@k3000/s1 0.2.6 → 0.3.0
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/bin.mjs +2 -24
- package/common/pm2.mjs +7 -4
- package/files/pm2.mjs +6 -0
- package/package.json +1 -1
- /package/{package.bin.json → files/package.bin.json} +0 -0
package/bin.mjs
CHANGED
@@ -3,7 +3,6 @@ import {cpSync, existsSync, mkdirSync} from "node:fs";
|
|
3
3
|
import {resolve, dirname} from "node:path";
|
4
4
|
|
5
5
|
import {pm2} from './common/pm2.mjs'
|
6
|
-
// import {proxyService, uiService} from "./common/config.mjs";
|
7
6
|
|
8
7
|
const [, , key, value] = process.argv
|
9
8
|
|
@@ -66,33 +65,12 @@ function init(override) {
|
|
66
65
|
myCopyFn('build.mjs', 'build.mjs', override)
|
67
66
|
myCopyFn('index.mjs', 'index.mjs', override)
|
68
67
|
myCopyFn('files/package.json', 'package.json', override)
|
68
|
+
myCopyFn('files/package.bin.json', 'package.bin.json', override)
|
69
|
+
myCopyFn('files/pm2.mjs', 'pm2.mjs', override)
|
69
70
|
|
70
|
-
// pm2.del(uiService)
|
71
|
-
// pm2.add(uiService, './backstage/index.mjs')
|
72
|
-
// pm2.stop(uiService)
|
73
71
|
pm2.save()
|
74
72
|
|
75
73
|
pm2.exec('npm i --registry=https://registry.npmmirror.com').log()
|
76
|
-
// pm2.exec('npm i dmb3').log()
|
77
|
-
// pm2.exec('npm i tools2').log()
|
78
|
-
// pm2.exec('npm i @k3000/express').log()
|
79
|
-
// pm2.exec('npm i @k3000/mysql').log()
|
80
|
-
// pm2.exec('npm i @k3000/proxy').log()
|
81
|
-
// pm2.exec('npm i @k3000/server').log()
|
82
|
-
// pm2.exec('npm i @k3000/store').log()
|
83
|
-
// pm2.exec('npm i @k3000/tools').log()
|
84
|
-
// pm2.exec('npm i @k3000/info').log()
|
85
|
-
// pm2.exec('npm i @k3000/build').log()
|
86
|
-
// pm2.exec('npm i svg-captcha').log()
|
87
|
-
// pm2.exec('npm i mysql2').log()
|
88
|
-
// pm2.exec('npm i ssh2').log()
|
89
|
-
// pm2.exec('npm i archiver').log()
|
90
|
-
// pm2.exec('npm i exceljs').log()
|
91
|
-
// pm2.exec('npm i body-parser').log()
|
92
|
-
// pm2.exec('npm i express-fileupload').log()
|
93
|
-
|
94
|
-
// pm2.del(proxyService)
|
95
|
-
// pm2.add(proxyService, './proxy.mjs')
|
96
74
|
}
|
97
75
|
|
98
76
|
/**
|
package/common/pm2.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
import {execSync} from 'node:child_process'
|
2
|
+
import {execSync, exec} from 'node:child_process'
|
3
3
|
|
4
4
|
class PM2 {
|
5
5
|
|
@@ -16,13 +16,16 @@ class PM2 {
|
|
16
16
|
}
|
17
17
|
|
18
18
|
/**
|
19
|
-
*
|
20
19
|
* @param {string} command
|
20
|
+
* @param {Boolean} sync
|
21
21
|
*/
|
22
|
-
exec(command) {
|
22
|
+
exec(command, sync = true) {
|
23
23
|
|
24
24
|
console.log(' > ' + command)
|
25
25
|
|
26
|
+
if (!sync) return exec(command, {windowsHide: true},
|
27
|
+
error => console.error(error))
|
28
|
+
|
26
29
|
const string = execSync(command).toString()
|
27
30
|
|
28
31
|
return {
|
@@ -142,4 +145,4 @@ class PM2 {
|
|
142
145
|
}
|
143
146
|
}
|
144
147
|
|
145
|
-
export const pm2 = new PM2()
|
148
|
+
export const pm2 = new PM2()
|
package/files/pm2.mjs
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
import {pm2} from "./common/pm2.mjs";
|
2
|
+
|
3
|
+
pm2.exec('node --experimental-vm-modules admin.mjs', false)
|
4
|
+
pm2.exec('node --experimental-vm-modules jwt.mjs', false)
|
5
|
+
pm2.exec('node --experimental-vm-modules store1.mjs', false)
|
6
|
+
pm2.exec('node --experimental-vm-modules proxy.mjs', false)
|
package/package.json
CHANGED
File without changes
|