jjb-cmd 2.0.7 → 2.0.9
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/LICENSE +21 -21
- package/README.md +7 -0
- package/package.json +1 -2
- package/src/new/cmd.init/index.js +90 -54
- package/src/new/cmd.install/config.js +16 -0
- 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/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/src/new/cmd.init.copy/lib/jjb.config.json +0 -32
- package/src/new/cmd.init.copy/lib/jjb.script/build.js +0 -14
- package/src/new/cmd.init.copy/lib/jjb.script/config.js +0 -149
- package/src/new/cmd.init.copy/lib/jjb.script/proxy.js +0 -19
- package/src/new/cmd.init.copy/lib/jjb.script/server.js +0 -29
- package/src/new/cmd.init.copy/lib/jjb.script/utils.js +0 -13
- package/src/new/cmd.init.copy/lib/package.json +0 -62
- package/src/new/cmd.init.copy/lib/src/index.js +0 -1
- package/src/new/cmd.init.copy/lib/webstorm.config.js +0 -16
- package/src/new/cmd.init.copy/micro-app/jjb.config.json +0 -38
- package/src/new/cmd.init.copy/micro-app/jjb.script/build.js +0 -15
- package/src/new/cmd.init.copy/micro-app/jjb.script/config.js +0 -221
- package/src/new/cmd.init.copy/micro-app/jjb.script/proxy.js +0 -19
- package/src/new/cmd.init.copy/micro-app/jjb.script/server.js +0 -29
- package/src/new/cmd.init.copy/micro-app/jjb.script/utils.js +0 -13
- package/src/new/cmd.init.copy/micro-app/package.json +0 -69
- package/src/new/cmd.init.copy/micro-app/public/index.html +0 -25
- package/src/new/cmd.init.copy/micro-app/src/enumerate/namespace/index.js +0 -1
- package/src/new/cmd.init.copy/micro-app/src/index.js +0 -23
- package/src/new/cmd.init.copy/micro-app/src/pages/index.js +0 -13
- package/src/new/cmd.init.copy/micro-app/webstorm.config.js +0 -16
- package/src/new/cmd.init.copy/micro-app-ts/jjb.config.json +0 -37
- package/src/new/cmd.init.copy/micro-app-ts/jjb.script/build.js +0 -11
- package/src/new/cmd.init.copy/micro-app-ts/jjb.script/config.js +0 -273
- package/src/new/cmd.init.copy/micro-app-ts/jjb.script/proxy.js +0 -19
- package/src/new/cmd.init.copy/micro-app-ts/jjb.script/server.js +0 -29
- package/src/new/cmd.init.copy/micro-app-ts/jjb.script/utils.js +0 -13
- package/src/new/cmd.init.copy/micro-app-ts/package.json +0 -79
- package/src/new/cmd.init.copy/micro-app-ts/public/index.html +0 -35
- package/src/new/cmd.init.copy/micro-app-ts/src/api/home/index.ts +0 -1
- package/src/new/cmd.init.copy/micro-app-ts/src/enumerate/namespace/index.ts +0 -3
- package/src/new/cmd.init.copy/micro-app-ts/src/index.ts +0 -18
- package/src/new/cmd.init.copy/micro-app-ts/src/pages/index.tsx +0 -9
- package/src/new/cmd.init.copy/micro-app-ts/src/types/global.d.ts +0 -21
- package/src/new/cmd.init.copy/micro-app-ts/tsconfig.json +0 -16
- package/src/new/cmd.init.copy/micro-app-ts/webstorm.config.js +0 -16
- package/src/new/cmd.init.copy/react-component/jjb.config.json +0 -33
- package/src/new/cmd.init.copy/react-component/jjb.script/build.js +0 -14
- package/src/new/cmd.init.copy/react-component/jjb.script/config.js +0 -190
- package/src/new/cmd.init.copy/react-component/jjb.script/proxy.js +0 -22
- package/src/new/cmd.init.copy/react-component/jjb.script/server.js +0 -29
- package/src/new/cmd.init.copy/react-component/jjb.script/utils.js +0 -13
- package/src/new/cmd.init.copy/react-component/package.json +0 -60
- package/src/new/cmd.init.copy/react-component/public/index.html +0 -11
- package/src/new/cmd.init.copy/react-component/src/index.js +0 -15
- package/src/new/cmd.init.copy/react-component/webstorm.config.js +0 -16
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/README.md
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
const path = require('path');
|
2
2
|
const { f_file_copy } = require('../cmd.install/tools');
|
3
|
+
const { CLOUD_PROJECT, GIT_TEMP_DIR, GIT_HOST } = require('../cmd.install/config');
|
3
4
|
const fs = require('fs');
|
5
|
+
const os = require("os");
|
6
|
+
const utils = require("../../old/util");
|
7
|
+
const request = require("request");
|
8
|
+
const compressing = require("compressing");
|
4
9
|
|
5
10
|
module.exports = stdin => {
|
6
11
|
/**
|
@@ -8,59 +13,90 @@ module.exports = stdin => {
|
|
8
13
|
* @type {string}
|
9
14
|
*/
|
10
15
|
const root_path = path.resolve('./');
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
console.log('初始化完成!');
|
41
|
-
process.exit(0);
|
42
|
-
} else {
|
43
|
-
console.log('初始化失败,文件已存在!');
|
44
|
-
process.exit(0);
|
45
|
-
}
|
46
|
-
} else if ([
|
47
|
-
'lib',
|
48
|
-
'react-component'
|
49
|
-
].includes(stdin)) {
|
50
|
-
if (
|
51
|
-
!fs.existsSync(`${root_path}\\jjb.script`) &&
|
52
|
-
!fs.existsSync(`${root_path}\\src`) &&
|
53
|
-
!fs.existsSync(`${root_path}\\.gitignore`) &&
|
54
|
-
!fs.existsSync(`${root_path}\\jjb.config.json`) &&
|
55
|
-
!fs.existsSync(`${root_path}\\package.json`) &&
|
56
|
-
!fs.existsSync(`${root_path}\\webstorm.config.js`)
|
57
|
-
) {
|
58
|
-
f_file_copy(`${__dirname}\\..\\cmd.init.copy\\${stdin}`, root_path);
|
59
|
-
console.log('初始化完成!');
|
60
|
-
process.exit(0);
|
61
|
-
} else {
|
62
|
-
console.log('初始化失败,文件已存在!');
|
63
|
-
process.exit(0);
|
64
|
-
}
|
16
|
+
|
17
|
+
const cloudObj = CLOUD_PROJECT[ stdin ] || undefined;
|
18
|
+
if (cloudObj) {
|
19
|
+
const tmpDir = os.tmpdir();
|
20
|
+
const zipPath = `${tmpDir}/${GIT_TEMP_DIR}/${stdin}.zip`;
|
21
|
+
const zipFolder = `${tmpDir}/${GIT_TEMP_DIR}/unzip/`;
|
22
|
+
utils.DeleteDirAllFile(`${tmpDir}/${GIT_TEMP_DIR}`, () => {
|
23
|
+
fs.mkdirSync(`${tmpDir}/${GIT_TEMP_DIR}`);
|
24
|
+
let stream = fs.createWriteStream(zipPath);
|
25
|
+
request(`${GIT_HOST}/api/v4/projects/${cloudObj.projectId}/repository/archive.zip?private_token=${cloudObj.token}&ref=master`).pipe(stream)
|
26
|
+
.on('close', () => {
|
27
|
+
fs.mkdirSync(zipFolder);
|
28
|
+
compressing.zip.uncompress(zipPath, zipFolder)
|
29
|
+
.then(() => {
|
30
|
+
setTimeout(() => {
|
31
|
+
fs.readdirSync(zipFolder).forEach(dirName => {
|
32
|
+
if (dirName.indexOf('-master-') !== -1) {
|
33
|
+
utils.CopyFolder(zipFolder + dirName, root_path, () => {
|
34
|
+
console.log('初始化完成!');
|
35
|
+
process.exit(0);
|
36
|
+
});
|
37
|
+
}
|
38
|
+
})
|
39
|
+
}, 2000);
|
40
|
+
})
|
41
|
+
});
|
42
|
+
});
|
43
|
+
} else {
|
44
|
+
console.log('【Error】:初始化失败,'+ stdin +'不存在。');
|
65
45
|
}
|
46
|
+
|
47
|
+
// if (stdin === 'micro-app') {
|
48
|
+
// if (
|
49
|
+
// !fs.existsSync(`${root_path}\\jjb.script`) &&
|
50
|
+
// !fs.existsSync(`${root_path}\\public`) &&
|
51
|
+
// !fs.existsSync(`${root_path}\\src`) &&
|
52
|
+
// !fs.existsSync(`${root_path}\\.gitignore`) &&
|
53
|
+
// !fs.existsSync(`${root_path}\\jjb.config.json`) &&
|
54
|
+
// !fs.existsSync(`${root_path}\\package.json`) &&
|
55
|
+
// !fs.existsSync(`${root_path}\\webstorm.config.js`)
|
56
|
+
// ) {
|
57
|
+
// f_file_copy(`${__dirname}\\..\\cmd.init.copy\\micro-app`, root_path);
|
58
|
+
// console.log('初始化完成!');
|
59
|
+
// process.exit(0);
|
60
|
+
// } else {
|
61
|
+
// console.log('初始化失败,文件已存在!');
|
62
|
+
// process.exit(0);
|
63
|
+
// }
|
64
|
+
// } else if(stdin === 'micro-app-ts') {
|
65
|
+
// if (
|
66
|
+
// !fs.existsSync(`${root_path}\\jjb.script`) &&
|
67
|
+
// !fs.existsSync(`${root_path}\\public`) &&
|
68
|
+
// !fs.existsSync(`${root_path}\\src`) &&
|
69
|
+
// !fs.existsSync(`${root_path}\\.gitignore`) &&
|
70
|
+
// !fs.existsSync(`${root_path}\\jjb.config.json`) &&
|
71
|
+
// !fs.existsSync(`${root_path}\\tsconfig.json`) &&
|
72
|
+
// !fs.existsSync(`${root_path}\\package.json`) &&
|
73
|
+
// !fs.existsSync(`${root_path}\\webstorm.config.js`)
|
74
|
+
// ) {
|
75
|
+
// f_file_copy(`${__dirname}\\..\\cmd.init.copy\\micro-app-ts`, root_path);
|
76
|
+
// console.log('初始化完成!');
|
77
|
+
// process.exit(0);
|
78
|
+
// } else {
|
79
|
+
// console.log('初始化失败,文件已存在!');
|
80
|
+
// process.exit(0);
|
81
|
+
// }
|
82
|
+
// } else if ([
|
83
|
+
// 'lib',
|
84
|
+
// 'react-component'
|
85
|
+
// ].includes(stdin)) {
|
86
|
+
// if (
|
87
|
+
// !fs.existsSync(`${root_path}\\jjb.script`) &&
|
88
|
+
// !fs.existsSync(`${root_path}\\src`) &&
|
89
|
+
// !fs.existsSync(`${root_path}\\.gitignore`) &&
|
90
|
+
// !fs.existsSync(`${root_path}\\jjb.config.json`) &&
|
91
|
+
// !fs.existsSync(`${root_path}\\package.json`) &&
|
92
|
+
// !fs.existsSync(`${root_path}\\webstorm.config.js`)
|
93
|
+
// ) {
|
94
|
+
// f_file_copy(`${__dirname}\\..\\cmd.init.copy\\${stdin}`, root_path);
|
95
|
+
// console.log('初始化完成!');
|
96
|
+
// process.exit(0);
|
97
|
+
// } else {
|
98
|
+
// console.log('初始化失败,文件已存在!');
|
99
|
+
// process.exit(0);
|
100
|
+
// }
|
101
|
+
// }
|
66
102
|
};
|
@@ -27,5 +27,21 @@ exports.CLOUD_PROJECT = {
|
|
27
27
|
token: 'd4wQ7dzEjYPsgVbKnYei',
|
28
28
|
projectId: 339
|
29
29
|
},
|
30
|
+
'react-component': {
|
31
|
+
token: 'snBxJ2i5kYarGGcsojhY',
|
32
|
+
projectId: 831
|
33
|
+
},
|
34
|
+
'micro-app-ts': {
|
35
|
+
token: '7V-YUxhmh51Mdhgx4rq4',
|
36
|
+
projectId: 830
|
37
|
+
},
|
38
|
+
'micro-app': {
|
39
|
+
token: 'FqNrmFAgrxasMrbbjvq9',
|
40
|
+
projectId: 829
|
41
|
+
},
|
42
|
+
'lib': {
|
43
|
+
token: 'ywPtT3xCG6b_vAxp6sTj',
|
44
|
+
projectId: 828
|
45
|
+
}
|
30
46
|
};
|
31
47
|
exports.TEMPLATE_FOLDER = `${os.tmpdir()}\\${exports.GIT_TEMP_DIR}`;
|
@@ -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,32 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"projectType": "micro-spa",
|
3
|
-
"installTarget": "node_modules",
|
4
|
-
"installResources": [],
|
5
|
-
"environment": {
|
6
|
-
"development": {
|
7
|
-
"API_HOST": ""
|
8
|
-
},
|
9
|
-
"test": {
|
10
|
-
"API_HOST": ""
|
11
|
-
},
|
12
|
-
"release": {
|
13
|
-
"API_HOST": ""
|
14
|
-
},
|
15
|
-
"production": {
|
16
|
-
"API_HOST": ""
|
17
|
-
}
|
18
|
-
},
|
19
|
-
"contextInject": {},
|
20
|
-
"windowInject": {},
|
21
|
-
"server": {
|
22
|
-
"port": "8066",
|
23
|
-
"host": "127.0.0.1"
|
24
|
-
},
|
25
|
-
"framework": {
|
26
|
-
"antd": {
|
27
|
-
"link-color": "red",
|
28
|
-
"primary-color": "red",
|
29
|
-
"border-radius-base": "2px"
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
const { hasEnvironment } = require('./utils');
|
2
|
-
|
3
|
-
if ( !hasEnvironment()) {
|
4
|
-
throw Error('jjb.script[build]: 启动build需要提供NODE_ENV变量,请确认你所运行的脚本是否正确?');
|
5
|
-
}
|
6
|
-
|
7
|
-
require('webpack')(require('./config')('production').webpack).run(function (stat, compiler) {
|
8
|
-
if ( !compiler.compilation.errors.length) {
|
9
|
-
console.log('库文件Build完成!');
|
10
|
-
} else {
|
11
|
-
console.log('库文件Build失败,发现以下问题,请解决后重试!');
|
12
|
-
console.log(compiler.compilation.errors);
|
13
|
-
}
|
14
|
-
});
|