Skip to content

Commit 0d58f73

Browse files
committed
fix(@schematics/angular): rename app.server.module.ts to app.module.server.ts
This fixes an issue were we generated files using inconsistent names example `app.server.module.ts` and `app.config.server.ts`. (cherry picked from commit 603d24f)
1 parent eca366a commit 0d58f73

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

Diff for: packages/angular_devkit/build_angular/src/builders/app-shell/app-shell_spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('AppShell Builder', () => {
6767
})
6868
export class AppModule { }
6969
`,
70-
'src/app/app.server.module.ts': `
70+
'src/app/app.module.server.ts': `
7171
import { NgModule } from '@angular/core';
7272
import { ServerModule } from '@angular/platform-server';
7373

Diff for: packages/angular_devkit/build_angular/test/hello-world-app/src/main.server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
export { AppServerModule } from './app/app.server.module';
9+
export { AppServerModule } from './app/app.module.server';

Diff for: packages/schematics/angular/app-shell/index_spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('App Shell Schematic', () => {
5656

5757
it('should add a universal app', async () => {
5858
const tree = await schematicRunner.runSchematic('app-shell', defaultOptions, appTree);
59-
const filePath = '/projects/bar/src/app/app.server.module.ts';
59+
const filePath = '/projects/bar/src/app/app.module.server.ts';
6060
expect(tree.exists(filePath)).toEqual(true);
6161
});
6262

@@ -145,7 +145,7 @@ describe('App Shell Schematic', () => {
145145

146146
it('should add router imports to server module', async () => {
147147
const tree = await schematicRunner.runSchematic('app-shell', defaultOptions, appTree);
148-
const filePath = '/projects/bar/src/app/app.server.module.ts';
148+
const filePath = '/projects/bar/src/app/app.module.server.ts';
149149
const content = tree.readContent(filePath);
150150
expect(content).toMatch(/import { Routes, RouterModule } from '@angular\/router';/);
151151
});
@@ -158,21 +158,21 @@ describe('App Shell Schematic', () => {
158158
appTree.overwrite('angular.json', JSON.stringify(workspace, undefined, 2));
159159

160160
tree = await schematicRunner.runSchematic('app-shell', defaultOptions, tree);
161-
const filePath = '/projects/bar/src/app/app.server.module.ts';
161+
const filePath = '/projects/bar/src/app/app.module.server.ts';
162162
const content = tree.readContent(filePath);
163163
expect(content).toMatch(/import { Routes, RouterModule } from '@angular\/router';/);
164164
});
165165

166166
it('should define a server route', async () => {
167167
const tree = await schematicRunner.runSchematic('app-shell', defaultOptions, appTree);
168-
const filePath = '/projects/bar/src/app/app.server.module.ts';
168+
const filePath = '/projects/bar/src/app/app.module.server.ts';
169169
const content = tree.readContent(filePath);
170170
expect(content).toMatch(/const routes: Routes = \[/);
171171
});
172172

173173
it('should import RouterModule with forRoot', async () => {
174174
const tree = await schematicRunner.runSchematic('app-shell', defaultOptions, appTree);
175-
const filePath = '/projects/bar/src/app/app.server.module.ts';
175+
const filePath = '/projects/bar/src/app/app.module.server.ts';
176176
const content = tree.readContent(filePath);
177177
expect(content).toMatch(
178178
/const routes: Routes = \[ { path: 'shell', component: AppShellComponent }\];/,
@@ -183,7 +183,7 @@ describe('App Shell Schematic', () => {
183183
it('should create the shell component', async () => {
184184
const tree = await schematicRunner.runSchematic('app-shell', defaultOptions, appTree);
185185
expect(tree.exists('/projects/bar/src/app/app-shell/app-shell.component.ts')).toBe(true);
186-
const content = tree.readContent('/projects/bar/src/app/app.server.module.ts');
186+
const content = tree.readContent('/projects/bar/src/app/app.module.server.ts');
187187
expect(content).toMatch(/app-shell\.component/);
188188
});
189189

Diff for: packages/schematics/angular/app-shell/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"rootModuleFileName": {
3434
"type": "string",
3535
"description": "The name of the root module file",
36-
"default": "app.server.module.ts"
36+
"default": "app.module.server.ts"
3737
},
3838
"rootModuleClassName": {
3939
"type": "string",

Diff for: packages/schematics/angular/universal/index_spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('Universal Schematic', () => {
6767

6868
it('should create a root module file', async () => {
6969
const tree = await schematicRunner.runSchematic('universal', defaultOptions, appTree);
70-
const filePath = '/projects/bar/src/app/app.server.module.ts';
70+
const filePath = '/projects/bar/src/app/app.module.server.ts';
7171
expect(tree.exists(filePath)).toEqual(true);
7272
});
7373

@@ -76,7 +76,7 @@ describe('Universal Schematic', () => {
7676
const filePath = '/projects/bar/src/main.server.ts';
7777
expect(tree.exists(filePath)).toEqual(true);
7878
const contents = tree.readContent(filePath);
79-
expect(contents).toMatch(/export { AppServerModule } from '\.\/app\/app\.server\.module'/);
79+
expect(contents).toMatch(/export { AppServerModule } from '\.\/app\/app\.module\.server'/);
8080
});
8181

8282
it('should create a tsconfig file for the workspace project', async () => {
@@ -211,7 +211,7 @@ describe('Universal Schematic', () => {
211211
defaultStandaloneOptions,
212212
appTree,
213213
);
214-
const filePath = '/projects/baz/src/app/app.server.module.ts';
214+
const filePath = '/projects/baz/src/app/app.module.server.ts';
215215
expect(tree.exists(filePath)).toEqual(false);
216216
});
217217

Diff for: packages/schematics/angular/universal/schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"type": "string",
3131
"format": "path",
3232
"description": "The name of the root NgModule file.",
33-
"default": "app.server.module.ts"
33+
"default": "app.module.server.ts"
3434
},
3535
"rootModuleClassName": {
3636
"type": "string",

0 commit comments

Comments
 (0)