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 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('./config.json')) {
4
- const config = JSON.parse(fs.readFileSync('./config.json', { encoding: 'utf8' }))
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 (config.config.connected_modules) {
8
- if (config.config.connected_modules.length > 0) {
9
- config.config.connected_modules.forEach((path) => {
10
- const modules = JSON.parse(fs.readFileSync(path + '/raw/connected_modules.json', { encoding: 'utf8' }))
11
- modules.forEach((module) => {
12
- console.log('>_ connecting.. ' + module)
13
- const ext = [
14
- '.ts',
15
- '.tsx',
16
- '.js',
17
- '.debug.ts',
18
- '.debug.tsx',
19
- '.debug.js',
20
- '.live.ts',
21
- '.live.tsx',
22
- '.live.js',
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
- if (fs.existsSync(source)) {
29
- const file = fs.readFileSync(source, { encoding: 'utf8' })
30
- const [mod, task] = module.split('/')
31
- if (!fs.existsSync(path + '/modules/' + mod)) {
32
- fs.mkdirSync(path + '/modules/' + mod)
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.138-u",
3
+ "version": "0.0.138-v",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",