esoftplay 0.0.121-d → 0.0.121-e

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
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  const fs = require('fs');
3
3
  const exec = require('child_process').execSync;
4
+ const execAsync = require('child_process').exec;
4
5
  const path = require('path');
5
6
  const os = require('os')
6
7
  const readline = require('readline');
@@ -63,6 +64,13 @@ switch (args[0]) {
63
64
  case "build":
64
65
  build()
65
66
  break;
67
+ case "bc":
68
+ case "build-cancel":
69
+ if (fs.existsSync('./node_modules/esoftplaymodules'))
70
+ command('rm -rf modules && mv ./node_modules/esoftplaymodules modules')
71
+ else
72
+ consoleError("build cancel sudah dilakukan sebelumnya")
73
+ break;
66
74
  case "vn":
67
75
  case "version-new":
68
76
  incrementVersion()
@@ -644,56 +652,28 @@ function devClientPos(file) {
644
652
  }
645
653
 
646
654
  function cacheBuild(include = true) {
647
- // if (include) {
648
- // if (fs.existsSync('./esoftplay')) {
649
- // command('rm -rf ./esoftplay')
650
- // }
651
- // if (!fs.existsSync('./modules_ori')) {
652
- // command('cp -r ./modules ./modules_ori')
653
- // }
654
- // command('cp -r ./node_modules/esoftplay ./')
655
-
656
-
657
- // if (fs.existsSync('./esoftplay/modules')) {
658
- // fs.readdirSync('./esoftplay/modules').forEach((module) => {
659
- // if (!module.startsWith('.'))
660
- // fs.readdirSync('./esoftplay/modules/' + module).forEach((task) => {
661
- // let file = fs.readFileSync(`./esoftplay/modules/${module}/${task}`, { encoding: 'utf8' }).replace(/esoftplay\/cache/g, "../../cache")
662
- // fs.writeFileSync(`./esoftplay/modules/${module}/${task}`, file, { encoding: 'utf8' })
663
- // })
664
- // })
665
- // }
666
-
667
- // if (fs.existsSync('./modules')) {
668
- // fs.readdirSync('./modules').forEach((module) => {
669
- // if (!module.startsWith('.'))
670
- // fs.readdirSync('./modules/' + module).forEach((task) => {
671
- // let file = fs.readFileSync(`./modules/${module}/${task}`, { encoding: 'utf8' }).replace(/esoftplay\/cache/g, "../../esoftplay/cache")
672
- // fs.writeFileSync(`./modules/${module}/${task}`, file, { encoding: 'utf8' })
673
- // })
674
- // })
675
- // }
676
- // if (fs.existsSync('./esoftplay/cache')) {
677
- // fs.readdirSync('./esoftplay/cache').forEach((module) => {
678
- // if (!module.startsWith('.'))
679
- // if (fs.lstatSync('./esoftplay/cache/' + module).isDirectory()) {
680
- // fs.readdirSync('./esoftplay/cache/' + module).forEach((task) => {
681
- // fs.readdirSync(`./esoftplay/cache/${module}/${task}`).forEach((imprt) => {
682
- // console.log(`./esoftplay/cache/${module}/${task}/import.js`)
683
- // let file = fs.readFileSync(`./esoftplay/cache/${module}/${task}/import.js`, { encoding: 'utf8' }).replace(/\.\.\/\.\.\/\.\.\/\.\.\/\.\.\//g, "../../../../")
684
- // file = file.replace(/\.\.\/\.\.\/\.\.\/\.\.\/node_modules\/esoftplay\//g, "../../../")
685
- // fs.writeFileSync(`./esoftplay/cache/${module}/${task}/import.js`, file, { encoding: 'utf8' })
686
- // })
687
- // })
688
- // }
689
- // })
690
- // }
691
-
692
- // } else {
693
- // command('rm -rf ./esoftplay')
694
- // command('rm -rf ./modules')
695
- // command('mv ./modules_ori ./modules')
696
- // }
655
+ if (include) {
656
+ if (!fs.existsSync('./node_modules/esoftplaymodules')) {
657
+ fs.mkdirSync('./node_modules/esoftplaymodules')
658
+ command('cp -r ./modules/* ./node_modules/esoftplaymodules')
659
+ }
660
+
661
+ if (fs.existsSync('./node_modules/esoftplay/modules')) {
662
+ let comm = []
663
+ fs.readdirSync('./node_modules/esoftplay/modules').forEach((module) => {
664
+ if (!module.startsWith('.')) {
665
+ if (!fs.existsSync(`./modules/${module}`)) {
666
+ fs.mkdirSync(`./modules/${module}`)
667
+ }
668
+ comm.push(`cp -n ./node_modules/esoftplay/modules/${module}/* ./modules/${module}`)
669
+ }
670
+ });
671
+ (async () => await execAsync(comm.join(" && ")))();
672
+ }
673
+ } else {
674
+ if (fs.existsSync('./node_modules/esoftplaymodules'))
675
+ command('rm -rf modules && mv ./node_modules/esoftplaymodules modules')
676
+ }
697
677
  }
698
678
 
699
679
  function configAvailable(enabled) {
@@ -961,6 +941,7 @@ function help() {
961
941
  "\n - u|update all : untuk update semua esp module ke versi terakhir",
962
942
  "\n - start : start esoftplay framework",
963
943
  "\n - b|build : untuk build app .ipa .apk .aab",
944
+ "\n - bc|build-cancel : untuk build app .ipa .apk .aab",
964
945
  "\n - f|file : untuk check status file",
965
946
  "\n - c|check : untuk check status",
966
947
  "\n - create-master [moduleName] : untuk create master module terpisah",
package/libs/worker.tsx CHANGED
@@ -1,8 +1,8 @@
1
1
  import { esp } from "esoftplay";
2
+ import _global from "esoftplay/_global";
2
3
  import React from "react";
3
4
  import { Platform, View } from 'react-native';
4
5
  import WebView from "react-native-webview";
5
- const _global = require('../_global').default
6
6
 
7
7
  _global.WorkerBase = React.createRef()
8
8
  _global.WorkerTasks = new Map()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.121-d",
3
+ "version": "0.0.121-e",
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",