Skip to content

Commit cd6c181

Browse files
author
Angular Builds
committed
0173c88 build: update devinfra digest to 85eab90
1 parent 839ca89 commit cd6c181

File tree

22 files changed

+52
-51
lines changed

22 files changed

+52
-51
lines changed

app-shell/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function addServerRoutes(options) {
143143
.filter((node) => node.kind === typescript_1.default.SyntaxKind.ImportDeclaration)
144144
.sort((a, b) => a.getStart() - b.getStart());
145145
const insertPosition = imports[imports.length - 1].getEnd();
146-
const routeText = `\n\nconst routes: Routes = [ { path: '${APP_SHELL_ROUTE}', component: AppShellComponent }];`;
146+
const routeText = `\n\nconst routes: Routes = [ { path: '${APP_SHELL_ROUTE}', component: AppShell }];`;
147147
recorder.insertRight(insertPosition, routeText);
148148
host.commitUpdate(recorder);
149149
}
@@ -195,13 +195,13 @@ function addStandaloneServerRoute(options) {
195195
multi: true,
196196
useValue: [{
197197
path: '${APP_SHELL_ROUTE}',
198-
component: AppShellComponent
198+
component: AppShell
199199
}]
200200
}\n `,
201201
];
202202
recorder.insertRight(providersLiteral.getStart(), `[\n${updatedProvidersString.join(',\n')}]`);
203203
(0, change_1.applyToUpdateRecorder)(recorder, [
204-
(0, ast_utils_1.insertImport)(configSourceFile, configFilePath, 'AppShellComponent', './app-shell/app-shell.component'),
204+
(0, ast_utils_1.insertImport)(configSourceFile, configFilePath, 'AppShell', './app-shell/app-shell'),
205205
]);
206206
host.commitUpdate(recorder);
207207
};
@@ -228,10 +228,10 @@ function addServerRoutingConfig(options, isStandalone) {
228228
throw new schematics_1.SchematicsException(`Cannot find the "provideServerRouting" function call in "${configFilePath}".`);
229229
}
230230
recorder = host.beginUpdate(configFilePath);
231-
recorder.insertLeft(functionCall.end - 1, `, withAppShell(AppShellComponent)`);
231+
recorder.insertLeft(functionCall.end - 1, `, withAppShell(AppShell)`);
232232
(0, change_1.applyToUpdateRecorder)(recorder, [
233233
(0, ast_utils_1.insertImport)(configSourceFile, configFilePath, 'withAppShell', '@angular/ssr'),
234-
(0, ast_utils_1.insertImport)(configSourceFile, configFilePath, 'AppShellComponent', './app-shell/app-shell.component'),
234+
(0, ast_utils_1.insertImport)(configSourceFile, configFilePath, 'AppShell', './app-shell/app-shell'),
235235
]);
236236
host.commitUpdate(recorder);
237237
};

application/files/module-files/src/app/app.module.ts.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { NgModule<% if(experimentalZoneless) { %>, provideExperimentalZonelessCh
22
import { BrowserModule } from '@angular/platform-browser';
33
<% if (routing) { %>
44
import { AppRoutingModule } from './app-routing.module';<% } %>
5-
import { AppComponent } from './app.component';
5+
import { App } from './app';
66

77
@NgModule({
88
declarations: [
9-
AppComponent
9+
App
1010
],
1111
imports: [
1212
BrowserModule<% if (routing) { %>,
1313
AppRoutingModule<% } %>
1414
],
1515
providers: [<% if (experimentalZoneless) { %>provideExperimentalZonelessChangeDetection()<% } %>],
16-
bootstrap: [AppComponent]
16+
bootstrap: [App]
1717
})
1818
export class AppModule { }

application/files/module-files/src/app/app.component.spec.ts.template renamed to application/files/module-files/src/app/app.spec.ts.template

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
<% if(experimentalZoneless) { %>import { provideExperimentalZonelessChangeDetection } from '@angular/core';
22
<% } %>import { TestBed } from '@angular/core/testing';<% if (routing) { %>
33
import { RouterModule } from '@angular/router';<% } %>
4-
import { AppComponent } from './app.component';
4+
import { App } from './app';
55

6-
describe('AppComponent', () => {
6+
describe('App', () => {
77
beforeEach(async () => {
88
await TestBed.configureTestingModule({<% if (routing) { %>
99
imports: [
1010
RouterModule.forRoot([])
1111
],<% } %>
1212
declarations: [
13-
AppComponent
13+
App
1414
],<% if(experimentalZoneless) { %>
1515
providers: [provideExperimentalZonelessChangeDetection()]<% } %>
1616
}).compileComponents();
1717
});
1818

1919
it('should create the app', () => {
20-
const fixture = TestBed.createComponent(AppComponent);
20+
const fixture = TestBed.createComponent(App);
2121
const app = fixture.componentInstance;
2222
expect(app).toBeTruthy();
2323
});
2424

2525
it(`should have as title '<%= name %>'`, () => {
26-
const fixture = TestBed.createComponent(AppComponent);
26+
const fixture = TestBed.createComponent(App);
2727
const app = fixture.componentInstance;
2828
expect(app.title).toEqual('<%= name %>');
2929
});
3030

3131
it('should render title', () => {
32-
const fixture = TestBed.createComponent(AppComponent);
32+
const fixture = TestBed.createComponent(App);
3333
fixture.detectChanges();
3434
const compiled = fixture.nativeElement as HTMLElement;
3535
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, <%= name %>');

application/files/module-files/src/app/app.component.ts.template renamed to application/files/module-files/src/app/app.ts.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import { Component } from '@angular/core';
99
%><router-outlet /><%
1010
} %>
1111
`,<% } else { %>
12-
templateUrl: './app.component.ng.html',<% } %>
12+
templateUrl: './app.ng.html',<% } %>
1313
standalone: false,<% if(inlineStyle) { %>
1414
styles: []<% } else { %>
15-
styleUrl: './app.component.<%= style %>'<% } %>
15+
styleUrl: './app.<%= style %>'<% } %>
1616
})
17-
export class AppComponent {
17+
export class App {
1818
title = '<%= name %>';
1919
}

application/files/standalone-files/src/app/app.component.spec.ts.template renamed to application/files/standalone-files/src/app/app.spec.ts.template

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<% if(experimentalZoneless) { %>import { provideExperimentalZonelessChangeDetection } from '@angular/core';
22
<% } %>import { TestBed } from '@angular/core/testing';
3-
import { AppComponent } from './app.component';
3+
import { App } from './app';
44

5-
describe('AppComponent', () => {
5+
describe('App', () => {
66
beforeEach(async () => {
77
await TestBed.configureTestingModule({
8-
imports: [AppComponent],<% if(experimentalZoneless) { %>
8+
imports: [App],<% if(experimentalZoneless) { %>
99
providers: [provideExperimentalZonelessChangeDetection()]<% } %>
1010
}).compileComponents();
1111
});
1212

1313
it('should create the app', () => {
14-
const fixture = TestBed.createComponent(AppComponent);
14+
const fixture = TestBed.createComponent(App);
1515
const app = fixture.componentInstance;
1616
expect(app).toBeTruthy();
1717
});
1818

1919
it(`should have the '<%= name %>' title`, () => {
20-
const fixture = TestBed.createComponent(AppComponent);
20+
const fixture = TestBed.createComponent(App);
2121
const app = fixture.componentInstance;
2222
expect(app.title).toEqual('<%= name %>');
2323
});
2424

2525
it('should render title', () => {
26-
const fixture = TestBed.createComponent(AppComponent);
26+
const fixture = TestBed.createComponent(App);
2727
fixture.detectChanges();
2828
const compiled = fixture.nativeElement as HTMLElement;
2929
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, <%= name %>');

application/files/standalone-files/src/app/app.component.ts.template renamed to application/files/standalone-files/src/app/app.ts.template

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import { RouterOutlet } from '@angular/router';<% } %>
1111
%><router-outlet /><%
1212
} %>
1313
`,<% } else { %>
14-
templateUrl: './app.component.ng.html',<% } if(inlineStyle) { %>
14+
templateUrl: './app.ng.html',<% } if(inlineStyle) { %>
1515
styles: [],<% } else { %>
16-
styleUrl: './app.component.<%= style %>'<% } %>
16+
styleUrl: './app.<%= style %>'<% } %>
1717
})
18-
export class AppComponent {
18+
export class App {
1919
title = '<%= name %>';
2020
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { bootstrapApplication } from '@angular/platform-browser';
22
import { appConfig } from './app/app.config';
3-
import { AppComponent } from './app/app.component';
3+
import { App } from './app/app';
44

5-
bootstrapApplication(AppComponent, appConfig)
5+
bootstrapApplication(App, appConfig)
66
.catch((err) => console.error(err));

component/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ function default_1(options) {
3636
options.path = (0, workspace_1.buildDefaultPath)(project);
3737
}
3838
options.module = (0, find_module_1.findModuleFromOptions)(host, options);
39+
// Schematic templates require a defined type value
40+
options.type ??= '';
3941
const parsedPath = (0, parse_name_1.parseName)(options.path, options.name);
4042
options.name = parsedPath.name;
4143
options.path = parsedPath.path;

component/schema.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@
9393
},
9494
"type": {
9595
"type": "string",
96-
"description": "Append a custom type to the component's filename. For example, if you set the type to `container`, the file will be named `my-component.container.ts`.",
97-
"default": "Component"
96+
"description": "Append a custom type to the component's filename. For example, if you set the type to `container`, the file will be named `my-component.container.ts`."
9897
},
9998
"skipTests": {
10099
"type": "boolean",

library/files/src/__entryFile__.ts.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
*/
44

55
export * from './lib/<%= dasherize(name) %>.service';
6-
export * from './lib/<%= dasherize(name) %>.component';<% if (!standalone) { %>
6+
export * from './lib/<%= dasherize(name) %>';<% if (!standalone) { %>
77
export * from './lib/<%= dasherize(name) %>.module';<% } %>

module/files/__name@dasherize@if-flat__/__name@dasherize__-routing.module.ts.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { NgModule } from '@angular/core';
22
import { RouterModule, Routes } from '@angular/router';<% if (lazyRoute) { %>
3-
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';<% } %>
3+
import { <%= classify(name) %> } from './<%= dasherize(name) %>';<% } %>
44

5-
const routes: Routes = [<% if (lazyRoute) { %>{ path: '', component: <%= classify(name) %>Component }<% } %>];
5+
const routes: Routes = [<% if (lazyRoute) { %>{ path: '', component: <%= classify(name) %> }<% } %>];
66

77
@NgModule({
88
imports: [RouterModule.for<%= routingScope %>(routes)],

module/files/__name@dasherize@if-flat__/__name@dasherize__.module.ts.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Routes, RouterModule } from '@angular/router';<% } %>
55
import { <%= classify(name) %>RoutingModule } from './<%= dasherize(name) %>-routing.module';<% } %>
66
<% if (lazyRouteWithoutRouteModule) { %>
77
const routes: Routes = [
8-
{ path: '', component: <%= classify(name) %>Component }
8+
{ path: '', component: <%= classify(name) %> }
99
];<% } %>
1010

1111
@NgModule({

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@schematics/angular",
3-
"version": "20.0.0-next.1+sha-29a58e5",
3+
"version": "20.0.0-next.1+sha-0173c88",
44
"description": "Schematics specific to Angular",
55
"homepage": "https://github.com/angular/angular-cli",
66
"keywords": [
@@ -22,8 +22,8 @@
2222
},
2323
"schematics": "./collection.json",
2424
"dependencies": {
25-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#29a58e5",
26-
"@angular-devkit/schematics": "github:angular/angular-devkit-schematics-builds#29a58e5",
25+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#0173c88",
26+
"@angular-devkit/schematics": "github:angular/angular-devkit-schematics-builds#0173c88",
2727
"jsonc-parser": "3.3.1"
2828
},
2929
"repository": {
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { NgModule } from '@angular/core';
22
import { ServerModule } from '@angular/platform-server';
33
import { provideServerRouting } from '@angular/ssr';
4-
import { AppComponent } from './app.component';
4+
import { App } from './app';
55
import { AppModule } from './app.module';
66
import { serverRoutes } from './app.routes.server';
77

88
@NgModule({
99
imports: [AppModule, ServerModule],
1010
providers: [provideServerRouting(serverRoutes)],
11-
bootstrap: [AppComponent],
11+
bootstrap: [App],
1212
})
1313
export class AppServerModule {}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { bootstrapApplication } from '@angular/platform-browser';
2-
import { AppComponent } from './app/app.component';
2+
import { App } from './app/app';
33
import { config } from './app/app.config.server';
44

5-
const bootstrap = () => bootstrapApplication(AppComponent, config);
5+
const bootstrap = () => bootstrapApplication(App, config);
66

77
export default bootstrap;

server/files/server-builder/ngmodule-src/app/app.module.server.ts.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { NgModule } from '@angular/core';
22
import { ServerModule } from '@angular/platform-server';
33

44
import { AppModule } from './app.module';
5-
import { AppComponent } from './app.component';
5+
import { App } from './app';
66

77
@NgModule({
88
imports: [
99
AppModule,
1010
ServerModule,
1111
],
12-
bootstrap: [AppComponent],
12+
bootstrap: [App],
1313
})
1414
export class AppServerModule {}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { bootstrapApplication } from '@angular/platform-browser';
2-
import { AppComponent } from './app/app.component';
2+
import { App } from './app/app';
33
import { config } from './app/app.config.server';
44

5-
const bootstrap = () => bootstrapApplication(AppComponent, config);
5+
const bootstrap = () => bootstrapApplication(App, config);
66

77
export default bootstrap;

uniqueId

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fri Mar 14 2025 17:25:00 GMT+0000 (Coordinated Universal Time)
1+
Fri Mar 14 2025 18:39:34 GMT+0000 (Coordinated Universal Time)

utility/find-module.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function findModuleFromOptions(host, options) {
4242
for (const c of candidatesDirs) {
4343
const candidateFiles = ['', `${moduleBaseName}.ts`, `${moduleBaseName}${moduleExt}`].map((x) => (0, core_1.join)(c, x));
4444
for (const sc of candidateFiles) {
45-
if (host.exists(sc)) {
45+
if (host.exists(sc) && host.readText(sc).includes('@NgModule')) {
4646
return (0, core_1.normalize)(sc);
4747
}
4848
}

utility/latest-versions.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exports.latestVersions = {
1616
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
1717
Angular: '^20.0.0-next.0',
1818
NgPackagr: '^20.0.0-next.0',
19-
DevkitBuildAngular: '^20.0.0-next.1+sha-29a58e5',
20-
AngularBuild: '^20.0.0-next.1+sha-29a58e5',
21-
AngularSSR: '^20.0.0-next.1+sha-29a58e5',
19+
DevkitBuildAngular: '^20.0.0-next.1+sha-0173c88',
20+
AngularBuild: '^20.0.0-next.1+sha-0173c88',
21+
AngularSSR: '^20.0.0-next.1+sha-0173c88',
2222
};

web-worker/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function addSnippet(options) {
2424
.getDir(options.path)
2525
.subfiles // Find all files that start with the same name, are ts files,
2626
// and aren't spec or module files.
27-
.filter((f) => fileRegExp.test(f) && !/(module|spec)\.ts$/.test(f))
27+
.filter((f) => fileRegExp.test(f) && !/(module|spec|config|routes)\.ts$/.test(f))
2828
// Sort alphabetically for consistency.
2929
.sort();
3030
if (siblingModules.length === 0) {

0 commit comments

Comments
 (0)