@startupjs/cli 0.55.0-alpha.14 → 0.55.0-alpha.18

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 +1 -1
  2. package/link/path.js +61 -0
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -144,7 +144,7 @@ SCRIPTS_ORIG.patchGestureHandler = () => PATCHES_GESTURE_HANDLER_DIR
144
144
  : 'true'
145
145
 
146
146
  SCRIPTS_ORIG.postinstall = () => oneLine(`
147
- ${SCRIPTS_ORIG.patchPackage()}}
147
+ ${SCRIPTS_ORIG.patchPackage()}
148
148
  `)
149
149
 
150
150
  const 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.14",
3
+ "version": "0.55.0-alpha.18",
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": "a23711261cd41ea04ea3ad92ba5f714dba514682"
27
+ "gitHead": "f832e1a76cf93575a1a3779ded71bf84954bb63c"
28
28
  }