@nx/angular 19.1.0-canary.20240522-89fdd42 → 19.1.0-canary.20240524-12c6a73
Sign up to get free protection for your applications and to get access to all the features.
- package/executors.json +1 -1
- package/migrations.json +82 -0
- package/package.json +14 -13
- package/src/builders/dev-server/dev-server.impl.js +1 -1
- package/src/builders/dev-server/schema.json +1 -1
- package/src/builders/module-federation-dev-ssr/module-federation-dev-ssr.impl.js +4 -1
- package/src/builders/utilities/module-federation.d.ts +2 -1
- package/src/builders/utilities/module-federation.js +17 -3
- package/src/builders/webpack-browser/schema.json +4 -3
- package/src/builders/webpack-browser/webpack-browser.impl.js +1 -1
- package/src/builders/webpack-server/schema.json +7 -6
- package/src/builders/webpack-server/webpack-server.impl.js +3 -5
- package/src/executors/application/application.impl.d.ts +2 -1
- package/src/executors/application/application.impl.js +2 -2
- package/src/executors/application/schema.json +4 -3
- package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +2 -7
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +2 -2
- package/src/executors/browser-esbuild/schema.json +4 -3
- package/src/executors/extract-i18n/extract-i18n.impl.js +2 -2
- package/src/executors/module-federation-dev-server/lib/start-static-remotes-file-server.js +2 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +8 -4
- package/src/executors/module-federation-dev-server/schema.json +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +6 -6
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.js +3 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.js +2 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.js +2 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.d.ts +1 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.js +5 -4
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.js +11 -11
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/v17+/ng-package/entry-point/write-package.transform.js +2 -1
- package/src/executors/ng-packagr-lite/schema.json +1 -1
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +5 -4
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +2 -1
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +4 -4
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +1 -2
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +5 -4
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +11 -11
- package/src/executors/utilities/esbuild-extensions.d.ts +2 -4
- package/src/executors/utilities/module-loader.d.ts +1 -2
- package/src/executors/utilities/ng-packagr/stylesheet-processor.js +22 -8
- package/src/executors/utilities/typescript.d.ts +1 -2
- package/src/executors/utilities/typescript.js +4 -3
- package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
- package/src/generators/add-linting/schema.json +1 -1
- package/src/generators/application/files/base-pre18/src/favicon.ico +0 -0
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +3 -1
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +2 -2
- package/src/generators/application/lib/add-linting.js +2 -1
- package/src/generators/application/lib/create-files.js +7 -0
- package/src/generators/application/lib/create-project.js +12 -5
- package/src/generators/component-test/component-test.js +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -3
- package/src/generators/federate-module/lib/add-remote.js +2 -1
- package/src/generators/host/host.js +3 -2
- package/src/generators/library/library.js +4 -3
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +3 -2
- package/src/generators/ng-add/migrators/migrator.d.ts +1 -1
- package/src/generators/ng-add/migrators/migrator.js +7 -7
- package/src/generators/ng-add/migrators/projects/app.migrator.js +2 -2
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +1 -1
- package/src/generators/ng-add/utilities/validation-logging.js +2 -1
- package/src/generators/ngrx-root-store/ngrx-root-store.js +2 -1
- package/src/generators/setup-mf/lib/add-remote-to-host.js +13 -4
- package/src/generators/setup-mf/lib/fix-bootstrap.d.ts +1 -1
- package/src/generators/setup-mf/lib/fix-bootstrap.js +12 -5
- package/src/generators/setup-mf/lib/setup-host-if-dynamic.js +5 -1
- package/src/generators/setup-mf/setup-mf.js +1 -1
- package/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +4 -3
- package/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ +4 -3
- package/src/generators/setup-ssr/lib/add-dependencies.js +2 -1
- package/src/generators/setup-ssr/lib/generate-files.js +1 -7
- package/src/generators/setup-ssr/lib/index.d.ts +0 -1
- package/src/generators/setup-ssr/lib/index.js +0 -1
- package/src/generators/setup-ssr/lib/validate-options.js +0 -13
- package/src/generators/setup-ssr/schema.json +4 -3
- package/src/generators/setup-ssr/setup-ssr.js +0 -3
- package/src/generators/stories/stories.js +3 -2
- package/src/generators/storybook-configuration/lib/generate-stories.js +1 -1
- package/src/generators/utils/storybook-ast/tree-utilities.js +2 -1
- package/src/generators/utils/version-utils.js +4 -3
- package/src/migrations/update-15-2-0/remove-browserlist-config.js +1 -1
- package/src/migrations/update-15-2-0/remove-platform-server-exports.js +2 -1
- package/src/migrations/update-15-2-0/update-karma-main-file.js +2 -1
- package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +2 -1
- package/src/migrations/update-19-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-19-1-0/update-angular-cli.js +23 -0
- package/src/utils/backward-compatible-versions.d.ts +10 -5
- package/src/utils/backward-compatible-versions.js +18 -19
- package/src/utils/file-change-recorder.js +2 -1
- package/src/utils/mf/with-module-federation.js +3 -2
- package/src/utils/version-utils.d.ts +2 -2
- package/src/utils/version-utils.js +2 -1
- package/src/utils/versions.d.ts +4 -4
- package/src/utils/versions.js +4 -4
- package/index.js +0 -8
- package/mf/index.js +0 -7
- package/mf/mf.js +0 -53
- package/src/builders/webpack-server/validate-options.d.ts +0 -2
- package/src/builders/webpack-server/validate-options.js +0 -33
- package/src/executors/utilities/ng-compiler-cli.d.ts +0 -1
- package/src/executors/utilities/ng-compiler-cli.js +0 -8
- package/src/generators/setup-ssr/files/ngmodule/pre-v15-2/src/main.ts__tpl__ +0 -14
- package/src/generators/setup-ssr/lib/update-app-module.d.ts +0 -3
- package/src/generators/setup-ssr/lib/update-app-module.js +0 -27
- package/src/runtime/nx/data-persistence.js +0 -350
- package/testing/index.js +0 -6
- package/testing/src/testing-utils.js +0 -40
- /package/src/generators/application/files/{base/src → base-18+/public}/favicon.ico +0 -0
- /package/src/generators/application/files/{base → base-pre18}/src/assets/.gitkeep__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/ngmodule/{base/src → src}/__main__ +0 -0
- /package/src/generators/setup-ssr/files/ngmodule/{base/src → src}/app/__rootModuleFileName__ +0 -0
package/executors.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"ng-packagr-lite": {
|
9
9
|
"implementation": "./src/executors/ng-packagr-lite/ng-packagr-lite.impl",
|
10
10
|
"schema": "./src/executors/ng-packagr-lite/schema.json",
|
11
|
-
"description": "Builds an Angular library with support for incremental builds.\n\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nx/angular:package` executor but
|
11
|
+
"description": "Builds an Angular library with support for incremental builds.\n\nThis executor is meant to be used with buildable libraries in an incremental build scenario. It is similar to the `@nx/angular:package` executor but it only produces ESM2022 bundles."
|
12
12
|
},
|
13
13
|
"package": {
|
14
14
|
"implementation": "./src/executors/package/package.impl",
|
package/migrations.json
CHANGED
@@ -386,6 +386,15 @@
|
|
386
386
|
},
|
387
387
|
"description": "Update the @angular/cli package version to ~17.3.0.",
|
388
388
|
"factory": "./src/migrations/update-18-2-0/update-angular-cli"
|
389
|
+
},
|
390
|
+
"update-angular-cli-version-18-0-0": {
|
391
|
+
"cli": "nx",
|
392
|
+
"version": "19.1.0-beta.2",
|
393
|
+
"requires": {
|
394
|
+
"@angular/core": ">=18.0.0"
|
395
|
+
},
|
396
|
+
"description": "Update the @angular/cli package version to ~18.0.0.",
|
397
|
+
"factory": "./src/migrations/update-19-1-0/update-angular-cli"
|
389
398
|
}
|
390
399
|
},
|
391
400
|
"packageJsonUpdates": {
|
@@ -1805,6 +1814,79 @@
|
|
1805
1814
|
"alwaysAddToPackageJson": false
|
1806
1815
|
}
|
1807
1816
|
}
|
1817
|
+
},
|
1818
|
+
"19.1.0": {
|
1819
|
+
"version": "19.1.0-beta.2",
|
1820
|
+
"x-prompt": "Do you want to update the Angular version to v18?",
|
1821
|
+
"requires": {
|
1822
|
+
"@angular/core": ">=17.3.0 <18.0.0"
|
1823
|
+
},
|
1824
|
+
"packages": {
|
1825
|
+
"@angular-devkit/build-angular": {
|
1826
|
+
"version": "~18.0.0",
|
1827
|
+
"alwaysAddToPackageJson": false
|
1828
|
+
},
|
1829
|
+
"@angular-devkit/core": {
|
1830
|
+
"version": "~18.0.0",
|
1831
|
+
"alwaysAddToPackageJson": false
|
1832
|
+
},
|
1833
|
+
"@angular-devkit/schematics": {
|
1834
|
+
"version": "~18.0.0",
|
1835
|
+
"alwaysAddToPackageJson": false
|
1836
|
+
},
|
1837
|
+
"@angular/pwa": {
|
1838
|
+
"version": "~18.0.0",
|
1839
|
+
"alwaysAddToPackageJson": false
|
1840
|
+
},
|
1841
|
+
"@angular/ssr": {
|
1842
|
+
"version": "~18.0.0",
|
1843
|
+
"alwaysAddToPackageJson": false
|
1844
|
+
},
|
1845
|
+
"@schematics/angular": {
|
1846
|
+
"version": "~18.0.0",
|
1847
|
+
"alwaysAddToPackageJson": false
|
1848
|
+
},
|
1849
|
+
"@angular-devkit/architect": {
|
1850
|
+
"version": "~0.1800.0",
|
1851
|
+
"alwaysAddToPackageJson": false
|
1852
|
+
},
|
1853
|
+
"@angular-devkit/build-webpack": {
|
1854
|
+
"version": "~0.1800.0",
|
1855
|
+
"alwaysAddToPackageJson": false
|
1856
|
+
},
|
1857
|
+
"@angular/core": {
|
1858
|
+
"version": "~18.0.0",
|
1859
|
+
"alwaysAddToPackageJson": true
|
1860
|
+
},
|
1861
|
+
"@angular/material": {
|
1862
|
+
"version": "~18.0.0",
|
1863
|
+
"alwaysAddToPackageJson": false
|
1864
|
+
},
|
1865
|
+
"@angular/cdk": {
|
1866
|
+
"version": "~18.0.0",
|
1867
|
+
"alwaysAddToPackageJson": false
|
1868
|
+
},
|
1869
|
+
"ng-packagr": {
|
1870
|
+
"version": "~18.0.0",
|
1871
|
+
"alwaysAddToPackageJson": false
|
1872
|
+
}
|
1873
|
+
}
|
1874
|
+
},
|
1875
|
+
"19.1.0-jest": {
|
1876
|
+
"version": "19.1.0-beta.2",
|
1877
|
+
"requires": {
|
1878
|
+
"@angular-devkit/build-angular": ">=15.0.0 <19.0.0",
|
1879
|
+
"@angular/compiler-cli": ">=15.0.0 <19.0.0",
|
1880
|
+
"@angular/core": ">=15.0.0 <19.0.0",
|
1881
|
+
"@angular/platform-browser-dynamic": ">=15.0.0 <19.0.0",
|
1882
|
+
"jest": "^29.0.0"
|
1883
|
+
},
|
1884
|
+
"packages": {
|
1885
|
+
"jest-preset-angular": {
|
1886
|
+
"version": "~14.1.0",
|
1887
|
+
"alwaysAddToPackageJson": false
|
1888
|
+
}
|
1889
|
+
}
|
1808
1890
|
}
|
1809
1891
|
}
|
1810
1892
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/angular",
|
3
|
-
"version": "19.1.0-canary.
|
3
|
+
"version": "19.1.0-canary.20240524-12c6a73",
|
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, Playwright 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- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
6
6
|
"repository": {
|
@@ -13,7 +13,8 @@
|
|
13
13
|
"Angular",
|
14
14
|
"Jest",
|
15
15
|
"Cypress",
|
16
|
-
"CLI"
|
16
|
+
"CLI",
|
17
|
+
"Front-end"
|
17
18
|
],
|
18
19
|
"exports": {
|
19
20
|
"./migrations.json": "./migrations.json",
|
@@ -78,20 +79,20 @@
|
|
78
79
|
"tslib": "^2.3.0",
|
79
80
|
"webpack": "^5.80.0",
|
80
81
|
"webpack-merge": "^5.8.0",
|
81
|
-
"@nx/devkit": "19.1.0-canary.
|
82
|
-
"@nx/js": "19.1.0-canary.
|
83
|
-
"@nx/eslint": "19.1.0-canary.
|
84
|
-
"@nx/webpack": "19.1.0-canary.
|
85
|
-
"@nx/web": "19.1.0-canary.
|
86
|
-
"@nx/workspace": "19.1.0-canary.
|
82
|
+
"@nx/devkit": "19.1.0-canary.20240524-12c6a73",
|
83
|
+
"@nx/js": "19.1.0-canary.20240524-12c6a73",
|
84
|
+
"@nx/eslint": "19.1.0-canary.20240524-12c6a73",
|
85
|
+
"@nx/webpack": "19.1.0-canary.20240524-12c6a73",
|
86
|
+
"@nx/web": "19.1.0-canary.20240524-12c6a73",
|
87
|
+
"@nx/workspace": "19.1.0-canary.20240524-12c6a73",
|
87
88
|
"piscina": "^4.4.0",
|
88
|
-
"@nrwl/angular": "19.1.0-canary.
|
89
|
+
"@nrwl/angular": "19.1.0-canary.20240524-12c6a73"
|
89
90
|
},
|
90
91
|
"peerDependencies": {
|
91
|
-
"@angular-devkit/build-angular": ">=
|
92
|
-
"@angular-devkit/core": ">=
|
93
|
-
"@angular-devkit/schematics": ">=
|
94
|
-
"@schematics/angular": ">=
|
92
|
+
"@angular-devkit/build-angular": ">= 16.0.0 < 19.0.0",
|
93
|
+
"@angular-devkit/core": ">= 16.0.0 < 19.0.0",
|
94
|
+
"@angular-devkit/schematics": ">= 16.0.0 < 19.0.0",
|
95
|
+
"@schematics/angular": ">= 16.0.0 < 19.0.0",
|
95
96
|
"esbuild": "^0.19.2",
|
96
97
|
"rxjs": "^6.5.3 || ^7.5.0"
|
97
98
|
},
|
@@ -98,7 +98,7 @@ function executeDevServerBuilder(rawOptions, context) {
|
|
98
98
|
*/
|
99
99
|
(0, patch_builder_context_1.patchBuilderContext)(context, !isUsingWebpackBuilder, parsedBuildTarget);
|
100
100
|
return (0, rxjs_1.combineLatest)([
|
101
|
-
(0, rxjs_1.from)(
|
101
|
+
(0, rxjs_1.from)(import('@angular-devkit/build-angular')),
|
102
102
|
(0, rxjs_1.from)((0, esbuild_extensions_1.loadPlugins)(buildTargetOptions.plugins, buildTargetOptions.tsConfig)),
|
103
103
|
(0, rxjs_1.from)((0, esbuild_extensions_1.loadMiddleware)(options.esbuildMiddleware, buildTargetOptions.tsConfig)),
|
104
104
|
(0, rxjs_1.from)(loadIndexHtmlFileTransformer(pathToIndexFileTransformer, buildTargetOptions.tsConfig, context, isUsingWebpackBuilder)),
|
@@ -36,7 +36,7 @@
|
|
36
36
|
},
|
37
37
|
"proxyConfig": {
|
38
38
|
"type": "string",
|
39
|
-
"description": "Proxy configuration file. For more information, see https://angular.
|
39
|
+
"description": "Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server."
|
40
40
|
},
|
41
41
|
"ssl": {
|
42
42
|
"type": "boolean",
|
@@ -17,7 +17,7 @@ function executeModuleFederationDevSSRBuilder(schema, context) {
|
|
17
17
|
const projectGraph = (0, devkit_1.readCachedProjectGraph)();
|
18
18
|
const { projects: workspaceProjects } = (0, project_graph_1.readProjectsConfigurationFromProjectGraph)(projectGraph);
|
19
19
|
const project = workspaceProjects[context.target.project];
|
20
|
-
let pathToManifestFile
|
20
|
+
let pathToManifestFile;
|
21
21
|
if (options.pathToManifestFile) {
|
22
22
|
const userPathToManifestFile = (0, path_1.join)(context.workspaceRoot, options.pathToManifestFile);
|
23
23
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
@@ -28,6 +28,9 @@ function executeModuleFederationDevSSRBuilder(schema, context) {
|
|
28
28
|
}
|
29
29
|
pathToManifestFile = userPathToManifestFile;
|
30
30
|
}
|
31
|
+
else {
|
32
|
+
pathToManifestFile = (0, module_federation_1.getDynamicMfManifestFile)(project, context.workspaceRoot);
|
33
|
+
}
|
31
34
|
(0, module_federation_1.validateDevRemotes)(options, workspaceProjects);
|
32
35
|
const remotesToSkip = new Set(options.skipRemotes ?? []);
|
33
36
|
const staticRemotes = (0, module_federation_1.getStaticRemotes)(project, context, workspaceProjects, remotesToSkip);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ProjectConfiguration } from '@nx/devkit';
|
2
|
-
export declare function getDynamicRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>, pathToManifestFile
|
2
|
+
export declare function getDynamicRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>, pathToManifestFile: string | undefined): string[];
|
3
3
|
export declare function getStaticRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>): string[];
|
4
4
|
export declare function validateDevRemotes(options: {
|
5
5
|
devRemotes?: (string | {
|
@@ -7,3 +7,4 @@ export declare function validateDevRemotes(options: {
|
|
7
7
|
configuration: string;
|
8
8
|
})[];
|
9
9
|
}, workspaceProjects: Record<string, ProjectConfiguration>): void;
|
10
|
+
export declare function getDynamicMfManifestFile(project: ProjectConfiguration, workspaceRoot: string): string | undefined;
|
@@ -1,15 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.validateDevRemotes = exports.getStaticRemotes = exports.getDynamicRemotes = void 0;
|
3
|
+
exports.getDynamicMfManifestFile = exports.validateDevRemotes = exports.getStaticRemotes = exports.getDynamicRemotes = void 0;
|
4
4
|
const path_1 = require("path");
|
5
5
|
const fs_1 = require("fs");
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
7
7
|
const internal_1 = require("@nx/js/src/internal");
|
8
|
-
function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip, pathToManifestFile
|
8
|
+
function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip, pathToManifestFile) {
|
9
|
+
pathToManifestFile ??= getDynamicMfManifestFile(project, context.workspaceRoot);
|
9
10
|
// check for dynamic remotes
|
10
11
|
// we should only check for dynamic based on what we generate
|
11
12
|
// and fallback to empty array
|
12
|
-
if (!(0, fs_1.existsSync)(pathToManifestFile)) {
|
13
|
+
if (!pathToManifestFile || !(0, fs_1.existsSync)(pathToManifestFile)) {
|
13
14
|
return [];
|
14
15
|
}
|
15
16
|
const moduleFederationManifestJson = (0, fs_1.readFileSync)(pathToManifestFile, 'utf-8');
|
@@ -95,3 +96,16 @@ function validateDevRemotes(options, workspaceProjects) {
|
|
95
96
|
}
|
96
97
|
}
|
97
98
|
exports.validateDevRemotes = validateDevRemotes;
|
99
|
+
function getDynamicMfManifestFile(project, workspaceRoot) {
|
100
|
+
// {sourceRoot}/assets/module-federation.manifest.json was the generated
|
101
|
+
// path for the manifest file in the past. We now generate the manifest
|
102
|
+
// file at {root}/public/module-federation.manifest.json. This check
|
103
|
+
// ensures that we can still support the old path for backwards
|
104
|
+
// compatibility since old projects may still have the manifest file
|
105
|
+
// at the old path.
|
106
|
+
return [
|
107
|
+
(0, path_1.join)(workspaceRoot, project.root, 'public/module-federation.manifest.json'),
|
108
|
+
(0, path_1.join)(workspaceRoot, project.sourceRoot, 'assets/module-federation.manifest.json'),
|
109
|
+
].find((path) => (0, fs_1.existsSync)(path));
|
110
|
+
}
|
111
|
+
exports.getDynamicMfManifestFile = getDynamicMfManifestFile;
|
@@ -153,7 +153,7 @@
|
|
153
153
|
"additionalProperties": false
|
154
154
|
},
|
155
155
|
"optimization": {
|
156
|
-
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.
|
156
|
+
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
157
157
|
"x-user-analytics": 16,
|
158
158
|
"default": true,
|
159
159
|
"oneOf": [
|
@@ -242,7 +242,7 @@
|
|
242
242
|
"default": true
|
243
243
|
},
|
244
244
|
"sourceMap": {
|
245
|
-
"description": "Output source maps for scripts and styles. For more information, see https://angular.
|
245
|
+
"description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
|
246
246
|
"default": false,
|
247
247
|
"oneOf": [
|
248
248
|
{
|
@@ -498,11 +498,12 @@
|
|
498
498
|
},
|
499
499
|
"output": {
|
500
500
|
"type": "string",
|
501
|
+
"default": "",
|
501
502
|
"description": "Absolute path within the output."
|
502
503
|
}
|
503
504
|
},
|
504
505
|
"additionalProperties": false,
|
505
|
-
"required": ["glob", "input"
|
506
|
+
"required": ["glob", "input"]
|
506
507
|
},
|
507
508
|
{
|
508
509
|
"type": "string"
|
@@ -46,7 +46,7 @@ function executeWebpackBrowserBuilder(options, context) {
|
|
46
46
|
dependencies = foundDependencies;
|
47
47
|
delegateBuilderOptions.tsConfig = (0, devkit_1.normalizePath)((0, path_1.relative)(context.workspaceRoot, tsConfigPath));
|
48
48
|
}
|
49
|
-
return (0, rxjs_1.from)(
|
49
|
+
return (0, rxjs_1.from)(import('@angular-devkit/build-angular')).pipe((0, operators_2.switchMap)(({ executeBrowserBuilder }) => executeBrowserBuilder(delegateBuilderOptions, context, {
|
50
50
|
webpackConfiguration: (baseWebpackConfig) => {
|
51
51
|
if (!buildLibsFromSource && delegateBuilderOptions.watch) {
|
52
52
|
const workspaceDependencies = dependencies
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"properties": {
|
9
9
|
"assets": {
|
10
10
|
"type": "array",
|
11
|
-
"description": "List of static application assets.
|
11
|
+
"description": "List of static application assets.",
|
12
12
|
"default": [],
|
13
13
|
"items": {
|
14
14
|
"$ref": "#/definitions/assetPattern"
|
@@ -45,7 +45,7 @@
|
|
45
45
|
"additionalProperties": false
|
46
46
|
},
|
47
47
|
"optimization": {
|
48
|
-
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.
|
48
|
+
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
49
49
|
"default": true,
|
50
50
|
"x-user-analytics": "ep.ng_optimization",
|
51
51
|
"oneOf": [
|
@@ -87,7 +87,7 @@
|
|
87
87
|
"description": "The path where style resources will be placed, relative to outputPath."
|
88
88
|
},
|
89
89
|
"sourceMap": {
|
90
|
-
"description": "Output source maps for scripts and styles. For more information, see https://angular.
|
90
|
+
"description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
|
91
91
|
"default": false,
|
92
92
|
"oneOf": [
|
93
93
|
{
|
@@ -127,7 +127,7 @@
|
|
127
127
|
},
|
128
128
|
"vendorChunk": {
|
129
129
|
"type": "boolean",
|
130
|
-
"description": "Generate a separate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.
|
130
|
+
"description": "Generate a separate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
|
131
131
|
"default": false
|
132
132
|
},
|
133
133
|
"verbose": {
|
@@ -192,7 +192,7 @@
|
|
192
192
|
},
|
193
193
|
"buildOptimizer": {
|
194
194
|
"type": "boolean",
|
195
|
-
"description": "Enables advanced build optimizations.
|
195
|
+
"description": "Enables advanced build optimizations.",
|
196
196
|
"default": true
|
197
197
|
},
|
198
198
|
"namedChunks": {
|
@@ -271,11 +271,12 @@
|
|
271
271
|
},
|
272
272
|
"output": {
|
273
273
|
"type": "string",
|
274
|
+
"default": "",
|
274
275
|
"description": "Absolute path within the output."
|
275
276
|
}
|
276
277
|
},
|
277
278
|
"additionalProperties": false,
|
278
|
-
"required": ["glob", "input"
|
279
|
+
"required": ["glob", "input"]
|
279
280
|
},
|
280
281
|
{
|
281
282
|
"type": "string"
|
@@ -8,7 +8,6 @@ const rxjs_1 = require("rxjs");
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
9
9
|
const buildable_libs_1 = require("../utilities/buildable-libs");
|
10
10
|
const webpack_1 = require("../utilities/webpack");
|
11
|
-
const validate_options_1 = require("./validate-options");
|
12
11
|
function buildServerApp(options, context) {
|
13
12
|
const { buildLibsFromSource, customWebpackConfig, ...delegateOptions } = options;
|
14
13
|
// If there is a path to custom webpack config
|
@@ -22,12 +21,12 @@ function buildServerApp(options, context) {
|
|
22
21
|
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}`);
|
23
22
|
}
|
24
23
|
}
|
25
|
-
return (0, rxjs_1.from)(
|
24
|
+
return (0, rxjs_1.from)(import('@angular-devkit/build-angular')).pipe((0, operators_1.switchMap)(({ executeServerBuilder }) => executeServerBuilder(delegateOptions, context)));
|
26
25
|
}
|
27
26
|
function buildServerAppWithCustomWebpackConfiguration(options, context, pathToWebpackConfig) {
|
28
|
-
return (0, rxjs_1.from)(
|
27
|
+
return (0, rxjs_1.from)(import('@angular-devkit/build-angular')).pipe((0, operators_1.switchMap)(({ executeServerBuilder }) => executeServerBuilder(options, context, {
|
29
28
|
webpackConfiguration: async (baseWebpackConfig) => {
|
30
|
-
// Angular
|
29
|
+
// Angular auto includes code from @angular/platform-server
|
31
30
|
// This includes the code outside the shared scope created by ModuleFederation
|
32
31
|
// This code will be included in the generated code from our generators,
|
33
32
|
// maintaining it within the shared scope.
|
@@ -47,7 +46,6 @@ function buildServerAppWithCustomWebpackConfiguration(options, context, pathToWe
|
|
47
46
|
})));
|
48
47
|
}
|
49
48
|
function executeWebpackServerBuilder(options, context) {
|
50
|
-
(0, validate_options_1.validateOptions)(options);
|
51
49
|
options.buildLibsFromSource ??= true;
|
52
50
|
process.env.NX_BUILD_LIBS_FROM_SOURCE = `${options.buildLibsFromSource}`;
|
53
51
|
process.env.NX_BUILD_TARGET = (0, devkit_1.targetToTargetString)({ ...context.target });
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import type { ExecutorContext } from '@nx/devkit';
|
2
2
|
import type { ApplicationExecutorOptions } from './schema';
|
3
|
-
|
3
|
+
import type { buildApplication as buildApplicationFn } from '@angular-devkit/build-angular';
|
4
|
+
export default function applicationExecutor(options: ApplicationExecutorOptions, context: ExecutorContext): ReturnType<typeof buildApplicationFn>;
|
@@ -19,11 +19,11 @@ async function* applicationExecutor(options, context) {
|
|
19
19
|
const indexHtmlTransformer = indexHtmlTransformerPath
|
20
20
|
? await (0, esbuild_extensions_1.loadIndexHtmlTransformer)(indexHtmlTransformerPath, options.tsConfig)
|
21
21
|
: undefined;
|
22
|
-
const { buildApplication } = await
|
22
|
+
const { buildApplication } = await import('@angular-devkit/build-angular');
|
23
23
|
const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
|
24
24
|
builderName: 'application',
|
25
25
|
description: 'Build an application.',
|
26
|
-
optionSchema:
|
26
|
+
optionSchema: require('./schema.json'),
|
27
27
|
}, context);
|
28
28
|
const { version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
29
29
|
if ((0, semver_1.gte)(angularVersion, '17.1.0')) {
|
@@ -145,7 +145,7 @@
|
|
145
145
|
"description": "Automatically clear the terminal screen during rebuilds. _Note: this is only supported in Angular versions >= 17.2.0_."
|
146
146
|
},
|
147
147
|
"optimization": {
|
148
|
-
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.
|
148
|
+
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
149
149
|
"default": true,
|
150
150
|
"x-user-analytics": "ep.ng_optimization",
|
151
151
|
"oneOf": [
|
@@ -281,7 +281,7 @@
|
|
281
281
|
"default": true
|
282
282
|
},
|
283
283
|
"sourceMap": {
|
284
|
-
"description": "Output source maps for scripts and styles. For more information, see https://angular.
|
284
|
+
"description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
|
285
285
|
"default": false,
|
286
286
|
"oneOf": [
|
287
287
|
{
|
@@ -600,11 +600,12 @@
|
|
600
600
|
},
|
601
601
|
"output": {
|
602
602
|
"type": "string",
|
603
|
+
"default": "",
|
603
604
|
"description": "Absolute path within the output."
|
604
605
|
}
|
605
606
|
},
|
606
607
|
"additionalProperties": false,
|
607
|
-
"required": ["glob", "input"
|
608
|
+
"required": ["glob", "input"]
|
608
609
|
},
|
609
610
|
{
|
610
611
|
"type": "string"
|
@@ -1,9 +1,4 @@
|
|
1
|
+
import type { buildEsbuildBrowser as buildEsbuildBrowserFn } from '@angular-devkit/build-angular/src/builders/browser-esbuild';
|
1
2
|
import { type ExecutorContext } from '@nx/devkit';
|
2
3
|
import type { EsBuildSchema } from './schema';
|
3
|
-
export default function esbuildExecutor(options: EsBuildSchema, context: ExecutorContext):
|
4
|
-
outputFiles?: import("@angular-devkit/build-angular/src/tools/esbuild/bundler-context").BuildOutputFile[];
|
5
|
-
assetFiles?: {
|
6
|
-
source: string;
|
7
|
-
destination: string;
|
8
|
-
}[];
|
9
|
-
}, any, undefined>;
|
4
|
+
export default function esbuildExecutor(options: EsBuildSchema, context: ExecutorContext): ReturnType<typeof buildEsbuildBrowserFn>;
|
@@ -22,11 +22,11 @@ async function* esbuildExecutor(options, context) {
|
|
22
22
|
delegateExecutorOptions.tsConfig = tsConfigPath;
|
23
23
|
}
|
24
24
|
const plugins = await (0, esbuild_extensions_1.loadPlugins)(pluginPaths, options.tsConfig);
|
25
|
-
const { buildEsbuildBrowser } =
|
25
|
+
const { buildEsbuildBrowser } = require('@angular-devkit/build-angular/src/builders/browser-esbuild');
|
26
26
|
const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
|
27
27
|
builderName: 'browser-esbuild',
|
28
28
|
description: 'Build a browser application',
|
29
|
-
optionSchema:
|
29
|
+
optionSchema: require('@angular-devkit/build-angular/src/builders/browser-esbuild/schema.json'),
|
30
30
|
}, context);
|
31
31
|
return yield* buildEsbuildBrowser(delegateExecutorOptions, builderContext,
|
32
32
|
/* infrastructureSettings */ undefined, plugins);
|
@@ -141,7 +141,7 @@
|
|
141
141
|
"default": []
|
142
142
|
},
|
143
143
|
"optimization": {
|
144
|
-
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.
|
144
|
+
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
|
145
145
|
"default": true,
|
146
146
|
"x-user-analytics": "ep.ng_optimization",
|
147
147
|
"oneOf": [
|
@@ -229,7 +229,7 @@
|
|
229
229
|
"default": true
|
230
230
|
},
|
231
231
|
"sourceMap": {
|
232
|
-
"description": "Output source maps for scripts and styles. For more information, see https://angular.
|
232
|
+
"description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
|
233
233
|
"default": false,
|
234
234
|
"oneOf": [
|
235
235
|
{
|
@@ -502,11 +502,12 @@
|
|
502
502
|
},
|
503
503
|
"output": {
|
504
504
|
"type": "string",
|
505
|
+
"default": "",
|
505
506
|
"description": "Absolute path within the output."
|
506
507
|
}
|
507
508
|
},
|
508
509
|
"additionalProperties": false,
|
509
|
-
"required": ["glob", "input"
|
510
|
+
"required": ["glob", "input"]
|
510
511
|
},
|
511
512
|
{
|
512
513
|
"type": "string"
|
@@ -18,7 +18,7 @@ async function* extractI18nExecutor(options, context) {
|
|
18
18
|
const builderContext = await (0, ngcli_adapter_1.createBuilderContext)({
|
19
19
|
builderName: 'extrct-i18n',
|
20
20
|
description: 'Extracts i18n messages from source code.',
|
21
|
-
optionSchema:
|
21
|
+
optionSchema: require('./schema.json'),
|
22
22
|
}, context);
|
23
23
|
/**
|
24
24
|
* The Angular CLI extract-i18n builder make some decisions based on the build
|
@@ -27,7 +27,7 @@ async function* extractI18nExecutor(options, context) {
|
|
27
27
|
* handle `@nx/angular:*` executors.
|
28
28
|
*/
|
29
29
|
(0, patch_builder_context_1.patchBuilderContext)(builderContext, isUsingEsbuildBuilder, parsedBuildTarget);
|
30
|
-
const { executeExtractI18nBuilder } = await
|
30
|
+
const { executeExtractI18nBuilder } = await import('@angular-devkit/build-angular');
|
31
31
|
const delegateBuilderOptions = getDelegateBuilderOptions(options);
|
32
32
|
return await executeExtractI18nBuilder(delegateBuilderOptions, builderContext);
|
33
33
|
}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.startStaticRemotesFileServer = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
5
|
-
const file_server_impl_1 = require("@nx/web/src/executors/file-server/file-server.impl");
|
6
|
+
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
6
7
|
const path_1 = require("path");
|
7
8
|
const fs_1 = require("fs");
|
8
9
|
function startStaticRemotesFileServer(staticRemotesConfig, context, options) {
|
@@ -1,13 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.moduleFederationDevServerExecutor = void 0;
|
4
|
+
const tslib_1 = require("tslib");
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
5
6
|
const lib_1 = require("./lib");
|
6
7
|
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
7
8
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
8
9
|
const module_federation_1 = require("@nx/webpack/src/utils/module-federation");
|
9
10
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
10
|
-
const file_server_impl_1 = require("@nx/web/src/executors/file-server/file-server.impl");
|
11
|
+
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
11
12
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
12
13
|
const dev_server_impl_1 = require("../../builders/dev-server/dev-server.impl");
|
13
14
|
const module_federation_2 = require("../../builders/utilities/module-federation");
|
@@ -34,13 +35,16 @@ async function* moduleFederationDevServerExecutor(schema, context) {
|
|
34
35
|
: (0, rxjs_for_await_1.eachValueFrom)((0, dev_server_impl_1.executeDevServerBuilder)(options, await (0, ngcli_adapter_1.createBuilderContext)({
|
35
36
|
builderName: '@nx/angular:webpack-browser',
|
36
37
|
description: 'Build a browser application',
|
37
|
-
optionSchema:
|
38
|
+
optionSchema: require('../../builders/webpack-browser/schema.json'),
|
38
39
|
}, context)));
|
39
40
|
if (options.isInitialHost === false) {
|
40
41
|
return yield* currIter;
|
41
42
|
}
|
42
|
-
let pathToManifestFile
|
43
|
-
if (options.pathToManifestFile) {
|
43
|
+
let pathToManifestFile;
|
44
|
+
if (!options.pathToManifestFile) {
|
45
|
+
pathToManifestFile = (0, module_federation_2.getDynamicMfManifestFile)(project, context.root);
|
46
|
+
}
|
47
|
+
else {
|
44
48
|
const userPathToManifestFile = (0, path_1.join)(context.root, options.pathToManifestFile);
|
45
49
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
46
50
|
throw new Error(`The provided Module Federation manifest file path does not exist. Please check the file exists at "${userPathToManifestFile}".`);
|
@@ -34,7 +34,7 @@
|
|
34
34
|
},
|
35
35
|
"proxyConfig": {
|
36
36
|
"type": "string",
|
37
|
-
"description": "Proxy configuration file. For more information, see https://angular.
|
37
|
+
"description": "Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server."
|
38
38
|
},
|
39
39
|
"ssl": {
|
40
40
|
"type": "boolean",
|
@@ -6,9 +6,9 @@ const angular_version_utils_1 = require("../../utilities/angular-version-utils")
|
|
6
6
|
async function getNgPackagrInstance(options) {
|
7
7
|
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
8
8
|
if (angularMajorVersion >= 17) {
|
9
|
-
const { WRITE_BUNDLES_TRANSFORM } = await
|
10
|
-
const { WRITE_PACKAGE_TRANSFORM } = await
|
11
|
-
const { STYLESHEET_PROCESSOR } = await
|
9
|
+
const { WRITE_BUNDLES_TRANSFORM } = await import('./v17+/ng-package/entry-point/write-bundles.di.js');
|
10
|
+
const { WRITE_PACKAGE_TRANSFORM } = await import('./v17+/ng-package/entry-point/write-package.di.js');
|
11
|
+
const { STYLESHEET_PROCESSOR } = await import('../../utilities/ng-packagr/stylesheet-processor.di.js');
|
12
12
|
const packagr = (0, ng_packagr_1.ngPackagr)();
|
13
13
|
packagr.withProviders([
|
14
14
|
WRITE_BUNDLES_TRANSFORM,
|
@@ -17,9 +17,9 @@ async function getNgPackagrInstance(options) {
|
|
17
17
|
]);
|
18
18
|
return packagr;
|
19
19
|
}
|
20
|
-
const { NX_ENTRY_POINT_PROVIDERS } = await
|
21
|
-
const { nxProvideOptions } = await
|
22
|
-
const { NX_PACKAGE_PROVIDERS, NX_PACKAGE_TRANSFORM } = await
|
20
|
+
const { NX_ENTRY_POINT_PROVIDERS } = await import('./pre-v17/ng-package/entry-point/entry-point.di.js');
|
21
|
+
const { nxProvideOptions } = await import('./pre-v17/ng-package/options.di.js');
|
22
|
+
const { NX_PACKAGE_PROVIDERS, NX_PACKAGE_TRANSFORM } = await import('./pre-v17/ng-package/package.di.js');
|
23
23
|
const packagr = new ng_packagr_1.NgPackagr([
|
24
24
|
...NX_PACKAGE_PROVIDERS,
|
25
25
|
...NX_ENTRY_POINT_PROVIDERS,
|
@@ -9,11 +9,12 @@
|
|
9
9
|
*/
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
11
11
|
exports.nxCompileNgcTransformFactory = void 0;
|
12
|
+
const tslib_1 = require("tslib");
|
12
13
|
const transform_1 = require("ng-packagr/lib/graph/transform");
|
13
14
|
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
14
15
|
const tsconfig_1 = require("ng-packagr/lib/ts/tsconfig");
|
15
|
-
const path = require("path");
|
16
|
-
const ts = require("typescript");
|
16
|
+
const path = tslib_1.__importStar(require("path"));
|
17
|
+
const ts = tslib_1.__importStar(require("typescript"));
|
17
18
|
const angular_version_utils_1 = require("../../../../../utilities/angular-version-utils");
|
18
19
|
const compile_source_files_1 = require("../../ngc/compile-source-files");
|
19
20
|
const nxCompileNgcTransformFactory = (StylesheetProcessor, options) => {
|