@startupjs/cli 0.55.10 → 0.56.0-alpha.1

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/index.js +24 -8
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -52,7 +52,7 @@ const LOCAL_DIR = process.env.LOCAL_DIR || '.'
52
52
  const DEPENDENCIES = [
53
53
  // Install alpha version of startupjs when running the alpha of cli
54
54
  `startupjs@${STARTUPJS_VERSION}`,
55
- 'react-native-svg@^12.1.0',
55
+ 'react-native-svg@^14.0.0',
56
56
  'nconf@^0.10.0',
57
57
  'react',
58
58
  'react-dom',
@@ -127,11 +127,20 @@ SCRIPTS_ORIG.build = ({ async } = {}) => oneLine(`
127
127
  npx webpack --config webpack.web.config.cjs
128
128
  `)
129
129
 
130
+ SCRIPTS_ORIG.expoBuild = ({ async } = {}) => oneLine(`
131
+ npx expo export -p web
132
+ `)
133
+
130
134
  SCRIPTS_ORIG.startProduction = oneLine(`
131
135
  npx cross-env NODE_ENV=production
132
136
  node --experimental-detect-module server.js
133
137
  `)
134
138
 
139
+ SCRIPTS_ORIG.expoStartProduction = oneLine(`
140
+ npx cross-env NODE_ENV=production
141
+ node --experimental-detect-module --import='startupjs/nodeRegister' -e 'import("startupjs/startServer")'
142
+ `)
143
+
135
144
  // Etc
136
145
 
137
146
  SCRIPTS_ORIG.patchPackage = () => oneLine(`
@@ -203,11 +212,8 @@ const TEMPLATES = {
203
212
  // === START UI PEER PEDS ===
204
213
  `@startupjs/ui@${STARTUPJS_VERSION}`,
205
214
  '@react-native-picker/picker@^1.16.1',
206
- 'react-native-collapsible@^1.6.0',
207
- 'react-native-color-picker@^0.6.0',
208
- 'react-native-gesture-handler@1.10.3',
209
- 'react-native-pager-view@^6.2.0',
210
- 'react-native-tab-view@^3.0.0'
215
+ 'react-native-gesture-handler@^2.14.0',
216
+ 'react-native-pager-view@^6.2.0'
211
217
  // === END UI PEER DEPS ===
212
218
  ]
213
219
  }
@@ -417,7 +423,7 @@ commander
417
423
  .option('-a, --async', 'Build with splitting code into async chunks loaded dynamically')
418
424
  .action(async (options) => {
419
425
  await execa.command(
420
- SCRIPTS_ORIG.build(options),
426
+ isExpo() ? SCRIPTS_ORIG.expoBuild(options) : SCRIPTS_ORIG.build(options),
421
427
  { stdio: 'inherit', shell: true }
422
428
  )
423
429
  })
@@ -427,7 +433,7 @@ commander
427
433
  .description('Start production')
428
434
  .action(async (options) => {
429
435
  await execa.command(
430
- SCRIPTS_ORIG.startProduction,
436
+ isExpo() ? SCRIPTS_ORIG.expoStartProduction : SCRIPTS_ORIG.startProduction,
431
437
  { stdio: 'inherit', shell: true }
432
438
  )
433
439
  })
@@ -669,6 +675,16 @@ function oneLine (str) {
669
675
  return str.replace(/\s+/g, ' ')
670
676
  }
671
677
 
678
+ function isExpo (rootPath = process.cwd()) {
679
+ try {
680
+ const packageJson = fs.readFileSync(path.resolve(rootPath, './package.json'), 'utf8')
681
+ const { dependencies = {} } = JSON.parse(packageJson)
682
+ return Boolean(dependencies.expo)
683
+ } catch {
684
+ return false
685
+ }
686
+ }
687
+
672
688
  exports.run = (options = {}) => {
673
689
  if (!options.templatesPath) throw Error('templatesPath not found!')
674
690
  templatesPath = options.templatesPath
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs/cli",
3
- "version": "0.55.10",
3
+ "version": "0.56.0-alpha.1",
4
4
  "description": "start, watch and build startupjs project",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "access": "public"
9
9
  },
10
10
  "dependencies": {
11
- "@startupjs/pm": "^0.55.8",
11
+ "@startupjs/pm": "^0.56.0-alpha.0",
12
12
  "commander": "^3.0.1",
13
13
  "concurrently": "^6.4.0",
14
14
  "cross-env": "^7.0.3",
@@ -24,5 +24,5 @@
24
24
  "webpack-cli": "^4.9.1",
25
25
  "webpack-dev-server": "^4.4.0"
26
26
  },
27
- "gitHead": "57d9888fca3409050042fa1c3ea9a5783e090275"
27
+ "gitHead": "30b858bb3203dc9dc064a3b16e060e2cc1777a71"
28
28
  }