esoftplay 0.0.136-n → 0.0.136-p

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.
Files changed (3) hide show
  1. package/bin/cli.js +43 -0
  2. package/moment.ts +1 -1
  3. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -793,6 +793,7 @@ function buildPrepare(include = true) {
793
793
  consoleSucces("BUILD PREPARE SUCCESS..!")
794
794
  }
795
795
  } else {
796
+ excludeOnBuild('ios', false)
796
797
  if (fs.existsSync('./assets/esoftplaymodules')) {
797
798
  command('rm -rf ./modules && mv ./assets/esoftplaymodules modules')
798
799
  consoleSucces("BUILD PREPARE SUCCESS CANCELED..!")
@@ -829,6 +830,37 @@ function configAvailable(enabled) {
829
830
  }
830
831
  }
831
832
 
833
+ function excludeOnBuild(platform, isBackup) {
834
+ const backupPath = './assets/p.json'
835
+ if (!isBackup) {
836
+ if (fs.existsSync(backupPath)) {
837
+ fs.writeFileSync(packjson, fs.readFileSync(backupPath))
838
+ fs.unlinkSync(backupPath)
839
+ }
840
+ }
841
+ if (fs.existsSync(confjson)) {
842
+ let cjson = readToJSON(confjson).config
843
+ if (cjson.exclude) {
844
+ if (cjson.exclude[platform]) {
845
+ let excluded = cjson.exclude[platform]
846
+ let pjson = readToJSON(packjson)
847
+ /* backup */
848
+ fs.writeFileSync(backupPath, JSON.stringify(pjson, undefined, 2))
849
+ /* cleanup */
850
+ let cleanDeps = {}
851
+ Object.keys(pjson.dependencies).forEach((key) => {
852
+ const value = pjson.dependencies[key]
853
+ if (!excluded.includes(key))
854
+ cleanDeps[key] = value
855
+ })
856
+ pjson.dependencies = cleanDeps
857
+ /* override */
858
+ fs.writeFileSync(packjson, JSON.stringify(pjson, undefined, 2))
859
+ }
860
+ }
861
+ }
862
+ }
863
+
832
864
  function build() {
833
865
  let cjson = readToJSON(confjson)
834
866
  let brokenConfig = undefined
@@ -863,6 +895,7 @@ function build() {
863
895
  pre: () => {
864
896
  configAvailable(true)
865
897
  devClientPre(appjson)
898
+ excludeOnBuild('ios', true)
866
899
  }
867
900
  },
868
901
  {
@@ -871,6 +904,7 @@ function build() {
871
904
  pre: () => {
872
905
  configAvailable(true)
873
906
  devClientPre(appjson)
907
+ excludeOnBuild('ios', true)
874
908
  }
875
909
  },
876
910
  {
@@ -879,6 +913,7 @@ function build() {
879
913
  pre: () => {
880
914
  configAvailable(true)
881
915
  devClientPos(appjson)
916
+ excludeOnBuild('ios', true)
882
917
  }
883
918
  },
884
919
  {
@@ -887,6 +922,7 @@ function build() {
887
922
  pre: () => {
888
923
  configAvailable(true)
889
924
  devClientPos(appjson)
925
+ excludeOnBuild('ios', true)
890
926
  }
891
927
  },
892
928
  {
@@ -895,6 +931,7 @@ function build() {
895
931
  pre: () => {
896
932
  configAvailable(true)
897
933
  devClientPos(appjson)
934
+ excludeOnBuild('ios', true)
898
935
  }
899
936
  },
900
937
  {
@@ -903,6 +940,7 @@ function build() {
903
940
  pre: () => {
904
941
  configAvailable(true)
905
942
  devClientPre(appjson)
943
+ excludeOnBuild('android', true)
906
944
  }
907
945
  },
908
946
  {
@@ -911,6 +949,7 @@ function build() {
911
949
  pre: () => {
912
950
  configAvailable(true)
913
951
  devClientPos(appjson)
952
+ excludeOnBuild('android', true)
914
953
  }
915
954
  },
916
955
  {
@@ -919,6 +958,7 @@ function build() {
919
958
  pre: () => {
920
959
  configAvailable(true)
921
960
  devClientPos(appjson)
961
+ excludeOnBuild('android', true)
922
962
  }
923
963
  }
924
964
  ]
@@ -942,8 +982,11 @@ function build() {
942
982
  if (pre) pre()
943
983
  consoleSucces("⚙⚙⚙ ... \n" + cmd)
944
984
  command(cmd)
985
+ excludeOnBuild('android', false)
986
+
945
987
  const cjson = readToJSON(confjson)
946
988
  const ajson = readToJSON(appjson)
989
+
947
990
  if (local) {
948
991
  const fs = require('fs');
949
992
  const path = require('path');
package/moment.ts CHANGED
@@ -59,7 +59,7 @@ export default function moment(date?: string | Date | any) {
59
59
  locale: (locale_id: string) => {
60
60
  require('dayjs/locale/en')
61
61
  require('dayjs/locale/id')
62
- require('dayjs/locale/id')
62
+ require('dayjs/locale/cn')
63
63
  const out = dayjs.locale(locale_id)
64
64
  return moment(out)
65
65
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.136-n",
3
+ "version": "0.0.136-p",
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",