Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(angular): change --preserveAngularCLILayout to --preserve-angular-cli-layout #9051

Merged
merged 1 commit into from Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/shared/migration/migration-angular.md
Expand Up @@ -10,10 +10,10 @@ using a monorepo approach. If you are currently using an Angular CLI workspace,

## Using ng add and preserving your existing structure

To add Nx to an existing Angular CLI workspace to an Nx workspace, with keeping your existing file structure in place, use the `ng add` command with the `--preserveAngularCLILayout` option:
To add Nx to an existing Angular CLI workspace to an Nx workspace, with keeping your existing file structure in place, use the `ng add` command with the `--preserve-angular-cli-layout` option:

```bash
ng add @nrwl/workspace --preserveAngularCLILayout
ng add @nrwl/workspace --preserve-angular-cli-layout
```

This installs the `@nrwl/workspace` package into your workspace and applies the following changes to your workspace:
Expand Down
5 changes: 2 additions & 3 deletions e2e/angular-core/src/ng-add.test.ts
Expand Up @@ -288,9 +288,8 @@ describe('convert Angular CLI workspace to an Nx workspace', () => {
// runCommand('mv src-bak src');
});

it('should support preserveAngularCLILayout', () => {
// TODO: rename this arg so it doesn't split the CLI letters
runNgAdd('--preserve-angular-c-l-i-layout');
it('should support preserveAngularCliLayout', () => {
runNgAdd('--preserve-angular-cli-layout');

const updatedAngularCLIJson = readJson('angular.json');
expect(updatedAngularCLIJson.projects[project].root).toEqual('');
Expand Down
6 changes: 3 additions & 3 deletions packages/workspace/src/generators/init/init.spec.ts
Expand Up @@ -408,7 +408,7 @@ describe('workspace', () => {
it('should update package.json', async () => {
await initGenerator(tree, {
name: 'myApp',
preserveAngularCLILayout: true,
preserveAngularCliLayout: true,
});

const d = readJson(tree, '/package.json').devDependencies;
Expand All @@ -419,7 +419,7 @@ describe('workspace', () => {
it('should create nx.json', async () => {
await initGenerator(tree, {
name: 'myApp',
preserveAngularCLILayout: true,
preserveAngularCliLayout: true,
});

const nxJson = readJson(tree, '/nx.json');
Expand All @@ -429,7 +429,7 @@ describe('workspace', () => {
it('should create decorate-angular-cli.js', async () => {
await initGenerator(tree, {
name: 'myApp',
preserveAngularCLILayout: true,
preserveAngularCliLayout: true,
});
const s = readJson(tree, '/package.json').scripts;

Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/src/generators/init/init.ts
Expand Up @@ -629,7 +629,7 @@ function renameDirSyncInTree(tree: Tree, from: string, to: string) {
}

export async function initGenerator(tree: Tree, schema: Schema) {
if (schema.preserveAngularCLILayout) {
if (schema.preserveAngularCliLayout) {
addDependenciesToPackageJson(tree, {}, { '@nrwl/workspace': nxVersion });
createNxJson(tree);
decorateAngularClI(tree);
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/src/generators/init/schema.d.ts
Expand Up @@ -2,6 +2,6 @@ export interface Schema {
name: string;
skipInstall?: boolean;
npmScope?: string;
preserveAngularCLILayout?: boolean;
preserveAngularCliLayout?: boolean;
defaultBase?: string;
}
4 changes: 2 additions & 2 deletions packages/workspace/src/generators/init/schema.json
Expand Up @@ -2,7 +2,7 @@
"$schema": "http://json-schema.org/schema",
"$id": "SchematicsNxNgAdd",
"title": "Init Workspace",
"cli": true,
"cli": "ng",
"description": "NOTE: Does not work in the --dry-run mode",
"type": "object",
"properties": {
Expand All @@ -19,7 +19,7 @@
"description": "Skip installing after adding @nrwl/workspace",
"default": false
},
"preserveAngularCLILayout": {
"preserveAngularCliLayout": {
"type": "boolean",
"description": "Preserve the Angular CLI layout instead of moving the app into apps.",
"default": false
Expand Down