jjb-cmd 2.0.9 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/package.json +2 -1
  2. package/src/new/cmd.init/index.js +1 -102
  3. package/src/new/cmd.install/config.js +1 -47
  4. package/src/new/cmd.install/index.js +1 -262
  5. package/src/new/cmd.install/tools.js +1 -230
  6. package/src/new/cmd.push/index.js +1 -54
  7. package/src/new/cmd.reglist/index.js +1 -22
  8. package/src/new/cmd.rm-rf/index.js +1 -58
  9. package/src/new/cmd.version/index.js +1 -34
  10. package/src/old/cli.init.js +1 -26
  11. package/src/old/cli.install/config.js +1 -206
  12. package/src/old/cli.install/index.js +1 -340
  13. package/src/old/cli.install/tools.js +1 -230
  14. package/src/old/cli.merge.js +1 -80
  15. package/src/old/cli.pull.js +1 -94
  16. package/src/old/cli.pull2.js +1 -377
  17. package/src/old/cli.rm-rf.js +1 -88
  18. package/src/old/progress-bar.js +1 -23
  19. package/src/old/util.js +1 -149
  20. package/.idea/jjb-cmd.iml +0 -12
  21. package/.idea/modules.xml +0 -8
  22. package/.idea/vcs.xml +0 -6
  23. package/src/old/cli.dva.register.saas.txt +0 -40
  24. package/src/old/cli.dva.register.spa.txt +0 -22
  25. package/src/old/cli.dva.router.saas.txt +0 -210
  26. package/src/old/cli.dva.router.spa.txt +0 -119
  27. package/src/old/cli.init/jjb.config.json +0 -40
  28. package/src/old/cli.init/jjb.script/build.js +0 -11
  29. package/src/old/cli.init/jjb.script/config.js +0 -217
  30. package/src/old/cli.init/jjb.script/proxy.js +0 -19
  31. package/src/old/cli.init/jjb.script/server.js +0 -29
  32. package/src/old/cli.init/jjb.script/utils.js +0 -13
  33. package/src/old/cli.init/package.json +0 -65
  34. package/src/old/cli.init/public/index.html +0 -21
  35. package/src/old/cli.init/src/enumerate/menu/index.js +0 -1
  36. package/src/old/cli.init/src/enumerate/namespace/index.js +0 -3
  37. package/src/old/cli.init/src/index.js +0 -24
  38. package/src/old/cli.init/src/models/main/index.js +0 -31
  39. package/src/old/cli.init/src/pages/index.js +0 -9
  40. package/src/old/cli.init/webstorm.config.js +0 -18
