@nx/angular 24.0.0-beta.2 → 24.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/dist/executors.d.ts +0 -2
- package/dist/executors.js +0 -2
- package/dist/generators.d.ts +0 -4
- package/dist/generators.js +0 -4
- package/dist/src/generators/add-linting/add-linting.js +0 -2
- package/dist/src/generators/add-linting/schema.d.ts +0 -1
- package/dist/src/generators/application/application.js +1 -2
- package/dist/src/generators/application/lib/add-e2e.js +0 -6
- package/dist/src/generators/application/lib/add-linting.js +0 -1
- package/dist/src/generators/application/lib/add-unit-test-runner.js +0 -2
- package/dist/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/dist/src/generators/application/lib/normalize-options.js +1 -8
- package/dist/src/generators/application/schema.d.ts +0 -1
- package/dist/src/generators/application/schema.json +1 -1
- package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +3 -4
- package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +1 -2
- package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +0 -63
- package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.d.ts +2 -0
- package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.js +32 -0
- package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -15
- package/dist/src/generators/init/init.js +1 -2
- package/dist/src/generators/init/schema.d.ts +0 -2
- package/dist/src/generators/library/schema.d.ts +0 -1
- package/dist/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +12 -1
- package/dist/src/generators/ng-add/migrators/projects/e2e.migrator.js +12 -16
- package/dist/src/generators/ng-add/utilities/workspace.js +1 -3
- package/dist/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
- package/dist/src/generators/utils/add-jest.d.ts +0 -1
- package/dist/src/generators/utils/add-jest.js +0 -2
- package/dist/src/generators/utils/add-vitest.d.ts +0 -1
- package/dist/src/generators/utils/add-vitest.js +0 -1
- package/dist/src/generators/utils/testing.d.ts +0 -4
- package/dist/src/generators/utils/testing.js +0 -12
- package/dist/src/utils/backward-compatible-versions.js +0 -8
- package/dist/src/utils/versions.d.ts +0 -4
- package/dist/src/utils/versions.js +1 -5
- package/executors.json +0 -10
- package/generators.json +0 -35
- package/package.json +11 -20
- package/dist/.npmignore +0 -2
- package/dist/fesm2022/nx-angular-mf.mjs +0 -193
- package/dist/fesm2022/nx-angular-mf.mjs.map +0 -1
- package/dist/mf/package.json +0 -4
- package/dist/src/builders/utilities/module-federation.d.ts +0 -11
- package/dist/src/builders/utilities/module-federation.js +0 -109
- package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
- package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -2
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -22
- package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +0 -29
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -4
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -111
- package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -38
- package/dist/src/executors/module-federation-dev-server/schema.json +0 -171
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -2
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -20
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.js +0 -30
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -4
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -110
- package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -17
- package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -124
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +0 -4
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.js +0 -36
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.d.ts +0 -5
- package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js +0 -448
- package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.js +0 -22
- package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +0 -45
- package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +0 -18
- package/dist/src/generators/convert-to-with-mf/lib/index.d.ts +0 -6
- package/dist/src/generators/convert-to-with-mf/lib/index.js +0 -9
- package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.d.ts +0 -5
- package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +0 -57
- package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.d.ts +0 -2
- package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +0 -13
- package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +0 -3
- package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +0 -50
- package/dist/src/generators/convert-to-with-mf/schema.d.ts +0 -4
- package/dist/src/generators/convert-to-with-mf/schema.json +0 -33
- package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
- package/dist/src/generators/federate-module/federate-module.js +0 -49
- package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +0 -2
- package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +0 -14
- package/dist/src/generators/federate-module/lib/add-path-to-exposes.d.ts +0 -8
- package/dist/src/generators/federate-module/lib/add-path-to-exposes.js +0 -77
- package/dist/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +0 -8
- package/dist/src/generators/federate-module/lib/add-path-to-ts-config.js +0 -11
- package/dist/src/generators/federate-module/lib/add-remote.d.ts +0 -7
- package/dist/src/generators/federate-module/lib/add-remote.js +0 -42
- package/dist/src/generators/federate-module/lib/check-remote-exists.d.ts +0 -2
- package/dist/src/generators/federate-module/lib/check-remote-exists.js +0 -21
- package/dist/src/generators/federate-module/lib/index.d.ts +0 -4
- package/dist/src/generators/federate-module/lib/index.js +0 -7
- package/dist/src/generators/federate-module/schema.d.ts +0 -13
- package/dist/src/generators/federate-module/schema.json +0 -83
- package/dist/src/generators/host/files/common/src/main.server.ts__tmpl__ +0 -78
- package/dist/src/generators/host/files/js/webpack.server.config.js__tmpl__ +0 -8
- package/dist/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +0 -9
- package/dist/src/generators/host/host.d.ts +0 -4
- package/dist/src/generators/host/host.js +0 -133
- package/dist/src/generators/host/lib/index.d.ts +0 -2
- package/dist/src/generators/host/lib/index.js +0 -5
- package/dist/src/generators/host/lib/update-ssr-setup.d.ts +0 -3
- package/dist/src/generators/host/lib/update-ssr-setup.js +0 -54
- package/dist/src/generators/host/lib/validate-options.d.ts +0 -3
- package/dist/src/generators/host/lib/validate-options.js +0 -12
- package/dist/src/generators/host/schema.d.ts +0 -36
- package/dist/src/generators/host/schema.json +0 -195
- package/dist/src/generators/remote/files/base/webpack.server.config.js__tmpl__ +0 -9
- package/dist/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +0 -9
- package/dist/src/generators/remote/files/common/src/main.server.ts__tmpl__ +0 -84
- package/dist/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +0 -12
- package/dist/src/generators/remote/lib/find-next-available-port.d.ts +0 -2
- package/dist/src/generators/remote/lib/find-next-available-port.js +0 -16
- package/dist/src/generators/remote/lib/index.d.ts +0 -3
- package/dist/src/generators/remote/lib/index.js +0 -6
- package/dist/src/generators/remote/lib/update-ssr-setup.d.ts +0 -9
- package/dist/src/generators/remote/lib/update-ssr-setup.js +0 -82
- package/dist/src/generators/remote/lib/validate-options.d.ts +0 -3
- package/dist/src/generators/remote/lib/validate-options.js +0 -12
- package/dist/src/generators/remote/remote.d.ts +0 -4
- package/dist/src/generators/remote/remote.js +0 -114
- package/dist/src/generators/remote/schema.d.ts +0 -34
- package/dist/src/generators/remote/schema.json +0 -184
- package/dist/src/generators/setup-mf/files/entry-module-files/__entryModuleFileName__.ts__tmpl__ +0 -18
- package/dist/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +0 -4
- package/dist/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +0 -10
- package/dist/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +0 -42
- package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +0 -4
- package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +0 -11
- package/dist/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +0 -27
- package/dist/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +0 -12
- package/dist/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +0 -9
- package/dist/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +0 -21
- package/dist/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +0 -23
- package/dist/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +0 -9
- package/dist/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +0 -21
- package/dist/src/generators/setup-mf/lib/add-cypress-workaround.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/add-cypress-workaround.js +0 -52
- package/dist/src/generators/setup-mf/lib/add-remote-entry.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/add-remote-entry.js +0 -27
- package/dist/src/generators/setup-mf/lib/add-remote-to-host.d.ts +0 -9
- package/dist/src/generators/setup-mf/lib/add-remote-to-host.js +0 -127
- package/dist/src/generators/setup-mf/lib/change-build-target.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/change-build-target.js +0 -24
- package/dist/src/generators/setup-mf/lib/fix-bootstrap.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/fix-bootstrap.js +0 -40
- package/dist/src/generators/setup-mf/lib/generate-config.d.ts +0 -6
- package/dist/src/generators/setup-mf/lib/generate-config.js +0 -32
- package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.d.ts +0 -6
- package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.js +0 -20
- package/dist/src/generators/setup-mf/lib/index.d.ts +0 -15
- package/dist/src/generators/setup-mf/lib/index.js +0 -18
- package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.d.ts +0 -2
- package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.js +0 -15
- package/dist/src/generators/setup-mf/lib/normalize-options.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/normalize-options.js +0 -26
- package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +0 -61
- package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.js +0 -20
- package/dist/src/generators/setup-mf/lib/setup-serve-target.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/setup-serve-target.js +0 -39
- package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.js +0 -15
- package/dist/src/generators/setup-mf/lib/update-host-app-routes.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/update-host-app-routes.js +0 -39
- package/dist/src/generators/setup-mf/lib/update-tsconfig.d.ts +0 -3
- package/dist/src/generators/setup-mf/lib/update-tsconfig.js +0 -18
- package/dist/src/generators/setup-mf/schema.d.ts +0 -35
- package/dist/src/generators/setup-mf/schema.json +0 -99
- package/dist/src/generators/setup-mf/setup-mf.d.ts +0 -4
- package/dist/src/generators/setup-mf/setup-mf.js +0 -90
- package/dist/src/generators/utils/add-mf-env-to-inputs.d.ts +0 -2
- package/dist/src/generators/utils/add-mf-env-to-inputs.js +0 -36
- package/dist/src/generators/utils/assert-mf-utils.d.ts +0 -1
- package/dist/src/generators/utils/assert-mf-utils.js +0 -8
- package/dist/src/utils/get-mf-projects.d.ts +0 -4
- package/dist/src/utils/get-mf-projects.js +0 -31
- package/dist/src/utils/module-federation-deprecation.d.ts +0 -4
- package/dist/src/utils/module-federation-deprecation.js +0 -29
- package/dist/types/nx-angular-mf.d.ts +0 -72
- package/dist/types/nx-angular-mf.d.ts.map +0 -1
package/dist/executors.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from './src/builders/webpack-browser/webpack-browser.impl';
|
|
2
2
|
export * from './src/builders/webpack-server/webpack-server.impl';
|
|
3
|
-
export * from './src/executors/module-federation-dev-server/module-federation-dev-server.impl';
|
|
4
3
|
export * from './src/executors/delegate-build/delegate-build.impl';
|
|
5
4
|
export * from './src/executors/ng-packagr-lite/ng-packagr-lite.impl';
|
|
6
5
|
export * from './src/executors/package/package.impl';
|
|
7
6
|
export * from './src/executors/browser-esbuild/browser-esbuild.impl';
|
|
8
7
|
export * from './src/executors/application/application.impl';
|
|
9
8
|
export * from './src/executors/extract-i18n/extract-i18n.impl';
|
|
10
|
-
export * from './src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl';
|
|
11
9
|
export { executeDevServerBuilder } from './src/builders/dev-server/dev-server.impl';
|
package/dist/executors.js
CHANGED
|
@@ -4,13 +4,11 @@ exports.executeDevServerBuilder = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
tslib_1.__exportStar(require("./src/builders/webpack-browser/webpack-browser.impl"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./src/builders/webpack-server/webpack-server.impl"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./src/executors/module-federation-dev-server/module-federation-dev-server.impl"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./src/executors/delegate-build/delegate-build.impl"), exports);
|
|
9
8
|
tslib_1.__exportStar(require("./src/executors/ng-packagr-lite/ng-packagr-lite.impl"), exports);
|
|
10
9
|
tslib_1.__exportStar(require("./src/executors/package/package.impl"), exports);
|
|
11
10
|
tslib_1.__exportStar(require("./src/executors/browser-esbuild/browser-esbuild.impl"), exports);
|
|
12
11
|
tslib_1.__exportStar(require("./src/executors/application/application.impl"), exports);
|
|
13
12
|
tslib_1.__exportStar(require("./src/executors/extract-i18n/extract-i18n.impl"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl"), exports);
|
|
15
13
|
var dev_server_impl_1 = require("./src/builders/dev-server/dev-server.impl");
|
|
16
14
|
Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return dev_server_impl_1.executeDevServerBuilder; } });
|
package/dist/generators.d.ts
CHANGED
|
@@ -3,20 +3,16 @@ export * from './src/generators/application/application';
|
|
|
3
3
|
export * from './src/generators/component-story/component-story';
|
|
4
4
|
export * from './src/generators/component/component';
|
|
5
5
|
export * from './src/generators/directive/directive';
|
|
6
|
-
export * from './src/generators/federate-module/federate-module';
|
|
7
|
-
export * from './src/generators/host/host';
|
|
8
6
|
export * from './src/generators/init/init';
|
|
9
7
|
export * from './src/generators/library-secondary-entry-point/library-secondary-entry-point';
|
|
10
8
|
export * from './src/generators/library/library';
|
|
11
9
|
export * from './src/generators/ngrx-feature-store/ngrx-feature-store';
|
|
12
10
|
export * from './src/generators/ngrx-root-store/ngrx-root-store';
|
|
13
11
|
export * from './src/generators/pipe/pipe';
|
|
14
|
-
export * from './src/generators/remote/remote';
|
|
15
12
|
export * from './src/generators/scam-directive/scam-directive';
|
|
16
13
|
export * from './src/generators/scam-pipe/scam-pipe';
|
|
17
14
|
export * from './src/generators/scam-to-standalone/scam-to-standalone';
|
|
18
15
|
export * from './src/generators/scam/scam';
|
|
19
|
-
export * from './src/generators/setup-mf/setup-mf';
|
|
20
16
|
export * from './src/generators/setup-ssr/setup-ssr';
|
|
21
17
|
export * from './src/generators/stories/stories';
|
|
22
18
|
export * from './src/generators/storybook-configuration/storybook-configuration';
|
package/dist/generators.js
CHANGED
|
@@ -7,20 +7,16 @@ tslib_1.__exportStar(require("./src/generators/application/application"), export
|
|
|
7
7
|
tslib_1.__exportStar(require("./src/generators/component-story/component-story"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./src/generators/component/component"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./src/generators/directive/directive"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./src/generators/federate-module/federate-module"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./src/generators/host/host"), exports);
|
|
12
10
|
tslib_1.__exportStar(require("./src/generators/init/init"), exports);
|
|
13
11
|
tslib_1.__exportStar(require("./src/generators/library-secondary-entry-point/library-secondary-entry-point"), exports);
|
|
14
12
|
tslib_1.__exportStar(require("./src/generators/library/library"), exports);
|
|
15
13
|
tslib_1.__exportStar(require("./src/generators/ngrx-feature-store/ngrx-feature-store"), exports);
|
|
16
14
|
tslib_1.__exportStar(require("./src/generators/ngrx-root-store/ngrx-root-store"), exports);
|
|
17
15
|
tslib_1.__exportStar(require("./src/generators/pipe/pipe"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./src/generators/remote/remote"), exports);
|
|
19
16
|
tslib_1.__exportStar(require("./src/generators/scam-directive/scam-directive"), exports);
|
|
20
17
|
tslib_1.__exportStar(require("./src/generators/scam-pipe/scam-pipe"), exports);
|
|
21
18
|
tslib_1.__exportStar(require("./src/generators/scam-to-standalone/scam-to-standalone"), exports);
|
|
22
19
|
tslib_1.__exportStar(require("./src/generators/scam/scam"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./src/generators/setup-mf/setup-mf"), exports);
|
|
24
20
|
tslib_1.__exportStar(require("./src/generators/setup-ssr/setup-ssr"), exports);
|
|
25
21
|
tslib_1.__exportStar(require("./src/generators/stories/stories"), exports);
|
|
26
22
|
tslib_1.__exportStar(require("./src/generators/storybook-configuration/storybook-configuration"), exports);
|
|
@@ -26,8 +26,6 @@ async function addLintingGenerator(tree, options) {
|
|
|
26
26
|
unitTestRunner: options.unitTestRunner,
|
|
27
27
|
enableTypedLinting: (0, internal_3.isTypedLintingEnabled)(options),
|
|
28
28
|
rootProject: rootProject,
|
|
29
|
-
addPlugin: options.addPlugin ?? false,
|
|
30
|
-
addExplicitTargets: true,
|
|
31
29
|
skipPackageJson: options.skipPackageJson,
|
|
32
30
|
}));
|
|
33
31
|
// The angular-eslint presets, selector rules and dependency install below have
|
|
@@ -21,7 +21,7 @@ async function applicationGenerator(tree, schema) {
|
|
|
21
21
|
if (isRspack) {
|
|
22
22
|
schema.bundler = 'webpack';
|
|
23
23
|
}
|
|
24
|
-
const options = await (0, lib_1.normalizeOptions)(tree, schema
|
|
24
|
+
const options = await (0, lib_1.normalizeOptions)(tree, schema);
|
|
25
25
|
const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
|
|
26
26
|
await (0, js_1.initGenerator)(tree, {
|
|
27
27
|
...options,
|
|
@@ -32,7 +32,6 @@ async function applicationGenerator(tree, schema) {
|
|
|
32
32
|
await (0, init_1.angularInitGenerator)(tree, {
|
|
33
33
|
...options,
|
|
34
34
|
skipFormat: true,
|
|
35
|
-
addPlugin: options.addPlugin,
|
|
36
35
|
});
|
|
37
36
|
if (!options.skipPackageJson) {
|
|
38
37
|
(0, ensure_angular_dependencies_1.ensureAngularDependencies)(tree, options.zoneless);
|
|
@@ -6,10 +6,6 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
const internal_2 = require("@nx/eslint/internal");
|
|
7
7
|
const versions_1 = require("../../../utils/versions");
|
|
8
8
|
async function addE2e(tree, options) {
|
|
9
|
-
// since e2e are separate projects, default to adding plugins
|
|
10
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
11
|
-
const addPlugin = nxJson['useInferencePlugins'] !== false &&
|
|
12
|
-
process.env.NX_ADD_PLUGINS !== 'false';
|
|
13
9
|
const e2eWebServerInfo = getAngularE2EWebServerInfo(tree, options.name, options.port);
|
|
14
10
|
if (options.e2eTestRunner === 'cypress') {
|
|
15
11
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
@@ -36,7 +32,6 @@ async function addE2e(tree, options) {
|
|
|
36
32
|
ciWebServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
|
|
37
33
|
ciBaseUrl: e2eWebServerInfo.e2eCiBaseUrl,
|
|
38
34
|
rootProject: options.rootProject,
|
|
39
|
-
addPlugin,
|
|
40
35
|
});
|
|
41
36
|
}
|
|
42
37
|
else if (options.e2eTestRunner === 'playwright') {
|
|
@@ -59,7 +54,6 @@ async function addE2e(tree, options) {
|
|
|
59
54
|
webServerCommand: e2eWebServerInfo.e2eWebServerCommand,
|
|
60
55
|
webServerAddress: e2eWebServerInfo.e2eWebServerAddress,
|
|
61
56
|
rootProject: options.rootProject,
|
|
62
|
-
addPlugin,
|
|
63
57
|
});
|
|
64
58
|
}
|
|
65
59
|
return e2eWebServerInfo.e2ePort;
|
|
@@ -12,7 +12,6 @@ async function addUnitTestRunner(host, options) {
|
|
|
12
12
|
projectRoot: options.appProjectRoot,
|
|
13
13
|
skipPackageJson: options.skipPackageJson,
|
|
14
14
|
strict: options.strict,
|
|
15
|
-
addPlugin: options.addPlugin,
|
|
16
15
|
runtimeTsconfigFileName: 'tsconfig.app.json',
|
|
17
16
|
zoneless: options.zoneless,
|
|
18
17
|
});
|
|
@@ -30,7 +29,6 @@ async function addUnitTestRunner(host, options) {
|
|
|
30
29
|
skipFormat: options.skipFormat,
|
|
31
30
|
skipPackageJson: options.skipPackageJson,
|
|
32
31
|
strict: options.strict,
|
|
33
|
-
addPlugin: options.addPlugin,
|
|
34
32
|
zoneless: options.zoneless,
|
|
35
33
|
});
|
|
36
34
|
default:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
2
|
import type { Schema } from '../schema';
|
|
3
3
|
import type { NormalizedSchema } from './normalized-schema';
|
|
4
|
-
export declare function normalizeOptions(host: Tree, options: Partial<Schema
|
|
4
|
+
export declare function normalizeOptions(host: Tree, options: Partial<Schema>): Promise<NormalizedSchema>;
|
|
@@ -6,18 +6,13 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
const test_runners_1 = require("../../../utils/test-runners");
|
|
8
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
9
|
-
function arePluginsExplicitlyDisabled(host) {
|
|
10
|
-
const { useInferencePlugins } = (0, devkit_1.readNxJson)(host);
|
|
11
|
-
const addPluginEnvVar = process.env.NX_ADD_PLUGINS;
|
|
12
|
-
return useInferencePlugins === false || addPluginEnvVar === 'false';
|
|
13
|
-
}
|
|
14
9
|
function validateBundler(bundler) {
|
|
15
10
|
if (['esbuild', 'webpack', 'rspack'].includes(bundler)) {
|
|
16
11
|
return bundler;
|
|
17
12
|
}
|
|
18
13
|
throw new Error(`Invalid bundler: ${bundler}. Please use one of the following: 'esbuild', 'webpack', 'rspack'.`);
|
|
19
14
|
}
|
|
20
|
-
async function normalizeOptions(host, options
|
|
15
|
+
async function normalizeOptions(host, options) {
|
|
21
16
|
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
22
17
|
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
23
18
|
name: options.name,
|
|
@@ -32,7 +27,6 @@ async function normalizeOptions(host, options, isRspack) {
|
|
|
32
27
|
? options.tags.split(',').map((s) => s.trim())
|
|
33
28
|
: [];
|
|
34
29
|
const bundler = validateBundler(options.bundler ?? 'esbuild');
|
|
35
|
-
const addPlugin = options.addPlugin ?? (!arePluginsExplicitlyDisabled(host) && isRspack);
|
|
36
30
|
const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(host);
|
|
37
31
|
const zonelessDefaultValue = angularMajorVersion >= 21 ? true : false;
|
|
38
32
|
const unitTestRunner = options.unitTestRunner ??
|
|
@@ -43,7 +37,6 @@ async function normalizeOptions(host, options, isRspack) {
|
|
|
43
37
|
: test_runners_1.UnitTestRunner.Jest);
|
|
44
38
|
// Set defaults and then overwrite with user options
|
|
45
39
|
return {
|
|
46
|
-
addPlugin,
|
|
47
40
|
style: 'css',
|
|
48
41
|
routing: true,
|
|
49
42
|
inlineStyle: false,
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
},
|
|
131
131
|
"port": {
|
|
132
132
|
"type": "number",
|
|
133
|
-
"description": "The port at which the
|
|
133
|
+
"description": "The port at which the application should be served."
|
|
134
134
|
},
|
|
135
135
|
"enableTypedLinting": {
|
|
136
136
|
"type": "boolean",
|
|
@@ -13,6 +13,7 @@ const create_config_1 = require("./lib/create-config");
|
|
|
13
13
|
const get_custom_webpack_config_1 = require("./lib/get-custom-webpack-config");
|
|
14
14
|
const merge_server_tsconfig_1 = require("./lib/merge-server-tsconfig");
|
|
15
15
|
const update_tsconfig_1 = require("./lib/update-tsconfig");
|
|
16
|
+
const validate_no_module_federation_1 = require("./lib/validate-no-module-federation");
|
|
16
17
|
const validate_supported_executor_1 = require("./lib/validate-supported-executor");
|
|
17
18
|
const SUPPORTED_EXECUTORS = [
|
|
18
19
|
'@angular-devkit/build-angular:browser',
|
|
@@ -23,7 +24,6 @@ const SUPPORTED_EXECUTORS = [
|
|
|
23
24
|
'@nx/angular:webpack-browser',
|
|
24
25
|
'@nx/angular:webpack-server',
|
|
25
26
|
'@nx/angular:dev-server',
|
|
26
|
-
'@nx/angular:module-federation-dev-server',
|
|
27
27
|
];
|
|
28
28
|
const RENAMED_OPTIONS = {
|
|
29
29
|
main: 'browser',
|
|
@@ -251,6 +251,7 @@ async function convertToRspack(tree, schema) {
|
|
|
251
251
|
const targetsToRemove = [];
|
|
252
252
|
let customWebpackConfigPath;
|
|
253
253
|
(0, validate_supported_executor_1.validateSupportedBuildExecutor)(Object.values(project.targets));
|
|
254
|
+
(0, validate_no_module_federation_1.validateNoModuleFederation)(tree, project);
|
|
254
255
|
let projectServePort = DEFAULT_PORT;
|
|
255
256
|
const projectServeConfigurationOptions = {};
|
|
256
257
|
for (const [targetName, target] of Object.entries(project.targets)) {
|
|
@@ -284,8 +285,7 @@ async function convertToRspack(tree, schema) {
|
|
|
284
285
|
targetsToRemove.push(targetName);
|
|
285
286
|
}
|
|
286
287
|
else if (target.executor === '@angular-devkit/build-angular:dev-server' ||
|
|
287
|
-
target.executor === '@nx/angular:dev-server'
|
|
288
|
-
target.executor === '@nx/angular:module-federation-dev-server') {
|
|
288
|
+
target.executor === '@nx/angular:dev-server') {
|
|
289
289
|
createConfigOptions.devServer = {};
|
|
290
290
|
if (target.options) {
|
|
291
291
|
handleDevServerTargetOptions(tree, target.options, createConfigOptions.devServer, project.root);
|
|
@@ -356,7 +356,6 @@ async function convertToRspack(tree, schema) {
|
|
|
356
356
|
// ensure plugin is registered
|
|
357
357
|
const { rspackInitGenerator } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
|
|
358
358
|
await rspackInitGenerator(tree, {
|
|
359
|
-
addPlugin: true,
|
|
360
359
|
framework: 'angular',
|
|
361
360
|
});
|
|
362
361
|
// find the inferred target names
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
2
|
export declare function getCustomWebpackConfig(tree: Tree, projectRoot: string, pathToCustomWebpackConfig: string): Promise<{
|
|
3
3
|
isWebpackConfigFunction: boolean;
|
|
4
4
|
normalizedPathToCustomWebpackConfig: string;
|
|
5
5
|
}>;
|
|
6
|
-
export declare function convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents: string): string;
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCustomWebpackConfig = getCustomWebpackConfig;
|
|
4
|
-
exports.convertWebpackConfigToUseNxModuleFederationPlugin = convertWebpackConfigToUseNxModuleFederationPlugin;
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
5
|
const path_1 = require("path");
|
|
8
|
-
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
9
6
|
const FILE_EXTENSION_REGEX = /\.[^.]+$/;
|
|
10
7
|
async function getCustomWebpackConfig(tree, projectRoot, pathToCustomWebpackConfig) {
|
|
11
|
-
const webpackConfigContents = tree.read(pathToCustomWebpackConfig, 'utf-8');
|
|
12
|
-
if (webpackConfigContents.includes('@nx/module-federation/angular') &&
|
|
13
|
-
webpackConfigContents.includes('withModuleFederation')) {
|
|
14
|
-
tree.write(pathToCustomWebpackConfig, convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents));
|
|
15
|
-
return {
|
|
16
|
-
isWebpackConfigFunction: false,
|
|
17
|
-
normalizedPathToCustomWebpackConfig: `./${(0, path_1.relative)(projectRoot, pathToCustomWebpackConfig).replace(FILE_EXTENSION_REGEX, '')}`,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
8
|
const configFile = await (0, internal_1.loadConfigFile)((0, path_1.join)(tree.root, pathToCustomWebpackConfig));
|
|
21
9
|
const webpackConfig = 'default' in configFile ? configFile.default : configFile;
|
|
22
10
|
return {
|
|
@@ -24,54 +12,3 @@ async function getCustomWebpackConfig(tree, projectRoot, pathToCustomWebpackConf
|
|
|
24
12
|
normalizedPathToCustomWebpackConfig: `./${(0, path_1.relative)(projectRoot, pathToCustomWebpackConfig).replace(FILE_EXTENSION_REGEX, '')}`,
|
|
25
13
|
};
|
|
26
14
|
}
|
|
27
|
-
function convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents) {
|
|
28
|
-
let newWebpackConfigContents = webpackConfigContents;
|
|
29
|
-
let sourceFile = (0, tsquery_1.ast)(webpackConfigContents);
|
|
30
|
-
const withModuleFederationImportNodes = (0, tsquery_1.query)(sourceFile, 'ImportDeclaration:has(StringLiteral[value=@nx/module-federation/angular])');
|
|
31
|
-
if (withModuleFederationImportNodes.length > 0) {
|
|
32
|
-
const withModuleFederationImportNode = withModuleFederationImportNodes[0];
|
|
33
|
-
newWebpackConfigContents = `${webpackConfigContents.slice(0, withModuleFederationImportNode.getStart())}import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/angular';${webpackConfigContents.slice(withModuleFederationImportNode.getEnd())}`;
|
|
34
|
-
sourceFile = (0, tsquery_1.ast)(newWebpackConfigContents);
|
|
35
|
-
const exportedWithModuleFederationNodes = (0, tsquery_1.query)(sourceFile, 'ExportAssignment:has(CallExpression > Identifier[name=withModuleFederation])');
|
|
36
|
-
if (exportedWithModuleFederationNodes.length > 0) {
|
|
37
|
-
const exportedWithModuleFederationNode = exportedWithModuleFederationNodes[0];
|
|
38
|
-
newWebpackConfigContents = `${newWebpackConfigContents.slice(0, exportedWithModuleFederationNode.getStart())}${newWebpackConfigContents.slice(exportedWithModuleFederationNode.getEnd())}
|
|
39
|
-
export default {
|
|
40
|
-
plugins: [
|
|
41
|
-
new NxModuleFederationPlugin({ config }, {
|
|
42
|
-
dts: false,
|
|
43
|
-
}),
|
|
44
|
-
new NxModuleFederationDevServerPlugin({ config }),
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
devkit_1.logger.warn("Could not find 'export default withModuleFederation' in the webpack config file. Skipping conversion.");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const withModuleFederationRequireNodes = (0, tsquery_1.query)(sourceFile, 'VariableStatement:has(CallExpression > Identifier[name=withModuleFederation], StringLiteral[value=@nx/module-federation/angular])');
|
|
54
|
-
if (withModuleFederationRequireNodes.length > 0) {
|
|
55
|
-
const withModuleFederationRequireNode = withModuleFederationRequireNodes[0];
|
|
56
|
-
newWebpackConfigContents = `${webpackConfigContents.slice(0, withModuleFederationRequireNode.getStart())}const { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } = require('@nx/module-federation/rspack');${webpackConfigContents.slice(withModuleFederationRequireNode.getEnd())}`;
|
|
57
|
-
sourceFile = (0, tsquery_1.ast)(newWebpackConfigContents);
|
|
58
|
-
const exportedWithModuleFederationNodes = (0, tsquery_1.query)(sourceFile, 'ExpressionStatement:has(BinaryExpression > PropertyAccessExpression:has(Identifier[name=module], Identifier[name=exports]), CallExpression:has(Identifier[name=withModuleFederation]))');
|
|
59
|
-
if (exportedWithModuleFederationNodes.length > 0) {
|
|
60
|
-
const exportedWithModuleFederationNode = exportedWithModuleFederationNodes[0];
|
|
61
|
-
newWebpackConfigContents = `${newWebpackConfigContents.slice(0, exportedWithModuleFederationNode.getStart())}${newWebpackConfigContents.slice(exportedWithModuleFederationNode.getEnd())}
|
|
62
|
-
module.exports = {
|
|
63
|
-
plugins: [
|
|
64
|
-
new NxModuleFederationPlugin({ config }, {
|
|
65
|
-
dts: false,
|
|
66
|
-
}),
|
|
67
|
-
new NxModuleFederationDevServerPlugin({ config }),
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
`;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
devkit_1.logger.warn("Could not find 'module.exports = withModuleFederation' in the webpack config file. Skipping conversion.");
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return newWebpackConfigContents;
|
|
77
|
-
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateNoModuleFederation = validateNoModuleFederation;
|
|
4
|
+
const MODULE_FEDERATION_EXECUTORS = [
|
|
5
|
+
'@nx/angular:module-federation-dev-server',
|
|
6
|
+
'@nx/angular:module-federation-dev-ssr',
|
|
7
|
+
];
|
|
8
|
+
function validateNoModuleFederation(tree, project) {
|
|
9
|
+
if (usesModuleFederation(tree, project)) {
|
|
10
|
+
throw new Error(`The project ${project.name} is using Module Federation. At the moment, we don't support migrating projects that use Module Federation. See https://nx.dev/docs/kb/migrate-angular-module-federation.`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function usesModuleFederation(tree, project) {
|
|
14
|
+
for (const target of Object.values(project.targets ?? {})) {
|
|
15
|
+
if (MODULE_FEDERATION_EXECUTORS.includes(target.executor)) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
const allOptions = [
|
|
19
|
+
target.options,
|
|
20
|
+
...Object.values(target.configurations ?? {}),
|
|
21
|
+
];
|
|
22
|
+
for (const options of allOptions) {
|
|
23
|
+
const configPath = options?.customWebpackConfig?.path;
|
|
24
|
+
if (configPath &&
|
|
25
|
+
tree.exists(configPath) &&
|
|
26
|
+
tree.read(configPath, 'utf-8').includes('@nx/module-federation')) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js
CHANGED
|
@@ -64,8 +64,6 @@ async function cypressComponentConfiguration(tree, options) {
|
|
|
64
64
|
tasks.push(await baseCyCTConfig(tree, {
|
|
65
65
|
project: options.project,
|
|
66
66
|
skipFormat: true,
|
|
67
|
-
addPlugin: false,
|
|
68
|
-
addExplicitTargets: true,
|
|
69
67
|
skipPackageJson: options.skipPackageJson,
|
|
70
68
|
}));
|
|
71
69
|
await configureCypressCT(tree, options);
|
|
@@ -142,20 +140,10 @@ async function configureCypressCT(tree, options) {
|
|
|
142
140
|
throw new Error('Unable to find a valid build configuration. Try passing in a target for an Angular app (e.g. --build-target=<project>:<target>[:<configuration>]).');
|
|
143
141
|
}
|
|
144
142
|
}
|
|
145
|
-
const ctConfigOptions = {
|
|
143
|
+
const ctConfigOptions = {
|
|
144
|
+
buildTarget: found.target,
|
|
145
|
+
};
|
|
146
146
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
147
|
-
if (projectConfig.targets?.['component-test']?.executor ===
|
|
148
|
-
'@nx/cypress:cypress') {
|
|
149
|
-
projectConfig.targets['component-test'].options = {
|
|
150
|
-
...projectConfig.targets['component-test'].options,
|
|
151
|
-
skipServe: true,
|
|
152
|
-
devServerTarget: found.target,
|
|
153
|
-
};
|
|
154
|
-
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
ctConfigOptions.buildTarget = found.target;
|
|
158
|
-
}
|
|
159
147
|
const { addDefaultCTConfig, getProjectCypressConfigPath, getInstalledCypressMajorVersion, } = require('@nx/cypress/internal');
|
|
160
148
|
const cypressConfigPath = getProjectCypressConfigPath(tree, projectConfig.root);
|
|
161
149
|
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigPath, 'utf-8'), ctConfigOptions, '@nx/angular/plugins/component-testing', getInstalledCypressMajorVersion(tree));
|
|
@@ -16,8 +16,7 @@ async function angularInitGenerator(tree, options) {
|
|
|
16
16
|
// generators do not use `angular.json`, and `nx init` should split
|
|
17
17
|
// `angular.json` into multiple `project.json` files -- as this is preferred
|
|
18
18
|
// by most folks we've talked to.
|
|
19
|
-
|
|
20
|
-
if (options.addPlugin) {
|
|
19
|
+
if (process.env.NX_RUNNING_NX_IMPORT === 'true') {
|
|
21
20
|
await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/angular/plugin', plugin_1.createNodes, {
|
|
22
21
|
targetNamePrefix: ['', 'angular:', 'angular-'],
|
|
23
22
|
}, options.updatePackageScripts);
|
|
@@ -33,7 +33,6 @@ class AngularEslintLintMigrator extends builder_migrator_1.BuilderMigrator {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async updateTargetConfiguration(targetName, target) {
|
|
36
|
-
target.executor = '@nx/eslint:lint';
|
|
37
36
|
if (!target.options) {
|
|
38
37
|
this.logger.warn(`The target "${targetName}" is not specifying any options. Skipping updating the target configuration.`);
|
|
39
38
|
return;
|
|
@@ -60,6 +59,18 @@ class AngularEslintLintMigrator extends builder_migrator_1.BuilderMigrator {
|
|
|
60
59
|
this.logger.warn(`The lint file pattern "${pattern}" specified in the "${targetName}" target is not contained in the project root or source root. The pattern will not be updated.`);
|
|
61
60
|
return pattern;
|
|
62
61
|
});
|
|
62
|
+
// `@nx/eslint:lint` is gone in v24, so the migrated target runs the ESLint
|
|
63
|
+
// CLI directly. Patterns were rebased onto the new project root above.
|
|
64
|
+
const eslintConfig = target.options.eslintConfig && this.newEsLintConfigPath;
|
|
65
|
+
const patterns = target.options.lintFilePatterns ?? [];
|
|
66
|
+
delete target.executor;
|
|
67
|
+
delete target.options;
|
|
68
|
+
target.command = [
|
|
69
|
+
'eslint',
|
|
70
|
+
...(eslintConfig ? ['--config', eslintConfig] : []),
|
|
71
|
+
// Quoted so ESLint, not the shell, expands the globs: sh has no globstar.
|
|
72
|
+
...patterns.map((pattern) => `"${pattern}"`),
|
|
73
|
+
].join(' ');
|
|
63
74
|
(0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
|
|
64
75
|
...this.projectConfig,
|
|
65
76
|
});
|
|
@@ -223,9 +223,6 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
223
223
|
tags: [],
|
|
224
224
|
implicitDependencies: [this.appName],
|
|
225
225
|
});
|
|
226
|
-
const nxJson = (0, devkit_1.readNxJson)(this.tree) ?? {};
|
|
227
|
-
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
228
|
-
nxJson.useInferencePlugins !== false;
|
|
229
226
|
const { configurationGenerator } = (require('@nx/cypress'));
|
|
230
227
|
await configurationGenerator(this.tree, {
|
|
231
228
|
project: this.project.name,
|
|
@@ -234,7 +231,6 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
234
231
|
// any target would do, we replace it later with the target existing in the project being migrated
|
|
235
232
|
devServerTarget: `${this.appName}:serve`,
|
|
236
233
|
baseUrl: 'http://localhost:4200',
|
|
237
|
-
addPlugin,
|
|
238
234
|
});
|
|
239
235
|
const cypressConfigFilePath = this.updateOrCreateCypressConfigFile(oldCypressConfigFilePath);
|
|
240
236
|
this.updateCypressProjectConfiguration(cypressConfigFilePath);
|
|
@@ -284,21 +280,21 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
284
280
|
});
|
|
285
281
|
}
|
|
286
282
|
updateE2eCypressTarget(existingTarget, cypressConfig) {
|
|
283
|
+
// `@nx/cypress:cypress` is gone in v24, so the migrated target runs the
|
|
284
|
+
// Cypress CLI directly against the rebased config. `watch` selected the
|
|
285
|
+
// interactive runner, which is `cypress open`.
|
|
286
|
+
const isInteractive = existingTarget.options?.watch === true;
|
|
287
|
+
if (existingTarget.options?.devServerTarget) {
|
|
288
|
+
this.logger.warn(`The "devServerTarget" option is not supported by the Cypress CLI. Start "${existingTarget.options.devServerTarget}" separately, or set "baseUrl" in "${cypressConfig}".`);
|
|
289
|
+
}
|
|
287
290
|
const updatedTarget = {
|
|
288
291
|
...existingTarget,
|
|
289
|
-
|
|
290
|
-
options: {
|
|
291
|
-
...existingTarget.options,
|
|
292
|
-
cypressConfig,
|
|
293
|
-
},
|
|
292
|
+
command: `cypress ${isInteractive ? 'open' : 'run'} --e2e --config-file ${(0, path_1.basename)(cypressConfig)}`,
|
|
293
|
+
options: { cwd: (0, path_1.dirname)(cypressConfig) },
|
|
294
294
|
};
|
|
295
|
-
delete updatedTarget.
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
delete updatedTarget.options.tsConfig;
|
|
301
|
-
}
|
|
295
|
+
delete updatedTarget.executor;
|
|
296
|
+
delete updatedTarget.configurations;
|
|
297
|
+
delete updatedTarget.defaultConfiguration;
|
|
302
298
|
return updatedTarget;
|
|
303
299
|
}
|
|
304
300
|
cypressConfigGlobToNewGlob(globPattern) {
|
|
@@ -156,9 +156,7 @@ function updatePackageJson(tree) {
|
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
async function updateRootEsLintConfig(tree, existingEsLintConfig, unitTestRunner) {
|
|
159
|
-
await (0, eslint_1.lintInitGenerator)(tree, {
|
|
160
|
-
addPlugin: false,
|
|
161
|
-
});
|
|
159
|
+
await (0, eslint_1.lintInitGenerator)(tree, {});
|
|
162
160
|
if (!existingEsLintConfig) {
|
|
163
161
|
// There was no eslint config in the root, so we set it up and use it as-is
|
|
164
162
|
(0, internal_1.setupRootEsLint)(tree, { unitTestRunner });
|
|
@@ -28,8 +28,6 @@ async function addJest(tree, options) {
|
|
|
28
28
|
skipSerializers: false,
|
|
29
29
|
skipPackageJson: options.skipPackageJson,
|
|
30
30
|
skipFormat: true,
|
|
31
|
-
addPlugin: options.addPlugin ?? false,
|
|
32
|
-
addExplicitTargets: !options.addPlugin,
|
|
33
31
|
});
|
|
34
32
|
const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src', 'test-setup.ts');
|
|
35
33
|
if (options.zoneless) {
|
|
@@ -12,7 +12,6 @@ export type AddVitestAnalogOptions = {
|
|
|
12
12
|
skipPackageJson: boolean;
|
|
13
13
|
strict: boolean;
|
|
14
14
|
zoneless: boolean;
|
|
15
|
-
addPlugin?: boolean;
|
|
16
15
|
};
|
|
17
16
|
export declare function addVitestAngular(tree: Tree, options: AddVitestAngularOptions): Promise<GeneratorCallback>;
|
|
18
17
|
export declare function addVitestAnalog(tree: Tree, options: AddVitestAnalogOptions): Promise<GeneratorCallback>;
|
|
@@ -81,7 +81,6 @@ async function addVitestAnalog(tree, options) {
|
|
|
81
81
|
uiFramework: 'angular',
|
|
82
82
|
testEnvironment: 'jsdom',
|
|
83
83
|
coverageProvider: 'v8',
|
|
84
|
-
addPlugin: options.addPlugin ?? false,
|
|
85
84
|
skipFormat: options.skipFormat,
|
|
86
85
|
skipPackageJson: options.skipPackageJson,
|
|
87
86
|
zoneless: options.zoneless,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Tree } from '@nx/devkit';
|
|
2
2
|
import type { Schema as ApplicationOptions } from '../application/schema';
|
|
3
|
-
import type { Schema as HostOptions } from '../host/schema';
|
|
4
3
|
import type { Schema as LibraryOptions } from '../library/schema';
|
|
5
|
-
import type { Schema as RemoteOptions } from '../remote/schema';
|
|
6
4
|
export declare function generateTestApplication(tree: Tree, options: ApplicationOptions): Promise<void>;
|
|
7
|
-
export declare function generateTestHostApplication(tree: Tree, options: HostOptions): Promise<void>;
|
|
8
|
-
export declare function generateTestRemoteApplication(tree: Tree, options: RemoteOptions): Promise<void>;
|
|
9
5
|
export declare function generateTestLibrary(tree: Tree, options: LibraryOptions): Promise<void>;
|
|
10
6
|
export declare function createStorybookTestWorkspaceForLib(libName: string): Promise<Tree>;
|