jjb-cmd 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/LICENSE +21 -21
- package/bin/command.js +47 -0
- package/package.json +1 -1
- package/src/new/cmd.init.copy/lib/package.json +62 -62
- package/src/new/cmd.init.copy/lib/webstorm.config.js +16 -16
- package/src/new/cmd.init.copy/micro-app/jjb.config.json +12 -16
- package/src/new/cmd.init.copy/micro-app/jjb.script/build.js +8 -7
- package/src/new/cmd.init.copy/micro-app/jjb.script/config.js +9 -7
- package/src/new/cmd.init.copy/micro-app/package.json +3 -3
- package/src/new/cmd.init.copy/micro-app/public/index.html +17 -27
- package/src/new/cmd.init.copy/micro-app/src/enumerate/namespace/index.js +1 -3
- package/src/new/cmd.init.copy/micro-app/src/index.js +1 -2
- package/src/new/cmd.init.copy/micro-app/src/pages/index.js +10 -6
- package/src/new/cmd.init.copy/micro-app-ts/webstorm.config.js +16 -16
- package/src/new/cmd.init.copy/react-component/webstorm.config.js +16 -16
- package/src/old/cli.init/package.json +65 -65
- package/src/old/cli.init/src/enumerate/namespace/index.js +3 -3
- package/src/old/cli.init/src/models/main/index.js +31 -31
- package/src/old/cli.init/webstorm.config.js +18 -18
- package/src/new/cmd.init.copy/micro-app/src/api/home/index.js +0 -1
package/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2022 jjb-front-team <https://www.cqjjb.cn>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 jjb-front-team <https://www.cqjjb.cn>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/bin/command.js
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
#! /usr/bin/env node
|
2
2
|
|
3
3
|
const commander = require('commander');
|
4
|
+
const readline = require('readline');
|
5
|
+
const path = require('path');
|
6
|
+
const fs = require('fs');
|
7
|
+
const child_process = require('child_process');
|
4
8
|
|
5
9
|
commander.command('v').description('-- 查看版本').action(() => {
|
6
10
|
console.log('当前版本 v2.0.0');
|
@@ -11,6 +15,49 @@ commander.command('view res').description('-- 预览资源').action(() => {
|
|
11
15
|
console.log('[common, react-admin-component]');
|
12
16
|
});
|
13
17
|
|
18
|
+
commander.command('link').option('-A').description('-- 创建符号链接').action(args => {
|
19
|
+
let dirList = [];
|
20
|
+
const hasFlag = args.A;
|
21
|
+
const root_path = path.resolve('./');
|
22
|
+
let r1 = readline.createInterface({
|
23
|
+
input: process.stdin,
|
24
|
+
output: process.stdout
|
25
|
+
});
|
26
|
+
r1.question('Target Path:', function (answer) {
|
27
|
+
const arr = answer.split('\\');
|
28
|
+
const name = arr.length
|
29
|
+
? arr[ arr.length - 1 ]
|
30
|
+
: '';
|
31
|
+
if (hasFlag) {
|
32
|
+
dirList = dirList.concat(fs.readdirSync(root_path).map(dir => {
|
33
|
+
return `${root_path}\\${dir}`;
|
34
|
+
}).filter(dir => fs.statSync(dir).isDirectory()).map(dir => {
|
35
|
+
return {
|
36
|
+
dir: dir + '\\' + name,
|
37
|
+
link: answer
|
38
|
+
};
|
39
|
+
}));
|
40
|
+
} else {
|
41
|
+
dirList = dirList.concat(root_path).map(dir => {
|
42
|
+
return {
|
43
|
+
dir: dir + '\\' + name,
|
44
|
+
link: answer
|
45
|
+
};
|
46
|
+
});
|
47
|
+
}
|
48
|
+
dirList.forEach(item => {
|
49
|
+
child_process.execSync(`mklink /D ${item.dir} ${item.link}`, (error, stdout) => {
|
50
|
+
if (!error) {
|
51
|
+
console.log(stdout);
|
52
|
+
}
|
53
|
+
});
|
54
|
+
});
|
55
|
+
console.log('执行完成。');
|
56
|
+
process.exit(0);
|
57
|
+
});
|
58
|
+
r1.on('close', () => process.exit(0));
|
59
|
+
});
|
60
|
+
|
14
61
|
// publish 命令
|
15
62
|
commander.command('push [args]').description('-- 发布包').action(args => {
|
16
63
|
if (args) {
|
package/package.json
CHANGED
@@ -1,62 +1,62 @@
|
|
1
|
-
{
|
2
|
-
"name": "lib",
|
3
|
-
"version": "1.0.0",
|
4
|
-
"description": "工具库模板",
|
5
|
-
"main": "index.js",
|
6
|
-
"scripts": {
|
7
|
-
"serve": "node jjb.script/server.js",
|
8
|
-
"build": "node jjb.script/build.js",
|
9
|
-
"serve:development": "cross-env NODE_ENV=development npm run serve",
|
10
|
-
"serve:test": "cross-env NODE_ENV=test npm run serve",
|
11
|
-
"serve:release": "cross-env NODE_ENV=release npm run serve",
|
12
|
-
"serve:production": "cross-env NODE_ENV=production npm run serve",
|
13
|
-
"build:development": "cross-env NODE_ENV=development npm run build",
|
14
|
-
"build:test": "cross-env NODE_ENV=test npm run build",
|
15
|
-
"build:release": "cross-env NODE_ENV=release npm run build",
|
16
|
-
"build:production": "cross-env NODE_ENV=production npm run build",
|
17
|
-
"jjb-cmd:install": "jjb-cmd install"
|
18
|
-
},
|
19
|
-
"author": "JJB",
|
20
|
-
"license": "MIT",
|
21
|
-
"devDependencies": {
|
22
|
-
"@babel/core": "^7.19.3",
|
23
|
-
"@babel/plugin-proposal-decorators": "^7.19.3",
|
24
|
-
"@babel/preset-react": "^7.18.6",
|
25
|
-
"babel-loader": "^8.2.5",
|
26
|
-
"babel-plugin-import": "^1.13.5",
|
27
|
-
"clean-webpack-plugin": "^4.0.0",
|
28
|
-
"connect-history-api-fallback": "^2.0.0",
|
29
|
-
"cross-env": "^7.0.3",
|
30
|
-
"css-loader": "^6.7.1",
|
31
|
-
"css-minimizer-webpack-plugin": "^4.2.1",
|
32
|
-
"express": "^4.18.2",
|
33
|
-
"file-loader": "^6.2.0",
|
34
|
-
"html-webpack-plugin": "^5.5.0",
|
35
|
-
"less": "^4.1.3",
|
36
|
-
"less-loader": "^11.1.0",
|
37
|
-
"mini-css-extract-plugin": "^2.6.1",
|
38
|
-
"style-loader": "^3.3.1",
|
39
|
-
"terser-webpack-plugin": "^5.3.6",
|
40
|
-
"uglifyjs-webpack-plugin": "^2.2.0",
|
41
|
-
"url-loader": "^4.1.1",
|
42
|
-
"webpack": "^5.74.0",
|
43
|
-
"webpack-bundle-analyzer": "^4.6.1",
|
44
|
-
"webpack-cli": "^4.10.0",
|
45
|
-
"webpack-dev-server": "^4.11.1"
|
46
|
-
},
|
47
|
-
"dependencies": {
|
48
|
-
"@ant-design/icons": "^4.7.0",
|
49
|
-
"antd": "^4.23.5",
|
50
|
-
"axios": "^1.1.2",
|
51
|
-
"crypto-js": "^4.1.1",
|
52
|
-
"dva": "^2.6.0-beta.22",
|
53
|
-
"history": "^5.3.0",
|
54
|
-
"moment": "^2.29.4",
|
55
|
-
"prop-types": "^15.8.1",
|
56
|
-
"react": "^17.0.2",
|
57
|
-
"react-cropper": "^2.1.8",
|
58
|
-
"react-dom": "^17.0.2",
|
59
|
-
"react-router-dom": "^5.2.0",
|
60
|
-
"watch-props": "^0.0.3"
|
61
|
-
}
|
62
|
-
}
|
1
|
+
{
|
2
|
+
"name": "lib",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "工具库模板",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"serve": "node jjb.script/server.js",
|
8
|
+
"build": "node jjb.script/build.js",
|
9
|
+
"serve:development": "cross-env NODE_ENV=development npm run serve",
|
10
|
+
"serve:test": "cross-env NODE_ENV=test npm run serve",
|
11
|
+
"serve:release": "cross-env NODE_ENV=release npm run serve",
|
12
|
+
"serve:production": "cross-env NODE_ENV=production npm run serve",
|
13
|
+
"build:development": "cross-env NODE_ENV=development npm run build",
|
14
|
+
"build:test": "cross-env NODE_ENV=test npm run build",
|
15
|
+
"build:release": "cross-env NODE_ENV=release npm run build",
|
16
|
+
"build:production": "cross-env NODE_ENV=production npm run build",
|
17
|
+
"jjb-cmd:install": "jjb-cmd install"
|
18
|
+
},
|
19
|
+
"author": "JJB",
|
20
|
+
"license": "MIT",
|
21
|
+
"devDependencies": {
|
22
|
+
"@babel/core": "^7.19.3",
|
23
|
+
"@babel/plugin-proposal-decorators": "^7.19.3",
|
24
|
+
"@babel/preset-react": "^7.18.6",
|
25
|
+
"babel-loader": "^8.2.5",
|
26
|
+
"babel-plugin-import": "^1.13.5",
|
27
|
+
"clean-webpack-plugin": "^4.0.0",
|
28
|
+
"connect-history-api-fallback": "^2.0.0",
|
29
|
+
"cross-env": "^7.0.3",
|
30
|
+
"css-loader": "^6.7.1",
|
31
|
+
"css-minimizer-webpack-plugin": "^4.2.1",
|
32
|
+
"express": "^4.18.2",
|
33
|
+
"file-loader": "^6.2.0",
|
34
|
+
"html-webpack-plugin": "^5.5.0",
|
35
|
+
"less": "^4.1.3",
|
36
|
+
"less-loader": "^11.1.0",
|
37
|
+
"mini-css-extract-plugin": "^2.6.1",
|
38
|
+
"style-loader": "^3.3.1",
|
39
|
+
"terser-webpack-plugin": "^5.3.6",
|
40
|
+
"uglifyjs-webpack-plugin": "^2.2.0",
|
41
|
+
"url-loader": "^4.1.1",
|
42
|
+
"webpack": "^5.74.0",
|
43
|
+
"webpack-bundle-analyzer": "^4.6.1",
|
44
|
+
"webpack-cli": "^4.10.0",
|
45
|
+
"webpack-dev-server": "^4.11.1"
|
46
|
+
},
|
47
|
+
"dependencies": {
|
48
|
+
"@ant-design/icons": "^4.7.0",
|
49
|
+
"antd": "^4.23.5",
|
50
|
+
"axios": "^1.1.2",
|
51
|
+
"crypto-js": "^4.1.1",
|
52
|
+
"dva": "^2.6.0-beta.22",
|
53
|
+
"history": "^5.3.0",
|
54
|
+
"moment": "^2.29.4",
|
55
|
+
"prop-types": "^15.8.1",
|
56
|
+
"react": "^17.0.2",
|
57
|
+
"react-cropper": "^2.1.8",
|
58
|
+
"react-dom": "^17.0.2",
|
59
|
+
"react-router-dom": "^5.2.0",
|
60
|
+
"watch-props": "^0.0.3"
|
61
|
+
}
|
62
|
+
}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
'use strict';
|
2
|
-
const path = require('path');
|
3
|
-
|
4
|
-
function resolve (dir) {
|
5
|
-
return path.join(__dirname, '.', dir);
|
6
|
-
}
|
7
|
-
|
8
|
-
module.exports = {
|
9
|
-
context: path.resolve(__dirname, './'),
|
10
|
-
resolve: {
|
11
|
-
extensions: [ '.js' ],
|
12
|
-
alias: {
|
13
|
-
'~': resolve('src/')
|
14
|
-
}
|
15
|
-
}
|
16
|
-
};
|
1
|
+
'use strict';
|
2
|
+
const path = require('path');
|
3
|
+
|
4
|
+
function resolve (dir) {
|
5
|
+
return path.join(__dirname, '.', dir);
|
6
|
+
}
|
7
|
+
|
8
|
+
module.exports = {
|
9
|
+
context: path.resolve(__dirname, './'),
|
10
|
+
resolve: {
|
11
|
+
extensions: [ '.js' ],
|
12
|
+
alias: {
|
13
|
+
'~': resolve('src/')
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -1,35 +1,31 @@
|
|
1
1
|
{
|
2
|
-
"projectType": "micro-spa",
|
3
|
-
"installTarget": "node_modules",
|
4
|
-
"installResources": [
|
5
|
-
"jjb-dva-runtime",
|
6
|
-
"jjb-common-lib",
|
7
|
-
"jjb-common-decorator",
|
8
|
-
"react-admin-component"
|
9
|
-
],
|
10
2
|
"environment": {
|
11
3
|
"development": {
|
12
|
-
"API_HOST": ""
|
13
4
|
},
|
14
5
|
"test": {
|
15
|
-
"API_HOST": ""
|
16
6
|
},
|
17
7
|
"release": {
|
18
|
-
"API_HOST": ""
|
19
8
|
},
|
20
9
|
"production": {
|
21
|
-
"API_HOST": ""
|
22
10
|
}
|
23
11
|
},
|
24
12
|
"contextInject": {
|
25
|
-
"basename": "/"
|
13
|
+
"basename": "/micro-app"
|
26
14
|
},
|
27
15
|
"windowInject": {
|
28
|
-
"title": "
|
29
|
-
"
|
16
|
+
"title": "微应用模板",
|
17
|
+
"links": [],
|
18
|
+
"element": {
|
19
|
+
"root": {
|
20
|
+
"id": "root"
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"scripts": [
|
24
|
+
"https://cdn.cqjjb.cn/jjb-common-lib/latest/index.js"
|
25
|
+
]
|
30
26
|
},
|
31
27
|
"server": {
|
32
|
-
"port": "
|
28
|
+
"port": "6005",
|
33
29
|
"host": "127.0.0.1"
|
34
30
|
},
|
35
31
|
"framework": {
|
@@ -1,14 +1,15 @@
|
|
1
|
+
const ora = require('ora');
|
1
2
|
const { hasEnvironment } = require('./utils');
|
2
3
|
|
3
|
-
|
4
|
+
const spinner = ora('项目正在打包中...').start();
|
5
|
+
|
6
|
+
if (!hasEnvironment()) {
|
4
7
|
throw Error('jjb.script[build]: 启动build需要提供NODE_ENV变量,请确认你所运行的脚本是否正确?');
|
5
8
|
}
|
6
9
|
|
7
|
-
require('webpack')(require('./config')('production').webpack).run(
|
8
|
-
if (
|
9
|
-
|
10
|
-
|
11
|
-
console.log('项目Build失败,发现以下问题,请解决后重试!');
|
12
|
-
console.log(compiler.compilation.errors);
|
10
|
+
require('webpack')(require('./config')('production').webpack).run(err => {
|
11
|
+
if (!err) {
|
12
|
+
spinner.stop();
|
13
|
+
console.log('项目打包完成!');
|
13
14
|
}
|
14
15
|
});
|
@@ -74,7 +74,9 @@ module.exports = mode => {
|
|
74
74
|
// ‘less-loader’特殊配置
|
75
75
|
lessOptions: {
|
76
76
|
// 定义‘less’全局变量,从jjb.config.antd获取
|
77
|
-
modifyVars:
|
77
|
+
modifyVars: {
|
78
|
+
...((framework || {}).antd || {})
|
79
|
+
},
|
78
80
|
// 启用‘less-javascript’功能
|
79
81
|
javascriptEnabled: true
|
80
82
|
}
|
@@ -109,7 +111,7 @@ module.exports = mode => {
|
|
109
111
|
libraryName: 'antd',
|
110
112
|
// 按需将‘es’文件夹中组件导出,绑定到‘antd’变量
|
111
113
|
// 除了‘es’,也可以修改为‘lib’
|
112
|
-
libraryDirectory: '
|
114
|
+
libraryDirectory: 'lib',
|
113
115
|
// 这里设为‘true’,表示自动导入‘antd/dist/less’
|
114
116
|
// 或修改为‘css’ | ‘less’
|
115
117
|
style: true
|
@@ -202,15 +204,15 @@ module.exports = mode => {
|
|
202
204
|
// 分离范围‘all’即所有
|
203
205
|
chunks: 'all',
|
204
206
|
// 分离大小范围0
|
205
|
-
minSize:
|
207
|
+
minSize: 30000,
|
206
208
|
// 分离大小范围100000
|
207
|
-
maxSize: 100000,
|
209
|
+
// maxSize: 100000,
|
208
210
|
// 同一个区块被调用两次,需要分离
|
209
|
-
minChunks:
|
211
|
+
minChunks: 1,
|
210
212
|
// 最大异步请求区块
|
211
|
-
maxAsyncRequests:
|
213
|
+
// maxAsyncRequests: 5,
|
212
214
|
// 最大初始化请求区块
|
213
|
-
maxInitialRequests:
|
215
|
+
maxInitialRequests: 5
|
214
216
|
}
|
215
217
|
}
|
216
218
|
: {}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"name": "
|
2
|
+
"name": "demo-app",
|
3
3
|
"version": "1.0.0",
|
4
4
|
"description": "建教帮微应用模板",
|
5
5
|
"main": "index.js",
|
@@ -39,6 +39,7 @@
|
|
39
39
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
40
40
|
"url-loader": "^4.1.1",
|
41
41
|
"webpack": "^5.74.0",
|
42
|
+
"ora": "^2.1.0",
|
42
43
|
"webpack-bundle-analyzer": "^4.6.1",
|
43
44
|
"webpack-cli": "^4.10.0",
|
44
45
|
"webpack-dev-server": "^4.11.1"
|
@@ -50,14 +51,13 @@
|
|
50
51
|
"axios": "^1.1.2",
|
51
52
|
"crypto-js": "^4.1.1",
|
52
53
|
"dva": "^2.6.0-beta.22",
|
53
|
-
"echarts": "^5.4.0",
|
54
54
|
"history": "^5.3.0",
|
55
55
|
"jjb-common-decorator": "latest",
|
56
56
|
"jjb-common-lib-types": "latest",
|
57
57
|
"jjb-dva-runtime": "latest",
|
58
58
|
"jjb-react-admin-component": "latest",
|
59
59
|
"moment": "^2.29.4",
|
60
|
-
"object-field-resolve": "^1.0.
|
60
|
+
"object-field-resolve": "^1.0.4",
|
61
61
|
"prop-types": "^15.8.1",
|
62
62
|
"qiankun": "^2.8.3",
|
63
63
|
"react": "^17.0.2",
|
@@ -2,34 +2,24 @@
|
|
2
2
|
<html lang="zh">
|
3
3
|
<head>
|
4
4
|
<meta charset="UTF-8">
|
5
|
-
<meta
|
6
|
-
|
7
|
-
|
8
|
-
>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<script>
|
19
|
-
window.__JJB_ENVIRONMENT__ = {
|
20
|
-
API_HOST: '<%= htmlWebpackPlugin.options.API_HOST %>',
|
21
|
-
FRAMEWORK: JSON.parse('<%= JSON.stringify(htmlWebpackPlugin.options.framework.antd) %>')
|
22
|
-
};
|
23
|
-
</script>
|
24
|
-
<script src="<%= htmlWebpackPlugin.options.jjbCommonLibUrl %>"></script>
|
5
|
+
<meta name="renderer" content="webkit">
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
|
7
|
+
<!-- TITLE -->
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
9
|
+
<!-- LINKS -->
|
10
|
+
<% for (const item of htmlWebpackPlugin.options.links) { %>
|
11
|
+
<link type="text/css" rel="stylesheet" href="<%=item%>"></link>
|
12
|
+
<% } %>
|
13
|
+
<script>window.__JJB_ENVIRONMENT__ = { API_HOST: '<%= htmlWebpackPlugin.options.API_HOST %>' };</script>
|
14
|
+
<!-- SCRIPTS -->
|
15
|
+
<% for (const item of htmlWebpackPlugin.options.scripts) { %>
|
16
|
+
<script src="<%=item%>" type="text/javascript"></script>
|
17
|
+
<% } %>
|
25
18
|
</head>
|
26
19
|
<body>
|
27
|
-
<noscript>
|
28
|
-
|
29
|
-
|
30
|
-
<div
|
31
|
-
id="root"
|
32
|
-
style="width: 100%; height: 100%; position: relative"
|
33
|
-
></div>
|
20
|
+
<noscript>此网页需要开启JavaScript功能。</noscript>
|
21
|
+
<% const { element } = htmlWebpackPlugin.options; %>
|
22
|
+
<% const { root } = element; %>
|
23
|
+
<div id="<%=root.id%>" style="width: 100%; height: 100%; position: relative"></div>
|
34
24
|
</body>
|
35
25
|
</html>
|
@@ -1,9 +1,13 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
|
3
|
-
export default
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
export default class App extends React.Component {
|
4
|
+
render () {
|
5
|
+
return (
|
6
|
+
<div style={{ marginTop: 40 }}>
|
7
|
+
<div style={{ textAlign: 'center' }}>
|
8
|
+
<h1>Hello World</h1>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
);
|
12
|
+
}
|
9
13
|
}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
'use strict';
|
2
|
-
const path = require('path');
|
3
|
-
|
4
|
-
function resolve (dir) {
|
5
|
-
return path.join(__dirname, '.', dir);
|
6
|
-
}
|
7
|
-
|
8
|
-
module.exports = {
|
9
|
-
context: path.resolve(__dirname, './'),
|
10
|
-
resolve: {
|
11
|
-
extensions: [ '.js' ],
|
12
|
-
alias: {
|
13
|
-
'~': resolve('src/')
|
14
|
-
}
|
15
|
-
}
|
16
|
-
};
|
1
|
+
'use strict';
|
2
|
+
const path = require('path');
|
3
|
+
|
4
|
+
function resolve (dir) {
|
5
|
+
return path.join(__dirname, '.', dir);
|
6
|
+
}
|
7
|
+
|
8
|
+
module.exports = {
|
9
|
+
context: path.resolve(__dirname, './'),
|
10
|
+
resolve: {
|
11
|
+
extensions: [ '.js' ],
|
12
|
+
alias: {
|
13
|
+
'~': resolve('src/')
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -1,16 +1,16 @@
|
|
1
|
-
'use strict';
|
2
|
-
const path = require('path');
|
3
|
-
|
4
|
-
function resolve (dir) {
|
5
|
-
return path.join(__dirname, '.', dir);
|
6
|
-
}
|
7
|
-
|
8
|
-
module.exports = {
|
9
|
-
context: path.resolve(__dirname, './'),
|
10
|
-
resolve: {
|
11
|
-
extensions: [ '.js' ],
|
12
|
-
alias: {
|
13
|
-
'~': resolve('src/')
|
14
|
-
}
|
15
|
-
}
|
16
|
-
};
|
1
|
+
'use strict';
|
2
|
+
const path = require('path');
|
3
|
+
|
4
|
+
function resolve (dir) {
|
5
|
+
return path.join(__dirname, '.', dir);
|
6
|
+
}
|
7
|
+
|
8
|
+
module.exports = {
|
9
|
+
context: path.resolve(__dirname, './'),
|
10
|
+
resolve: {
|
11
|
+
extensions: [ '.js' ],
|
12
|
+
alias: {
|
13
|
+
'~': resolve('src/')
|
14
|
+
}
|
15
|
+
}
|
16
|
+
};
|
@@ -1,65 +1,65 @@
|
|
1
|
-
{
|
2
|
-
"name": "jjbMicroApp",
|
3
|
-
"version": "1.0.0",
|
4
|
-
"description": "jjb-micro-app",
|
5
|
-
"main": "index.js",
|
6
|
-
"scripts": {
|
7
|
-
"serve": "node jjb.script/server.js",
|
8
|
-
"build": "node jjb.script/build.js",
|
9
|
-
"serve:development": "cross-env NODE_ENV=development npm run serve",
|
10
|
-
"serve:test": "cross-env NODE_ENV=test npm run serve",
|
11
|
-
"serve:release": "cross-env NODE_ENV=release npm run serve",
|
12
|
-
"serve:production": "cross-env NODE_ENV=production npm run serve",
|
13
|
-
"build:development": "cross-env NODE_ENV=development npm run build",
|
14
|
-
"build:test": "cross-env NODE_ENV=test npm run build",
|
15
|
-
"build:release": "cross-env NODE_ENV=release npm run build",
|
16
|
-
"build:production": "cross-env NODE_ENV=production npm run build",
|
17
|
-
"jjb-cmd:install": "jjb-cmd install"
|
18
|
-
},
|
19
|
-
"author": "XiWell",
|
20
|
-
"license": "MIT",
|
21
|
-
"devDependencies": {
|
22
|
-
"@babel/core": "^7.19.3",
|
23
|
-
"@babel/plugin-proposal-decorators": "^7.19.3",
|
24
|
-
"@babel/preset-react": "^7.18.6",
|
25
|
-
"babel-loader": "^8.2.5",
|
26
|
-
"babel-plugin-import": "^1.13.5",
|
27
|
-
"clean-webpack-plugin": "^4.0.0",
|
28
|
-
"connect-history-api-fallback": "^2.0.0",
|
29
|
-
"cross-env": "^7.0.3",
|
30
|
-
"css-loader": "^6.7.1",
|
31
|
-
"css-minimizer-webpack-plugin": "^4.2.1",
|
32
|
-
"express": "^4.18.2",
|
33
|
-
"file-loader": "^6.2.0",
|
34
|
-
"html-webpack-plugin": "^5.5.0",
|
35
|
-
"less": "^4.1.3",
|
36
|
-
"less-loader": "^11.1.0",
|
37
|
-
"mini-css-extract-plugin": "^2.6.1",
|
38
|
-
"style-loader": "^3.3.1",
|
39
|
-
"terser-webpack-plugin": "^5.3.6",
|
40
|
-
"uglifyjs-webpack-plugin": "^2.2.0",
|
41
|
-
"url-loader": "^4.1.1",
|
42
|
-
"webpack": "^5.74.0",
|
43
|
-
"webpack-bundle-analyzer": "^4.6.1",
|
44
|
-
"webpack-cli": "^4.10.0",
|
45
|
-
"webpack-dev-server": "^4.11.1"
|
46
|
-
},
|
47
|
-
"dependencies": {
|
48
|
-
"@ant-design/icons": "^4.7.0",
|
49
|
-
"antd": "^4.23.5",
|
50
|
-
"axios": "^1.1.2",
|
51
|
-
"crypto-js": "^4.1.1",
|
52
|
-
"dva": "^2.6.0-beta.22",
|
53
|
-
"history": "^5.3.0",
|
54
|
-
"moment": "^2.29.4",
|
55
|
-
"prop-types": "^15.8.1",
|
56
|
-
"qiankun": "^2.8.3",
|
57
|
-
"react": "^17.0.2",
|
58
|
-
"react-cropper": "^2.1.8",
|
59
|
-
"react-dom": "^17.0.2",
|
60
|
-
"react-router-dom": "^5.2.0",
|
61
|
-
"watch-props": "^0.0.3",
|
62
|
-
"jjb-dva-runtime": "1.0.0",
|
63
|
-
"jjb-common-decorator": "1.0.0"
|
64
|
-
}
|
65
|
-
}
|
1
|
+
{
|
2
|
+
"name": "jjbMicroApp",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "jjb-micro-app",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"serve": "node jjb.script/server.js",
|
8
|
+
"build": "node jjb.script/build.js",
|
9
|
+
"serve:development": "cross-env NODE_ENV=development npm run serve",
|
10
|
+
"serve:test": "cross-env NODE_ENV=test npm run serve",
|
11
|
+
"serve:release": "cross-env NODE_ENV=release npm run serve",
|
12
|
+
"serve:production": "cross-env NODE_ENV=production npm run serve",
|
13
|
+
"build:development": "cross-env NODE_ENV=development npm run build",
|
14
|
+
"build:test": "cross-env NODE_ENV=test npm run build",
|
15
|
+
"build:release": "cross-env NODE_ENV=release npm run build",
|
16
|
+
"build:production": "cross-env NODE_ENV=production npm run build",
|
17
|
+
"jjb-cmd:install": "jjb-cmd install"
|
18
|
+
},
|
19
|
+
"author": "XiWell",
|
20
|
+
"license": "MIT",
|
21
|
+
"devDependencies": {
|
22
|
+
"@babel/core": "^7.19.3",
|
23
|
+
"@babel/plugin-proposal-decorators": "^7.19.3",
|
24
|
+
"@babel/preset-react": "^7.18.6",
|
25
|
+
"babel-loader": "^8.2.5",
|
26
|
+
"babel-plugin-import": "^1.13.5",
|
27
|
+
"clean-webpack-plugin": "^4.0.0",
|
28
|
+
"connect-history-api-fallback": "^2.0.0",
|
29
|
+
"cross-env": "^7.0.3",
|
30
|
+
"css-loader": "^6.7.1",
|
31
|
+
"css-minimizer-webpack-plugin": "^4.2.1",
|
32
|
+
"express": "^4.18.2",
|
33
|
+
"file-loader": "^6.2.0",
|
34
|
+
"html-webpack-plugin": "^5.5.0",
|
35
|
+
"less": "^4.1.3",
|
36
|
+
"less-loader": "^11.1.0",
|
37
|
+
"mini-css-extract-plugin": "^2.6.1",
|
38
|
+
"style-loader": "^3.3.1",
|
39
|
+
"terser-webpack-plugin": "^5.3.6",
|
40
|
+
"uglifyjs-webpack-plugin": "^2.2.0",
|
41
|
+
"url-loader": "^4.1.1",
|
42
|
+
"webpack": "^5.74.0",
|
43
|
+
"webpack-bundle-analyzer": "^4.6.1",
|
44
|
+
"webpack-cli": "^4.10.0",
|
45
|
+
"webpack-dev-server": "^4.11.1"
|
46
|
+
},
|
47
|
+
"dependencies": {
|
48
|
+
"@ant-design/icons": "^4.7.0",
|
49
|
+
"antd": "^4.23.5",
|
50
|
+
"axios": "^1.1.2",
|
51
|
+
"crypto-js": "^4.1.1",
|
52
|
+
"dva": "^2.6.0-beta.22",
|
53
|
+
"history": "^5.3.0",
|
54
|
+
"moment": "^2.29.4",
|
55
|
+
"prop-types": "^15.8.1",
|
56
|
+
"qiankun": "^2.8.3",
|
57
|
+
"react": "^17.0.2",
|
58
|
+
"react-cropper": "^2.1.8",
|
59
|
+
"react-dom": "^17.0.2",
|
60
|
+
"react-router-dom": "^5.2.0",
|
61
|
+
"watch-props": "^0.0.3",
|
62
|
+
"jjb-dva-runtime": "1.0.0",
|
63
|
+
"jjb-common-decorator": "1.0.0"
|
64
|
+
}
|
65
|
+
}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { defineNamespace } from 'jjb-dva-runtime';
|
2
|
-
|
3
|
-
export const NS_MAIN = defineNamespace('main');
|
1
|
+
import { defineNamespace } from 'jjb-dva-runtime';
|
2
|
+
|
3
|
+
export const NS_MAIN = defineNamespace('main');
|
@@ -1,31 +1,31 @@
|
|
1
|
-
import { NS_MAIN } from '~/enumerate/namespace';
|
2
|
-
import { registerModelNew } from 'jjb-dva-runtime';
|
3
|
-
import { GetBaseApplicationConfig } from '~/api/main';
|
4
|
-
|
5
|
-
export default registerModelNew(NS_MAIN, {
|
6
|
-
state: {
|
7
|
-
loading: false
|
8
|
-
},
|
9
|
-
effects: {
|
10
|
-
/**
|
11
|
-
* @return {Promise<{IResponse}>}
|
12
|
-
*/
|
13
|
-
getBaseApplicationConfigAction: () => [
|
14
|
-
'loading',
|
15
|
-
GetBaseApplicationConfig,
|
16
|
-
({
|
17
|
-
tabs = {},
|
18
|
-
aside = {},
|
19
|
-
header = {},
|
20
|
-
content = {}
|
21
|
-
}) => ({
|
22
|
-
baseApplicationConfig: {
|
23
|
-
tabs,
|
24
|
-
aside,
|
25
|
-
header,
|
26
|
-
content
|
27
|
-
}
|
28
|
-
})
|
29
|
-
]
|
30
|
-
}
|
31
|
-
});
|
1
|
+
import { NS_MAIN } from '~/enumerate/namespace';
|
2
|
+
import { registerModelNew } from 'jjb-dva-runtime';
|
3
|
+
import { GetBaseApplicationConfig } from '~/api/main';
|
4
|
+
|
5
|
+
export default registerModelNew(NS_MAIN, {
|
6
|
+
state: {
|
7
|
+
loading: false
|
8
|
+
},
|
9
|
+
effects: {
|
10
|
+
/**
|
11
|
+
* @return {Promise<{IResponse}>}
|
12
|
+
*/
|
13
|
+
getBaseApplicationConfigAction: () => [
|
14
|
+
'loading',
|
15
|
+
GetBaseApplicationConfig,
|
16
|
+
({
|
17
|
+
tabs = {},
|
18
|
+
aside = {},
|
19
|
+
header = {},
|
20
|
+
content = {}
|
21
|
+
}) => ({
|
22
|
+
baseApplicationConfig: {
|
23
|
+
tabs,
|
24
|
+
aside,
|
25
|
+
header,
|
26
|
+
content
|
27
|
+
}
|
28
|
+
})
|
29
|
+
]
|
30
|
+
}
|
31
|
+
});
|
@@ -1,18 +1,18 @@
|
|
1
|
-
'use strict';
|
2
|
-
const path = require('path');
|
3
|
-
|
4
|
-
function resolve (dir) {
|
5
|
-
return path.join(__dirname, '.', dir);
|
6
|
-
}
|
7
|
-
|
8
|
-
module.exports = {
|
9
|
-
context: path.resolve(__dirname, './'),
|
10
|
-
resolve: {
|
11
|
-
extensions: [ '.js' ],
|
12
|
-
alias: {
|
13
|
-
'~': resolve('src/'),
|
14
|
-
'common': resolve('src/common'),
|
15
|
-
'components': resolve('src/components')
|
16
|
-
}
|
17
|
-
}
|
18
|
-
};
|
1
|
+
'use strict';
|
2
|
+
const path = require('path');
|
3
|
+
|
4
|
+
function resolve (dir) {
|
5
|
+
return path.join(__dirname, '.', dir);
|
6
|
+
}
|
7
|
+
|
8
|
+
module.exports = {
|
9
|
+
context: path.resolve(__dirname, './'),
|
10
|
+
resolve: {
|
11
|
+
extensions: [ '.js' ],
|
12
|
+
alias: {
|
13
|
+
'~': resolve('src/'),
|
14
|
+
'common': resolve('src/common'),
|
15
|
+
'components': resolve('src/components')
|
16
|
+
}
|
17
|
+
}
|
18
|
+
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|