jjb-cmd 2.5.8 → 2.5.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/src/publish.js CHANGED
@@ -1,307 +1 @@
1
- const path = require('path');
2
- const os = require('os');
3
- const axios = require('axios');
4
- const inquirer = require('inquirer');
5
- const { getApiHost } = require('./config');
6
- const {
7
- CONSTANTS,
8
- logInfo,
9
- logSuccess,
10
- logWarning,
11
- logError,
12
- executeCommand,
13
- fileExists,
14
- readFile,
15
- writeFile
16
- } = require('./utils');
17
- const { loadAuth } = require('./crypto-utils');
18
-
19
- /**
20
- * 解析组件配置信息
21
- * @param {string} distContent - 构建后的文件内容
22
- * @returns {Object} 解析后的配置信息
23
- */
24
- function parseComponentConfig(distContent) {
25
- const matches = distContent.match(/(window\[).+?(\.componentKey|.+]={)/img);
26
- if (!matches || !matches.length) {
27
- throw new Error('请在组件入口文件中添加"window[props.componentKey]"以暴露组件的配置信息!');
28
- }
29
-
30
- const componentConfig = {};
31
-
32
- // 解析 info 配置
33
- const infoMatches = distContent.match(/componentKey.+([{,]info:\s{0,}{)/img);
34
- if (!infoMatches || !infoMatches.length) {
35
- throw new Error('暴露的配置信息中缺少"info"!');
36
- }
37
-
38
- let infoStr = '{';
39
- const infoStr1 = distContent.split(infoMatches[0])[1];
40
- for (let i = 0; i < infoStr1.length; i++) {
41
- infoStr += infoStr1[i];
42
- if (infoStr1[i] === '}') {
43
- try {
44
- const currJson = new Function(`return ${infoStr}`)();
45
- Object.assign(componentConfig, currJson);
46
- componentConfig.defaultSetting = {};
47
- } catch (e) {
48
- // 忽略解析错误
49
- }
50
- break;
51
- }
52
- }
53
-
54
- // 解析 settings 配置
55
- const settingsMatches = distContent.match(/componentKey.+([{,]settings:\s{0,}{)/img);
56
- if (!settingsMatches || !settingsMatches.length) {
57
- throw new Error('暴露的配置信息中缺少"settings"!');
58
- }
59
-
60
- let settingsStr = '{';
61
- const settingsStr1 = distContent.split(settingsMatches[0])[1];
62
- for (let i = 0; i < settingsStr1.length; i++) {
63
- settingsStr += settingsStr1[i];
64
- if (settingsStr1[i] === '}') {
65
- try {
66
- componentConfig.defaultSetting = new Function(`return ${settingsStr}`)();
67
- } catch (e) {
68
- // 忽略解析错误
69
- }
70
- break;
71
- }
72
- }
73
-
74
- return JSON.stringify(componentConfig);
75
- }
76
-
77
- /**
78
- * 执行构建命令
79
- * @param {string} rootPath - 项目根路径
80
- */
81
- function executeBuild(rootPath) {
82
- const yarnLockPath = path.join(rootPath, 'yarn.lock');
83
- if (fileExists(yarnLockPath)) {
84
- executeCommand('yarn build:production', rootPath);
85
- } else {
86
- executeCommand('npm run build:production', rootPath);
87
- }
88
- }
89
-
90
- /**
91
- * 验证必要的文件
92
- * @param {string} rootPath - 项目根路径
93
- * @returns {Object} 验证结果和文件路径
94
- */
95
- function validateRequiredFiles(rootPath) {
96
- const readmePath = path.join(rootPath, 'README.md');
97
- const distPath = path.join(rootPath, 'dist', 'index.js');
98
- const packageJsonPath = path.join(rootPath, 'package.json');
99
- const thumbnailPath = path.join(rootPath, 'thumbnail.png');
100
-
101
- if (!fileExists(packageJsonPath)) {
102
- throw new Error('组件发布失败!根目录缺少\'package.json\'文件!');
103
- }
104
-
105
- if (!fileExists(distPath)) {
106
- throw new Error('组件发布失败!根目录缺少\'dist/index.js\'文件!');
107
- }
108
-
109
- if (!fileExists(readmePath)) {
110
- throw new Error('请在组件根目录添加一个README.md说明文件!');
111
- }
112
-
113
- if (!fileExists(thumbnailPath)) {
114
- throw new Error('请在组件根目录为组件添加一个缩略图"thumbnail.png"文件!');
115
- }
116
-
117
- return {
118
- readmePath,
119
- distPath,
120
- packageJsonPath,
121
- thumbnailPath
122
- };
123
- }
124
-
125
- /**
126
- * 提交发布数据
127
- * @param {string} message - 发布消息
128
- * @param {Object} pushData - 发布数据
129
- */
130
- const submitFun = function (message, pushData) {
131
- pushData.message = message || 'no message';
132
- axios.post(`${getApiHost()}/api/file/publish`, pushData).then(res => {
133
- logSuccess(res.data.message || '组件发布成功');
134
- process.exit(0);
135
- }).catch(e => {
136
- if (e && e.response) {
137
- const status = e.response.status;
138
- const serverMsg = (e.response.data && (e.response.data.message || e.response.data.msg)) || '';
139
- logError(`发布失败 (${status}): ${serverMsg || e.message}`);
140
- } else if (e && e.request) {
141
- logError(`网络连接失败: 无法连接到服务器`);
142
- } else {
143
- logError(`发布失败: ${e.message || '未知错误'}`);
144
- }
145
- process.exit(1);
146
- });
147
- };
148
-
149
- module.exports = version => {
150
- const authPath = path.join(__dirname, '../.auth');
151
-
152
- if (!fileExists(authPath)) {
153
- logError('未检测到认证信息,请先执行登录操作');
154
- process.exit(1);
155
- }
156
-
157
- // 安全读取认证信息
158
- let username, password;
159
- try {
160
- logInfo('正在加载认证信息...');
161
- const authData = loadAuth(authPath);
162
- username = authData.username;
163
- password = authData.password;
164
- logSuccess('认证信息加载成功');
165
- } catch (error) {
166
- logError(`读取认证信息失败: ${error.message}`);
167
- process.exit(1);
168
- }
169
-
170
- logInfo('正在请求服务器授权...');
171
-
172
- axios.post(`${getApiHost()}/api/auth`, {
173
- username,
174
- password
175
- }).then(async res => {
176
- if (res.data.status) {
177
- logSuccess('服务器授权成功');
178
-
179
- const rootPath = path.resolve('./');
180
-
181
- // 执行构建
182
- logInfo('正在执行项目构建...');
183
- try {
184
- executeBuild(rootPath);
185
- logSuccess('项目构建完成');
186
- } catch (error) {
187
- logError(`项目构建失败: ${error.message}`);
188
- process.exit(1);
189
- }
190
-
191
- // 验证必要文件
192
- logInfo('正在验证发布所需文件...');
193
- let filePaths;
194
- try {
195
- filePaths = validateRequiredFiles(rootPath);
196
- logSuccess('文件验证通过');
197
- } catch (error) {
198
- logError(error.message);
199
- process.exit(1);
200
- }
201
-
202
- // 读取包信息
203
- logInfo('正在读取包信息...');
204
- const packageJsonFile = JSON.parse(readFile(path.join(__dirname, '../package.json')));
205
- const { version: cmdVersion } = packageJsonFile;
206
-
207
- // 准备发布数据
208
- logInfo('正在准备发布数据...');
209
- const pushData = {
210
- username,
211
- cmd_version: cmdVersion,
212
- hostname: os.hostname(),
213
- platform: os.platform(),
214
- package_version: version || 0,
215
- package_content: readFile(filePaths.distPath),
216
- readme_content: readFile(filePaths.readmePath)
217
- };
218
-
219
- // 解析组件配置
220
- try {
221
- logInfo('正在解析组件配置信息...');
222
- const distContent = readFile(filePaths.distPath);
223
- pushData.component_config_content = parseComponentConfig(distContent);
224
- logSuccess('组件配置解析完成');
225
- } catch (error) {
226
- logError(error.message);
227
- process.exit(1);
228
- }
229
-
230
- // 处理缩略图
231
- logInfo('正在处理缩略图...');
232
- const thumbnailData = readFile(filePaths.thumbnailPath, 'binary');
233
- pushData.thumbnail_base64 = Buffer.from(thumbnailData, 'binary').toString('base64');
234
- logSuccess('缩略图处理完成');
235
-
236
- // 危险操作警告确认
237
- logWarning('警告:您即将进行组件发布操作,此操作不可逆,请谨慎操作');
238
- logWarning('发布错误可能导致线上应用产生严重生产故障,请务必确保:');
239
- logWarning(' 1. 已充分测试组件各项功能');
240
- logWarning(' 2. 已检查构建产物完整性');
241
- logWarning(' 3. 已确认版本号和发布信息正确');
242
- logWarning(' 4. 已了解发布后的影响范围');
243
- logWarning(' 5. 发布成功后请立即通知相关人员进行测试和验证');
244
-
245
- await new Promise((resolve) => {
246
- let countdown = 10;
247
- const interval = setInterval(() => {
248
- process.stdout.write(`\r倒计时 ${countdown} 秒... `);
249
- countdown--;
250
- if (countdown < 0) {
251
- clearInterval(interval);
252
- process.stdout.write('\r\n');
253
- resolve();
254
- }
255
- }, 1000);
256
- });
257
-
258
- const { confirmed } = await inquirer.prompt([
259
- {
260
- type: 'confirm',
261
- name: 'confirmed',
262
- message: '我已充分了解以上可能存在的严重风险,确认继续发布操作?',
263
- default: false
264
- }
265
- ]);
266
-
267
- if (!confirmed) {
268
- logInfo('发布操作已取消');
269
- process.exit(0);
270
- }
271
-
272
- // 提交发布
273
- const { message } = await inquirer.prompt([
274
- {
275
- type: 'input',
276
- name: 'message',
277
- message: '请输入此次组件发布的信息:',
278
- default: 'no message'
279
- }
280
- ]);
281
-
282
- logInfo('正在提交发布请求...');
283
- submitFun(message || 'no message', pushData);
284
- } else {
285
- logError(`授权失败: ${res.data.message || '未知错误'}`);
286
- process.exit(1);
287
- }
288
- }).catch(e => {
289
- // 更准确的错误分类,避免误导为授权问题
290
- if (e && e.response) {
291
- const status = e.response.status;
292
- if (status === 401 || status === 403) {
293
- logError(`授权失败 (${status}): 认证信息无效或无权限`);
294
- } else {
295
- const serverMsg = (e.response.data && (e.response.data.message || e.response.data.msg)) || '';
296
- logError(`请求失败 (${status}): ${serverMsg || e.message}`);
297
- }
298
- } else if (e && e.request) {
299
- // 请求已发出但未收到响应,多为网络问题
300
- logError(`网络连接失败: 无法连接到服务器或服务器无响应`);
301
- } else {
302
- // 触发请求前发生的错误
303
- logError(`操作失败: ${e ? e.message : '未知错误'}`);
304
- }
305
- process.exit(1);
306
- });
307
- };
1
+ const a6_0x3ff0cf=a6_0x5c6a;(function(_0x5bd9cb,_0x46f144){const _0x401f75=a6_0x5c6a,_0x1b68cc=_0x5bd9cb();while(!![]){try{const _0x292e0a=parseInt(_0x401f75(0x1c3))/0x1*(parseInt(_0x401f75(0x1bb))/0x2)+parseInt(_0x401f75(0x1b1))/0x3*(parseInt(_0x401f75(0x1cc))/0x4)+parseInt(_0x401f75(0x200))/0x5*(-parseInt(_0x401f75(0x1ba))/0x6)+parseInt(_0x401f75(0x1c8))/0x7+parseInt(_0x401f75(0x1a6))/0x8*(-parseInt(_0x401f75(0x1eb))/0x9)+-parseInt(_0x401f75(0x1e9))/0xa*(parseInt(_0x401f75(0x1ae))/0xb)+parseInt(_0x401f75(0x1f3))/0xc;if(_0x292e0a===_0x46f144)break;else _0x1b68cc['push'](_0x1b68cc['shift']());}catch(_0x34f7eb){_0x1b68cc['push'](_0x1b68cc['shift']());}}}(a6_0x3e65,0x3e455));const path=require(a6_0x3ff0cf(0x1b4)),os=require('os'),child_process=require(a6_0x3ff0cf(0x1ef)),axios=require(a6_0x3ff0cf(0x1a4)),inquirer=require(a6_0x3ff0cf(0x1e0)),{getApiHost}=require('./config'),{CONSTANTS,logInfo,logSuccess,logWarning,logError,executeCommand,fileExists,readFile,writeFile}=require(a6_0x3ff0cf(0x1d3)),{loadAuth}=require(a6_0x3ff0cf(0x1c2));function getGitInfo(){const _0x48b1c1=a6_0x3ff0cf;let _0x2a6c28=_0x48b1c1(0x202),_0x4476e7='unknown';try{_0x2a6c28=child_process[_0x48b1c1(0x1ea)](_0x48b1c1(0x1bc),{'cwd':process[_0x48b1c1(0x1e2)](),'stdio':'pipe'})['toString']()['trim']();}catch(_0x17ae83){}try{_0x4476e7=child_process['execSync'](_0x48b1c1(0x1e6),{'cwd':process[_0x48b1c1(0x1e2)](),'stdio':_0x48b1c1(0x1e7)})[_0x48b1c1(0x1d6)]()[_0x48b1c1(0x1b3)]();}catch(_0x8f1bbf){}return{'branch':_0x2a6c28,'gitUser':_0x4476e7};}function generateMetadataComment(_0x195a68){const _0x4807bf=a6_0x3ff0cf,{branch:_0x5cc6d5,gitUser:_0xdedbb0,hostname:_0x250acb,platform:_0x2b5bb9,publishTime:_0x3b0058,version:_0x58b0e0,cmdVersion:_0x3fe62f}=_0x195a68;return'/**\x20git-branch:\x20'+_0x5cc6d5+_0x4807bf(0x1a0)+_0x250acb+'\x20('+_0x2b5bb9+')\x20|\x20publish-time:\x20'+_0x3b0058+'\x20|\x20git-user:\x20'+_0xdedbb0+'\x20|\x20publish-version:\x20'+_0x58b0e0+_0x4807bf(0x1d4)+_0x3fe62f+_0x4807bf(0x19b);}function a6_0x5c6a(_0x380fb8,_0x4b74cc){_0x380fb8=_0x380fb8-0x194;const _0x3e6502=a6_0x3e65();let _0x5c6ae3=_0x3e6502[_0x380fb8];return _0x5c6ae3;}function parseComponentConfig(_0x9936d1){const _0x55d344=a6_0x3ff0cf,_0x58106f=_0x9936d1[_0x55d344(0x1b5)](/(window\[).+?(\.componentKey|.+]={)/img);if(!_0x58106f||!_0x58106f[_0x55d344(0x1a5)])throw new Error(_0x55d344(0x1fc));const _0x84cc8d={},_0x4cb586=_0x9936d1[_0x55d344(0x1b5)](/componentKey.+([{,]info:\s{0,}{)/img);if(!_0x4cb586||!_0x4cb586[_0x55d344(0x1a5)])throw new Error(_0x55d344(0x1d0));let _0x1a5dc8='{';const _0x155cc5=_0x9936d1[_0x55d344(0x197)](_0x4cb586[0x0])[0x1];for(let _0x2cabd0=0x0;_0x2cabd0<_0x155cc5[_0x55d344(0x1a5)];_0x2cabd0++){_0x1a5dc8+=_0x155cc5[_0x2cabd0];if(_0x155cc5[_0x2cabd0]==='}'){try{const _0x1d1f66=new Function(_0x55d344(0x1e4)+_0x1a5dc8)();Object['assign'](_0x84cc8d,_0x1d1f66),_0x84cc8d[_0x55d344(0x1a7)]={};}catch(_0x51a2f3){}break;}}const _0x3b4cff=_0x9936d1['match'](/componentKey.+([{,]settings:\s{0,}{)/img);if(!_0x3b4cff||!_0x3b4cff[_0x55d344(0x1a5)])throw new Error(_0x55d344(0x1c9));let _0x324d35='{';const _0x1f844c=_0x9936d1[_0x55d344(0x197)](_0x3b4cff[0x0])[0x1];for(let _0x2d134b=0x0;_0x2d134b<_0x1f844c[_0x55d344(0x1a5)];_0x2d134b++){_0x324d35+=_0x1f844c[_0x2d134b];if(_0x1f844c[_0x2d134b]==='}'){try{_0x84cc8d[_0x55d344(0x1a7)]=new Function(_0x55d344(0x1e4)+_0x324d35)();}catch(_0x57bd72){}break;}}return JSON[_0x55d344(0x1f7)](_0x84cc8d);}function executeBuild(_0xab3078){const _0x3c221a=a6_0x3ff0cf,_0x53a519=path[_0x3c221a(0x1b6)](_0xab3078,'yarn.lock');fileExists(_0x53a519)?executeCommand(_0x3c221a(0x1d9),_0xab3078):executeCommand('npm\x20run\x20build:production',_0xab3078);}function validateRequiredFiles(_0x4e7c1a){const _0x4113bd=a6_0x3ff0cf,_0x522b9c=path[_0x4113bd(0x1b6)](_0x4e7c1a,_0x4113bd(0x1ee)),_0x3dd63f=path[_0x4113bd(0x1b6)](_0x4e7c1a,_0x4113bd(0x1d1),_0x4113bd(0x1dc)),_0x1f2c11=path['join'](_0x4e7c1a,_0x4113bd(0x195)),_0x36c9db=path['join'](_0x4e7c1a,_0x4113bd(0x1b9));if(!fileExists(_0x1f2c11))throw new Error(_0x4113bd(0x1d5));if(!fileExists(_0x3dd63f))throw new Error(_0x4113bd(0x1cb));if(!fileExists(_0x522b9c))throw new Error('请在组件根目录添加一个README.md说明文件!');if(!fileExists(_0x36c9db))throw new Error('请在组件根目录为组件添加一个缩略图\x22thumbnail.png\x22文件!');return{'readmePath':_0x522b9c,'distPath':_0x3dd63f,'packageJsonPath':_0x1f2c11,'thumbnailPath':_0x36c9db};}const submitFun=function(_0x17185d,_0x421042){const _0x25630f=a6_0x3ff0cf;_0x421042[_0x25630f(0x1f5)]=_0x17185d||_0x25630f(0x206),axios['post'](getApiHost()+_0x25630f(0x1f9),_0x421042)[_0x25630f(0x1ca)](_0x475ba5=>{const _0x346247=_0x25630f;logSuccess(_0x475ba5[_0x346247(0x1f1)][_0x346247(0x1f5)]||_0x346247(0x1f6)),process[_0x346247(0x203)](0x0);})[_0x25630f(0x1ad)](_0x58c347=>{const _0x1b0c35=_0x25630f;if(_0x58c347&&_0x58c347[_0x1b0c35(0x1ff)]){const _0x4f5d66=_0x58c347[_0x1b0c35(0x1ff)][_0x1b0c35(0x1af)],_0x14f91a=_0x58c347[_0x1b0c35(0x1ff)]['data']&&(_0x58c347['response'][_0x1b0c35(0x1f1)][_0x1b0c35(0x1f5)]||_0x58c347[_0x1b0c35(0x1ff)][_0x1b0c35(0x1f1)]['msg'])||'';logError(_0x1b0c35(0x1ce)+_0x4f5d66+_0x1b0c35(0x1f8)+(_0x14f91a||_0x58c347['message']));}else _0x58c347&&_0x58c347['request']?logError('网络连接失败:\x20无法连接到服务器'):logError(_0x1b0c35(0x1e3)+(_0x58c347[_0x1b0c35(0x1f5)]||_0x1b0c35(0x204)));process['exit'](0x1);});};module[a6_0x3ff0cf(0x1da)]=_0x353591=>{const _0x10013b=a6_0x3ff0cf,_0x7fcaa5=path[_0x10013b(0x1b6)](__dirname,_0x10013b(0x1dd));!fileExists(_0x7fcaa5)&&(logError('未检测到认证信息,请先执行登录操作'),process[_0x10013b(0x203)](0x1));let _0x588ea6,_0x400d85;try{logInfo(_0x10013b(0x1be));const _0x38dbd4=loadAuth(_0x7fcaa5);_0x588ea6=_0x38dbd4[_0x10013b(0x1e5)],_0x400d85=_0x38dbd4[_0x10013b(0x19d)],logSuccess(_0x10013b(0x19f));}catch(_0x1a0acb){logError(_0x10013b(0x1db)+_0x1a0acb[_0x10013b(0x1f5)]),process[_0x10013b(0x203)](0x1);}logInfo(_0x10013b(0x196)),axios[_0x10013b(0x1a8)](getApiHost()+_0x10013b(0x1ab),{'username':_0x588ea6,'password':_0x400d85})[_0x10013b(0x1ca)](async _0x80d6c=>{const _0x10553e=_0x10013b;if(_0x80d6c[_0x10553e(0x1f1)][_0x10553e(0x1af)]){logSuccess(_0x10553e(0x1df));const _0x3ee9d2=path[_0x10553e(0x1d2)]('./');logInfo(_0x10553e(0x1de));try{executeBuild(_0x3ee9d2),logSuccess(_0x10553e(0x1bf));}catch(_0x1555e4){logError(_0x10553e(0x1a2)+_0x1555e4[_0x10553e(0x1f5)]),process[_0x10553e(0x203)](0x1);}logInfo(_0x10553e(0x1cd));let _0x54d800;try{_0x54d800=validateRequiredFiles(_0x3ee9d2),logSuccess(_0x10553e(0x1ac));}catch(_0x53c5da){logError(_0x53c5da[_0x10553e(0x1f5)]),process[_0x10553e(0x203)](0x1);}logInfo(_0x10553e(0x1bd));const _0xd23110=JSON[_0x10553e(0x1f2)](readFile(path[_0x10553e(0x1b6)](__dirname,_0x10553e(0x1d7)))),{version:_0x151e8c}=_0xd23110;logInfo(_0x10553e(0x1aa));const _0x3e38bf=getGitInfo(),_0x232083=new Date()[_0x10553e(0x19a)](),_0x58825a=readFile(_0x54d800['distPath']),_0x13e09c=generateMetadataComment({'branch':_0x3e38bf[_0x10553e(0x1a3)],'gitUser':_0x3e38bf['gitUser'],'hostname':os[_0x10553e(0x1fe)](),'platform':os['platform'](),'publishTime':_0x232083,'version':_0x353591||_0x10553e(0x1fa),'cmdVersion':_0x151e8c})+_0x58825a;logSuccess(_0x10553e(0x1fb)),logInfo(_0x10553e(0x1b2));const _0x3cb18c={'username':_0x588ea6,'cmd_version':_0x151e8c,'hostname':os[_0x10553e(0x1fe)](),'platform':os[_0x10553e(0x1b0)](),'package_version':_0x353591||0x0,'package_content':_0x13e09c,'readme_content':readFile(_0x54d800[_0x10553e(0x1f4)])};try{logInfo(_0x10553e(0x1d8)),_0x3cb18c['component_config_content']=parseComponentConfig(_0x13e09c),logSuccess('组件配置解析完成');}catch(_0x55bb9e){logError(_0x55bb9e['message']),process[_0x10553e(0x203)](0x1);}logInfo(_0x10553e(0x19c));const _0x2def3b=readFile(_0x54d800['thumbnailPath'],_0x10553e(0x1c5));_0x3cb18c['thumbnail_base64']=Buffer[_0x10553e(0x194)](_0x2def3b,'binary')[_0x10553e(0x1d6)]('base64'),logSuccess('缩略图处理完成'),logWarning(_0x10553e(0x199)),logWarning(_0x10553e(0x1c4)),logWarning(_0x10553e(0x1c1)),logWarning(_0x10553e(0x1b8)),logWarning('\x20\x203.\x20已确认版本号和发布信息正确'),logWarning('\x20\x204.\x20已了解发布后的影响范围'),logWarning(_0x10553e(0x1a9)),await new Promise(_0x213ab9=>{let _0x466f7c=0xa;const _0x3f4c6a=setInterval(()=>{const _0x26e58d=a6_0x5c6a;process[_0x26e58d(0x1c6)][_0x26e58d(0x1b7)](_0x26e58d(0x1f0)+_0x466f7c+'\x20秒...\x20\x20'),_0x466f7c--,_0x466f7c<0x0&&(clearInterval(_0x3f4c6a),process[_0x26e58d(0x1c6)]['write']('\x0d\x0a'),_0x213ab9());},0x3e8);});const {confirmed:_0x56c8ec}=await inquirer[_0x10553e(0x1e8)]([{'type':_0x10553e(0x1fd),'name':_0x10553e(0x1c0),'message':_0x10553e(0x1c7),'default':![]}]);!_0x56c8ec&&(logInfo(_0x10553e(0x1e1)),process[_0x10553e(0x203)](0x0));const {message:_0x24f50b}=await inquirer[_0x10553e(0x1e8)]([{'type':_0x10553e(0x1ec),'name':_0x10553e(0x1f5),'message':_0x10553e(0x198),'default':'no\x20message'}]);logInfo('正在提交发布请求...'),submitFun(_0x24f50b||'no\x20message',_0x3cb18c);}else logError('授权失败:\x20'+(_0x80d6c['data'][_0x10553e(0x1f5)]||_0x10553e(0x204))),process[_0x10553e(0x203)](0x1);})[_0x10013b(0x1ad)](_0xb13866=>{const _0x509b55=_0x10013b;if(_0xb13866&&_0xb13866['response']){const _0x3293e8=_0xb13866['response']['status'];if(_0x3293e8===0x191||_0x3293e8===0x193)logError(_0x509b55(0x19e)+_0x3293e8+_0x509b55(0x201));else{const _0x4c094c=_0xb13866[_0x509b55(0x1ff)][_0x509b55(0x1f1)]&&(_0xb13866[_0x509b55(0x1ff)][_0x509b55(0x1f1)][_0x509b55(0x1f5)]||_0xb13866[_0x509b55(0x1ff)]['data']['msg'])||'';logError(_0x509b55(0x1a1)+_0x3293e8+'):\x20'+(_0x4c094c||_0xb13866['message']));}}else _0xb13866&&_0xb13866[_0x509b55(0x1ed)]?logError(_0x509b55(0x1cf)):logError(_0x509b55(0x205)+(_0xb13866?_0xb13866[_0x509b55(0x1f5)]:_0x509b55(0x204)));process['exit'](0x1);});};function a6_0x3e65(){const _0x1224ac=['post','\x20\x205.\x20发布成功后请立即通知相关人员进行测试和验证','正在注入组件追溯信息...','/api/auth','文件验证通过','catch','88NMjPIv','status','platform','564WTPdEO','正在准备发布数据...','trim','path','match','join','write','\x20\x202.\x20已检查构建产物完整性','thumbnail.png','12cWyMmL','4FkRVzI','git\x20rev-parse\x20--abbrev-ref\x20HEAD','正在读取包信息...','正在加载认证信息...','项目构建完成','confirmed','\x20\x201.\x20已充分测试组件各项功能','./crypto-utils','214685eogsNL','发布错误可能导致线上应用产生严重生产故障,请务必确保:','binary','stdout','我已充分了解以上可能存在的严重风险,确认继续发布操作?','2063705ASleRS','暴露的配置信息中缺少\x22settings\x22!','then','组件发布失败!根目录缺少\x27dist/index.js\x27文件!','820VGhvZv','正在验证发布所需文件...','发布失败\x20(','网络连接失败:\x20无法连接到服务器或服务器无响应','暴露的配置信息中缺少\x22info\x22!','dist','resolve','./utils','\x20|\x20cmd-version:\x20','组件发布失败!根目录缺少\x27package.json\x27文件!','toString','../package.json','正在解析组件配置信息...','yarn\x20build:production','exports','读取认证信息失败:\x20','index.js','../.auth','正在执行项目构建...','服务器授权成功','inquirer','发布操作已取消','cwd','发布失败:\x20','return\x20','username','git\x20config\x20user.name','pipe','prompt','539940DTdemh','execSync','9lRaYDH','input','request','README.md','child_process','\x0d倒计时\x20','data','parse','4471524UGqTiA','readmePath','message','组件发布成功','stringify','):\x20','/api/file/publish','0.0.0','追溯信息注入完成','请在组件入口文件中添加\x22window[props.componentKey]\x22以暴露组件的配置信息!','confirm','hostname','response','727770IPEafl','):\x20认证信息无效或无权限','unknown','exit','未知错误','操作失败:\x20','no\x20message','from','package.json','正在请求服务器授权...','split','请输入此次组件发布的信息:','警告:您即将进行组件发布操作,此操作不可逆,请谨慎操作','toISOString','\x20**/\x0a','正在处理缩略图...','password','授权失败\x20(','认证信息加载成功','\x20|\x20device:\x20','请求失败\x20(','项目构建失败:\x20','branch','axios','length','1257848ccPZBt','defaultSetting'];a6_0x3e65=function(){return _0x1224ac;};return a6_0x3e65();}