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

fix userRegistry

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