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 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("PROCESSING FORCE UPDATE")
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)
@@ -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 class m {
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
- static _barStyle(): string {
23
- return m.colors(['dark', 'light'])
24
- }
25
-
26
- static _colorPrimary(): string {
27
- return m.colors([colorPrimary, colorPrimary])
28
- }
29
- static _colorAccent(): string {
30
- return m.colors([colorAccent, colorAccent])
31
- }
32
- static _colorHeader(): string {
33
- return m.colors(['#3E50B4', '#292B37'])
34
- }
35
- static _colorHeaderText(): string {
36
- return m.colors(['white', 'white'])
37
- }
38
- static _colorButtonPrimary(): string {
39
- return m.colors(['#3E50B4', '#3E50B4'])
40
- }
41
- static _colorButtonTextPrimary(): string {
42
- return m.colors(['white', 'white'])
43
- }
44
- static _colorButtonSecondary(): string {
45
- return m.colors(['#3E50B4', '#3E50B4'])
46
- }
47
- static _colorButtonTextSecondary(): string {
48
- return m.colors(['white', 'white'])
49
- }
50
- static _colorButtonTertiary(): string {
51
- return m.colors(['#3E50B4', '#3E50B4'])
52
- }
53
- static _colorButtonTextTertiary(): string {
54
- return m.colors(['white', 'white'])
55
- }
56
- static _colorBackgroundPrimary(): string {
57
- return m.colors(['white', '#202529'])
58
- }
59
- static _colorBackgroundSecondary(): string {
60
- return m.colors(['white', '#202529'])
61
- }
62
- static _colorBackgroundTertiary(): string {
63
- return m.colors(['white', '#202529'])
64
- }
65
- static _colorBackgroundCardPrimary(): string {
66
- return m.colors(['white', '#2B2F38'])
67
- }
68
- static _colorBackgroundCardSecondary(): string {
69
- return m.colors(['white', '#2B2F38'])
70
- }
71
- static _colorBackgroundCardTertiary(): string {
72
- return m.colors(['white', '#2B2F38'])
73
- }
74
- static _colorTextPrimary(): string {
75
- return m.colors(['#353535', 'white'])
76
- }
77
- static _colorTextSecondary(): string {
78
- return m.colors(['#666666', 'white'])
79
- }
80
- static _colorTextTertiary(): string {
81
- return m.colors(['#999999', 'white'])
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.131-a",
3
+ "version": "0.0.131-c",
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",