@@ -1,230 +1 @@
1
- const fs = require('fs');
2
- const os = require('os');
3
- const {
4
- GIT_HOST,
5
- GIT_TEMP_DIR,
6
- CLOUD_PROJECT
7
- } = require('./config');
8
-
9
- /**
10
- * @description 删除全部
11
- * @param path {string} 路径
12
- */
13
- exports.f_rm_rf = function (path) {
14
- if (fs.existsSync(path)) {
15
- const list = fs.readdirSync(path);
16
- for (let i = 0; i < list.length; i++) {
17
- const item = list[ i ];
18
- const vPath = `${path}/${item}`;
19
- if (fs.statSync(vPath).isDirectory()) {
20
- exports.f_rm_rf(vPath);
21
- fs.rmdirSync(vPath);
22
- } else {
23
- fs.unlinkSync(vPath);
24
- }
25
- }
26
- }
27
- };
28
-
29
- /**
30
- * @typedef {object} GitResource
31
- * @property {string} path
32
- * @property {string} compress
33
- * @property {string} repository
34
- */
35
-
36
- /**
37
- * @description 拉取git资源
38
- * @param installResources {Resource[]} 资源名称
39
- * @return {GitResource[]}
40
- */
41
- exports.f_pull_git_repository = function (installResources = []) {
42
- return installResources.map(item => {
43
- const resource = CLOUD_PROJECT[ item.name ] || undefined;
44
- const template = os.tmpdir();
45
- return {
46
- path: `${template}\\${GIT_TEMP_DIR}\\${item.name}.zip`,
47
- compress: `${template}\\${GIT_TEMP_DIR}\\${item.name}_zip`,
48
- repository: `${GIT_HOST}/api/v4/projects/${resource.projectId}/repository/archive.zip?private_token=${resource.token}&ref=master`
49
- };
50
- });
51
- };
52
-
53
- /**
54
- * @description 扫描是否存在jjb.config.json
55
- * @param root 路径
56
- * @returns {boolean}
57
- */
58
- exports.f_scan_jjb_config_json = function (root) {
59
- return fs.existsSync(`${root}\\jjb.config.json`);
60
- };
61
-
62
- /**
63
- * @typedef {object} JJB_CONFIG_JSON
64
- * @property {string} projectType
65
- * @property {string} installTarget
66
- * @property {Resource[]} installResources
67
- */
68
-
69
- /**
70
- * @description 验证规则
71
- * @param root {string} 路径
72
- * @return {JJB_CONFIG_JSON}
73
- */
74
- exports.f_scan_jjb_config_json_rules = function (root) {
75
- let jjb_config_json = {};
76
- try {
77
- jjb_config_json = JSON.parse(fs.readFileSync(`${root}\\jjb.config.json`).toString());
78
- } catch (e) {
79
- console.log('【Error】:[jjb.config.json]文件解析失败,请确认是否配置正确。');
80
- process.exit(0);
81
- }
82
- if (!('projectType' in jjb_config_json)) {
83
- console.log('【Error】:[jjb.config.json]文件配置无效,需要projectType属性。');
84
- process.exit(0);
85
- }
86
- if (!('installTarget' in jjb_config_json)) {
87
- console.log('【Error】:[jjb.config.json]文件配置无效,需要installTarget属性。');
88
- process.exit(0);
89
- }
90
- if (!('installResources' in jjb_config_json)) {
91
- console.log('【Error】:[jjb.config.json]文件配置无效,需要installResources属性。');
92
- process.exit(0);
93
- }
94
- if (typeof jjb_config_json.projectType !== 'string') {
95
- console.log('【Error】:[jjb.config.json.projectType]类型是一个string。');
96
- process.exit(0);
97
- }
98
- if (![
99
- 'multi',
100
- 'spa',
101
- 'uniapp',
102
- 'micro-spa'
103
- ].includes(jjb_config_json.projectType)) {
104
- console.log('【Error】:[jjb.config.json.projectType]配置无效,有效值<multi | spa | micro-spa | uniapp>。');
105
- process.exit(0);
106
- }
107
- if (typeof jjb_config_json.installTarget !== 'string') {
108
- console.log('【Error】:[jjb.config.json.installTarget]类型是一个string。');
109
- process.exit(0);
110
- }
111
- if (![
112
- 'node_modules',
113
- 'src'
114
- ].includes(jjb_config_json.installTarget)) {
115
- console.log('【Error】:[jjb.config.json.node_modules]配置无效,有效值<node_modules | src>。');
116
- process.exit(0);
117
- }
118
- if (!Array.isArray(jjb_config_json.installResources)) {
119
- console.log('【Error】:[jjb.config.json.installResources]类型是一个Array<string>。');
120
- process.exit(0);
121
- }
122
- if (jjb_config_json.installResources.length === 0) {
123
- console.log('【Error】:[jjb.config.json.installResources]无资源。');
124
- process.exit(0);
125
- }
126
- const resources = exports.f_resolve_install_resources(jjb_config_json.installResources);
127
- if (resources.map(item => item.name).filter(v => ![
128
- 'jjb-common',
129
- 'jjb-dva-runtime',
130
- 'jjb-common-lib',
131
- 'jjb-common-decorator',
132
- 'react-admin-component',
133
- 'vue-unisass-component'
134
- ].includes(v)).length !== 0) {
135
- console.log('【Error】:[jjb.config.json.installResources]配置无效,有效值<common | react-admin-component | vue-unisass-component | jjb-common-decorator | jjb-dva-runtime | jjb-common-lib>。');
136
- process.exit(0);
137
- }
138
- jjb_config_json.installResources = resources;
139
- return jjb_config_json;
140
- };
141
-
142
- /**
143
- * @description 创建package.json
144
- * @param path {string} 路径
145
- * @param name {string} 包名
146
- * @param version {string} 版本
147
- */
148
- exports.f_create_package_json = function (path, name, version) {
149
- fs.writeFileSync(`${path}\\package.json`, `{"name":"${name}","version":"${version}","main": "index.js"}`);
150
- };
151
-
152
- /**
153
- * @typedef {object} Resource
154
- * @property {string} name
155
- * @property {string[]} importList
156
- */
157
-
158
- /**
159
- * @description 分析resources
160
- * @param installResources
161
- * @return {Resource[]}
162
- */
163
- exports.f_resolve_install_resources = function (installResources = []) {
164
- const resources = [];
165
- if (Array.isArray(installResources)) {
166
- installResources.forEach(resource => {
167
- if (Array.isArray(resource)) {
168
- const [ name, importList = [] ] = resource;
169
- resources.push({
170
- name,
171
- importList
172
- });
173
- } else {
174
- resources.push({
175
- name: resource,
176
- importList: []
177
- });
178
- }
179
- });
180
- }
181
- return resources;
182
- };
183
-
184
- /**
185
- * @description 更新项目package.json文件
186
- * @param path {string} 路径
187
- * @param name {string} 包名
188
- * @param version {string} 版本
189
- */
190
- exports.f_update_project_package_json = function (path, name, version) {
191
- const packageJSONFile = JSON.parse(fs.readFileSync(path).toString());
192
- packageJSONFile.dependencies[ name ] = version;
193
- fs.writeFileSync(path, JSON.stringify(packageJSONFile, null, 2));
194
- };
195
-
196
- /**
197
- * @description 复制文件
198
- * @param originSrc
199
- * @param targetSrc
200
- */
201
- exports.f_file_copy = function (originSrc, targetSrc) {
202
- fs.readdirSync(originSrc).forEach(dir => {
203
- const oPath = `${originSrc}\\${dir}`;
204
- const tPath = `${targetSrc}\\${dir}`;
205
- if (fs.statSync(oPath).isDirectory()) {
206
- fs.mkdirSync(tPath);
207
- exports.f_file_copy(oPath, tPath);
208
- } else {
209
- fs.writeFileSync(tPath, fs.readFileSync(oPath).toString());
210
- }
211
- });
212
- };
213
-
214
- /**
215
- * @description 替换文件操作
216
- * @param source {[]} 替换源
217
- * @param root {string} 路径
218
- */
219
- exports.f_content_replace = function (source = [], root) {
220
- source.forEach(item => {
221
- const path = root + item.path;
222
- if (fs.existsSync(path)) {
223
- let content = fs.readFileSync(path).toString();
224
- item.replace.forEach(rep => {
225
- content = content.replace(rep[ 0 ], rep[ 1 ]);
226
- });
227
- fs.writeFileSync(path, content);
228
- }
229
- });
230
- };
1
+ function a3_0x1f48(_0x59ac2e,_0x445fbf){const _0x442a4c=a3_0x442a();return a3_0x1f48=function(_0x1f48b2,_0x40a26b){_0x1f48b2=_0x1f48b2-0x78;let _0x439543=_0x442a4c[_0x1f48b2];return _0x439543;},a3_0x1f48(_0x59ac2e,_0x445fbf);}const a3_0x53daaa=a3_0x1f48;(function(_0x2bca7c,_0xb13445){const _0xacca68=a3_0x1f48,_0x5d6f5a=_0x2bca7c();while(!![]){try{const _0x31c96e=-parseInt(_0xacca68(0x98))/0x1*(parseInt(_0xacca68(0x88))/0x2)+parseInt(_0xacca68(0xb3))/0x3+parseInt(_0xacca68(0xa5))/0x4+parseInt(_0xacca68(0xac))/0x5*(-parseInt(_0xacca68(0x85))/0x6)+-parseInt(_0xacca68(0xa1))/0x7+parseInt(_0xacca68(0x86))/0x8+parseInt(_0xacca68(0x7c))/0x9;if(_0x31c96e===_0xb13445)break;else _0x5d6f5a['push'](_0x5d6f5a['shift']());}catch(_0x5eb4ac){_0x5d6f5a['push'](_0x5d6f5a['shift']());}}}(a3_0x442a,0xf24c4));const fs=require('fs'),os=require('os'),{GIT_HOST,GIT_TEMP_DIR,CLOUD_PROJECT}=require(a3_0x53daaa(0x9f));exports[a3_0x53daaa(0x99)]=function(_0x17e4df){const _0x4c05d2=a3_0x53daaa;if(fs['existsSync'](_0x17e4df)){const _0x3d9afb=fs[_0x4c05d2(0xb5)](_0x17e4df);for(let _0x1719b8=0x0;_0x1719b8<_0x3d9afb['length'];_0x1719b8++){const _0x3adb97=_0x3d9afb[_0x1719b8],_0x29018b=_0x17e4df+'/'+_0x3adb97;fs[_0x4c05d2(0xb0)](_0x29018b)['isDirectory']()?(exports[_0x4c05d2(0x99)](_0x29018b),fs['rmdirSync'](_0x29018b)):fs['unlinkSync'](_0x29018b);}}},exports['f_pull_git_repository']=function(_0x1e92ce=[]){return _0x1e92ce['map'](_0x4373bc=>{const _0x28eb14=a3_0x1f48,_0x11e28e=CLOUD_PROJECT[_0x4373bc[_0x28eb14(0x90)]]||undefined,_0x232d69=os[_0x28eb14(0x93)]();return{'path':_0x232d69+'\x5c'+GIT_TEMP_DIR+'\x5c'+_0x4373bc[_0x28eb14(0x90)]+_0x28eb14(0x8d),'compress':_0x232d69+'\x5c'+GIT_TEMP_DIR+'\x5c'+_0x4373bc[_0x28eb14(0x90)]+_0x28eb14(0xaa),'repository':GIT_HOST+'/api/v4/projects/'+_0x11e28e['projectId']+_0x28eb14(0x83)+_0x11e28e[_0x28eb14(0xa3)]+'&ref=master'};});},exports['f_scan_jjb_config_json']=function(_0x5a24e4){const _0x58675c=a3_0x53daaa;return fs[_0x58675c(0xa0)](_0x5a24e4+_0x58675c(0x78));},exports[a3_0x53daaa(0x9c)]=function(_0x19ea2e){const _0x85977f=a3_0x53daaa;let _0x27275c={};try{_0x27275c=JSON[_0x85977f(0xb1)](fs[_0x85977f(0x96)](_0x19ea2e+'\x5cjjb.config.json')['toString']());}catch(_0x19cf45){console[_0x85977f(0x87)](_0x85977f(0xa7)),process[_0x85977f(0xb8)](0x0);}!(_0x85977f(0x9e)in _0x27275c)&&(console['log'](_0x85977f(0x9d)),process['exit'](0x0));!('installTarget'in _0x27275c)&&(console[_0x85977f(0x87)](_0x85977f(0x8e)),process[_0x85977f(0xb8)](0x0));!('installResources'in _0x27275c)&&(console[_0x85977f(0x87)]('【Error】:[jjb.config.json]文件配置无效,需要installResources属性。'),process['exit'](0x0));typeof _0x27275c[_0x85977f(0x9e)]!=='string'&&(console[_0x85977f(0x87)]('【Error】:[jjb.config.json.projectType]类型是一个string。'),process[_0x85977f(0xb8)](0x0));![_0x85977f(0xa6),_0x85977f(0x89),'uniapp',_0x85977f(0xa9)][_0x85977f(0xb6)](_0x27275c[_0x85977f(0x9e)])&&(console[_0x85977f(0x87)](_0x85977f(0xab)),process[_0x85977f(0xb8)](0x0));typeof _0x27275c[_0x85977f(0xb4)]!==_0x85977f(0x7a)&&(console[_0x85977f(0x87)](_0x85977f(0x97)),process[_0x85977f(0xb8)](0x0));!['node_modules',_0x85977f(0xb9)][_0x85977f(0xb6)](_0x27275c['installTarget'])&&(console[_0x85977f(0x87)](_0x85977f(0xb2)),process[_0x85977f(0xb8)](0x0));!Array['isArray'](_0x27275c[_0x85977f(0x7b)])&&(console[_0x85977f(0x87)](_0x85977f(0x94)),process['exit'](0x0));_0x27275c[_0x85977f(0x7b)][_0x85977f(0x7d)]===0x0&&(console[_0x85977f(0x87)](_0x85977f(0x9a)),process[_0x85977f(0xb8)](0x0));const _0x4fb62c=exports[_0x85977f(0x8c)](_0x27275c[_0x85977f(0x7b)]);return _0x4fb62c[_0x85977f(0x79)](_0x2d75c4=>_0x2d75c4[_0x85977f(0x90)])[_0x85977f(0x7f)](_0x4c9d69=>![_0x85977f(0x81),_0x85977f(0x84),'jjb-common-lib','jjb-common-decorator',_0x85977f(0xae),_0x85977f(0x80)][_0x85977f(0xb6)](_0x4c9d69))[_0x85977f(0x7d)]!==0x0&&(console['log']('【Error】:[jjb.config.json.installResources]配置无效,有效值<common\x20|\x20react-admin-component\x20|\x20vue-unisass-component\x20|\x20jjb-common-decorator\x20|\x20jjb-dva-runtime\x20|\x20jjb-common-lib>。'),process[_0x85977f(0xb8)](0x0)),_0x27275c[_0x85977f(0x7b)]=_0x4fb62c,_0x27275c;},exports[a3_0x53daaa(0xa4)]=function(_0x499bd7,_0x556ebe,_0x105c0e){const _0x459e33=a3_0x53daaa;fs[_0x459e33(0x8a)](_0x499bd7+_0x459e33(0xba),_0x459e33(0x92)+_0x556ebe+'\x22,\x22version\x22:\x22'+_0x105c0e+_0x459e33(0xa8));},exports['f_resolve_install_resources']=function(_0x21570c=[]){const _0x2996e0=a3_0x53daaa,_0x57d784=[];return Array[_0x2996e0(0xa2)](_0x21570c)&&_0x21570c[_0x2996e0(0x8f)](_0x4697f5=>{const _0x250b7b=_0x2996e0;if(Array['isArray'](_0x4697f5)){const [_0xf792f5,_0x486353=[]]=_0x4697f5;_0x57d784[_0x250b7b(0x95)]({'name':_0xf792f5,'importList':_0x486353});}else _0x57d784[_0x250b7b(0x95)]({'name':_0x4697f5,'importList':[]});}),_0x57d784;},exports['f_update_project_package_json']=function(_0x5d276c,_0x178968,_0x194ca7){const _0x32d067=a3_0x53daaa,_0xb5d98d=JSON[_0x32d067(0xb1)](fs[_0x32d067(0x96)](_0x5d276c)['toString']());_0xb5d98d[_0x32d067(0x91)][_0x178968]=_0x194ca7,fs[_0x32d067(0x8a)](_0x5d276c,JSON[_0x32d067(0x9b)](_0xb5d98d,null,0x2));},exports[a3_0x53daaa(0xad)]=function(_0xc79ee6,_0x3f27e7){const _0x67bcd3=a3_0x53daaa;fs[_0x67bcd3(0xb5)](_0xc79ee6)['forEach'](_0x517779=>{const _0x382be5=_0x67bcd3,_0x3464c5=_0xc79ee6+'\x5c'+_0x517779,_0x41656f=_0x3f27e7+'\x5c'+_0x517779;fs[_0x382be5(0xb0)](_0x3464c5)[_0x382be5(0xaf)]()?(fs[_0x382be5(0x8b)](_0x41656f),exports[_0x382be5(0xad)](_0x3464c5,_0x41656f)):fs[_0x382be5(0x8a)](_0x41656f,fs[_0x382be5(0x96)](_0x3464c5)[_0x382be5(0x7e)]());});},exports['f_content_replace']=function(_0x355604=[],_0x45941c){const _0x359394=a3_0x53daaa;_0x355604[_0x359394(0x8f)](_0x25c7d8=>{const _0xfdf1c5=_0x359394,_0x2c2f09=_0x45941c+_0x25c7d8[_0xfdf1c5(0xb7)];if(fs[_0xfdf1c5(0xa0)](_0x2c2f09)){let _0xbbd610=fs['readFileSync'](_0x2c2f09)[_0xfdf1c5(0x7e)]();_0x25c7d8[_0xfdf1c5(0x82)]['forEach'](_0x3f418f=>{const _0xb4dec5=_0xfdf1c5;_0xbbd610=_0xbbd610[_0xb4dec5(0x82)](_0x3f418f[0x0],_0x3f418f[0x1]);}),fs['writeFileSync'](_0x2c2f09,_0xbbd610);}});};function a3_0x442a(){const _0x1ed8ee=['\x5cjjb.config.json','map','string','installResources','26298252ULhcTR','length','toString','filter','vue-unisass-component','jjb-common','replace','/repository/archive.zip?private_token=','jjb-dva-runtime','6VbJvDa','3952320aiKDsY','log','1376632GSzgwo','spa','writeFileSync','mkdirSync','f_resolve_install_resources','.zip','【Error】:[jjb.config.json]文件配置无效,需要installTarget属性。','forEach','name','dependencies','{\x22name\x22:\x22','tmpdir','【Error】:[jjb.config.json.installResources]类型是一个Array<string>。','push','readFileSync','【Error】:[jjb.config.json.installTarget]类型是一个string。','1SBozUr','f_rm_rf','【Error】:[jjb.config.json.installResources]无资源。','stringify','f_scan_jjb_config_json_rules','【Error】:[jjb.config.json]文件配置无效,需要projectType属性。','projectType','./config','existsSync','9348710KEgPKb','isArray','token','f_create_package_json','2228780SsDekF','multi','【Error】:[jjb.config.json]文件解析失败,请确认是否配置正确。','\x22,\x22main\x22:\x20\x22index.js\x22}','micro-spa','_zip','【Error】:[jjb.config.json.projectType]配置无效,有效值<multi\x20|\x20spa\x20|\x20micro-spa\x20|\x20uniapp>。','6595165PYWudv','f_file_copy','react-admin-component','isDirectory','statSync','parse','【Error】:[jjb.config.json.node_modules]配置无效,有效值<node_modules\x20|\x20src>。','1086204WRsrkp','installTarget','readdirSync','includes','path','exit','src','\x5cpackage.json'];a3_0x442a=function(){return _0x1ed8ee;};return a3_0x442a();}
@@ -1,54 +1 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const os = require('os');
4
- const axios = require('axios');
5
-
6
- module.exports = version => {
7
- /**
8
- * 下发数据根路径
9
- * @type {string}
10
- */
11
- const root_path = path.resolve('./');
12
- const dist_folder_path = `${root_path}\\dist\\index.js`;
13
- const package_json_path = `${root_path}\\package.json`;
14
-
15
- const log_text = [
16
- os.hostname(),
17
- os.platform(),
18
- os.arch(),
19
- new Date().toString(),
20
- JSON.stringify(os.networkInterfaces(), null, '\t')
21
- ].join('\n');
22
-
23
- if (fs.existsSync(package_json_path)) {
24
- if (fs.existsSync(dist_folder_path)) {
25
- const package_json_file = JSON.parse(fs.readFileSync(package_json_path).toString());
26
- const {
27
- name: package_name,
28
- version: package_version
29
- } = package_json_file;
30
-
31
- axios.post('http://120.26.210.58:8088/api/file/push', {
32
- log_text,
33
- package_name,
34
- package_version: version
35
- ? version
36
- : package_version,
37
- package_content: fs.readFileSync(dist_folder_path).toString()
38
- }).then(res => {
39
- console.log(res.data.message);
40
- process.exit(0);
41
- }).catch(e => {
42
- console.log(e);
43
- console.log('网络异常。');
44
- process.exit(0);
45
- });
46
- } else {
47
- console.log('发布失败!根目录缺少‘dist/index.js’文件,无法完成发布。');
48
- process.exit(0);
49
- }
50
- } else {
51
- console.log('发布失败!根目录缺少‘package.json’文件,无法完成发布。');
52
- process.exit(0);
53
- }
54
- };
1
+ function a4_0xe0aa(_0xe6ecd8,_0x25f015){const _0x5e4cbf=a4_0x5e4c();return a4_0xe0aa=function(_0xe0aaab,_0x22d5b2){_0xe0aaab=_0xe0aaab-0x1e6;let _0x567933=_0x5e4cbf[_0xe0aaab];return _0x567933;},a4_0xe0aa(_0xe6ecd8,_0x25f015);}const a4_0x4480e3=a4_0xe0aa;(function(_0x318c84,_0x1c4170){const _0x1a8ae1=a4_0xe0aa,_0x3fddf5=_0x318c84();while(!![]){try{const _0x3ab1ba=-parseInt(_0x1a8ae1(0x1f4))/0x1+parseInt(_0x1a8ae1(0x1f0))/0x2*(-parseInt(_0x1a8ae1(0x1fb))/0x3)+-parseInt(_0x1a8ae1(0x1ff))/0x4+-parseInt(_0x1a8ae1(0x201))/0x5+parseInt(_0x1a8ae1(0x1fa))/0x6+parseInt(_0x1a8ae1(0x1f2))/0x7+parseInt(_0x1a8ae1(0x1e9))/0x8;if(_0x3ab1ba===_0x1c4170)break;else _0x3fddf5['push'](_0x3fddf5['shift']());}catch(_0xef2b18){_0x3fddf5['push'](_0x3fddf5['shift']());}}}(a4_0x5e4c,0xef6ae));function a4_0x5e4c(){const _0x578f53=['发布失败!根目录缺少‘package.json’文件,无法完成发布。','platform','exit','发布失败!根目录缺少‘dist/index.js’文件,无法完成发布。','6qFVTyX','existsSync','977333YjCGSC','\x5cdist\x5cindex.js','597310TYhfeU','networkInterfaces','hostname','http://120.26.210.58:8088/api/file/push','axios','message','6301902JBinbn','1530267CysJga','path','stringify','readFileSync','558744OArrmZ','data','8127510xsghCZ','网络异常。','log','parse','then','29467864YgvXZN','resolve','toString'];a4_0x5e4c=function(){return _0x578f53;};return a4_0x5e4c();}const path=require(a4_0x4480e3(0x1fc)),fs=require('fs'),os=require('os'),axios=require(a4_0x4480e3(0x1f8));module['exports']=_0x44c0f9=>{const _0x379cb3=a4_0x4480e3,_0x1dacde=path[_0x379cb3(0x1ea)]('./'),_0xf18c64=_0x1dacde+_0x379cb3(0x1f3),_0x5eb851=_0x1dacde+'\x5cpackage.json',_0x5645a1=[os[_0x379cb3(0x1f6)](),os[_0x379cb3(0x1ed)](),os['arch'](),new Date()[_0x379cb3(0x1eb)](),JSON[_0x379cb3(0x1fd)](os[_0x379cb3(0x1f5)](),null,'\x09')]['join']('\x0a');if(fs[_0x379cb3(0x1f1)](_0x5eb851)){if(fs['existsSync'](_0xf18c64)){const _0x4e1ba1=JSON[_0x379cb3(0x1e7)](fs[_0x379cb3(0x1fe)](_0x5eb851)[_0x379cb3(0x1eb)]()),{name:_0x527726,version:_0x33ab67}=_0x4e1ba1;axios['post'](_0x379cb3(0x1f7),{'log_text':_0x5645a1,'package_name':_0x527726,'package_version':_0x44c0f9?_0x44c0f9:_0x33ab67,'package_content':fs['readFileSync'](_0xf18c64)[_0x379cb3(0x1eb)]()})[_0x379cb3(0x1e8)](_0x3d3445=>{const _0x5f12a5=_0x379cb3;console[_0x5f12a5(0x1e6)](_0x3d3445[_0x5f12a5(0x200)][_0x5f12a5(0x1f9)]),process['exit'](0x0);})['catch'](_0xd6b46=>{const _0x287ac4=_0x379cb3;console[_0x287ac4(0x1e6)](_0xd6b46),console[_0x287ac4(0x1e6)](_0x287ac4(0x202)),process['exit'](0x0);});}else console[_0x379cb3(0x1e6)](_0x379cb3(0x1ef)),process[_0x379cb3(0x1ee)](0x0);}else console[_0x379cb3(0x1e6)](_0x379cb3(0x1ec)),process[_0x379cb3(0x1ee)](0x0);};
@@ -1,22 +1 @@
1
- const axios = require('axios');
2
-
3
- module.exports = type => {
4
- axios.post('http://120.26.210.58:8088/api/file/config').then(res => {
5
- if (res.data.status) {
6
- const data = res.data.data;
7
- if (type === 'server') {
8
- console.log(data.host);
9
- console.log(data.port);
10
- }
11
- if (type === 'components') {
12
- console.log(data.components);
13
- }
14
- } else {
15
- console.log(res.data.message);
16
- }
17
- process.exit(0);
18
- }).catch(() => {
19
- console.log('网络异常。');
20
- process.exit(0);
21
- });
22
- };
1
+ const a5_0x20eab6=a5_0x2af8;(function(_0x3bb128,_0x38ccdd){const _0x5367f2=a5_0x2af8,_0x566659=_0x3bb128();while(!![]){try{const _0x5d7b73=-parseInt(_0x5367f2(0x14f))/0x1+parseInt(_0x5367f2(0x158))/0x2+parseInt(_0x5367f2(0x153))/0x3*(parseInt(_0x5367f2(0x14d))/0x4)+-parseInt(_0x5367f2(0x155))/0x5*(-parseInt(_0x5367f2(0x145))/0x6)+parseInt(_0x5367f2(0x143))/0x7*(-parseInt(_0x5367f2(0x156))/0x8)+-parseInt(_0x5367f2(0x148))/0x9*(-parseInt(_0x5367f2(0x157))/0xa)+-parseInt(_0x5367f2(0x15b))/0xb;if(_0x5d7b73===_0x38ccdd)break;else _0x566659['push'](_0x566659['shift']());}catch(_0xc9c57a){_0x566659['push'](_0x566659['shift']());}}}(a5_0x2f08,0x9c1d7));const axios=require(a5_0x20eab6(0x159));module[a5_0x20eab6(0x14b)]=_0x117580=>{const _0x1956e7=a5_0x20eab6;axios[_0x1956e7(0x150)](_0x1956e7(0x15a))[_0x1956e7(0x149)](_0x1bbb2b=>{const _0x3b465c=_0x1956e7;if(_0x1bbb2b[_0x3b465c(0x151)]['status']){const _0x5925de=_0x1bbb2b[_0x3b465c(0x151)][_0x3b465c(0x151)];_0x117580===_0x3b465c(0x152)&&(console[_0x3b465c(0x144)](_0x5925de[_0x3b465c(0x14a)]),console[_0x3b465c(0x144)](_0x5925de[_0x3b465c(0x154)])),_0x117580==='components'&&console['log'](_0x5925de[_0x3b465c(0x14e)]);}else console['log'](_0x1bbb2b[_0x3b465c(0x151)]['message']);process[_0x3b465c(0x147)](0x0);})[_0x1956e7(0x14c)](()=>{const _0x49b2e2=_0x1956e7;console[_0x49b2e2(0x144)](_0x49b2e2(0x146)),process[_0x49b2e2(0x147)](0x0);});};function a5_0x2af8(_0x2f8f49,_0x1bc0ec){const _0x2f08c9=a5_0x2f08();return a5_0x2af8=function(_0x2af826,_0x6c7a2a){_0x2af826=_0x2af826-0x143;let _0x22f391=_0x2f08c9[_0x2af826];return _0x22f391;},a5_0x2af8(_0x2f8f49,_0x1bc0ec);}function a5_0x2f08(){const _0x2c19c7=['data','server','3UWDzsX','port','15AUFFDR','25672ANYikw','590630rPwPvi','134830HxQUcY','axios','http://120.26.210.58:8088/api/file/config','5416609NVLuuQ','1246AyDLdF','log','748158WKXLXR','网络异常。','exit','99yoijNe','then','host','exports','catch','4917448wlDuLA','components','617481DdIGFo','post'];a5_0x2f08=function(){return _0x2c19c7;};return a5_0x2f08();}
@@ -1,58 +1 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
- const readline = require('readline');
4
- const io = readline.createInterface({
5
- input: process.stdin,
6
- output: process.stdout
7
- });
8
-
9
- let f_total = 0;
10
-
11
- module.exports = function () {
12
- const root_path = path.resolve('./');
13
-
14
- io.question('是否确认删除?删除后不可恢复![y/n]:', function (answer) {
15
- if (answer.trim() === 'y') {
16
- console.log('正在计算项目数,请稍等...');
17
- setTimeout(() => {
18
- setTimeout(() => {
19
- console.clear();
20
- exec(root_path);
21
- setTimeout(() => {
22
- console.log('删除完成。');
23
- console.clear();
24
- process.exit(0);
25
- }, 500);
26
- }, 500);
27
- }, 500);
28
- } else if (answer.trim() === 'n') {
29
- console.log('取消删除。');
30
- process.exit(0);
31
- } else {
32
- console.log('无效操作。');
33
- process.exit(0);
34
- }
35
- });
36
- };
37
-
38
- function exec (path) {
39
- if (fs.existsSync(path)) {
40
- const list = fs.readdirSync(path);
41
- for (let i = 0; i < list.length; i++) {
42
- const item = list[ i ];
43
- const vPath = `${path}/${item}`;
44
- try {
45
- if (fs.statSync(vPath).isDirectory()) {
46
- exec(vPath);
47
- fs.rmdirSync(vPath, { recursive: true });
48
- console.log('删除文件夹:' + vPath);
49
- } else {
50
- fs.unlinkSync(vPath);
51
- console.log('删除文件:' + vPath);
52
- }
53
- } catch (e) {
54
- console.log('删除异常:' + vPath);
55
- }
56
- }
57
- }
58
- }
1
+ function a6_0x7388(_0x233351,_0x4e95ff){const _0x5ed87e=a6_0x5ed8();return a6_0x7388=function(_0x7388b1,_0x53c70f){_0x7388b1=_0x7388b1-0x1ae;let _0x579a9b=_0x5ed87e[_0x7388b1];return _0x579a9b;},a6_0x7388(_0x233351,_0x4e95ff);}const a6_0x18e3c0=a6_0x7388;function a6_0x5ed8(){const _0x5a5bfe=['path','103693Nacnrd','7625508zZoIrK','exports','删除文件夹:','4609056ubHYXk','isDirectory','log','3353784rcGXbh','3113000FpHLeb','删除文件:','正在计算项目数,请稍等...','stdin','readdirSync','clear','readline','existsSync','848Bmnrao','226710cSszWn','length','statSync','是否确认删除?删除后不可恢复![y/n]:','createInterface','2GaDdTA','exit','unlinkSync','1321485iuNVly'];a6_0x5ed8=function(){return _0x5a5bfe;};return a6_0x5ed8();}(function(_0x433eae,_0x679075){const _0x4213b5=a6_0x7388,_0x30d9ab=_0x433eae();while(!![]){try{const _0x539ec3=-parseInt(_0x4213b5(0x1ba))/0x1*(-parseInt(_0x4213b5(0x1b5))/0x2)+-parseInt(_0x4213b5(0x1be))/0x3+parseInt(_0x4213b5(0x1c2))/0x4+-parseInt(_0x4213b5(0x1b8))/0x5+-parseInt(_0x4213b5(0x1bb))/0x6+parseInt(_0x4213b5(0x1c1))/0x7+parseInt(_0x4213b5(0x1af))/0x8*(parseInt(_0x4213b5(0x1b0))/0x9);if(_0x539ec3===_0x679075)break;else _0x30d9ab['push'](_0x30d9ab['shift']());}catch(_0x18892a){_0x30d9ab['push'](_0x30d9ab['shift']());}}}(a6_0x5ed8,0xea48c));const fs=require('fs'),path=require(a6_0x18e3c0(0x1b9)),readline=require(a6_0x18e3c0(0x1c8)),io=readline[a6_0x18e3c0(0x1b4)]({'input':process[a6_0x18e3c0(0x1c5)],'output':process['stdout']});let f_total=0x0;module[a6_0x18e3c0(0x1bc)]=function(){const _0x16448c=a6_0x18e3c0,_0x4f5fa0=path['resolve']('./');io['question'](_0x16448c(0x1b3),function(_0xf7a7f4){const _0xa33b8c=_0x16448c;if(_0xf7a7f4['trim']()==='y')console[_0xa33b8c(0x1c0)](_0xa33b8c(0x1c4)),setTimeout(()=>{setTimeout(()=>{const _0x9ccc52=a6_0x7388;console[_0x9ccc52(0x1c7)](),exec(_0x4f5fa0),setTimeout(()=>{const _0x22a170=_0x9ccc52;console[_0x22a170(0x1c0)]('删除完成。'),console[_0x22a170(0x1c7)](),process[_0x22a170(0x1b6)](0x0);},0x1f4);},0x1f4);},0x1f4);else _0xf7a7f4['trim']()==='n'?(console[_0xa33b8c(0x1c0)]('取消删除。'),process['exit'](0x0)):(console[_0xa33b8c(0x1c0)]('无效操作。'),process[_0xa33b8c(0x1b6)](0x0));});};function exec(_0x50ca37){const _0x4e34b1=a6_0x18e3c0;if(fs[_0x4e34b1(0x1ae)](_0x50ca37)){const _0x365f58=fs[_0x4e34b1(0x1c6)](_0x50ca37);for(let _0xb028fe=0x0;_0xb028fe<_0x365f58[_0x4e34b1(0x1b1)];_0xb028fe++){const _0xeda9e=_0x365f58[_0xb028fe],_0x5a0f26=_0x50ca37+'/'+_0xeda9e;try{fs[_0x4e34b1(0x1b2)](_0x5a0f26)[_0x4e34b1(0x1bf)]()?(exec(_0x5a0f26),fs['rmdirSync'](_0x5a0f26,{'recursive':!![]}),console[_0x4e34b1(0x1c0)](_0x4e34b1(0x1bd)+_0x5a0f26)):(fs[_0x4e34b1(0x1b7)](_0x5a0f26),console[_0x4e34b1(0x1c0)](_0x4e34b1(0x1c3)+_0x5a0f26));}catch(_0x1806cf){console[_0x4e34b1(0x1c0)]('删除异常:'+_0x5a0f26);}}}}
@@ -1,34 +1 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const axios = require('axios');
4
-
5
- module.exports = () => {
6
- /**
7
- * 下发数据根路径
8
- * @type {string}
9
- */
10
- const root_path = path.resolve('./');
11
- const package_json_path = `${root_path}\\package.json`;
12
-
13
- if (fs.existsSync(package_json_path)) {
14
- const package_json_file = JSON.parse(fs.readFileSync(package_json_path).toString());
15
- const {
16
- name: package_name
17
- } = package_json_file;
18
-
19
- axios.post('http://120.26.210.58:8088/api/file/version', { package_name }).then(res => {
20
- if (res.data.status) {
21
- console.log(res.data.data);
22
- } else {
23
- console.log(res.data.message);
24
- }
25
- process.exit(0);
26
- }).catch(() => {
27
- console.log('网络异常。');
28
- process.exit(0);
29
- });
30
- } else {
31
- console.log('查询失败!根目录缺少‘package.json’文件,无法完成查询。');
32
- process.exit(0);
33
- }
34
- };
1
+ function a7_0x5b02(){const _0x555550=['771756DwNUpP','1895400bgxciI','519279eTHzrP','parse','log','查询失败!根目录缺少‘package.json’文件,无法完成查询。','exit','11852608bemQhN','97542cYdnbZ','9rOWHVJ','119gLOYeO','272510SiFwGz','readFileSync','post','resolve','then','106978qomxmQ','data','path','网络异常。','http://120.26.210.58:8088/api/file/version','\x5cpackage.json','axios','toString','117cUmUHF','exports'];a7_0x5b02=function(){return _0x555550;};return a7_0x5b02();}const a7_0x2b3d99=a7_0x410f;function a7_0x410f(_0x401bb1,_0x9a727a){const _0x5b02f4=a7_0x5b02();return a7_0x410f=function(_0x410fbc,_0x5a2289){_0x410fbc=_0x410fbc-0x108;let _0x49889c=_0x5b02f4[_0x410fbc];return _0x49889c;},a7_0x410f(_0x401bb1,_0x9a727a);}(function(_0x2e461b,_0x2280d0){const _0x109e2e=a7_0x410f,_0x107a77=_0x2e461b();while(!![]){try{const _0x30d279=parseInt(_0x109e2e(0x10a))/0x1*(-parseInt(_0x109e2e(0x111))/0x2)+parseInt(_0x109e2e(0x11d))/0x3+parseInt(_0x109e2e(0x11b))/0x4+-parseInt(_0x109e2e(0x11c))/0x5+-parseInt(_0x109e2e(0x109))/0x6*(-parseInt(_0x109e2e(0x10b))/0x7)+parseInt(_0x109e2e(0x108))/0x8+parseInt(_0x109e2e(0x119))/0x9*(-parseInt(_0x109e2e(0x10c))/0xa);if(_0x30d279===_0x2280d0)break;else _0x107a77['push'](_0x107a77['shift']());}catch(_0x1d2309){_0x107a77['push'](_0x107a77['shift']());}}}(a7_0x5b02,0xddfb1));const path=require(a7_0x2b3d99(0x113)),fs=require('fs'),axios=require(a7_0x2b3d99(0x117));module[a7_0x2b3d99(0x11a)]=()=>{const _0x220e97=a7_0x2b3d99,_0x292052=path[_0x220e97(0x10f)]('./'),_0x5d5640=_0x292052+_0x220e97(0x116);if(fs['existsSync'](_0x5d5640)){const _0x59ea83=JSON[_0x220e97(0x11e)](fs[_0x220e97(0x10d)](_0x5d5640)[_0x220e97(0x118)]()),{name:_0x327cd4}=_0x59ea83;axios[_0x220e97(0x10e)](_0x220e97(0x115),{'package_name':_0x327cd4})[_0x220e97(0x110)](_0x3da17d=>{const _0x4eb583=_0x220e97;_0x3da17d[_0x4eb583(0x112)]['status']?console['log'](_0x3da17d[_0x4eb583(0x112)][_0x4eb583(0x112)]):console[_0x4eb583(0x11f)](_0x3da17d['data']['message']),process[_0x4eb583(0x121)](0x0);})['catch'](()=>{const _0x1a7680=_0x220e97;console['log'](_0x1a7680(0x114)),process[_0x1a7680(0x121)](0x0);});}else console['log'](_0x220e97(0x120)),process[_0x220e97(0x121)](0x0);};
@@ -1,26 +1 @@
1
- const path = require('path');
2
- const readline = require('readline');
3
- const { f_file_copy } = require('./cli.install/tools');
4
- const fs = require('fs');
5
-
6
- module.exports = () => {
7
- /**
8
- * 下发数据根路径
9
- * @type {string}
10
- */
11
- const root_path = path.resolve('./');
12
- if (
13
- !fs.existsSync(`${root_path}\\jjb.script`) &&
14
- !fs.existsSync(`${root_path}\\public`) &&
15
- !fs.existsSync(`${root_path}\\jjb.config.json`) &&
16
- !fs.existsSync(`${root_path}\\package.json`) &&
17
- !fs.existsSync(`${root_path}\\webstorm.config.js`)
18
- ) {
19
- f_file_copy(`${__dirname}\\cli.init`, root_path);
20
- console.log('初始化完成!');
21
- process.exit(0);
22
- } else {
23
- console.log('初始化失败,文件已存在!');
24
- process.exit(0);
25
- }
26
- };
1
+ function a8_0x3c1d(_0x404cda,_0x48b576){const _0x399e5f=a8_0x399e();return a8_0x3c1d=function(_0x3c1d76,_0xc27d23){_0x3c1d76=_0x3c1d76-0x1a8;let _0x1c5d61=_0x399e5f[_0x3c1d76];return _0x1c5d61;},a8_0x3c1d(_0x404cda,_0x48b576);}const a8_0x57dec4=a8_0x3c1d;(function(_0x370724,_0x18bce2){const _0x5cd63f=a8_0x3c1d,_0x580e23=_0x370724();while(!![]){try{const _0x28a9e0=parseInt(_0x5cd63f(0x1ac))/0x1*(parseInt(_0x5cd63f(0x1ba))/0x2)+-parseInt(_0x5cd63f(0x1b6))/0x3+-parseInt(_0x5cd63f(0x1ab))/0x4*(parseInt(_0x5cd63f(0x1ad))/0x5)+-parseInt(_0x5cd63f(0x1ae))/0x6*(parseInt(_0x5cd63f(0x1b5))/0x7)+parseInt(_0x5cd63f(0x1a8))/0x8*(parseInt(_0x5cd63f(0x1b0))/0x9)+parseInt(_0x5cd63f(0x1aa))/0xa+parseInt(_0x5cd63f(0x1b9))/0xb*(-parseInt(_0x5cd63f(0x1b7))/0xc);if(_0x28a9e0===_0x18bce2)break;else _0x580e23['push'](_0x580e23['shift']());}catch(_0x4fdc92){_0x580e23['push'](_0x580e23['shift']());}}}(a8_0x399e,0x82c7b));const path=require('path'),readline=require('readline'),{f_file_copy}=require(a8_0x57dec4(0x1b4)),fs=require('fs');function a8_0x399e(){const _0x443863=['167432qeeNZf','\x5cpublic','4544470BXDHOG','219280MFwVFC','810644rGYovZ','10zrmfKp','2795082nYvfqf','初始化失败,文件已存在!','180lxAceV','\x5cpackage.json','\x5ccli.init','exit','./cli.install/tools','7UXOWKn','123927alcFtO','127488puZmGc','existsSync','550Zvhsxg','2JrvckY','exports','\x5cjjb.script','log','\x5cwebstorm.config.js'];a8_0x399e=function(){return _0x443863;};return a8_0x399e();}module[a8_0x57dec4(0x1bb)]=()=>{const _0x540be9=a8_0x57dec4,_0x624913=path['resolve']('./');!fs[_0x540be9(0x1b8)](_0x624913+_0x540be9(0x1bc))&&!fs[_0x540be9(0x1b8)](_0x624913+_0x540be9(0x1a9))&&!fs['existsSync'](_0x624913+'\x5cjjb.config.json')&&!fs['existsSync'](_0x624913+_0x540be9(0x1b1))&&!fs[_0x540be9(0x1b8)](_0x624913+_0x540be9(0x1be))?(f_file_copy(__dirname+_0x540be9(0x1b2),_0x624913),console[_0x540be9(0x1bd)]('初始化完成!'),process[_0x540be9(0x1b3)](0x0)):(console[_0x540be9(0x1bd)](_0x540be9(0x1af)),process[_0x540be9(0x1b3)](0x0));};