@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.
Files changed (209) hide show
  1. package/executors.json +1 -1
  2. package/fesm2022/nx-angular-mf.mjs.map +1 -1
  3. package/fesm2022/nx-angular-testing.mjs.map +1 -1
  4. package/fesm2022/nx-angular.mjs.map +1 -1
  5. package/generators.json +1 -1
  6. package/migrations.json +151 -1
  7. package/package.json +8 -15
  8. package/src/builders/dev-server/lib/normalize-options.js +3 -0
  9. package/src/builders/dev-server/lib/validate-options.js +1 -9
  10. package/src/builders/dev-server/schema.json +3 -4
  11. package/src/executors/application/application.impl.d.ts +1 -1
  12. package/src/executors/application/application.impl.js +4 -1
  13. package/src/executors/application/schema.json +78 -6
  14. package/src/executors/application/utils/normalize-options.d.ts +2 -0
  15. package/src/executors/application/utils/normalize-options.js +33 -0
  16. package/src/executors/application/utils/validate-options.js +18 -4
  17. package/src/executors/browser-esbuild/browser-esbuild.impl.d.ts +1 -1
  18. package/src/executors/browser-esbuild/browser-esbuild.impl.js +0 -9
  19. package/src/executors/browser-esbuild/schema.json +1 -1
  20. package/src/executors/delegate-build/delegate-build.impl.d.ts +1 -1
  21. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -1
  22. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +1 -1
  23. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +8 -12
  24. package/src/executors/module-federation-ssr-dev-server/schema.d.ts +2 -14
  25. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.d.ts +1 -2
  26. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-packagr.js +11 -20
  27. package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.d.ts +1 -1
  28. package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +1 -1
  29. package/src/executors/ng-packagr-lite/schema.json +0 -8
  30. package/src/executors/package/ng-packagr-adjustments/ng-packagr.d.ts +1 -2
  31. package/src/executors/package/ng-packagr-adjustments/ng-packagr.js +4 -21
  32. package/src/executors/package/package.impl.d.ts +2 -2
  33. package/src/executors/package/package.impl.js +1 -1
  34. package/src/executors/package/schema.d.ts +1 -3
  35. package/src/executors/package/schema.json +0 -10
  36. package/src/executors/utilities/ng-packagr/{stylesheet-processor.js → pre-v19/stylesheet-processor.js} +2 -2
  37. package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +11 -5
  38. package/src/executors/utilities/ng-packagr/tailwindcss.d.ts +0 -6
  39. package/src/executors/utilities/ng-packagr/tailwindcss.js +0 -32
  40. package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts +23 -0
  41. package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.js +93 -0
  42. package/src/generators/application/application.js +1 -0
  43. package/src/generators/application/files/ng-module/src/app/app.component.ts__tpl__ +4 -5
  44. package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
  45. package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
  46. package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
  47. package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
  48. package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome.component.ts__tpl__ +2 -1
  49. package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome.component.ts__tpl__ +2 -2
  50. package/src/generators/application/files/standalone-components/src/app/app.component.ts__tpl__ +4 -6
  51. package/src/generators/application/lib/add-serve-static-target.d.ts +1 -1
  52. package/src/generators/application/lib/add-serve-static-target.js +1 -3
  53. package/src/generators/application/lib/create-files.js +4 -1
  54. package/src/generators/application/lib/create-project.js +24 -31
  55. package/src/generators/application/lib/normalize-options.js +1 -6
  56. package/src/generators/application/schema.d.ts +1 -0
  57. package/src/generators/application/schema.json +7 -2
  58. package/src/generators/component/component.js +4 -0
  59. package/src/generators/component/files/__fileName__.spec.ts__tpl__ +1 -1
  60. package/src/generators/component/files/__fileName__.ts__tpl__ +5 -13
  61. package/src/generators/component/lib/normalize-options.js +2 -0
  62. package/src/generators/component/schema.d.ts +1 -0
  63. package/src/generators/component/schema.json +5 -0
  64. package/src/generators/convert-to-application-executor/convert-to-application-executor.js +1 -4
  65. package/src/generators/convert-to-application-executor/schema.json +1 -1
  66. package/src/generators/directive/directive.js +5 -0
  67. package/src/generators/directive/files/__fileName__.ts__tpl__ +2 -2
  68. package/src/generators/directive/lib/normalize-options.js +3 -1
  69. package/src/generators/host/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
  70. package/src/generators/host/lib/update-ssr-setup.js +2 -1
  71. package/src/generators/host/schema.d.ts +1 -0
  72. package/src/generators/host/schema.json +4 -0
  73. package/src/generators/pipe/files/__fileName__.ts__tpl__ +2 -2
  74. package/src/generators/pipe/lib/normalize-options.js +3 -1
  75. package/src/generators/pipe/pipe.js +5 -0
  76. package/src/generators/remote/files/common/{v17+/src → src}/main.server.ts__tmpl__ +1 -1
  77. package/src/generators/remote/lib/update-ssr-setup.js +2 -1
  78. package/src/generators/remote/schema.d.ts +1 -0
  79. package/src/generators/remote/schema.json +4 -0
  80. package/src/generators/scam/lib/normalize-options.js +3 -1
  81. package/src/generators/scam-directive/lib/normalize-options.js +3 -1
  82. package/src/generators/scam-pipe/lib/normalize-options.js +3 -1
  83. package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.d.ts +1 -1
  84. package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +5 -4
  85. package/src/generators/setup-mf/files/entry-module-files/entry.component.ts__tmpl__ +2 -1
  86. package/src/generators/setup-mf/files/standalone-entry-component-files/entry.component.ts__tmpl__ +2 -2
  87. package/src/generators/setup-mf/lib/add-remote-entry.js +5 -0
  88. package/src/generators/setup-ssr/files/{server → pre-v19/server}/application-builder/__serverFileName__ +1 -1
  89. package/src/generators/setup-ssr/files/{server/server-builder/v17+ → pre-v19/server/server-builder}/__serverFileName__ +1 -1
  90. package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/__main__ +1 -0
  91. package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/__rootModuleFileName__ +13 -0
  92. package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/app.routes.server.ts__tpl__ +8 -0
  93. package/src/generators/setup-ssr/files/v19+/application-builder/server/__serverFileName__ +66 -0
  94. package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/__main__ +7 -0
  95. package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +14 -0
  96. package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.routes.server.ts__tpl__ +8 -0
  97. package/src/generators/setup-ssr/files/v19+/application-builder-common-engine/server/__serverFileName__ +65 -0
  98. package/src/generators/setup-ssr/files/v19+/server-builder/ngmodule-src/__main__ +1 -0
  99. package/src/generators/setup-ssr/files/v19+/server-builder/ngmodule-src/app/__rootModuleFileName__ +14 -0
  100. package/src/generators/setup-ssr/files/v19+/server-builder/root/tsconfig.server.json.template +16 -0
  101. package/src/generators/setup-ssr/files/{server/server-builder/pre-v17 → v19+/server-builder/server}/__serverFileName__ +25 -15
  102. package/src/generators/setup-ssr/files/v19+/server-builder/standalone-src/__main__ +7 -0
  103. package/src/generators/setup-ssr/files/v19+/server-builder/standalone-src/app/app.config.server.ts.template +11 -0
  104. package/src/generators/setup-ssr/lib/add-dependencies.js +6 -17
  105. package/src/generators/setup-ssr/lib/add-hydration.d.ts +2 -2
  106. package/src/generators/setup-ssr/lib/add-hydration.js +10 -2
  107. package/src/generators/setup-ssr/lib/add-server-file.d.ts +2 -2
  108. package/src/generators/setup-ssr/lib/add-server-file.js +24 -10
  109. package/src/generators/setup-ssr/lib/generate-files.d.ts +2 -2
  110. package/src/generators/setup-ssr/lib/generate-files.js +20 -8
  111. package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts +3 -3
  112. package/src/generators/setup-ssr/lib/generate-server-ts-config.js +24 -3
  113. package/src/generators/setup-ssr/lib/normalize-options.d.ts +3 -14
  114. package/src/generators/setup-ssr/lib/normalize-options.js +23 -6
  115. package/src/generators/setup-ssr/lib/set-router-initial-navigation.d.ts +2 -2
  116. package/src/generators/setup-ssr/lib/update-project-config.d.ts +3 -3
  117. package/src/generators/setup-ssr/lib/update-project-config.js +36 -24
  118. package/src/generators/setup-ssr/lib/validate-options.js +5 -0
  119. package/src/generators/setup-ssr/schema.d.ts +5 -0
  120. package/src/generators/setup-ssr/schema.json +6 -8
  121. package/src/generators/setup-ssr/setup-ssr.js +6 -11
  122. package/src/generators/setup-tailwind/lib/index.d.ts +1 -1
  123. package/src/generators/setup-tailwind/lib/index.js +1 -1
  124. package/src/generators/setup-tailwind/lib/update-application-styles.js +1 -1
  125. package/src/generators/setup-tailwind/lib/validate-build-target.d.ts +3 -0
  126. package/src/generators/setup-tailwind/lib/{add-tailwind-config-path-to-project.js → validate-build-target.js} +4 -15
  127. package/src/generators/setup-tailwind/setup-tailwind.js +4 -1
  128. package/src/generators/utils/storybook-ast/component-info.js +12 -2
  129. package/src/generators/utils/validations.d.ts +1 -0
  130. package/src/generators/utils/validations.js +10 -0
  131. package/src/generators/utils/version-utils.js +2 -2
  132. package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.d.ts +3 -0
  133. package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.js +48 -0
  134. package/src/migrations/update-20-2-0/update-angular-cli.d.ts +3 -0
  135. package/src/migrations/update-20-2-0/update-angular-cli.js +23 -0
  136. package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.d.ts +2 -0
  137. package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.js +55 -0
  138. package/src/utils/backward-compatible-versions.d.ts +4 -4
  139. package/src/utils/backward-compatible-versions.js +20 -19
  140. package/src/utils/nx-devkit/ast-utils.d.ts +10 -1
  141. package/src/utils/nx-devkit/ast-utils.js +32 -9
  142. package/src/utils/versions.d.ts +7 -7
  143. package/src/utils/versions.js +7 -7
  144. package/esm2022/index.mjs +0 -2
  145. package/esm2022/mf/index.mjs +0 -2
  146. package/esm2022/mf/mf.mjs +0 -116
  147. package/esm2022/mf/nx-angular-mf.mjs +0 -5
  148. package/esm2022/nx-angular.mjs +0 -5
  149. package/esm2022/src/runtime/nx/data-persistence.mjs +0 -349
  150. package/esm2022/testing/index.mjs +0 -2
  151. package/esm2022/testing/nx-angular-testing.mjs +0 -5
  152. package/esm2022/testing/src/testing-utils.mjs +0 -38
  153. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.d.ts +0 -14
  154. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.di.js +0 -27
  155. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.d.ts +0 -12
  156. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/compile-ngc.transform.js +0 -53
  157. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.d.ts +0 -15
  158. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.di.js +0 -28
  159. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.d.ts +0 -30
  160. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/entry-point.transform.js +0 -52
  161. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.d.ts +0 -12
  162. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.di.js +0 -20
  163. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.d.ts +0 -9
  164. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/entry-point/write-package.transform.js +0 -320
  165. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.d.ts +0 -14
  166. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/options.di.js +0 -35
  167. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.d.ts +0 -14
  168. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ng-package/package.di.js +0 -37
  169. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.d.ts +0 -12
  170. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/ngc/compile-source-files.js +0 -178
  171. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.d.ts +0 -42
  172. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.d.ts +0 -10
  173. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.di.js +0 -17
  174. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/pre-v17/styles/stylesheet-processor.js +0 -201
  175. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.d.ts +0 -14
  176. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.js +0 -26
  177. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.d.ts +0 -12
  178. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +0 -71
  179. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.d.ts +0 -13
  180. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.js +0 -32
  181. package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.d.ts +0 -14
  182. package/src/executors/package/ng-packagr-adjustments/ng-package/options.di.js +0 -35
  183. package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.d.ts +0 -14
  184. package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.js +0 -37
  185. package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +0 -13
  186. package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +0 -183
  187. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +0 -36
  188. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.d.ts +0 -10
  189. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.di.js +0 -17
  190. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +0 -194
  191. package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.d.ts +0 -1
  192. package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +0 -9
  193. package/src/generators/host/files/common/pre-v17/src/main.server.ts__tmpl__ +0 -66
  194. package/src/generators/remote/files/common/pre-v17/src/main.server.ts__tmpl__ +0 -72
  195. package/src/generators/setup-tailwind/lib/add-tailwind-config-path-to-project.d.ts +0 -3
  196. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.di.d.ts +0 -0
  197. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.di.js +0 -0
  198. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.transform.d.ts +0 -0
  199. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-bundles.transform.js +0 -0
  200. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.di.d.ts +0 -0
  201. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.di.js +0 -0
  202. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.transform.d.ts +0 -0
  203. /package/src/executors/ng-packagr-lite/ng-packagr-adjustments/{v17+ → pre-v19}/ng-package/entry-point/write-package.transform.js +0 -0
  204. /package/src/executors/utilities/ng-packagr/{stylesheet-processor.d.ts → pre-v19/stylesheet-processor.d.ts} +0 -0
  205. /package/src/generators/setup-ssr/files/{ngmodule/src → pre-v19/ngmodule-src}/__main__ +0 -0
  206. /package/src/generators/setup-ssr/files/{ngmodule/src → pre-v19/ngmodule-src}/app/__rootModuleFileName__ +0 -0
  207. /package/src/generators/setup-ssr/files/{root → pre-v19/root}/tsconfig.server.json__tpl__ +0 -0
  208. /package/src/generators/setup-ssr/files/{standalone/src → pre-v19/standalone-src}/__main__ +0 -0
  209. /package/src/generators/setup-ssr/files/{standalone/src → pre-v19/standalone-src}/app/app.config.server.ts__tpl__ +0 -0
