esoftplay 0.0.131-a → 0.0.131-c
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 +41 -1
- package/modules/lib/theme.tsx +66 -71
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -532,7 +532,7 @@ function publish(notes) {
|
|
|
532
532
|
const ajson = readToJSON(appjson);
|
|
533
533
|
const url = config.publish_uri + ajson.config.publish_id
|
|
534
534
|
const fetch = require('node-fetch')
|
|
535
|
-
console.log("
|
|
535
|
+
console.log("\n\nPROCESSING FORCE UPDATE")
|
|
536
536
|
fetch(url).then((res) => JSON.stringify(res.json(), undefined, 2)).then(consoleSucces)
|
|
537
537
|
}
|
|
538
538
|
});
|
|
@@ -827,6 +827,46 @@ function build() {
|
|
|
827
827
|
if (pre) pre()
|
|
828
828
|
consoleSucces("⚙⚙⚙ ... \n" + cmd)
|
|
829
829
|
command(cmd)
|
|
830
|
+
const cjson = readToJSON(confjson)
|
|
831
|
+
const ajson = readToJSON(appjson)
|
|
832
|
+
if (local) {
|
|
833
|
+
const fs = require('fs');
|
|
834
|
+
const path = require('path');
|
|
835
|
+
const directoryPath = './'; // Replace with the path to your directory
|
|
836
|
+
|
|
837
|
+
fs.readdir(directoryPath, (err, files) => {
|
|
838
|
+
if (err) {
|
|
839
|
+
console.error('Error reading directory:', err);
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
// Define a regular expression pattern to match file names starting with "build-"
|
|
843
|
+
const regexPattern = /^build-(.+)$/;
|
|
844
|
+
// Filter the file names using the pattern
|
|
845
|
+
const matchingFiles = files.filter((fileName) => regexPattern.test(fileName));
|
|
846
|
+
|
|
847
|
+
if (matchingFiles.length === 0) {
|
|
848
|
+
console.log('No files matching the pattern found.');
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
// Extract and display the old file names
|
|
852
|
+
matchingFiles.forEach((fileName) => {
|
|
853
|
+
// const oldFileName = fileName.replace(regexPattern, '$1');
|
|
854
|
+
let ext = fileName.split(".")
|
|
855
|
+
ext.shift()
|
|
856
|
+
fs.renameSync('./' + fileName, './' + ajson.expo.name + "-" + new Date().toISOString() + "." + ext.join("."))
|
|
857
|
+
});
|
|
858
|
+
});
|
|
859
|
+
let tmId = "-1001429450501"
|
|
860
|
+
if (cjson.hasOwnProperty('config')) {
|
|
861
|
+
if (cjson.config.hasOwnProperty('build')) {
|
|
862
|
+
let tmid = cjson.config.build[2]
|
|
863
|
+
if (tmid) tmId = tmid;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
const os = require('os')
|
|
867
|
+
const message = " ✅ Build Success by " + os.userInfo().username + '@' + os.hostname()
|
|
868
|
+
// command("curl -d \"text=" + message + "&disable_web_page_preview=true&chat_id=" + tmId + "\" 'https://api.telegram.org/bot112133589:AAFFyztZh79OsHRCxJ9rGCGpnxkcjWBP8kU/sendMessage'")
|
|
869
|
+
}
|
|
830
870
|
if (fs.existsSync('./build/post.js'))
|
|
831
871
|
command('node ./build/post.js')
|
|
832
872
|
configAvailable(false)
|
package/modules/lib/theme.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// noPage
|
|
2
|
+
// withObject
|
|
2
3
|
import { esp } from 'esoftplay';
|
|
3
4
|
import { LibNavigation } from 'esoftplay/cache/lib/navigation/import';
|
|
4
5
|
import { LibStyle } from 'esoftplay/cache/lib/style/import';
|
|
@@ -7,81 +8,75 @@ import useGlobalState from 'esoftplay/global';
|
|
|
7
8
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
8
9
|
const { colorPrimary, colorAccent } = LibStyle
|
|
9
10
|
|
|
10
|
-
const state = useGlobalState({
|
|
11
|
-
theme: 'light'
|
|
12
|
-
}, { persistKey: 'lib_theme' })
|
|
11
|
+
const state = useGlobalState({ theme: 'light' }, { persistKey: 'lib_theme' })
|
|
13
12
|
|
|
14
|
-
export default
|
|
15
|
-
|
|
16
|
-
static setTheme(themeName: string): void {
|
|
13
|
+
export default {
|
|
14
|
+
setTheme(themeName: string): void {
|
|
17
15
|
state.set({ theme: themeName })
|
|
18
16
|
LibNavigation.reset()
|
|
19
17
|
AsyncStorage.setItem('theme', themeName)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
static colors(colors: string[]): string {
|
|
18
|
+
},
|
|
19
|
+
_barStyle(): string {
|
|
20
|
+
return this.colors(['dark', 'light'])
|
|
21
|
+
},
|
|
22
|
+
_colorPrimary(): string {
|
|
23
|
+
return this.colors([colorPrimary, colorPrimary])
|
|
24
|
+
},
|
|
25
|
+
_colorAccent(): string {
|
|
26
|
+
return this.colors([colorAccent, colorAccent])
|
|
27
|
+
},
|
|
28
|
+
_colorHeader(): string {
|
|
29
|
+
return this.colors(['#3E50B4', '#292B37'])
|
|
30
|
+
},
|
|
31
|
+
_colorHeaderText(): string {
|
|
32
|
+
return this.colors(['white', 'white'])
|
|
33
|
+
},
|
|
34
|
+
_colorButtonPrimary(): string {
|
|
35
|
+
return this.colors(['#3E50B4', '#3E50B4'])
|
|
36
|
+
},
|
|
37
|
+
_colorButtonTextPrimary(): string {
|
|
38
|
+
return this.colors(['white', 'white'])
|
|
39
|
+
},
|
|
40
|
+
_colorButtonSecondary(): string {
|
|
41
|
+
return this.colors(['#3E50B4', '#3E50B4'])
|
|
42
|
+
},
|
|
43
|
+
_colorButtonTextSecondary(): string {
|
|
44
|
+
return this.colors(['white', 'white'])
|
|
45
|
+
},
|
|
46
|
+
_colorButtonTertiary(): string {
|
|
47
|
+
return this.colors(['#3E50B4', '#3E50B4'])
|
|
48
|
+
},
|
|
49
|
+
_colorButtonTextTertiary(): string {
|
|
50
|
+
return this.colors(['white', 'white'])
|
|
51
|
+
},
|
|
52
|
+
_colorBackgroundPrimary(): string {
|
|
53
|
+
return this.colors(['white', '#202529'])
|
|
54
|
+
},
|
|
55
|
+
_colorBackgroundSecondary(): string {
|
|
56
|
+
return this.colors(['white', '#202529'])
|
|
57
|
+
},
|
|
58
|
+
_colorBackgroundTertiary(): string {
|
|
59
|
+
return this.colors(['white', '#202529'])
|
|
60
|
+
},
|
|
61
|
+
_colorBackgroundCardPrimary(): string {
|
|
62
|
+
return this.colors(['white', '#2B2F38'])
|
|
63
|
+
},
|
|
64
|
+
_colorBackgroundCardSecondary(): string {
|
|
65
|
+
return this.colors(['white', '#2B2F38'])
|
|
66
|
+
},
|
|
67
|
+
_colorBackgroundCardTertiary(): string {
|
|
68
|
+
return this.colors(['white', '#2B2F38'])
|
|
69
|
+
},
|
|
70
|
+
_colorTextPrimary(): string {
|
|
71
|
+
return this.colors(['#353535', 'white'])
|
|
72
|
+
},
|
|
73
|
+
_colorTextSecondary(): string {
|
|
74
|
+
return this.colors(['#666666', 'white'])
|
|
75
|
+
},
|
|
76
|
+
_colorTextTertiary(): string {
|
|
77
|
+
return this.colors(['#999999', 'white'])
|
|
78
|
+
},
|
|
79
|
+
colors(colors: string[]): string {
|
|
85
80
|
const _themeName = state.get().theme
|
|
86
81
|
const _themes: string[] = esp.config('theme');
|
|
87
82
|
const _themeIndex = _themes.indexOf(_themeName);
|