forked from nrwl/nx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nx): delegate to cli when command is not recognized
- Loading branch information
Showing
16 changed files
with
109 additions
and
421 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
docs/api-workspace/npmscripts/lint-files.md → ...kspace/npmscripts/workspace-lint-files.md
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ensureProject, uniq, runCommand, checkFilesExist } from '../utils'; | ||
|
||
describe('Delegate to CLI', () => { | ||
it('should delegate to the Angular CLI all non-standard commands', async () => { | ||
ensureProject(); | ||
|
||
const appName = uniq('app'); | ||
runCommand(`npm run nx -- g app ${appName}`); | ||
runCommand(`npm run nx -- build ${appName}`); | ||
|
||
checkFilesExist( | ||
`dist/apps/${appName}/index.html`, | ||
`dist/apps/${appName}/polyfills-es2015.js`, | ||
`dist/apps/${appName}/runtime-es2015.js`, | ||
`dist/apps/${appName}/main-es2015.js`, | ||
`dist/apps/${appName}/styles-es2015.js`, | ||
`dist/apps/${appName}/polyfills-es5.js`, | ||
`dist/apps/${appName}/runtime-es5.js`, | ||
`dist/apps/${appName}/main-es5.js`, | ||
`dist/apps/${appName}/styles-es5.js` | ||
); | ||
}, 120000); | ||
}); |
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
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,14 +1,17 @@ | ||
#!/usr/bin/env node | ||
import { commandsObject } from '@nrwl/workspace'; | ||
import { commandsObject, supportedNxCommands } from './nx-commands'; | ||
import { closestCli } from '../utils/app-root'; | ||
|
||
export interface GlobalNxArgs { | ||
help?: boolean; | ||
version?: boolean; | ||
quiet?: boolean; | ||
} | ||
|
||
/** | ||
* The commandsObject is a Yargs object declared in `nx-commands.ts`, | ||
* It is exposed and bootstrapped here to provide CLI features. | ||
*/ | ||
commandsObject.argv; // .argv bootstraps the CLI creation; | ||
if (supportedNxCommands.includes(process.argv[2])) { | ||
// The commandsObject is a Yargs object declared in `nx-commands.ts`, | ||
// It is exposed and bootstrapped here to provide CLI features. | ||
commandsObject.argv; // .argv bootstraps the CLI creation; | ||
} else { | ||
require(closestCli(__dirname)); | ||
} |
Oops, something went wrong.