@@ -1,178 +0,0 @@
1
- "use strict";
2
- /**
3
- * Adapted from the original ng-packagr source.
4
- *
5
- * Changes made:
6
- * - Use custom StylesheetProcessor instead of the one provided by ng-packagr.
7
- * - Support Angular Compiler `incrementalDriver` for Angular < 16.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.compileSourceFiles = compileSourceFiles;
11
- const tslib_1 = require("tslib");
12
- const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
13
- const cache_compiler_host_1 = require("ng-packagr/lib/ts/cache-compiler-host");
14
- const log = tslib_1.__importStar(require("ng-packagr/lib/utils/log"));
15
- const node_path_1 = require("node:path");
16
- const ts = tslib_1.__importStar(require("typescript"));
17
- const angular_version_utils_1 = require("../../../../utilities/angular-version-utils");
18
- const module_loader_1 = require("../../../../utilities/module-loader");
19
- async function compileSourceFiles(graph, tsConfig, moduleResolutionCache, options, extraOptions, stylesheetProcessor) {
20
- const { NgtscProgram, formatDiagnostics } = await (0, module_loader_1.loadEsmModule)('@angular/compiler-cli');
21
- const { cacheDirectory, watch, cacheEnabled } = options;
22
- const tsConfigOptions = {
23
- ...tsConfig.options,
24
- ...extraOptions,
25
- };
26
- const entryPoint = graph.find((0, nodes_1.isEntryPointInProgress)());
27
- const ngPackageNode = graph.find(nodes_1.isPackage);
28
- const inlineStyleLanguage = ngPackageNode.data.inlineStyleLanguage;
29
- const cacheDir = cacheEnabled && cacheDirectory;
30
- if (cacheDir) {
31
- tsConfigOptions.incremental ??= true;
32
- tsConfigOptions.tsBuildInfoFile ??= (0, node_path_1.join)(cacheDir, `tsbuildinfo/${entryPoint.data.entryPoint.flatModuleFile}.tsbuildinfo`);
33
- }
34
- const tsCompilerHost = (0, cache_compiler_host_1.cacheCompilerHost)(graph, entryPoint, tsConfigOptions, moduleResolutionCache, stylesheetProcessor, inlineStyleLanguage);
35
- const cache = entryPoint.cache;
36
- const sourceFileCache = cache.sourcesFileCache;
37
- let usingBuildInfo = false;
38
- let oldBuilder = cache.oldBuilder;
39
- if (!oldBuilder && cacheDir) {
40
- oldBuilder = ts.readBuilderProgram(tsConfigOptions, tsCompilerHost);
41
- usingBuildInfo = true;
42
- }
43
- // Create the Angular specific program that contains the Angular compiler
44
- const angularProgram = new NgtscProgram(tsConfig.rootNames, tsConfigOptions, tsCompilerHost, cache.oldNgtscProgram);
45
- const angularCompiler = angularProgram.compiler;
46
- const { ignoreForDiagnostics, ignoreForEmit } = angularCompiler;
47
- // SourceFile versions are required for builder programs.
48
- // The wrapped host inside NgtscProgram adds additional files that will not have versions.
49
- const typeScriptProgram = angularProgram.getTsProgram();
50
- (0, cache_compiler_host_1.augmentProgramWithVersioning)(typeScriptProgram);
51
- let builder;
52
- if (watch || cacheDir) {
53
- builder = cache.oldBuilder =
54
- ts.createEmitAndSemanticDiagnosticsBuilderProgram(typeScriptProgram, tsCompilerHost, oldBuilder);
55
- cache.oldNgtscProgram = angularProgram;
56
- }
57
- else {
58
- builder = ts.createEmitAndSemanticDiagnosticsBuilderProgram(typeScriptProgram, tsCompilerHost);
59
- }
60
- // Update semantic diagnostics cache
61
- const affectedFiles = new Set();
62
- // Analyze affected files when in watch mode for incremental type checking
63
- if ('getSemanticDiagnosticsOfNextAffectedFile' in builder) {
64
- // eslint-disable-next-line no-constant-condition
65
- while (true) {
66
- const result = builder.getSemanticDiagnosticsOfNextAffectedFile(undefined, (sourceFile) => {
67
- // If the affected file is a TTC shim, add the shim's original source file.
68
- // This ensures that changes that affect TTC are typechecked even when the changes
69
- // are otherwise unrelated from a TS perspective and do not result in Ivy codegen changes.
70
- // For example, changing @Input property types of a directive used in another component's
71
- // template.
72
- if (ignoreForDiagnostics.has(sourceFile) &&
73
- sourceFile.fileName.endsWith('.ngtypecheck.ts')) {
74
- // This file name conversion relies on internal compiler logic and should be converted
75
- // to an official method when available. 15 is length of `.ngtypecheck.ts`
76
- const originalFilename = sourceFile.fileName.slice(0, -15) + '.ts';
77
- const originalSourceFile = builder.getSourceFile(originalFilename);
78
- if (originalSourceFile) {
79
- affectedFiles.add(originalSourceFile);
80
- }
81
- return true;
82
- }
83
- return false;
84
- });
85
- if (!result) {
86
- break;
87
- }
88
- affectedFiles.add(result.affected);
89
- }
90
- // Add all files with associated template type checking files.
91
- // Stored TS build info does not have knowledge of the AOT compiler or the typechecking state of the templates.
92
- // To ensure that errors are reported correctly, all AOT component diagnostics need to be analyzed even if build
93
- // info is present.
94
- if (usingBuildInfo) {
95
- for (const sourceFile of builder.getSourceFiles()) {
96
- if (ignoreForDiagnostics.has(sourceFile) &&
97
- sourceFile.fileName.endsWith('.ngtypecheck.ts')) {
98
- // This file name conversion relies on internal compiler logic and should be converted
99
- // to an official method when available. 15 is length of `.ngtypecheck.ts`
100
- const originalFilename = sourceFile.fileName.slice(0, -15) + '.ts';
101
- const originalSourceFile = builder.getSourceFile(originalFilename);
102
- if (originalSourceFile) {
103
- affectedFiles.add(originalSourceFile);
104
- }
105
- }
106
- }
107
- }
108
- }
109
- // Collect program level diagnostics
110
- const allDiagnostics = [
111
- ...angularCompiler.getOptionDiagnostics(),
112
- ...builder.getOptionsDiagnostics(),
113
- ...builder.getGlobalDiagnostics(),
114
- ];
115
- // Required to support asynchronous resource loading
116
- // Must be done before creating transformers or getting template diagnostics
117
- await angularCompiler.analyzeAsync();
118
- // Collect source file specific diagnostics
119
- for (const sourceFile of builder.getSourceFiles()) {
120
- if (ignoreForDiagnostics.has(sourceFile)) {
121
- continue;
122
- }
123
- allDiagnostics.push(...builder.getDeclarationDiagnostics(sourceFile), ...builder.getSyntacticDiagnostics(sourceFile), ...builder.getSemanticDiagnostics(sourceFile));
124
- // Declaration files cannot have template diagnostics
125
- if (sourceFile.isDeclarationFile) {
126
- continue;
127
- }
128
- // Only request Angular template diagnostics for affected files to avoid
129
- // overhead of template diagnostics for unchanged files.
130
- if (affectedFiles.has(sourceFile)) {
131
- const angularDiagnostics = angularCompiler.getDiagnosticsForFile(sourceFile, affectedFiles.size === 1
132
- ? /** OptimizeFor.SingleFile **/ 0
133
- : /** OptimizeFor.WholeProgram */ 1);
134
- allDiagnostics.push(...angularDiagnostics);
135
- sourceFileCache.updateAngularDiagnostics(sourceFile, angularDiagnostics);
136
- }
137
- }
138
- const otherDiagnostics = [];
139
- const errorDiagnostics = [];
140
- for (const diagnostic of allDiagnostics) {
141
- if (diagnostic.category === ts.DiagnosticCategory.Error) {
142
- errorDiagnostics.push(diagnostic);
143
- }
144
- else {
145
- otherDiagnostics.push(diagnostic);
146
- }
147
- }
148
- if (otherDiagnostics.length) {
149
- log.msg(formatDiagnostics(errorDiagnostics));
150
- }
151
- if (errorDiagnostics.length) {
152
- throw new Error(formatDiagnostics(errorDiagnostics));
153
- }
154
- const transformers = angularCompiler.prepareEmit().transformers;
155
- if ('getSemanticDiagnosticsOfNextAffectedFile' in builder) {
156
- while (builder.emitNextAffectedFile((fileName, data, writeByteOrderMark, onError, sourceFiles) => {
157
- if (fileName.endsWith('.tsbuildinfo')) {
158
- tsCompilerHost.writeFile(fileName, data, writeByteOrderMark, onError, sourceFiles);
159
- }
160
- })) {
161
- // empty
162
- }
163
- }
164
- const angularVersion = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
165
- const incrementalCompilation = angularVersion.major < 16
166
- ? angularCompiler.incrementalDriver
167
- : angularCompiler.incrementalCompilation;
168
- for (const sourceFile of builder.getSourceFiles()) {
169
- if (ignoreForEmit.has(sourceFile)) {
170
- continue;
171
- }
172
- if (incrementalCompilation.safeToSkipEmit(sourceFile)) {
173
- continue;
174
- }
175
- builder.emit(sourceFile, undefined, undefined, undefined, transformers);
176
- incrementalCompilation.recordSuccessfulEmit(sourceFile);
177
- }
178
- }
@@ -1,42 +0,0 @@
1
- /**
2
- * Adapted from the original ng-packagr source.
3
- *
4
- * Changes made:
5
- * - Refactored caching to take into account TailwindCSS processing.
6
- * - Added PostCSS plugin needed to support TailwindCSS.
7
- */
8
- export declare enum CssUrl {
9
- inline = "inline",
10
- none = "none"
11
- }
12
- export declare enum InlineStyleLanguage {
13
- sass = "sass",
14
- scss = "scss",
15
- css = "css",
16
- less = "less"
17
- }
18
- export interface Result {
19
- css: string;
20
- warnings: string[];
21
- error?: string;
22
- }
23
- export declare class StylesheetProcessor {
24
- private readonly projectBasePath;
25
- private readonly basePath;
26
- private readonly cssUrl?;
27
- private readonly includePaths?;
28
- private cacheDirectory?;
29
- private readonly tailwindConfig?;
30
- private browserslistData;
31
- private targets;
32
- private postCssProcessor;
33
- private esbuild;
34
- private styleIncludePaths;
35
- constructor(projectBasePath: string, basePath: string, cssUrl?: CssUrl, includePaths?: string[], cacheDirectory?: string | false, tailwindConfig?: string);
36
- process({ filePath, content, }: {
37
- filePath: string;
38
- content: string;
39
- }): Promise<string>;
40
- private createPostCssProcessor;
41
- private renderCss;
42
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * Adapted from the original ng-packagr source.
3
- *
4
- * Changes made:
5
- * - Use our own StylesheetProcessor instead of the one provided by ng-packagr.
6
- */
7
- import { FactoryProvider, InjectionToken } from 'injection-js';
8
- import { StylesheetProcessor } from './stylesheet-processor';
9
- export declare const NX_STYLESHEET_PROCESSOR_TOKEN: InjectionToken<StylesheetProcessor>;
10
- export declare const NX_STYLESHEET_PROCESSOR: FactoryProvider;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- /**
3
- * Adapted from the original ng-packagr source.
4
- *
5
- * Changes made:
6
- * - Use our own StylesheetProcessor instead of the one provided by ng-packagr.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.NX_STYLESHEET_PROCESSOR = exports.NX_STYLESHEET_PROCESSOR_TOKEN = void 0;
10
- const injection_js_1 = require("injection-js");
11
- const stylesheet_processor_1 = require("./stylesheet-processor");
12
- exports.NX_STYLESHEET_PROCESSOR_TOKEN = new injection_js_1.InjectionToken(`nx.v1.stylesheetProcessor`);
13
- exports.NX_STYLESHEET_PROCESSOR = {
14
- provide: exports.NX_STYLESHEET_PROCESSOR_TOKEN,
15
- useFactory: () => stylesheet_processor_1.StylesheetProcessor,
16
- deps: [],
17
- };
@@ -1,201 +0,0 @@
1
- "use strict";
2
- /**
3
- * Adapted from the original ng-packagr source.
4
- *
5
- * Changes made:
6
- * - Refactored caching to take into account TailwindCSS processing.
7
- * - Added PostCSS plugin needed to support TailwindCSS.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.StylesheetProcessor = exports.InlineStyleLanguage = exports.CssUrl = void 0;
11
- const tslib_1 = require("tslib");
12
- const browserslist_1 = tslib_1.__importDefault(require("browserslist"));
13
- const fs_1 = require("fs");
14
- const cache_1 = require("ng-packagr/lib/utils/cache");
15
- const log = tslib_1.__importStar(require("ng-packagr/lib/utils/log"));
16
- const path_1 = require("path");
17
- const autoprefixer_1 = tslib_1.__importDefault(require("autoprefixer"));
18
- const postcss_url_1 = tslib_1.__importDefault(require("postcss-url"));
19
- const node_url_1 = require("node:url");
20
- const tailwindcss_1 = require("../../../../utilities/ng-packagr/tailwindcss");
21
- const postcss = require('postcss');
22
- var CssUrl;
23
- (function (CssUrl) {
24
- CssUrl["inline"] = "inline";
25
- CssUrl["none"] = "none";
26
- })(CssUrl || (exports.CssUrl = CssUrl = {}));
27
- var InlineStyleLanguage;
28
- (function (InlineStyleLanguage) {
29
- InlineStyleLanguage["sass"] = "sass";
30
- InlineStyleLanguage["scss"] = "scss";
31
- InlineStyleLanguage["css"] = "css";
32
- InlineStyleLanguage["less"] = "less";
33
- })(InlineStyleLanguage || (exports.InlineStyleLanguage = InlineStyleLanguage = {}));
34
- class StylesheetProcessor {
35
- constructor(projectBasePath, basePath, cssUrl, includePaths, cacheDirectory, tailwindConfig) {
36
- this.projectBasePath = projectBasePath;
37
- this.basePath = basePath;
38
- this.cssUrl = cssUrl;
39
- this.includePaths = includePaths;
40
- this.cacheDirectory = cacheDirectory;
41
- this.tailwindConfig = tailwindConfig;
42
- this.esbuild = new (require('ng-packagr/lib/esbuild/esbuild-executor').EsbuildExecutor)();
43
- // By default, browserslist defaults are too inclusive
44
- // https://github.com/browserslist/browserslist/blob/83764ea81ffaa39111c204b02c371afa44a4ff07/index.js#L516-L522
45
- // We change the default query to browsers that Angular support.
46
- // https://angular.io/guide/browser-support
47
- browserslist_1.default.defaults = [
48
- 'last 2 Chrome versions',
49
- 'last 1 Firefox version',
50
- 'last 2 Edge major versions',
51
- 'last 2 Safari major versions',
52
- 'last 2 iOS major versions',
53
- 'Firefox ESR',
54
- ];
55
- this.styleIncludePaths = [...this.includePaths];
56
- let prevDir = null;
57
- let currentDir = this.basePath;
58
- while (currentDir !== prevDir) {
59
- const p = (0, path_1.join)(currentDir, 'node_modules');
60
- if ((0, fs_1.existsSync)(p)) {
61
- this.styleIncludePaths.push(p);
62
- }
63
- prevDir = currentDir;
64
- currentDir = (0, path_1.dirname)(prevDir);
65
- }
66
- this.browserslistData = (0, browserslist_1.default)(undefined, { path: this.basePath });
67
- this.targets = transformSupportedBrowsersToTargets(this.browserslistData);
68
- const tailwindSetup = (0, tailwindcss_1.getTailwindSetup)(this.projectBasePath, this.tailwindConfig);
69
- if (tailwindSetup) {
70
- this.cacheDirectory = undefined;
71
- }
72
- this.postCssProcessor = this.createPostCssProcessor(tailwindSetup);
73
- }
74
- async process({ filePath, content, }) {
75
- const CACHE_KEY_VALUES = [
76
- ...this.browserslistData,
77
- ...this.styleIncludePaths,
78
- this.cssUrl,
79
- ].join(':');
80
- let key;
81
- if (this.cacheDirectory &&
82
- !content.includes('@import') &&
83
- !content.includes('@use')) {
84
- // No transitive deps and no Tailwind directives, we can cache more aggressively.
85
- key = await (0, cache_1.generateKey)(content, CACHE_KEY_VALUES);
86
- const result = await (0, cache_1.readCacheEntry)(this.cacheDirectory, key);
87
- if (result) {
88
- result.warnings.forEach((msg) => log.warn(msg));
89
- return result.css;
90
- }
91
- }
92
- // Render pre-processor language (sass, styl, less)
93
- const renderedCss = await this.renderCss(filePath, content);
94
- // We cannot cache CSS re-rendering phase, because a transitive dependency via (@import) can case different CSS output.
95
- // Example a change in a mixin or SCSS variable.
96
- if (!key) {
97
- key = await (0, cache_1.generateKey)(renderedCss, CACHE_KEY_VALUES);
98
- }
99
- if (this.cacheDirectory) {
100
- const cachedResult = await (0, cache_1.readCacheEntry)(this.cacheDirectory, key);
101
- if (cachedResult) {
102
- cachedResult.warnings.forEach((msg) => log.warn(msg));
103
- return cachedResult.css;
104
- }
105
- }
106
- // Render postcss (autoprefixing and friends)
107
- const result = await this.postCssProcessor.process(renderedCss, {
108
- from: filePath,
109
- to: filePath.replace((0, path_1.extname)(filePath), '.css'),
110
- });
111
- const warnings = result.warnings().map((w) => w.toString());
112
- const { code, warnings: esBuildWarnings } = await this.esbuild.transform(result.css, {
113
- loader: 'css',
114
- minify: true,
115
- target: this.targets,
116
- sourcefile: filePath,
117
- });
118
- if (esBuildWarnings.length > 0) {
119
- warnings.push(...(await this.esbuild.formatMessages(esBuildWarnings, {
120
- kind: 'warning',
121
- })));
122
- }
123
- if (this.cacheDirectory) {
124
- await (0, cache_1.saveCacheEntry)(this.cacheDirectory, key, JSON.stringify({
125
- css: code,
126
- warnings,
127
- }));
128
- }
129
- warnings.forEach((msg) => log.warn(msg));
130
- return code;
131
- }
132
- createPostCssProcessor(tailwindSetup) {
133
- const postCssPlugins = [];
134
- if (tailwindSetup) {
135
- postCssPlugins.push((0, tailwindcss_1.getTailwindPostCssPlugin)(tailwindSetup));
136
- }
137
- if (this.cssUrl !== CssUrl.none) {
138
- postCssPlugins.push((0, postcss_url_1.default)({ url: this.cssUrl }));
139
- }
140
- postCssPlugins.push((0, autoprefixer_1.default)({
141
- ignoreUnknownVersions: true,
142
- overrideBrowserslist: this.browserslistData,
143
- }));
144
- return postcss(postCssPlugins);
145
- }
146
- async renderCss(filePath, css) {
147
- const ext = (0, path_1.extname)(filePath);
148
- switch (ext) {
149
- case '.sass':
150
- case '.scss': {
151
- return (await import('sass')).compileString(css, {
152
- url: (0, node_url_1.pathToFileURL)(filePath),
153
- syntax: '.sass' === ext ? 'indented' : 'scss',
154
- loadPaths: this.styleIncludePaths,
155
- }).css;
156
- }
157
- case '.less': {
158
- const { css: content } = await (await import('less')).render(css, {
159
- filename: filePath,
160
- javascriptEnabled: true,
161
- paths: this.styleIncludePaths,
162
- });
163
- return content;
164
- }
165
- case '.css':
166
- default:
167
- return css;
168
- }
169
- }
170
- }
171
- exports.StylesheetProcessor = StylesheetProcessor;
172
- function transformSupportedBrowsersToTargets(supportedBrowsers) {
173
- const transformed = [];
174
- // https://esbuild.github.io/api/#target
175
- const esBuildSupportedBrowsers = new Set([
176
- 'safari',
177
- 'firefox',
178
- 'edge',
179
- 'chrome',
180
- 'ios',
181
- ]);
182
- for (const browser of supportedBrowsers) {
183
- let [browserName, version] = browser.split(' ');
184
- // browserslist uses the name `ios_saf` for iOS Safari whereas esbuild uses `ios`
185
- if (browserName === 'ios_saf') {
186
- browserName = 'ios';
187
- }
188
- // browserslist uses ranges `15.2-15.3` versions but only the lowest is required
189
- // to perform minimum supported feature checks. esbuild also expects a single version.
190
- [version] = version.split('-');
191
- if (esBuildSupportedBrowsers.has(browserName)) {
192
- if (browserName === 'safari' && version === 'tp') {
193
- // esbuild only supports numeric versions so `TP` is converted to a high number (999) since
194
- // a Technology Preview (TP) of Safari is assumed to support all currently known features.
195
- version = '999';
196
- }
197
- transformed.push(browserName + version);
198
- }
199
- }
200
- return transformed.length ? transformed : undefined;
201
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * Adapted from the original ng-packagr source.
3
- *
4
- * Changes made:
5
- * - Use our own compileNgcTransformFactory instead of the one provided by ng-packagr.
6
- * - Use NX_STYLESHEET_PROCESSOR instead of STYLESHEET_PROCESSOR.
7
- * - Use NX_STYLESHEET_PROCESSOR_TOKEN instead of STYLESHEET_PROCESSOR_TOKEN.
8
- */
9
- import { InjectionToken, Provider } from 'injection-js';
10
- import { Transform } from 'ng-packagr/lib/graph/transform';
11
- import { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
12
- export declare const NX_COMPILE_NGC_TOKEN: InjectionToken<Transform>;
13
- export declare const NX_COMPILE_NGC_TRANSFORM: TransformProvider;
14
- export declare const NX_COMPILE_NGC_PROVIDERS: Provider[];
@@ -1,26 +0,0 @@
1
- "use strict";
2
- /**
3
- * Adapted from the original ng-packagr source.
4
- *
5
- * Changes made:
6
- * - Use our own compileNgcTransformFactory instead of the one provided by ng-packagr.
7
- * - Use NX_STYLESHEET_PROCESSOR instead of STYLESHEET_PROCESSOR.
8
- * - Use NX_STYLESHEET_PROCESSOR_TOKEN instead of STYLESHEET_PROCESSOR_TOKEN.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.NX_COMPILE_NGC_PROVIDERS = exports.NX_COMPILE_NGC_TRANSFORM = exports.NX_COMPILE_NGC_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 stylesheet_processor_di_1 = require("../../styles/stylesheet-processor.di");
15
- const options_di_1 = require("../options.di");
16
- const compile_ngc_transform_1 = require("./compile-ngc.transform");
17
- exports.NX_COMPILE_NGC_TOKEN = new injection_js_1.InjectionToken(`nx.v1.compileNgcTransform`);
18
- exports.NX_COMPILE_NGC_TRANSFORM = (0, transform_di_1.provideTransform)({
19
- provide: exports.NX_COMPILE_NGC_TOKEN,
20
- useFactory: compile_ngc_transform_1.compileNgcTransformFactory,
21
- deps: [stylesheet_processor_di_1.NX_STYLESHEET_PROCESSOR_TOKEN, options_di_1.NX_OPTIONS_TOKEN],
22
- });
23
- exports.NX_COMPILE_NGC_PROVIDERS = [
24
- stylesheet_processor_di_1.NX_STYLESHEET_PROCESSOR,
25
- exports.NX_COMPILE_NGC_TRANSFORM,
26
- ];
@@ -1,12 +0,0 @@
1
- /**
2
- * Adapted from the original ng-packagr source.
3
- *
4
- * Changes made:
5
- * - Use our own StylesheetProcessor files instead of the ones provide by ng-packagr.
6
- * - Support ngcc for Angular < 16.
7
- * - Support ESM2020 for Angular < 16.
8
- */
9
- import { Transform } from 'ng-packagr/lib/graph/transform';
10
- import { StylesheetProcessor as StylesheetProcessorClass } from '../../styles/stylesheet-processor';
11
- import { NgPackagrOptions } from '../options.di';
12
- export declare const compileNgcTransformFactory: (StylesheetProcessor: typeof StylesheetProcessorClass, options: NgPackagrOptions) => Transform;
@@ -1,71 +0,0 @@
1
- "use strict";
2
- /**
3
- * Adapted from the original ng-packagr source.
4
- *
5
- * Changes made:
6
- * - Use our own StylesheetProcessor files instead of the ones provide by ng-packagr.
7
- * - Support ngcc for Angular < 16.
8
- * - Support ESM2020 for Angular < 16.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.compileNgcTransformFactory = void 0;
12
- const tslib_1 = require("tslib");
13
- const transform_1 = require("ng-packagr/lib/graph/transform");
14
- const nodes_1 = require("ng-packagr/lib/ng-package/nodes");
15
- const tsconfig_1 = require("ng-packagr/lib/ts/tsconfig");
16
- const ora_1 = tslib_1.__importDefault(require("ora"));
17
- const path = tslib_1.__importStar(require("path"));
18
- const ts = tslib_1.__importStar(require("typescript"));
19
- const angular_version_utils_1 = require("../../../../utilities/angular-version-utils");
20
- const compile_source_files_1 = require("../../ngc/compile-source-files");
21
- const ng_compiler_cli_1 = require("../../utils/ng-compiler-cli");
22
- const compileNgcTransformFactory = (StylesheetProcessor, options) => {
23
- return (0, transform_1.transformFromPromise)(async (graph) => {
24
- const spinner = (0, ora_1.default)({
25
- hideCursor: false,
26
- discardStdin: false,
27
- });
28
- const entryPoints = graph.filter(nodes_1.isEntryPoint);
29
- const entryPoint = graph.find((0, nodes_1.isEntryPointInProgress)());
30
- const ngPackageNode = graph.find(nodes_1.isPackage);
31
- const projectBasePath = ngPackageNode.data.primary.basePath;
32
- try {
33
- // Add paths mappings for dependencies
34
- const tsConfig = (0, tsconfig_1.setDependenciesTsConfigPaths)(entryPoint.data.tsConfig, entryPoints);
35
- const angularVersion = (0, angular_version_utils_1.getInstalledAngularVersionInfo)();
36
- // Compile TypeScript sources
37
- const { declarations } = entryPoint.data.destinationFiles;
38
- const esmModulePath = angularVersion.major < 16
39
- ? entryPoint.data.destinationFiles.esm2020
40
- : entryPoint.data.destinationFiles.esm2022;
41
- const { basePath, cssUrl, styleIncludePaths } = entryPoint.data.entryPoint;
42
- const { moduleResolutionCache } = entryPoint.cache;
43
- spinner.start(`Compiling with Angular sources in Ivy ${tsConfig.options.compilationMode || 'full'} compilation mode.`);
44
- let ngccProcessor;
45
- if (angularVersion && angularVersion.major < 16) {
46
- ngccProcessor =
47
- new (require('ng-packagr/lib/ngc/ngcc-processor').NgccProcessor)(await (0, ng_compiler_cli_1.ngccCompilerCli)(), entryPoint.cache.ngccProcessingCache, tsConfig.project, tsConfig.options, entryPoints);
48
- if (!entryPoint.data.entryPoint.isSecondaryEntryPoint) {
49
- // Only run the async version of NGCC during the primary entrypoint processing.
50
- await ngccProcessor.process();
51
- }
52
- }
53
- entryPoint.cache.stylesheetProcessor ??= new StylesheetProcessor(projectBasePath, basePath, cssUrl, styleIncludePaths, options.cacheEnabled && options.cacheDirectory, options.tailwindConfig);
54
- await (0, compile_source_files_1.compileSourceFiles)(graph, tsConfig, moduleResolutionCache, options, {
55
- outDir: path.dirname(esmModulePath),
56
- declarationDir: path.dirname(declarations),
57
- declaration: true,
58
- target: angularVersion.major >= 16
59
- ? ts.ScriptTarget.ES2022
60
- : ts.ScriptTarget.ES2020,
61
- }, entryPoint.cache.stylesheetProcessor, ngccProcessor);
62
- }
63
- catch (error) {
64
- spinner.fail();
65
- throw error;
66
- }
67
- spinner.succeed();
68
- return graph;
69
- });
70
- };
71
- exports.compileNgcTransformFactory = compileNgcTransformFactory;
@@ -1,13 +0,0 @@
1
- /**
2
- * Adapted from the original ng-packagr source.
3
- *
4
- * Changes made:
5
- * - Use NX_COMPILE_NGC_TOKEN instead of COMPILE_NGC_TOKEN.
6
- * - Use NX_COMPILE_NGC_PROVIDERS instead of COMPILE_NGC_PROVIDERS.
7
- */
8
- import { InjectionToken, Provider } from 'injection-js';
9
- import { Transform } from 'ng-packagr/lib/graph/transform';
10
- import { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
11
- export declare const NX_ENTRY_POINT_TRANSFORM_TOKEN: InjectionToken<Transform>;
12
- export declare const NX_ENTRY_POINT_TRANSFORM: TransformProvider;
13
- export declare const NX_ENTRY_POINT_PROVIDERS: Provider[];
@@ -1,32 +0,0 @@
1
- "use strict";
2
- /**
3
- * Adapted from the original ng-packagr source.
4
- *
5
- * Changes made:
6
- * - Use NX_COMPILE_NGC_TOKEN instead of COMPILE_NGC_TOKEN.
7
- * - Use NX_COMPILE_NGC_PROVIDERS instead of COMPILE_NGC_PROVIDERS.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.NX_ENTRY_POINT_PROVIDERS = exports.NX_ENTRY_POINT_TRANSFORM = exports.NX_ENTRY_POINT_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 entry_point_transform_1 = require("ng-packagr/lib/ng-package/entry-point/entry-point.transform");
14
- const write_bundles_di_1 = require("ng-packagr/lib/ng-package/entry-point/write-bundles.di");
15
- const write_package_di_1 = require("ng-packagr/lib/ng-package/entry-point/write-package.di");
16
- const compile_ngc_di_1 = require("./compile-ngc.di");
17
- exports.NX_ENTRY_POINT_TRANSFORM_TOKEN = new injection_js_1.InjectionToken(`nx.v1.entryPointTransform`);
18
- exports.NX_ENTRY_POINT_TRANSFORM = (0, transform_di_1.provideTransform)({
19
- provide: exports.NX_ENTRY_POINT_TRANSFORM_TOKEN,
20
- useFactory: entry_point_transform_1.entryPointTransformFactory,
21
- deps: [
22
- compile_ngc_di_1.NX_COMPILE_NGC_TOKEN,
23
- write_bundles_di_1.WRITE_BUNDLES_TRANSFORM_TOKEN,
24
- write_package_di_1.WRITE_PACKAGE_TRANSFORM_TOKEN,
25
- ],
26
- });
27
- exports.NX_ENTRY_POINT_PROVIDERS = [
28
- exports.NX_ENTRY_POINT_TRANSFORM,
29
- ...compile_ngc_di_1.NX_COMPILE_NGC_PROVIDERS,
30
- write_bundles_di_1.WRITE_BUNDLES_TRANSFORM,
31
- write_package_di_1.WRITE_PACKAGE_TRANSFORM,
32
- ];
@@ -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;