@nx/angular 23.0.0-rc.4 → 23.1.0-beta.0
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/README.md +1 -2
- package/dist/src/builders/dev-server/schema.json +2 -2
- package/dist/src/builders/webpack-browser/webpack-browser.impl.js +1 -1
- package/dist/src/executors/application/application.impl.js +3 -14
- package/dist/src/executors/application/schema.json +9 -3
- package/dist/src/executors/application/utils/normalize-options.js +19 -8
- package/dist/src/executors/application/utils/validate-options.js +0 -10
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.d.ts +1 -1
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.js +4 -21
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.d.ts +1 -1
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.js +6 -9
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +7 -10
- package/dist/src/executors/unit-test/schema.json +8 -0
- package/dist/src/executors/unit-test/unit-test.impl.d.ts +1 -2
- package/dist/src/executors/unit-test/unit-test.impl.js +8 -0
- package/dist/src/executors/utilities/esbuild-extensions.js +17 -3
- package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +2 -5
- package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.js +11 -19
- package/dist/src/executors/utilities/typescript.js +2 -4
- package/dist/src/generators/application/application.js +11 -15
- package/dist/src/generators/application/files/base/tsconfig.app.json__tpl__ +0 -5
- package/dist/src/generators/application/files/base/tsconfig.json__tpl__ +1 -4
- package/dist/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +1 -7
- package/dist/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.ts__tpl__ +1 -1
- package/dist/src/generators/application/files/ng-module/src/app/app__moduleTypeSeparator__module.ts__tpl__ +2 -2
- package/dist/src/generators/application/files/ng-module/src/main.ts__tpl__ +0 -8
- package/dist/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
- package/dist/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +1 -7
- package/dist/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.ts__tpl__ +1 -1
- package/dist/src/generators/application/lib/create-files.js +0 -8
- package/dist/src/generators/application/lib/create-project.js +3 -12
- package/dist/src/generators/application/lib/update-tsconfig-files.js +6 -36
- package/dist/src/generators/application/schema.d.ts +0 -1
- package/dist/src/generators/application/schema.json +0 -4
- package/dist/src/generators/component/component.js +1 -0
- package/dist/src/generators/component/files/__fileName__.ts__tpl__ +3 -2
- package/dist/src/generators/component/lib/index.d.ts +1 -0
- package/dist/src/generators/component/lib/index.js +1 -0
- package/dist/src/generators/component/lib/normalize-options.js +2 -4
- package/dist/src/generators/component/lib/validate-options.d.ts +3 -0
- package/dist/src/generators/component/lib/validate-options.js +10 -0
- package/dist/src/generators/component/schema.d.ts +1 -1
- package/dist/src/generators/component/schema.json +3 -4
- package/dist/src/generators/convert-to-application-executor/convert-to-application-executor.js +1 -6
- package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +1 -2
- package/dist/src/generators/directive/lib/normalize-options.js +0 -5
- package/dist/src/generators/directive/schema.json +1 -1
- package/dist/src/generators/library/lib/normalized-schema.d.ts +1 -1
- package/dist/src/generators/library/lib/update-tsconfig-files.js +6 -14
- package/dist/src/generators/library/schema.d.ts +1 -1
- package/dist/src/generators/library/schema.json +2 -3
- package/dist/src/generators/pipe/lib/normalize-options.js +1 -3
- package/dist/src/generators/pipe/schema.json +1 -1
- package/dist/src/generators/remote/lib/update-ssr-setup.js +1 -4
- package/dist/src/generators/scam/lib/normalize-options.js +0 -5
- package/dist/src/generators/scam/schema.d.ts +1 -1
- package/dist/src/generators/scam/schema.json +3 -4
- package/dist/src/generators/scam-directive/lib/normalize-options.js +0 -5
- package/dist/src/generators/scam-directive/schema.json +1 -1
- package/dist/src/generators/scam-pipe/lib/normalize-options.js +1 -3
- package/dist/src/generators/scam-pipe/schema.json +1 -1
- package/dist/src/generators/setup-mf/setup-mf.js +4 -7
- package/dist/src/generators/setup-ssr/lib/add-dependencies.js +1 -4
- package/dist/src/generators/setup-ssr/lib/add-server-file.js +3 -13
- package/dist/src/generators/setup-ssr/lib/generate-files.js +5 -27
- package/dist/src/generators/setup-ssr/lib/generate-server-ts-config.js +11 -20
- package/dist/src/generators/setup-ssr/lib/normalize-options.js +0 -17
- package/dist/src/generators/setup-ssr/lib/update-project-config.js +1 -6
- package/dist/src/generators/setup-ssr/lib/validate-options.js +0 -14
- package/dist/src/generators/setup-ssr/schema.d.ts +0 -1
- package/dist/src/generators/setup-ssr/schema.json +0 -4
- package/dist/src/generators/utils/app-components-info.js +1 -5
- package/dist/src/generators/utils/artifact-types.js +2 -10
- package/dist/src/generators/utils/ensure-angular-dependencies.js +0 -5
- package/dist/src/generators/utils/update-project-root-tsconfig.js +4 -4
- package/dist/src/generators/utils/version-utils.d.ts +0 -5
- package/dist/src/generators/utils/version-utils.js +0 -13
- package/dist/src/migrations/update-23-1-0/add-istanbul-instrumenter.d.ts +2 -0
- package/dist/src/migrations/update-23-1-0/add-istanbul-instrumenter.js +56 -0
- package/dist/src/migrations/update-23-1-0/add-istanbul-instrumenter.md +65 -0
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.d.ts +2 -0
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.js +61 -0
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.md +48 -0
- package/dist/src/migrations/update-23-1-0/rename-ssr-experimental-platform.d.ts +2 -0
- package/dist/src/migrations/update-23-1-0/rename-ssr-experimental-platform.js +70 -0
- package/dist/src/migrations/update-23-1-0/rename-ssr-experimental-platform.md +85 -0
- package/dist/src/utils/backward-compatible-versions.d.ts +2 -2
- package/dist/src/utils/backward-compatible-versions.js +23 -24
- package/dist/src/utils/versions.d.ts +7 -7
- package/dist/src/utils/versions.js +7 -7
- package/dist/src/utils/zoneless.d.ts +1 -1
- package/dist/types/nx-angular-mf.d.ts.map +1 -1
- package/dist/types/nx-angular.d.ts.map +1 -1
- package/migrations.json +188 -0
- package/package.json +18 -17
- package/dist/src/executors/extract-i18n/utils/validate-options.d.ts +0 -2
- package/dist/src/executors/extract-i18n/utils/validate-options.js +0 -13
- package/dist/src/executors/utilities/ng-packagr/package-imports.d.ts +0 -3
- package/dist/src/executors/utilities/ng-packagr/package-imports.js +0 -10
- package/dist/src/generators/application/files/base/tsconfig.editor.json__tpl__ +0 -5
- package/dist/src/generators/setup-ssr/files/v19/application-builder/ngmodule-src/__main__ +0 -1
- package/dist/src/generators/setup-ssr/files/v19/application-builder/ngmodule-src/app/__rootModuleFileName__ +0 -13
- package/dist/src/generators/setup-ssr/files/v19/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +0 -8
- package/dist/src/generators/setup-ssr/files/v19/application-builder/server/__serverFileName__ +0 -66
- package/dist/src/generators/setup-ssr/files/v19/application-builder/standalone-src/__main__ +0 -12
- package/dist/src/generators/setup-ssr/files/v19/application-builder/standalone-src/app/app.config.server.ts__tpl__ +0 -14
- package/dist/src/generators/setup-ssr/files/v19/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +0 -8
- package/dist/src/generators/setup-ssr/files/v19/application-builder-common-engine/server/__serverFileName__ +0 -67
- package/dist/src/generators/setup-ssr/files/v19/server-builder/ngmodule-src/__main__ +0 -1
- package/dist/src/generators/setup-ssr/files/v19/server-builder/ngmodule-src/app/__rootModuleFileName__ +0 -14
- package/dist/src/generators/setup-ssr/files/v19/server-builder/root/tsconfig.server.json.template +0 -16
- package/dist/src/generators/setup-ssr/files/v19/server-builder/server/__serverFileName__ +0 -69
- package/dist/src/generators/setup-ssr/files/v19/server-builder/standalone-src/__main__ +0 -12
- package/dist/src/generators/setup-ssr/files/v19/server-builder/standalone-src/app/app.config.server.ts.template +0 -11
package/README.md
CHANGED
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
<div style="text-align: center;">
|
|
9
9
|
|
|
10
|
-
[](https://circleci.com/gh/nrwl/nx)
|
|
11
10
|
[]()
|
|
12
11
|
[](https://www.npmjs.com/package/nx)
|
|
13
12
|
[]()
|
|
14
13
|
[](http://commitizen.github.io/cz-cli/)
|
|
15
|
-
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
16
14
|
[](https://go.nx.dev/community)
|
|
15
|
+
[](https://nx.dev/docs/features/ci-features/sandboxing)
|
|
17
16
|
|
|
18
17
|
</div>
|
|
19
18
|
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
},
|
|
78
78
|
"allowedHosts": {
|
|
79
79
|
"type": "array",
|
|
80
|
-
"description": "List of hosts that are allowed to access the dev server.
|
|
80
|
+
"description": "List of hosts that are allowed to access the dev server.",
|
|
81
81
|
"default": [],
|
|
82
82
|
"items": {
|
|
83
83
|
"type": "string"
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
"disableHostCheck": {
|
|
98
98
|
"type": "boolean",
|
|
99
|
-
"description": "Don't verify connected clients are part of allowed hosts.
|
|
99
|
+
"description": "Don't verify connected clients are part of allowed hosts.",
|
|
100
100
|
"default": false
|
|
101
101
|
},
|
|
102
102
|
"hmr": {
|
|
@@ -78,7 +78,7 @@ function executeWebpackBrowserBuilder(options, context) {
|
|
|
78
78
|
if (workspaceDependencies.length > 0) {
|
|
79
79
|
const skipInitialRun = shouldSkipInitialTargetRun(projectGraph, context.target.project, context.target.target);
|
|
80
80
|
baseWebpackConfig.plugins.push(
|
|
81
|
-
//
|
|
81
|
+
// Cast away the angular/webpack plugin type difference (webpack versions).
|
|
82
82
|
new internal_1.WebpackNxBuildCoordinationPlugin(`nx run-many --target=${context.target.target} --projects=${workspaceDependencies.join(',')}`, { skipInitialRun, skipWatchingDeps: !watchDependencies }));
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = applicationExecutor;
|
|
4
4
|
const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
|
|
5
|
-
const angular_version_utils_1 = require("../utilities/angular-version-utils");
|
|
6
5
|
const buildable_libs_1 = require("../utilities/buildable-libs");
|
|
7
6
|
const builder_package_1 = require("../utilities/builder-package");
|
|
8
7
|
const esbuild_extensions_1 = require("../utilities/esbuild-extensions");
|
|
@@ -10,8 +9,7 @@ const normalize_options_1 = require("./utils/normalize-options");
|
|
|
10
9
|
const validate_options_1 = require("./utils/validate-options");
|
|
11
10
|
async function* applicationExecutor(options, context) {
|
|
12
11
|
(0, validate_options_1.validateOptions)(options);
|
|
13
|
-
|
|
14
|
-
const { buildLibsFromSource = true, plugins: pluginPaths, indexHtmlTransformer: indexHtmlTransformerPath, ...delegateExecutorOptions } = options;
|
|
12
|
+
const { buildLibsFromSource = true, plugins: pluginPaths, indexHtmlTransformer: indexHtmlTransformerPath, ...delegateExecutorOptions } = (0, normalize_options_1.normalizeOptions)(options);
|
|
15
13
|
let dependencies;
|
|
16
14
|
if (!buildLibsFromSource) {
|
|
17
15
|
const { tsConfigPath, dependencies: foundDependencies } = (0, buildable_libs_1.createTmpTsConfigForBuildableLibs)(delegateExecutorOptions.tsConfig, context);
|
|
@@ -27,17 +25,8 @@ async function* applicationExecutor(options, context) {
|
|
|
27
25
|
description: 'Build an application.',
|
|
28
26
|
optionSchema: require('./schema.json'),
|
|
29
27
|
}, context);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(0, builder_package_1.assertBuilderPackageIsInstalled)('@angular/build');
|
|
33
|
-
const { buildApplication } = await import('@angular/build');
|
|
34
|
-
return yield* buildApplication(delegateExecutorOptions, builderContext, {
|
|
35
|
-
codePlugins: plugins,
|
|
36
|
-
indexHtmlTransformer,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
(0, builder_package_1.assertBuilderPackageIsInstalled)('@angular-devkit/build-angular');
|
|
40
|
-
const { buildApplication } = await import('@angular-devkit/build-angular');
|
|
28
|
+
(0, builder_package_1.assertBuilderPackageIsInstalled)('@angular/build');
|
|
29
|
+
const { buildApplication } = await import('@angular/build');
|
|
41
30
|
return yield* buildApplication(delegateExecutorOptions, builderContext, {
|
|
42
31
|
codePlugins: plugins,
|
|
43
32
|
indexHtmlTransformer,
|
|
@@ -304,7 +304,7 @@
|
|
|
304
304
|
}
|
|
305
305
|
},
|
|
306
306
|
"conditions": {
|
|
307
|
-
"description": "Custom package resolution conditions used to resolve conditional exports/imports. Defaults to ['module', 'development'/'production']. The following special conditions are always present if the requirements are satisfied: 'default', 'import', 'require', 'browser', 'node'.
|
|
307
|
+
"description": "Custom package resolution conditions used to resolve conditional exports/imports. Defaults to ['module', 'development'/'production']. The following special conditions are always present if the requirements are satisfied: 'default', 'import', 'require', 'browser', 'node'.",
|
|
308
308
|
"type": "array",
|
|
309
309
|
"items": {
|
|
310
310
|
"type": "string"
|
|
@@ -389,7 +389,7 @@
|
|
|
389
389
|
},
|
|
390
390
|
"sourcesContent": {
|
|
391
391
|
"type": "boolean",
|
|
392
|
-
"description": "Output original source content for files within the source map.
|
|
392
|
+
"description": "Output original source content for files within the source map.",
|
|
393
393
|
"default": true
|
|
394
394
|
}
|
|
395
395
|
},
|
|
@@ -605,10 +605,16 @@
|
|
|
605
605
|
"type": "string",
|
|
606
606
|
"description": "The server entry-point that when executed will spawn the web server."
|
|
607
607
|
},
|
|
608
|
+
"platform": {
|
|
609
|
+
"description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules.",
|
|
610
|
+
"default": "node",
|
|
611
|
+
"enum": ["node", "neutral"]
|
|
612
|
+
},
|
|
608
613
|
"experimentalPlatform": {
|
|
609
614
|
"description": "Specifies the platform for which the server bundle is generated. This affects the APIs and modules available in the server-side code. \n\n- `node`: (Default) Generates a bundle optimized for Node.js environments. \n- `neutral`: Generates a platform-neutral bundle suitable for environments like edge workers, and other serverless platforms. This option avoids using Node.js-specific APIs, making the bundle more portable. \n\nPlease note that this feature does not provide polyfills for Node.js modules. Additionally, it is experimental, and the feature may undergo changes in future versions.",
|
|
610
615
|
"default": "node",
|
|
611
|
-
"enum": ["node", "neutral"]
|
|
616
|
+
"enum": ["node", "neutral"],
|
|
617
|
+
"x-deprecated": "Use 'platform' instead."
|
|
612
618
|
}
|
|
613
619
|
},
|
|
614
620
|
"additionalProperties": false
|
|
@@ -3,13 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
|
5
5
|
function normalizeOptions(options) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
return { ...options, ssr: coerceSsrPlatform(options.ssr) };
|
|
7
|
+
}
|
|
8
|
+
// `platform` is the option name from Angular v22 onwards; earlier majors use
|
|
9
|
+
// `experimentalPlatform`. We accept both and forward the one the installed
|
|
10
|
+
// builder understands so a `neutral` value is never silently dropped.
|
|
11
|
+
function coerceSsrPlatform(ssr) {
|
|
12
|
+
if (!ssr || typeof ssr !== 'object') {
|
|
13
|
+
return ssr;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
const { platform, experimentalPlatform, ...rest } = ssr;
|
|
16
|
+
const resolvedPlatform = platform ?? experimentalPlatform;
|
|
17
|
+
if (resolvedPlatform === undefined) {
|
|
18
|
+
return ssr;
|
|
19
|
+
}
|
|
20
|
+
// `validateOptions` runs first and asserts Angular is installed, so the
|
|
21
|
+
// version info is always present here.
|
|
22
|
+
const { major: angularMajorVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
23
|
+
return (angularMajorVersion >= 22
|
|
24
|
+
? { ...rest, platform: resolvedPlatform }
|
|
25
|
+
: { ...rest, experimentalPlatform: resolvedPlatform });
|
|
15
26
|
}
|
|
@@ -5,16 +5,6 @@ const semver_1 = require("semver");
|
|
|
5
5
|
const angular_version_utils_1 = require("../../utilities/angular-version-utils");
|
|
6
6
|
function validateOptions(options) {
|
|
7
7
|
const { version: angularVersion } = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
8
|
-
if ((0, semver_1.lt)(angularVersion, '20.0.0')) {
|
|
9
|
-
if (options.sourceMap &&
|
|
10
|
-
typeof options.sourceMap === 'object' &&
|
|
11
|
-
options.sourceMap.sourcesContent === false) {
|
|
12
|
-
throw new Error(`The "sourceMap.sourcesContent" option requires Angular version 20.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
13
|
-
}
|
|
14
|
-
if (options.conditions) {
|
|
15
|
-
throw new Error(`The "conditions" option requires Angular version 20.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
8
|
if ((0, semver_1.lt)(angularVersion, '21.2.0')) {
|
|
19
9
|
if (options.security?.allowedHosts) {
|
|
20
10
|
throw new Error(`The "security.allowedHosts" option requires Angular version 21.2.0 or greater. You are currently using version ${angularVersion}.`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NgEntryPoint as NgEntryPointBase } from 'ng-packagr/src/lib/ng-package/entry-point/entry-point';
|
|
2
2
|
import type { NgPackageConfig } from 'ng-packagr/src/ng-package.schema';
|
|
3
3
|
export type NgEntryPointType = NgEntryPointBase & {
|
|
4
4
|
primaryDestinationPath?: string;
|
|
@@ -1,28 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNgEntryPoint = createNgEntryPoint;
|
|
4
|
+
const entry_point_1 = require("ng-packagr/src/lib/ng-package/entry-point/entry-point");
|
|
5
|
+
const path_1 = require("ng-packagr/src/lib/utils/path");
|
|
4
6
|
const node_path_1 = require("node:path");
|
|
5
|
-
const ng_packagr_version_1 = require("../../../../utilities/ng-packagr/ng-packagr-version");
|
|
6
|
-
const package_imports_1 = require("../../../../utilities/ng-packagr/package-imports");
|
|
7
7
|
function createNgEntryPoint(packageJson, ngPackageJson, basePath, secondaryData) {
|
|
8
|
-
|
|
9
|
-
const { NgEntryPoint: NgEntryPointBase } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/entry-point/entry-point', ngPackagrMajorVersion);
|
|
10
|
-
if (ngPackagrMajorVersion < 20) {
|
|
11
|
-
class NgEntryPoint extends NgEntryPointBase {
|
|
12
|
-
/**
|
|
13
|
-
* Point the FESM2022 files to the ESM2022 files.
|
|
14
|
-
*/
|
|
15
|
-
get destinationFiles() {
|
|
16
|
-
const result = super.destinationFiles;
|
|
17
|
-
result.fesm2022 = result.esm2022;
|
|
18
|
-
result.fesm2022Dir = (0, node_path_1.dirname)(result.esm2022);
|
|
19
|
-
return result;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return new NgEntryPoint(packageJson, ngPackageJson, basePath, secondaryData);
|
|
23
|
-
}
|
|
24
|
-
const { ensureUnixPath } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/utils/path', ngPackagrMajorVersion);
|
|
25
|
-
class NgEntryPoint extends NgEntryPointBase {
|
|
8
|
+
class NgEntryPoint extends entry_point_1.NgEntryPoint {
|
|
26
9
|
constructor(packageJson, ngPackageJson, basePath, _secondaryData) {
|
|
27
10
|
super(packageJson, ngPackageJson, basePath, _secondaryData);
|
|
28
11
|
this.packageJson = packageJson;
|
|
@@ -43,7 +26,7 @@ function createNgEntryPoint(packageJson, ngPackageJson, basePath, secondaryData)
|
|
|
43
26
|
const flatModuleFile = this.flatModuleFile;
|
|
44
27
|
const pathJoinWithDest = (...paths) => (0, node_path_1.join)(primaryDestPath, ...paths);
|
|
45
28
|
return {
|
|
46
|
-
directory: ensureUnixPath(secondaryDir),
|
|
29
|
+
directory: (0, path_1.ensureUnixPath)(secondaryDir),
|
|
47
30
|
declarations: pathJoinWithDest('tmp-typings', secondaryDir, `${flatModuleFile}.d.ts`),
|
|
48
31
|
// changed to use esm2022
|
|
49
32
|
declarationsBundled: pathJoinWithDest(secondaryDir, `${flatModuleFile}.d.ts`),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TransformProvider } from 'ng-packagr/src/lib/graph/transform.di';
|
|
2
2
|
export declare function getWriteBundlesTransformProvider(): TransformProvider;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getWriteBundlesTransformProvider = getWriteBundlesTransformProvider;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const transform_di_1 = require("ng-packagr/src/lib/graph/transform.di");
|
|
5
|
+
const write_bundles_di_1 = require("ng-packagr/src/lib/ng-package/entry-point/write-bundles.di");
|
|
6
|
+
const options_di_1 = require("ng-packagr/src/lib/ng-package/options.di");
|
|
6
7
|
const write_bundles_transform_1 = require("./write-bundles.transform");
|
|
7
8
|
function getWriteBundlesTransformProvider() {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const { WRITE_BUNDLES_TRANSFORM_TOKEN } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/entry-point/write-bundles.di', ngPackagrMajorVersion);
|
|
11
|
-
const { OPTIONS_TOKEN } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/options.di', ngPackagrMajorVersion);
|
|
12
|
-
return provideTransform({
|
|
13
|
-
provide: WRITE_BUNDLES_TRANSFORM_TOKEN,
|
|
9
|
+
return (0, transform_di_1.provideTransform)({
|
|
10
|
+
provide: write_bundles_di_1.WRITE_BUNDLES_TRANSFORM_TOKEN,
|
|
14
11
|
useFactory: write_bundles_transform_1.writeBundlesTransform,
|
|
15
|
-
deps: [OPTIONS_TOKEN],
|
|
12
|
+
deps: [options_di_1.OPTIONS_TOKEN],
|
|
16
13
|
});
|
|
17
14
|
}
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.writeBundlesTransform = void 0;
|
|
12
|
+
const transform_1 = require("ng-packagr/src/lib/graph/transform");
|
|
13
|
+
const nodes_1 = require("ng-packagr/src/lib/ng-package/nodes");
|
|
14
|
+
const package_1 = require("ng-packagr/src/lib/ng-package/package");
|
|
12
15
|
const promises_1 = require("node:fs/promises");
|
|
13
16
|
const node_path_1 = require("node:path");
|
|
14
|
-
const ng_packagr_version_1 = require("../../../../utilities/ng-packagr/ng-packagr-version");
|
|
15
|
-
const package_imports_1 = require("../../../../utilities/ng-packagr/package-imports");
|
|
16
17
|
const entry_point_1 = require("./entry-point");
|
|
17
18
|
async function shouldWriteFile(filePath, newContent) {
|
|
18
19
|
try {
|
|
@@ -25,12 +26,8 @@ async function shouldWriteFile(filePath, newContent) {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
const writeBundlesTransform = (_options) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const { isEntryPointInProgress, isPackage } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/nodes', ngPackagrMajorVersion);
|
|
31
|
-
const { NgPackage } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/ng-package/package', ngPackagrMajorVersion);
|
|
32
|
-
return transformFromPromise(async (graph) => {
|
|
33
|
-
const entryPointNode = graph.find(isEntryPointInProgress());
|
|
29
|
+
return (0, transform_1.transformFromPromise)(async (graph) => {
|
|
30
|
+
const entryPointNode = graph.find((0, nodes_1.isEntryPointInProgress)());
|
|
34
31
|
if (!entryPointNode) {
|
|
35
32
|
return;
|
|
36
33
|
}
|
|
@@ -51,9 +48,9 @@ const writeBundlesTransform = (_options) => {
|
|
|
51
48
|
}
|
|
52
49
|
// Update package node only when processing the primary entry point
|
|
53
50
|
if (!entryPoint.isSecondaryEntryPoint) {
|
|
54
|
-
const packageNode = graph.find(isPackage);
|
|
51
|
+
const packageNode = graph.find(nodes_1.isPackage);
|
|
55
52
|
if (packageNode) {
|
|
56
|
-
packageNode.data = new NgPackage(packageNode.data.src, toCustomNgEntryPoint(packageNode.data.primary), packageNode.data.secondaries.map((secondary) => toCustomNgEntryPoint(secondary)));
|
|
53
|
+
packageNode.data = new package_1.NgPackage(packageNode.data.src, toCustomNgEntryPoint(packageNode.data.primary), packageNode.data.secondaries.map((secondary) => toCustomNgEntryPoint(secondary)));
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
56
|
});
|
|
@@ -42,6 +42,14 @@
|
|
|
42
42
|
"type": "boolean",
|
|
43
43
|
"description": "Forces all configured browsers to run in headless mode. When using the Vitest runner, this option is ignored if no browsers are configured. The Karma runner does not support this option. _Note: this is only supported in Angular versions >= 21.2.0_."
|
|
44
44
|
},
|
|
45
|
+
"isolate": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Enables isolation for test execution. When true, Vitest runs tests in separate threads or processes. This option is only available for the Vitest runner. Defaults to false to align with the Karma/Jasmine experience. _Note: this is only supported in Angular versions >= 22.0.0_."
|
|
48
|
+
},
|
|
49
|
+
"quiet": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "Suppresses the verbose build summary and stats table on each rebuild. Defaults to `true` locally and `false` in CI environments. _Note: this is only supported in Angular versions >= 22.0.0_."
|
|
52
|
+
},
|
|
45
53
|
"include": {
|
|
46
54
|
"type": "array",
|
|
47
55
|
"items": {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { BuilderOutput } from '@angular-devkit/architect';
|
|
2
1
|
import type { ExecutorContext } from '@nx/devkit';
|
|
3
2
|
import type { UnitTestExecutorOptions } from './schema';
|
|
4
|
-
export default function unitTestExecutor(options: UnitTestExecutorOptions, context: ExecutorContext):
|
|
3
|
+
export default function unitTestExecutor(options: UnitTestExecutorOptions, context: ExecutorContext): AsyncGenerator<import("@angular-devkit/architect").BuilderOutput, any, any>;
|
|
@@ -39,6 +39,14 @@ function validateOptions(options) {
|
|
|
39
39
|
throw new Error(`The "headless" option requires Angular version 21.2.0 or greater. You are currently using version ${angularVersion}.`);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
if ((0, semver_1.lt)(angularVersion, '22.0.0')) {
|
|
43
|
+
if (options.isolate !== undefined) {
|
|
44
|
+
throw new Error(`The "isolate" option requires Angular version 22.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
45
|
+
}
|
|
46
|
+
if (options.quiet !== undefined) {
|
|
47
|
+
throw new Error(`The "quiet" option requires Angular version 22.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
/**
|
|
44
52
|
* The Angular CLI unit-test builder only accepts the `@angular/build:application`
|
|
@@ -3,7 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.loadPlugins = loadPlugins;
|
|
4
4
|
exports.loadMiddleware = loadMiddleware;
|
|
5
5
|
exports.loadIndexHtmlTransformer = loadIndexHtmlTransformer;
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const node_fs_1 = require("node:fs");
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
6
9
|
const module_loader_1 = require("./module-loader");
|
|
10
|
+
// Nx strips {workspaceRoot}/ and expands {projectRoot} in option paths to a
|
|
11
|
+
// path relative to the workspace root, but require() would resolve that against
|
|
12
|
+
// this file's directory. Anchor it to the workspace root, while leaving bare
|
|
13
|
+
// package specifiers (e.g. an esbuild plugin shipped as a package) untouched.
|
|
14
|
+
function resolveModulePath(path) {
|
|
15
|
+
if ((0, node_path_1.isAbsolute)(path)) {
|
|
16
|
+
return path;
|
|
17
|
+
}
|
|
18
|
+
const candidate = (0, node_path_1.join)(devkit_1.workspaceRoot, path);
|
|
19
|
+
return (0, node_fs_1.existsSync)(candidate) ? candidate : path;
|
|
20
|
+
}
|
|
7
21
|
async function loadPlugins(plugins, tsConfig) {
|
|
8
22
|
if (!plugins?.length) {
|
|
9
23
|
return [];
|
|
@@ -12,7 +26,7 @@ async function loadPlugins(plugins, tsConfig) {
|
|
|
12
26
|
}
|
|
13
27
|
async function loadPlugin(pluginSpec, tsConfig) {
|
|
14
28
|
const pluginPath = typeof pluginSpec === 'string' ? pluginSpec : pluginSpec.path;
|
|
15
|
-
let plugin = await (0, module_loader_1.loadModule)(pluginPath, tsConfig);
|
|
29
|
+
let plugin = await (0, module_loader_1.loadModule)(resolveModulePath(pluginPath), tsConfig);
|
|
16
30
|
if (typeof plugin === 'function') {
|
|
17
31
|
plugin =
|
|
18
32
|
typeof pluginSpec === 'object' ? plugin(pluginSpec.options) : plugin();
|
|
@@ -23,8 +37,8 @@ async function loadMiddleware(middlewareFns, tsConfig) {
|
|
|
23
37
|
if (!middlewareFns?.length) {
|
|
24
38
|
return [];
|
|
25
39
|
}
|
|
26
|
-
return Promise.all(middlewareFns.map((fnPath) => (0, module_loader_1.loadModule)(fnPath, tsConfig)));
|
|
40
|
+
return Promise.all(middlewareFns.map((fnPath) => (0, module_loader_1.loadModule)(resolveModulePath(fnPath), tsConfig)));
|
|
27
41
|
}
|
|
28
42
|
async function loadIndexHtmlTransformer(indexHtmlTransformerPath, tsConfig) {
|
|
29
|
-
return (0, module_loader_1.loadModule)(indexHtmlTransformerPath, tsConfig);
|
|
43
|
+
return (0, module_loader_1.loadModule)(resolveModulePath(indexHtmlTransformerPath), tsConfig);
|
|
30
44
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStylesheetProcessorFactoryProvider = getStylesheetProcessorFactoryProvider;
|
|
4
|
-
const
|
|
5
|
-
const package_imports_1 = require("./package-imports");
|
|
4
|
+
const stylesheet_processor_di_1 = require("ng-packagr/src/lib/styles/stylesheet-processor.di");
|
|
6
5
|
function getStylesheetProcessorFactoryProvider() {
|
|
7
|
-
const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
|
8
|
-
const { STYLESHEET_PROCESSOR_TOKEN } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/styles/stylesheet-processor.di', ngPackagrMajorVersion);
|
|
9
6
|
return {
|
|
10
|
-
provide: STYLESHEET_PROCESSOR_TOKEN,
|
|
7
|
+
provide: stylesheet_processor_di_1.STYLESHEET_PROCESSOR_TOKEN,
|
|
11
8
|
useFactory: () => {
|
|
12
9
|
const { getStylesheetProcessor } = require('./stylesheet-processor');
|
|
13
10
|
return getStylesheetProcessor();
|
|
@@ -11,8 +11,9 @@ exports.getStylesheetProcessor = getStylesheetProcessor;
|
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
const devkit_1 = require("@nx/devkit");
|
|
13
13
|
const browserslist_1 = tslib_1.__importDefault(require("browserslist"));
|
|
14
|
+
const component_stylesheets_1 = require("ng-packagr/src/lib/styles/component-stylesheets");
|
|
15
|
+
const postcss_configuration_1 = require("ng-packagr/src/lib/styles/postcss-configuration");
|
|
14
16
|
const ng_packagr_version_1 = require("./ng-packagr-version");
|
|
15
|
-
const package_imports_1 = require("./package-imports");
|
|
16
17
|
var CssUrl;
|
|
17
18
|
(function (CssUrl) {
|
|
18
19
|
CssUrl["inline"] = "inline";
|
|
@@ -20,11 +21,12 @@ var CssUrl;
|
|
|
20
21
|
})(CssUrl || (exports.CssUrl = CssUrl = {}));
|
|
21
22
|
function getStylesheetProcessor() {
|
|
22
23
|
const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
|
23
|
-
|
|
24
|
-
const { generateSearchDirectories, getTailwindConfig, loadPostcssConfiguration, } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/styles/postcss-configuration', ngPackagrMajorVersion);
|
|
25
|
-
class StylesheetProcessor extends ComponentStylesheetBundler {
|
|
24
|
+
class StylesheetProcessor extends component_stylesheets_1.ComponentStylesheetBundler {
|
|
26
25
|
constructor(projectBasePath, basePath, cssUrl, includePaths, sass, cacheDirectory, watch) {
|
|
27
|
-
if (ngPackagrMajorVersion ===
|
|
26
|
+
if (ngPackagrMajorVersion === 22) {
|
|
27
|
+
browserslist_1.default.defaults = ['baseline widely available on 2026-05-07'];
|
|
28
|
+
}
|
|
29
|
+
else if (ngPackagrMajorVersion === 21) {
|
|
28
30
|
browserslist_1.default.defaults = ['baseline widely available on 2025-10-20'];
|
|
29
31
|
}
|
|
30
32
|
else if (ngPackagrMajorVersion === 20) {
|
|
@@ -32,27 +34,17 @@ function getStylesheetProcessor() {
|
|
|
32
34
|
path: require.resolve('ng-packagr/.browserslistrc'),
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
|
-
else if (ngPackagrMajorVersion < 20) {
|
|
36
|
-
browserslist_1.default.defaults = [
|
|
37
|
-
'last 2 Chrome versions',
|
|
38
|
-
'last 1 Firefox version',
|
|
39
|
-
'last 2 Edge major versions',
|
|
40
|
-
'last 2 Safari major versions',
|
|
41
|
-
'last 2 iOS major versions',
|
|
42
|
-
'Firefox ESR',
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
37
|
const browserslistData = (0, browserslist_1.default)(undefined, { path: basePath });
|
|
46
|
-
let searchDirs = generateSearchDirectories([projectBasePath]);
|
|
47
|
-
const postcssConfiguration = loadPostcssConfiguration(searchDirs);
|
|
38
|
+
let searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath]);
|
|
39
|
+
const postcssConfiguration = (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirs);
|
|
48
40
|
// (nx-specific): we support loading the TailwindCSS config from the root of the workspace
|
|
49
|
-
searchDirs = generateSearchDirectories([projectBasePath, devkit_1.workspaceRoot]);
|
|
41
|
+
searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath, devkit_1.workspaceRoot]);
|
|
50
42
|
super({
|
|
51
43
|
cacheDirectory: cacheDirectory,
|
|
52
44
|
postcssConfiguration: postcssConfiguration,
|
|
53
45
|
tailwindConfiguration: postcssConfiguration
|
|
54
46
|
? undefined
|
|
55
|
-
: getTailwindConfig(searchDirs, projectBasePath),
|
|
47
|
+
: (0, postcss_configuration_1.getTailwindConfig)(searchDirs, projectBasePath),
|
|
56
48
|
sass: sass,
|
|
57
49
|
workspaceRoot: projectBasePath,
|
|
58
50
|
cssUrl: cssUrl,
|
|
@@ -13,17 +13,15 @@ const tslib_1 = require("tslib");
|
|
|
13
13
|
const path_1 = require("path");
|
|
14
14
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
15
15
|
const module_loader_1 = require("./module-loader");
|
|
16
|
-
const ng_packagr_version_1 = require("./ng-packagr/ng-packagr-version");
|
|
17
16
|
async function readDefaultTsConfig(fileName) {
|
|
18
|
-
const ngPackagrVersion = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
|
19
17
|
// these options are mandatory
|
|
20
18
|
const extraOptions = {
|
|
21
19
|
target: ts.ScriptTarget.ES2022,
|
|
22
20
|
composite: false,
|
|
23
21
|
// sourcemaps
|
|
24
|
-
sourceMap:
|
|
22
|
+
sourceMap: true,
|
|
25
23
|
inlineSources: true,
|
|
26
|
-
inlineSourceMap:
|
|
24
|
+
inlineSourceMap: false,
|
|
27
25
|
outDir: '',
|
|
28
26
|
declaration: true,
|
|
29
27
|
// ng compiler
|
|
@@ -57,7 +57,6 @@ async function applicationGenerator(tree, schema) {
|
|
|
57
57
|
project: options.name,
|
|
58
58
|
standalone: options.standalone,
|
|
59
59
|
skipPackageJson: options.skipPackageJson,
|
|
60
|
-
serverRouting: options.serverRouting,
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
if (isRspack) {
|
|
@@ -78,22 +77,19 @@ async function applicationGenerator(tree, schema) {
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
if (!options.skipPackageJson) {
|
|
81
|
-
const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
|
|
82
80
|
const devDependencies = {};
|
|
83
81
|
const packageVersions = (0, version_utils_1.versions)(tree);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
devDependencies['@angular-devkit/build-angular'] = angularDevkitVersion;
|
|
96
|
-
}
|
|
82
|
+
const angularDevkitVersion = (0, version_utils_1.getInstalledAngularDevkitVersion)(tree) ??
|
|
83
|
+
packageVersions.angularDevkitVersion;
|
|
84
|
+
if (options.bundler === 'esbuild') {
|
|
85
|
+
devDependencies['@angular/build'] = angularDevkitVersion;
|
|
86
|
+
}
|
|
87
|
+
else if (isRspack) {
|
|
88
|
+
devDependencies['@angular/build'] = angularDevkitVersion;
|
|
89
|
+
devDependencies['@angular-devkit/build-angular'] = angularDevkitVersion;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
devDependencies['@angular-devkit/build-angular'] = angularDevkitVersion;
|
|
97
93
|
}
|
|
98
94
|
if (options.style === 'less') {
|
|
99
95
|
devDependencies['less'] = packageVersions.lessVersion;
|
|
@@ -4,12 +4,7 @@
|
|
|
4
4
|
"outDir": "<%= rootOffset %>dist/out-tsc",
|
|
5
5
|
"types": []
|
|
6
6
|
},
|
|
7
|
-
<%_ if (angularMajorVersion < 20) { _%>
|
|
8
|
-
"files": ["src/main.ts"],
|
|
9
|
-
"include": ["src/**/*.d.ts"],
|
|
10
|
-
<%_ } else { _%>
|
|
11
7
|
"include": ["src/**/*.ts"],
|
|
12
|
-
<%_ } _%>
|
|
13
8
|
"exclude": [
|
|
14
9
|
"src/**/*.spec.ts",
|
|
15
10
|
"src/**/*.test.ts"
|
|
@@ -18,11 +18,5 @@ describe('App<%= componentType %>', () => {
|
|
|
18
18
|
expect(compiled.querySelector('h1')?.textContent).toContain(
|
|
19
19
|
'Welcome <%= appName %>'
|
|
20
20
|
);
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
it(`should have as title '<%= appName %>'`, () => {
|
|
24
|
-
const fixture = TestBed.createComponent(App<%= componentType %>);
|
|
25
|
-
const app = fixture.componentInstance;
|
|
26
|
-
expect(app.title).toEqual('<%= appName %>');
|
|
27
|
-
});<% } %>
|
|
21
|
+
});
|
|
28
22
|
});
|
package/dist/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.ts__tpl__
CHANGED
|
@@ -10,5 +10,5 @@ import { Component<% if(viewEncapsulation) { %>, ViewEncapsulation<% } %> } from
|
|
|
10
10
|
encapsulation: ViewEncapsulation.<%= viewEncapsulation %>,<% } %>
|
|
11
11
|
})
|
|
12
12
|
export class App<%= componentType %> {<% if(!minimal) { %>
|
|
13
|
-
|
|
13
|
+
protected title = '<%= appName %>';
|
|
14
14
|
<% } %>}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NgModule
|
|
1
|
+
import { NgModule, provideBrowserGlobalErrorListeners } from '@angular/core';
|
|
2
2
|
import { BrowserModule } from '@angular/platform-browser';<% if(routing) { %>
|
|
3
3
|
import { RouterModule } from '@angular/router';<% } %>
|
|
4
4
|
import { App<%= componentType %> } from './app<%= componentFileSuffix %>';<% if(routing) { %>
|
|
@@ -11,7 +11,7 @@ import { NxWelcome<%= componentType %> } from './nx-welcome<%= componentFileSuff
|
|
|
11
11
|
BrowserModule,<% if(routing) { %>
|
|
12
12
|
RouterModule.forRoot(appRoutes),<% } %>
|
|
13
13
|
],
|
|
14
|
-
providers: [
|
|
14
|
+
providers: [provideBrowserGlobalErrorListeners()],
|
|
15
15
|
bootstrap: [App<%= componentType %>],
|
|
16
16
|
})
|
|
17
17
|
export class AppModule {}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
<%_ if (usePlatformBrowserDynamic) { _%>
|
|
2
|
-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3
|
-
<%_ } else { _%>
|
|
4
1
|
import { platformBrowser } from '@angular/platform-browser';
|
|
5
|
-
<%_ } _%>
|
|
6
2
|
import { AppModule } from './app/app<%= moduleTypeSeparator %>module';
|
|
7
3
|
|
|
8
|
-
<%_ if (usePlatformBrowserDynamic) { _%>
|
|
9
|
-
platformBrowserDynamic()
|
|
10
|
-
<%_ } else { _%>
|
|
11
4
|
platformBrowser()
|
|
12
|
-
<%_ } _%>
|
|
13
5
|
.bootstrapModule(AppModule<% if (!zoneless) { %>, { ngZoneEventCoalescing: true }<% } %>)
|
|
14
6
|
.catch((err) => console.error(err));
|
package/dist/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ApplicationConfig
|
|
1
|
+
import { ApplicationConfig, provideBrowserGlobalErrorListeners<% if (!zoneless) { %>, provideZoneChangeDetection<% } %> } from '@angular/core';<% if (routing) { %>
|
|
2
2
|
import { provideRouter } from '@angular/router';
|
|
3
3
|
import { appRoutes } from './app.routes';<% } %>
|
|
4
4
|
|
|
5
5
|
export const appConfig: ApplicationConfig = {
|
|
6
|
-
providers: [
|
|
7
|
-
provideBrowserGlobalErrorListeners(),<%
|
|
6
|
+
providers: [
|
|
7
|
+
provideBrowserGlobalErrorListeners(),<% if (!zoneless) { %>
|
|
8
8
|
provideZoneChangeDetection({ eventCoalescing: true }),<% } %><% if (routing) { %>
|
|
9
9
|
provideRouter(appRoutes)<% } %>
|
|
10
10
|
]
|