@nx/angular 21.0.0-canary.20250206-8bd0bcd → 21.0.0-canary.20250418-8619c1d
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/fesm2022/nx-angular.mjs +0 -352
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/generators.json +7 -2
- package/index.d.ts +1 -1
- package/migrations.json +199 -69
- package/ng-package.json +1 -1
- package/package.json +11 -14
- 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 +4 -0
- package/src/builders/dev-server/schema.json +9 -4
- package/src/builders/webpack-browser/schema.d.ts +1 -4
- package/src/builders/webpack-browser/schema.json +5 -0
- package/src/builders/webpack-browser/webpack-browser.impl.js +5 -5
- 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/module-federation-dev-server/schema.d.ts +3 -0
- package/src/executors/module-federation-dev-server/schema.json +1 -1
- package/src/executors/package/package.impl.js +1 -4
- package/src/generators/add-linting/add-linting.js +1 -16
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
- package/src/generators/add-linting/lib/create-eslint-configuration.js +2 -2
- package/src/generators/add-linting/schema.d.ts +1 -0
- package/src/generators/application/application.js +20 -1
- package/src/generators/application/files/rspack-ssr/server.ts__tmpl__ +72 -0
- package/src/generators/application/lib/add-e2e.js +2 -9
- 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 -2
- package/src/generators/application/schema.json +1 -7
- 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 +314 -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/host/schema.d.ts +0 -1
- package/src/generators/host/schema.json +0 -6
- 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/lib/normalized-schema.d.ts +0 -1
- package/src/generators/library/library.js +5 -1
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +0 -6
- package/src/generators/move/move.d.ts +3 -0
- package/src/generators/move/move.js +3 -0
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +2 -2
- package/src/generators/ngrx/ngrx.d.ts +3 -0
- package/src/generators/ngrx/ngrx.js +3 -0
- package/src/generators/ngrx/schema.json +1 -1
- package/src/generators/ngrx-feature-store/schema.d.ts +1 -1
- package/src/generators/remote/remote.js +1 -1
- package/src/generators/remote/schema.d.ts +0 -1
- package/src/generators/remote/schema.json +0 -6
- 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-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +4 -4
- package/src/migrations/update-19-6-0/turn-off-dts-by-default.js +2 -2
- package/src/migrations/{update-16-1-0 → update-20-5-0}/update-angular-cli.d.ts +1 -1
- package/src/migrations/{update-16-1-0 → update-20-5-0}/update-angular-cli.js +1 -1
- package/src/migrations/{update-16-1-0/remove-ngcc-invocation.d.ts → update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.d.ts} +1 -1
- package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +122 -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/nx-devkit/ast-utils.d.ts +0 -8
- package/src/utils/nx-devkit/ast-utils.js +7 -12
- package/src/utils/versions.d.ts +7 -6
- package/src/utils/versions.js +8 -7
- package/fesm2022/nx-angular-testing.mjs +0 -45
- package/fesm2022/nx-angular-testing.mjs.map +0 -1
- package/src/migrations/update-16-0-0/remove-karma-defaults.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-karma-defaults.js +0 -52
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.js +0 -40
- package/src/migrations/update-16-0-0/remove-protractor-defaults.d.ts +0 -2
- package/src/migrations/update-16-0-0/remove-protractor-defaults.js +0 -52
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -9
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.d.ts +0 -2
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +0 -127
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +0 -22
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.d.ts +0 -2
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +0 -62
- package/src/migrations/update-16-1-0/update-server-executor-config.d.ts +0 -2
- package/src/migrations/update-16-1-0/update-server-executor-config.js +0 -26
- package/src/runtime/nx/data-persistence.d.ts +0 -276
- package/testing/index.d.ts +0 -1
- package/testing/ng-package.json +0 -6
- package/testing/src/testing-utils.d.ts +0 -33
@@ -1,2 +1,2 @@
|
|
1
|
-
import type
|
1
|
+
import { type Tree } from '@nx/devkit';
|
2
2
|
export default function (tree: Tree): Promise<void>;
|
@@ -0,0 +1,122 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = default_1;
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
5
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
6
|
+
const project_graph_1 = require("nx/src/config/project-graph");
|
7
|
+
const nx_deps_cache_1 = require("nx/src/project-graph/nx-deps-cache");
|
8
|
+
const version_utils_1 = require("../../generators/utils/version-utils");
|
9
|
+
const file_change_recorder_1 = require("../../utils/file-change-recorder");
|
10
|
+
const projects_1 = require("../utils/projects");
|
11
|
+
let tsquery;
|
12
|
+
const angularPluginTargetNames = ['npm:@nx/angular', 'npm:@nrwl/angular'];
|
13
|
+
const dataPersistenceOperators = [
|
14
|
+
'fetch',
|
15
|
+
'navigation',
|
16
|
+
'optimisticUpdate',
|
17
|
+
'pessimisticUpdate',
|
18
|
+
];
|
19
|
+
const newImportPath = '@ngrx/router-store/data-persistence';
|
20
|
+
async function default_1(tree) {
|
21
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(tree, angularPluginTargetNames);
|
22
|
+
if (!projects.length) {
|
23
|
+
return;
|
24
|
+
}
|
25
|
+
(0, ensure_typescript_1.ensureTypescript)();
|
26
|
+
tsquery = require('@phenomnomnominal/tsquery').tsquery;
|
27
|
+
const cachedFileMap = (0, nx_deps_cache_1.readFileMapCache)().fileMap.projectFileMap;
|
28
|
+
const filesWithNxAngularImports = [];
|
29
|
+
for (const { graphNode } of projects) {
|
30
|
+
const files = filterFilesWithNxAngularDep(cachedFileMap[graphNode.name] || []);
|
31
|
+
filesWithNxAngularImports.push(...files);
|
32
|
+
}
|
33
|
+
let isAnyFileUsingDataPersistence = false;
|
34
|
+
for (const { file } of filesWithNxAngularImports) {
|
35
|
+
const updated = replaceDataPersistenceInFile(tree, file);
|
36
|
+
isAnyFileUsingDataPersistence ||= updated;
|
37
|
+
}
|
38
|
+
if (isAnyFileUsingDataPersistence) {
|
39
|
+
addNgrxRouterStoreIfNotInstalled(tree);
|
40
|
+
await (0, devkit_1.formatFiles)(tree);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
function replaceDataPersistenceInFile(tree, file) {
|
44
|
+
const fileContents = tree.read(file, 'utf-8');
|
45
|
+
const fileAst = tsquery.ast(fileContents);
|
46
|
+
// "\\u002F" is the unicode code for "/", there's an issue with the query parser
|
47
|
+
// that prevents using "/" directly in regex queries
|
48
|
+
// https://github.com/estools/esquery/issues/68#issuecomment-415597670
|
49
|
+
const NX_ANGULAR_IMPORT_SELECTOR = 'ImportDeclaration:has(StringLiteral[value=/@(nx|nrwl)\\u002Fangular$/])';
|
50
|
+
const nxAngularImports = tsquery(fileAst, NX_ANGULAR_IMPORT_SELECTOR, { visitAllChildren: true });
|
51
|
+
if (!nxAngularImports.length) {
|
52
|
+
return false;
|
53
|
+
}
|
54
|
+
const recorder = new file_change_recorder_1.FileChangeRecorder(tree, file);
|
55
|
+
const IMPORT_SPECIFIERS_SELECTOR = 'ImportClause NamedImports ImportSpecifier';
|
56
|
+
for (const importDeclaration of nxAngularImports) {
|
57
|
+
const importSpecifiers = tsquery(importDeclaration, IMPORT_SPECIFIERS_SELECTOR, { visitAllChildren: true });
|
58
|
+
if (!importSpecifiers.length) {
|
59
|
+
continue;
|
60
|
+
}
|
61
|
+
// no imported symbol is a data persistence operator, skip
|
62
|
+
if (importSpecifiers.every((i) => !isOperatorImport(i))) {
|
63
|
+
continue;
|
64
|
+
}
|
65
|
+
// all imported symbols are data persistence operators, change import path
|
66
|
+
if (importSpecifiers.every((i) => isOperatorImport(i))) {
|
67
|
+
const IMPORT_PATH_SELECTOR = `${NX_ANGULAR_IMPORT_SELECTOR} > StringLiteral`;
|
68
|
+
const importPathNode = tsquery(importDeclaration, IMPORT_PATH_SELECTOR, {
|
69
|
+
visitAllChildren: true,
|
70
|
+
});
|
71
|
+
recorder.replace(importPathNode[0], `'${newImportPath}'`);
|
72
|
+
continue;
|
73
|
+
}
|
74
|
+
// mixed imports, split data persistence operators to a separate import
|
75
|
+
const operatorImportSpecifiers = [];
|
76
|
+
for (const importSpecifier of importSpecifiers) {
|
77
|
+
if (isOperatorImport(importSpecifier)) {
|
78
|
+
operatorImportSpecifiers.push(importSpecifier.getText());
|
79
|
+
recorder.remove(importSpecifier.getStart(), importSpecifier.getEnd() +
|
80
|
+
(hasTrailingComma(recorder.originalContent, importSpecifier)
|
81
|
+
? 1
|
82
|
+
: 0));
|
83
|
+
}
|
84
|
+
}
|
85
|
+
recorder.insertLeft(importDeclaration.getStart(), `import { ${operatorImportSpecifiers.join(', ')} } from '${newImportPath}';`);
|
86
|
+
}
|
87
|
+
if (recorder.hasChanged()) {
|
88
|
+
recorder.applyChanges();
|
89
|
+
return true;
|
90
|
+
}
|
91
|
+
return false;
|
92
|
+
}
|
93
|
+
function hasTrailingComma(content, node) {
|
94
|
+
return content[node.getEnd()] === ',';
|
95
|
+
}
|
96
|
+
function isOperatorImport(importSpecifier) {
|
97
|
+
return dataPersistenceOperators.includes(getOriginalIdentifierTextFromImportSpecifier(importSpecifier));
|
98
|
+
}
|
99
|
+
function getOriginalIdentifierTextFromImportSpecifier(importSpecifier) {
|
100
|
+
const children = importSpecifier.getChildren();
|
101
|
+
if (!children.length) {
|
102
|
+
return importSpecifier.getText();
|
103
|
+
}
|
104
|
+
return children[0].getText();
|
105
|
+
}
|
106
|
+
function addNgrxRouterStoreIfNotInstalled(tree) {
|
107
|
+
const { dependencies, devDependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
108
|
+
if (dependencies?.['@ngrx/router-store'] ||
|
109
|
+
devDependencies?.['@ngrx/router-store']) {
|
110
|
+
return;
|
111
|
+
}
|
112
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, { '@ngrx/router-store': (0, version_utils_1.versions)(tree).ngrxVersion }, {});
|
113
|
+
}
|
114
|
+
function filterFilesWithNxAngularDep(files) {
|
115
|
+
const filteredFiles = [];
|
116
|
+
for (const file of files) {
|
117
|
+
if (file.deps?.some((dep) => angularPluginTargetNames.includes((0, project_graph_1.fileDataDepTarget)(dep)))) {
|
118
|
+
filteredFiles.push(file);
|
119
|
+
}
|
120
|
+
}
|
121
|
+
return filteredFiles;
|
122
|
+
}
|
@@ -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',
|
@@ -1,14 +1,6 @@
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
2
2
|
import type * as ts from 'typescript';
|
3
3
|
type DecoratorName = 'Component' | 'Directive' | 'NgModule' | 'Pipe';
|
4
|
-
/**
|
5
|
-
* Check if the Component, Directive or Pipe is standalone
|
6
|
-
* @param sourceFile TS Source File containing the token to check
|
7
|
-
* @param decoratorName The type of decorator to check (Component, Directive, Pipe)
|
8
|
-
*
|
9
|
-
* @deprecated Use the function signature with a Tree. This signature will be removed in v21.
|
10
|
-
*/
|
11
|
-
export declare function isStandalone(sourceFile: ts.SourceFile, decoratorName: DecoratorName): boolean;
|
12
4
|
/**
|
13
5
|
* Check if the Component, Directive or Pipe is standalone
|
14
6
|
* @param tree The file system tree
|
@@ -77,18 +77,13 @@ function _angularImportsFromNode(node, _sourceFile) {
|
|
77
77
|
return {};
|
78
78
|
}
|
79
79
|
}
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
else {
|
88
|
-
tree = treeOrSourceFile;
|
89
|
-
sourceFile = sourceFileOrDecoratorName;
|
90
|
-
decoratorName = decoratorName;
|
91
|
-
}
|
80
|
+
/**
|
81
|
+
* Check if the Component, Directive or Pipe is standalone
|
82
|
+
* @param tree The file system tree
|
83
|
+
* @param sourceFile TS Source File containing the token to check
|
84
|
+
* @param decoratorName The type of decorator to check (Component, Directive, Pipe)
|
85
|
+
*/
|
86
|
+
function isStandalone(tree, sourceFile, decoratorName) {
|
92
87
|
const decoratorMetadata = getDecoratorMetadata(sourceFile, decoratorName, '@angular/core');
|
93
88
|
const hasStandaloneTrue = decoratorMetadata.some((node) => node.getText().includes('standalone: true'));
|
94
89
|
if (hasStandaloneTrue) {
|
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.7.0";
|
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.7.0';
|
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';
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { toArray, first } from 'rxjs/operators';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* @deprecated This will be removed in Nx v21. If using RxJS 7, use `firstValueFrom(obs$.pipe(toArray()))`
|
5
|
-
* or `lastValueFrom(obs$.pipe(toArray()))`. If using RxJS 6, use `obs$.pipe(toArray()).toPromise()`.
|
6
|
-
*
|
7
|
-
* @whatItDoes reads all the values from an observable and returns a promise
|
8
|
-
* with an array of all values. This should be used in combination with async/await.
|
9
|
-
*
|
10
|
-
* ## Example
|
11
|
-
*
|
12
|
-
* ```typescript
|
13
|
-
* const obs = of(1, 2, 3, 4);
|
14
|
-
* const res = await readAll(obs)
|
15
|
-
* expect(res).toEqual([1, 2, 3, 4]);
|
16
|
-
* ```
|
17
|
-
*/
|
18
|
-
function readAll(o) {
|
19
|
-
return o.pipe(toArray()).toPromise();
|
20
|
-
}
|
21
|
-
/**
|
22
|
-
* @deprecated This will be removed in Nx v21. Since RxJS 7, use `firstValueFrom(obs$)`. If using RxJS 6,
|
23
|
-
* use `obs$.pipe(first()).toPromise()`.
|
24
|
-
*
|
25
|
-
* @whatItDoes reads the first value from an observable and returns a promise
|
26
|
-
* with it. This should be used in combination with async/await.
|
27
|
-
*
|
28
|
-
* ## Example
|
29
|
-
*
|
30
|
-
* ```typescript
|
31
|
-
* const obs = of(1, 2, 3, 4);
|
32
|
-
* const res = await readFirst(obs)
|
33
|
-
* expect(res).toEqual(1);
|
34
|
-
* ```
|
35
|
-
*/
|
36
|
-
function readFirst(o) {
|
37
|
-
return o.pipe(first()).toPromise();
|
38
|
-
}
|
39
|
-
|
40
|
-
/**
|
41
|
-
* Generated bundle index. Do not edit.
|
42
|
-
*/
|
43
|
-
|
44
|
-
export { readAll, readFirst };
|
45
|
-
//# sourceMappingURL=nx-angular-testing.mjs.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nx-angular-testing.mjs","sources":["../../../../packages/angular/testing/src/testing-utils.ts","../../../../packages/angular/testing/nx-angular-testing.ts"],"sourcesContent":["import type { Observable } from 'rxjs';\nimport { first, toArray } from 'rxjs/operators';\n\n/**\n * @deprecated This will be removed in Nx v21. If using RxJS 7, use `firstValueFrom(obs$.pipe(toArray()))`\n * or `lastValueFrom(obs$.pipe(toArray()))`. If using RxJS 6, use `obs$.pipe(toArray()).toPromise()`.\n *\n * @whatItDoes reads all the values from an observable and returns a promise\n * with an array of all values. This should be used in combination with async/await.\n *\n * ## Example\n *\n * ```typescript\n * const obs = of(1, 2, 3, 4);\n * const res = await readAll(obs)\n * expect(res).toEqual([1, 2, 3, 4]);\n * ```\n */\nexport function readAll<T>(o: Observable<T>): Promise<T[]> {\n return o.pipe(toArray()).toPromise();\n}\n\n/**\n * @deprecated This will be removed in Nx v21. Since RxJS 7, use `firstValueFrom(obs$)`. If using RxJS 6,\n * use `obs$.pipe(first()).toPromise()`.\n *\n * @whatItDoes reads the first value from an observable and returns a promise\n * with it. This should be used in combination with async/await.\n *\n * ## Example\n *\n * ```typescript\n * const obs = of(1, 2, 3, 4);\n * const res = await readFirst(obs)\n * expect(res).toEqual(1);\n * ```\n */\nexport function readFirst<T>(o: Observable<T>): Promise<T> {\n return o.pipe(first()).toPromise();\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAGA;;;;;;;;;;;;;;AAcG;AACG,SAAU,OAAO,CAAI,CAAgB,EAAA;IACzC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,EAAE;AACtC;AAEA;;;;;;;;;;;;;;AAcG;AACG,SAAU,SAAS,CAAI,CAAgB,EAAA;IAC3C,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE;AACpC;;ACvCA;;AAEG;;;;"}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = removeKarmaDefaults;
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
5
|
-
const GENERATORS = ['application', 'library', 'host', 'remote'];
|
6
|
-
const CANDIDATE_GENERATOR_COLLECTIONS = ['@nrwl/angular', '@nx/angular'];
|
7
|
-
async function removeKarmaDefaults(tree) {
|
8
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
9
|
-
if (nxJson.generators) {
|
10
|
-
const updatedConfig = updateUnitTestRunner(nxJson.generators);
|
11
|
-
if (updatedConfig) {
|
12
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
13
|
-
}
|
14
|
-
}
|
15
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
16
|
-
for (const [projectName, projectConfig] of projects) {
|
17
|
-
if (projectConfig.generators) {
|
18
|
-
const updatedProject = updateUnitTestRunner(projectConfig.generators);
|
19
|
-
if (updatedProject) {
|
20
|
-
(0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfig);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|
24
|
-
await (0, devkit_1.formatFiles)(tree);
|
25
|
-
}
|
26
|
-
function updateUnitTestRunner(generatorsConfig) {
|
27
|
-
const generators = Object.entries(generatorsConfig);
|
28
|
-
let updatedConfig = false;
|
29
|
-
for (const [generatorName, generatorDefaults] of generators) {
|
30
|
-
if (CANDIDATE_GENERATOR_COLLECTIONS.includes(generatorName)) {
|
31
|
-
for (const possibleGenerator of GENERATORS) {
|
32
|
-
if (generatorDefaults[possibleGenerator] &&
|
33
|
-
generatorDefaults[possibleGenerator]['unitTestRunner'] &&
|
34
|
-
generatorDefaults[possibleGenerator]['unitTestRunner'] === 'karma') {
|
35
|
-
generatorsConfig[generatorName][possibleGenerator]['unitTestRunner'] =
|
36
|
-
undefined;
|
37
|
-
updatedConfig = true;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
}
|
41
|
-
if (!GENERATORS.map((v) => `@nrwl/angular:${v}`).includes(generatorName) &&
|
42
|
-
!GENERATORS.map((v) => `@nx/angular:${v}`).includes(generatorName)) {
|
43
|
-
continue;
|
44
|
-
}
|
45
|
-
if (generatorDefaults['unitTestRunner'] &&
|
46
|
-
generatorDefaults['unitTestRunner'] === 'karma') {
|
47
|
-
generatorsConfig[generatorName]['unitTestRunner'] = undefined;
|
48
|
-
updatedConfig = true;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
return updatedConfig;
|
52
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = removeLibraryGeneratorSimpleModuleNameOption;
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
5
|
-
async function removeLibraryGeneratorSimpleModuleNameOption(tree) {
|
6
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
7
|
-
// update global config
|
8
|
-
const nxJsonUpdated = replaceSimpleModuleNameInConfig(nxJson);
|
9
|
-
if (nxJsonUpdated) {
|
10
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
11
|
-
}
|
12
|
-
// update project configs
|
13
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
14
|
-
for (const [name, project] of projects) {
|
15
|
-
const projectUpdated = replaceSimpleModuleNameInConfig(project);
|
16
|
-
if (projectUpdated) {
|
17
|
-
(0, devkit_1.updateProjectConfiguration)(tree, name, project);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
await (0, devkit_1.formatFiles)(tree);
|
21
|
-
}
|
22
|
-
function replaceSimpleModuleNameInConfig(configObject) {
|
23
|
-
if (!configObject?.generators) {
|
24
|
-
return false;
|
25
|
-
}
|
26
|
-
let updated = false;
|
27
|
-
if (configObject.generators['@nrwl/angular']?.['library']?.simpleModuleName) {
|
28
|
-
configObject.generators['@nrwl/angular']['library'].simpleName ??=
|
29
|
-
configObject.generators['@nrwl/angular']['library'].simpleModuleName;
|
30
|
-
delete configObject.generators['@nrwl/angular']['library'].simpleModuleName;
|
31
|
-
updated = true;
|
32
|
-
}
|
33
|
-
else if (configObject.generators['@nrwl/angular:library']?.simpleModuleName) {
|
34
|
-
configObject.generators['@nrwl/angular:library'].simpleName ??=
|
35
|
-
configObject.generators['@nrwl/angular:library'].simpleModuleName;
|
36
|
-
delete configObject.generators['@nrwl/angular:library'].simpleModuleName;
|
37
|
-
updated = true;
|
38
|
-
}
|
39
|
-
return updated;
|
40
|
-
}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = removeProtractorDefaults;
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
5
|
-
const GENERATORS = ['application', 'host', 'remote'];
|
6
|
-
const CANDIDATE_GENERATOR_COLLECTIONS = ['@nrwl/angular', '@nx/angular'];
|
7
|
-
async function removeProtractorDefaults(tree) {
|
8
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
9
|
-
if (nxJson.generators) {
|
10
|
-
const updatedConfig = updateE2ETestRunner(nxJson.generators);
|
11
|
-
if (updatedConfig) {
|
12
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
13
|
-
}
|
14
|
-
}
|
15
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
16
|
-
for (const [projectName, projectConfig] of projects) {
|
17
|
-
if (projectConfig.generators) {
|
18
|
-
const updatedProject = updateE2ETestRunner(projectConfig.generators);
|
19
|
-
if (updatedProject) {
|
20
|
-
(0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfig);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|
24
|
-
await (0, devkit_1.formatFiles)(tree);
|
25
|
-
}
|
26
|
-
function updateE2ETestRunner(generatorsConfig) {
|
27
|
-
const generators = Object.entries(generatorsConfig);
|
28
|
-
let updatedConfig = false;
|
29
|
-
for (const [generatorName, generatorDefaults] of generators) {
|
30
|
-
if (CANDIDATE_GENERATOR_COLLECTIONS.includes(generatorName)) {
|
31
|
-
for (const possibleGenerator of GENERATORS) {
|
32
|
-
if (generatorDefaults[possibleGenerator] &&
|
33
|
-
generatorDefaults[possibleGenerator]['e2eTestRunner'] &&
|
34
|
-
generatorDefaults[possibleGenerator]['e2eTestRunner'] === 'protractor') {
|
35
|
-
generatorsConfig[generatorName][possibleGenerator]['e2eTestRunner'] =
|
36
|
-
undefined;
|
37
|
-
updatedConfig = true;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
}
|
41
|
-
if (!GENERATORS.map((v) => `@nrwl/angular:${v}`).includes(generatorName) &&
|
42
|
-
!GENERATORS.map((v) => `@nx/angular:${v}`).includes(generatorName)) {
|
43
|
-
continue;
|
44
|
-
}
|
45
|
-
if (generatorDefaults['e2eTestRunner'] &&
|
46
|
-
generatorDefaults['e2eTestRunner'] === 'protractor') {
|
47
|
-
generatorsConfig[generatorName]['e2eTestRunner'] = undefined;
|
48
|
-
updatedConfig = true;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
return updatedConfig;
|
52
|
-
}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = replacePackage;
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
5
|
-
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
6
|
-
async function replacePackage(tree) {
|
7
|
-
await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/angular', '@nx/angular');
|
8
|
-
await (0, devkit_1.formatFiles)(tree);
|
9
|
-
}
|