@nx/angular 22.2.4 → 22.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/executors.json +5 -0
- package/migrations.json +200 -291
- package/package.json +18 -18
- package/src/builders/dev-server/lib/normalize-options.d.ts.map +1 -1
- package/src/builders/dev-server/lib/normalize-options.js +1 -3
- package/src/builders/dev-server/lib/validate-options.d.ts.map +1 -1
- package/src/builders/dev-server/lib/validate-options.js +6 -5
- package/src/builders/dev-server/schema.d.ts +1 -0
- package/src/builders/dev-server/schema.json +9 -2
- package/src/executors/application/application.impl.js +1 -1
- package/src/executors/application/schema.json +11 -9
- package/src/executors/application/utils/normalize-options.d.ts.map +1 -1
- package/src/executors/application/utils/normalize-options.js +1 -27
- package/src/executors/application/utils/validate-options.d.ts.map +1 -1
- package/src/executors/application/utils/validate-options.js +0 -17
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +1 -1
- package/src/executors/extract-i18n/extract-i18n.impl.js +1 -1
- package/src/executors/unit-test/schema.d.ts +7 -0
- package/src/executors/unit-test/schema.json +320 -0
- package/src/executors/unit-test/unit-test.impl.d.ts +5 -0
- package/src/executors/unit-test/unit-test.impl.d.ts.map +1 -0
- package/src/executors/unit-test/unit-test.impl.js +111 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts.map +1 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts.map +1 -1
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +2 -6
- package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.js → stylesheet-processor.js} +2 -2
- package/src/generators/application/application.d.ts +1 -1
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +6 -1
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +2 -4
- package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
- package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +1 -3
- package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/files/rspack-ssr/server.ts__tmpl__ +6 -0
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
- package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
- package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/lib/add-unit-test-runner.d.ts +1 -1
- package/src/generators/application/lib/add-unit-test-runner.d.ts.map +1 -1
- package/src/generators/application/lib/add-unit-test-runner.js +13 -2
- package/src/generators/application/lib/create-files.d.ts.map +1 -1
- package/src/generators/application/lib/create-files.js +1 -3
- package/src/generators/application/lib/create-project.js +12 -10
- package/src/generators/application/lib/enable-strict-type-checking.js +1 -1
- package/src/generators/application/lib/index.d.ts +2 -1
- package/src/generators/application/lib/index.d.ts.map +1 -1
- package/src/generators/application/lib/index.js +2 -1
- package/src/generators/application/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/application/lib/normalize-options.js +12 -2
- package/src/generators/application/lib/update-tsconfig-files.d.ts.map +1 -1
- package/src/generators/application/lib/update-tsconfig-files.js +6 -17
- package/src/generators/application/lib/validate-options.d.ts +4 -0
- package/src/generators/application/lib/validate-options.d.ts.map +1 -0
- package/src/generators/application/lib/validate-options.js +26 -0
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +7 -4
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +4 -3
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +1 -1
- package/src/generators/component/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/component-test/component-test.d.ts +3 -3
- package/src/generators/component-test/component-test.d.ts.map +1 -1
- package/src/generators/component-test/component-test.js +9 -0
- package/src/generators/component-test/schema.d.ts +1 -0
- package/src/generators/component-test/schema.json +6 -0
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts.map +1 -1
- package/src/generators/convert-to-rspack/convert-to-rspack.js +1 -4
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +50 -22
- package/src/generators/cypress-component-configuration/schema.d.ts +1 -0
- package/src/generators/cypress-component-configuration/schema.json +6 -0
- package/src/generators/directive/directive.d.ts.map +1 -1
- package/src/generators/directive/directive.js +0 -3
- package/src/generators/directive/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/federate-module/federate-module.d.ts +1 -1
- package/src/generators/federate-module/federate-module.d.ts.map +1 -1
- package/src/generators/federate-module/federate-module.js +8 -0
- package/src/generators/federate-module/lib/add-remote.js +1 -1
- package/src/generators/federate-module/schema.d.ts +2 -2
- package/src/generators/federate-module/schema.json +3 -4
- package/src/generators/host/files/common/src/main.server.ts__tmpl__ +8 -1
- package/src/generators/host/host.d.ts.map +1 -1
- package/src/generators/host/host.js +5 -1
- package/src/generators/host/lib/index.d.ts +1 -0
- package/src/generators/host/lib/index.d.ts.map +1 -1
- package/src/generators/host/lib/index.js +1 -0
- package/src/generators/host/lib/update-ssr-setup.d.ts.map +1 -1
- package/src/generators/host/lib/update-ssr-setup.js +6 -4
- package/src/generators/host/lib/validate-options.d.ts +4 -0
- package/src/generators/host/lib/validate-options.d.ts.map +1 -0
- package/src/generators/host/lib/validate-options.js +12 -0
- package/src/generators/host/schema.d.ts +2 -2
- package/src/generators/host/schema.json +5 -6
- package/src/generators/library/files/base/tsconfig.lib.json__tpl__ +3 -5
- package/src/generators/library/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/library/lib/normalize-options.js +10 -3
- package/src/generators/library/lib/update-tsconfig-files.d.ts.map +1 -1
- package/src/generators/library/lib/update-tsconfig-files.js +15 -6
- package/src/generators/library/lib/validate-options.d.ts +4 -0
- package/src/generators/library/lib/validate-options.d.ts.map +1 -0
- package/src/generators/library/lib/validate-options.js +27 -0
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +20 -13
- package/src/generators/library/schema.json +3 -4
- package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts +16 -0
- package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts.map +1 -0
- package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.js +161 -0
- package/src/generators/ng-add/migrators/builders/index.d.ts +1 -0
- package/src/generators/ng-add/migrators/builders/index.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/builders/index.js +1 -0
- package/src/generators/ng-add/migrators/projects/app.migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/projects/app.migrator.js +1 -0
- package/src/generators/ng-add/migrators/projects/lib.migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/projects/lib.migrator.js +1 -0
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/pipe/pipe.d.ts.map +1 -1
- package/src/generators/pipe/pipe.js +0 -5
- package/src/generators/remote/files/common/src/main.server.ts__tmpl__ +8 -1
- package/src/generators/remote/lib/index.d.ts +1 -0
- package/src/generators/remote/lib/index.d.ts.map +1 -1
- package/src/generators/remote/lib/index.js +1 -0
- package/src/generators/remote/lib/update-ssr-setup.d.ts +2 -1
- package/src/generators/remote/lib/update-ssr-setup.d.ts.map +1 -1
- package/src/generators/remote/lib/update-ssr-setup.js +7 -7
- package/src/generators/remote/lib/validate-options.d.ts +4 -0
- package/src/generators/remote/lib/validate-options.d.ts.map +1 -0
- package/src/generators/remote/lib/validate-options.js +12 -0
- package/src/generators/remote/remote.d.ts.map +1 -1
- package/src/generators/remote/remote.js +6 -1
- package/src/generators/remote/schema.d.ts +2 -2
- package/src/generators/remote/schema.json +5 -6
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +1 -1
- package/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +5 -6
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +1 -2
- package/src/generators/setup-mf/lib/add-remote-entry.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js +0 -5
- package/src/generators/setup-mf/lib/update-host-app-routes.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/update-host-app-routes.js +9 -6
- package/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +2 -2
- package/src/generators/setup-ssr/files/v20+/server-builder/server/__serverFileName__ +6 -0
- package/src/generators/setup-ssr/lib/add-hydration.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/add-hydration.js +2 -8
- package/src/generators/setup-ssr/lib/add-server-file.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/add-server-file.js +7 -7
- package/src/generators/setup-ssr/lib/generate-files.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/generate-files.js +2 -7
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +26 -12
- package/src/generators/setup-ssr/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/normalize-options.js +1 -5
- package/src/generators/setup-ssr/lib/update-project-config.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +6 -17
- package/src/generators/setup-ssr/lib/validate-options.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/validate-options.js +9 -0
- package/src/generators/utils/add-jest.d.ts +2 -0
- package/src/generators/utils/add-jest.d.ts.map +1 -1
- package/src/generators/utils/add-jest.js +41 -11
- package/src/generators/utils/add-vitest.d.ts +11 -2
- package/src/generators/utils/add-vitest.d.ts.map +1 -1
- package/src/generators/utils/add-vitest.js +173 -6
- package/src/generators/utils/assert-mf-utils.d.ts +1 -1
- package/src/generators/utils/assert-mf-utils.d.ts.map +1 -1
- package/src/generators/utils/assert-mf-utils.js +1 -4
- package/src/generators/utils/ensure-angular-dependencies.d.ts +1 -1
- package/src/generators/utils/ensure-angular-dependencies.d.ts.map +1 -1
- package/src/generators/utils/ensure-angular-dependencies.js +6 -4
- package/src/generators/utils/storybook-ast/component-info.js +2 -10
- package/src/generators/utils/tsconfig-utils.d.ts +13 -0
- package/src/generators/utils/tsconfig-utils.d.ts.map +1 -0
- package/src/generators/utils/tsconfig-utils.js +29 -0
- package/src/generators/utils/version-utils.d.ts +13 -3
- package/src/generators/utils/version-utils.d.ts.map +1 -1
- package/src/generators/utils/version-utils.js +11 -18
- package/src/migrations/update-22-3-0/update-angular-cli.d.ts +4 -0
- package/src/migrations/update-22-3-0/update-angular-cli.d.ts.map +1 -0
- package/src/migrations/{update-16-4-0 → update-22-3-0}/update-angular-cli.js +1 -1
- package/src/migrations/update-22-3-0/update-module-resolution.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-module-resolution.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-module-resolution.js +61 -0
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.js +111 -0
- package/src/migrations/update-22-3-0/update-typescript-lib.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-typescript-lib.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-typescript-lib.js +98 -0
- package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-unit-test-runner-option.js +44 -0
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +40 -24
- package/src/utils/backward-compatible-versions.d.ts +7 -9
- package/src/utils/backward-compatible-versions.d.ts.map +1 -1
- package/src/utils/backward-compatible-versions.js +20 -14
- package/src/utils/nx-devkit/ast-utils.d.ts.map +1 -1
- package/src/utils/nx-devkit/ast-utils.js +2 -13
- package/src/utils/targets.d.ts +6 -1
- package/src/utils/targets.d.ts.map +1 -1
- package/src/utils/targets.js +20 -3
- package/src/utils/test-runners.d.ts +2 -1
- package/src/utils/test-runners.d.ts.map +1 -1
- package/src/utils/test-runners.js +2 -1
- package/src/utils/version-utils.d.ts +2 -2
- package/src/utils/version-utils.d.ts.map +1 -1
- package/src/utils/version-utils.js +3 -2
- package/src/utils/versions.d.ts +7 -6
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +8 -7
- package/src/utils/zoneless.d.ts +3 -0
- package/src/utils/zoneless.d.ts.map +1 -0
- package/src/utils/zoneless.js +28 -0
- package/{mf/index.d.ts → types/nx-angular-mf.d.ts} +1 -1
- package/types/nx-angular-mf.d.ts.map +1 -0
- package/types/nx-angular.d.ts +3 -0
- package/types/nx-angular.d.ts.map +1 -0
- package/index.d.ts +0 -3
- package/index.d.ts.map +0 -1
- package/mf/index.d.ts.map +0 -1
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts +0 -28
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts.map +0 -1
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.js +0 -159
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts.map +0 -1
- package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/__main__ +0 -1
- package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/app/__rootModuleFileName__ +0 -14
- package/src/generators/setup-ssr/files/pre-v19/root/tsconfig.server.json__tpl__ +0 -15
- package/src/generators/setup-ssr/files/pre-v19/server/application-builder/__serverFileName__ +0 -57
- package/src/generators/setup-ssr/files/pre-v19/server/server-builder/__serverFileName__ +0 -72
- package/src/generators/setup-ssr/files/pre-v19/standalone-src/__main__ +0 -12
- package/src/generators/setup-ssr/files/pre-v19/standalone-src/app/app.config.server.ts__tpl__ +0 -11
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts +0 -3
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts.map +0 -1
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +0 -122
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts +0 -3
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts.map +0 -1
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +0 -34
- package/src/migrations/update-16-4-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-16-4-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts +0 -3
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts.map +0 -1
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +0 -34
- package/src/migrations/update-16-7-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-16-7-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-16-7-0/update-angular-cli.js +0 -14
- /package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.d.ts → stylesheet-processor.d.ts} +0 -0
package/src/utils/targets.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allProjectTargets = allProjectTargets;
|
|
4
4
|
exports.allTargetOptions = allTargetOptions;
|
|
5
|
+
exports.targetFromTargetString = targetFromTargetString;
|
|
5
6
|
function* allProjectTargets(project) {
|
|
6
|
-
for (const
|
|
7
|
-
yield [name,
|
|
7
|
+
for (const name of Object.keys(project.targets ?? {})) {
|
|
8
|
+
yield [name, project.targets[name]];
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
function* allTargetOptions(target) {
|
|
@@ -14,9 +15,25 @@ function* allTargetOptions(target) {
|
|
|
14
15
|
if (!target.configurations) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
|
-
for (const
|
|
18
|
+
for (const name of Object.keys(target.configurations)) {
|
|
19
|
+
const options = target.configurations[name];
|
|
18
20
|
if (options !== undefined) {
|
|
19
21
|
yield [name, options];
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Return a Target tuple from a specifier string.
|
|
27
|
+
* Supports abbreviated target specifiers (examples: `::`, `::development`, or `:build:production`).
|
|
28
|
+
*/
|
|
29
|
+
function targetFromTargetString(specifier, abbreviatedProjectName, abbreviatedTargetName) {
|
|
30
|
+
const tuple = specifier.split(':', 3);
|
|
31
|
+
if (tuple.length < 2) {
|
|
32
|
+
throw new Error('Invalid target string: ' + JSON.stringify(specifier));
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
project: tuple[0] || abbreviatedProjectName || '',
|
|
36
|
+
target: tuple[1] || abbreviatedTargetName || '',
|
|
37
|
+
...(tuple[2] !== undefined && { configuration: tuple[2] }),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-runners.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/test-runners.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,
|
|
1
|
+
{"version":3,"file":"test-runners.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/test-runners.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,aAAa,mBAAmB;IAChC,YAAY,kBAAkB;CAC/B;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,IAAI,SAAS;CACd"}
|
|
@@ -5,7 +5,8 @@ var UnitTestRunner;
|
|
|
5
5
|
(function (UnitTestRunner) {
|
|
6
6
|
UnitTestRunner["Jest"] = "jest";
|
|
7
7
|
UnitTestRunner["None"] = "none";
|
|
8
|
-
UnitTestRunner["
|
|
8
|
+
UnitTestRunner["VitestAngular"] = "vitest-angular";
|
|
9
|
+
UnitTestRunner["VitestAnalog"] = "vitest-analog";
|
|
9
10
|
})(UnitTestRunner || (exports.UnitTestRunner = UnitTestRunner = {}));
|
|
10
11
|
var E2eTestRunner;
|
|
11
12
|
(function (E2eTestRunner) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PackageCompatVersions,
|
|
1
|
+
import type { PackageCompatVersions, PackageVersionNames } from './backward-compatible-versions';
|
|
2
2
|
export declare function getPkgVersionForAngularMajorVersion(pkgVersionName: PackageVersionNames, angularMajorVersion: number): string;
|
|
3
|
-
export declare function getPkgVersionsForAngularMajorVersion(angularMajorVersion: number):
|
|
3
|
+
export declare function getPkgVersionsForAngularMajorVersion(angularMajorVersion: number): PackageCompatVersions;
|
|
4
4
|
//# sourceMappingURL=version-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/version-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/version-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AAKxC,wBAAgB,mCAAmC,CACjD,cAAc,EAAE,mBAAmB,EACnC,mBAAmB,EAAE,MAAM,GAC1B,MAAM,CAKR;AAED,wBAAgB,oCAAoC,CAClD,mBAAmB,EAAE,MAAM,GAC1B,qBAAqB,CAIvB"}
|
|
@@ -9,11 +9,12 @@ const versions = tslib_1.__importStar(require("./versions"));
|
|
|
9
9
|
const versions_1 = require("./versions");
|
|
10
10
|
function getPkgVersionForAngularMajorVersion(pkgVersionName, angularMajorVersion) {
|
|
11
11
|
return angularMajorVersion < (0, semver_1.major)((0, semver_1.coerce)(versions_1.angularVersion))
|
|
12
|
-
? backward_compatible_versions_1.backwardCompatibleVersions[
|
|
12
|
+
? backward_compatible_versions_1.backwardCompatibleVersions[angularMajorVersion]?.[pkgVersionName] ??
|
|
13
|
+
versions[pkgVersionName]
|
|
13
14
|
: versions[pkgVersionName];
|
|
14
15
|
}
|
|
15
16
|
function getPkgVersionsForAngularMajorVersion(angularMajorVersion) {
|
|
16
17
|
return angularMajorVersion < (0, semver_1.major)((0, semver_1.coerce)(versions_1.angularVersion))
|
|
17
|
-
? backward_compatible_versions_1.backwardCompatibleVersions[
|
|
18
|
+
? backward_compatible_versions_1.backwardCompatibleVersions[angularMajorVersion] ?? versions
|
|
18
19
|
: versions;
|
|
19
20
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const angularVersion = "~
|
|
3
|
-
export declare const angularDevkitVersion = "~
|
|
4
|
-
export declare const ngPackagrVersion = "~
|
|
2
|
+
export declare const angularVersion = "~21.0.0";
|
|
3
|
+
export declare const angularDevkitVersion = "~21.0.0";
|
|
4
|
+
export declare const ngPackagrVersion = "~21.0.0";
|
|
5
5
|
export declare const ngrxVersion = "^20.0.0";
|
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
7
7
|
export declare const zoneJsVersion = "~0.15.0";
|
|
8
|
-
export declare const angularJsVersion = "1.7.9";
|
|
9
8
|
export declare const tsLibVersion = "^2.3.0";
|
|
10
9
|
export declare const corsVersion = "~2.8.5";
|
|
11
10
|
export declare const typesCorsVersion = "~2.8.5";
|
|
@@ -15,7 +14,7 @@ export declare const browserSyncVersion = "^3.0.0";
|
|
|
15
14
|
export declare const moduleFederationNodeVersion = "^2.7.21";
|
|
16
15
|
export declare const moduleFederationEnhancedVersion = "^0.21.2";
|
|
17
16
|
export declare const webpackMergeVersion = "^5.8.0";
|
|
18
|
-
export declare const angularEslintVersion = "^
|
|
17
|
+
export declare const angularEslintVersion = "^21.0.1";
|
|
19
18
|
export declare const typescriptEslintVersion = "^7.16.0";
|
|
20
19
|
export declare const tailwindVersion = "^3.0.2";
|
|
21
20
|
export declare const postcssVersion = "^8.4.5";
|
|
@@ -23,8 +22,10 @@ export declare const postcssUrlVersion = "~10.1.3";
|
|
|
23
22
|
export declare const autoprefixerVersion = "^10.4.0";
|
|
24
23
|
export declare const tsNodeVersion = "10.9.1";
|
|
25
24
|
export declare const lessVersion = "^4.3.0";
|
|
26
|
-
export declare const jestPresetAngularVersion = "~
|
|
25
|
+
export declare const jestPresetAngularVersion = "~16.0.0";
|
|
27
26
|
export declare const typesNodeVersion = "20.19.9";
|
|
28
27
|
export declare const jasmineMarblesVersion = "^0.9.2";
|
|
28
|
+
export declare const vitestVersion = "^4.0.8";
|
|
29
|
+
export declare const jsdomVersion = "^27.1.0";
|
|
29
30
|
export declare const jsoncEslintParserVersion = "^2.1.0";
|
|
30
31
|
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,WAAW,YAAY,CAAC;AACrC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,+BAA+B,YAAY,CAAC;AACzD,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,WAAW,WAAW,CAAC;AAEpC,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAE9C,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,eAAO,MAAM,wBAAwB,WAAW,CAAC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.
|
|
3
|
+
exports.jsoncEslintParserVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.angularVersion = '~
|
|
6
|
-
exports.angularDevkitVersion = '~
|
|
7
|
-
exports.ngPackagrVersion = '~
|
|
5
|
+
exports.angularVersion = '~21.0.0';
|
|
6
|
+
exports.angularDevkitVersion = '~21.0.0';
|
|
7
|
+
exports.ngPackagrVersion = '~21.0.0';
|
|
8
8
|
exports.ngrxVersion = '^20.0.0';
|
|
9
9
|
exports.rxjsVersion = '~7.8.0';
|
|
10
10
|
exports.zoneJsVersion = '~0.15.0';
|
|
11
|
-
exports.angularJsVersion = '1.7.9';
|
|
12
11
|
exports.tsLibVersion = '^2.3.0';
|
|
13
12
|
exports.corsVersion = '~2.8.5';
|
|
14
13
|
exports.typesCorsVersion = '~2.8.5';
|
|
@@ -18,7 +17,7 @@ exports.browserSyncVersion = '^3.0.0';
|
|
|
18
17
|
exports.moduleFederationNodeVersion = '^2.7.21';
|
|
19
18
|
exports.moduleFederationEnhancedVersion = '^0.21.2';
|
|
20
19
|
exports.webpackMergeVersion = '^5.8.0';
|
|
21
|
-
exports.angularEslintVersion = '^
|
|
20
|
+
exports.angularEslintVersion = '^21.0.1';
|
|
22
21
|
exports.typescriptEslintVersion = '^7.16.0';
|
|
23
22
|
exports.tailwindVersion = '^3.0.2';
|
|
24
23
|
exports.postcssVersion = '^8.4.5';
|
|
@@ -26,7 +25,9 @@ exports.postcssUrlVersion = '~10.1.3';
|
|
|
26
25
|
exports.autoprefixerVersion = '^10.4.0';
|
|
27
26
|
exports.tsNodeVersion = '10.9.1';
|
|
28
27
|
exports.lessVersion = '^4.3.0';
|
|
29
|
-
exports.jestPresetAngularVersion = '~
|
|
28
|
+
exports.jestPresetAngularVersion = '~16.0.0';
|
|
30
29
|
exports.typesNodeVersion = '20.19.9';
|
|
31
30
|
exports.jasmineMarblesVersion = '^0.9.2';
|
|
31
|
+
exports.vitestVersion = '^4.0.8';
|
|
32
|
+
exports.jsdomVersion = '^27.1.0';
|
|
32
33
|
exports.jsoncEslintParserVersion = '^2.1.0';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoneless.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/zoneless.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAEzB,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAUpE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isZonelessApp = isZonelessApp;
|
|
4
|
+
function isZonelessApp(project) {
|
|
5
|
+
const buildTarget = findBuildTarget(project);
|
|
6
|
+
if (!buildTarget?.options?.polyfills) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
const polyfills = buildTarget.options.polyfills;
|
|
10
|
+
const polyfillsList = Array.isArray(polyfills) ? polyfills : [polyfills];
|
|
11
|
+
return !polyfillsList.includes('zone.js');
|
|
12
|
+
}
|
|
13
|
+
function findBuildTarget(project) {
|
|
14
|
+
for (const target of Object.values(project.targets ?? {})) {
|
|
15
|
+
if ([
|
|
16
|
+
'@angular-devkit/build-angular:browser',
|
|
17
|
+
'@angular-devkit/build-angular:browser-esbuild',
|
|
18
|
+
'@angular-devkit/build-angular:application',
|
|
19
|
+
'@angular/build:application',
|
|
20
|
+
'@nx/angular:application',
|
|
21
|
+
'@nx/angular:browser-esbuild',
|
|
22
|
+
'@nx/angular:webpack-browser',
|
|
23
|
+
].includes(target.executor)) {
|
|
24
|
+
return target;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return project.targets?.build ?? null;
|
|
28
|
+
}
|
|
@@ -69,4 +69,4 @@ declare function setRemoteDefinition(remoteName: string, remoteUrl: string): voi
|
|
|
69
69
|
declare function loadRemoteModule(remoteName: string, moduleName: string): Promise<any>;
|
|
70
70
|
|
|
71
71
|
export { loadRemoteModule, setRemoteDefinition, setRemoteDefinitions, setRemoteUrlResolver };
|
|
72
|
-
//# sourceMappingURL=
|
|
72
|
+
//# sourceMappingURL=nx-angular-mf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-angular-mf.d.ts","sources":["../../../../packages/angular/mf/mf.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEM;AASN;;AAEG;AACH;AAQA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACH;AAIA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACH;AAQA;;;;;;;;;;;;;;AAcG;AACH;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-angular.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/index.d.ts
DELETED
package/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/mf/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../../packages/angular/mf/mf.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEM;AASN;;AAEG;AACH;AAQA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACH;AAIA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACH;AAQA;;;;;;;;;;;;;;AAcG;AACH;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from the original ng-packagr source.
|
|
3
|
-
*
|
|
4
|
-
* Changes made:
|
|
5
|
-
* - Resolve `piscina` from the installed `ng-packagr` package.
|
|
6
|
-
* - Additionally search for the TailwindCSS config in the workspace root.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum CssUrl {
|
|
9
|
-
inline = "inline",
|
|
10
|
-
none = "none"
|
|
11
|
-
}
|
|
12
|
-
export declare class StylesheetProcessor {
|
|
13
|
-
private readonly projectBasePath;
|
|
14
|
-
private readonly basePath;
|
|
15
|
-
private readonly cssUrl?;
|
|
16
|
-
private readonly includePaths?;
|
|
17
|
-
private readonly cacheDirectory?;
|
|
18
|
-
private renderWorker;
|
|
19
|
-
constructor(projectBasePath: string, basePath: string, cssUrl?: CssUrl, includePaths?: string[], cacheDirectory?: string | false);
|
|
20
|
-
process({ filePath, content, }: {
|
|
21
|
-
filePath: string;
|
|
22
|
-
content: string;
|
|
23
|
-
}): Promise<string>;
|
|
24
|
-
/** Destory workers in pool. */
|
|
25
|
-
destroy(): void;
|
|
26
|
-
private createRenderWorker;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=stylesheet-processor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stylesheet-processor.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/angular/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,oBAAY,MAAM;IAChB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,qBAAa,mBAAmB;IAI5B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAC9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAPlC,OAAO,CAAC,YAAY,CAAkB;gBAGnB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,EAAE,EACvB,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK;IAgB5C,OAAO,CAAC,EACZ,QAAQ,EACR,OAAO,GACR,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,MAAM,CAAC;IAMnB,+BAA+B;IAC/B,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,kBAAkB;CAgE3B"}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from the original ng-packagr source.
|
|
4
|
-
*
|
|
5
|
-
* Changes made:
|
|
6
|
-
* - Resolve `piscina` from the installed `ng-packagr` package.
|
|
7
|
-
* - Additionally search for the TailwindCSS config in the workspace root.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.StylesheetProcessor = exports.CssUrl = void 0;
|
|
11
|
-
const tslib_1 = require("tslib");
|
|
12
|
-
const devkit_1 = require("@nx/devkit");
|
|
13
|
-
const browserslist_1 = tslib_1.__importDefault(require("browserslist"));
|
|
14
|
-
const fs_1 = require("fs");
|
|
15
|
-
const path_1 = require("path");
|
|
16
|
-
const ng_packagr_version_1 = require("../ng-packagr-version");
|
|
17
|
-
const package_imports_1 = require("../package-imports");
|
|
18
|
-
const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
|
|
19
|
-
const maxThreads = typeof maxWorkersVariable === 'string' && maxWorkersVariable !== ''
|
|
20
|
-
? +maxWorkersVariable
|
|
21
|
-
: 4;
|
|
22
|
-
var CssUrl;
|
|
23
|
-
(function (CssUrl) {
|
|
24
|
-
CssUrl["inline"] = "inline";
|
|
25
|
-
CssUrl["none"] = "none";
|
|
26
|
-
})(CssUrl || (exports.CssUrl = CssUrl = {}));
|
|
27
|
-
class StylesheetProcessor {
|
|
28
|
-
constructor(projectBasePath, basePath, cssUrl, includePaths, cacheDirectory) {
|
|
29
|
-
this.projectBasePath = projectBasePath;
|
|
30
|
-
this.basePath = basePath;
|
|
31
|
-
this.cssUrl = cssUrl;
|
|
32
|
-
this.includePaths = includePaths;
|
|
33
|
-
this.cacheDirectory = cacheDirectory;
|
|
34
|
-
// By default, browserslist defaults are too inclusive
|
|
35
|
-
// https://github.com/browserslist/browserslist/blob/83764ea81ffaa39111c204b02c371afa44a4ff07/index.js#L516-L522
|
|
36
|
-
// We change the default query to browsers that Angular support.
|
|
37
|
-
// https://angular.io/guide/browser-support
|
|
38
|
-
browserslist_1.default.defaults = [
|
|
39
|
-
'last 2 Chrome versions',
|
|
40
|
-
'last 1 Firefox version',
|
|
41
|
-
'last 2 Edge major versions',
|
|
42
|
-
'last 2 Safari major versions',
|
|
43
|
-
'last 2 iOS major versions',
|
|
44
|
-
'Firefox ESR',
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
async process({ filePath, content, }) {
|
|
48
|
-
this.createRenderWorker();
|
|
49
|
-
return this.renderWorker.run({ content, filePath });
|
|
50
|
-
}
|
|
51
|
-
/** Destory workers in pool. */
|
|
52
|
-
destroy() {
|
|
53
|
-
void this.renderWorker?.destroy();
|
|
54
|
-
}
|
|
55
|
-
createRenderWorker() {
|
|
56
|
-
if (this.renderWorker) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const styleIncludePaths = [...this.includePaths];
|
|
60
|
-
let prevDir = null;
|
|
61
|
-
let currentDir = this.basePath;
|
|
62
|
-
while (currentDir !== prevDir) {
|
|
63
|
-
const p = (0, path_1.join)(currentDir, 'node_modules');
|
|
64
|
-
if ((0, fs_1.existsSync)(p)) {
|
|
65
|
-
styleIncludePaths.push(p);
|
|
66
|
-
}
|
|
67
|
-
prevDir = currentDir;
|
|
68
|
-
currentDir = (0, path_1.dirname)(prevDir);
|
|
69
|
-
}
|
|
70
|
-
const browserslistData = (0, browserslist_1.default)(undefined, { path: this.basePath });
|
|
71
|
-
const { findTailwindConfiguration, generateSearchDirectories, loadPostcssConfiguration, } = require('ng-packagr/lib/styles/postcss-configuration');
|
|
72
|
-
let searchDirs = generateSearchDirectories([this.projectBasePath]);
|
|
73
|
-
const postcssConfiguration = loadPostcssConfiguration(searchDirs);
|
|
74
|
-
// (nx-specific): we support loading the TailwindCSS config from the root of the workspace
|
|
75
|
-
searchDirs = generateSearchDirectories([
|
|
76
|
-
this.projectBasePath,
|
|
77
|
-
devkit_1.workspaceRoot,
|
|
78
|
-
]);
|
|
79
|
-
const tailwindConfigPath = findTailwindConfiguration(searchDirs);
|
|
80
|
-
const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
|
81
|
-
const { colors } = (0, package_imports_1.importNgPackagrPath)('ng-packagr/src/lib/utils/color', ngPackagrMajorVersion);
|
|
82
|
-
const Piscina = getPiscina();
|
|
83
|
-
this.renderWorker = new Piscina({
|
|
84
|
-
filename: require.resolve('ng-packagr/lib/styles/stylesheet-processor-worker'),
|
|
85
|
-
maxThreads,
|
|
86
|
-
recordTiming: false,
|
|
87
|
-
env: {
|
|
88
|
-
...process.env,
|
|
89
|
-
FORCE_COLOR: '' + colors.enabled,
|
|
90
|
-
},
|
|
91
|
-
workerData: {
|
|
92
|
-
postcssConfiguration,
|
|
93
|
-
tailwindConfigPath,
|
|
94
|
-
projectBasePath: this.projectBasePath,
|
|
95
|
-
browserslistData,
|
|
96
|
-
targets: transformSupportedBrowsersToTargets(browserslistData),
|
|
97
|
-
cacheDirectory: this.cacheDirectory,
|
|
98
|
-
cssUrl: this.cssUrl,
|
|
99
|
-
styleIncludePaths,
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.StylesheetProcessor = StylesheetProcessor;
|
|
105
|
-
function transformSupportedBrowsersToTargets(supportedBrowsers) {
|
|
106
|
-
const transformed = [];
|
|
107
|
-
// https://esbuild.github.io/api/#target
|
|
108
|
-
const esBuildSupportedBrowsers = new Set([
|
|
109
|
-
'safari',
|
|
110
|
-
'firefox',
|
|
111
|
-
'edge',
|
|
112
|
-
'chrome',
|
|
113
|
-
'ios',
|
|
114
|
-
]);
|
|
115
|
-
for (const browser of supportedBrowsers) {
|
|
116
|
-
let [browserName, version] = browser.split(' ');
|
|
117
|
-
// browserslist uses the name `ios_saf` for iOS Safari whereas esbuild uses `ios`
|
|
118
|
-
if (browserName === 'ios_saf') {
|
|
119
|
-
browserName = 'ios';
|
|
120
|
-
}
|
|
121
|
-
// browserslist uses ranges `15.2-15.3` versions but only the lowest is required
|
|
122
|
-
// to perform minimum supported feature checks. esbuild also expects a single version.
|
|
123
|
-
[version] = version.split('-');
|
|
124
|
-
if (esBuildSupportedBrowsers.has(browserName)) {
|
|
125
|
-
if (browserName === 'safari' && version === 'tp') {
|
|
126
|
-
// esbuild only supports numeric versions so `TP` is converted to a high number (999) since
|
|
127
|
-
// a Technology Preview (TP) of Safari is assumed to support all currently known features.
|
|
128
|
-
version = '999';
|
|
129
|
-
}
|
|
130
|
-
transformed.push(browserName + version);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return transformed.length ? transformed : undefined;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Loads the `piscina` package from the installed `ng-packagr` package.
|
|
137
|
-
*/
|
|
138
|
-
function getPiscina() {
|
|
139
|
-
const ngPackagrPath = getInstalledNgPackagrPath();
|
|
140
|
-
try {
|
|
141
|
-
// Resolve the main piscina module entry point
|
|
142
|
-
const piscinaModulePath = require.resolve('piscina', {
|
|
143
|
-
paths: [ngPackagrPath],
|
|
144
|
-
});
|
|
145
|
-
return require(piscinaModulePath);
|
|
146
|
-
}
|
|
147
|
-
catch (error) {
|
|
148
|
-
throw new Error(`Failed to load the \`piscina\` package from \`ng-packagr\` dependencies: ${error.message}`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function getInstalledNgPackagrPath() {
|
|
152
|
-
try {
|
|
153
|
-
const ngPackagrPackageJsonPath = require.resolve('ng-packagr/package.json');
|
|
154
|
-
return (0, path_1.dirname)(ngPackagrPackageJsonPath);
|
|
155
|
-
}
|
|
156
|
-
catch (e) {
|
|
157
|
-
throw new Error('The `ng-packagr` package is not installed. The package is required to use this executor. Please install it in your workspace.');
|
|
158
|
-
}
|
|
159
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stylesheet-processor.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/angular/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAIhF,oBAAY,MAAM;IAChB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,wBAAgB,sBAAsB,IAAI,KACxC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,EAAE,EACvB,IAAI,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,EAC1C,cAAc,CAAC,EAAE,MAAM,GAAG,KAAK,EAC/B,KAAK,CAAC,EAAE,OAAO,KACZ;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAuEA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { <%= rootModuleClassName %> as default } from './app/<%= rootModuleFileName.slice(0, -3) %>';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { ServerModule } from '@angular/platform-server';
|
|
3
|
-
|
|
4
|
-
import { AppModule } from './app.module';
|
|
5
|
-
import { AppComponent } from './app.component';
|
|
6
|
-
|
|
7
|
-
@NgModule({
|
|
8
|
-
imports: [
|
|
9
|
-
AppModule,
|
|
10
|
-
ServerModule,
|
|
11
|
-
],
|
|
12
|
-
bootstrap: [AppComponent],
|
|
13
|
-
})
|
|
14
|
-
export class <%= rootModuleClassName %> {}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "./tsconfig.app.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/server",
|
|
6
|
-
"target": "es2019",
|
|
7
|
-
"types": [
|
|
8
|
-
"node"
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"src/<%= main %>",
|
|
13
|
-
"server.ts",
|
|
14
|
-
]
|
|
15
|
-
}
|
package/src/generators/setup-ssr/files/pre-v19/server/application-builder/__serverFileName__
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { APP_BASE_HREF } from '@angular/common';
|
|
2
|
-
import { CommonEngine } from '@angular/ssr';
|
|
3
|
-
import express from 'express';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import { dirname, join, resolve } from 'node:path';
|
|
6
|
-
import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './src/<%= main.slice(0, -3) %>';
|
|
7
|
-
|
|
8
|
-
// The Express app is exported so that it can be used by serverless Functions.
|
|
9
|
-
export function app(): express.Express {
|
|
10
|
-
const server = express();
|
|
11
|
-
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
|
|
12
|
-
const browserDistFolder = resolve(serverDistFolder, '../<%= browserDistDirectory %>');
|
|
13
|
-
const indexHtml = join(serverDistFolder, 'index.server.html');
|
|
14
|
-
|
|
15
|
-
const commonEngine = new CommonEngine();
|
|
16
|
-
|
|
17
|
-
server.set('view engine', 'html');
|
|
18
|
-
server.set('views', browserDistFolder);
|
|
19
|
-
|
|
20
|
-
// Example Express Rest API endpoints
|
|
21
|
-
// server.get('/api/**', (req, res) => { });
|
|
22
|
-
// Serve static files from /browser
|
|
23
|
-
server.get('**', express.static(browserDistFolder, {
|
|
24
|
-
maxAge: '1y',
|
|
25
|
-
index: 'index.html',
|
|
26
|
-
}));
|
|
27
|
-
|
|
28
|
-
// All regular routes use the Angular engine
|
|
29
|
-
server.get('**', (req, res, next) => {
|
|
30
|
-
const { protocol, originalUrl, baseUrl, headers } = req;
|
|
31
|
-
|
|
32
|
-
commonEngine
|
|
33
|
-
.render({
|
|
34
|
-
bootstrap<% if (!standalone) { %>: <%= rootModuleClassName %><% } %>,
|
|
35
|
-
documentFilePath: indexHtml,
|
|
36
|
-
url: `${protocol}://${headers.host}${originalUrl}`,
|
|
37
|
-
publicPath: browserDistFolder,
|
|
38
|
-
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
|
|
39
|
-
})
|
|
40
|
-
.then((html) => res.send(html))
|
|
41
|
-
.catch((err) => next(err));
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
return server;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function run(): void {
|
|
48
|
-
const port = process.env['PORT'] || <%= serverPort %>;
|
|
49
|
-
|
|
50
|
-
// Start up the Node server
|
|
51
|
-
const server = app();
|
|
52
|
-
server.listen(port, () => {
|
|
53
|
-
console.log(`Node Express server listening on http://localhost:${port}`);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
run();
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import 'zone.js/node';
|
|
2
|
-
|
|
3
|
-
import { APP_BASE_HREF } from '@angular/common';
|
|
4
|
-
import { CommonEngine } from '@angular/ssr';
|
|
5
|
-
import * as express from 'express';
|
|
6
|
-
import { existsSync } from 'node:fs';
|
|
7
|
-
import { join } from 'node:path';
|
|
8
|
-
import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './src/<%= main.slice(0, -3) %>';
|
|
9
|
-
|
|
10
|
-
// The Express app is exported so that it can be used by serverless Functions.
|
|
11
|
-
export function app(): express.Express {
|
|
12
|
-
const server = express();
|
|
13
|
-
const distFolder = join(process.cwd(), '<%= browserDistDirectory %>');
|
|
14
|
-
const indexHtml = existsSync(join(distFolder, 'index.original.html'))
|
|
15
|
-
? join(distFolder, 'index.original.html')
|
|
16
|
-
: join(distFolder, 'index.html');
|
|
17
|
-
|
|
18
|
-
const commonEngine = new CommonEngine();
|
|
19
|
-
|
|
20
|
-
server.set('view engine', 'html');
|
|
21
|
-
server.set('views', distFolder);
|
|
22
|
-
|
|
23
|
-
// Example Express Rest API endpoints
|
|
24
|
-
// server.get('/api/**', (req, res) => { });
|
|
25
|
-
// Serve static files from /browser
|
|
26
|
-
server.get(
|
|
27
|
-
'*.*',
|
|
28
|
-
express.static(distFolder, {
|
|
29
|
-
maxAge: '1y',
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
// All regular routes use the Angular engine
|
|
34
|
-
server.get('*', (req, res, next) => {
|
|
35
|
-
const { protocol, originalUrl, baseUrl, headers } = req;
|
|
36
|
-
|
|
37
|
-
commonEngine
|
|
38
|
-
.render({
|
|
39
|
-
bootstrap<% if (!standalone) { %>: <%= rootModuleClassName %><% } %>,
|
|
40
|
-
documentFilePath: indexHtml,
|
|
41
|
-
url: `${protocol}://${headers.host}${originalUrl}`,
|
|
42
|
-
publicPath: distFolder,
|
|
43
|
-
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
|
|
44
|
-
})
|
|
45
|
-
.then((html) => res.send(html))
|
|
46
|
-
.catch((err) => next(err));
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return server;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function run(): void {
|
|
53
|
-
const port = process.env['PORT'] || <%= serverPort %>;
|
|
54
|
-
|
|
55
|
-
// Start up the Node server
|
|
56
|
-
const server = app();
|
|
57
|
-
server.listen(port, () => {
|
|
58
|
-
console.log(`Node Express server listening on http://localhost:${port}`);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Webpack will replace 'require' with '__webpack_require__'
|
|
63
|
-
// '__non_webpack_require__' is a proxy to Node 'require'
|
|
64
|
-
// The below code is to ensure that the server is run only when not requiring the bundle.
|
|
65
|
-
declare const __non_webpack_require__: NodeRequire;
|
|
66
|
-
const mainModule = __non_webpack_require__.main;
|
|
67
|
-
const moduleFilename = mainModule && mainModule.filename || '';
|
|
68
|
-
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
|
|
69
|
-
run();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export default <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { <% if (useBootstrapContext) { %>BootstrapContext, <% } %>bootstrapApplication } from '@angular/platform-browser';
|
|
2
|
-
import { AppComponent } from './app/app.component';
|
|
3
|
-
import { config } from './app/app.config.server';
|
|
4
|
-
|
|
5
|
-
<%_ if (useBootstrapContext) { _%>
|
|
6
|
-
const bootstrap = (context: BootstrapContext) =>
|
|
7
|
-
bootstrapApplication(AppComponent, config, context);
|
|
8
|
-
<%_ } else { _%>
|
|
9
|
-
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
|
10
|
-
<%_ } _%>
|
|
11
|
-
|
|
12
|
-
export default bootstrap;
|
package/src/generators/setup-ssr/files/pre-v19/standalone-src/app/app.config.server.ts__tpl__
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
|
|
2
|
-
import { provideServerRendering } from '@angular/platform-server';
|
|
3
|
-
import { appConfig } from './app.config';
|
|
4
|
-
|
|
5
|
-
const serverConfig: ApplicationConfig = {
|
|
6
|
-
providers: [
|
|
7
|
-
provideServerRendering()
|
|
8
|
-
]
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const config = mergeApplicationConfig(appConfig, serverConfig);
|