@nx/angular 21.0.0-beta.1 → 21.0.0-beta.3
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/generators.json +5 -0
- package/migrations.json +181 -0
- package/ng-package.json +1 -1
- package/package.json +11 -9
- package/src/builders/dev-server/dev-server.impl.js +2 -3
- package/src/builders/dev-server/lib/normalize-options.js +1 -0
- package/src/builders/dev-server/schema.d.ts +1 -0
- package/src/builders/dev-server/schema.json +8 -3
- package/src/builders/webpack-browser/schema.d.ts +3 -1
- package/src/builders/webpack-browser/schema.json +5 -0
- package/src/builders/webpack-browser/webpack-browser.impl.js +3 -2
- package/src/executors/delegate-build/delegate-build.impl.d.ts +1 -3
- package/src/executors/delegate-build/delegate-build.impl.js +0 -3
- package/src/executors/package/package.impl.js +1 -4
- package/src/generators/add-linting/add-linting.js +1 -16
- package/src/generators/add-linting/schema.d.ts +1 -0
- package/src/generators/application/application.js +14 -1
- package/src/generators/application/lib/add-e2e.js +2 -2
- package/src/generators/application/lib/add-linting.js +1 -0
- package/src/generators/application/lib/add-serve-static-target.js +1 -0
- package/src/generators/application/lib/add-unit-test-runner.js +2 -0
- package/src/generators/application/lib/create-project.js +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +9 -2
- package/src/generators/application/schema.d.ts +2 -1
- package/src/generators/application/schema.json +1 -1
- package/src/generators/component-test/component-test.js +1 -1
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts +4 -0
- package/src/generators/convert-to-rspack/convert-to-rspack.js +319 -0
- package/src/generators/convert-to-rspack/lib/create-config.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/create-config.js +48 -0
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +6 -0
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +75 -0
- package/src/generators/convert-to-rspack/lib/update-tsconfig.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/update-tsconfig.js +26 -0
- package/src/generators/convert-to-rspack/lib/validate-supported-executor.d.ts +2 -0
- package/src/generators/convert-to-rspack/lib/validate-supported-executor.js +14 -0
- package/src/generators/convert-to-rspack/schema.d.ts +5 -0
- package/src/generators/convert-to-rspack/schema.json +30 -0
- package/src/generators/host/host.js +1 -1
- package/src/generators/library/lib/add-project.d.ts +1 -1
- package/src/generators/library/lib/add-project.js +7 -1
- package/src/generators/library/lib/normalize-options.js +1 -1
- package/src/generators/library/library.js +5 -1
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +2 -2
- package/src/generators/ngrx-feature-store/schema.d.ts +1 -1
- package/src/generators/remote/remote.js +1 -1
- package/src/generators/setup-mf/lib/setup-serve-target.js +1 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/__rootModuleFileName__ +2 -2
- package/src/generators/setup-ssr/files/v19+/application-builder/server/__serverFileName__ +1 -1
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +2 -2
- package/src/generators/setup-ssr/files/v19+/application-builder-common-engine/server/__serverFileName__ +2 -0
- package/src/generators/setup-ssr/lib/generate-files.js +12 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +1 -0
- package/src/generators/stories/stories.js +2 -2
- package/src/generators/utils/add-jest.d.ts +1 -0
- package/src/generators/utils/add-jest.js +2 -2
- package/src/generators/utils/add-vitest.d.ts +1 -0
- package/src/generators/utils/add-vitest.js +1 -1
- package/src/generators/utils/ensure-angular-dependencies.js +0 -1
- package/src/migrations/update-19-6-0/turn-off-dts-by-default.js +2 -2
- package/src/migrations/update-20-5-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-20-5-0/update-angular-cli.js +23 -0
- package/src/migrations/update-21-0-0/set-continuous-option.d.ts +3 -0
- package/src/migrations/update-21-0-0/set-continuous-option.js +29 -0
- package/src/plugins/plugin.js +2 -0
- package/src/utils/backward-compatible-versions.js +2 -0
- package/src/utils/versions.d.ts +7 -6
- package/src/utils/versions.js +8 -7
@@ -1,13 +1,13 @@
|
|
1
1
|
import { NgModule } from '@angular/core';
|
2
2
|
import { ServerModule } from '@angular/platform-server';<% if(serverRouting) { %>
|
3
|
-
import {
|
3
|
+
import { <%= provideServerRoutingFn %> } from '@angular/ssr';<% } %>
|
4
4
|
import { AppComponent } from './app.component';
|
5
5
|
import { AppModule } from './app.module';<% if(serverRouting) { %>
|
6
6
|
import { serverRoutes } from './app.routes.server';<% } %>
|
7
7
|
|
8
8
|
@NgModule({
|
9
9
|
imports: [AppModule, ServerModule],<% if(serverRouting) { %>
|
10
|
-
providers: [
|
10
|
+
providers: [<%= provideServerRoutingFn %>(serverRoutes)],<% } %>
|
11
11
|
bootstrap: [AppComponent],
|
12
12
|
})
|
13
13
|
export class <%= rootModuleClassName %> {}
|
@@ -61,6 +61,6 @@ if (isMainModule(import.meta.url)) {
|
|
61
61
|
}
|
62
62
|
|
63
63
|
/**
|
64
|
-
*
|
64
|
+
* Request handler used by the Angular CLI (for dev-server and during build) or Firebase Cloud Functions.
|
65
65
|
*/
|
66
66
|
export const reqHandler = createNodeRequestHandler(app);
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
2
2
|
import { provideServerRendering } from '@angular/platform-server';<% if(serverRouting) { %>
|
3
|
-
import {
|
3
|
+
import { <%= provideServerRoutingFn %> } from '@angular/ssr';<% } %>
|
4
4
|
import { appConfig } from './app.config';<% if(serverRouting) { %>
|
5
5
|
import { serverRoutes } from './app.routes.server';<% } %>
|
6
6
|
|
7
7
|
const serverConfig: ApplicationConfig = {
|
8
8
|
providers: [
|
9
9
|
provideServerRendering()<% if(serverRouting) { %>,
|
10
|
-
|
10
|
+
<%= provideServerRoutingFn %>(serverRoutes)<% } %>
|
11
11
|
]
|
12
12
|
};
|
13
13
|
|
@@ -4,6 +4,7 @@ exports.generateSSRFiles = generateSSRFiles;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const path_1 = require("path");
|
6
6
|
const version_utils_1 = require("../../utils/version-utils");
|
7
|
+
const semver_1 = require("semver");
|
7
8
|
function generateSSRFiles(tree, options) {
|
8
9
|
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
9
10
|
if (project.targets.server ||
|
@@ -24,7 +25,17 @@ function generateSSRFiles(tree, options) {
|
|
24
25
|
pathToFiles = (0, path_1.join)(baseFilesPath, 'pre-v19', options.standalone ? 'standalone-src' : 'ngmodule-src');
|
25
26
|
}
|
26
27
|
const sourceRoot = project.sourceRoot ?? (0, devkit_1.joinPathFragments)(project.root, 'src');
|
27
|
-
(0,
|
28
|
+
const ssrVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, '@angular/ssr');
|
29
|
+
const cleanedSsrVersion = ssrVersion
|
30
|
+
? (0, semver_1.clean)(ssrVersion) ?? (0, semver_1.coerce)(ssrVersion).version
|
31
|
+
: null;
|
32
|
+
(0, devkit_1.generateFiles)(tree, pathToFiles, sourceRoot, {
|
33
|
+
...options,
|
34
|
+
provideServerRoutingFn: !cleanedSsrVersion || (0, semver_1.gte)(cleanedSsrVersion, '19.2.0')
|
35
|
+
? 'provideServerRouting'
|
36
|
+
: 'provideServerRoutesConfig',
|
37
|
+
tpl: '',
|
38
|
+
});
|
28
39
|
if (angularMajorVersion >= 19 && !options.serverRouting) {
|
29
40
|
tree.delete((0, devkit_1.joinPathFragments)(sourceRoot, 'app/app.routes.server.ts'));
|
30
41
|
}
|
@@ -76,6 +76,7 @@ function updateProjectConfigForBrowserBuilder(tree, options) {
|
|
76
76
|
defaultConfiguration: 'production',
|
77
77
|
};
|
78
78
|
projectConfig.targets['serve-ssr'] = {
|
79
|
+
continuous: true,
|
79
80
|
executor: '@angular-devkit/build-angular:ssr-dev-server',
|
80
81
|
configurations: {
|
81
82
|
development: {
|
@@ -7,7 +7,7 @@ const component_story_1 = tslib_1.__importDefault(require("../component-story/co
|
|
7
7
|
const component_info_1 = require("../utils/storybook-ast/component-info");
|
8
8
|
const entry_point_1 = require("../utils/storybook-ast/entry-point");
|
9
9
|
const module_info_1 = require("../utils/storybook-ast/module-info");
|
10
|
-
const
|
10
|
+
const picomatch = require("picomatch");
|
11
11
|
const versions_1 = require("../../utils/versions");
|
12
12
|
async function angularStoriesGenerator(tree, options) {
|
13
13
|
const entryPoints = (0, entry_point_1.getProjectEntryPoints)(tree, options.name);
|
@@ -17,7 +17,7 @@ async function angularStoriesGenerator(tree, options) {
|
|
17
17
|
componentsInfo.push(...(0, component_info_1.getComponentsInfo)(tree, entryPoint, moduleFilePaths, options.name), ...(0, component_info_1.getStandaloneComponentsInfo)(tree, entryPoint));
|
18
18
|
}
|
19
19
|
const componentInfos = componentsInfo.filter((f) => !options.ignorePaths?.some((pattern) => {
|
20
|
-
const shouldIgnorePath = (
|
20
|
+
const shouldIgnorePath = picomatch(pattern)((0, devkit_1.joinPathFragments)(f.moduleFolderPath, f.path, `${f.componentFileName}.ts`));
|
21
21
|
return shouldIgnorePath;
|
22
22
|
}));
|
23
23
|
for (const info of componentInfos) {
|
@@ -16,8 +16,8 @@ async function addJest(tree, options) {
|
|
16
16
|
skipSerializers: false,
|
17
17
|
skipPackageJson: options.skipPackageJson,
|
18
18
|
skipFormat: true,
|
19
|
-
addPlugin: false,
|
20
|
-
addExplicitTargets:
|
19
|
+
addPlugin: options.addPlugin ?? false,
|
20
|
+
addExplicitTargets: !options.addPlugin,
|
21
21
|
});
|
22
22
|
const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src', 'test-setup.ts');
|
23
23
|
if (options.strict && tree.exists(setupFile)) {
|
@@ -19,7 +19,6 @@ function ensureAngularDependencies(tree) {
|
|
19
19
|
const rxjsVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, 'rxjs') ?? pkgVersions.rxjsVersion;
|
20
20
|
const tsLibVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, 'tslib') ?? pkgVersions.tsLibVersion;
|
21
21
|
const zoneJsVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, 'zone.js') ?? pkgVersions.zoneJsVersion;
|
22
|
-
dependencies['@angular/animations'] = angularVersion;
|
23
22
|
dependencies['@angular/common'] = angularVersion;
|
24
23
|
dependencies['@angular/compiler'] = angularVersion;
|
25
24
|
dependencies['@angular/core'] = angularVersion;
|
@@ -2,12 +2,12 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.default = default_1;
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
|
-
const
|
5
|
+
const picomatch = require("picomatch");
|
6
6
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
7
7
|
async function default_1(tree) {
|
8
8
|
(0, devkit_1.visitNotIgnoredFiles)(tree, '', (path) => {
|
9
9
|
const webpackConfigGlob = '**/webpack*.config*.{js,ts,mjs,cjs}';
|
10
|
-
const result = (
|
10
|
+
const result = picomatch(webpackConfigGlob)(path);
|
11
11
|
if (!result) {
|
12
12
|
return;
|
13
13
|
}
|
@@ -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 = '~19.2.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
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.continuousExecutors = void 0;
|
4
|
+
exports.default = default_1;
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
6
|
+
exports.continuousExecutors = new Set([
|
7
|
+
'@angular-devkit/build-angular:dev-server',
|
8
|
+
'@angular-devkit/build-angular:ssr-dev-server',
|
9
|
+
'@nx/angular:dev-server',
|
10
|
+
'@nx/angular:module-federation-dev-server',
|
11
|
+
'@nx/angular:module-federation-dev-ssr',
|
12
|
+
]);
|
13
|
+
async function default_1(tree) {
|
14
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
15
|
+
for (const [projectName, projectConfig] of projects) {
|
16
|
+
let updated = false;
|
17
|
+
for (const targetConfig of Object.values(projectConfig.targets ?? {})) {
|
18
|
+
if (exports.continuousExecutors.has(targetConfig.executor) &&
|
19
|
+
targetConfig.continuous === undefined) {
|
20
|
+
targetConfig.continuous = true;
|
21
|
+
updated = true;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
if (updated) {
|
25
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfig);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
await (0, devkit_1.formatFiles)(tree);
|
29
|
+
}
|
package/src/plugins/plugin.js
CHANGED
@@ -114,6 +114,7 @@ async function buildAngularProjects(configFilePath, options, angularWorkspaceRoo
|
|
114
114
|
await updateBuildTarget(nxTargetName, targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs);
|
115
115
|
}
|
116
116
|
else if (knownExecutors.devServer.has(angularTarget.builder)) {
|
117
|
+
targets[nxTargetName].continuous = true;
|
117
118
|
targets[nxTargetName].metadata.help.example.options = { port: 4201 };
|
118
119
|
}
|
119
120
|
else if (knownExecutors.extractI18n.has(angularTarget.builder)) {
|
@@ -128,6 +129,7 @@ async function buildAngularProjects(configFilePath, options, angularWorkspaceRoo
|
|
128
129
|
updateServerTarget(targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs);
|
129
130
|
}
|
130
131
|
else if (knownExecutors.serveSsr.has(angularTarget.builder)) {
|
132
|
+
targets[nxTargetName].continuous = true;
|
131
133
|
targets[nxTargetName].metadata.help.example.options = { port: 4201 };
|
132
134
|
}
|
133
135
|
else if (knownExecutors.prerender.has(angularTarget.builder)) {
|
@@ -6,6 +6,7 @@ exports.backwardCompatibleVersions = {
|
|
6
6
|
angularVersion: '~17.3.0',
|
7
7
|
angularDevkitVersion: '~17.3.0',
|
8
8
|
ngPackagrVersion: '~17.3.0',
|
9
|
+
angularRspackVersion: '~20.6.1',
|
9
10
|
ngrxVersion: '~17.0.0',
|
10
11
|
rxjsVersion: '~7.8.0',
|
11
12
|
zoneJsVersion: '~0.14.3',
|
@@ -33,6 +34,7 @@ exports.backwardCompatibleVersions = {
|
|
33
34
|
angularVersion: '~18.2.0',
|
34
35
|
angularDevkitVersion: '~18.2.0',
|
35
36
|
ngPackagrVersion: '~18.2.0',
|
37
|
+
angularRspackVersion: '~20.6.1',
|
36
38
|
ngrxVersion: '~18.0.2',
|
37
39
|
rxjsVersion: '~7.8.0',
|
38
40
|
zoneJsVersion: '~0.14.3',
|
package/src/utils/versions.d.ts
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
export declare const nxVersion: any;
|
2
|
-
export declare const angularVersion = "~19.
|
3
|
-
export declare const angularDevkitVersion = "~19.
|
4
|
-
export declare const ngPackagrVersion = "~19.
|
2
|
+
export declare const angularVersion = "~19.2.0";
|
3
|
+
export declare const angularDevkitVersion = "~19.2.0";
|
4
|
+
export declare const ngPackagrVersion = "~19.2.0";
|
5
|
+
export declare const angularRspackVersion = "~20.6.1";
|
5
6
|
export declare const ngrxVersion = "^19.0.0";
|
6
7
|
export declare const rxjsVersion = "~7.8.0";
|
7
8
|
export declare const zoneJsVersion = "~0.15.0";
|
@@ -12,9 +13,9 @@ export declare const typesCorsVersion = "~2.8.5";
|
|
12
13
|
export declare const expressVersion = "^4.21.2";
|
13
14
|
export declare const typesExpressVersion = "^4.17.21";
|
14
15
|
export declare const browserSyncVersion = "^3.0.0";
|
15
|
-
export declare const moduleFederationNodeVersion = "^2.6.
|
16
|
-
export declare const moduleFederationEnhancedVersion = "^0.
|
17
|
-
export declare const angularEslintVersion = "^19.0
|
16
|
+
export declare const moduleFederationNodeVersion = "^2.6.26";
|
17
|
+
export declare const moduleFederationEnhancedVersion = "^0.9.0";
|
18
|
+
export declare const angularEslintVersion = "^19.2.0";
|
18
19
|
export declare const typescriptEslintVersion = "^7.16.0";
|
19
20
|
export declare const tailwindVersion = "^3.0.2";
|
20
21
|
export declare const postcssVersion = "^8.4.5";
|
package/src/utils/versions.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = 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;
|
3
|
+
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = 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.angularRspackVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
5
|
-
exports.angularVersion = '~19.
|
6
|
-
exports.angularDevkitVersion = '~19.
|
7
|
-
exports.ngPackagrVersion = '~19.
|
5
|
+
exports.angularVersion = '~19.2.0';
|
6
|
+
exports.angularDevkitVersion = '~19.2.0';
|
7
|
+
exports.ngPackagrVersion = '~19.2.0';
|
8
|
+
exports.angularRspackVersion = '~20.6.1';
|
8
9
|
exports.ngrxVersion = '^19.0.0';
|
9
10
|
exports.rxjsVersion = '~7.8.0';
|
10
11
|
exports.zoneJsVersion = '~0.15.0';
|
@@ -15,9 +16,9 @@ exports.typesCorsVersion = '~2.8.5';
|
|
15
16
|
exports.expressVersion = '^4.21.2';
|
16
17
|
exports.typesExpressVersion = '^4.17.21';
|
17
18
|
exports.browserSyncVersion = '^3.0.0';
|
18
|
-
exports.moduleFederationNodeVersion = '^2.6.
|
19
|
-
exports.moduleFederationEnhancedVersion = '^0.
|
20
|
-
exports.angularEslintVersion = '^19.0
|
19
|
+
exports.moduleFederationNodeVersion = '^2.6.26';
|
20
|
+
exports.moduleFederationEnhancedVersion = '^0.9.0';
|
21
|
+
exports.angularEslintVersion = '^19.2.0';
|
21
22
|
exports.typescriptEslintVersion = '^7.16.0';
|
22
23
|
exports.tailwindVersion = '^3.0.2';
|
23
24
|
exports.postcssVersion = '^8.4.5';
|