@startupjs/cli 0.55.8 → 0.55.10

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 +36 -2
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -148,6 +148,18 @@ SCRIPTS_ORIG.postinstall = () => oneLine(`
148
148
  ${SCRIPTS_ORIG.patchPackage()}
149
149
  `)
150
150
 
151
+ SCRIPTS_ORIG.testE2E = ({ inspect } = {}) => {
152
+ return oneLine(`
153
+ startupjs build --async && npx concurrently "startupjs start-production" "sleep 15s && npx playwright test $@" --kill-others --success first
154
+ `)
155
+ }
156
+
157
+ SCRIPTS_ORIG.codegenTestE2E = ({ inspect } = {}) => {
158
+ return oneLine(`
159
+ startupjs build --async && npx concurrently "startupjs start-production" "npx playwright codegen $@"
160
+ `)
161
+ }
162
+
151
163
  const SCRIPTS = {
152
164
  start: 'startupjs start',
153
165
  metro: 'react-native start --reset-cache',
@@ -162,7 +174,9 @@ const SCRIPTS = {
162
174
  ios: 'react-native run-ios',
163
175
  'ios-release': 'react-native run-ios --configuration Release',
164
176
  build: 'startupjs build --async',
165
- 'start-production': 'startupjs start-production'
177
+ 'start-production': 'startupjs start-production',
178
+ 'test-e2e': 'startupjs test-e2e',
179
+ 'codegen-test-e2e': 'startupjs codegen-test-e2e'
166
180
  }
167
181
 
168
182
  const DEFAULT_TEMPLATE = 'ui'
@@ -206,7 +220,7 @@ let templatesPath
206
220
  commander
207
221
  .command('init <projectName>')
208
222
  .description('bootstrap a new startupjs application')
209
- .option('-rn, --react-native <semver>', 'Use a particular semver of React Native as a template', 'latest')
223
+ .option('--react-native <semver>', 'Use a particular semver of React Native as a template', 'latest')
210
224
  .option('-t, --template <name>', 'Which startupjs template to use to bootstrap the project', DEFAULT_TEMPLATE)
211
225
  .option('-y, --yarn <semver>', 'Use a particular semver of yarn', DEFAULT_YARN_VERSION)
212
226
  .action(async (projectName, { reactNative, template, yarn }) => {
@@ -356,6 +370,26 @@ commander
356
370
  )
357
371
  })
358
372
 
373
+ commander
374
+ .command('test-e2e')
375
+ .description('Run e2e tests')
376
+ .action(async (options) => {
377
+ await execa.command(
378
+ SCRIPTS_ORIG.testE2E(options),
379
+ { stdio: 'inherit', shell: true }
380
+ )
381
+ })
382
+
383
+ commander
384
+ .command('codegen-test-e2e')
385
+ .description('Run codegen for e2e tests')
386
+ .action(async (options) => {
387
+ await execa.command(
388
+ SCRIPTS_ORIG.codegenTestE2E(options),
389
+ { stdio: 'inherit', shell: true }
390
+ )
391
+ })
392
+
359
393
  commander
360
394
  .command('web')
361
395
  .description('Compile (with webpack) and run web')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs/cli",
3
- "version": "0.55.8",
3
+ "version": "0.55.10",
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": "75f57690644950055f8c8cb9afa265eb44f594fd"
27
+ "gitHead": "57d9888fca3409050042fa1c3ea9a5783e090275"
28
28
  }