@nx/angular 23.0.0-beta.0 → 23.0.0-beta.10
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.d.ts +0 -3
- package/generators.d.ts.map +1 -1
- package/generators.js +0 -3
- package/generators.json +0 -19
- package/migrations.json +19 -3
- package/package.json +10 -12
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts.map +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +4 -5
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +4 -5
- package/src/executors/package/package.impl.js +2 -2
- package/src/executors/utilities/angular-version-utils.d.ts.map +1 -1
- package/src/executors/utilities/angular-version-utils.js +3 -8
- package/src/generators/add-linting/add-linting.d.ts.map +1 -1
- package/src/generators/add-linting/add-linting.js +7 -5
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.d.ts.map +1 -1
- package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +1 -1
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +4 -10
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +1 -1
- package/src/generators/application/lib/create-project.d.ts.map +1 -1
- package/src/generators/application/lib/create-project.js +3 -3
- package/src/generators/application/lib/normalize-options.js +3 -3
- package/src/generators/application/schema.d.ts +0 -1
- package/src/generators/application/schema.json +0 -5
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +2 -0
- package/src/generators/component/lib/normalize-options.js +2 -2
- package/src/generators/component-story/component-story.d.ts.map +1 -1
- package/src/generators/component-story/component-story.js +2 -0
- package/src/generators/component-test/component-test.d.ts.map +1 -1
- package/src/generators/component-test/component-test.js +2 -0
- package/src/generators/convert-to-application-executor/convert-to-application-executor.d.ts.map +1 -1
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +2 -0
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts.map +1 -1
- package/src/generators/convert-to-rspack/convert-to-rspack.js +5 -4
- package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +2 -2
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts.map +1 -1
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +5 -0
- package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +2 -0
- package/src/generators/directive/directive.d.ts.map +1 -1
- package/src/generators/directive/directive.js +2 -0
- package/src/generators/directive/lib/normalize-options.js +2 -2
- package/src/generators/federate-module/federate-module.d.ts.map +1 -1
- package/src/generators/federate-module/federate-module.js +2 -0
- package/src/generators/federate-module/lib/add-remote.js +2 -2
- package/src/generators/host/host.d.ts.map +1 -1
- package/src/generators/host/host.js +10 -7
- package/src/generators/host/schema.d.ts +1 -1
- package/src/generators/host/schema.json +4 -5
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +4 -2
- package/src/generators/library/lib/add-project.js +2 -2
- package/src/generators/library/lib/normalize-options.js +3 -3
- package/src/generators/library/lib/normalized-schema.d.ts +0 -1
- package/src/generators/library/lib/normalized-schema.d.ts.map +1 -1
- package/src/generators/library/lib/validate-options.d.ts.map +1 -1
- package/src/generators/library/lib/validate-options.js +0 -3
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +4 -10
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +0 -5
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.d.ts.map +1 -1
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +2 -0
- package/src/generators/ng-add/ng-add.d.ts.map +1 -1
- package/src/generators/ng-add/ng-add.js +2 -0
- package/src/generators/ngrx-feature-store/lib/normalize-options.js +5 -5
- package/src/generators/ngrx-feature-store/ngrx-feature-store.d.ts.map +1 -1
- package/src/generators/ngrx-feature-store/ngrx-feature-store.js +2 -0
- package/src/generators/ngrx-root-store/lib/normalize-options.js +3 -3
- package/src/generators/ngrx-root-store/ngrx-root-store.d.ts.map +1 -1
- package/src/generators/ngrx-root-store/ngrx-root-store.js +2 -0
- package/src/generators/pipe/lib/normalize-options.js +2 -2
- package/src/generators/pipe/pipe.d.ts.map +1 -1
- package/src/generators/pipe/pipe.js +2 -0
- package/src/generators/remote/remote.d.ts.map +1 -1
- package/src/generators/remote/remote.js +5 -3
- package/src/generators/remote/schema.d.ts +0 -1
- package/src/generators/remote/schema.json +0 -5
- package/src/generators/scam/lib/normalize-options.js +2 -2
- package/src/generators/scam/scam.d.ts.map +1 -1
- package/src/generators/scam/scam.js +2 -0
- package/src/generators/scam-directive/lib/normalize-options.js +2 -2
- package/src/generators/scam-directive/scam-directive.d.ts.map +1 -1
- package/src/generators/scam-directive/scam-directive.js +2 -0
- package/src/generators/scam-pipe/lib/normalize-options.js +2 -2
- package/src/generators/scam-pipe/scam-pipe.d.ts.map +1 -1
- package/src/generators/scam-pipe/scam-pipe.js +2 -0
- package/src/generators/scam-to-standalone/scam-to-standalone.d.ts.map +1 -1
- package/src/generators/scam-to-standalone/scam-to-standalone.js +2 -0
- package/src/generators/setup-mf/lib/change-build-target.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/change-build-target.js +2 -2
- package/src/generators/setup-mf/setup-mf.d.ts.map +1 -1
- package/src/generators/setup-mf/setup-mf.js +2 -0
- package/src/generators/setup-ssr/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/normalize-options.js +2 -2
- package/src/generators/setup-ssr/setup-ssr.d.ts.map +1 -1
- package/src/generators/setup-ssr/setup-ssr.js +2 -0
- package/src/generators/stories/stories.d.ts.map +1 -1
- package/src/generators/stories/stories.js +2 -0
- package/src/generators/storybook-configuration/storybook-configuration.d.ts.map +1 -1
- package/src/generators/storybook-configuration/storybook-configuration.js +2 -0
- package/src/generators/utils/add-vitest.js +1 -1
- package/src/generators/utils/version-utils.d.ts.map +1 -1
- package/src/generators/utils/version-utils.js +2 -7
- package/src/generators/web-worker/web-worker.d.ts.map +1 -1
- package/src/generators/web-worker/web-worker.js +2 -0
- package/src/migrations/update-17-1-0/browser-target-to-build-target.d.ts.map +1 -1
- package/src/migrations/update-17-1-0/browser-target-to-build-target.js +2 -2
- package/src/migrations/update-19-6-1/ensure-depends-on-for-mf.js +2 -2
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +2 -2
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.js +2 -2
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts.map +1 -1
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +2 -2
- package/src/migrations/update-23-0-0/migrate-ngrx-generator-defaults.d.ts +3 -0
- package/src/migrations/update-23-0-0/migrate-ngrx-generator-defaults.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/migrate-ngrx-generator-defaults.js +120 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.d.ts +3 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.js +45 -0
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +14 -17
- package/src/utils/assert-supported-angular-version.d.ts +3 -0
- package/src/utils/assert-supported-angular-version.d.ts.map +1 -0
- package/src/utils/assert-supported-angular-version.js +9 -0
- package/src/utils/backward-compatible-versions.d.ts.map +1 -1
- package/src/utils/backward-compatible-versions.js +2 -4
- package/src/utils/get-mf-projects.js +3 -3
- package/src/utils/index.d.ts +1 -0
- package/src/utils/index.d.ts.map +1 -1
- package/src/utils/index.js +3 -1
- package/src/utils/versions.d.ts +1 -2
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +2 -3
- package/tailwind.d.ts +2 -3
- package/tailwind.d.ts.map +1 -1
- package/tailwind.js +10 -4
- package/module-federation/index.d.ts +0 -6
- package/module-federation/index.d.ts.map +0 -1
- package/module-federation/index.js +0 -6
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +0 -16
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts.map +0 -1
- package/src/generators/add-linting/lib/create-eslint-configuration.js +0 -121
- package/src/generators/move/move.d.ts +0 -7
- package/src/generators/move/move.d.ts.map +0 -1
- package/src/generators/move/move.js +0 -11
- package/src/generators/move/schema.d.ts +0 -8
- package/src/generators/move/schema.json +0 -56
- package/src/generators/ngrx/files/__directory__/__fileName__.actions.ts__tmpl__ +0 -16
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.spec.ts__tmpl__ +0 -37
- package/src/generators/ngrx/files/__directory__/__fileName__.effects.ts__tmpl__ +0 -22
- package/src/generators/ngrx/files/__directory__/__fileName__.facade.spec.ts__tmpl__ +0 -103
- package/src/generators/ngrx/files/__directory__/__fileName__.facade.ts__tmpl__ +0 -27
- package/src/generators/ngrx/files/__directory__/__fileName__.models.ts__tmpl__ +0 -7
- package/src/generators/ngrx/files/__directory__/__fileName__.reducer.spec.ts__tmpl__ +0 -37
- package/src/generators/ngrx/files/__directory__/__fileName__.reducer.ts__tmpl__ +0 -41
- package/src/generators/ngrx/files/__directory__/__fileName__.selectors.spec.ts__tmpl__ +0 -58
- package/src/generators/ngrx/files/__directory__/__fileName__.selectors.ts__tmpl__ +0 -38
- package/src/generators/ngrx/lib/add-exports-barrel.d.ts +0 -7
- package/src/generators/ngrx/lib/add-exports-barrel.d.ts.map +0 -1
- package/src/generators/ngrx/lib/add-exports-barrel.js +0 -44
- package/src/generators/ngrx/lib/add-imports-to-module.d.ts +0 -4
- package/src/generators/ngrx/lib/add-imports-to-module.d.ts.map +0 -1
- package/src/generators/ngrx/lib/add-imports-to-module.js +0 -181
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.d.ts +0 -4
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.d.ts.map +0 -1
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +0 -23
- package/src/generators/ngrx/lib/generate-files.d.ts +0 -7
- package/src/generators/ngrx/lib/generate-files.d.ts.map +0 -1
- package/src/generators/ngrx/lib/generate-files.js +0 -23
- package/src/generators/ngrx/lib/index.d.ts +0 -7
- package/src/generators/ngrx/lib/index.d.ts.map +0 -1
- package/src/generators/ngrx/lib/index.js +0 -15
- package/src/generators/ngrx/lib/normalize-options.d.ts +0 -9
- package/src/generators/ngrx/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/ngrx/lib/normalize-options.js +0 -30
- package/src/generators/ngrx/lib/validate-options.d.ts +0 -4
- package/src/generators/ngrx/lib/validate-options.d.ts.map +0 -1
- package/src/generators/ngrx/lib/validate-options.js +0 -14
- package/src/generators/ngrx/ngrx.d.ts +0 -8
- package/src/generators/ngrx/ngrx.d.ts.map +0 -1
- package/src/generators/ngrx/ngrx.js +0 -28
- package/src/generators/ngrx/schema.d.ts +0 -14
- package/src/generators/ngrx/schema.json +0 -102
- package/src/generators/setup-tailwind/files/v2/tailwind.config.js__tmpl__ +0 -18
- package/src/generators/setup-tailwind/files/v3/tailwind.config.js__tmpl__ +0 -14
- package/src/generators/setup-tailwind/lib/add-tailwind-config.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/add-tailwind-config.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/add-tailwind-config.js +0 -17
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/add-tailwind-required-packages.js +0 -13
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.js +0 -18
- package/src/generators/setup-tailwind/lib/index.d.ts +0 -7
- package/src/generators/setup-tailwind/lib/index.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/index.js +0 -9
- package/src/generators/setup-tailwind/lib/normalize-options.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/normalize-options.js +0 -9
- package/src/generators/setup-tailwind/lib/update-application-styles.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/update-application-styles.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/update-application-styles.js +0 -53
- package/src/generators/setup-tailwind/lib/validate-build-target.d.ts +0 -4
- package/src/generators/setup-tailwind/lib/validate-build-target.d.ts.map +0 -1
- package/src/generators/setup-tailwind/lib/validate-build-target.js +0 -24
- package/src/generators/setup-tailwind/schema.d.ts +0 -11
- package/src/generators/setup-tailwind/schema.json +0 -42
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +0 -5
- package/src/generators/setup-tailwind/setup-tailwind.d.ts.map +0 -1
- package/src/generators/setup-tailwind/setup-tailwind.js +0 -32
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const COLLECTION = '@nx/angular';
|
|
6
|
+
const OLD_GENERATOR = 'ngrx';
|
|
7
|
+
const OLD_KEY = `${COLLECTION}:${OLD_GENERATOR}`;
|
|
8
|
+
const ROOT_STORE = 'ngrx-root-store';
|
|
9
|
+
const FEATURE_STORE = 'ngrx-feature-store';
|
|
10
|
+
// Options supported by ngrx-root-store. The `minimal` option is included here
|
|
11
|
+
// because its semantics match the old generator (skip generating root feature
|
|
12
|
+
// state files).
|
|
13
|
+
const ROOT_STORE_OPTIONS = [
|
|
14
|
+
'name',
|
|
15
|
+
'route',
|
|
16
|
+
'directory',
|
|
17
|
+
'facade',
|
|
18
|
+
'minimal',
|
|
19
|
+
'skipImport',
|
|
20
|
+
'skipPackageJson',
|
|
21
|
+
'skipFormat',
|
|
22
|
+
];
|
|
23
|
+
// Options supported by ngrx-feature-store. `minimal` is intentionally excluded:
|
|
24
|
+
// in the old generator it was a no-op for feature usage, but in
|
|
25
|
+
// ngrx-feature-store it skips template generation while still wiring imports,
|
|
26
|
+
// which would produce broken modules.
|
|
27
|
+
const FEATURE_STORE_OPTIONS = [
|
|
28
|
+
'name',
|
|
29
|
+
'parent',
|
|
30
|
+
'route',
|
|
31
|
+
'directory',
|
|
32
|
+
'facade',
|
|
33
|
+
'barrels',
|
|
34
|
+
'skipImport',
|
|
35
|
+
'skipPackageJson',
|
|
36
|
+
'skipFormat',
|
|
37
|
+
];
|
|
38
|
+
async function default_1(tree) {
|
|
39
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
40
|
+
if (nxJson?.generators && migrateGenerators(nxJson.generators)) {
|
|
41
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
42
|
+
}
|
|
43
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
44
|
+
for (const [projectName, project] of projects) {
|
|
45
|
+
if (project.generators && migrateGenerators(project.generators)) {
|
|
46
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
50
|
+
}
|
|
51
|
+
function migrateGenerators(generators) {
|
|
52
|
+
const flatDefaults = generators[OLD_KEY];
|
|
53
|
+
const nestedDefaults = generators[COLLECTION]?.[OLD_GENERATOR];
|
|
54
|
+
if (!flatDefaults && !nestedDefaults) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
// Match Nx's runtime merge: nested first, then flat overrides.
|
|
58
|
+
// See `getGeneratorDefaults` in packages/nx/src/utils/params.ts.
|
|
59
|
+
const oldDefaults = {
|
|
60
|
+
...(nestedDefaults ?? {}),
|
|
61
|
+
...(flatDefaults ?? {}),
|
|
62
|
+
};
|
|
63
|
+
// Prefer flat when both shapes exist (it's the dominant runtime shape).
|
|
64
|
+
const useNestedFormat = !flatDefaults && !!nestedDefaults;
|
|
65
|
+
// The deprecated `module` option was an alias for `parent`. The old
|
|
66
|
+
// generator resolved `options.module ?? options.parent`, so `module` won
|
|
67
|
+
// when both were set — preserve that precedence here.
|
|
68
|
+
if (oldDefaults.module !== undefined) {
|
|
69
|
+
oldDefaults.parent = oldDefaults.module;
|
|
70
|
+
}
|
|
71
|
+
const rootStoreDefaults = pick(oldDefaults, ROOT_STORE_OPTIONS);
|
|
72
|
+
const featureStoreDefaults = pick(oldDefaults, FEATURE_STORE_OPTIONS);
|
|
73
|
+
if (Object.keys(rootStoreDefaults).length > 0) {
|
|
74
|
+
setNewDefaults(generators, ROOT_STORE, rootStoreDefaults, useNestedFormat);
|
|
75
|
+
}
|
|
76
|
+
if (Object.keys(featureStoreDefaults).length > 0) {
|
|
77
|
+
setNewDefaults(generators, FEATURE_STORE, featureStoreDefaults, useNestedFormat);
|
|
78
|
+
}
|
|
79
|
+
delete generators[OLD_KEY];
|
|
80
|
+
if (generators[COLLECTION]?.[OLD_GENERATOR] !== undefined) {
|
|
81
|
+
delete generators[COLLECTION][OLD_GENERATOR];
|
|
82
|
+
if (Object.keys(generators[COLLECTION]).length === 0) {
|
|
83
|
+
delete generators[COLLECTION];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
function pick(obj, keys) {
|
|
89
|
+
const result = {};
|
|
90
|
+
for (const key of keys) {
|
|
91
|
+
if (obj[key] !== undefined) {
|
|
92
|
+
result[key] = obj[key];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
function setNewDefaults(generators, generator, newDefaults, preferNestedFormat) {
|
|
98
|
+
const flatKey = `${COLLECTION}:${generator}`;
|
|
99
|
+
const existingFlat = generators[flatKey];
|
|
100
|
+
const existingNested = generators[COLLECTION]?.[generator];
|
|
101
|
+
// Per-generator destination: prefer whichever shape the user already uses
|
|
102
|
+
// for the replacement key, so the migrated defaults layer correctly under
|
|
103
|
+
// their existing values. Fall back to the input shape when neither exists.
|
|
104
|
+
const writeNested = existingNested !== undefined
|
|
105
|
+
? true
|
|
106
|
+
: existingFlat !== undefined
|
|
107
|
+
? false
|
|
108
|
+
: preferNestedFormat;
|
|
109
|
+
if (writeNested) {
|
|
110
|
+
generators[COLLECTION] ??= {};
|
|
111
|
+
// Existing user-set defaults take precedence over the migrated ones.
|
|
112
|
+
generators[COLLECTION][generator] = {
|
|
113
|
+
...newDefaults,
|
|
114
|
+
...(existingNested ?? {}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
generators[flatKey] = { ...newDefaults, ...(existingFlat ?? {}) };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-with-mf-import-to-new-package.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAIV,MAAM,YAAY,CAAC;AASpB,wBAA8B,mBAAmB,CAAC,IAAI,EAAE,IAAI,iBAmD3D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateWithMfImport;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
6
|
+
const projects_1 = require("../utils/projects");
|
|
7
|
+
const versions_1 = require("../../utils/versions");
|
|
8
|
+
const NX_ANGULAR_MODULE_FEDERATION_IMPORT_SELECTOR = 'ImportDeclaration > StringLiteral[value=@nx/angular/module-federation], VariableStatement CallExpression:has(Identifier[name=require]) > StringLiteral[value=@nx/angular/module-federation]';
|
|
9
|
+
const NEW_IMPORT_PATH = `'@nx/module-federation/angular'`;
|
|
10
|
+
async function migrateWithMfImport(tree) {
|
|
11
|
+
const angularProjects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
12
|
+
'npm:@nx/angular',
|
|
13
|
+
]);
|
|
14
|
+
if (!angularProjects.length) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let anyUpdated = false;
|
|
18
|
+
for (const { data } of angularProjects) {
|
|
19
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, data.root, (filePath) => {
|
|
20
|
+
if (!filePath.endsWith('.ts') && !filePath.endsWith('.js')) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let contents = tree.read(filePath, 'utf-8');
|
|
24
|
+
if (!contents.includes('@nx/angular/module-federation')) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const sourceFile = (0, tsquery_1.ast)(contents);
|
|
28
|
+
const importNodes = (0, tsquery_1.query)(sourceFile, NX_ANGULAR_MODULE_FEDERATION_IMPORT_SELECTOR);
|
|
29
|
+
if (importNodes.length === 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Iterate end-to-start so earlier replacements don't shift later offsets.
|
|
33
|
+
for (let i = importNodes.length - 1; i >= 0; i--) {
|
|
34
|
+
const node = importNodes[i];
|
|
35
|
+
contents = `${contents.slice(0, node.getStart())}${NEW_IMPORT_PATH}${contents.slice(node.getEnd())}`;
|
|
36
|
+
}
|
|
37
|
+
tree.write(filePath, contents);
|
|
38
|
+
anyUpdated = true;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (anyUpdated) {
|
|
42
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/module-federation': versions_1.nxVersion });
|
|
43
|
+
}
|
|
44
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/plugins/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/plugins/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,aAAa,EAOnB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAOD,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,EAAE,aAAa,GAAG,SAAS,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;CACtD,CAAC;AAqCF,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,oBAAoB,CA+B7D,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
|
|
7
|
-
const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
|
|
8
7
|
const js_1 = require("@nx/js");
|
|
9
8
|
const node_fs_1 = require("node:fs");
|
|
10
9
|
const node_path_1 = require("node:path");
|
|
@@ -46,37 +45,35 @@ const knownExecutors = {
|
|
|
46
45
|
'@angular/build:unit-test',
|
|
47
46
|
]),
|
|
48
47
|
};
|
|
49
|
-
function readProjectsCache(cachePath) {
|
|
50
|
-
return (0, node_fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
|
|
51
|
-
}
|
|
52
|
-
function writeProjectsToCache(cachePath, results) {
|
|
53
|
-
(0, devkit_1.writeJsonFile)(cachePath, results);
|
|
54
|
-
}
|
|
55
48
|
exports.createNodesV2 = [
|
|
56
49
|
'**/angular.json',
|
|
57
50
|
async (configFiles, options, context) => {
|
|
58
51
|
const optionsHash = (0, devkit_internals_1.hashObject)(options);
|
|
59
52
|
const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `angular-${optionsHash}.hash`);
|
|
60
|
-
const projectsCache =
|
|
61
|
-
const
|
|
53
|
+
const projectsCache = new internal_1.PluginCache(cachePath);
|
|
54
|
+
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
55
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
56
|
+
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
62
57
|
try {
|
|
63
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, projectsCache, pmc), configFiles, options, context);
|
|
58
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, projectsCache, pmc, lockFileName), configFiles, options, context);
|
|
64
59
|
}
|
|
65
60
|
finally {
|
|
66
|
-
|
|
61
|
+
projectsCache.writeToDisk();
|
|
67
62
|
}
|
|
68
63
|
},
|
|
69
64
|
];
|
|
70
|
-
async function createNodesInternal(configFilePath, options, context, projectsCache, pmc) {
|
|
65
|
+
async function createNodesInternal(configFilePath, options, context, projectsCache, pmc, lockFileName) {
|
|
71
66
|
const angularWorkspaceRoot = (0, node_path_1.dirname)(configFilePath);
|
|
72
67
|
// Do not create a project if package.json isn't there
|
|
73
68
|
const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot));
|
|
74
69
|
if (!siblingFiles.includes('package.json')) {
|
|
75
70
|
return {};
|
|
76
71
|
}
|
|
77
|
-
const hash = await (0,
|
|
78
|
-
projectsCache
|
|
79
|
-
|
|
72
|
+
const hash = await (0, internal_1.calculateHashForCreateNodes)(angularWorkspaceRoot, options, context, [lockFileName]);
|
|
73
|
+
if (!projectsCache.has(hash)) {
|
|
74
|
+
projectsCache.set(hash, await buildAngularProjects(configFilePath, options, angularWorkspaceRoot, context, pmc));
|
|
75
|
+
}
|
|
76
|
+
return { projects: projectsCache.get(hash) };
|
|
80
77
|
}
|
|
81
78
|
async function buildAngularProjects(configFilePath, options, angularWorkspaceRoot, context, pmc) {
|
|
82
79
|
const projects = {};
|
|
@@ -90,7 +87,7 @@ async function buildAngularProjects(configFilePath, options, angularWorkspaceRoo
|
|
|
90
87
|
if (!projectTargets) {
|
|
91
88
|
continue;
|
|
92
89
|
}
|
|
93
|
-
const namedInputs = (0,
|
|
90
|
+
const namedInputs = (0, internal_1.getNamedInputs)(project.root, context);
|
|
94
91
|
for (const [angularTargetName, angularTarget] of Object.entries(projectTargets)) {
|
|
95
92
|
const nxTargetName = options?.targetNamePrefix
|
|
96
93
|
? `${options.targetNamePrefix}${angularTargetName}`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-supported-angular-version.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/assert-supported-angular-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAMvC,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAM9D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertSupportedAngularVersion = assertSupportedAngularVersion;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const backward_compatible_versions_1 = require("./backward-compatible-versions");
|
|
6
|
+
const minSupportedAngularMajor = Math.min(...backward_compatible_versions_1.supportedVersions);
|
|
7
|
+
function assertSupportedAngularVersion(tree) {
|
|
8
|
+
(0, internal_1.assertSupportedPackageVersion)(tree, '@angular/core', `${minSupportedAngularMajor}.0.0`);
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backward-compatible-versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/backward-compatible-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,uBAAwB,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,OAAO,cAAc,EAC3B,WAAW,CACZ,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,GAAG,sBAAsB,EAAE,MAAM,CAAC,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"backward-compatible-versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/backward-compatible-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,uBAAwB,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,OAAO,cAAc,EAC3B,WAAW,CACZ,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,GAAG,sBAAsB,EAAE,MAAM,CAAC,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B,EAAE,UAiExC,CAAC"}
|
|
@@ -23,14 +23,13 @@ exports.backwardCompatibleVersions = {
|
|
|
23
23
|
moduleFederationEnhancedVersion: '^0.21.2',
|
|
24
24
|
angularEslintVersion: '^20.3.0',
|
|
25
25
|
typescriptEslintVersion: '^7.16.0',
|
|
26
|
-
tailwindVersion: '^3.0.2',
|
|
27
26
|
postcssVersion: '^8.4.5',
|
|
28
27
|
postcssUrlVersion: '~10.1.3',
|
|
29
28
|
autoprefixerVersion: '^10.4.0',
|
|
30
29
|
tsNodeVersion: '10.9.1',
|
|
31
30
|
lessVersion: '^4.3.0',
|
|
32
31
|
jestPresetAngularVersion: '~14.6.1',
|
|
33
|
-
typesNodeVersion: '
|
|
32
|
+
typesNodeVersion: '^22.0.0',
|
|
34
33
|
jasmineMarblesVersion: '^0.9.2',
|
|
35
34
|
jsoncEslintParserVersion: '^2.1.0',
|
|
36
35
|
webpackMergeVersion: '^5.8.0',
|
|
@@ -56,14 +55,13 @@ exports.backwardCompatibleVersions = {
|
|
|
56
55
|
moduleFederationEnhancedVersion: '^0.9.0',
|
|
57
56
|
angularEslintVersion: '^19.2.0',
|
|
58
57
|
typescriptEslintVersion: '^7.16.0',
|
|
59
|
-
tailwindVersion: '^3.0.2',
|
|
60
58
|
postcssVersion: '^8.4.5',
|
|
61
59
|
postcssUrlVersion: '~10.1.3',
|
|
62
60
|
autoprefixerVersion: '^10.4.0',
|
|
63
61
|
tsNodeVersion: '10.9.1',
|
|
64
62
|
lessVersion: '^4.3.0',
|
|
65
63
|
jestPresetAngularVersion: '~14.4.0',
|
|
66
|
-
typesNodeVersion: '
|
|
64
|
+
typesNodeVersion: '^22.0.0',
|
|
67
65
|
jasmineMarblesVersion: '^0.9.2',
|
|
68
66
|
jsoncEslintParserVersion: '^2.1.0',
|
|
69
67
|
webpackMergeVersion: '^5.8.0',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMFProjects = getMFProjects;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
function _getMfProjects(tree, CUSTOM_WEBPACK_OPTION, MODULE_FEDERATION_IDENTIFIER, projects) {
|
|
6
6
|
return (opts, projectName) => {
|
|
7
7
|
const webpackPath = opts[CUSTOM_WEBPACK_OPTION]?.path;
|
|
@@ -25,7 +25,7 @@ function getMFProjects(tree, { legacy } = { legacy: false }) {
|
|
|
25
25
|
? 'Identifier[name=ModuleFederationPlugin]'
|
|
26
26
|
: 'Identifier[name=withModuleFederation]';
|
|
27
27
|
const projects = [];
|
|
28
|
-
(0,
|
|
29
|
-
(0,
|
|
28
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nx/angular:webpack-browser', _getMfProjects(tree, CUSTOM_WEBPACK_OPTION, MODULE_FEDERATION_IDENTIFIER, projects));
|
|
29
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nrwl/angular:webpack-browser', _getMfProjects(tree, CUSTOM_WEBPACK_OPTION, MODULE_FEDERATION_IDENTIFIER, projects));
|
|
30
30
|
return projects;
|
|
31
31
|
}
|
package/src/utils/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { isStandalone, addImportToComponent, addImportToDirective, addImportToPipe, addImportToModule, addProviderToBootstrapApplication, addProviderToAppConfig, addProviderToComponent, addProviderToModule, addViewProviderToComponent, } from './nx-devkit/ast-utils';
|
|
7
7
|
export { addRoute, addProviderToRoute } from './nx-devkit/route-utils';
|
|
8
|
+
export { angularDevkitVersion } from './versions';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/src/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iCAAiC,EACjC,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,iCAAiC,EACjC,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
|
package/src/utils/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Try hard to not add to this API to reduce the surface area we need to maintain.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.addProviderToRoute = exports.addRoute = exports.addViewProviderToComponent = exports.addProviderToModule = exports.addProviderToComponent = exports.addProviderToAppConfig = exports.addProviderToBootstrapApplication = exports.addImportToModule = exports.addImportToPipe = exports.addImportToDirective = exports.addImportToComponent = exports.isStandalone = void 0;
|
|
8
|
+
exports.angularDevkitVersion = exports.addProviderToRoute = exports.addRoute = exports.addViewProviderToComponent = exports.addProviderToModule = exports.addProviderToComponent = exports.addProviderToAppConfig = exports.addProviderToBootstrapApplication = exports.addImportToModule = exports.addImportToPipe = exports.addImportToDirective = exports.addImportToComponent = exports.isStandalone = void 0;
|
|
9
9
|
var ast_utils_1 = require("./nx-devkit/ast-utils");
|
|
10
10
|
Object.defineProperty(exports, "isStandalone", { enumerable: true, get: function () { return ast_utils_1.isStandalone; } });
|
|
11
11
|
Object.defineProperty(exports, "addImportToComponent", { enumerable: true, get: function () { return ast_utils_1.addImportToComponent; } });
|
|
@@ -20,3 +20,5 @@ Object.defineProperty(exports, "addViewProviderToComponent", { enumerable: true,
|
|
|
20
20
|
var route_utils_1 = require("./nx-devkit/route-utils");
|
|
21
21
|
Object.defineProperty(exports, "addRoute", { enumerable: true, get: function () { return route_utils_1.addRoute; } });
|
|
22
22
|
Object.defineProperty(exports, "addProviderToRoute", { enumerable: true, get: function () { return route_utils_1.addProviderToRoute; } });
|
|
23
|
+
var versions_1 = require("./versions");
|
|
24
|
+
Object.defineProperty(exports, "angularDevkitVersion", { enumerable: true, get: function () { return versions_1.angularDevkitVersion; } });
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -16,14 +16,13 @@ export declare const moduleFederationEnhancedVersion = "^2.1.0";
|
|
|
16
16
|
export declare const webpackMergeVersion = "^5.8.0";
|
|
17
17
|
export declare const angularEslintVersion = "^21.2.0";
|
|
18
18
|
export declare const typescriptEslintVersion = "^7.16.0";
|
|
19
|
-
export declare const tailwindVersion = "^3.0.2";
|
|
20
19
|
export declare const postcssVersion = "^8.4.5";
|
|
21
20
|
export declare const postcssUrlVersion = "~10.1.3";
|
|
22
21
|
export declare const autoprefixerVersion = "^10.4.0";
|
|
23
22
|
export declare const tsNodeVersion = "10.9.1";
|
|
24
23
|
export declare const lessVersion = "^4.3.0";
|
|
25
24
|
export declare const jestPresetAngularVersion = "~16.0.0";
|
|
26
|
-
export declare const typesNodeVersion = "
|
|
25
|
+
export declare const typesNodeVersion = "^22.0.0";
|
|
27
26
|
export declare const jasmineMarblesVersion = "^0.9.2";
|
|
28
27
|
export declare const vitestVersion = "^4.0.8";
|
|
29
28
|
export declare const jsdomVersion = "^27.1.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,+BAA+B,WAAW,CAAC;AACxD,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,+BAA+B,WAAW,CAAC;AACxD,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,YAAY,YAAY,CAAC;AAGtC,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,eAAO,MAAM,wBAAwB,WAAW,CAAC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsoncEslintParserVersion = exports.oxcProjectRuntimeVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.
|
|
3
|
+
exports.jsoncEslintParserVersion = exports.oxcProjectRuntimeVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = 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
5
|
exports.angularVersion = '~21.2.0';
|
|
6
6
|
exports.angularDevkitVersion = '~21.2.0';
|
|
@@ -19,14 +19,13 @@ exports.moduleFederationEnhancedVersion = '^2.1.0';
|
|
|
19
19
|
exports.webpackMergeVersion = '^5.8.0';
|
|
20
20
|
exports.angularEslintVersion = '^21.2.0';
|
|
21
21
|
exports.typescriptEslintVersion = '^7.16.0';
|
|
22
|
-
exports.tailwindVersion = '^3.0.2';
|
|
23
22
|
exports.postcssVersion = '^8.4.5';
|
|
24
23
|
exports.postcssUrlVersion = '~10.1.3';
|
|
25
24
|
exports.autoprefixerVersion = '^10.4.0';
|
|
26
25
|
exports.tsNodeVersion = '10.9.1';
|
|
27
26
|
exports.lessVersion = '^4.3.0';
|
|
28
27
|
exports.jestPresetAngularVersion = '~16.0.0';
|
|
29
|
-
exports.typesNodeVersion = '
|
|
28
|
+
exports.typesNodeVersion = '^22.0.0';
|
|
30
29
|
exports.jasmineMarblesVersion = '^0.9.2';
|
|
31
30
|
exports.vitestVersion = '^4.0.8';
|
|
32
31
|
exports.jsdomVersion = '^27.1.0';
|
package/tailwind.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @param fileGlobPattern pass a custom glob pattern to be used
|
|
2
|
+
* @deprecated `@nx/angular/tailwind` will be removed in Nx 24. Migrate to Tailwind CSS v4 which no longer needs glob patterns.
|
|
3
|
+
* See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular
|
|
5
4
|
*/
|
|
6
5
|
export declare function createGlobPatternsForDependencies(dirPath: string, fileGlobPattern?: string): string[];
|
|
7
6
|
//# sourceMappingURL=tailwind.d.ts.map
|
package/tailwind.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../packages/angular/tailwind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../../packages/angular/tailwind.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,MAAM,EACf,eAAe,GAAE,MAA4C,YA4B9D"}
|
package/tailwind.js
CHANGED
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createGlobPatternsForDependencies = createGlobPatternsForDependencies;
|
|
4
4
|
const generate_globs_1 = require("@nx/js/src/utils/generate-globs");
|
|
5
|
+
let hasWarned = false;
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param fileGlobPattern pass a custom glob pattern to be used
|
|
7
|
+
* @deprecated `@nx/angular/tailwind` will be removed in Nx 24. Migrate to Tailwind CSS v4 which no longer needs glob patterns.
|
|
8
|
+
* See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular
|
|
9
9
|
*/
|
|
10
10
|
function createGlobPatternsForDependencies(dirPath, fileGlobPattern = '/**/!(*.stories|*.spec).{ts,html}') {
|
|
11
|
+
if (!hasWarned) {
|
|
12
|
+
hasWarned = true;
|
|
13
|
+
console.warn(`\nWARNING: "@nx/angular/tailwind" is deprecated and will be removed in Nx 24.\n` +
|
|
14
|
+
`Migrate to Tailwind CSS v4 which no longer needs glob patterns for content detection.\n` +
|
|
15
|
+
`See: https://nx.dev/docs/technologies/angular/guides/using-tailwind-css-with-angular\n`);
|
|
16
|
+
}
|
|
11
17
|
try {
|
|
12
18
|
return (0, generate_globs_1.createGlobPatternsForDependencies)(dirPath, fileGlobPattern);
|
|
13
19
|
}
|
|
@@ -19,7 +25,7 @@ function createGlobPatternsForDependencies(dirPath, fileGlobPattern = '/**/!(*.s
|
|
|
19
25
|
* autocomplete features, for example.
|
|
20
26
|
*
|
|
21
27
|
* In order to best support that use-case, we therefore do not hard error when the ProjectGraph is
|
|
22
|
-
*
|
|
28
|
+
* fundamentally unavailable in this tailwind-specific context.
|
|
23
29
|
*/
|
|
24
30
|
console.warn('\nWARNING: There was an error creating glob patterns, returning an empty array\n' +
|
|
25
31
|
`${e.message}\n`);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { withModuleFederation, withModuleFederationForSSR } from '@nx/module-federation/angular';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Update the import path to `@nx/module-federation/angular` instead. This import path will be removed in Nx v22.
|
|
4
|
-
*/
|
|
5
|
-
export { withModuleFederation, withModuleFederationForSSR };
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/angular/module-federation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC;AAEvC;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withModuleFederationForSSR = exports.withModuleFederation = void 0;
|
|
4
|
-
const angular_1 = require("@nx/module-federation/angular");
|
|
5
|
-
Object.defineProperty(exports, "withModuleFederation", { enumerable: true, get: function () { return angular_1.withModuleFederation; } });
|
|
6
|
-
Object.defineProperty(exports, "withModuleFederationForSSR", { enumerable: true, get: function () { return angular_1.withModuleFederationForSSR; } });
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Tree } from '@nx/devkit';
|
|
2
|
-
import type { Linter } from 'eslint';
|
|
3
|
-
import type { AddLintingGeneratorSchema } from '../schema';
|
|
4
|
-
type EslintExtensionSchema = {
|
|
5
|
-
prefix: string;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use tools from `@nx/eslint/src/generators/utils/eslint-file` instead. It will be removed in Nx v22.
|
|
9
|
-
*/
|
|
10
|
-
export declare const extendAngularEslintJson: (json: Linter.LegacyConfig, options: EslintExtensionSchema) => Linter.LegacyConfig;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use {@link extendAngularEslintJson} instead. It will be removed in Nx v22.
|
|
13
|
-
*/
|
|
14
|
-
export declare function createEsLintConfiguration(tree: Tree, options: AddLintingGeneratorSchema): void;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=create-eslint-configuration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-eslint-configuration.d.ts","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAG3D,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,MAAM,CAAC,YAAY,EACzB,SAAS,qBAAqB,KAC7B,MAAM,CAAC,YA4CT,CAAC;AAEF;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,yBAAyB,GACjC,IAAI,CAqEN"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendAngularEslintJson = void 0;
|
|
4
|
-
exports.createEsLintConfiguration = createEsLintConfiguration;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const string_utils_1 = require("@nx/devkit/src/utils/string-utils");
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use tools from `@nx/eslint/src/generators/utils/eslint-file` instead. It will be removed in Nx v22.
|
|
9
|
-
*/
|
|
10
|
-
const extendAngularEslintJson = (json, options) => {
|
|
11
|
-
const overrides = [
|
|
12
|
-
{
|
|
13
|
-
...json.overrides[0],
|
|
14
|
-
files: ['*.ts'],
|
|
15
|
-
extends: [
|
|
16
|
-
...(json.overrides[0].extends || []),
|
|
17
|
-
'plugin:@nx/angular',
|
|
18
|
-
'plugin:@angular-eslint/template/process-inline-templates',
|
|
19
|
-
],
|
|
20
|
-
rules: {
|
|
21
|
-
'@angular-eslint/directive-selector': [
|
|
22
|
-
'error',
|
|
23
|
-
{
|
|
24
|
-
type: 'attribute',
|
|
25
|
-
prefix: (0, string_utils_1.camelize)(options.prefix),
|
|
26
|
-
style: 'camelCase',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
'@angular-eslint/component-selector': [
|
|
30
|
-
'error',
|
|
31
|
-
{
|
|
32
|
-
type: 'element',
|
|
33
|
-
prefix: (0, string_utils_1.dasherize)(options.prefix),
|
|
34
|
-
style: 'kebab-case',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
files: ['*.html'],
|
|
41
|
-
extends: ['plugin:@nx/angular-template'],
|
|
42
|
-
/**
|
|
43
|
-
* Having an empty rules object present makes it more obvious to the user where they would
|
|
44
|
-
* extend things from if they needed to
|
|
45
|
-
*/
|
|
46
|
-
rules: {},
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
return {
|
|
50
|
-
...json,
|
|
51
|
-
overrides,
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
exports.extendAngularEslintJson = extendAngularEslintJson;
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated Use {@link extendAngularEslintJson} instead. It will be removed in Nx v22.
|
|
57
|
-
*/
|
|
58
|
-
function createEsLintConfiguration(tree, options) {
|
|
59
|
-
const rootConfig = `${(0, devkit_1.offsetFromRoot)(options.projectRoot)}.eslintrc.json`;
|
|
60
|
-
// Include all project files to be linted (since they are turned off in the root eslintrc file).
|
|
61
|
-
const ignorePatterns = ['!**/*'];
|
|
62
|
-
const configJson = {
|
|
63
|
-
extends: [rootConfig],
|
|
64
|
-
ignorePatterns,
|
|
65
|
-
overrides: [
|
|
66
|
-
{
|
|
67
|
-
files: ['*.ts'],
|
|
68
|
-
extends: [
|
|
69
|
-
'plugin:@nx/angular',
|
|
70
|
-
'plugin:@angular-eslint/template/process-inline-templates',
|
|
71
|
-
],
|
|
72
|
-
/**
|
|
73
|
-
* NOTE: We no longer set parserOptions.project by default when creating new projects.
|
|
74
|
-
*
|
|
75
|
-
* We have observed that users rarely add rules requiring type-checking to their Nx workspaces, and therefore
|
|
76
|
-
* do not actually need the capabilites which parserOptions.project provides. When specifying parserOptions.project,
|
|
77
|
-
* typescript-eslint needs to create full TypeScript Programs for you. When omitting it, it can perform a simple
|
|
78
|
-
* parse (and AST tranformation) of the source files it encounters during a lint run, which is much faster and much
|
|
79
|
-
* less memory intensive.
|
|
80
|
-
*
|
|
81
|
-
* In the rare case that users attempt to add rules requiring type-checking to their setup later on (and haven't set
|
|
82
|
-
* parserOptions.project), the executor will attempt to look for the particular error typescript-eslint gives you
|
|
83
|
-
* and provide feedback to the user.
|
|
84
|
-
*/
|
|
85
|
-
parserOptions: !options.setParserOptionsProject
|
|
86
|
-
? undefined
|
|
87
|
-
: {
|
|
88
|
-
project: [`${options.projectRoot}/tsconfig.*?.json`],
|
|
89
|
-
},
|
|
90
|
-
rules: {
|
|
91
|
-
'@angular-eslint/directive-selector': [
|
|
92
|
-
'error',
|
|
93
|
-
{
|
|
94
|
-
type: 'attribute',
|
|
95
|
-
prefix: (0, string_utils_1.camelize)(options.prefix),
|
|
96
|
-
style: 'camelCase',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
'@angular-eslint/component-selector': [
|
|
100
|
-
'error',
|
|
101
|
-
{
|
|
102
|
-
type: 'element',
|
|
103
|
-
prefix: (0, string_utils_1.dasherize)(options.prefix),
|
|
104
|
-
style: 'kebab-case',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
files: ['*.html'],
|
|
111
|
-
extends: ['plugin:@nx/angular-template'],
|
|
112
|
-
/**
|
|
113
|
-
* Having an empty rules object present makes it more obvious to the user where they would
|
|
114
|
-
* extend things from if they needed to
|
|
115
|
-
*/
|
|
116
|
-
rules: {},
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
};
|
|
120
|
-
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, '.eslintrc.json'), configJson);
|
|
121
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Tree } from '@nx/devkit';
|
|
2
|
-
import type { Schema } from './schema';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use the `@nx/workspace:move` generator instead. It will be removed in Nx v22.
|
|
5
|
-
*/
|
|
6
|
-
export declare function angularMoveGenerator(tree: Tree, schema: Schema): Promise<void>;
|
|
7
|
-
//# sourceMappingURL=move.d.ts.map
|