Commit d1d64fc7 authored by 邓晓峰's avatar 邓晓峰

fix userRegistry

parent 83a32aad
...@@ -11,4 +11,4 @@ export default ({ children, ...rest }) => { ...@@ -11,4 +11,4 @@ export default ({ children, ...rest }) => {
<PreView {...rest}>{children}</PreView> <PreView {...rest}>{children}</PreView>
</LazyLoad> </LazyLoad>
); );
}; };
\ No newline at end of file
#root { #root {
& /deep/ { & /deep/ {
.__dumi-default-navbar-logo { .__dumi-default-navbar-logo {
padding-left: 86px!important; padding-left: 86px !important;
}
} }
} }
\ No newline at end of file }
...@@ -13,7 +13,6 @@ moment.locale('zh-cn'); ...@@ -13,7 +13,6 @@ moment.locale('zh-cn');
export default ({ children, ...props }) => { export default ({ children, ...props }) => {
useEffect(() => { useEffect(() => {
(function (h, o, t, j, a, r) { (function (h, o, t, j, a, r) {
h.hj = h.hj =
h.hj || h.hj ||
function () { function () {
...@@ -32,4 +31,4 @@ export default ({ children, ...props }) => { ...@@ -32,4 +31,4 @@ export default ({ children, ...props }) => {
<Layout {...props}>{children}</Layout> <Layout {...props}>{children}</Layout>
</ConfigProvider> </ConfigProvider>
); );
}; };
\ No newline at end of file
module.exports = { module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')], extends: [require.resolve('@umijs/fabric/dist/eslint')],
rules: { rules: {
'import/no-extraneous-dependencies': 0, 'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0, 'import/no-unresolved': 0,
}, },
}; };
\ No newline at end of file
...@@ -2,7 +2,7 @@ import { readdirSync } from 'fs'; ...@@ -2,7 +2,7 @@ import { readdirSync } from 'fs';
import { join } from 'path'; import { join } from 'path';
// utils must build before core // utils must build before core
const headPkgs = []; const headPkgs = [];
const tailPkgs = readdirSync(join(__dirname, 'packages')).filter( const tailPkgs = readdirSync(join(__dirname, 'packages')).filter(
(pkg) => pkg.charAt(0) !== '.' && !headPkgs.includes(pkg), (pkg) => pkg.charAt(0) !== '.' && !headPkgs.includes(pkg),
); );
...@@ -17,4 +17,4 @@ export default { ...@@ -17,4 +17,4 @@ export default {
extraBabelPlugins: [ extraBabelPlugins: [
['babel-plugin-import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'], ['babel-plugin-import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'],
], ],
}; };
\ No newline at end of file
...@@ -2,4 +2,4 @@ const fabric = require('@umijs/fabric'); ...@@ -2,4 +2,4 @@ const fabric = require('@umijs/fabric');
module.exports = { module.exports = {
...fabric.prettier, ...fabric.prettier,
}; };
\ No newline at end of file
...@@ -85,4 +85,4 @@ export default { ...@@ -85,4 +85,4 @@ export default {
'https://gw.alipayobjects.com/os/lib/antd/4.6.6/dist/antd-with-locales.js', 'https://gw.alipayobjects.com/os/lib/antd/4.6.6/dist/antd-with-locales.js',
] ]
: [], : [],
}; };
\ No newline at end of file
...@@ -11,6 +11,3 @@ nav: ...@@ -11,6 +11,3 @@ nav:
## 安装 ## 安装
当前 wisdom-components 每一个组件都是一个独立的包,你需要在你的项目中安装对应的 npm 包并使用。 当前 wisdom-components 每一个组件都是一个独立的包,你需要在你的项目中安装对应的 npm 包并使用。
...@@ -13,6 +13,5 @@ hero: ...@@ -13,6 +13,5 @@ hero:
## 组件看板 ## 组件看板
| 组件 | 下载量 | 版本 | | 组件 | 下载量 | 版本 |
| --- | --- | --- | | ---- | ------ | ---- |
...@@ -41,7 +41,6 @@ dataSource 用于存储从服务器请求的数据,为了优化体验,我们 ...@@ -41,7 +41,6 @@ dataSource 用于存储从服务器请求的数据,为了优化体验,我们
在实际开发中我们也经常会碰到一些设计问题,比如经典的按钮应该放在左面还是右面,查询表单怎么布局,日期怎么格式化,数字对齐问题,在重型组件中都进行了抽象。对于各种行为我们都经过了设计师的讨论与设计。默认好看并且好用。 在实际开发中我们也经常会碰到一些设计问题,比如经典的按钮应该放在左面还是右面,查询表单怎么布局,日期怎么格式化,数字对齐问题,在重型组件中都进行了抽象。对于各种行为我们都经过了设计师的讨论与设计。默认好看并且好用。
### 脚手架概览 ### 脚手架概览
当我们 clone 完项目之后我们会看到如下的目录结构。 当我们 clone 完项目之后我们会看到如下的目录结构。
......
...@@ -11,10 +11,7 @@ pkgList.forEach((shortName) => { ...@@ -11,10 +11,7 @@ pkgList.forEach((shortName) => {
}); });
module.exports = { module.exports = {
collectCoverageFrom: [ collectCoverageFrom: ['packages/**/src/**/*.{js}', '!packages/**/src/demos/**'],
'packages/**/src/**/*.{js}',
'!packages/**/src/demos/**',
],
moduleNameMapper, moduleNameMapper,
testURL: 'http://localhost', testURL: 'http://localhost',
verbose: true, verbose: true,
...@@ -23,4 +20,4 @@ module.exports = { ...@@ -23,4 +20,4 @@ module.exports = {
globals: { globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false, ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false,
}, },
}; };
\ No newline at end of file
{ {
"version": "independent", "version": "independent",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"changelog": { "changelog": {
"repo": "test/winsdom-components", "repo": "test/winsdom-components",
"cacheDir": ".changelog" "cacheDir": ".changelog"
}, },
"ignoreChanges": ["**/*.md", "**/*.test.js", "**/*.e2e.js", "**/fixtures/**", "**/test/**"] "ignoreChanges": ["**/*.md", "**/*.test.js", "**/*.e2e.js", "**/fixtures/**", "**/test/**"]
} }
\ No newline at end of file
console.log("hello world"); console.log('hello world');
\ No newline at end of file
...@@ -29,9 +29,7 @@ const { yParser } = require('@umijs/utils'); ...@@ -29,9 +29,7 @@ const { yParser } = require('@umijs/utils');
}, },
browserslist: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 11'], browserslist: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 11'],
keywords: ['antd', 'admin', 'ant-design', 'ant-design-pro'], keywords: ['antd', 'admin', 'ant-design', 'ant-design-pro'],
authors: [ authors: ['dengxiaofeng'],
'dengxiaofeng',
],
license: 'MIT', license: 'MIT',
bugs: 'http://github.com/umijs/plugins/issues', bugs: 'http://github.com/umijs/plugins/issues',
homepage: `https://g.civnet.cn:8443/test/winsdom-components/tree/master/packages/${shortName}#readme`, homepage: `https://g.civnet.cn:8443/test/winsdom-components/tree/master/packages/${shortName}#readme`,
...@@ -84,4 +82,4 @@ $ yarn add ${name} ...@@ -84,4 +82,4 @@ $ yarn add ${name}
); );
} }
}); });
})(); })();
\ No newline at end of file
...@@ -33,4 +33,4 @@ componentsNames = componentsNames.filter((dir) => ignoreDirPath.indexOf(dir) === ...@@ -33,4 +33,4 @@ componentsNames = componentsNames.filter((dir) => ignoreDirPath.indexOf(dir) ===
}); });
await writePkg(cwd, { ...json, 'size-limit': sizeLimitConfig }); await writePkg(cwd, { ...json, 'size-limit': sizeLimitConfig });
})(); })();
\ No newline at end of file
...@@ -14,4 +14,4 @@ module.exports = (publishPkgList) => { ...@@ -14,4 +14,4 @@ module.exports = (publishPkgList) => {
return subprocess; return subprocess;
}); });
Promise.all(commands); Promise.all(commands);
}; };
\ No newline at end of file
...@@ -15,4 +15,4 @@ module.exports = function exec(command, args, opts) { ...@@ -15,4 +15,4 @@ module.exports = function exec(command, args, opts) {
} }
}); });
}); });
}; };
\ No newline at end of file
...@@ -3,4 +3,4 @@ const { join } = require('path'); ...@@ -3,4 +3,4 @@ const { join } = require('path');
module.exports = function getPackages() { module.exports = function getPackages() {
return readdirSync(join(__dirname, '../../packages')).filter((pkg) => pkg.charAt(0) !== '.'); return readdirSync(join(__dirname, '../../packages')).filter((pkg) => pkg.charAt(0) !== '.');
}; };
\ No newline at end of file
module.exports = function (version) { module.exports = function (version) {
return version.includes('-rc.') || version.includes('-beta.') || version.includes('-alpha.'); return version.includes('-rc.') || version.includes('-beta.') || version.includes('-alpha.');
}; };
\ No newline at end of file
...@@ -21,4 +21,4 @@ ${chalk.green(`🎨 chore(compiler): do something`)}\n ...@@ -21,4 +21,4 @@ ${chalk.green(`🎨 chore(compiler): do something`)}\n
${chalk.red(`See .github/commit-convention.md for more details.\n`)}`, ${chalk.red(`See .github/commit-convention.md for more details.\n`)}`,
); );
process.exit(1); process.exit(1);
} }
\ No newline at end of file
export * from '../packages/card/src'; export * from '../packages/card/src';
\ No newline at end of file
...@@ -89,4 +89,4 @@ Math.random = () => 0.8404419276253765; ...@@ -89,4 +89,4 @@ Math.random = () => 0.8404419276253765;
fetch.mockResponse(async () => { fetch.mockResponse(async () => {
return { body: JSON.stringify(tableData) }; return { body: JSON.stringify(tableData) };
}); });
\ No newline at end of file
...@@ -19,4 +19,4 @@ export const resizeWindow = (x, y) => { ...@@ -19,4 +19,4 @@ export const resizeWindow = (x, y) => {
window.innerWidth = x; window.innerWidth = x;
window.innerHeight = y; window.innerHeight = y;
window.dispatchEvent(new Event('resize')); window.dispatchEvent(new Event('resize'));
}; };
\ No newline at end of file
...@@ -6,145 +6,145 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin'); ...@@ -6,145 +6,145 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const { readdirSync } = require('fs'); const { readdirSync } = require('fs');
const tailPkgs = readdirSync(path.join(__dirname, 'packages')).filter( const tailPkgs = readdirSync(path.join(__dirname, 'packages')).filter(
(pkg) => pkg.charAt(0) !== '.' (pkg) => pkg.charAt(0) !== '.',
); );
const webPackConfigList = []; const webPackConfigList = [];
tailPkgs.forEach((pkg) => { tailPkgs.forEach((pkg) => {
const entry = {}; const entry = {};
entry[`${pkg}`] = `./packages/${pkg}/src/index.js`; entry[`${pkg}`] = `./packages/${pkg}/src/index.js`;
entry[`${pkg}.min`] = `./packages/${pkg}/src/index.js`; entry[`${pkg}.min`] = `./packages/${pkg}/src/index.js`;
const config = { const config = {
entry, entry,
output: { output: {
filename: '[name].js', filename: '[name].js',
library: `WisDOM${pkg.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase())}`, library: `WisDOM${pkg.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase())}`,
libraryExport: 'default', libraryExport: 'default',
path: path.resolve(__dirname, 'packages', pkg, 'dist'), path: path.resolve(__dirname, 'packages', pkg, 'dist'),
globalObject: 'this' globalObject: 'this',
}, },
mode: 'production', mode: 'production',
resolve: { resolve: {
extensions: ['.json', '.css', '.js', '.less'], extensions: ['.json', '.css', '.js', '.less'],
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
include: /\.min\.js$/,
}),
new OptimizeCSSAssetsPlugin({
include: /\.min\.js$/,
}),
],
},
module: {
rules: [
{
test: /\.(png|jpg|gif|svg)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
}, },
optimization: { {
minimize: true, test: /\.jsx?$/,
minimizer: [ use: {
new TerserPlugin({ loader: 'babel-loader',
include: /\.min\.js$/, options: {
}), presets: ['@babel/typescript', '@babel/env', '@babel/react'],
new OptimizeCSSAssetsPlugin({ plugins: [
include: /\.min\.js$/, ['@babel/plugin-proposal-decorators', { legacy: true }],
}), ['@babel/plugin-proposal-class-properties', { loose: true }],
], '@babel/proposal-object-rest-spread',
],
},
},
}, },
module: { {
rules: [ test: /\.tsx?$/,
{ exclude: /(node_modules|bower_components)/,
test: /\.(png|jpg|gif|svg)$/i, use: {
use: [ loader: 'babel-loader',
options: {
presets: [
'@babel/typescript',
[
'@babel/env',
{ {
loader: 'url-loader', loose: true,
options: { modules: false,
limit: 8192,
},
}, },
], ],
'@babel/react',
],
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/proposal-object-rest-spread',
],
},
},
},
{
test: /\.css$/,
use: [
{
loader: 'style-loader', // creates style nodes from JS strings
},
{
loader: 'css-loader', // translates CSS into CommonJS
},
],
},
{
test: /\.less$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: (resourcePath, context) =>
`${path.relative(path.dirname(resourcePath), context)}/`,
}, },
{ },
test: /\.jsx?$/, {
use: { loader: 'css-loader', // translates CSS into CommonJS
loader: 'babel-loader', },
options: { {
presets: ['@babel/typescript', '@babel/env', '@babel/react'], loader: 'less-loader',
plugins: [ options: {
['@babel/plugin-proposal-decorators', { legacy: true }], lessOptions: {
['@babel/plugin-proposal-class-properties', { loose: true }], javascriptEnabled: true,
'@babel/proposal-object-rest-spread',
],
},
},
},
{
test: /\.tsx?$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
'@babel/typescript',
[
'@babel/env',
{
loose: true,
modules: false,
},
],
'@babel/react',
],
plugins: [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/proposal-object-rest-spread',
],
},
}, },
}, },
{ },
test: /\.css$/, ],
use: [
{
loader: 'style-loader', // creates style nodes from JS strings
},
{
loader: 'css-loader', // translates CSS into CommonJS
},
],
},
{
test: /\.less$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: (resourcePath, context) =>
`${path.relative(path.dirname(resourcePath), context)}/`,
},
},
{
loader: 'css-loader', // translates CSS into CommonJS
},
{
loader: 'less-loader',
options: {
lessOptions: {
javascriptEnabled: true,
},
},
},
],
},
],
}, },
externals: [ ],
{ },
react: 'React', externals: [
'react-dom': 'ReactDOM', {
antd: 'antd', react: 'React',
moment: 'moment', 'react-dom': 'ReactDOM',
}, antd: 'antd',
], moment: 'moment',
plugins: [ },
new ProgressBarPlugin(), ],
new MiniCssExtractPlugin({ plugins: [
filename: '[name].css', new ProgressBarPlugin(),
chunkFilename: '[id].css', new MiniCssExtractPlugin({
}), filename: '[name].css',
] chunkFilename: '[id].css',
}; }),
webPackConfigList.push(config); ],
};
webPackConfigList.push(config);
}); });
module.exports = webPackConfigList; module.exports = webPackConfigList;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment