esoftplay 0.0.138-u → 0.0.138-v
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/cli.js +5 -6
- package/bin/connector.js +28 -30
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -81,6 +81,10 @@ switch (args[0]) {
|
|
|
81
81
|
case "check":
|
|
82
82
|
doctor()
|
|
83
83
|
break
|
|
84
|
+
case "cm":
|
|
85
|
+
case "connect-module":
|
|
86
|
+
command('bun ./node_modules/esoftplay/bin/connector.js')
|
|
87
|
+
break
|
|
84
88
|
case "b":
|
|
85
89
|
case "build":
|
|
86
90
|
buildPrepare(true)
|
|
@@ -737,12 +741,6 @@ Pastikan data sudah benar sebelum anda melanjutkan, lanjut publish ketikkan runt
|
|
|
737
741
|
}
|
|
738
742
|
});
|
|
739
743
|
}
|
|
740
|
-
if (cjson.config.connected_modules) {
|
|
741
|
-
if (cjson.config.connected_modules.length > 0) {
|
|
742
|
-
consoleSucces("<== CONNECTED MODULE DETECTED ==>")
|
|
743
|
-
command('bun ./node_modules/esoftplay/bin/connector.js')
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
744
|
}
|
|
747
745
|
}
|
|
748
746
|
|
|
@@ -1256,6 +1254,7 @@ function help() {
|
|
|
1256
1254
|
"\n - bc|build-cancel : untuk cancel build prepare",
|
|
1257
1255
|
"\n - f|file : untuk check status file",
|
|
1258
1256
|
"\n - c|check : untuk check status",
|
|
1257
|
+
"\n - cm|connect-module : untuk update module berdasarkan source",
|
|
1259
1258
|
"\n - create-master [moduleName] : untuk create master module terpisah",
|
|
1260
1259
|
"\n - d|debug : untuk ubah status DEBUG",
|
|
1261
1260
|
"\n - l|live : untuk ubah status LIVE",
|
package/bin/connector.js
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
2
|
|
|
3
|
-
if (fs.existsSync('./
|
|
4
|
-
const
|
|
3
|
+
if (fs.existsSync('./raw/connected.json')) {
|
|
4
|
+
const { source, modules } = JSON.parse(fs.readFileSync('./raw/connected.json'))
|
|
5
5
|
const currentProject = './modules/';
|
|
6
6
|
|
|
7
|
-
if (
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ext.forEach((fext) => {
|
|
25
|
-
const source = currentProject + module + fext;
|
|
26
|
-
const destination = path + "/modules/" + module + fext;
|
|
7
|
+
if (source) {
|
|
8
|
+
if (modules.length > 0) {
|
|
9
|
+
modules.forEach((module) => {
|
|
10
|
+
const ext = [
|
|
11
|
+
'.ts',
|
|
12
|
+
'.tsx',
|
|
13
|
+
'.js',
|
|
14
|
+
'.debug.ts',
|
|
15
|
+
'.debug.tsx',
|
|
16
|
+
'.debug.js',
|
|
17
|
+
'.live.ts',
|
|
18
|
+
'.live.tsx',
|
|
19
|
+
'.live.js',
|
|
20
|
+
]
|
|
21
|
+
ext.forEach((fext) => {
|
|
22
|
+
const _source = source + "/modules/" + module + fext;
|
|
23
|
+
const _destination = currentProject + module + fext;
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
fs.writeFileSync(destination, file, { encoding: 'utf8' })
|
|
25
|
+
if (fs.existsSync(_source)) {
|
|
26
|
+
console.log({ _source, _destination })
|
|
27
|
+
const file = fs.readFileSync(_source, { encoding: 'utf8' })
|
|
28
|
+
const [mod] = module.split('/')
|
|
29
|
+
if (!fs.existsSync(currentProject + mod)) {
|
|
30
|
+
fs.mkdirSync(currentProject + mod)
|
|
35
31
|
}
|
|
36
|
-
|
|
32
|
+
fs.writeFileSync(_destination, file, { encoding: 'utf8' })
|
|
33
|
+
console.log('>_ ' + module + fext + ' connected!')
|
|
34
|
+
}
|
|
37
35
|
})
|
|
38
36
|
})
|
|
39
37
|
}
|