esoftplay 0.0.132 → 0.0.133
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/build.js +3 -15
- package/bin/cli.js +35 -16
- package/bin/mover.js +3 -3
- package/bin/router.js +39 -483
- package/bin/run.js +10 -0
- package/error.d.ts +1 -0
- package/error.ts +8 -8
- package/esp.d.ts +2 -0
- package/global.d.ts +2 -0
- package/global.ts +3 -9
- package/lazy.d.ts +2 -0
- package/modules/lib/component.tsx +20 -23
- package/modules/lib/dropdown.tsx +1 -1
- package/modules/lib/editbox.tsx +1 -1
- package/modules/lib/image.tsx +1 -1
- package/modules/lib/locale.ts +2 -2
- package/modules/lib/net_status.tsx +2 -2
- package/modules/lib/notification.ts +1 -2
- package/modules/lib/sociallogin.tsx +1 -1
- package/modules/lib/theme.tsx +1 -1
- package/modules/lib/updater.tsx +8 -6
- package/modules/lib/utils.ts +1 -1
- package/modules/lib/version.tsx +1 -1
- package/modules/lib/webview.tsx +1 -1
- package/modules/lib/workloop.tsx +1 -1
- package/modules/use/deeplink.ts +1 -1
- package/modules/use/tasks.ts +1 -1
- package/modules/user/class.ts +2 -2
- package/modules/user/loading.tsx +1 -1
- package/modules/user/notification.tsx +2 -2
- package/modules/user/routes.ts +1 -2
- package/moment.d.ts +2 -0
- package/package.json +6 -3
- package/persist.d.ts +2 -0
- package/publisher.js +1 -1
- package/state.d.ts +2 -0
- package/state.ts +1 -1
- package/storage.d.ts +2 -0
- package/subscribe.d.ts +2 -0
- /package/{config.js → config.json} +0 -0
package/bin/build.js
CHANGED
|
@@ -16,11 +16,6 @@ const appts = DIR + "App.tsx"
|
|
|
16
16
|
const pathJSTimer = DIR + "node_modules/react-native/Libraries/Core/Timers/JSTimers.js"
|
|
17
17
|
const lowercasePrompt = 'if (/^[a-z]/.test(component.name)) {'
|
|
18
18
|
const pathLowercasePrompt = DIR + 'node_modules/@react-navigation/core/src/useNavigationBuilder.tsx'
|
|
19
|
-
/**
|
|
20
|
-
* function ini untuk mengambil name autocomplete dari @expo/vector-icons untuk library LibIcon
|
|
21
|
-
* function akan di injectkan di folder @expo/vector-icons/build dengan nama file esoftplay_icons.ts
|
|
22
|
-
* function ini hanya akan dieksekusi sekali saat install esoftplay framework
|
|
23
|
-
*/
|
|
24
19
|
|
|
25
20
|
if (fs.existsSync(packjson)) {
|
|
26
21
|
let txt = fs.readFileSync(packjson, 'utf8');
|
|
@@ -346,20 +341,13 @@ export default UserIndex`;
|
|
|
346
341
|
fs.mkdirSync(DIR + 'modules')
|
|
347
342
|
let cmd = "cd ../../ "
|
|
348
343
|
if (installDevLibs.length > 0)
|
|
349
|
-
cmd += "&&
|
|
344
|
+
cmd += "&& yarn add " + installDevLibs.join(" ") + " --dev "
|
|
350
345
|
if (installExpoLibs.length > 0)
|
|
351
346
|
cmd += "&& expo install " + installExpoLibs.join(" ")
|
|
352
347
|
execSync(cmd + "|| true")
|
|
353
|
-
execSync("cd ../../ &&
|
|
354
|
-
execSync("cd ../../ &&
|
|
348
|
+
execSync("cd ../../ && node ./node_modules/esoftplay/bin/router.js || true")
|
|
349
|
+
execSync("cd ../../ && node ./node_modules/esoftplay/bin/locale.js || true")
|
|
355
350
|
console.log('App.js has been replace to App.tsx');
|
|
356
|
-
// /* bugfix AsyncStorage @firebase, remove this section if firebase has update the AsyncStorage */
|
|
357
|
-
// if (fs.existsSync('../@firebase/app/dist/index.rn.cjs.js')) {
|
|
358
|
-
// let firebaseText = fs.readFileSync('../@firebase/app/dist/index.rn.cjs.js', 'utf8')
|
|
359
|
-
// firebaseText = firebaseText.replace("var AsyncStorage = require('react-native').AsyncStorage;", "var AsyncStorage = require('@react-native-async-storage/async-storage').default;")
|
|
360
|
-
// fs.writeFileSync('../@firebase/app/dist/index.rn.cjs.js', firebaseText)
|
|
361
|
-
// }
|
|
362
|
-
// /* end AsyncStorage @firebase section */
|
|
363
351
|
if (appjson)
|
|
364
352
|
|
|
365
353
|
if (fs.existsSync('../@expo/vector-icons')) {
|
package/bin/cli.js
CHANGED
|
@@ -23,7 +23,7 @@ var args = process.argv.slice(2);
|
|
|
23
23
|
|
|
24
24
|
// console.log(modpath, "sdofsjdofjsd")
|
|
25
25
|
function execution() {
|
|
26
|
-
const cmd = `watchman watch-del ./ && watchman watch ./ && watchman -j <<< '["trigger","./",{"name":"esp","expression":["allof",["not",["dirname","node_modules"]],["not",["name","index.d.ts"]]],"command":["node","./node_modules/esoftplay/bin/router.js"],"append_files":true}]' &&
|
|
26
|
+
const cmd = `watchman watch-del ./ && watchman watch ./ && watchman -j <<< '["trigger","./",{"name":"esp","expression":["allof",["not",["dirname","node_modules"]],["not",["name","index.d.ts"]]],"command":["node","./node_modules/esoftplay/bin/router.js"],"append_files":true}]' && node ./node_modules/esoftplay/bin/run.js && node ./node_modules/esoftplay/bin/router.js`
|
|
27
27
|
command(cmd)
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -34,11 +34,11 @@ if (args.length == 0) {
|
|
|
34
34
|
switch (args[0]) {
|
|
35
35
|
case "a":
|
|
36
36
|
case "analyze":
|
|
37
|
-
command('
|
|
37
|
+
command('node ./node_modules/esoftplay/bin/analyze.js')
|
|
38
38
|
break
|
|
39
39
|
case "ac":
|
|
40
40
|
case "analyze clear":
|
|
41
|
-
command('
|
|
41
|
+
command('node ./node_modules/esoftplay/bin/analyze.js clear')
|
|
42
42
|
break;
|
|
43
43
|
case "help":
|
|
44
44
|
help()
|
|
@@ -259,7 +259,7 @@ function configUpdate(state) {
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
function update() {
|
|
262
|
-
command("
|
|
262
|
+
command("yarn add esoftplay")
|
|
263
263
|
if (fs.existsSync(packjson)) {
|
|
264
264
|
let pack = readToJSON(packjson)
|
|
265
265
|
let esplibs = Object.keys(pack.dependencies).filter((key) => key.includes("esoftplay"))
|
|
@@ -267,13 +267,13 @@ function update() {
|
|
|
267
267
|
esplibs.forEach((key) => {
|
|
268
268
|
if (key != 'esoftplay') {
|
|
269
269
|
if (args[1] == 'all')
|
|
270
|
-
command('
|
|
271
|
-
command("cd node_modules/" + key + " &&
|
|
270
|
+
command('yarn add ' + key)
|
|
271
|
+
command("cd node_modules/" + key + " && node mover.js")
|
|
272
272
|
consoleSucces(key + " succesfully implemented!")
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
275
|
}
|
|
276
|
-
command("
|
|
276
|
+
command("node ./node_modules/esoftplay/bin/locale.js")
|
|
277
277
|
consoleSucces("esoftplay framework sudah diupdate!")
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -291,7 +291,7 @@ function createMaster(module_name) {
|
|
|
291
291
|
"main": "index.js",
|
|
292
292
|
"scripts": {
|
|
293
293
|
"test": "echo \\"Error: no test specified\\" && exit 1",
|
|
294
|
-
"postinstall": "
|
|
294
|
+
"postinstall": "node ../esoftplay/bin/mover.js esoftplay-`+ module_name + `"
|
|
295
295
|
},
|
|
296
296
|
"keywords": [
|
|
297
297
|
"espftplay-`+ module_name + `",
|
|
@@ -463,6 +463,19 @@ function publish(notes) {
|
|
|
463
463
|
status = "debug"
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
+
|
|
467
|
+
let brokenConfig = undefined
|
|
468
|
+
if (status != 'debug' && status != 'live') {
|
|
469
|
+
brokenConfig = "Gagal publish : CONFIG tidak valid"
|
|
470
|
+
}
|
|
471
|
+
if (!cjson.config.salt){
|
|
472
|
+
brokenConfig = "Gagal publish : CONFIG tidak valid"
|
|
473
|
+
}
|
|
474
|
+
if (brokenConfig){
|
|
475
|
+
consoleError(brokenConfig)
|
|
476
|
+
return
|
|
477
|
+
}
|
|
478
|
+
|
|
466
479
|
let last_id = 0
|
|
467
480
|
if (status == "live") {
|
|
468
481
|
let migratedPublishId = 1
|
|
@@ -708,6 +721,18 @@ function configAvailable(enabled) {
|
|
|
708
721
|
}
|
|
709
722
|
|
|
710
723
|
function build() {
|
|
724
|
+
let cjson = readToJSON(confjson)
|
|
725
|
+
let brokenConfig = undefined
|
|
726
|
+
if (!cjson.config.domain) {
|
|
727
|
+
brokenConfig = "Gagal build : CONFIG tidak valid"
|
|
728
|
+
}
|
|
729
|
+
if (!cjson.config.salt){
|
|
730
|
+
brokenConfig = "Gagal build : CONFIG tidak valid"
|
|
731
|
+
}
|
|
732
|
+
if (brokenConfig){
|
|
733
|
+
consoleError(brokenConfig)
|
|
734
|
+
return
|
|
735
|
+
}
|
|
711
736
|
const local = args[1] == 'local' ? ' --local' : ''
|
|
712
737
|
const types = isWeb
|
|
713
738
|
?
|
|
@@ -872,7 +897,7 @@ function build() {
|
|
|
872
897
|
// command("curl -d \"text=" + message + "&disable_web_page_preview=true&chat_id=" + tmId + "\" 'https://api.telegram.org/bot112133589:AAFFyztZh79OsHRCxJ9rGCGpnxkcjWBP8kU/sendMessage'")
|
|
873
898
|
}
|
|
874
899
|
if (fs.existsSync('./build/post.js'))
|
|
875
|
-
command('
|
|
900
|
+
command('node ./build/post.js')
|
|
876
901
|
configAvailable(false)
|
|
877
902
|
devClientPos(appjson)
|
|
878
903
|
buildPrepare(false)
|
|
@@ -1007,12 +1032,6 @@ function help() {
|
|
|
1007
1032
|
"\n - vn|version-new [visible] : untuk increment version dengan tampilan custom. misal 2.0beta",
|
|
1008
1033
|
"\n - p|publish [notes] : untuk mempublish dan menambahkan id",
|
|
1009
1034
|
"\n - bcl|backup-config-live : untuk backup config live",
|
|
1010
|
-
"\n - bcd|backup-config-debug : untuk backup config debug"
|
|
1011
|
-
// "\n - build debug : untuk build app .ipa .apk .aab status DEBUG",
|
|
1012
|
-
// "\n - build debug offline : untuk build app .ipa .apk .aab status DEBUG mode OFFLINE",
|
|
1013
|
-
// "\n - build debug online : untuk build app .ipa .apk .aab status DEBUG mode ONLINE",
|
|
1014
|
-
// "\n - build live : untuk build app .ipa .apk .aab status LIVE",
|
|
1015
|
-
// "\n - build live offline : untuk build app .ipa .apk .aab status LIVE mode OFFLINE",
|
|
1016
|
-
// "\n - build live online : untuk build app .ipa .apk .aab status LIVE mode ONLINE",
|
|
1035
|
+
"\n - bcd|backup-config-debug : untuk backup config debug"
|
|
1017
1036
|
)
|
|
1018
1037
|
}
|
package/bin/mover.js
CHANGED
|
@@ -5,7 +5,7 @@ const assetsFonts = "assets/fonts"
|
|
|
5
5
|
let args = process.argv.slice(2);
|
|
6
6
|
|
|
7
7
|
if (args.length == 0) {
|
|
8
|
-
console.log("
|
|
8
|
+
console.log("Argument tidak boleh kosong");
|
|
9
9
|
return
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -75,7 +75,7 @@ if (fs.existsSync("../" + mainModule + "/id.json")) {
|
|
|
75
75
|
}
|
|
76
76
|
fs.writeFileSync("../../assets/locale/id.json", JSON.stringify(moduleLang, undefined, 2))
|
|
77
77
|
/* sort id.JSON */
|
|
78
|
-
shell("cd ../../ &&
|
|
78
|
+
shell("cd ../../ && node ./node_modules/esoftplay/bin/locale.js")
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/* inject libs */
|
|
@@ -104,5 +104,5 @@ if (fs.existsSync("../" + mainModule + "/libs.json")) {
|
|
|
104
104
|
|
|
105
105
|
/* execute mover on master */
|
|
106
106
|
if (fs.existsSync("../" + mainModule + "/mover.js")) {
|
|
107
|
-
shell("
|
|
107
|
+
shell("node ../" + mainModule + "/mover.js", { stdio: 'inherit' })
|
|
108
108
|
}
|