This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor create-project to support testing the cli and middleware int…
…egration (#488) * Refactor create-project to support testing the cli and middleware integration * Make create-project output more helpful and descriptive * Revise create-project tests to utilize new Vue preset and Neutrino extensions * Run create-project tests serially to output to CI stdout more frequently :( * Scaffold all middleware consistently in the root of the destination project
- Loading branch information
1 parent
135d7aa
commit cd5fa51
Showing
37 changed files
with
841 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
#!/usr/bin/env node | ||
|
||
const yeoman = require('yeoman-environment'); | ||
const yargs = require('yargs'); | ||
const path = require('path'); | ||
const { createEnv } = require('yeoman-environment'); | ||
const { basename, isAbsolute, join, resolve } = require('path'); | ||
|
||
const env = yeoman.createEnv(); | ||
const env = createEnv(); | ||
const done = exitCode => process.exit(exitCode || 0); | ||
const dir = path.resolve(__dirname, '../commands/init'); | ||
const dir = resolve(__dirname, '../commands/init'); | ||
|
||
env.register(require.resolve(dir), 'create-neutrino-project:init'); | ||
env.register(require.resolve(dir), 'create-neutrino-project'); | ||
|
||
const cli = yargs.command('<project-directory>') | ||
.demandCommand(1, 'Only <project-directory> is required') | ||
.help() | ||
.argv; | ||
const directory = isAbsolute(cli._[0]) ? cli._[0] : join(process.cwd(), cli._[0]); | ||
const name = basename(directory); | ||
|
||
env.run('create-neutrino-project:init', { directory: cli._[0] }, done); | ||
env.run('create-neutrino-project', { | ||
directory, | ||
name, | ||
stdio: process.env.NODE_ENV === 'test' ? 'ignore' : 'inherit' | ||
}, done); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.