-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c76b95
commit ebf8ad0
Showing
15 changed files
with
817 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: 'import - CLI command' | ||
description: 'Import another project into the workspace' | ||
--- | ||
|
||
# import | ||
|
||
Import another project into the workspace | ||
|
||
## Usage | ||
|
||
```shell | ||
nx import [sourceRemoteUrl] [destination] | ||
``` | ||
|
||
Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpm nx`. | ||
|
||
## Options | ||
|
||
### destination | ||
|
||
Type: `string` | ||
|
||
The destination in the current workspace | ||
|
||
### help | ||
|
||
Type: `boolean` | ||
|
||
Show help | ||
|
||
### ref | ||
|
||
Type: `string` | ||
|
||
The branch to import | ||
|
||
### sourceRemoteUrl | ||
|
||
Type: `string` | ||
|
||
The remote URL of the source to import | ||
|
||
### verbose | ||
|
||
Type: `boolean` | ||
|
||
Prints additional information about the commands (e.g., stack traces) | ||
|
||
### version | ||
|
||
Type: `boolean` | ||
|
||
Show version number |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: 'import - CLI command' | ||
description: 'Import another project into the workspace' | ||
--- | ||
|
||
# import | ||
|
||
Import another project into the workspace | ||
|
||
## Usage | ||
|
||
```shell | ||
nx import [sourceRemoteUrl] [destination] | ||
``` | ||
|
||
Install `nx` globally to invoke the command directly using `nx`, or use `npx nx`, `yarn nx`, or `pnpm nx`. | ||
|
||
## Options | ||
|
||
### destination | ||
|
||
Type: `string` | ||
|
||
The destination in the current workspace | ||
|
||
### help | ||
|
||
Type: `boolean` | ||
|
||
Show help | ||
|
||
### ref | ||
|
||
Type: `string` | ||
|
||
The branch to import | ||
|
||
### sourceRemoteUrl | ||
|
||
Type: `string` | ||
|
||
The remote URL of the source to import | ||
|
||
### verbose | ||
|
||
Type: `boolean` | ||
|
||
Prints additional information about the commands (e.g., stack traces) | ||
|
||
### version | ||
|
||
Type: `boolean` | ||
|
||
Show version number |
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,39 @@ | ||
import { Arguments, CommandModule, MiddlewareFunction } from 'yargs'; | ||
import { linkToNxDevAndExamples } from '../yargs-utils/documentation'; | ||
import { withVerbose } from '../yargs-utils/shared-options'; | ||
import { handleErrors } from '../../utils/params'; | ||
import type { ImportOptions } from './import'; | ||
|
||
export const yargsImportCommand: CommandModule = { | ||
command: 'import [sourceRemoteUrl] [destination]', | ||
describe: 'Import another project into the workspace', | ||
builder: (yargs) => | ||
linkToNxDevAndExamples( | ||
withVerbose( | ||
yargs | ||
.positional('sourceRemoteUrl', { | ||
type: 'string', | ||
description: 'The remote URL of the source to import', | ||
}) | ||
.positional('destination', { | ||
type: 'string', | ||
description: 'The destination in the current workspace', | ||
}) | ||
.option('ref', { | ||
type: 'string', | ||
description: 'The branch to import', | ||
}) | ||
.requiresArg('ref') | ||
), | ||
'import' | ||
), | ||
handler: async (args) => { | ||
const exitCode = await handleErrors( | ||
(args.verbose as boolean) ?? process.env.NX_VERBOSE_LOGGING === 'true', | ||
async () => { | ||
return (await import('./import')).importHandler(args as any); | ||
} | ||
); | ||
process.exit(exitCode); | ||
}, | ||
}; |
Oops, something went wrong.