@nx/angular 17.2.0-beta.1 → 17.2.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/executors.d.ts +6 -1
- package/executors.js +4 -1
- package/executors.json +4 -4
- package/migrations.json +18 -0
- package/package.json +10 -10
- package/plugins/component-testing.js +1 -1
- package/src/builders/dev-server/dev-server.impl.d.ts +4 -0
- package/src/builders/{webpack-dev-server/webpack-dev-server.impl.js → dev-server/dev-server.impl.js} +48 -26
- package/src/builders/{webpack-dev-server → dev-server}/schema.json +2 -2
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +2 -2
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +8 -5
- package/src/builders/webpack-server/schema.json +1 -1
- package/src/generators/add-linting/add-linting.js +0 -5
- package/src/generators/application/lib/add-e2e.js +1 -0
- package/src/generators/library-secondary-entry-point/lib/index.d.ts +0 -1
- package/src/generators/library-secondary-entry-point/lib/index.js +0 -1
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +0 -1
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +1 -1
- package/src/generators/setup-mf/lib/setup-serve-target.js +1 -1
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.d.ts +2 -0
- package/src/migrations/update-17-2-0/rename-webpack-dev-server.js +40 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.d.ts +0 -4
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.d.ts +0 -3
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +0 -15
- /package/src/builders/{webpack-dev-server → dev-server}/lib/index.d.ts +0 -0
- /package/src/builders/{webpack-dev-server → dev-server}/lib/index.js +0 -0
- /package/src/builders/{webpack-dev-server → dev-server}/lib/normalize-options.d.ts +0 -0
- /package/src/builders/{webpack-dev-server → dev-server}/lib/normalize-options.js +0 -0
- /package/src/builders/{webpack-dev-server → dev-server}/schema.d.ts +0 -0
package/executors.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
export * from './src/builders/module-federation-dev-server/module-federation-dev-server.impl';
|
|
2
2
|
export * from './src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl';
|
|
3
3
|
export * from './src/builders/webpack-browser/webpack-browser.impl';
|
|
4
|
-
export * from './src/builders/webpack-dev-server/webpack-dev-server.impl';
|
|
5
4
|
export * from './src/builders/webpack-server/webpack-server.impl';
|
|
6
5
|
export * from './src/executors/delegate-build/delegate-build.impl';
|
|
7
6
|
export * from './src/executors/ng-packagr-lite/ng-packagr-lite.impl';
|
|
8
7
|
export * from './src/executors/package/package.impl';
|
|
9
8
|
export * from './src/executors/browser-esbuild/browser-esbuild.impl';
|
|
9
|
+
import { executeDevServerBuilder } from './src/builders/dev-server/dev-server.impl';
|
|
10
|
+
export {
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use executeDevServerBuilder instead. It will be removed in Nx v18.
|
|
13
|
+
*/
|
|
14
|
+
executeDevServerBuilder as executeWebpackDevServerBuilder, executeDevServerBuilder, };
|
package/executors.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeDevServerBuilder = exports.executeWebpackDevServerBuilder = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
tslib_1.__exportStar(require("./src/builders/module-federation-dev-server/module-federation-dev-server.impl"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./src/builders/webpack-browser/webpack-browser.impl"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./src/builders/webpack-dev-server/webpack-dev-server.impl"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./src/builders/webpack-server/webpack-server.impl"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./src/executors/delegate-build/delegate-build.impl"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./src/executors/ng-packagr-lite/ng-packagr-lite.impl"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./src/executors/package/package.impl"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./src/executors/browser-esbuild/browser-esbuild.impl"), exports);
|
|
13
|
+
const dev_server_impl_1 = require("./src/builders/dev-server/dev-server.impl");
|
|
14
|
+
Object.defineProperty(exports, "executeWebpackDevServerBuilder", { enumerable: true, get: function () { return dev_server_impl_1.executeDevServerBuilder; } });
|
|
15
|
+
Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return dev_server_impl_1.executeDevServerBuilder; } });
|
package/executors.json
CHANGED
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"schema": "./src/builders/webpack-browser/schema.json",
|
|
28
28
|
"description": "The `webpack-browser` executor is very similar to the standard `browser` builder provided by the Angular Devkit. It allows you to build your Angular application to a build artifact that can be hosted online. There are some key differences: \n- Supports Custom Webpack Configurations \n- Supports Incremental Building"
|
|
29
29
|
},
|
|
30
|
-
"
|
|
31
|
-
"implementation": "./src/builders/
|
|
32
|
-
"schema": "./src/builders/
|
|
33
|
-
"description": "The `
|
|
30
|
+
"dev-server": {
|
|
31
|
+
"implementation": "./src/builders/dev-server/dev-server.impl",
|
|
32
|
+
"schema": "./src/builders/dev-server/schema.json",
|
|
33
|
+
"description": "The `dev-server` executor is very similar to the standard `dev-server` builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration."
|
|
34
34
|
},
|
|
35
35
|
"webpack-server": {
|
|
36
36
|
"implementation": "./src/builders/webpack-server/webpack-server.impl",
|
package/migrations.json
CHANGED
|
@@ -323,6 +323,12 @@
|
|
|
323
323
|
},
|
|
324
324
|
"description": "Replace the deep imports from 'zone.js/dist/zone' and 'zone.js/dist/zone-testing' with 'zone.js' and 'zone.js/testing'.",
|
|
325
325
|
"factory": "./src/migrations/update-17-1-0/update-zone-js-deep-import"
|
|
326
|
+
},
|
|
327
|
+
"rename-webpack-dev-server-executor": {
|
|
328
|
+
"cli": "nx",
|
|
329
|
+
"version": "17.2.0-beta.2",
|
|
330
|
+
"description": "Rename '@nx/angular:webpack-dev-server' executor to '@nx/angular:dev-server'",
|
|
331
|
+
"factory": "./src/migrations/update-17-2-0/rename-webpack-dev-server"
|
|
326
332
|
}
|
|
327
333
|
},
|
|
328
334
|
"packageJsonUpdates": {
|
|
@@ -1505,6 +1511,18 @@
|
|
|
1505
1511
|
"alwaysAddToPackageJson": false
|
|
1506
1512
|
}
|
|
1507
1513
|
}
|
|
1514
|
+
},
|
|
1515
|
+
"17.2.0-ngrx": {
|
|
1516
|
+
"version": "17.2.0-beta.3",
|
|
1517
|
+
"requires": {
|
|
1518
|
+
"@angular/core": "^17.0.0"
|
|
1519
|
+
},
|
|
1520
|
+
"packages": {
|
|
1521
|
+
"@ngrx/store": {
|
|
1522
|
+
"version": "~17.0.0",
|
|
1523
|
+
"alwaysAddToPackageJson": false
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1508
1526
|
}
|
|
1509
1527
|
}
|
|
1510
1528
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "17.2.0-beta.
|
|
3
|
+
"version": "17.2.0-beta.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
"tslib": "^2.3.0",
|
|
79
79
|
"webpack": "^5.80.0",
|
|
80
80
|
"webpack-merge": "^5.8.0",
|
|
81
|
-
"@nx/devkit": "17.2.0-beta.
|
|
82
|
-
"@nx/cypress": "17.2.0-beta.
|
|
83
|
-
"@nx/jest": "17.2.0-beta.
|
|
84
|
-
"@nx/js": "17.2.0-beta.
|
|
85
|
-
"@nx/eslint": "17.2.0-beta.
|
|
86
|
-
"@nx/webpack": "17.2.0-beta.
|
|
87
|
-
"@nx/web": "17.2.0-beta.
|
|
88
|
-
"@nx/workspace": "17.2.0-beta.
|
|
89
|
-
"@nrwl/angular": "17.2.0-beta.
|
|
81
|
+
"@nx/devkit": "17.2.0-beta.10",
|
|
82
|
+
"@nx/cypress": "17.2.0-beta.10",
|
|
83
|
+
"@nx/jest": "17.2.0-beta.10",
|
|
84
|
+
"@nx/js": "17.2.0-beta.10",
|
|
85
|
+
"@nx/eslint": "17.2.0-beta.10",
|
|
86
|
+
"@nx/webpack": "17.2.0-beta.10",
|
|
87
|
+
"@nx/web": "17.2.0-beta.10",
|
|
88
|
+
"@nx/workspace": "17.2.0-beta.10",
|
|
89
|
+
"@nrwl/angular": "17.2.0-beta.10"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
|
|
@@ -225,7 +225,7 @@ function withSchemaDefaults(options) {
|
|
|
225
225
|
options.outputHashing ??= 'none';
|
|
226
226
|
options.progress ??= true;
|
|
227
227
|
options.scripts ??= [];
|
|
228
|
-
options.main
|
|
228
|
+
options.main ??= options.browser;
|
|
229
229
|
return options;
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Schema } from './schema';
|
|
2
|
+
export declare function executeDevServerBuilder(rawOptions: Schema, context: import('@angular-devkit/architect').BuilderContext): import("rxjs").Observable<import("@angular-devkit/build-angular").DevServerBuilderOutput>;
|
|
3
|
+
declare const _default: any;
|
|
4
|
+
export default _default;
|
package/src/builders/{webpack-dev-server/webpack-dev-server.impl.js → dev-server/dev-server.impl.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.executeDevServerBuilder = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
6
|
const webpack_nx_build_coordination_plugin_1 = require("@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin");
|
|
@@ -9,11 +9,12 @@ const operators_1 = require("nx/src/project-graph/operators");
|
|
|
9
9
|
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
10
10
|
const rxjs_1 = require("rxjs");
|
|
11
11
|
const operators_2 = require("rxjs/operators");
|
|
12
|
+
const semver_1 = require("semver");
|
|
12
13
|
const angular_version_utils_1 = require("../../executors/utilities/angular-version-utils");
|
|
13
14
|
const buildable_libs_1 = require("../utilities/buildable-libs");
|
|
14
15
|
const webpack_1 = require("../utilities/webpack");
|
|
15
16
|
const lib_1 = require("./lib");
|
|
16
|
-
function
|
|
17
|
+
function executeDevServerBuilder(rawOptions, context) {
|
|
17
18
|
process.env.NX_TSCONFIG_PATH = (0, js_1.getRootTsConfigPath)();
|
|
18
19
|
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
19
20
|
const parsedBuildTarget = (0, devkit_1.parseTargetString)(options.buildTarget, {
|
|
@@ -74,28 +75,35 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
|
74
75
|
// webpack-server implementation.
|
|
75
76
|
buildTargetOptions.tsConfig = tsConfigPath;
|
|
76
77
|
}
|
|
77
|
-
const delegateBuilderOptions = getDelegateBuilderOptions(options);
|
|
78
|
+
const delegateBuilderOptions = getDelegateBuilderOptions(options, buildTarget, context);
|
|
79
|
+
const isUsingWebpackBuilder = ![
|
|
80
|
+
'@angular-devkit/build-angular:application',
|
|
81
|
+
'@angular-devkit/build-angular:browser-esbuild',
|
|
82
|
+
'@nx/angular:browser-esbuild',
|
|
83
|
+
].includes(buildTarget.executor);
|
|
78
84
|
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeDevServerBuilder }) => executeDevServerBuilder(delegateBuilderOptions, context, {
|
|
79
|
-
webpackConfiguration:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
webpackConfiguration: isUsingWebpackBuilder
|
|
86
|
+
? async (baseWebpackConfig) => {
|
|
87
|
+
if (!buildLibsFromSource) {
|
|
88
|
+
const workspaceDependencies = dependencies
|
|
89
|
+
.filter((dep) => !(0, operators_1.isNpmProject)(dep.node))
|
|
90
|
+
.map((dep) => dep.node.name);
|
|
91
|
+
// default for `nx run-many` is --all projects
|
|
92
|
+
// by passing an empty string for --projects, run-many will default to
|
|
93
|
+
// run the target for all projects.
|
|
94
|
+
// This will occur when workspaceDependencies = []
|
|
95
|
+
if (workspaceDependencies.length > 0) {
|
|
96
|
+
baseWebpackConfig.plugins.push(
|
|
97
|
+
// @ts-expect-error - difference between angular and webpack plugin definitions bc of webpack versions
|
|
98
|
+
new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${parsedBuildTarget.target} --projects=${workspaceDependencies.join(',')}`));
|
|
99
|
+
}
|
|
92
100
|
}
|
|
101
|
+
if (!pathToWebpackConfig) {
|
|
102
|
+
return baseWebpackConfig;
|
|
103
|
+
}
|
|
104
|
+
return (0, webpack_1.mergeCustomWebpackConfig)(baseWebpackConfig, pathToWebpackConfig, buildTargetOptions, context.target);
|
|
93
105
|
}
|
|
94
|
-
|
|
95
|
-
return baseWebpackConfig;
|
|
96
|
-
}
|
|
97
|
-
return (0, webpack_1.mergeCustomWebpackConfig)(baseWebpackConfig, pathToWebpackConfig, buildTargetOptions, context.target);
|
|
98
|
-
},
|
|
106
|
+
: undefined,
|
|
99
107
|
...(pathToIndexFileTransformer
|
|
100
108
|
? {
|
|
101
109
|
indexHtml: (0, webpack_1.resolveIndexHtmlTransformer)(pathToIndexFileTransformer, buildTargetOptions.tsConfig, context.target),
|
|
@@ -103,12 +111,26 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
|
103
111
|
: {}),
|
|
104
112
|
})));
|
|
105
113
|
}
|
|
106
|
-
exports.
|
|
107
|
-
exports.default = require('@angular-devkit/architect').createBuilder(
|
|
108
|
-
function getDelegateBuilderOptions(options) {
|
|
114
|
+
exports.executeDevServerBuilder = executeDevServerBuilder;
|
|
115
|
+
exports.default = require('@angular-devkit/architect').createBuilder(executeDevServerBuilder);
|
|
116
|
+
function getDelegateBuilderOptions(options, buildTarget, context) {
|
|
109
117
|
const delegatedBuilderOptions = { ...options };
|
|
110
|
-
const { major } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
111
|
-
|
|
118
|
+
const { major: angularMajorVersion, version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
119
|
+
// this option was introduced in angular 16.1.0
|
|
120
|
+
// https://github.com/angular/angular-cli/commit/3ede1a2cac5005f4dfbd2a62ef528a34c3793b78
|
|
121
|
+
if ((0, semver_1.gte)(angularVersion, '16.1.0') &&
|
|
122
|
+
buildTarget.executor === '@nx/angular:browser-esbuild') {
|
|
123
|
+
delegatedBuilderOptions.forceEsbuild = true;
|
|
124
|
+
const originalLoggerWarn = context.logger.warn.bind(context.logger);
|
|
125
|
+
context.logger.warn = (...args) => {
|
|
126
|
+
// we silence the warning about forcing esbuild from third-party builders
|
|
127
|
+
if (args[0].includes('Warning: Forcing the use of the esbuild-based build system with third-party builders may cause unexpected behavior and/or build failures.')) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
originalLoggerWarn(...args);
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (angularMajorVersion <= 17) {
|
|
112
134
|
delegatedBuilderOptions.browserTarget = delegatedBuilderOptions.buildTarget;
|
|
113
135
|
delete delegatedBuilderOptions.buildTarget;
|
|
114
136
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"outputCapture": "direct-nodejs",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
5
5
|
"title": "Schema for Webpack Dev Server",
|
|
6
|
-
"description": "The
|
|
7
|
-
"examplesFile": "../../../docs/
|
|
6
|
+
"description": "The dev-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nx/angular:webpack-browser` when your Angular application uses a custom webpack configuration.",
|
|
7
|
+
"examplesFile": "../../../docs/dev-server-examples.md",
|
|
8
8
|
"type": "object",
|
|
9
9
|
"presets": [
|
|
10
10
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Schema } from './schema';
|
|
2
|
-
import {
|
|
3
|
-
export declare function executeModuleFederationDevServerBuilder(schema: Schema, context: import('@angular-devkit/architect').BuilderContext): ReturnType<typeof
|
|
2
|
+
import { executeDevServerBuilder } from '../dev-server/dev-server.impl';
|
|
3
|
+
export declare function executeModuleFederationDevServerBuilder(schema: Schema, context: import('@angular-devkit/architect').BuilderContext): ReturnType<typeof executeDevServerBuilder | any>;
|
|
4
4
|
declare const _default: any;
|
|
5
5
|
export default _default;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeModuleFederationDevServerBuilder = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
6
|
-
const
|
|
6
|
+
const dev_server_impl_1 = require("../dev-server/dev-server.impl");
|
|
7
7
|
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
8
8
|
const executor_utils_1 = require("nx/src/command-line/run/executor-utils");
|
|
9
9
|
const module_federation_1 = require("../utilities/module-federation");
|
|
@@ -14,6 +14,9 @@ const child_process_1 = require("child_process");
|
|
|
14
14
|
const rxjs_1 = require("rxjs");
|
|
15
15
|
const fs_2 = require("fs");
|
|
16
16
|
function buildStaticRemotes(remotes, nxBin, context, options) {
|
|
17
|
+
if (!remotes.staticRemotes.length) {
|
|
18
|
+
return Promise.resolve();
|
|
19
|
+
}
|
|
17
20
|
const mappedLocationOfRemotes = {};
|
|
18
21
|
for (const app of remotes.staticRemotes) {
|
|
19
22
|
mappedLocationOfRemotes[app] = `http${options.ssl ? 's' : ''}://${options.host}:${options.staticRemotesPort}/${app}`;
|
|
@@ -62,7 +65,8 @@ function startStaticRemotesFileServer(remotes, projectGraph, options, context) {
|
|
|
62
65
|
if (!commonOutputDirectory) {
|
|
63
66
|
commonOutputDirectory = directoryOfOutputPath;
|
|
64
67
|
}
|
|
65
|
-
else if (commonOutputDirectory !== directoryOfOutputPath
|
|
68
|
+
else if (commonOutputDirectory !== directoryOfOutputPath ||
|
|
69
|
+
!outputPath.endsWith(app)) {
|
|
66
70
|
shouldMoveToCommonLocation = true;
|
|
67
71
|
}
|
|
68
72
|
}
|
|
@@ -70,8 +74,7 @@ function startStaticRemotesFileServer(remotes, projectGraph, options, context) {
|
|
|
70
74
|
commonOutputDirectory = (0, path_1.join)(devkit_1.workspaceRoot, 'tmp/static-remotes');
|
|
71
75
|
for (const app of remotes.staticRemotes) {
|
|
72
76
|
const outputPath = projectGraph.nodes[app].data.targets['build'].options.outputPath;
|
|
73
|
-
|
|
74
|
-
(0, fs_2.cpSync)(outputPath, (0, path_1.join)(commonOutputDirectory, outputPathParts[outputPathParts.length - 1]), {
|
|
77
|
+
(0, fs_2.cpSync)(outputPath, (0, path_1.join)(commonOutputDirectory, app), {
|
|
75
78
|
force: true,
|
|
76
79
|
recursive: true,
|
|
77
80
|
});
|
|
@@ -167,7 +170,7 @@ function executeModuleFederationDevServerBuilder(schema, context) {
|
|
|
167
170
|
projectsConfigurations: { projects: workspaceProjects, version: 2 },
|
|
168
171
|
nxJsonConfiguration: (0, devkit_1.readNxJson)(),
|
|
169
172
|
})));
|
|
170
|
-
const webpackDevServer = (0,
|
|
173
|
+
const webpackDevServer = (0, dev_server_impl_1.executeDevServerBuilder)(options, context);
|
|
171
174
|
const currExecutor = options.static ? staticFileServer : webpackDevServer;
|
|
172
175
|
if (options.isInitialHost === false) {
|
|
173
176
|
return currExecutor;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"outputCapture": "direct-nodejs",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
5
5
|
"title": "Schema for Webpack Server",
|
|
6
|
-
"description": "The webpack-
|
|
6
|
+
"description": "The webpack-server executor is very similar to the standard server builder provided by the Angular Devkit. It is usually used in tandem with `@nx/angular:webpack-browser` when your Angular application uses a custom webpack configuration and NgUniversal for SSR.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"assets": {
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addLintingGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const eslint_1 = require("@nx/eslint");
|
|
6
|
-
const lint_project_1 = require("@nx/eslint/src/generators/lint-project/lint-project");
|
|
7
6
|
const add_angular_eslint_dependencies_1 = require("./lib/add-angular-eslint-dependencies");
|
|
8
7
|
const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
|
|
9
8
|
const string_utils_1 = require("@nx/devkit/src/utils/string-utils");
|
|
@@ -17,10 +16,6 @@ async function addLintingGenerator(tree, options) {
|
|
|
17
16
|
(0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.app.json'),
|
|
18
17
|
],
|
|
19
18
|
unitTestRunner: options.unitTestRunner,
|
|
20
|
-
eslintFilePatterns: [
|
|
21
|
-
(0, lint_project_1.mapLintPattern)(options.projectRoot, 'ts', rootProject),
|
|
22
|
-
(0, lint_project_1.mapLintPattern)(options.projectRoot, 'html', rootProject),
|
|
23
|
-
],
|
|
24
19
|
setParserOptionsProject: options.setParserOptionsProject,
|
|
25
20
|
skipFormat: true,
|
|
26
21
|
rootProject: rootProject,
|
|
@@ -4,5 +4,4 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./add-files"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./add-path-mapping"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./update-linting-file-patterns"), exports);
|
|
8
7
|
tslib_1.__exportStar(require("./update-tsconfig-included-files"), exports);
|
|
@@ -8,7 +8,6 @@ async function librarySecondaryEntryPointGenerator(tree, rawOptions) {
|
|
|
8
8
|
(0, lib_1.addFiles)(tree, options);
|
|
9
9
|
(0, lib_1.addPathMapping)(tree, options);
|
|
10
10
|
(0, lib_1.updateTsConfigIncludedFiles)(tree, options);
|
|
11
|
-
(0, lib_1.updateLintingFilePatterns)(tree, options);
|
|
12
11
|
await (0, devkit_1.formatFiles)(tree);
|
|
13
12
|
}
|
|
14
13
|
exports.librarySecondaryEntryPointGenerator = librarySecondaryEntryPointGenerator;
|
|
@@ -217,7 +217,6 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
217
217
|
await (0, eslint_1.lintProjectGenerator)(this.tree, {
|
|
218
218
|
project: this.project.name,
|
|
219
219
|
linter: eslint_1.Linter.EsLint,
|
|
220
|
-
eslintFilePatterns: [`${this.project.newRoot}/**/*.{js,ts}`],
|
|
221
220
|
unitTestRunner: this.options.unitTestRunner,
|
|
222
221
|
tsConfigPaths: [
|
|
223
222
|
(0, devkit_1.joinPathFragments)(this.project.newRoot, 'tsconfig.json'),
|
|
@@ -242,6 +241,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
242
241
|
skipFormat: true,
|
|
243
242
|
// any target would do, we replace it later with the target existing in the project being migrated
|
|
244
243
|
devServerTarget: `${this.appName}:serve`,
|
|
244
|
+
baseUrl: 'http://localhost:4200',
|
|
245
245
|
});
|
|
246
246
|
const cypressConfigFilePath = this.updateOrCreateCypressConfigFile(oldCypressConfigFilePath);
|
|
247
247
|
this.updateCypressProjectConfiguration(cypressConfigFilePath);
|
|
@@ -8,7 +8,7 @@ function setupServeTarget(host, options) {
|
|
|
8
8
|
...appConfig.targets['serve'],
|
|
9
9
|
executor: options.mfType === 'host'
|
|
10
10
|
? '@nx/angular:module-federation-dev-server'
|
|
11
|
-
: '@nx/angular:
|
|
11
|
+
: '@nx/angular:dev-server',
|
|
12
12
|
options: {
|
|
13
13
|
...appConfig.targets['serve'].options,
|
|
14
14
|
port: options.port ?? undefined,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
async function default_1(tree) {
|
|
5
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
6
|
+
for (const [, project] of projects) {
|
|
7
|
+
if (project.projectType !== 'application') {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
for (const target of Object.values(project.targets ?? {})) {
|
|
11
|
+
if (target.executor === '@nx/angular:webpack-dev-server' ||
|
|
12
|
+
target.executor === '@nrwl/angular:webpack-dev-server') {
|
|
13
|
+
target.executor = '@nx/angular:dev-server';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
(0, devkit_1.updateProjectConfiguration)(tree, project.name, project);
|
|
17
|
+
}
|
|
18
|
+
// update options from nx.json target defaults
|
|
19
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
20
|
+
if (!nxJson.targetDefaults) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
for (const [targetOrExecutor, targetConfig] of Object.entries(nxJson.targetDefaults)) {
|
|
24
|
+
if (targetOrExecutor === '@nx/angular:webpack-dev-server') {
|
|
25
|
+
nxJson.targetDefaults['@nx/angular:dev-server'] = targetConfig;
|
|
26
|
+
delete nxJson.targetDefaults['@nx/angular:webpack-dev-server'];
|
|
27
|
+
}
|
|
28
|
+
else if (targetOrExecutor === '@nrwl/angular:webpack-dev-server') {
|
|
29
|
+
nxJson.targetDefaults['@nx/angular:dev-server'] = targetConfig;
|
|
30
|
+
delete nxJson.targetDefaults['@nrwl/angular:webpack-dev-server'];
|
|
31
|
+
}
|
|
32
|
+
else if (targetConfig.executor === '@nx/angular:webpack-dev-server' ||
|
|
33
|
+
targetConfig.executor === '@nrwl/angular:webpack-dev-server') {
|
|
34
|
+
targetConfig.executor = '@nx/angular:dev-server';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
38
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
39
|
+
}
|
|
40
|
+
exports.default = default_1;
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const nxVersion: any;
|
|
|
2
2
|
export declare const angularVersion = "~17.0.0";
|
|
3
3
|
export declare const angularDevkitVersion = "~17.0.0";
|
|
4
4
|
export declare const ngPackagrVersion = "~17.0.0";
|
|
5
|
-
export declare const ngrxVersion = "~
|
|
5
|
+
export declare const ngrxVersion = "~17.0.0";
|
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
7
7
|
export declare const zoneJsVersion = "~0.14.0";
|
|
8
8
|
export declare const angularJsVersion = "1.7.9";
|
package/src/utils/versions.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.nxVersion = require('../../package.json').version;
|
|
|
5
5
|
exports.angularVersion = '~17.0.0';
|
|
6
6
|
exports.angularDevkitVersion = '~17.0.0';
|
|
7
7
|
exports.ngPackagrVersion = '~17.0.0';
|
|
8
|
-
exports.ngrxVersion = '~
|
|
8
|
+
exports.ngrxVersion = '~17.0.0';
|
|
9
9
|
exports.rxjsVersion = '~7.8.0';
|
|
10
10
|
exports.zoneJsVersion = '~0.14.0';
|
|
11
11
|
exports.angularJsVersion = '1.7.9';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Schema } from './schema';
|
|
2
|
-
export declare function executeWebpackDevServerBuilder(rawOptions: Schema, context: import('@angular-devkit/architect').BuilderContext): import("rxjs").Observable<import("@angular-devkit/build-angular").DevServerBuilderOutput>;
|
|
3
|
-
declare const _default: any;
|
|
4
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateLintingFilePatterns = void 0;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
function updateLintingFilePatterns(tree, options) {
|
|
6
|
-
const { libraryProject } = options;
|
|
7
|
-
if (libraryProject.targets?.lint?.options?.lintFilePatterns) {
|
|
8
|
-
libraryProject.targets.lint.options.lintFilePatterns.push(...[
|
|
9
|
-
`${libraryProject.root}/${options.name}/**/*.ts`,
|
|
10
|
-
`${libraryProject.root}/${options.name}/**/*.html`,
|
|
11
|
-
]);
|
|
12
|
-
(0, devkit_1.updateProjectConfiguration)(tree, options.library, libraryProject);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.updateLintingFilePatterns = updateLintingFilePatterns;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|