@startupjs/cli 0.55.0-alpha.15 → 0.55.0-alpha.20

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/index.js +2 -3
  2. package/link/path.js +61 -0
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -115,6 +115,7 @@ SCRIPTS_ORIG.server = ({ inspect } = {}) => oneLine(`
115
115
  node
116
116
  ${inspect ? '--inspect' : ''}
117
117
  --watch
118
+ --experimental-detect-module
118
119
  server.js
119
120
  `)
120
121
 
@@ -128,7 +129,7 @@ SCRIPTS_ORIG.build = ({ async } = {}) => oneLine(`
128
129
 
129
130
  SCRIPTS_ORIG.startProduction = oneLine(`
130
131
  npx cross-env NODE_ENV=production
131
- node server.js
132
+ node --experimental-detect-module server.js
132
133
  `)
133
134
 
134
135
  // Etc
@@ -496,8 +497,6 @@ function patchPackageJson (projectPath) {
496
497
  delete packageJSON.devDependencies['react-test-renderer']
497
498
  delete packageJSON.devDependencies.jest
498
499
 
499
- packageJSON.type = 'module'
500
-
501
500
  packageJSON.scripts = {
502
501
  ...packageJSON.scripts,
503
502
  ...SCRIPTS
package/link/path.js ADDED
@@ -0,0 +1,61 @@
1
+ const glob = require('glob')
2
+ const path = require('path')
3
+ const ignoreFolders = { ignore: ['node_modules/**', '**/build/**'] }
4
+ const styles = glob.sync('**/values/styles.xml', ignoreFolders)
5
+ const appJsonPath = glob.sync('**/app.json', ignoreFolders)[0]
6
+ if (!appJsonPath) {
7
+ throw new Error('Can\'t find app.json')
8
+ }
9
+ // TODO: some people get undefined when trying to find mainApplicationJava
10
+ // const mainApplicationJava = glob.sync(
11
+ // '**/MainApplication.java',
12
+ // ignoreFolders
13
+ // )[0]
14
+
15
+ // Android files
16
+ const mainActivityJava = glob.sync('**/MainActivity.java', ignoreFolders)[0]
17
+
18
+ const mainBuildGradleAndroid = glob.sync(
19
+ '**/android/build.gradle',
20
+ ignoreFolders
21
+ )[0]
22
+ const appBuildGradleAndroid = glob.sync(
23
+ '**/android/app/build.gradle',
24
+ ignoreFolders
25
+ )[0]
26
+ const androidManifestXML = glob.sync(
27
+ '**/main/AndroidManifest.xml',
28
+ ignoreFolders
29
+ )[0]
30
+ const APP_NAME = require(path.resolve(process.cwd(), appJsonPath)).name
31
+ const networkSecurityConfigFolder = 'android/app/src/main/res/xml'
32
+ const networkSecurityConfigRout = networkSecurityConfigFolder + '/network_security_config.xml'
33
+ const detoxTestFolder = `android/app/src/androidTest/java/com/${APP_NAME}`
34
+ const detoxTestRoute = detoxTestFolder + '/DetoxTest.java'
35
+
36
+ // iOS files
37
+ const appDelegateH = glob.sync('**/AppDelegate.h', ignoreFolders)[0]
38
+ const appDelegateM = glob.sync('**/AppDelegate.m', ignoreFolders)[0]
39
+ const podFilePath = glob.sync('**/Podfile', ignoreFolders)[0]
40
+
41
+ // exports
42
+
43
+ exports.mainActivityJava = mainActivityJava
44
+ // exports.mainApplicationJava = mainApplicationJava
45
+ // exports.rootGradle = mainApplicationJava
46
+ // .replace(/android\/app\/.*\.java/, 'android/build.gradle')
47
+ exports.styles = styles
48
+
49
+ exports.appDelegateH = appDelegateH
50
+ exports.appDelegateM = appDelegateM
51
+ exports.podFilePath = podFilePath
52
+
53
+ exports.networkSecurityConfigFolder = networkSecurityConfigFolder
54
+ exports.networkSecurityConfigRout = networkSecurityConfigRout
55
+ exports.detoxTestFolder = detoxTestFolder
56
+ exports.detoxTestRoute = detoxTestRoute
57
+ exports.mainBuildGradleAndroid = mainBuildGradleAndroid
58
+ exports.appBuildGradleAndroid = appBuildGradleAndroid
59
+ exports.androidManifestXML = androidManifestXML
60
+
61
+ exports.APP_NAME = APP_NAME
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs/cli",
3
- "version": "0.55.0-alpha.15",
3
+ "version": "0.55.0-alpha.20",
4
4
  "description": "start, watch and build startupjs project",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
@@ -24,5 +24,5 @@
24
24
  "webpack-cli": "^4.9.1",
25
25
  "webpack-dev-server": "^4.4.0"
26
26
  },
27
- "gitHead": "187e297908d5f1cacfa4dc65c991b8041533456a"
27
+ "gitHead": "5038b8ccbc5ff7b8a6e7db98c0a64be8afd2dd62"
28
28
  }