@nx/angular 20.2.0-canary.20241129-2cb58b9 → 20.2.0-canary.20241203-6b87005
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 +1 -1
- package/fesm2022/nx-angular-mf.mjs.map +1 -1
- package/fesm2022/nx-angular-testing.mjs.map +1 -1
- package/fesm2022/nx-angular.mjs.map +1 -1
- package/generators.json +1 -1
- package/migrations.json +151 -1
- package/package.json +8 -15
- package/src/builders/dev-server/lib/normalize-options.js +3 -0
- package/src/builders/dev-server/lib/validate-options.js +1 -9
- package/src/builders/dev-server/schema.json +3 -4
- package/src/executors/application/application.impl.d.ts +1 -1
- package/src/executors/application/application.impl.js +4 -1
- package/src/executors/application/schema.json +78 -6
- package/src/executors/application/utils/normalize-options.d.ts +2 -0
- package/src/executors/application/utils/normalize-options.js +33 -0
- package/src/executors/application/utils/validate-options.js +18 -4
- package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +1 -1
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +0 -9
- package/src/executors/browser-esbuild/schema.json +1 -1
- package/src/executors/delegate-build/delegate-build.impl.d.ts +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +1 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +8 -12
- package/src/executors/module-federation-ssr-dev-server/schema.d.ts +2 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +1 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +11 -20
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.d.ts +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +1 -1
- package/src/executors/ng-packagr-lite/schema.json +0 -8
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +1 -2
- package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +4 -21
- package/src/executors/package/package.impl.d.ts +2 -2
- package/src/executors/package/package.impl.js +1 -1
- package/src/executors/package/schema.d.ts +1 -3
- package/src/executors/package/schema.json +0 -10
- package/src/executors/utilities/ng-packagr/{stylesheet-processor.js → pre-v19/stylesheet-processor.js} +2 -2
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +11 -5
- package/src/executors/utilities/ng-packagr/tailwindcss.d.ts +0 -6
- package/src/executors/utilities/ng-packagr/tailwindcss.js +0 -32
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts +23 -0
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.js +93 -0
- package/src/generators/application/application.js +1 -0
- package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +4 -5
- package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
- package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
- package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
- package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
- package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +4 -6
- package/src/generators/application/lib/add-serve-static-target.d.ts +1 -1
- package/src/generators/application/lib/add-serve-static-target.js +1 -3
- package/src/generators/application/lib/create-files.js +4 -1
- package/src/generators/application/lib/create-project.js +24 -31
- package/src/generators/application/lib/normalize-options.js +1 -6
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +7 -2
- package/src/generators/component/component.js +4 -0
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +1 -1
- package/src/generators/component/files/__fileName__.ts__tpl__ +5 -13
- package/src/generators/component/lib/normalize-options.js +2 -0
- package/src/generators/component/schema.d.ts +1 -0
- package/src/generators/component/schema.json +5 -0
- package/src/generators/convert-to-application-executor/convert-to-application-executor.js +1 -4
- package/src/generators/convert-to-application-executor/schema.json +1 -1
- package/src/generators/directive/directive.js +5 -0
- package/src/generators/directive/files/__fileName__.ts__tpl__ +2 -2
- package/src/generators/directive/lib/normalize-options.js +3 -1
- package/src/generators/host/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
- package/src/generators/host/lib/update-ssr-setup.js +2 -1
- package/src/generators/host/schema.d.ts +1 -0
- package/src/generators/host/schema.json +4 -0
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +2 -2
- package/src/generators/pipe/lib/normalize-options.js +3 -1
- package/src/generators/pipe/pipe.js +5 -0
- package/src/generators/remote/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
- package/src/generators/remote/lib/update-ssr-setup.js +2 -1
- package/src/generators/remote/schema.d.ts +1 -0
- package/src/generators/remote/schema.json +4 -0
- package/src/generators/scam/lib/normalize-options.js +3 -1
- package/src/generators/scam-directive/lib/normalize-options.js +3 -1
- package/src/generators/scam-pipe/lib/normalize-options.js +3 -1
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.d.ts +1 -1
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +5 -4
- package/src/generators/setup-mf/files/entry-module-files/entry.component.ts__tmpl__ +2 -1
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry.component.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/lib/add-remote-entry.js +5 -0
- package/src/generators/setup-ssr/files/{server → pre-v19/server}/application-builder/__serverFileName__ +1 -1
- package/src/generators/setup-ssr/files/{server/server-builder/v17+ → pre-v19/server/server-builder}/__serverFileName__ +1 -1
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/__main__ +1 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/__rootModuleFileName__ +13 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +8 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/server/__serverFileName__ +66 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/__main__ +7 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +14 -0
- package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +8 -0
- package/src/generators/setup-ssr/files/v19+/application-builder-common-engine/server/__serverFileName__ +65 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/ngmodule-src/__main__ +1 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/ngmodule-src/app/__rootModuleFileName__ +14 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/root/tsconfig.server.json.template +16 -0
- package/src/generators/setup-ssr/files/{server/server-builder/pre-v17 → v19+/server-builder/server}/__serverFileName__ +25 -15
- package/src/generators/setup-ssr/files/v19+/server-builder/standalone-src/__main__ +7 -0
- package/src/generators/setup-ssr/files/v19+/server-builder/standalone-src/app/app.config.server.ts.template +11 -0
- package/src/generators/setup-ssr/lib/add-dependencies.js +6 -17
- package/src/generators/setup-ssr/lib/add-hydration.d.ts +2 -2
- package/src/generators/setup-ssr/lib/add-hydration.js +10 -2
- package/src/generators/setup-ssr/lib/add-server-file.d.ts +2 -2
- package/src/generators/setup-ssr/lib/add-server-file.js +24 -10
- package/src/generators/setup-ssr/lib/generate-files.d.ts +2 -2
- package/src/generators/setup-ssr/lib/generate-files.js +20 -8
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +3 -3
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +24 -3
- package/src/generators/setup-ssr/lib/normalize-options.d.ts +3 -14
- package/src/generators/setup-ssr/lib/normalize-options.js +23 -6
- package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +2 -2
- package/src/generators/setup-ssr/lib/update-project-config.d.ts +3 -3
- package/src/generators/setup-ssr/lib/update-project-config.js +36 -24
- package/src/generators/setup-ssr/lib/validate-options.js +5 -0
- package/src/generators/setup-ssr/schema.d.ts +5 -0
- package/src/generators/setup-ssr/schema.json +6 -8
- package/src/generators/setup-ssr/setup-ssr.js +6 -11
- package/src/generators/setup-tailwind/lib/index.d.ts +1 -1
- package/src/generators/setup-tailwind/lib/index.js +1 -1
- package/src/generators/setup-tailwind/lib/update-application-styles.js +1 -1
- package/src/generators/setup-tailwind/lib/validate-build-target.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/{add-tailwind-config-path-to-project.js → validate-build-target.js} +4 -15
- package/src/generators/setup-tailwind/setup-tailwind.js +4 -1
- package/src/generators/utils/storybook-ast/component-info.js +12 -2
- package/src/generators/utils/validations.d.ts +1 -0
- package/src/generators/utils/validations.js +10 -0
- package/src/generators/utils/version-utils.js +2 -2
- package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.d.ts +3 -0
- package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.js +48 -0
- package/src/migrations/update-20-2-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-20-2-0/update-angular-cli.js +23 -0
- package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.d.ts +2 -0
- package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.js +55 -0
- package/src/utils/backward-compatible-versions.d.ts +4 -4
- package/src/utils/backward-compatible-versions.js +20 -19
- package/src/utils/nx-devkit/ast-utils.d.ts +10 -1
- package/src/utils/nx-devkit/ast-utils.js +32 -9
- package/src/utils/versions.d.ts +7 -7
- package/src/utils/versions.js +7 -7
- package/esm2022/index.mjs +0 -2
- package/esm2022/mf/index.mjs +0 -2
- package/esm2022/mf/mf.mjs +0 -116
- package/esm2022/mf/nx-angular-mf.mjs +0 -5
- package/esm2022/nx-angular.mjs +0 -5
- package/esm2022/src/runtime/nx/data-persistence.mjs +0 -349
- package/esm2022/testing/index.mjs +0 -2
- package/esm2022/testing/nx-angular-testing.mjs +0 -5
- package/esm2022/testing/src/testing-utils.mjs +0 -38
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.d.ts +0 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.js +0 -27
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.d.ts +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.js +0 -53
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.d.ts +0 -15
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.js +0 -28
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.d.ts +0 -30
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.js +0 -52
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.d.ts +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.js +0 -20
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.d.ts +0 -9
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.js +0 -320
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.d.ts +0 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.js +0 -35
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.d.ts +0 -14
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.js +0 -37
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.d.ts +0 -12
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.js +0 -178
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.d.ts +0 -42
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.d.ts +0 -10
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.js +0 -17
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.js +0 -201
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.d.ts +0 -14
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.js +0 -26
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.d.ts +0 -12
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +0 -71
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.d.ts +0 -13
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.js +0 -32
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.d.ts +0 -14
- package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +0 -35
- package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.d.ts +0 -14
- package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.js +0 -37
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +0 -13
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +0 -183
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +0 -36
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.d.ts +0 -10
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.js +0 -17
- package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +0 -194
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.d.ts +0 -1
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +0 -9
- package/src/generators/host/files/common/pre-v17/src/main.server.ts__tmpl__ +0 -66
- package/src/generators/remote/files/common/pre-v17/src/main.server.ts__tmpl__ +0 -72
- package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.d.ts +0 -3
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.transform.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.di.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.di.js +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.transform.d.ts +0 -0
- /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.transform.js +0 -0
- /package/src/executors/utilities/ng-packagr/{stylesheet-processor.d.ts → pre-v19/stylesheet-processor.d.ts} +0 -0
- /package/src/generators/setup-ssr/files/{ngmodule/src → pre-v19/ngmodule-src}/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{ngmodule/src → pre-v19/ngmodule-src}/app/__rootModuleFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{root → pre-v19/root}/tsconfig.server.json__tpl__ +0 -0
- /package/src/generators/setup-ssr/files/{standalone/src → pre-v19/standalone-src}/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{standalone/src → pre-v19/standalone-src}/app/app.config.server.ts__tpl__ +0 -0
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from the original ng-packagr source.
|
|
4
|
-
*
|
|
5
|
-
* Changes made:
|
|
6
|
-
* - Removed writing bundles as we don't generate them for incremental builds.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.nxEntryPointTransformFactory = void 0;
|
|
10
|
-
const devkit_1 = require("@nx/devkit");
|
|
11
|
-
const node_1 = require("ng-packagr/lib/graph/node");
|
|
12
|
-
const select_1 = require("ng-packagr/lib/graph/select");
|
|
13
|
-
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
14
|
-
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
15
|
-
const rxjs_1 = require("rxjs");
|
|
16
|
-
/**
|
|
17
|
-
* A re-write of the `transformSources()` script that transforms an entry point from sources to distributable format.
|
|
18
|
-
*
|
|
19
|
-
* Sources are TypeScript source files accompanied by HTML templates and xCSS stylesheets.
|
|
20
|
-
* See the Angular Package Format for a detailed description of what the distributables include.
|
|
21
|
-
*
|
|
22
|
-
* The current transformation pipeline can be thought of as:
|
|
23
|
-
*
|
|
24
|
-
* - clean
|
|
25
|
-
* - compileTs
|
|
26
|
-
* - downlevelTs
|
|
27
|
-
* - relocateSourceMaps
|
|
28
|
-
* - writePackage
|
|
29
|
-
* - copyStagedFiles (esm, dts, sourcemaps)
|
|
30
|
-
* - writePackageJson
|
|
31
|
-
*
|
|
32
|
-
* The transformation pipeline is pluggable through the dependency injection system.
|
|
33
|
-
* Sub-transformations are passed to this factory function as arguments.
|
|
34
|
-
*
|
|
35
|
-
* @param compileTs Transformation compiling typescript sources to ES2022 modules.
|
|
36
|
-
* @param writeBundles Transformation flattening ES2022 modules to ESM2022, UMD, and minified UMD.
|
|
37
|
-
*/
|
|
38
|
-
const nxEntryPointTransformFactory = (compileTs, writePackage) => (0, rxjs_1.pipe)((0, transform_1.transformFromPromise)(async (graph) => {
|
|
39
|
-
// Peek the first entry point from the graph
|
|
40
|
-
const entryPoint = graph.find((0, nodes_1.byEntryPoint)().and(select_1.isInProgress));
|
|
41
|
-
devkit_1.logger.info('\n------------------------------------------------------------------------------');
|
|
42
|
-
devkit_1.logger.info(`Building entry point '${entryPoint.data.entryPoint.moduleId}'`);
|
|
43
|
-
devkit_1.logger.info('------------------------------------------------------------------------------');
|
|
44
|
-
}),
|
|
45
|
-
// TypeScript sources compilation
|
|
46
|
-
compileTs,
|
|
47
|
-
// After TypeScript: write package
|
|
48
|
-
writePackage, (0, transform_1.transformFromPromise)(async (graph) => {
|
|
49
|
-
const entryPoint = graph.find((0, nodes_1.byEntryPoint)().and(select_1.isInProgress));
|
|
50
|
-
entryPoint.state = node_1.STATE_DONE;
|
|
51
|
-
}));
|
|
52
|
-
exports.nxEntryPointTransformFactory = nxEntryPointTransformFactory;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from the original ng-packagr source.
|
|
3
|
-
*
|
|
4
|
-
* Changes made:
|
|
5
|
-
* - Provide our own writePackageTransform function.
|
|
6
|
-
* - USE NX_OPTIONS_TOKEN instead of OPTIONS_TOKEN.
|
|
7
|
-
*/
|
|
8
|
-
import { InjectionToken } from 'injection-js';
|
|
9
|
-
import type { Transform } from 'ng-packagr/lib/graph/transform';
|
|
10
|
-
import { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
|
|
11
|
-
export declare const NX_WRITE_PACKAGE_TRANSFORM_TOKEN: InjectionToken<Transform>;
|
|
12
|
-
export declare const NX_WRITE_PACKAGE_TRANSFORM: TransformProvider;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from the original ng-packagr source.
|
|
4
|
-
*
|
|
5
|
-
* Changes made:
|
|
6
|
-
* - Provide our own writePackageTransform function.
|
|
7
|
-
* - USE NX_OPTIONS_TOKEN instead of OPTIONS_TOKEN.
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.NX_WRITE_PACKAGE_TRANSFORM = exports.NX_WRITE_PACKAGE_TRANSFORM_TOKEN = void 0;
|
|
11
|
-
const injection_js_1 = require("injection-js");
|
|
12
|
-
const transform_di_1 = require("ng-packagr/lib/graph/transform.di");
|
|
13
|
-
const options_di_1 = require("../options.di");
|
|
14
|
-
const write_package_transform_1 = require("./write-package.transform");
|
|
15
|
-
exports.NX_WRITE_PACKAGE_TRANSFORM_TOKEN = new injection_js_1.InjectionToken(`nx.v1.writePackageTransform`);
|
|
16
|
-
exports.NX_WRITE_PACKAGE_TRANSFORM = (0, transform_di_1.provideTransform)({
|
|
17
|
-
provide: exports.NX_WRITE_PACKAGE_TRANSFORM_TOKEN,
|
|
18
|
-
useFactory: write_package_transform_1.nxWritePackageTransform,
|
|
19
|
-
deps: [options_di_1.NX_OPTIONS_TOKEN],
|
|
20
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from the original ng-packagr.
|
|
3
|
-
*
|
|
4
|
-
* Changes made:
|
|
5
|
-
* - Change the package.json metadata to only use the ESM2022 output.
|
|
6
|
-
* - Change the package.json metadata to only use the ESM2020 output (Angular < 16).
|
|
7
|
-
*/
|
|
8
|
-
import { NgPackagrOptions } from 'ng-packagr/lib/ng-package/options.di';
|
|
9
|
-
export declare const nxWritePackageTransform: (options: NgPackagrOptions) => import("ng-packagr/lib/graph/transform").Transform;
|
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from the original ng-packagr.
|
|
4
|
-
*
|
|
5
|
-
* Changes made:
|
|
6
|
-
* - Change the package.json metadata to only use the ESM2022 output.
|
|
7
|
-
* - Change the package.json metadata to only use the ESM2020 output (Angular < 16).
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.nxWritePackageTransform = void 0;
|
|
11
|
-
const tslib_1 = require("tslib");
|
|
12
|
-
const devkit_1 = require("@nx/devkit");
|
|
13
|
-
const node_1 = require("ng-packagr/lib/graph/node");
|
|
14
|
-
const transform_1 = require("ng-packagr/lib/graph/transform");
|
|
15
|
-
const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
|
|
16
|
-
const fs_1 = require("ng-packagr/lib/utils/fs");
|
|
17
|
-
const glob_1 = require("ng-packagr/lib/utils/glob");
|
|
18
|
-
const path_1 = require("ng-packagr/lib/utils/path");
|
|
19
|
-
const path = tslib_1.__importStar(require("path"));
|
|
20
|
-
const angular_version_utils_1 = require("../../../../../utilities/angular-version-utils");
|
|
21
|
-
const nxWritePackageTransform = (options) => (0, transform_1.transformFromPromise)(async (graph) => {
|
|
22
|
-
const entryPoint = graph.find((0, nodes_1.isEntryPointInProgress)());
|
|
23
|
-
const ngEntryPoint = entryPoint.data.entryPoint;
|
|
24
|
-
const ngPackageNode = graph.find(nodes_1.isPackage);
|
|
25
|
-
const ngPackage = ngPackageNode.data;
|
|
26
|
-
const { destinationFiles } = entryPoint.data;
|
|
27
|
-
const angularVersion = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
|
|
28
|
-
if (!ngEntryPoint.isSecondaryEntryPoint) {
|
|
29
|
-
devkit_1.logger.log('Copying assets');
|
|
30
|
-
try {
|
|
31
|
-
await copyAssets(graph, entryPoint, ngPackageNode, angularVersion);
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// 6. WRITE PACKAGE.JSON
|
|
38
|
-
const relativeUnixFromDestPath = (filePath) => (0, path_1.ensureUnixPath)(path.relative(ngEntryPoint.destinationPath, filePath));
|
|
39
|
-
if (!ngEntryPoint.isSecondaryEntryPoint) {
|
|
40
|
-
try {
|
|
41
|
-
devkit_1.logger.info('Writing package manifest');
|
|
42
|
-
if (!options.watch) {
|
|
43
|
-
const primary = ngPackageNode.data.primary;
|
|
44
|
-
await (0, fs_1.writeFile)(path.join(primary.destinationPath, '.npmignore'), `# Nested package.json's are only needed for development.\n**/package.json`);
|
|
45
|
-
}
|
|
46
|
-
await writePackageJson(ngEntryPoint, ngPackage, {
|
|
47
|
-
// backward compat for Angular < 16
|
|
48
|
-
...(angularVersion.major < 16
|
|
49
|
-
? {
|
|
50
|
-
module: relativeUnixFromDestPath(destinationFiles.esm2020),
|
|
51
|
-
es2020: relativeUnixFromDestPath(destinationFiles.esm2020),
|
|
52
|
-
esm2020: relativeUnixFromDestPath(destinationFiles.esm2020),
|
|
53
|
-
}
|
|
54
|
-
: {
|
|
55
|
-
module: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
56
|
-
}),
|
|
57
|
-
typings: relativeUnixFromDestPath(destinationFiles.declarations),
|
|
58
|
-
exports: generatePackageExports(ngEntryPoint, graph, angularVersion),
|
|
59
|
-
// webpack v4+ specific flag to enable advanced optimizations and code splitting
|
|
60
|
-
sideEffects: ngEntryPoint.packageJson.sideEffects ?? false,
|
|
61
|
-
}, !!options.watch);
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
throw error;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else if (ngEntryPoint.isSecondaryEntryPoint) {
|
|
68
|
-
if (options.watch) {
|
|
69
|
-
// Update the watch version of the primary entry point `package.json` file.
|
|
70
|
-
// this is needed because of Webpack's 5 `cachemanagedpaths`
|
|
71
|
-
// https://github.com/ng-packagr/ng-packagr/issues/2069
|
|
72
|
-
const primary = ngPackageNode.data.primary;
|
|
73
|
-
const packageJsonPath = path.join(primary.destinationPath, 'package.json');
|
|
74
|
-
if (await (0, fs_1.exists)(packageJsonPath)) {
|
|
75
|
-
const packageJson = JSON.parse(await (0, fs_1.readFile)(packageJsonPath, { encoding: 'utf8' }));
|
|
76
|
-
packageJson.version = generateWatchVersion();
|
|
77
|
-
await (0, fs_1.writeFile)(path.join(primary.destinationPath, 'package.json'), JSON.stringify(packageJson, undefined, 2));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// Write a package.json in each secondary entry-point
|
|
81
|
-
// This is need for esbuild to secondary entry-points in dist correctly.
|
|
82
|
-
await (0, fs_1.writeFile)(path.join(ngEntryPoint.destinationPath, 'package.json'), JSON.stringify({
|
|
83
|
-
module: relativeUnixFromDestPath(angularVersion.major < 16
|
|
84
|
-
? destinationFiles.esm2020
|
|
85
|
-
: destinationFiles.esm2022),
|
|
86
|
-
}, undefined, 2));
|
|
87
|
-
}
|
|
88
|
-
devkit_1.logger.info(`Built ${ngEntryPoint.moduleId}`);
|
|
89
|
-
return graph;
|
|
90
|
-
});
|
|
91
|
-
exports.nxWritePackageTransform = nxWritePackageTransform;
|
|
92
|
-
async function copyAssets(graph, entryPointNode, ngPackageNode, angularVersion) {
|
|
93
|
-
const ngPackage = ngPackageNode.data;
|
|
94
|
-
const globsForceIgnored = [
|
|
95
|
-
'.gitkeep',
|
|
96
|
-
'**/.DS_Store',
|
|
97
|
-
'**/Thumbs.db',
|
|
98
|
-
`${ngPackage.dest}/**`,
|
|
99
|
-
];
|
|
100
|
-
const assets = [];
|
|
101
|
-
for (const assetPath of ngPackage.assets) {
|
|
102
|
-
let asset;
|
|
103
|
-
if (typeof assetPath === 'object') {
|
|
104
|
-
asset = { ...assetPath };
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
const [isDir, isFile] = await (0, fs_1.stat)(path.join(ngPackage.src, assetPath))
|
|
108
|
-
.then((stats) => [stats.isDirectory(), stats.isFile()])
|
|
109
|
-
.catch(() => [false, false]);
|
|
110
|
-
if (isDir) {
|
|
111
|
-
asset = { glob: '**/*', input: assetPath, output: assetPath };
|
|
112
|
-
}
|
|
113
|
-
else if (isFile) {
|
|
114
|
-
// filenames are their own glob
|
|
115
|
-
asset = {
|
|
116
|
-
glob: path.basename(assetPath),
|
|
117
|
-
input: path.dirname(assetPath),
|
|
118
|
-
output: path.dirname(assetPath),
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
asset = { glob: assetPath, input: '/', output: '/' };
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
asset.input = path.join(ngPackage.src, asset.input);
|
|
126
|
-
asset.output = path.join(ngPackage.dest, asset.output);
|
|
127
|
-
const isAncestorPath = (target, datum) => path.relative(datum, target).startsWith('..');
|
|
128
|
-
if (isAncestorPath(asset.input, ngPackage.src)) {
|
|
129
|
-
throw new Error('Cannot read assets from a location outside of the project root.');
|
|
130
|
-
}
|
|
131
|
-
if (isAncestorPath(asset.output, ngPackage.dest)) {
|
|
132
|
-
throw new Error('Cannot write assets to a location outside of the output path.');
|
|
133
|
-
}
|
|
134
|
-
assets.push(asset);
|
|
135
|
-
}
|
|
136
|
-
for (const asset of assets) {
|
|
137
|
-
const globOptions = {
|
|
138
|
-
cwd: asset.input,
|
|
139
|
-
ignore: [...(asset.ignore ?? []), ...globsForceIgnored],
|
|
140
|
-
dot: true,
|
|
141
|
-
};
|
|
142
|
-
if (angularVersion.major < 16) {
|
|
143
|
-
// versions lower than v16 support these properties
|
|
144
|
-
globOptions.cache = ngPackageNode.cache.globCache;
|
|
145
|
-
globOptions.nodir = true;
|
|
146
|
-
globOptions.follow = asset.followSymlinks;
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
// starting in v16 these properties are supported
|
|
150
|
-
globOptions.onlyFiles = true;
|
|
151
|
-
globOptions.followSymbolicLinks = asset.followSymlinks;
|
|
152
|
-
}
|
|
153
|
-
const filePaths = await (0, glob_1.globFiles)(asset.glob, globOptions);
|
|
154
|
-
for (const filePath of filePaths) {
|
|
155
|
-
const fileSrcFullPath = path.join(asset.input, filePath);
|
|
156
|
-
const fileDestFullPath = path.join(asset.output, filePath);
|
|
157
|
-
const nodeUri = (0, nodes_1.fileUrl)((0, path_1.ensureUnixPath)(fileSrcFullPath));
|
|
158
|
-
let node = graph.get(nodeUri);
|
|
159
|
-
if (!node) {
|
|
160
|
-
node = new node_1.Node(nodeUri);
|
|
161
|
-
graph.put(node);
|
|
162
|
-
}
|
|
163
|
-
entryPointNode.dependsOn(node);
|
|
164
|
-
await (0, fs_1.copyFile)(fileSrcFullPath, fileDestFullPath);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Creates and writes a `package.json` file of the entry point used by the `node_module`
|
|
170
|
-
* resolution strategies.
|
|
171
|
-
*
|
|
172
|
-
* #### Example
|
|
173
|
-
*
|
|
174
|
-
* A consumer of the entry point depends on it by `import {..} from '@my/module/id';`.
|
|
175
|
-
* The module id `@my/module/id` will be resolved to the `package.json` file that is written by
|
|
176
|
-
* this build step.
|
|
177
|
-
* The properties `main`, `module`, `typings` (and so on) in the `package.json` point to the
|
|
178
|
-
* flattened JavaScript bundles, type definitions, (...).
|
|
179
|
-
*
|
|
180
|
-
* @param entryPoint An entry point of an Angular package / library
|
|
181
|
-
* @param additionalProperties Additional properties, e.g. binary artefacts (bundle files), to merge into `package.json`
|
|
182
|
-
*/
|
|
183
|
-
async function writePackageJson(entryPoint, pkg, additionalProperties, isWatchMode) {
|
|
184
|
-
// set additional properties
|
|
185
|
-
const packageJson = { ...entryPoint.packageJson, ...additionalProperties };
|
|
186
|
-
// read tslib version from `@angular/compiler` so that our tslib
|
|
187
|
-
// version at least matches that of angular if we use require('tslib').version
|
|
188
|
-
// it will get what installed and not the minimum version nor if it is a `~` or `^`
|
|
189
|
-
// this is only required for primary
|
|
190
|
-
if (isWatchMode) {
|
|
191
|
-
// Needed because of Webpack's 5 `cachemanagedpaths`
|
|
192
|
-
// https://github.com/angular/angular-cli/issues/20962
|
|
193
|
-
packageJson.version = generateWatchVersion();
|
|
194
|
-
}
|
|
195
|
-
if (!packageJson.peerDependencies?.tslib &&
|
|
196
|
-
!packageJson.dependencies?.tslib) {
|
|
197
|
-
const { peerDependencies: angularPeerDependencies = {}, dependencies: angularDependencies = {}, } = require('@angular/compiler/package.json');
|
|
198
|
-
const tsLibVersion = angularPeerDependencies.tslib || angularDependencies.tslib;
|
|
199
|
-
if (tsLibVersion) {
|
|
200
|
-
packageJson.dependencies = {
|
|
201
|
-
...packageJson.dependencies,
|
|
202
|
-
tslib: tsLibVersion,
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
else if (packageJson.peerDependencies?.tslib) {
|
|
207
|
-
devkit_1.logger.warn(`'tslib' is no longer recommended to be used as a 'peerDependencies'. Moving it to 'dependencies'.`);
|
|
208
|
-
packageJson.dependencies = {
|
|
209
|
-
...(packageJson.dependencies || {}),
|
|
210
|
-
tslib: packageJson.peerDependencies.tslib,
|
|
211
|
-
};
|
|
212
|
-
delete packageJson.peerDependencies.tslib;
|
|
213
|
-
}
|
|
214
|
-
// Verify non-peerDependencies as they can easily lead to duplicate installs or version conflicts
|
|
215
|
-
// in the node_modules folder of an application
|
|
216
|
-
const allowedList = pkg.allowedNonPeerDependencies.map((value) => new RegExp(value));
|
|
217
|
-
try {
|
|
218
|
-
checkNonPeerDependencies(packageJson, 'dependencies', allowedList);
|
|
219
|
-
}
|
|
220
|
-
catch (e) {
|
|
221
|
-
await (0, fs_1.rmdir)(entryPoint.destinationPath, { recursive: true });
|
|
222
|
-
throw e;
|
|
223
|
-
}
|
|
224
|
-
// Removes scripts from package.json after build
|
|
225
|
-
if (packageJson.scripts) {
|
|
226
|
-
if (pkg.keepLifecycleScripts !== true) {
|
|
227
|
-
devkit_1.logger.info(`Removing scripts section in package.json as it's considered a potential security vulnerability.`);
|
|
228
|
-
delete packageJson.scripts;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
devkit_1.logger.warn(`You enabled keepLifecycleScripts explicitly. The scripts section in package.json will be published to npm.`);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
// keep the dist package.json clean
|
|
235
|
-
// this will not throw if ngPackage field does not exist
|
|
236
|
-
delete packageJson.ngPackage;
|
|
237
|
-
const packageJsonPropertiesToDelete = [
|
|
238
|
-
'stylelint',
|
|
239
|
-
'prettier',
|
|
240
|
-
'browserslist',
|
|
241
|
-
'devDependencies',
|
|
242
|
-
'jest',
|
|
243
|
-
'workspaces',
|
|
244
|
-
'husky',
|
|
245
|
-
];
|
|
246
|
-
for (const prop of packageJsonPropertiesToDelete) {
|
|
247
|
-
if (prop in packageJson) {
|
|
248
|
-
delete packageJson[prop];
|
|
249
|
-
devkit_1.logger.info(`Removing ${prop} section in package.json.`);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
packageJson.name = entryPoint.moduleId;
|
|
253
|
-
await (0, fs_1.writeFile)(path.join(entryPoint.destinationPath, 'package.json'), JSON.stringify(packageJson, undefined, 2));
|
|
254
|
-
}
|
|
255
|
-
function checkNonPeerDependencies(packageJson, property, allowed) {
|
|
256
|
-
if (!packageJson[property]) {
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
for (const dep of Object.keys(packageJson[property])) {
|
|
260
|
-
if (!allowed.some((regex) => regex.test(dep))) {
|
|
261
|
-
devkit_1.logger.warn(`Distributing npm packages with '${property}' is not recommended. Please consider adding ${dep} to 'peerDependencies' or remove it from '${property}'.`);
|
|
262
|
-
throw new Error(`Dependency ${dep} must be explicitly allowed using the "allowedNonPeerDependencies" option.`);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Generates the `package.json` package exports following APF v13.
|
|
268
|
-
* This is supposed to match with: https://github.com/angular/angular/blob/e0667efa6eada64d1fb8b143840689090fc82e52/packages/bazel/src/ng_package/packager.ts#L415.
|
|
269
|
-
*/
|
|
270
|
-
function generatePackageExports({ destinationPath, packageJson }, graph, angularVersion) {
|
|
271
|
-
const exports = packageJson.exports
|
|
272
|
-
? JSON.parse(JSON.stringify(packageJson.exports))
|
|
273
|
-
: {};
|
|
274
|
-
const insertMappingOrError = (subpath, mapping) => {
|
|
275
|
-
exports[subpath] ??= {};
|
|
276
|
-
const subpathExport = exports[subpath];
|
|
277
|
-
// Go through all conditions that should be inserted. If the condition is already
|
|
278
|
-
// manually set of the subpath export, we throw an error. In general, we allow for
|
|
279
|
-
// additional conditions to be set. These will always precede the generated ones.
|
|
280
|
-
for (const conditionName of Object.keys(mapping)) {
|
|
281
|
-
if (subpathExport[conditionName] !== undefined) {
|
|
282
|
-
devkit_1.logger.warn(`Found a conflicting export condition for "${subpath}". The "${conditionName}" ` +
|
|
283
|
-
`condition would be overridden by ng-packagr. Please unset it.`);
|
|
284
|
-
}
|
|
285
|
-
// **Note**: The order of the conditions is preserved even though we are setting
|
|
286
|
-
// the conditions once at a time (the latest assignment will be at the end).
|
|
287
|
-
subpathExport[conditionName] = mapping[conditionName];
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
const relativeUnixFromDestPath = (filePath) => './' + (0, path_1.ensureUnixPath)(path.relative(destinationPath, filePath));
|
|
291
|
-
insertMappingOrError('./package.json', { default: './package.json' });
|
|
292
|
-
const entryPoints = graph.filter(nodes_1.isEntryPoint);
|
|
293
|
-
for (const entryPoint of entryPoints) {
|
|
294
|
-
const { destinationFiles, isSecondaryEntryPoint } = entryPoint.data.entryPoint;
|
|
295
|
-
const subpath = isSecondaryEntryPoint
|
|
296
|
-
? `./${destinationFiles.directory}`
|
|
297
|
-
: '.';
|
|
298
|
-
// backward compat for Angular < 16
|
|
299
|
-
const mapping = angularVersion.major < 16
|
|
300
|
-
? {
|
|
301
|
-
types: relativeUnixFromDestPath(destinationFiles.declarations),
|
|
302
|
-
es2020: relativeUnixFromDestPath(destinationFiles.esm2020),
|
|
303
|
-
esm2020: relativeUnixFromDestPath(destinationFiles.esm2020),
|
|
304
|
-
default: relativeUnixFromDestPath(destinationFiles.esm2020),
|
|
305
|
-
}
|
|
306
|
-
: {
|
|
307
|
-
esm2022: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
308
|
-
esm: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
309
|
-
default: relativeUnixFromDestPath(destinationFiles.esm2022),
|
|
310
|
-
};
|
|
311
|
-
insertMappingOrError(subpath, mapping);
|
|
312
|
-
}
|
|
313
|
-
return exports;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Generates a new version for the package `package.json` when runing in watch mode.
|
|
317
|
-
*/
|
|
318
|
-
function generateWatchVersion() {
|
|
319
|
-
return `0.0.0-watch+${Date.now()}`;
|
|
320
|
-
}
|
package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from the original ng-packagr.
|
|
3
|
-
*
|
|
4
|
-
* Changes made:
|
|
5
|
-
* - Use our own options interface to add support for tailwindConfig.
|
|
6
|
-
*/
|
|
7
|
-
import { InjectionToken, Provider, ValueProvider } from 'injection-js';
|
|
8
|
-
import { NgPackagrOptions as NgPackagrOptionsBase } from 'ng-packagr/lib/ng-package/options.di';
|
|
9
|
-
export interface NgPackagrOptions extends NgPackagrOptionsBase {
|
|
10
|
-
tailwindConfig?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const NX_OPTIONS_TOKEN: InjectionToken<NgPackagrOptions>;
|
|
13
|
-
export declare const nxProvideOptions: (options?: NgPackagrOptions) => ValueProvider;
|
|
14
|
-
export declare const NX_DEFAULT_OPTIONS_PROVIDER: Provider;
|
package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from the original ng-packagr.
|
|
4
|
-
*
|
|
5
|
-
* Changes made:
|
|
6
|
-
* - Use our own options interface to add support for tailwindConfig.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.NX_DEFAULT_OPTIONS_PROVIDER = exports.nxProvideOptions = exports.NX_OPTIONS_TOKEN = void 0;
|
|
10
|
-
const tslib_1 = require("tslib");
|
|
11
|
-
const find_cache_dir_1 = tslib_1.__importDefault(require("find-cache-dir"));
|
|
12
|
-
const injection_js_1 = require("injection-js");
|
|
13
|
-
const os_1 = require("os");
|
|
14
|
-
const path_1 = require("path");
|
|
15
|
-
exports.NX_OPTIONS_TOKEN = new injection_js_1.InjectionToken(`nx.v1.options`);
|
|
16
|
-
const nxProvideOptions = (options = {}) => ({
|
|
17
|
-
provide: exports.NX_OPTIONS_TOKEN,
|
|
18
|
-
useValue: normalizeOptions(options),
|
|
19
|
-
});
|
|
20
|
-
exports.nxProvideOptions = nxProvideOptions;
|
|
21
|
-
exports.NX_DEFAULT_OPTIONS_PROVIDER = (0, exports.nxProvideOptions)();
|
|
22
|
-
function normalizeOptions(options = {}) {
|
|
23
|
-
const ciEnv = process.env['CI'];
|
|
24
|
-
const isCI = ciEnv?.toLowerCase() === 'true' || ciEnv === '1';
|
|
25
|
-
const { cacheEnabled = !isCI, cacheDirectory = findCachePath() } = options;
|
|
26
|
-
return {
|
|
27
|
-
...options,
|
|
28
|
-
cacheEnabled,
|
|
29
|
-
cacheDirectory,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function findCachePath() {
|
|
33
|
-
const name = 'ng-packagr';
|
|
34
|
-
return (0, find_cache_dir_1.default)({ name }) || (0, path_1.resolve)((0, os_1.tmpdir)(), name);
|
|
35
|
-
}
|
package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from the original ng-packagr.
|
|
3
|
-
*
|
|
4
|
-
* Changes made:
|
|
5
|
-
* - Use NX_ENTRY_POINT_TRANSFORM_TOKEN instead of ENTRY_POINT_TRANSFORM_TOKEN.
|
|
6
|
-
* - USE NX_OPTIONS_TOKEN instead of OPTIONS_TOKEN.
|
|
7
|
-
* - USE NX_DEFAULT_OPTIONS_PROVIDER instead of DEFAULT_OPTIONS_PROVIDER.
|
|
8
|
-
*/
|
|
9
|
-
import type { Provider } from 'injection-js';
|
|
10
|
-
import { InjectionToken } from 'injection-js';
|
|
11
|
-
import type { Transform } from 'ng-packagr/lib/graph/transform';
|
|
12
|
-
export declare const NX_PACKAGE_TRANSFORM_TOKEN: InjectionToken<Transform>;
|
|
13
|
-
export declare const NX_PACKAGE_TRANSFORM: import("ng-packagr/lib/graph/transform.di").TransformProvider;
|
|
14
|
-
export declare const NX_PACKAGE_PROVIDERS: Provider[];
|
package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Adapted from the original ng-packagr.
|
|
4
|
-
*
|
|
5
|
-
* Changes made:
|
|
6
|
-
* - Use NX_ENTRY_POINT_TRANSFORM_TOKEN instead of ENTRY_POINT_TRANSFORM_TOKEN.
|
|
7
|
-
* - USE NX_OPTIONS_TOKEN instead of OPTIONS_TOKEN.
|
|
8
|
-
* - USE NX_DEFAULT_OPTIONS_PROVIDER instead of DEFAULT_OPTIONS_PROVIDER.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.NX_PACKAGE_PROVIDERS = exports.NX_PACKAGE_TRANSFORM = exports.NX_PACKAGE_TRANSFORM_TOKEN = void 0;
|
|
12
|
-
const injection_js_1 = require("injection-js");
|
|
13
|
-
const transform_di_1 = require("ng-packagr/lib/graph/transform.di");
|
|
14
|
-
const analyse_sources_di_1 = require("ng-packagr/lib/ng-package/entry-point/analyse-sources.di");
|
|
15
|
-
const init_tsconfig_di_1 = require("ng-packagr/lib/ng-package/entry-point/init-tsconfig.di");
|
|
16
|
-
const package_transform_1 = require("ng-packagr/lib/ng-package/package.transform");
|
|
17
|
-
const project_di_1 = require("ng-packagr/lib/project.di");
|
|
18
|
-
const entry_point_di_1 = require("./entry-point/entry-point.di");
|
|
19
|
-
const options_di_1 = require("./options.di");
|
|
20
|
-
exports.NX_PACKAGE_TRANSFORM_TOKEN = new injection_js_1.InjectionToken(`nx.v1.packageTransform`);
|
|
21
|
-
exports.NX_PACKAGE_TRANSFORM = (0, transform_di_1.provideTransform)({
|
|
22
|
-
provide: exports.NX_PACKAGE_TRANSFORM_TOKEN,
|
|
23
|
-
useFactory: package_transform_1.packageTransformFactory,
|
|
24
|
-
deps: [
|
|
25
|
-
project_di_1.PROJECT_TOKEN,
|
|
26
|
-
options_di_1.NX_OPTIONS_TOKEN,
|
|
27
|
-
init_tsconfig_di_1.INIT_TS_CONFIG_TOKEN,
|
|
28
|
-
analyse_sources_di_1.ANALYSE_SOURCES_TOKEN,
|
|
29
|
-
entry_point_di_1.NX_ENTRY_POINT_TRANSFORM_TOKEN,
|
|
30
|
-
],
|
|
31
|
-
});
|
|
32
|
-
exports.NX_PACKAGE_PROVIDERS = [
|
|
33
|
-
exports.NX_PACKAGE_TRANSFORM,
|
|
34
|
-
options_di_1.NX_DEFAULT_OPTIONS_PROVIDER,
|
|
35
|
-
init_tsconfig_di_1.INIT_TS_CONFIG_TRANSFORM,
|
|
36
|
-
analyse_sources_di_1.ANALYSE_SOURCES_TRANSFORM,
|
|
37
|
-
];
|
package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from the original ng-packagr source.
|
|
3
|
-
*
|
|
4
|
-
* Changes made:
|
|
5
|
-
* - Use custom StylesheetProcessor instead of the one provided by ng-packagr.
|
|
6
|
-
* - Support Angular Compiler `incrementalDriver` for Angular < 16.
|
|
7
|
-
*/
|
|
8
|
-
import { BuildGraph } from 'ng-packagr/lib/graph/build-graph';
|
|
9
|
-
import * as ts from 'typescript';
|
|
10
|
-
import { NgPackagrOptions } from '../ng-package/options.di';
|
|
11
|
-
import { StylesheetProcessor } from '../styles/stylesheet-processor';
|
|
12
|
-
export declare function compileSourceFiles(graph: BuildGraph, tsConfig: any, moduleResolutionCache: ts.ModuleResolutionCache, options: NgPackagrOptions, extraOptions?: Partial<ts.CompilerOptions>, stylesheetProcessor?: StylesheetProcessor): Promise<void>;
|