Skip to content

Commit bd840b2

Browse files
alan-agius4mgechev
authored andcommitted
fix(@schematics/angular): improve cli migration name and description (angular#16093)
1 parent 00aa5bb commit bd840b2

8 files changed

+49
-49
lines changed

packages/angular/cli/commands/update-impl.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
180180

181181
// Commit migration
182182
if (commit) {
183-
let message = `${packageName} migration - ${migration.name}.`;
183+
let message = `${packageName} migration - ${migration.name}`;
184184
if (migration.description) {
185185
message += '\n' + migration.description;
186186
}

packages/schematics/angular/migrations/migration-collection.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
"factory": "./update-8/#updateLazyModulePaths",
4141
"description": "Update an Angular CLI project to version 8."
4242
},
43-
"migration-09": {
43+
"workspace-version-9": {
4444
"version": "9.0.0-beta.0",
4545
"factory": "./update-9",
46-
"description": "Update an Angular CLI project to version 9."
46+
"description": "Angular Workspace migration. Update an Angular CLI workspace to version 9."
4747
},
48-
"migration-10": {
48+
"lazy-loading-syntax": {
4949
"version": "9.0.0-next.6",
5050
"factory": "./update-8/#updateLazyModulePaths",
51-
"description": "Update lazy loading syntax to use dynamic imports."
51+
"description": "Lazy loading syntax migration. Update lazy loading syntax to use dynamic imports."
5252
}
5353
}
5454
}

packages/schematics/angular/migrations/update-9/ivy-libraries_spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Migration to version 9', () => {
7070

7171
updateWorkspaceTargets(tree, config);
7272

73-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
73+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
7474
config = getWorkspaceTargets(tree2).build;
7575
expect(config.configurations.production.tsConfig).toEqual(libProdTsConfig);
7676
expect(tree2.exists(libProdTsConfig)).toBeTruthy();
@@ -82,7 +82,7 @@ describe('Migration to version 9', () => {
8282

8383
updateWorkspaceTargets(tree, config);
8484

85-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
85+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
8686
config = getWorkspaceTargets(tree2).build;
8787
expect(config.configurations.production.tsConfig).toEqual(libProdTsConfig);
8888
expect(tree2.exists(libProdTsConfig)).toBeTruthy();
@@ -94,7 +94,7 @@ describe('Migration to version 9', () => {
9494

9595
updateWorkspaceTargets(tree, config);
9696

97-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
97+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
9898
config = getWorkspaceTargets(tree2).build;
9999
expect(config.configurations.production.tsConfig).toEqual(libProdTsConfig);
100100
expect(tree2.exists(libProdTsConfig)).toBeTruthy();
@@ -113,7 +113,7 @@ describe('Migration to version 9', () => {
113113

114114
tree.create(prodLibTsConfig, JSON.stringify(tsconfig, undefined, 2));
115115

116-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
116+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
117117
config = getWorkspaceTargets(tree2).build;
118118
expect(config.configurations.production.tsConfig).toEqual(prodLibTsConfig);
119119

@@ -137,7 +137,7 @@ describe('Migration to version 9', () => {
137137

138138
tree.create(prodLibTsConfig, JSON.stringify(tsconfig, undefined, 2));
139139

140-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
140+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
141141
config = getWorkspaceTargets(tree2).build;
142142
expect(config.configurations.production.tsConfig).toEqual(prodLibTsConfig);
143143

packages/schematics/angular/migrations/update-9/ngsw-config_spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('Migration to version 9', () => {
8787

8888
tree.create(ngswConfigPath, ngswConfig);
8989

90-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
90+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
9191
const { assetGroups } = JSON.parse(tree2.readContent(ngswConfigPath));
9292
expect(assetGroups[0].resources.files).toEqual([
9393
'/favicon.ico',
@@ -127,7 +127,7 @@ describe('Migration to version 9', () => {
127127

128128
tree.create(ngswConfigPath, ngswConfig);
129129

130-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
130+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
131131
const { assetGroups } = JSON.parse(tree2.readContent(ngswConfigPath));
132132
expect(assetGroups[0].resources.files).toEqual([
133133
'/manifest.webmanifest',

packages/schematics/angular/migrations/update-9/remove-tsickle_spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('Migration to version 9', () => {
5959

6060
tree.overwrite(libTsConfig, JSON.stringify(tsconfig, undefined, 2));
6161

62-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
62+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
6363
const { angularCompilerOptions } = JSON.parse(tree2.readContent(libTsConfig));
6464
expect(angularCompilerOptions).toEqual({ enableIvy: false, skipTemplateCodegen: true });
6565
});
@@ -75,7 +75,7 @@ describe('Migration to version 9', () => {
7575
};
7676

7777
tree.overwrite('/package.json', JSON.stringify(packageJson, undefined, 2));
78-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
78+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
7979
const { dependencies, devDependencies } = JSON.parse(tree2.readContent('/package.json'));
8080
expect(dependencies['tsickle']).toBeUndefined();
8181
expect(devDependencies['tsickle']).toBeUndefined();

packages/schematics/angular/migrations/update-9/update-app-tsconfigs_spec.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('Migration to version 9', () => {
5858

5959
it('should update apps tsConfig with stricter files inclusions', async () => {
6060
overrideJsonFile(tree, 'tsconfig.app.json', defaultTsConfigOptions);
61-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
61+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
6262
const { exclude, files } = JSON.parse(tree2.readContent('tsconfig.app.json'));
6363
expect(exclude).toBeUndefined();
6464
expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']);
@@ -72,7 +72,7 @@ describe('Migration to version 9', () => {
7272

7373
overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent);
7474

75-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
75+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
7676
const { files, include } = JSON.parse(tree2.readContent('tsconfig.app.json'));
7777
expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']);
7878
expect(include).toEqual(['foo.ts']);
@@ -87,7 +87,7 @@ describe('Migration to version 9', () => {
8787

8888
overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent);
8989

90-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
90+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
9191
const { files, include, exclude } = JSON.parse(tree2.readContent('tsconfig.app.json'));
9292
expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']);
9393
expect(include).toEqual(['src/**/*.d.ts']);
@@ -102,7 +102,7 @@ describe('Migration to version 9', () => {
102102

103103
overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent);
104104

105-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
105+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
106106
const { files, include, exclude } = JSON.parse(tree2.readContent('tsconfig.app.json'));
107107
expect(files).toEqual(['src/main.ts', 'src/polyfills.ts']);
108108
expect(include).toEqual(['foo.ts', 'src/**/*.d.ts']);
@@ -111,7 +111,7 @@ describe('Migration to version 9', () => {
111111

112112
it(`should remove angularCompilerOptions when enableIvy is true and it's the only option`, async () => {
113113
overrideJsonFile(tree, 'tsconfig.app.json', defaultTsConfigOptions);
114-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
114+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
115115
const { angularCompilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json'));
116116
expect(angularCompilerOptions).toBeUndefined();
117117
});
@@ -126,7 +126,7 @@ describe('Migration to version 9', () => {
126126
};
127127

128128
overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent);
129-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
129+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
130130
const { angularCompilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json'));
131131
expect(angularCompilerOptions.enableIvy).toBeUndefined();
132132
expect(angularCompilerOptions.fullTemplateTypeCheck).toBe(true);
@@ -142,7 +142,7 @@ describe('Migration to version 9', () => {
142142
};
143143

144144
overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent);
145-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
145+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
146146
const { angularCompilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json'));
147147
expect(angularCompilerOptions.enableIvy).toBe(false);
148148
expect(angularCompilerOptions.fullTemplateTypeCheck).toBe(true);
@@ -158,7 +158,7 @@ describe('Migration to version 9', () => {
158158
};
159159

160160
overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent);
161-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
161+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
162162
const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json'));
163163
expect(compilerOptions.module).toBeUndefined();
164164

@@ -177,7 +177,7 @@ describe('Migration to version 9', () => {
177177
};
178178

179179
overrideJsonFile(tree, 'tsconfig.app.json', tsConfigContent);
180-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
180+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
181181
const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.app.json'));
182182
expect(compilerOptions.module).toBe('esnext');
183183
});
@@ -206,7 +206,7 @@ describe('Migration to version 9', () => {
206206
.toPromise();
207207

208208
overrideJsonFile(tree, 'tsconfig.server.json', tsConfigContent);
209-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
209+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
210210
const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.server.json'));
211211
expect(compilerOptions.module).toBe('commonjs');
212212
});
@@ -218,7 +218,7 @@ describe('Migration to version 9', () => {
218218
};
219219

220220
overrideJsonFile(tree, 'tsconfig.json', tsConfigContent);
221-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
221+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
222222
const { compilerOptions } = JSON.parse(tree2.readContent('tsconfig.json'));
223223
expect(compilerOptions.module).toBe('esnext');
224224
});

packages/schematics/angular/migrations/update-9/update-server-main-file_spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('Migration to version 9', () => {
6161

6262
it(`should add exports from '@angular/platform-server'`, async () => {
6363
tree.overwrite(mainServerFile, mainServerContent);
64-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
64+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
6565
expect(tree2.readContent(mainServerFile)).toContain(tags.stripIndents`
6666
export { AppServerModule } from './app/app.server.module';
6767
export { renderModule, renderModuleFactory } from '@angular/platform-server';
@@ -74,7 +74,7 @@ describe('Migration to version 9', () => {
7474
export { platformDynamicServer } from '@angular/platform-server';
7575
export { PlatformConfig } from '@angular/platform-server';
7676
`);
77-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
77+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
7878
expect(tree2.readContent(mainServerFile)).toContain(tags.stripIndents`
7979
export { AppServerModule } from './app/app.server.module';
8080
export { platformDynamicServer, renderModule, renderModuleFactory } from '@angular/platform-server';
@@ -87,7 +87,7 @@ describe('Migration to version 9', () => {
8787
${mainServerContent}
8888
export { platformDynamicServer, renderModuleFactory } from '@angular/platform-server';
8989
`);
90-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
90+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
9191
expect(tree2.readContent(mainServerFile)).toContain(tags.stripIndents`
9292
export { AppServerModule } from './app/app.server.module';
9393
export { platformDynamicServer, renderModuleFactory, renderModule } from '@angular/platform-server';
@@ -101,7 +101,7 @@ describe('Migration to version 9', () => {
101101
`;
102102

103103
tree.overwrite(mainServerFile, input);
104-
const tree2 = await schematicRunner.runSchematicAsync('migration-09', {}, tree.branch()).toPromise();
104+
const tree2 = await schematicRunner.runSchematicAsync('workspace-version-9', {}, tree.branch()).toPromise();
105105
expect(tree2.readContent(mainServerFile)).toBe(input);
106106
});
107107
});

0 commit comments

Comments
 (0)