@nx/angular 16.8.0-beta.4 → 16.8.0-beta.5
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/mf/mf.js +31 -36
- package/package.json +10 -10
- package/plugins/component-testing.js +48 -40
- package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +4 -6
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +4 -6
- package/src/builders/utilities/buildable-libs.js +1 -2
- package/src/builders/utilities/module-federation.js +2 -3
- package/src/builders/utilities/webpack.js +16 -21
- package/src/builders/webpack-browser/webpack-browser.impl.js +13 -13
- package/src/builders/webpack-dev-server/lib/normalize-options.js +8 -1
- package/src/builders/webpack-dev-server/webpack-dev-server.impl.js +24 -18
- package/src/builders/webpack-server/webpack-server.impl.js +5 -7
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +19 -23
- package/src/executors/browser-esbuild/lib/buildable-libs.js +1 -2
- package/src/executors/delegate-build/delegate-build.impl.js +9 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +4 -7
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.js +4 -5
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.js +158 -156
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/options.di.js +6 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.js +118 -118
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/styles/stylesheet-processor.js +96 -103
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ts/cache-compiler-host.js +20 -12
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +18 -21
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +6 -9
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +6 -3
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +122 -122
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +96 -103
- package/src/executors/package/ng-packagr-adjustments/ts/cache-compiler-host.js +21 -13
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +5 -8
- package/src/executors/package/package.impl.js +33 -38
- package/src/executors/utilities/angular-version-utils.js +1 -1
- package/src/executors/utilities/tailwindcss.js +2 -2
- package/src/executors/utilities/typescript.js +23 -28
- package/src/generators/add-linting/add-linting.js +76 -74
- package/src/generators/add-linting/lib/create-eslint-configuration.js +12 -4
- package/src/generators/application/application.js +56 -55
- package/src/generators/application/lib/add-e2e.js +36 -40
- package/src/generators/application/lib/add-linting.js +12 -15
- package/src/generators/application/lib/add-proxy-config.js +4 -1
- package/src/generators/application/lib/add-unit-test-runner.js +15 -18
- package/src/generators/application/lib/create-files.js +44 -47
- package/src/generators/application/lib/enable-strict-type-checking.js +2 -2
- package/src/generators/application/lib/normalize-options.js +37 -25
- package/src/generators/application/lib/set-app-strict-default.js +1 -2
- package/src/generators/application/lib/update-editor-tsconfig.js +1 -2
- package/src/generators/component/component.js +40 -43
- package/src/generators/component/lib/normalize-options.js +15 -5
- package/src/generators/component-cypress-spec/component-cypress-spec.js +25 -28
- package/src/generators/component-story/component-story.js +19 -22
- package/src/generators/convert-to-with-mf/convert-to-with-mf.js +19 -22
- package/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +3 -4
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +103 -106
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +59 -62
- package/src/generators/directive/directive.js +21 -24
- package/src/generators/directive/lib/normalize-options.js +11 -5
- package/src/generators/host/host.js +77 -67
- package/src/generators/host/lib/add-ssr.js +32 -35
- package/src/generators/init/init.js +101 -92
- package/src/generators/library/lib/add-standalone-component.js +18 -13
- package/src/generators/library/lib/enable-strict-type-checking.js +17 -5
- package/src/generators/library/lib/normalize-options.js +68 -53
- package/src/generators/library/library.js +89 -92
- package/src/generators/library-secondary-entry-point/lib/add-files.js +5 -1
- package/src/generators/library-secondary-entry-point/lib/normalize-options.js +6 -3
- package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +1 -2
- package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +6 -9
- package/src/generators/move/lib/normalize-schema.js +5 -1
- package/src/generators/move/lib/update-module-name.js +1 -1
- package/src/generators/move/lib/update-ng-package.js +1 -2
- package/src/generators/move/lib/update-secondary-entry-points.js +1 -2
- package/src/generators/move/move.js +9 -12
- package/src/generators/ng-add/migrate-from-angular-cli.js +54 -53
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +4 -3
- package/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.js +11 -12
- package/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +39 -42
- package/src/generators/ng-add/migrators/builders/builder.migrator.js +1 -2
- package/src/generators/ng-add/migrators/migrator.js +7 -11
- package/src/generators/ng-add/migrators/projects/app.migrator.js +39 -43
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +115 -91
- package/src/generators/ng-add/migrators/projects/lib.migrator.js +23 -31
- package/src/generators/ng-add/migrators/projects/project.migrator.js +10 -14
- package/src/generators/ng-add/ng-add.js +5 -8
- package/src/generators/ng-add/utilities/dependencies.js +2 -3
- package/src/generators/ng-add/utilities/format-files-task.js +1 -1
- package/src/generators/ng-add/utilities/projects.js +1 -1
- package/src/generators/ng-add/utilities/workspace.js +25 -36
- package/src/generators/ngrx/lib/add-imports-to-module.js +1 -2
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +1 -3
- package/src/generators/ngrx/lib/generate-files.js +11 -2
- package/src/generators/ngrx/lib/normalize-options.js +9 -4
- package/src/generators/ngrx/lib/validate-options.js +3 -3
- package/src/generators/ngrx/ngrx.js +18 -21
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.actions.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.effects.spec.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.effects.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.facade.spec.ts__tmpl__ +6 -6
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.facade.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.reducer.spec.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.reducer.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.selectors.spec.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/files/base/__directory__/__fileName__.selectors.ts__tmpl__ +1 -1
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.effects.ts__tmpl__ +2 -2
- package/src/generators/ngrx-feature-store/files/no-inject/__directory__/__fileName__.facade.ts__tmpl__ +3 -3
- package/src/generators/ngrx-feature-store/lib/add-exports-barrel.js +4 -1
- package/src/generators/ngrx-feature-store/lib/add-imports.js +1 -1
- package/src/generators/ngrx-feature-store/lib/add-ngrx-to-package-json.js +1 -3
- package/src/generators/ngrx-feature-store/lib/generate-files.js +20 -4
- package/src/generators/ngrx-feature-store/lib/normalize-options.d.ts +1 -0
- package/src/generators/ngrx-feature-store/lib/normalize-options.js +22 -3
- package/src/generators/ngrx-feature-store/lib/validate-options.js +2 -2
- package/src/generators/ngrx-feature-store/ngrx-feature-store.js +18 -21
- package/src/generators/ngrx-root-store/lib/add-ngrx-to-package-json.js +8 -6
- package/src/generators/ngrx-root-store/lib/normalize-options.js +8 -4
- package/src/generators/ngrx-root-store/lib/validate-options.js +2 -2
- package/src/generators/ngrx-root-store/ngrx-root-store.js +27 -30
- package/src/generators/pipe/lib/normalize-options.js +9 -3
- package/src/generators/pipe/pipe.js +21 -24
- package/src/generators/remote/lib/add-ssr.js +46 -47
- package/src/generators/remote/lib/find-next-available-port.js +1 -2
- package/src/generators/remote/remote.js +52 -49
- package/src/generators/scam/lib/convert-component-to-scam.js +1 -2
- package/src/generators/scam/lib/normalize-options.js +11 -4
- package/src/generators/scam/scam.js +15 -12
- package/src/generators/scam-directive/lib/normalize-options.js +12 -4
- package/src/generators/scam-directive/scam-directive.js +13 -10
- package/src/generators/scam-pipe/lib/normalize-options.js +12 -4
- package/src/generators/scam-pipe/scam-pipe.js +13 -10
- package/src/generators/scam-to-standalone/scam-to-standalone.js +23 -26
- package/src/generators/setup-mf/lib/add-cypress-workaround.js +1 -1
- package/src/generators/setup-mf/lib/add-remote-to-host.js +4 -1
- package/src/generators/setup-mf/lib/change-build-target.js +10 -4
- package/src/generators/setup-mf/lib/generate-config.js +1 -1
- package/src/generators/setup-mf/lib/get-remotes-with-ports.js +1 -2
- package/src/generators/setup-mf/lib/normalize-options.js +5 -2
- package/src/generators/setup-mf/lib/set-tsconfig-target.js +7 -1
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +1 -2
- package/src/generators/setup-mf/lib/setup-serve-target.js +10 -3
- package/src/generators/setup-mf/setup-mf.js +32 -35
- package/src/generators/setup-ssr/lib/generate-files.js +8 -5
- package/src/generators/setup-ssr/lib/normalize-options.js +9 -10
- package/src/generators/setup-ssr/lib/update-project-config.js +21 -17
- package/src/generators/setup-ssr/setup-ssr.js +26 -27
- package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.js +6 -4
- package/src/generators/setup-tailwind/lib/detect-tailwind-installed-version.js +1 -2
- package/src/generators/setup-tailwind/lib/normalize-options.js +4 -1
- package/src/generators/setup-tailwind/lib/update-application-styles.js +5 -6
- package/src/generators/setup-tailwind/setup-tailwind.js +20 -23
- package/src/generators/stories/lib/get-e2e-project.js +1 -1
- package/src/generators/stories/stories.js +43 -50
- package/src/generators/storybook-configuration/lib/assert-compatible-storybook-version.js +1 -1
- package/src/generators/storybook-configuration/lib/generate-stories.js +10 -13
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +12 -15
- package/src/generators/storybook-configuration/storybook-configuration.js +20 -16
- package/src/generators/utils/create-ts-config.js +1 -1
- package/src/generators/utils/entry-point.js +1 -2
- package/src/generators/utils/export-scam.js +1 -1
- package/src/generators/utils/insert-ngmodule-import.js +1 -1
- package/src/generators/utils/path.js +3 -3
- package/src/generators/utils/project.js +2 -3
- package/src/generators/utils/selector.js +1 -1
- package/src/generators/utils/storybook-ast/component-info.js +1 -2
- package/src/generators/utils/storybook-ast/entry-point.js +1 -2
- package/src/generators/utils/storybook-ast/module-info.js +1 -2
- package/src/generators/utils/storybook-ast/tree-utilities.js +1 -1
- package/src/generators/utils/testing.js +141 -139
- package/src/generators/utils/validations.js +1 -1
- package/src/generators/utils/version-utils.js +5 -7
- package/src/generators/web-worker/lib/normalize-options.js +6 -3
- package/src/generators/web-worker/web-worker.js +25 -28
- package/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.js +10 -13
- package/src/migrations/update-14-2-0/update-angular-cli.js +14 -18
- package/src/migrations/update-14-2-0/update-libraries-secondary-entrypoints.js +22 -26
- package/src/migrations/update-14-2-0/update-ngcc-target.js +10 -14
- package/src/migrations/update-14-2-0/update-router-initial-navigation.js +31 -39
- package/src/migrations/update-14-2-0/update-tsconfig-target.js +48 -56
- package/src/migrations/update-14-5-0/migrate-mfe-to-mf.js +14 -17
- package/src/migrations/update-14-5-2/update-angular-cli.js +14 -18
- package/src/migrations/update-14-6-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-0-0/add-karma-inputs.js +27 -32
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +62 -68
- package/src/migrations/update-15-2-0/remove-browserlist-config.js +34 -37
- package/src/migrations/update-15-2-0/remove-platform-server-exports.js +49 -52
- package/src/migrations/update-15-2-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-2-0/update-karma-main-file.js +11 -12
- package/src/migrations/update-15-2-0/update-typescript-target.js +40 -39
- package/src/migrations/update-15-2-0/update-workspace-config.js +16 -19
- package/src/migrations/update-15-5-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-7-0/install-required-packages.js +26 -28
- package/src/migrations/update-15-8-0/update-angular-cli.js +14 -18
- package/src/migrations/update-15-9-0/update-file-server-executor.js +31 -35
- package/src/migrations/update-15-9-0/update-testing-tsconfig.js +17 -22
- package/src/migrations/update-16-0-0/remove-karma-defaults.js +15 -18
- package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.js +22 -25
- package/src/migrations/update-16-0-0/remove-protractor-defaults.js +15 -18
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +38 -42
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +15 -19
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +49 -52
- package/src/migrations/update-16-1-0/update-angular-cli.js +14 -18
- package/src/migrations/update-16-1-0/update-server-executor-config.js +13 -16
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +25 -29
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +13 -16
- package/src/migrations/update-16-4-0/update-angular-cli.js +14 -18
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +19 -24
- package/src/migrations/update-16-7-0/update-angular-cli.js +14 -18
- package/src/migrations/utils/projects.js +9 -15
- package/src/utils/get-mf-projects.js +1 -2
- package/src/utils/mf/utils.js +43 -44
- package/src/utils/mf/with-module-federation-ssr.js +39 -24
- package/src/utils/mf/with-module-federation.js +40 -21
- package/src/utils/nx-devkit/ast-utils.js +2 -3
- package/src/utils/version-utils.js +2 -4
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeWebpackDevServerBuilder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const webpack_nx_build_coordination_plugin_1 = require("@nx/webpack/src/plugins/webpack-nx-build-coordination-plugin");
|
|
7
6
|
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
@@ -14,20 +13,24 @@ const rxjs_1 = require("rxjs");
|
|
|
14
13
|
const operators_2 = require("rxjs/operators");
|
|
15
14
|
const js_1 = require("@nx/js");
|
|
16
15
|
function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
17
|
-
var _a, _b, _c;
|
|
18
16
|
process.env.NX_TSCONFIG_PATH = (0, js_1.getRootTsConfigPath)();
|
|
19
17
|
const options = (0, lib_1.normalizeOptions)(rawOptions);
|
|
20
18
|
const parsedBrowserTarget = (0, devkit_1.parseTargetString)(options.browserTarget, (0, devkit_1.readCachedProjectGraph)());
|
|
21
19
|
const browserTargetProjectConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(parsedBrowserTarget.project);
|
|
22
20
|
const buildTarget = browserTargetProjectConfiguration.targets[parsedBrowserTarget.target];
|
|
23
|
-
const buildTargetOptions =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
? buildTarget.configurations[
|
|
27
|
-
:
|
|
28
|
-
|
|
21
|
+
const buildTargetOptions = {
|
|
22
|
+
...buildTarget.options,
|
|
23
|
+
...(parsedBrowserTarget.configuration
|
|
24
|
+
? buildTarget.configurations[parsedBrowserTarget.configuration]
|
|
25
|
+
: buildTarget.defaultConfiguration
|
|
26
|
+
? buildTarget.configurations[buildTarget.defaultConfiguration]
|
|
27
|
+
: {}),
|
|
28
|
+
};
|
|
29
|
+
const buildLibsFromSource = options.buildLibsFromSource ??
|
|
30
|
+
buildTargetOptions.buildLibsFromSource ??
|
|
31
|
+
true;
|
|
29
32
|
let pathToWebpackConfig;
|
|
30
|
-
if (
|
|
33
|
+
if (buildTargetOptions.customWebpackConfig?.path) {
|
|
31
34
|
pathToWebpackConfig = (0, devkit_1.joinPathFragments)(context.workspaceRoot, buildTargetOptions.customWebpackConfig.path);
|
|
32
35
|
if (pathToWebpackConfig && !(0, fs_1.existsSync)(pathToWebpackConfig)) {
|
|
33
36
|
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}`);
|
|
@@ -53,18 +56,19 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
|
53
56
|
// the target options to overwrite the tsconfig path to use the generated
|
|
54
57
|
// one with the updated path mappings.
|
|
55
58
|
const originalGetTargetOptions = context.getTargetOptions;
|
|
56
|
-
context.getTargetOptions = (target) =>
|
|
57
|
-
const options =
|
|
59
|
+
context.getTargetOptions = async (target) => {
|
|
60
|
+
const options = await originalGetTargetOptions(target);
|
|
58
61
|
options.tsConfig = tsConfigPath;
|
|
59
62
|
return options;
|
|
60
|
-
}
|
|
63
|
+
};
|
|
61
64
|
// The buildTargetConfiguration also needs to use the generated tsconfig path
|
|
62
65
|
// otherwise the build will fail if customWebpack function/file is referencing
|
|
63
66
|
// local libs. This synchronize the behavior with webpack-browser and
|
|
64
67
|
// webpack-server implementation.
|
|
65
68
|
buildTargetOptions.tsConfig = tsConfigPath;
|
|
66
69
|
}
|
|
67
|
-
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeDevServerBuilder }) => executeDevServerBuilder(options, context,
|
|
70
|
+
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_2.switchMap)(({ executeDevServerBuilder }) => executeDevServerBuilder(options, context, {
|
|
71
|
+
webpackConfiguration: async (baseWebpackConfig) => {
|
|
68
72
|
if (!buildLibsFromSource) {
|
|
69
73
|
const workspaceDependencies = dependencies
|
|
70
74
|
.filter((dep) => !(0, operators_1.isNpmProject)(dep.node))
|
|
@@ -83,11 +87,13 @@ function executeWebpackDevServerBuilder(rawOptions, context) {
|
|
|
83
87
|
return baseWebpackConfig;
|
|
84
88
|
}
|
|
85
89
|
return (0, webpack_1.mergeCustomWebpackConfig)(baseWebpackConfig, pathToWebpackConfig, buildTargetOptions, context.target);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
},
|
|
91
|
+
...(pathToIndexFileTransformer
|
|
92
|
+
? {
|
|
93
|
+
indexHtml: (0, webpack_1.resolveIndexHtmlTransformer)(pathToIndexFileTransformer, buildTargetOptions.tsConfig, context.target),
|
|
94
|
+
}
|
|
95
|
+
: {}),
|
|
96
|
+
})));
|
|
91
97
|
}
|
|
92
98
|
exports.executeWebpackDevServerBuilder = executeWebpackDevServerBuilder;
|
|
93
99
|
exports.default = require('@angular-devkit/architect').createBuilder(executeWebpackDevServerBuilder);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeWebpackServerBuilder = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const fs_1 = require("fs");
|
|
7
6
|
const rxjs_1 = require("rxjs");
|
|
@@ -12,7 +11,7 @@ const buildable_libs_1 = require("../utilities/buildable-libs");
|
|
|
12
11
|
const webpack_1 = require("../utilities/webpack");
|
|
13
12
|
const validate_options_1 = require("./validate-options");
|
|
14
13
|
function buildServerApp(options, context) {
|
|
15
|
-
const { buildLibsFromSource, customWebpackConfig
|
|
14
|
+
const { buildLibsFromSource, customWebpackConfig, ...delegateOptions } = options;
|
|
16
15
|
// If there is a path to custom webpack config
|
|
17
16
|
// Invoke our own support for custom webpack config
|
|
18
17
|
if (customWebpackConfig && customWebpackConfig.path) {
|
|
@@ -28,14 +27,14 @@ function buildServerApp(options, context) {
|
|
|
28
27
|
}
|
|
29
28
|
function buildServerAppWithCustomWebpackConfiguration(options, context, pathToWebpackConfig) {
|
|
30
29
|
return (0, rxjs_1.from)(Promise.resolve().then(() => require('@angular-devkit/build-angular'))).pipe((0, operators_1.switchMap)(({ executeServerBuilder }) => executeServerBuilder(options, context, {
|
|
31
|
-
webpackConfiguration: (baseWebpackConfig) =>
|
|
30
|
+
webpackConfiguration: async (baseWebpackConfig) => {
|
|
32
31
|
// Angular 15 auto includes code from @angular/platform-server
|
|
33
32
|
// This includes the code outside the shared scope created by ModuleFederation
|
|
34
33
|
// This code will be included in the generated code from our generators,
|
|
35
34
|
// maintaining it within the shared scope.
|
|
36
35
|
// Therefore, if the build is an MF Server build, remove the auto-includes from
|
|
37
36
|
// the base webpack config from Angular
|
|
38
|
-
let mergedConfig =
|
|
37
|
+
let mergedConfig = await (0, webpack_1.mergeCustomWebpackConfig)(baseWebpackConfig, pathToWebpackConfig, options, context.target);
|
|
39
38
|
if (mergedConfig.plugins
|
|
40
39
|
.map((p) => p.constructor.name)
|
|
41
40
|
.includes('UniversalFederationPlugin')) {
|
|
@@ -45,11 +44,10 @@ function buildServerAppWithCustomWebpackConfiguration(options, context, pathToWe
|
|
|
45
44
|
: !m.loader.endsWith('@angular-devkit/build-angular/src/builders/server/platform-server-exports-loader.js'));
|
|
46
45
|
}
|
|
47
46
|
return mergedConfig;
|
|
48
|
-
}
|
|
47
|
+
},
|
|
49
48
|
})));
|
|
50
49
|
}
|
|
51
50
|
function executeWebpackServerBuilder(options, context) {
|
|
52
|
-
var _a;
|
|
53
51
|
(0, validate_options_1.validateOptions)(options);
|
|
54
52
|
const installedAngularVersionInfo = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
55
53
|
// default bundleDependencies to true if supported by Angular version
|
|
@@ -57,7 +55,7 @@ function executeWebpackServerBuilder(options, context) {
|
|
|
57
55
|
options.bundleDependencies === undefined) {
|
|
58
56
|
options.bundleDependencies = true;
|
|
59
57
|
}
|
|
60
|
-
|
|
58
|
+
options.buildLibsFromSource ??= true;
|
|
61
59
|
if (!options.buildLibsFromSource) {
|
|
62
60
|
const { tsConfigPath } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(options.tsConfig, context);
|
|
63
61
|
options.tsConfig = tsConfigPath;
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const validate_options_1 = require("./lib/validate-options");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const buildable_libs_1 = require("./lib/buildable-libs");
|
|
7
6
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
8
|
-
function esbuildExecutor(options, context) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, context));
|
|
28
|
-
return yield tslib_1.__await(yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(buildEsbuildBrowser(delegateExecutorOptions, builderContext)))));
|
|
29
|
-
});
|
|
7
|
+
async function* esbuildExecutor(options, context) {
|
|
8
|
+
(0, validate_options_1.validateOptions)(options);
|
|
9
|
+
options.buildLibsFromSource ??= true;
|
|
10
|
+
const { buildLibsFromSource, ...delegateExecutorOptions } = options;
|
|
11
|
+
let dependencies;
|
|
12
|
+
let projectGraph = context.projectGraph;
|
|
13
|
+
if (!buildLibsFromSource) {
|
|
14
|
+
projectGraph = projectGraph ?? (0, devkit_1.readCachedProjectGraph)();
|
|
15
|
+
const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(delegateExecutorOptions.tsConfig, context, { projectGraph });
|
|
16
|
+
dependencies = foundDependencies;
|
|
17
|
+
delegateExecutorOptions.tsConfig = tsConfigPath;
|
|
18
|
+
}
|
|
19
|
+
const { buildEsbuildBrowser } = await Promise.resolve().then(() => require('@angular-devkit/build-angular/src/builders/browser-esbuild/index'));
|
|
20
|
+
const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
|
|
21
|
+
builderName: 'browser-esbuild',
|
|
22
|
+
description: 'Build a browser application',
|
|
23
|
+
optionSchema: await Promise.resolve().then(() => require('@angular-devkit/build-angular/src/builders/browser-esbuild/schema.json')),
|
|
24
|
+
}, context);
|
|
25
|
+
return yield* buildEsbuildBrowser(delegateExecutorOptions, builderContext);
|
|
30
26
|
}
|
|
31
27
|
exports.default = esbuildExecutor;
|
|
@@ -5,9 +5,8 @@ const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
function createTmpTsConfigForBuildableLibs(tsConfigPath, context, options) {
|
|
8
|
-
var _a, _b;
|
|
9
8
|
let dependencies;
|
|
10
|
-
const result = (0, buildable_libs_utils_1.calculateProjectDependencies)(
|
|
9
|
+
const result = (0, buildable_libs_utils_1.calculateProjectDependencies)(options?.projectGraph ?? (0, devkit_1.readCachedProjectGraph)(), context.root, context.projectName, options?.target ?? context.targetName, context.configurationName);
|
|
11
10
|
dependencies = result.dependencies;
|
|
12
11
|
const tmpTsConfigPath = (0, buildable_libs_utils_1.createTmpTsConfig)((0, path_1.join)(context.root, tsConfigPath), context.root, result.target.data.root, dependencies);
|
|
13
12
|
process.env.NX_TSCONFIG_PATH = tmpTsConfigPath;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.delegateBuildExecutor = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
7
|
-
function delegateBuildExecutor(options, context) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(yield tslib_1.__await((0, devkit_1.runExecutor)(delegateTarget, targetOptions, context)))));
|
|
17
|
-
});
|
|
6
|
+
async function* delegateBuildExecutor(options, context) {
|
|
7
|
+
const { target, dependencies } = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, context.targetName, context.configurationName);
|
|
8
|
+
options.tsConfig = (0, buildable_libs_utils_1.createTmpTsConfig)((0, devkit_1.joinPathFragments)(context.root, options.tsConfig), context.root, target.data.root, dependencies);
|
|
9
|
+
if (!(0, buildable_libs_utils_1.checkDependentProjectsHaveBeenBuilt)(context.root, context.projectName, context.targetName, dependencies)) {
|
|
10
|
+
return { success: false };
|
|
11
|
+
}
|
|
12
|
+
const { buildTarget, ...targetOptions } = options;
|
|
13
|
+
const delegateTarget = (0, devkit_1.parseTargetString)(buildTarget, context.projectGraph);
|
|
14
|
+
yield* await (0, devkit_1.runExecutor)(delegateTarget, targetOptions, context);
|
|
18
15
|
}
|
|
19
16
|
exports.delegateBuildExecutor = delegateBuildExecutor;
|
|
20
17
|
exports.default = delegateBuildExecutor;
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.nxCompileNgcTransformFactory = void 0;
|
|
12
|
-
const tslib_1 = require("tslib");
|
|
13
12
|
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
14
13
|
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
15
14
|
const tsconfig_1 = require("ng-packagr/lib/ts/tsconfig");
|
|
@@ -18,9 +17,7 @@ const ts = require("typescript");
|
|
|
18
17
|
const angular_version_utils_1 = require("../../../../utilities/angular-version-utils");
|
|
19
18
|
const compile_source_files_1 = require("../../ngc/compile-source-files");
|
|
20
19
|
const nxCompileNgcTransformFactory = (StylesheetProcessor, options) => {
|
|
21
|
-
return (0, transform_1.transformFromPromise)((graph) =>
|
|
22
|
-
var _a;
|
|
23
|
-
var _b;
|
|
20
|
+
return (0, transform_1.transformFromPromise)(async (graph) => {
|
|
24
21
|
try {
|
|
25
22
|
const entryPoint = graph.find((0, nodes_1.isEntryPointInProgress)());
|
|
26
23
|
const entryPoints = graph.filter(nodes_1.isEntryPoint);
|
|
@@ -34,8 +31,8 @@ const nxCompileNgcTransformFactory = (StylesheetProcessor, options) => {
|
|
|
34
31
|
: entryPoint.data.destinationFiles.esm2022;
|
|
35
32
|
const { basePath, cssUrl, styleIncludePaths } = entryPoint.data.entryPoint;
|
|
36
33
|
const { moduleResolutionCache } = entryPoint.cache;
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
entryPoint.cache.stylesheetProcessor ??= new StylesheetProcessor(basePath, cssUrl, styleIncludePaths, options.cacheEnabled && options.cacheDirectory, options.watch, options.tailwindConfig);
|
|
35
|
+
await (0, compile_source_files_1.compileSourceFiles)(graph, tsConfig, moduleResolutionCache, {
|
|
39
36
|
outDir: path.dirname(esmModulePath),
|
|
40
37
|
declarationDir: path.dirname(declarations),
|
|
41
38
|
declaration: true,
|
|
@@ -48,6 +45,6 @@ const nxCompileNgcTransformFactory = (StylesheetProcessor, options) => {
|
|
|
48
45
|
throw error;
|
|
49
46
|
}
|
|
50
47
|
return graph;
|
|
51
|
-
})
|
|
48
|
+
});
|
|
52
49
|
};
|
|
53
50
|
exports.nxCompileNgcTransformFactory = nxCompileNgcTransformFactory;
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.nxEntryPointTransformFactory = void 0;
|
|
10
|
-
const tslib_1 = require("tslib");
|
|
11
10
|
const devkit_1 = require("@nx/devkit");
|
|
12
11
|
const node_1 = require("ng-packagr/lib/graph/node");
|
|
13
12
|
const select_1 = require("ng-packagr/lib/graph/select");
|
|
@@ -36,18 +35,18 @@ const rxjs_1 = require("rxjs");
|
|
|
36
35
|
* @param compileTs Transformation compiling typescript sources to ES2022 modules.
|
|
37
36
|
* @param writeBundles Transformation flattening ES2022 modules to ESM2022, UMD, and minified UMD.
|
|
38
37
|
*/
|
|
39
|
-
const nxEntryPointTransformFactory = (compileTs, writePackage) => (0, rxjs_1.pipe)((0, transform_1.transformFromPromise)((graph) =>
|
|
38
|
+
const nxEntryPointTransformFactory = (compileTs, writePackage) => (0, rxjs_1.pipe)((0, transform_1.transformFromPromise)(async (graph) => {
|
|
40
39
|
// Peek the first entry point from the graph
|
|
41
40
|
const entryPoint = graph.find((0, nodes_1.byEntryPoint)().and(select_1.isInProgress));
|
|
42
41
|
devkit_1.logger.info('\n------------------------------------------------------------------------------');
|
|
43
42
|
devkit_1.logger.info(`Building entry point '${entryPoint.data.entryPoint.moduleId}'`);
|
|
44
43
|
devkit_1.logger.info('------------------------------------------------------------------------------');
|
|
45
|
-
})
|
|
44
|
+
}),
|
|
46
45
|
// TypeScript sources compilation
|
|
47
46
|
compileTs,
|
|
48
47
|
// After TypeScript: write package
|
|
49
|
-
writePackage, (0, transform_1.transformFromPromise)((graph) =>
|
|
48
|
+
writePackage, (0, transform_1.transformFromPromise)(async (graph) => {
|
|
50
49
|
const entryPoint = graph.find((0, nodes_1.byEntryPoint)().and(select_1.isInProgress));
|
|
51
50
|
entryPoint.state = node_1.STATE_DONE;
|
|
52
|
-
}))
|
|
51
|
+
}));
|
|
53
52
|
exports.nxEntryPointTransformFactory = nxEntryPointTransformFactory;
|