@serverless-devs/s 2.2.2 → 3.0.0-85afd68d
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/lib/daemon/lib.js +327 -0
- package/lib/daemon/report.js +50 -0
- package/lib/daemon/update-cli.js +20 -0
- package/lib/daemon/update-component.js +21 -0
- package/lib/daemon/update-templates.js +19 -0
- package/lib/index.js +1677 -246
- package/package.json +62 -48
- package/readme.md +2 -2
- package/lib/check-node-version/index.js +0 -15
- package/lib/clean/index.js +0 -166
- package/lib/cli/index.js +0 -223
- package/lib/component/index.js +0 -286
- package/lib/config/add/index.js +0 -190
- package/lib/config/common/common.js +0 -194
- package/lib/config/delete/index.js +0 -121
- package/lib/config/get/index.js +0 -130
- package/lib/config/index.js +0 -39
- package/lib/config/rename/index.js +0 -132
- package/lib/constant.js +0 -8
- package/lib/daemon/template.js +0 -20
- package/lib/daemon/update.js +0 -9
- package/lib/edit/index.js +0 -104
- package/lib/error/command-error.js +0 -29
- package/lib/error/config-delete-error.js +0 -29
- package/lib/error/config-error.js +0 -29
- package/lib/error/config-get-error.js +0 -29
- package/lib/error/human-error.js +0 -76
- package/lib/error/human-warning.js +0 -20
- package/lib/error/index.js +0 -147
- package/lib/error/init-error.js +0 -29
- package/lib/error/serverless-error.js +0 -19
- package/lib/execDaemon.js +0 -35
- package/lib/global-agent/index.js +0 -22
- package/lib/help/index.js +0 -158
- package/lib/init/index.js +0 -106
- package/lib/init/init-config.js +0 -606
- package/lib/init/init-manager.js +0 -223
- package/lib/onboarding/index.js +0 -111
- package/lib/set/analysis/index.js +0 -118
- package/lib/set/index.js +0 -40
- package/lib/set/locale/index.js +0 -118
- package/lib/set/log/index.js +0 -118
- package/lib/set/proxy/index.js +0 -123
- package/lib/set/registry/index.js +0 -146
- package/lib/set/workspace/index.js +0 -119
- package/lib/special-commad/index.js +0 -156
- package/lib/update-notifier/index.js +0 -137
- package/lib/utils/common.js +0 -347
- package/lib/utils/core.js +0 -49
- package/lib/utils/handler-set-config.js +0 -130
- package/lib/utils/i18n/en.js +0 -46
- package/lib/utils/i18n/index.js +0 -16
- package/lib/utils/i18n/zh.js +0 -46
- package/lib/utils/index.js +0 -39
- package/lib/utils/logger.js +0 -12
- package/lib/verify/index.js +0 -224
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const { Report } = require('./lib');
|
|
2
|
+
|
|
3
|
+
(async () => {
|
|
4
|
+
try {
|
|
5
|
+
console.log('********Starting report in daemon********');
|
|
6
|
+
|
|
7
|
+
// Exit process when offline
|
|
8
|
+
setTimeout(process.exit, 1000 * 30);
|
|
9
|
+
const { type, template, uid, argv, command, component, message, userAgent } = JSON.parse(process.argv[2]);
|
|
10
|
+
console.log('type', type);
|
|
11
|
+
const instance = new Report();
|
|
12
|
+
const run = async () => {
|
|
13
|
+
if (type === 'init') {
|
|
14
|
+
console.log('template', template);
|
|
15
|
+
return await instance.reportInit({ template });
|
|
16
|
+
}
|
|
17
|
+
console.log('userAgent', userAgent);
|
|
18
|
+
console.log('command', command);
|
|
19
|
+
if (type === 'command') {
|
|
20
|
+
console.log('uid', uid);
|
|
21
|
+
console.log('argv', argv);
|
|
22
|
+
console.log('component', component);
|
|
23
|
+
return await instance.reportCommand({ uid, argv, command, component, userAgent });
|
|
24
|
+
}
|
|
25
|
+
// 解析异常
|
|
26
|
+
if (type === 'parseException') {
|
|
27
|
+
console.log('uid', uid);
|
|
28
|
+
console.log('argv', argv);
|
|
29
|
+
console.log('message', message);
|
|
30
|
+
return await instance.reportParseException({ argv, command, message, userAgent });
|
|
31
|
+
}
|
|
32
|
+
// 执行异常
|
|
33
|
+
if (type === 'runtimeException') {
|
|
34
|
+
console.log('uid', uid);
|
|
35
|
+
console.log('argv', argv);
|
|
36
|
+
console.log('component', component);
|
|
37
|
+
console.log('message', message);
|
|
38
|
+
return await instance.reportRuntimeException({ uid, argv, command, component, message, userAgent });
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
await run();
|
|
42
|
+
console.log('********report successfully in daemon********');
|
|
43
|
+
// Call process exit explicitly to terminate the child process,
|
|
44
|
+
// otherwise the child process will run forever, according to the Node.js docs
|
|
45
|
+
process.exit();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
})();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const { UpdateNotifier } = require('./lib');
|
|
2
|
+
|
|
3
|
+
(async () => {
|
|
4
|
+
try {
|
|
5
|
+
console.log('********Starting update cli in daemon********');
|
|
6
|
+
|
|
7
|
+
// Exit process when offline
|
|
8
|
+
setTimeout(process.exit, 1000 * 30);
|
|
9
|
+
|
|
10
|
+
const updateNotifier = new UpdateNotifier();
|
|
11
|
+
await updateNotifier.update();
|
|
12
|
+
console.log('********Update cli successfully in daemon********');
|
|
13
|
+
// Call process exit explicitly to terminate the child process,
|
|
14
|
+
// otherwise the child process will run forever, according to the Node.js docs
|
|
15
|
+
process.exit();
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error(error);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
})();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const { Component } = require('./lib');
|
|
2
|
+
|
|
3
|
+
(async () => {
|
|
4
|
+
try {
|
|
5
|
+
console.log('********Starting update component in daemon********');
|
|
6
|
+
|
|
7
|
+
// Exit process when offline
|
|
8
|
+
setTimeout(process.exit, 1000 * 30);
|
|
9
|
+
const { component } = JSON.parse(process.argv[2]);
|
|
10
|
+
console.log('component', component);
|
|
11
|
+
const instance = new Component(component);
|
|
12
|
+
await instance.update();
|
|
13
|
+
console.log('********Update component successfully in daemon********');
|
|
14
|
+
// Call process exit explicitly to terminate the child process,
|
|
15
|
+
// otherwise the child process will run forever, according to the Node.js docs
|
|
16
|
+
process.exit();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
console.error(error);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { Templates } = require('./lib');
|
|
2
|
+
|
|
3
|
+
(async () => {
|
|
4
|
+
try {
|
|
5
|
+
console.log('******** Starting update templates in daemon ********');
|
|
6
|
+
// Exit process when offline
|
|
7
|
+
setTimeout(process.exit, 1000 * 30);
|
|
8
|
+
|
|
9
|
+
const instance = new Templates();
|
|
10
|
+
await instance.update();
|
|
11
|
+
console.log('******** Update templates successfully in daemon ********');
|
|
12
|
+
// Call process exit explicitly to terminate the child process,
|
|
13
|
+
// otherwise the child process will run forever, according to the Node.js docs
|
|
14
|
+
process.exit();
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error(error);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
})();
|