@nx/angular 21.6.0-canary.20250908-95e7b49 → 21.6.0-canary.20250915-98c47f0
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/migrations.json +161 -0
- package/package.json +9 -9
- package/spec/src/migrations/update-21-6-1/update-angular-cli.spec.d.ts +2 -0
- package/spec/src/migrations/update-21-6-1/update-angular-cli.spec.d.ts.map +1 -0
- package/spec/tsconfig.spec.tsbuildinfo +1 -0
- package/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +6 -1
- package/src/generators/remote/lib/update-ssr-setup.d.ts.map +1 -1
- package/src/generators/remote/lib/update-ssr-setup.js +10 -1
- package/src/generators/setup-ssr/files/pre-v19/standalone-src/__main__ +6 -1
- package/src/generators/setup-ssr/files/v19/application-builder/standalone-src/__main__ +6 -1
- package/src/generators/setup-ssr/files/v19/server-builder/standalone-src/__main__ +6 -1
- package/src/generators/setup-ssr/files/v20+/application-builder/standalone-src/__main__ +6 -1
- package/src/generators/setup-ssr/files/v20+/server-builder/standalone-src/__main__ +6 -1
- package/src/generators/setup-ssr/lib/generate-files.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/generate-files.js +9 -1
- package/src/migrations/update-21-6-1/update-angular-cli.d.ts +4 -0
- package/src/migrations/update-21-6-1/update-angular-cli.d.ts.map +1 -0
- package/src/migrations/update-21-6-1/update-angular-cli.js +23 -0
- package/src/utils/versions.d.ts +4 -4
- package/src/utils/versions.js +4 -4
@@ -1,7 +1,12 @@
|
|
1
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
1
|
+
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
2
2
|
import { RemoteEntry<%= componentType %> } from './app/remote-entry/entry<%= componentFileSuffix %>';
|
3
3
|
import { config } from './app/app.config.server';
|
4
4
|
|
5
|
+
<%_ if (useBootstrapContext) { _%>
|
6
|
+
const bootstrap = (context: BootstrapContext) =>
|
7
|
+
bootstrapApplication(RemoteEntry<%= componentType %>, config, context);
|
8
|
+
<%_ } else { _%>
|
5
9
|
const bootstrap = () => bootstrapApplication(RemoteEntry<%= componentType %>, config);
|
10
|
+
<%_ } _%>
|
6
11
|
|
7
12
|
export default bootstrap;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-ssr-setup.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/remote/lib/update-ssr-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"update-ssr-setup.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/remote/lib/update-ssr-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAoBvC,wBAAsB,cAAc,CAClC,IAAI,EAAE,IAAI,EACV,EACE,OAAO,EACP,IAAI,EACJ,UAAU,EACV,uBAAuB,EACvB,eAAe,GAChB,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,uBAAuB,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,mDA6HF"}
|
@@ -4,11 +4,12 @@ exports.updateSsrSetup = updateSsrSetup;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
6
6
|
const path_1 = require("path");
|
7
|
+
const semver_1 = require("semver");
|
7
8
|
const versions_1 = require("../../../utils/versions");
|
8
9
|
const artifact_types_1 = require("../../utils/artifact-types");
|
9
10
|
const version_utils_1 = require("../../utils/version-utils");
|
10
11
|
async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfiguration, skipPackageJson, }) {
|
11
|
-
const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
12
|
+
const { major: angularMajorVersion, version: angularVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
12
13
|
let project = (0, devkit_1.readProjectConfiguration)(tree, appName);
|
13
14
|
const sourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(project, tree);
|
14
15
|
tree.rename((0, devkit_1.joinPathFragments)(sourceRoot, 'main.server.ts'), (0, devkit_1.joinPathFragments)(sourceRoot, 'bootstrap.server.ts'));
|
@@ -31,11 +32,19 @@ async function updateSsrSetup(tree, { appName, port, standalone, typescriptConfi
|
|
31
32
|
if (standalone) {
|
32
33
|
const componentType = (0, artifact_types_1.getComponentType)(tree);
|
33
34
|
const componentFileSuffix = componentType ? `.${componentType}` : '';
|
35
|
+
const useBootstrapContext =
|
36
|
+
// https://github.com/angular/angular-cli/releases/tag/20.3.0
|
37
|
+
(0, semver_1.gte)(angularVersion, '20.3.0') ||
|
38
|
+
// https://github.com/angular/angular-cli/releases/tag/19.2.16
|
39
|
+
(angularMajorVersion === 19 && (0, semver_1.gte)(angularVersion, '19.2.16')) ||
|
40
|
+
// https://github.com/angular/angular-cli/releases/tag/18.2.21
|
41
|
+
(angularMajorVersion === 18 && (0, semver_1.gte)(angularVersion, '18.2.21'));
|
34
42
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/standalone'), project.root, {
|
35
43
|
appName,
|
36
44
|
standalone,
|
37
45
|
componentType: componentType ? (0, devkit_1.names)(componentType).className : '',
|
38
46
|
componentFileSuffix,
|
47
|
+
useBootstrapContext,
|
39
48
|
tmpl: '',
|
40
49
|
});
|
41
50
|
}
|
@@ -1,7 +1,12 @@
|
|
1
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
1
|
+
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
2
2
|
import { AppComponent } from './app/app.component';
|
3
3
|
import { config } from './app/app.config.server';
|
4
4
|
|
5
|
+
<%_ if (useBootstrapContext) { _%>
|
6
|
+
const bootstrap = (context: BootstrapContext) =>
|
7
|
+
bootstrapApplication(AppComponent, config, context);
|
8
|
+
<%_ } else { _%>
|
5
9
|
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
10
|
+
<%_ } _%>
|
6
11
|
|
7
12
|
export default bootstrap;
|
@@ -1,7 +1,12 @@
|
|
1
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
1
|
+
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
2
2
|
import { AppComponent } from './app/app.component';
|
3
3
|
import { config } from './app/app.config.server';
|
4
4
|
|
5
|
+
<%_ if (useBootstrapContext) { _%>
|
6
|
+
const bootstrap = (context: BootstrapContext) =>
|
7
|
+
bootstrapApplication(AppComponent, config, context);
|
8
|
+
<%_ } else { _%>
|
5
9
|
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
10
|
+
<%_ } _%>
|
6
11
|
|
7
12
|
export default bootstrap;
|
@@ -1,7 +1,12 @@
|
|
1
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
1
|
+
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
2
2
|
import { AppComponent } from './app/app.component';
|
3
3
|
import { config } from './app/app.config.server';
|
4
4
|
|
5
|
+
<%_ if (useBootstrapContext) { _%>
|
6
|
+
const bootstrap = (context: BootstrapContext) =>
|
7
|
+
bootstrapApplication(AppComponent, config, context);
|
8
|
+
<%_ } else { _%>
|
5
9
|
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
10
|
+
<%_ } _%>
|
6
11
|
|
7
12
|
export default bootstrap;
|
@@ -1,7 +1,12 @@
|
|
1
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
1
|
+
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
2
2
|
import { <%= appSymbolName %> } from './app/<%= appFileName %>';
|
3
3
|
import { config } from './app/app.config.server';
|
4
4
|
|
5
|
+
<%_ if (useBootstrapContext) { _%>
|
6
|
+
const bootstrap = (context: BootstrapContext) =>
|
7
|
+
bootstrapApplication(<%= appSymbolName %>, config, context);
|
8
|
+
<%_ } else { _%>
|
5
9
|
const bootstrap = () => bootstrapApplication(<%= appSymbolName %>, config);
|
10
|
+
<%_ } _%>
|
6
11
|
|
7
12
|
export default bootstrap;
|
@@ -1,7 +1,12 @@
|
|
1
|
-
import { bootstrapApplication } from '@angular/platform-browser';
|
1
|
+
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
2
2
|
import { <%= appSymbolName %> } from './app/<%= appFileName %>';
|
3
3
|
import { config } from './app/app.config.server';
|
4
4
|
|
5
|
+
<%_ if (useBootstrapContext) { _%>
|
6
|
+
const bootstrap = (context: BootstrapContext) =>
|
7
|
+
bootstrapApplication(<%= appSymbolName %>, config, context);
|
8
|
+
<%_ } else { _%>
|
5
9
|
const bootstrap = () => bootstrapApplication(<%= appSymbolName %>, config);
|
10
|
+
<%_ } _%>
|
6
11
|
|
7
12
|
export default bootstrap;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generate-files.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-ssr/lib/generate-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAkBvC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,0BAA0B,
|
1
|
+
{"version":3,"file":"generate-files.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/setup-ssr/lib/generate-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAkBvC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,0BAA0B,QAiFpC"}
|
@@ -16,7 +16,7 @@ function generateSSRFiles(tree, options) {
|
|
16
16
|
// server has already been added
|
17
17
|
return;
|
18
18
|
}
|
19
|
-
const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
19
|
+
const { major: angularMajorVersion, version: angularVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
20
20
|
const baseFilesPath = (0, path_1.join)(__dirname, '..', 'files');
|
21
21
|
let pathToFiles;
|
22
22
|
if (angularMajorVersion >= 20) {
|
@@ -40,6 +40,13 @@ function generateSSRFiles(tree, options) {
|
|
40
40
|
const componentType = (0, artifact_types_1.getComponentType)(tree);
|
41
41
|
const appComponentInfo = (0, app_components_info_1.getAppComponentInfo)(tree, componentType ? `.${componentType}` : '', project);
|
42
42
|
const moduleTypeSeparator = (0, artifact_types_1.getModuleTypeSeparator)(tree);
|
43
|
+
const useBootstrapContext =
|
44
|
+
// https://github.com/angular/angular-cli/releases/tag/20.3.0
|
45
|
+
(0, semver_1.gte)(angularVersion, '20.3.0') ||
|
46
|
+
// https://github.com/angular/angular-cli/releases/tag/19.2.16
|
47
|
+
(angularMajorVersion === 19 && (0, semver_1.gte)(angularVersion, '19.2.16')) ||
|
48
|
+
// https://github.com/angular/angular-cli/releases/tag/18.2.21
|
49
|
+
(angularMajorVersion === 18 && (0, semver_1.gte)(angularVersion, '18.2.21'));
|
43
50
|
(0, devkit_1.generateFiles)(tree, pathToFiles, sourceRoot, {
|
44
51
|
...options,
|
45
52
|
provideServerRoutingFn: !cleanedSsrVersion || (0, semver_1.gte)(cleanedSsrVersion, '19.2.0')
|
@@ -48,6 +55,7 @@ function generateSSRFiles(tree, options) {
|
|
48
55
|
appFileName: appComponentInfo.extensionlessFileName,
|
49
56
|
appSymbolName: appComponentInfo.symbolName,
|
50
57
|
moduleTypeSeparator,
|
58
|
+
useBootstrapContext,
|
51
59
|
tpl: '',
|
52
60
|
});
|
53
61
|
if (angularMajorVersion === 19 && !options.serverRouting) {
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-21-6-1/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAc,MAAM,YAAY,CAAC;AAE3D,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAkBxC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.angularCliVersion = void 0;
|
4
|
+
exports.default = default_1;
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
6
|
+
exports.angularCliVersion = '~20.3.0';
|
7
|
+
async function default_1(tree) {
|
8
|
+
let shouldFormat = false;
|
9
|
+
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
10
|
+
if (json.devDependencies?.['@angular/cli']) {
|
11
|
+
json.devDependencies['@angular/cli'] = exports.angularCliVersion;
|
12
|
+
shouldFormat = true;
|
13
|
+
}
|
14
|
+
else if (json.dependencies?.['@angular/cli']) {
|
15
|
+
json.dependencies['@angular/cli'] = exports.angularCliVersion;
|
16
|
+
shouldFormat = true;
|
17
|
+
}
|
18
|
+
return json;
|
19
|
+
});
|
20
|
+
if (shouldFormat) {
|
21
|
+
await (0, devkit_1.formatFiles)(tree);
|
22
|
+
}
|
23
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
export declare const nxVersion: any;
|
2
|
-
export declare const angularVersion = "~20.
|
3
|
-
export declare const angularDevkitVersion = "~20.
|
4
|
-
export declare const ngPackagrVersion = "~20.
|
2
|
+
export declare const angularVersion = "~20.3.0";
|
3
|
+
export declare const angularDevkitVersion = "~20.3.0";
|
4
|
+
export declare const ngPackagrVersion = "~20.3.0";
|
5
5
|
export declare const ngrxVersion = "^20.0.0";
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
7
7
|
export declare const zoneJsVersion = "~0.15.0";
|
@@ -15,7 +15,7 @@ export declare const browserSyncVersion = "^3.0.0";
|
|
15
15
|
export declare const moduleFederationNodeVersion = "^2.7.11";
|
16
16
|
export declare const moduleFederationEnhancedVersion = "^0.18.0";
|
17
17
|
export declare const webpackMergeVersion = "^5.8.0";
|
18
|
-
export declare const angularEslintVersion = "^20.
|
18
|
+
export declare const angularEslintVersion = "^20.3.0";
|
19
19
|
export declare const typescriptEslintVersion = "^7.16.0";
|
20
20
|
export declare const tailwindVersion = "^3.0.2";
|
21
21
|
export declare const postcssVersion = "^8.4.5";
|
package/src/utils/versions.js
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
5
|
-
exports.angularVersion = '~20.
|
6
|
-
exports.angularDevkitVersion = '~20.
|
7
|
-
exports.ngPackagrVersion = '~20.
|
5
|
+
exports.angularVersion = '~20.3.0';
|
6
|
+
exports.angularDevkitVersion = '~20.3.0';
|
7
|
+
exports.ngPackagrVersion = '~20.3.0';
|
8
8
|
exports.ngrxVersion = '^20.0.0';
|
9
9
|
exports.rxjsVersion = '~7.8.0';
|
10
10
|
exports.zoneJsVersion = '~0.15.0';
|
@@ -18,7 +18,7 @@ exports.browserSyncVersion = '^3.0.0';
|
|
18
18
|
exports.moduleFederationNodeVersion = '^2.7.11';
|
19
19
|
exports.moduleFederationEnhancedVersion = '^0.18.0';
|
20
20
|
exports.webpackMergeVersion = '^5.8.0';
|
21
|
-
exports.angularEslintVersion = '^20.
|
21
|
+
exports.angularEslintVersion = '^20.3.0';
|
22
22
|
exports.typescriptEslintVersion = '^7.16.0';
|
23
23
|
exports.tailwindVersion = '^3.0.2';
|
24
24
|
exports.postcssVersion = '^8.4.5';
|