esoftplay 0.0.121-b → 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 +31 -50
- package/libs/worker.tsx +1 -1
- package/modules/lib/picture.tsx +1 -1
- package/package.json +1 -1
- package/storage.ts +1 -1
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
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
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/modules/lib/picture.tsx
CHANGED
|
@@ -38,7 +38,7 @@ const getCacheEntry = async (uri: string, toSize: number): Promise<{ exists: boo
|
|
|
38
38
|
return { exists, path };
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const fetchPicture = Worker.registerJobAsync
|
|
41
|
+
const fetchPicture = Worker.registerJobAsync('lib_picture_fetch', (url: string, toSize: number) => {
|
|
42
42
|
'show source';
|
|
43
43
|
return new Promise((resolve, reject) => {
|
|
44
44
|
fetch(url, { mode: 'cors' })
|
package/package.json
CHANGED