esoftplay 0.0.136-n → 0.0.136-o

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 (2) hide show
  1. package/bin/cli.js +42 -0
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -829,6 +829,37 @@ function configAvailable(enabled) {
829
829
  }
830
830
  }
831
831
 
832
+ function excludeOnBuild(platform, isBackup) {
833
+ const backupPath = './assets/p.json'
834
+ if (!isBackup) {
835
+ if (fs.existsSync(backupPath)) {
836
+ fs.writeFileSync(packjson, fs.readFileSync(backupPath))
837
+ fs.unlinkSync(backupPath)
838
+ }
839
+ }
840
+ if (fs.existsSync(confjson)) {
841
+ let cjson = readToJSON(confjson)
842
+ if (cjson.exclude) {
843
+ if (cjson.exclude[platform]) {
844
+ let excluded = cjson.exclude[platform]
845
+ let pjson = readToJSON(packjson)
846
+ /* backup */
847
+ fs.writeFileSync(backupPath, JSON.stringify(pjson, undefined, 2))
848
+ /* cleanup */
849
+ let cleanDeps = {}
850
+ Object.keys(pjson.dependencies).forEach((key) => {
851
+ const value = Object.values(pjson.dependencies[key])
852
+ if (!excluded.includes(key))
853
+ cleanDeps[key] = value
854
+ })
855
+ pjson.dependencies = cleanDeps
856
+ /* override */
857
+ fs.writeFileSync(packjson, JSON.stringify(pjson, undefined, 2))
858
+ }
859
+ }
860
+ }
861
+ }
862
+
832
863
  function build() {
833
864
  let cjson = readToJSON(confjson)
834
865
  let brokenConfig = undefined
@@ -863,6 +894,7 @@ function build() {
863
894
  pre: () => {
864
895
  configAvailable(true)
865
896
  devClientPre(appjson)
897
+ excludeOnBuild('ios', true)
866
898
  }
867
899
  },
868
900
  {
@@ -871,6 +903,7 @@ function build() {
871
903
  pre: () => {
872
904
  configAvailable(true)
873
905
  devClientPre(appjson)
906
+ excludeOnBuild('ios', true)
874
907
  }
875
908
  },
876
909
  {
@@ -879,6 +912,7 @@ function build() {
879
912
  pre: () => {
880
913
  configAvailable(true)
881
914
  devClientPos(appjson)
915
+ excludeOnBuild('ios', true)
882
916
  }
883
917
  },
884
918
  {
@@ -887,6 +921,7 @@ function build() {
887
921
  pre: () => {
888
922
  configAvailable(true)
889
923
  devClientPos(appjson)
924
+ excludeOnBuild('ios', true)
890
925
  }
891
926
  },
892
927
  {
@@ -895,6 +930,7 @@ function build() {
895
930
  pre: () => {
896
931
  configAvailable(true)
897
932
  devClientPos(appjson)
933
+ excludeOnBuild('ios', true)
898
934
  }
899
935
  },
900
936
  {
@@ -903,6 +939,7 @@ function build() {
903
939
  pre: () => {
904
940
  configAvailable(true)
905
941
  devClientPre(appjson)
942
+ excludeOnBuild('android', true)
906
943
  }
907
944
  },
908
945
  {
@@ -911,6 +948,7 @@ function build() {
911
948
  pre: () => {
912
949
  configAvailable(true)
913
950
  devClientPos(appjson)
951
+ excludeOnBuild('android', true)
914
952
  }
915
953
  },
916
954
  {
@@ -919,6 +957,7 @@ function build() {
919
957
  pre: () => {
920
958
  configAvailable(true)
921
959
  devClientPos(appjson)
960
+ excludeOnBuild('android', true)
922
961
  }
923
962
  }
924
963
  ]
@@ -942,8 +981,11 @@ function build() {
942
981
  if (pre) pre()
943
982
  consoleSucces("⚙⚙⚙ ... \n" + cmd)
944
983
  command(cmd)
984
+ excludeOnBuild('android', false)
985
+
945
986
  const cjson = readToJSON(confjson)
946
987
  const ajson = readToJSON(appjson)
988
+
947
989
  if (local) {
948
990
  const fs = require('fs');
949
991
  const path = require('path');
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-o",
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",