@schematics/angular 19.0.0-rc.1 → 19.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-shell/index.js +12 -4
- package/package.json +3 -3
- package/utility/latest-versions.js +2 -2
package/app-shell/index.js
CHANGED
|
@@ -202,7 +202,7 @@ function addStandaloneServerRoute(options) {
|
|
|
202
202
|
if (!host.exists(configFilePath)) {
|
|
203
203
|
throw new schematics_1.SchematicsException(`Cannot find "${configFilePath}".`);
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
let recorder = host.beginUpdate(configFilePath);
|
|
206
206
|
let configSourceFile = getSourceFile(host, configFilePath);
|
|
207
207
|
if (!(0, ast_utils_1.isImported)(configSourceFile, 'ROUTES', '@angular/router')) {
|
|
208
208
|
const routesChange = (0, ast_utils_1.insertImport)(configSourceFile, configFilePath, 'ROUTES', '@angular/router');
|
|
@@ -229,6 +229,16 @@ function addStandaloneServerRoute(options) {
|
|
|
229
229
|
}\n `,
|
|
230
230
|
];
|
|
231
231
|
recorder.insertRight(providersLiteral.getStart(), `[\n${updatedProvidersString.join(',\n')}]`);
|
|
232
|
+
if (options.serverRouting) {
|
|
233
|
+
host.commitUpdate(recorder);
|
|
234
|
+
configSourceFile = getSourceFile(host, configFilePath);
|
|
235
|
+
const functionCall = (0, ast_utils_1.findNodes)(configSourceFile, typescript_1.default.isCallExpression).find((n) => typescript_1.default.isIdentifier(n.expression) && n.expression.getText() === 'provideServerRoutesConfig');
|
|
236
|
+
if (!functionCall) {
|
|
237
|
+
throw new schematics_1.SchematicsException(`Cannot find the "provideServerRoutesConfig" function call in "${configFilePath}".`);
|
|
238
|
+
}
|
|
239
|
+
recorder = host.beginUpdate(configFilePath);
|
|
240
|
+
recorder.insertLeft(functionCall.end - 1, `, { appShellRoute: '${APP_SHELL_ROUTE}' }`);
|
|
241
|
+
}
|
|
232
242
|
// Add AppShellComponent import
|
|
233
243
|
const appShellImportChange = (0, ast_utils_1.insertImport)(configSourceFile, configFilePath, 'AppShellComponent', './app-shell/app-shell.component');
|
|
234
244
|
(0, change_1.applyToUpdateRecorder)(recorder, [appShellImportChange]);
|
|
@@ -279,9 +289,7 @@ function default_1(options) {
|
|
|
279
289
|
...(isStandalone
|
|
280
290
|
? [addStandaloneServerRoute(options)]
|
|
281
291
|
: [addRouterModule(browserEntryPoint), addServerRoutes(options)]),
|
|
282
|
-
options.serverRouting
|
|
283
|
-
? addServerRoutingConfig(options)
|
|
284
|
-
: addAppShellConfigToWorkspace(options),
|
|
292
|
+
options.serverRouting ? (0, schematics_1.noop)() : addAppShellConfigToWorkspace(options),
|
|
285
293
|
(0, schematics_1.schematic)('component', {
|
|
286
294
|
name: 'app-shell',
|
|
287
295
|
module: 'app.module.server.ts',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematics/angular",
|
|
3
|
-
"version": "19.0.0-rc.
|
|
3
|
+
"version": "19.0.0-rc.2",
|
|
4
4
|
"description": "Schematics specific to Angular",
|
|
5
5
|
"homepage": "https://github.com/angular/angular-cli",
|
|
6
6
|
"keywords": [
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"schematics": "./collection.json",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@angular-devkit/core": "19.0.0-rc.
|
|
26
|
-
"@angular-devkit/schematics": "19.0.0-rc.
|
|
25
|
+
"@angular-devkit/core": "19.0.0-rc.2",
|
|
26
|
+
"@angular-devkit/schematics": "19.0.0-rc.2",
|
|
27
27
|
"jsonc-parser": "3.3.1"
|
|
28
28
|
},
|
|
29
29
|
"packageManager": "yarn@4.5.0",
|
|
@@ -15,6 +15,6 @@ exports.latestVersions = {
|
|
|
15
15
|
...dependencies,
|
|
16
16
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
17
17
|
Angular: dependencies['@angular/core'],
|
|
18
|
-
DevkitBuildAngular: '^19.0.0-rc.
|
|
19
|
-
AngularSSR: '^19.0.0-rc.
|
|
18
|
+
DevkitBuildAngular: '^19.0.0-rc.2',
|
|
19
|
+
AngularSSR: '^19.0.0-rc.2',
|
|
20
20
|
};
|