@nrwl/angular 14.3.4-beta.4 → 14.3.6
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/CHANGELOG.md +1 -1
- package/migrations.json +4 -0
- package/package.json +9 -8
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -1
- package/src/builders/webpack-server/schema.d.ts +1 -0
- package/src/builders/webpack-server/schema.json +4 -0
- package/src/builders/webpack-server/webpack-server.impl.d.ts +3 -2
- package/src/builders/webpack-server/webpack-server.impl.js +58 -30
- package/src/builders/webpack-server/webpack-server.impl.js.map +1 -1
- package/src/generators/application/lib/nrwl-home-tpl.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [14.3.
|
|
6
|
+
## [14.3.6](https://github.com/nrwl/nx/compare/14.3.5...14.3.6) (2022-06-16)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/angular
|
package/migrations.json
CHANGED
|
@@ -1148,6 +1148,10 @@
|
|
|
1148
1148
|
"version": "~14.0.0",
|
|
1149
1149
|
"alwaysAddToPackageJson": false
|
|
1150
1150
|
},
|
|
1151
|
+
"@schematics/angular": {
|
|
1152
|
+
"version": "~14.0.0",
|
|
1153
|
+
"alwaysAddToPackageJson": false
|
|
1154
|
+
},
|
|
1151
1155
|
"@angular/core": {
|
|
1152
1156
|
"version": "~14.0.0",
|
|
1153
1157
|
"alwaysAddToPackageJson": true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/angular",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.6",
|
|
4
4
|
"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, Cypress, Karma, and Protractor. \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.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -65,12 +65,13 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@angular-devkit/schematics": "~14.0.0",
|
|
68
|
-
"@nrwl/cypress": "14.3.
|
|
69
|
-
"@nrwl/devkit": "14.3.
|
|
70
|
-
"@nrwl/jest": "14.3.
|
|
71
|
-
"@nrwl/linter": "14.3.
|
|
72
|
-
"@nrwl/storybook": "14.3.
|
|
73
|
-
"@nrwl/
|
|
68
|
+
"@nrwl/cypress": "14.3.6",
|
|
69
|
+
"@nrwl/devkit": "14.3.6",
|
|
70
|
+
"@nrwl/jest": "14.3.6",
|
|
71
|
+
"@nrwl/linter": "14.3.6",
|
|
72
|
+
"@nrwl/storybook": "14.3.6",
|
|
73
|
+
"@nrwl/web": "14.3.6",
|
|
74
|
+
"@nrwl/workspace": "14.3.6",
|
|
74
75
|
"@phenomnomnominal/tsquery": "4.1.1",
|
|
75
76
|
"@schematics/angular": "~14.0.0",
|
|
76
77
|
"chalk": "4.1.0",
|
|
@@ -93,5 +94,5 @@
|
|
|
93
94
|
"fesm2015": "fesm2015/nrwl-angular.mjs",
|
|
94
95
|
"typings": "index.d.ts",
|
|
95
96
|
"sideEffects": false,
|
|
96
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "cc2a1d55bb3dd51e655cc8da7af4e633d24b40a3"
|
|
97
98
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Schema } from './schema';
|
|
2
2
|
import { BuilderContext } from '@angular-devkit/architect';
|
|
3
3
|
import { JsonObject } from '@angular-devkit/core';
|
|
4
|
-
export declare function executeModuleFederationDevServerBuilder(schema: Schema, context: BuilderContext): import("rxjs").Observable<import("@angular-devkit/
|
|
4
|
+
export declare function executeModuleFederationDevServerBuilder(schema: Schema, context: BuilderContext): import("rxjs").Observable<import("@angular-devkit/architect").BuilderOutput>;
|
|
5
5
|
declare const _default: import("@angular-devkit/architect/src/internal").Builder<JsonObject & Schema>;
|
|
6
6
|
export default _default;
|
|
@@ -102,6 +102,10 @@
|
|
|
102
102
|
"poll": {
|
|
103
103
|
"type": "number",
|
|
104
104
|
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
105
|
+
},
|
|
106
|
+
"buildLibsFromSource": {
|
|
107
|
+
"type": "boolean",
|
|
108
|
+
"description": "Read buildable libraries from source instead of building them separately. If not set, it will take the value specified in the `browserTarget` options, or it will default to `true` if it's also not set in the `browserTarget` options."
|
|
105
109
|
}
|
|
106
110
|
},
|
|
107
111
|
"additionalProperties": false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BuilderContext } from '@angular-devkit/architect';
|
|
1
|
+
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
import type { Schema } from './schema';
|
|
3
|
-
export declare function executeWebpackServerBuilder(
|
|
4
|
+
export declare function executeWebpackServerBuilder(rawOptions: Schema, context: BuilderContext): Observable<BuilderOutput>;
|
|
4
5
|
declare const _default: any;
|
|
5
6
|
export default _default;
|
|
@@ -3,51 +3,79 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeWebpackServerBuilder = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const architect_1 = require("@angular-devkit/architect");
|
|
6
|
-
const
|
|
6
|
+
const build_angular_1 = require("@angular-devkit/build-angular");
|
|
7
7
|
const devkit_1 = require("@nrwl/devkit");
|
|
8
|
+
const webpack_nx_build_coordination_plugin_1 = require("@nrwl/web/src/plugins/webpack-nx-build-coordination-plugin");
|
|
9
|
+
const buildable_libs_utils_1 = require("@nrwl/workspace/src/utilities/buildable-libs-utils");
|
|
8
10
|
const fs_1 = require("fs");
|
|
11
|
+
const operators_1 = require("nx/src/project-graph/operators");
|
|
9
12
|
const webpack_merge_1 = require("webpack-merge");
|
|
10
13
|
const webpack_1 = require("../utilities/webpack");
|
|
11
14
|
const lib_1 = require("./lib");
|
|
12
|
-
function executeWebpackServerBuilder(
|
|
13
|
-
var _a;
|
|
14
|
-
|
|
15
|
-
const options = (0, lib_1.normalizeOptions)(schema);
|
|
15
|
+
function executeWebpackServerBuilder(rawOptions, context) {
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
|
+
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
16
18
|
const workspaceConfig = (0, devkit_1.readAllWorkspaceConfiguration)();
|
|
17
19
|
const parsedBrowserTarget = (0, devkit_1.parseTargetString)(options.browserTarget);
|
|
18
20
|
const buildTarget = workspaceConfig.projects[parsedBrowserTarget.project].targets[parsedBrowserTarget.target];
|
|
19
|
-
const
|
|
21
|
+
const buildTargetConfiguration = parsedBrowserTarget.configuration
|
|
20
22
|
? buildTarget.configurations[parsedBrowserTarget.configuration]
|
|
21
23
|
: buildTarget.defaultConfiguration
|
|
22
24
|
? buildTarget.configurations[buildTarget.defaultConfiguration]
|
|
23
|
-
:
|
|
24
|
-
const
|
|
25
|
+
: undefined;
|
|
26
|
+
const buildLibsFromSource = (_c = (_b = (_a = options.buildLibsFromSource) !== null && _a !== void 0 ? _a : buildTargetConfiguration === null || buildTargetConfiguration === void 0 ? void 0 : buildTargetConfiguration.buildLibsFromSource) !== null && _b !== void 0 ? _b : buildTarget.options.buildLibsFromSource) !== null && _c !== void 0 ? _c : true;
|
|
27
|
+
const customWebpackConfig = (_d = buildTargetConfiguration === null || buildTargetConfiguration === void 0 ? void 0 : buildTargetConfiguration.customWebpackConfig) !== null && _d !== void 0 ? _d : buildTarget.options.customWebpackConfig;
|
|
28
|
+
let pathToWebpackConfig;
|
|
25
29
|
if (customWebpackConfig && customWebpackConfig.path) {
|
|
26
|
-
|
|
27
|
-
if ((0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
28
|
-
return (0, dev_server_1.serveWebpackBrowser)(options, context, {
|
|
29
|
-
webpackConfiguration: (baseWebpackConfig) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const customWebpackConfiguration = (0, webpack_1.resolveCustomWebpackConfig)(pathToWebpackConfig, buildTarget.options.tsConfig);
|
|
31
|
-
// The extra Webpack configuration file can also export a Promise, for instance:
|
|
32
|
-
// `module.exports = new Promise(...)`. If it exports a single object, but not a Promise,
|
|
33
|
-
// then await will just resolve that object.
|
|
34
|
-
const config = yield customWebpackConfiguration;
|
|
35
|
-
// The extra Webpack configuration file can export a synchronous or asynchronous function,
|
|
36
|
-
// for instance: `module.exports = async config => { ... }`.
|
|
37
|
-
if (typeof config === 'function') {
|
|
38
|
-
return config(baseWebpackConfig, selectedConfiguration, context.target);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
return (0, webpack_merge_1.merge)(baseWebpackConfig, config);
|
|
42
|
-
}
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
30
|
+
pathToWebpackConfig = (0, devkit_1.joinPathFragments)(context.workspaceRoot, customWebpackConfig.path);
|
|
31
|
+
if (!(0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
47
32
|
throw new Error(`Custom Webpack Config File Not Found!\nTo use a custom webpack config, please ensure the path to the custom webpack file is correct: \n${pathToWebpackConfig}`);
|
|
48
33
|
}
|
|
49
34
|
}
|
|
50
|
-
|
|
35
|
+
let dependencies;
|
|
36
|
+
if (!buildLibsFromSource) {
|
|
37
|
+
const buildTargetTsConfigPath = (_e = buildTargetConfiguration === null || buildTargetConfiguration === void 0 ? void 0 : buildTargetConfiguration.tsConfig) !== null && _e !== void 0 ? _e : buildTarget.options.tsConfig;
|
|
38
|
+
const result = (0, buildable_libs_utils_1.calculateProjectDependencies)((0, devkit_1.readCachedProjectGraph)(), context.workspaceRoot, context.target.project, parsedBrowserTarget.target, context.target.configuration);
|
|
39
|
+
dependencies = result.dependencies;
|
|
40
|
+
const updatedTsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)((0, devkit_1.joinPathFragments)(context.workspaceRoot, buildTargetTsConfigPath), context.workspaceRoot, result.target.data.root, dependencies);
|
|
41
|
+
process.env.NX_TSCONFIG_PATH = updatedTsConfig;
|
|
42
|
+
// We can't just pass the tsconfig path in memory to the angular builder
|
|
43
|
+
// function because we can't pass the build target options to it, the build
|
|
44
|
+
// targets options will be retrieved by the builder from the project
|
|
45
|
+
// configuration. Therefore, we patch the method in the context to retrieve
|
|
46
|
+
// the target options to overwrite the tsconfig path to use the generated
|
|
47
|
+
// one with the updated path mappings.
|
|
48
|
+
const originalGetTargetOptions = context.getTargetOptions;
|
|
49
|
+
context.getTargetOptions = (target) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const options = yield originalGetTargetOptions(target);
|
|
51
|
+
options.tsConfig = updatedTsConfig;
|
|
52
|
+
return options;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return (0, build_angular_1.executeDevServerBuilder)(options, context, {
|
|
56
|
+
webpackConfiguration: (baseWebpackConfig) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
if (!buildLibsFromSource) {
|
|
58
|
+
const workspaceDependencies = dependencies
|
|
59
|
+
.filter((dep) => !(0, operators_1.isNpmProject)(dep.node))
|
|
60
|
+
.map((dep) => dep.node.name);
|
|
61
|
+
baseWebpackConfig.plugins.push(new webpack_nx_build_coordination_plugin_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${parsedBrowserTarget.target} --projects=${workspaceDependencies.join(',')}`));
|
|
62
|
+
}
|
|
63
|
+
if (!pathToWebpackConfig) {
|
|
64
|
+
return baseWebpackConfig;
|
|
65
|
+
}
|
|
66
|
+
const customWebpackConfiguration = (0, webpack_1.resolveCustomWebpackConfig)(pathToWebpackConfig, buildTarget.options.tsConfig);
|
|
67
|
+
// The extra Webpack configuration file can also export a Promise, for instance:
|
|
68
|
+
// `module.exports = new Promise(...)`. If it exports a single object, but not a Promise,
|
|
69
|
+
// then await will just resolve that object.
|
|
70
|
+
const config = yield customWebpackConfiguration;
|
|
71
|
+
// The extra Webpack configuration file can export a synchronous or asynchronous function,
|
|
72
|
+
// for instance: `module.exports = async config => { ... }`.
|
|
73
|
+
if (typeof config === 'function') {
|
|
74
|
+
return config(baseWebpackConfig, buildTargetConfiguration, context.target);
|
|
75
|
+
}
|
|
76
|
+
return (0, webpack_merge_1.merge)(baseWebpackConfig, config);
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
51
79
|
}
|
|
52
80
|
exports.executeWebpackServerBuilder = executeWebpackServerBuilder;
|
|
53
81
|
exports.default = (0, architect_1.createBuilder)(executeWebpackServerBuilder);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-server/webpack-server.impl.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"webpack-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-server/webpack-server.impl.ts"],"names":[],"mappings":";;;;AAAA,yDAImC;AACnC,iEAGuC;AAEvC,yCAKsB;AACtB,qHAA8G;AAC9G,6FAI4D;AAC5D,2BAAgC;AAChC,8DAA8D;AAE9D,iDAAsC;AACtC,kDAAkE;AAClE,+BAAyC;AAGzC,SAAgB,2BAA2B,CACzC,UAAkB,EAClB,OAAuB;;IAEvB,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,UAAU,CAAC,CAAC;IAC7C,MAAM,eAAe,GAAG,IAAA,sCAA6B,GAAE,CAAC;IAExD,MAAM,mBAAmB,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACrE,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CAC5B,IAAI,uEAAgC,CAClC,wBACE,mBAAmB,CAAC,MACtB,eAAe,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CACjD,CACF,CAAC;aACH;YAED,IAAI,CAAC,mBAAmB,EAAE;gBACxB,OAAO,iBAAiB,CAAC;aAC1B;YAED,MAAM,0BAA0B,GAAG,IAAA,oCAA0B,EAC3D,mBAAmB,EACnB,WAAW,CAAC,OAAO,CAAC,QAAQ,CAC7B,CAAC;YACF,gFAAgF;YAChF,yFAAyF;YACzF,4CAA4C;YAC5C,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC;YAEhD,0FAA0F;YAC1F,4DAA4D;YAC5D,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;gBAChC,OAAO,MAAM,CACX,iBAAiB,EACjB,wBAAwB,EACxB,OAAO,CAAC,MAAM,CACf,CAAC;aACH;YAED,OAAO,IAAA,qBAAK,EAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QAC1C,CAAC,CAAA;KACF,CAAC,CAAC;AACL,CAAC;AAtHD,kEAsHC;AAED,kBAAe,IAAA,yBAAa,EAC1B,2BAA2B,CACrB,CAAC"}
|
|
@@ -569,7 +569,7 @@ exports.nrwlHomeTemplate = {
|
|
|
569
569
|
/>
|
|
570
570
|
</svg>
|
|
571
571
|
</a>
|
|
572
|
-
<a href="https://nx.dev/tutorial/01-create-application?utm_source=nx-project" target="_blank" rel="noreferrer" class="list-item-link">
|
|
572
|
+
<a href="https://nx.dev/angular-tutorial/01-create-application?utm_source=nx-project" target="_blank" rel="noreferrer" class="list-item-link">
|
|
573
573
|
<svg
|
|
574
574
|
fill="none"
|
|
575
575
|
stroke="currentColor"
|