@analogjs/vite-plugin-angular 3.0.0-alpha.5 → 3.0.0-alpha.50

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 (194) hide show
  1. package/README.md +30 -0
  2. package/migrations/migrate-setup-vitest/migrate-setup-vitest.d.ts +2 -0
  3. package/migrations/migrate-setup-vitest/migrate-setup-vitest.js +49 -0
  4. package/migrations/migrate-setup-vitest/migrate-setup-vitest.js.map +1 -0
  5. package/migrations/migration.json +7 -1
  6. package/migrations/migrations.json +9 -0
  7. package/migrations/update-3-0-0/migrate-setup-vitest.d.ts +2 -0
  8. package/migrations/update-3-0-0/migrate-setup-vitest.js +36 -0
  9. package/migrations/update-3-0-0/migrate-setup-vitest.js.map +1 -0
  10. package/package.json +41 -12
  11. package/src/index.d.ts +3 -2
  12. package/src/index.js +6 -2
  13. package/src/index.js.map +1 -1
  14. package/src/lib/angular-build-optimizer-plugin.d.ts +4 -4
  15. package/src/lib/angular-build-optimizer-plugin.js +48 -62
  16. package/src/lib/angular-build-optimizer-plugin.js.map +1 -1
  17. package/src/lib/angular-jit-plugin.d.ts +3 -3
  18. package/src/lib/angular-jit-plugin.js +39 -37
  19. package/src/lib/angular-jit-plugin.js.map +1 -1
  20. package/src/lib/angular-pending-tasks.plugin.d.ts +7 -7
  21. package/src/lib/angular-pending-tasks.plugin.js +17 -18
  22. package/src/lib/angular-pending-tasks.plugin.js.map +1 -1
  23. package/src/lib/angular-vite-plugin.d.ts +180 -44
  24. package/src/lib/angular-vite-plugin.js +1233 -969
  25. package/src/lib/angular-vite-plugin.js.map +1 -1
  26. package/src/lib/angular-vitest-plugin.d.ts +19 -15
  27. package/src/lib/angular-vitest-plugin.js +99 -114
  28. package/src/lib/angular-vitest-plugin.js.map +1 -1
  29. package/src/lib/compilation-api/compilation-api-plugin.d.ts +29 -0
  30. package/src/lib/compilation-api/compilation-api-plugin.js +469 -0
  31. package/src/lib/compilation-api/compilation-api-plugin.js.map +1 -0
  32. package/src/lib/compilation-api/index.d.ts +1 -0
  33. package/src/lib/compilation-api/index.js +1 -0
  34. package/src/lib/compiler/angular-version.d.ts +19 -0
  35. package/src/lib/compiler/angular-version.js +16 -0
  36. package/src/lib/compiler/angular-version.js.map +1 -0
  37. package/src/lib/compiler/class-field-lowering.d.ts +23 -0
  38. package/src/lib/compiler/class-field-lowering.js +131 -0
  39. package/src/lib/compiler/class-field-lowering.js.map +1 -0
  40. package/src/lib/compiler/compile.d.ts +44 -0
  41. package/src/lib/compiler/compile.js +731 -0
  42. package/src/lib/compiler/compile.js.map +1 -0
  43. package/src/lib/compiler/constants.d.ts +18 -0
  44. package/src/lib/compiler/constants.js +52 -0
  45. package/src/lib/compiler/constants.js.map +1 -0
  46. package/src/lib/compiler/debug.d.ts +22 -0
  47. package/src/lib/compiler/debug.js +20 -0
  48. package/src/lib/compiler/debug.js.map +1 -0
  49. package/src/lib/compiler/defer.d.ts +57 -0
  50. package/src/lib/compiler/defer.js +154 -0
  51. package/src/lib/compiler/defer.js.map +1 -0
  52. package/src/lib/compiler/dts-reader.d.ts +35 -0
  53. package/src/lib/compiler/dts-reader.js +365 -0
  54. package/src/lib/compiler/dts-reader.js.map +1 -0
  55. package/src/lib/compiler/hmr.d.ts +16 -0
  56. package/src/lib/compiler/hmr.js +69 -0
  57. package/src/lib/compiler/hmr.js.map +1 -0
  58. package/src/lib/compiler/index.d.ts +7 -0
  59. package/src/lib/compiler/index.js +7 -0
  60. package/src/lib/compiler/jit-metadata.d.ts +14 -0
  61. package/src/lib/compiler/jit-metadata.js +146 -0
  62. package/src/lib/compiler/jit-metadata.js.map +1 -0
  63. package/src/lib/compiler/jit-transform.d.ts +24 -0
  64. package/src/lib/compiler/jit-transform.js +200 -0
  65. package/src/lib/compiler/jit-transform.js.map +1 -0
  66. package/src/lib/compiler/js-emitter.d.ts +10 -0
  67. package/src/lib/compiler/js-emitter.js +445 -0
  68. package/src/lib/compiler/js-emitter.js.map +1 -0
  69. package/src/lib/compiler/metadata.d.ts +45 -0
  70. package/src/lib/compiler/metadata.js +633 -0
  71. package/src/lib/compiler/metadata.js.map +1 -0
  72. package/src/lib/compiler/registry.d.ts +49 -0
  73. package/src/lib/compiler/registry.js +164 -0
  74. package/src/lib/compiler/registry.js.map +1 -0
  75. package/src/lib/compiler/resource-inliner.d.ts +21 -0
  76. package/src/lib/compiler/resource-inliner.js +152 -0
  77. package/src/lib/compiler/resource-inliner.js.map +1 -0
  78. package/src/lib/compiler/style-ast.d.ts +8 -0
  79. package/src/lib/compiler/style-ast.js +54 -0
  80. package/src/lib/compiler/style-ast.js.map +1 -0
  81. package/src/lib/compiler/styles.d.ts +13 -0
  82. package/src/lib/compiler/test-helpers.d.ts +7 -0
  83. package/src/lib/compiler/type-elision.d.ts +26 -0
  84. package/src/lib/compiler/type-elision.js +211 -0
  85. package/src/lib/compiler/type-elision.js.map +1 -0
  86. package/src/lib/compiler/utils.d.ts +10 -0
  87. package/src/lib/compiler/utils.js +35 -0
  88. package/src/lib/compiler/utils.js.map +1 -0
  89. package/src/lib/compiler-plugin.d.ts +11 -11
  90. package/src/lib/compiler-plugin.js +43 -44
  91. package/src/lib/compiler-plugin.js.map +1 -1
  92. package/src/lib/component-resolvers.d.ts +23 -5
  93. package/src/lib/component-resolvers.js +153 -63
  94. package/src/lib/component-resolvers.js.map +1 -1
  95. package/src/lib/encapsulation-plugin.d.ts +13 -0
  96. package/src/lib/encapsulation-plugin.js +48 -0
  97. package/src/lib/encapsulation-plugin.js.map +1 -0
  98. package/src/lib/fast-compile-plugin.d.ts +28 -0
  99. package/src/lib/fast-compile-plugin.js +289 -0
  100. package/src/lib/fast-compile-plugin.js.map +1 -0
  101. package/src/lib/host.d.ts +10 -8
  102. package/src/lib/host.js +113 -101
  103. package/src/lib/host.js.map +1 -1
  104. package/src/lib/live-reload-plugin.d.ts +5 -5
  105. package/src/lib/live-reload-plugin.js +61 -62
  106. package/src/lib/live-reload-plugin.js.map +1 -1
  107. package/src/lib/models.d.ts +9 -9
  108. package/src/lib/nx-folder-plugin.d.ts +5 -5
  109. package/src/lib/nx-folder-plugin.js +18 -16
  110. package/src/lib/nx-folder-plugin.js.map +1 -1
  111. package/src/lib/plugins/file-replacements.plugin.d.ts +4 -4
  112. package/src/lib/plugins/file-replacements.plugin.js +40 -62
  113. package/src/lib/plugins/file-replacements.plugin.js.map +1 -1
  114. package/src/lib/router-plugin.d.ts +1 -1
  115. package/src/lib/router-plugin.js +23 -23
  116. package/src/lib/router-plugin.js.map +1 -1
  117. package/src/lib/style-pipeline.d.ts +15 -0
  118. package/src/lib/style-pipeline.js +31 -0
  119. package/src/lib/style-pipeline.js.map +1 -0
  120. package/src/lib/style-preprocessor.d.ts +35 -0
  121. package/src/lib/style-preprocessor.js +35 -0
  122. package/src/lib/style-preprocessor.js.map +1 -0
  123. package/src/lib/stylesheet-registry.d.ts +73 -0
  124. package/src/lib/stylesheet-registry.js +168 -0
  125. package/src/lib/stylesheet-registry.js.map +1 -0
  126. package/src/lib/tailwind-plugin.d.ts +34 -0
  127. package/src/lib/tailwind-plugin.js +116 -0
  128. package/src/lib/tailwind-plugin.js.map +1 -0
  129. package/src/lib/template-class-binding-guard-plugin.d.ts +30 -0
  130. package/src/lib/template-class-binding-guard-plugin.js +237 -0
  131. package/src/lib/template-class-binding-guard-plugin.js.map +1 -0
  132. package/src/lib/tools/package.json +2 -7
  133. package/src/lib/tools/src/builders/vite/vite-build.impl.js +31 -38
  134. package/src/lib/tools/src/builders/vite/vite-build.impl.js.map +1 -1
  135. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js +51 -62
  136. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js.map +1 -1
  137. package/src/lib/tools/src/index.js +0 -2
  138. package/src/lib/utils/compilation-shared.d.ts +58 -0
  139. package/src/lib/utils/compilation-shared.js +133 -0
  140. package/src/lib/utils/compilation-shared.js.map +1 -0
  141. package/src/lib/utils/compiler-plugin-options.d.ts +11 -11
  142. package/src/lib/utils/debug-harness.d.ts +23 -0
  143. package/src/lib/utils/debug-harness.js +88 -0
  144. package/src/lib/utils/debug-harness.js.map +1 -0
  145. package/src/lib/utils/debug-log-file.d.ts +5 -0
  146. package/src/lib/utils/debug-log-file.js +56 -0
  147. package/src/lib/utils/debug-log-file.js.map +1 -0
  148. package/src/lib/utils/debug.d.ts +28 -0
  149. package/src/lib/utils/debug.js +39 -0
  150. package/src/lib/utils/debug.js.map +1 -0
  151. package/src/lib/utils/devkit.d.ts +6 -6
  152. package/src/lib/utils/devkit.js +34 -38
  153. package/src/lib/utils/devkit.js.map +1 -1
  154. package/src/lib/utils/hmr-candidates.d.ts +28 -28
  155. package/src/lib/utils/plugin-config.d.ts +37 -0
  156. package/src/lib/utils/plugin-config.js +71 -0
  157. package/src/lib/utils/plugin-config.js.map +1 -0
  158. package/src/lib/utils/rolldown.d.ts +2 -0
  159. package/src/lib/utils/rolldown.js +12 -0
  160. package/src/lib/utils/rolldown.js.map +1 -0
  161. package/src/lib/utils/safe-module-paths.d.ts +16 -0
  162. package/src/lib/utils/safe-module-paths.js +29 -0
  163. package/src/lib/utils/safe-module-paths.js.map +1 -0
  164. package/src/lib/utils/source-file-cache.d.ts +8 -15
  165. package/src/lib/utils/source-file-cache.js +35 -37
  166. package/src/lib/utils/source-file-cache.js.map +1 -1
  167. package/src/lib/utils/tailwind-reference.d.ts +12 -0
  168. package/src/lib/utils/tailwind-reference.js +99 -0
  169. package/src/lib/utils/tailwind-reference.js.map +1 -0
  170. package/src/lib/utils/tsconfig-resolver.d.ts +28 -0
  171. package/src/lib/utils/tsconfig-resolver.js +191 -0
  172. package/src/lib/utils/tsconfig-resolver.js.map +1 -0
  173. package/src/lib/utils/virtual-ids.d.ts +4 -0
  174. package/src/lib/utils/virtual-ids.js +23 -0
  175. package/src/lib/utils/virtual-ids.js.map +1 -0
  176. package/src/lib/utils/virtual-resources.d.ts +19 -0
  177. package/src/lib/utils/virtual-resources.js +38 -0
  178. package/src/lib/utils/virtual-resources.js.map +1 -0
  179. package/src/lib/virtual-modules-plugin.d.ts +5 -0
  180. package/src/lib/virtual-modules-plugin.js +23 -0
  181. package/src/lib/virtual-modules-plugin.js.map +1 -0
  182. package/src/test-setup.d.ts +2 -0
  183. package/setup-vitest.d.ts +0 -4
  184. package/setup-vitest.js +0 -215
  185. package/setup-vitest.js.map +0 -1
  186. package/src/lib/models.js +0 -1
  187. package/src/lib/models.js.map +0 -1
  188. package/src/lib/tools/README.md +0 -3
  189. package/src/lib/tools/src/index.d.ts +0 -0
  190. package/src/lib/tools/src/index.js.map +0 -1
  191. package/src/lib/utils/compiler-plugin-options.js +0 -1
  192. package/src/lib/utils/compiler-plugin-options.js.map +0 -1
  193. package/src/lib/utils/hmr-candidates.js +0 -272
  194. package/src/lib/utils/hmr-candidates.js.map +0 -1
@@ -1,65 +1,54 @@
1
- import { createBuilder, targetFromTargetString, } from '@angular-devkit/architect';
1
+ let _angular_devkit_architect = require("@angular-devkit/architect");
2
+ //#region packages/vite-plugin-angular-tools/src/builders/vite-dev-server/dev-server.impl.ts
2
3
  async function viteDevServerBuilder(options, context) {
3
- const { createServer } = await Function('return import("vite")')();
4
- if (!context.target) {
5
- throw new Error('Builder must be executed with a target');
6
- }
7
- const projectConfig = await context.getProjectMetadata(context.target);
8
- const projectName = context.target.project;
9
- const buildTargetSpecifier = options.buildTarget ?? `::development`;
10
- const buildTarget = targetFromTargetString(buildTargetSpecifier, projectName, 'build');
11
- const browserBuilderName = await context.getBuilderNameForTarget(buildTarget);
12
- const rawBuildOptions = await context.getTargetOptions(buildTarget);
13
- const buildOptions = await context.validateOptions(rawBuildOptions, browserBuilderName);
14
- const serverConfig = {
15
- configFile: buildOptions.configFile,
16
- root: projectConfig.root,
17
- mode: (process.env.NODE_ENV ??
18
- buildOptions.mode ??
19
- 'development'),
20
- build: {
21
- sourcemap: !!buildOptions.sourcemap,
22
- },
23
- server: {
24
- hmr: options?.hmr,
25
- port: options?.port,
26
- },
27
- };
28
- try {
29
- const server = await createServer(serverConfig);
30
- await runViteDevServer(server);
31
- const resolvedUrls = [
32
- ...server.resolvedUrls.local,
33
- ...server.resolvedUrls.network,
34
- ];
35
- await new Promise((resolve) => {
36
- process.once('SIGINT', () => resolve());
37
- process.once('SIGTERM', () => resolve());
38
- process.once('exit', () => resolve());
39
- });
40
- return {
41
- success: true,
42
- baseUrl: resolvedUrls[0] ?? '',
43
- };
44
- }
45
- catch (e) {
46
- console.error(e);
47
- return {
48
- success: false,
49
- baseUrl: '',
50
- };
51
- }
4
+ const { createServer } = await Function("return import(\"vite\")")();
5
+ if (!context.target) throw new Error("Builder must be executed with a target");
6
+ const projectConfig = await context.getProjectMetadata(context.target);
7
+ const projectName = context.target.project;
8
+ const buildTarget = (0, _angular_devkit_architect.targetFromTargetString)(options.buildTarget ?? `::development`, projectName, "build");
9
+ const browserBuilderName = await context.getBuilderNameForTarget(buildTarget);
10
+ const rawBuildOptions = await context.getTargetOptions(buildTarget);
11
+ const buildOptions = await context.validateOptions(rawBuildOptions, browserBuilderName);
12
+ const serverConfig = {
13
+ configFile: buildOptions.configFile,
14
+ root: projectConfig.root,
15
+ mode: process.env.NODE_ENV ?? buildOptions.mode ?? "development",
16
+ build: { sourcemap: !!buildOptions.sourcemap },
17
+ server: {
18
+ hmr: options?.hmr,
19
+ port: options?.port
20
+ }
21
+ };
22
+ try {
23
+ const server = await createServer(serverConfig);
24
+ await server.listen();
25
+ server.printUrls();
26
+ const resolvedUrls = [...server.resolvedUrls.local, ...server.resolvedUrls.network];
27
+ const processOnExit = async () => {
28
+ await server.close();
29
+ };
30
+ await new Promise((resolve) => {
31
+ const shutdown = () => {
32
+ processOnExit().then(() => resolve(), () => resolve());
33
+ };
34
+ process.once("SIGINT", shutdown);
35
+ process.once("SIGTERM", shutdown);
36
+ process.once("exit", shutdown);
37
+ });
38
+ return {
39
+ success: true,
40
+ baseUrl: resolvedUrls[0] ?? ""
41
+ };
42
+ } catch (e) {
43
+ console.error(e);
44
+ return {
45
+ success: false,
46
+ baseUrl: ""
47
+ };
48
+ }
52
49
  }
53
- // vite ViteDevServer
54
- async function runViteDevServer(server) {
55
- await server.listen();
56
- server.printUrls();
57
- const processOnExit = async () => {
58
- await server.close();
59
- };
60
- process.once('SIGINT', processOnExit);
61
- process.once('SIGTERM', processOnExit);
62
- process.once('exit', processOnExit);
63
- }
64
- export default createBuilder(viteDevServerBuilder);
50
+ var dev_server_impl_default = (0, _angular_devkit_architect.createBuilder)(viteDevServerBuilder);
51
+ //#endregion
52
+ module.exports = dev_server_impl_default;
53
+
65
54
  //# sourceMappingURL=dev-server.impl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev-server.impl.js","sourceRoot":"","sources":["../../../../../../../../../packages/vite-plugin-angular-tools/src/builders/vite-dev-server/dev-server.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EACb,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAInC,KAAK,UAAU,oBAAoB,CACjC,OAA4B,EAC5B,OAAuB;IAEvB,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;IACnE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvE,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;IAC3C,MAAM,oBAAoB,GAAG,OAAO,CAAC,WAAW,IAAI,eAAe,CAAC;IACpE,MAAM,WAAW,GAAG,sBAAsB,CACxC,oBAAoB,EACpB,WAAW,EACX,OAAO,CACR,CAAC;IAEF,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC9E,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,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AK,CAAC,CAAC,CAAC,CAAC;QACjB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,EAAE;SACZ,CAAC;IACJ,CAAC;AACH,CAAC;AAED,qBAAqB;AACrB,KAAK,UAAU,gBAAgB,CAAC,MAA2B;IACzD,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;IAEtB,MAAM,CAAC,SAAS,EAAE,CAAC;IAEnB,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC,CAAC;IAEF,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AACtC,CAAC;AAED,eAAe,aAAa,CAAC,oBAAoB,CAAQ,CAAC"}
1
+ {"version":3,"file":"dev-server.impl.js","names":[],"sources":["../../../../../../../../vite-plugin-angular-tools/src/builders/vite-dev-server/dev-server.impl.ts"],"sourcesContent":["import {\n BuilderContext,\n BuilderOutput,\n createBuilder,\n targetFromTargetString,\n} from '@angular-devkit/architect';\nimport type { InlineConfig } from 'vite';\nimport { ViteDevServerSchema } from './schema';\n\nasync function viteDevServerBuilder(\n options: ViteDevServerSchema,\n context: BuilderContext,\n): Promise<BuilderOutput> {\n const { createServer } = await Function('return import(\"vite\")')();\n if (!context.target) {\n throw new Error('Builder must be executed with a target');\n }\n const projectConfig = await context.getProjectMetadata(context.target);\n const projectName = context.target.project;\n const buildTargetSpecifier = options.buildTarget ?? `::development`;\n const buildTarget = targetFromTargetString(\n buildTargetSpecifier,\n projectName,\n 'build',\n );\n\n const browserBuilderName = await context.getBuilderNameForTarget(buildTarget);\n const rawBuildOptions = await context.getTargetOptions(buildTarget);\n const buildOptions = await context.validateOptions(\n rawBuildOptions,\n browserBuilderName,\n );\n\n const serverConfig: InlineConfig = {\n configFile: buildOptions.configFile as string,\n root: projectConfig.root as string,\n mode: (process.env.NODE_ENV ??\n buildOptions.mode ??\n 'development') as string,\n build: {\n sourcemap: !!buildOptions.sourcemap,\n },\n server: {\n hmr: options?.hmr,\n port: options?.port,\n },\n };\n\n try {\n const server = await createServer(serverConfig);\n await server.listen();\n server.printUrls();\n\n const resolvedUrls = [\n ...server.resolvedUrls.local,\n ...server.resolvedUrls.network,\n ];\n\n const processOnExit = async () => {\n await server.close();\n };\n\n // Use process.once to avoid listener accumulation when Nx invokes\n // multiple builders in the same process during a large build graph.\n await new Promise<void>((resolve) => {\n const shutdown = () => {\n processOnExit().then(\n () => resolve(),\n () => resolve(),\n );\n };\n process.once('SIGINT', shutdown);\n process.once('SIGTERM', shutdown);\n process.once('exit', shutdown);\n });\n\n return {\n success: true,\n baseUrl: resolvedUrls[0] ?? '',\n };\n } catch (e) {\n console.error(e);\n return {\n success: false,\n baseUrl: '',\n };\n }\n}\n\nexport default createBuilder(viteDevServerBuilder) as any;\n"],"mappings":";;AASA,eAAe,qBACb,SACA,SACwB;CACxB,MAAM,EAAE,iBAAiB,MAAM,SAAS,0BAAwB,EAAE;AAClE,KAAI,CAAC,QAAQ,OACX,OAAM,IAAI,MAAM,yCAAyC;CAE3D,MAAM,gBAAgB,MAAM,QAAQ,mBAAmB,QAAQ,OAAO;CACtE,MAAM,cAAc,QAAQ,OAAO;CAEnC,MAAM,eAAA,GAAA,0BAAA,wBADuB,QAAQ,eAAe,iBAGlD,aACA,QACD;CAED,MAAM,qBAAqB,MAAM,QAAQ,wBAAwB,YAAY;CAC7E,MAAM,kBAAkB,MAAM,QAAQ,iBAAiB,YAAY;CACnE,MAAM,eAAe,MAAM,QAAQ,gBACjC,iBACA,mBACD;CAED,MAAM,eAA6B;EACjC,YAAY,aAAa;EACzB,MAAM,cAAc;EACpB,MAAA,QAAA,IAAA,YACE,aAAa,QACb;EACF,OAAO,EACL,WAAW,CAAC,CAAC,aAAa,WAC3B;EACD,QAAQ;GACN,KAAK,SAAS;GACd,MAAM,SAAS;GAChB;EACF;AAED,KAAI;EACF,MAAM,SAAS,MAAM,aAAa,aAAa;AAC/C,QAAM,OAAO,QAAQ;AACrB,SAAO,WAAW;EAElB,MAAM,eAAe,CACnB,GAAG,OAAO,aAAa,OACvB,GAAG,OAAO,aAAa,QACxB;EAED,MAAM,gBAAgB,YAAY;AAChC,SAAM,OAAO,OAAO;;AAKtB,QAAM,IAAI,SAAe,YAAY;GACnC,MAAM,iBAAiB;AACrB,mBAAe,CAAC,WACR,SAAS,QACT,SAAS,CAChB;;AAEH,WAAQ,KAAK,UAAU,SAAS;AAChC,WAAQ,KAAK,WAAW,SAAS;AACjC,WAAQ,KAAK,QAAQ,SAAS;IAC9B;AAEF,SAAO;GACL,SAAS;GACT,SAAS,aAAa,MAAM;GAC7B;UACM,GAAG;AACV,UAAQ,MAAM,EAAE;AAChB,SAAO;GACL,SAAS;GACT,SAAS;GACV;;;AAIL,IAAA,2BAAA,GAAA,0BAAA,eAA6B,qBAAqB"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,58 @@
1
+ import { AnalogStylesheetRegistry } from "../stylesheet-registry.js";
2
+ import type { StylePreprocessor } from "../style-preprocessor.js";
3
+ import type { FileReplacement } from "../plugins/file-replacements.plugin.js";
4
+ export declare enum DiagnosticModes {
5
+ None = 0,
6
+ Option = 1,
7
+ Syntactic = 2,
8
+ Semantic = 4,
9
+ All = 7
10
+ }
11
+ export declare function injectViteIgnoreForHmrMetadata(code: string): string;
12
+ export declare function isIgnoredHmrFile(file: string): boolean;
13
+ /**
14
+ * Convert Analog/Angular CLI-style file replacements into the flat record
15
+ * expected by `AngularHostOptions.fileReplacements`.
16
+ *
17
+ * Only browser replacements (`{ replace, with }`) are converted. SSR-only
18
+ * replacements (`{ replace, ssr }`) are left for the Vite runtime plugin to
19
+ * handle — they should not be baked into the Angular compilation host because
20
+ * that would apply them to both browser and server builds.
21
+ *
22
+ * Relative paths are resolved against `workspaceRoot` so that the host
23
+ * receives the same absolute paths it would get from the Angular CLI.
24
+ */
25
+ export declare function toAngularCompilationFileReplacements(replacements: FileReplacement[], workspaceRoot: string): Record<string, string> | undefined;
26
+ /**
27
+ * Map Angular's `templateUpdates` (keyed by `encodedFilePath@ClassName`)
28
+ * back to absolute file paths with their associated HMR code and component
29
+ * class name.
30
+ *
31
+ * Angular's private Compilation API emits template update keys in the form
32
+ * `encodeURIComponent(relativePath + '@' + className)`. We decode and resolve
33
+ * them so the caller can look up updates by the same normalized absolute path
34
+ * used elsewhere in the plugin (`outputFiles`, `classNames`, etc.).
35
+ */
36
+ export declare function mapTemplateUpdatesToFiles(templateUpdates: ReadonlyMap<string, string> | undefined): Map<string, {
37
+ className: string;
38
+ code: string;
39
+ }>;
40
+ export declare function describeStylesheetContent(code: string): {
41
+ length: number;
42
+ digest: string;
43
+ preview: string;
44
+ };
45
+ /**
46
+ * Refreshes any already-served stylesheet records that map back to a changed
47
+ * source file.
48
+ *
49
+ * This is the critical bridge for externalized Angular component styles during
50
+ * HMR. Angular's resource watcher can notice that `/src/...component.css`
51
+ * changed before Angular recompilation has had a chance to repopulate the
52
+ * stylesheet registry. If we emit a CSS update against the existing virtual
53
+ * stylesheet id without first refreshing the registry content, the browser gets
54
+ * a hot update containing stale CSS. By rewriting the existing served records
55
+ * from disk up front, HMR always pushes the latest source content.
56
+ */
57
+ export declare function refreshStylesheetRegistryForFile(file: string, stylesheetRegistry?: AnalogStylesheetRegistry, stylePreprocessor?: StylePreprocessor): void;
58
+ export declare function isTestWatchMode(args?: string[]): boolean;
@@ -0,0 +1,133 @@
1
+ import { debugStylesV } from "./debug.js";
2
+ import { normalizeStylesheetDependencies } from "../style-preprocessor.js";
3
+ import { preprocessStylesheetResult, rewriteRelativeCssImports } from "../stylesheet-registry.js";
4
+ import { existsSync, readFileSync } from "node:fs";
5
+ import { basename, isAbsolute, resolve } from "node:path";
6
+ import { normalizePath } from "vite";
7
+ import { createHash } from "node:crypto";
8
+ //#region packages/vite-plugin-angular/src/lib/utils/compilation-shared.ts
9
+ /**
10
+ * Shared utilities used by both angular-vite-plugin.ts and
11
+ * compilation-api/compilation-api-plugin.ts.
12
+ */
13
+ var DiagnosticModes = /* @__PURE__ */ function(DiagnosticModes) {
14
+ DiagnosticModes[DiagnosticModes["None"] = 0] = "None";
15
+ DiagnosticModes[DiagnosticModes["Option"] = 1] = "Option";
16
+ DiagnosticModes[DiagnosticModes["Syntactic"] = 2] = "Syntactic";
17
+ DiagnosticModes[DiagnosticModes["Semantic"] = 4] = "Semantic";
18
+ DiagnosticModes[DiagnosticModes["All"] = 7] = "All";
19
+ return DiagnosticModes;
20
+ }({});
21
+ function injectViteIgnoreForHmrMetadata(code) {
22
+ let patched = code.replace(/\bimport\(([a-zA-Z_$][\w$]*\.\u0275\u0275getReplaceMetadataURL)/g, "import(/* @vite-ignore */ $1");
23
+ if (patched === code) patched = patched.replace(/import\((\S+getReplaceMetadataURL)/g, "import(/* @vite-ignore */ $1");
24
+ return patched;
25
+ }
26
+ function isIgnoredHmrFile(file) {
27
+ return file.endsWith(".tsbuildinfo");
28
+ }
29
+ /**
30
+ * Convert Analog/Angular CLI-style file replacements into the flat record
31
+ * expected by `AngularHostOptions.fileReplacements`.
32
+ *
33
+ * Only browser replacements (`{ replace, with }`) are converted. SSR-only
34
+ * replacements (`{ replace, ssr }`) are left for the Vite runtime plugin to
35
+ * handle — they should not be baked into the Angular compilation host because
36
+ * that would apply them to both browser and server builds.
37
+ *
38
+ * Relative paths are resolved against `workspaceRoot` so that the host
39
+ * receives the same absolute paths it would get from the Angular CLI.
40
+ */
41
+ function toAngularCompilationFileReplacements(replacements, workspaceRoot) {
42
+ const mappedReplacements = replacements.flatMap((replacement) => {
43
+ if (!("with" in replacement)) return [];
44
+ return [[isAbsolute(replacement.replace) ? replacement.replace : resolve(workspaceRoot, replacement.replace), isAbsolute(replacement.with) ? replacement.with : resolve(workspaceRoot, replacement.with)]];
45
+ });
46
+ return mappedReplacements.length ? Object.fromEntries(mappedReplacements) : void 0;
47
+ }
48
+ /**
49
+ * Map Angular's `templateUpdates` (keyed by `encodedFilePath@ClassName`)
50
+ * back to absolute file paths with their associated HMR code and component
51
+ * class name.
52
+ *
53
+ * Angular's private Compilation API emits template update keys in the form
54
+ * `encodeURIComponent(relativePath + '@' + className)`. We decode and resolve
55
+ * them so the caller can look up updates by the same normalized absolute path
56
+ * used elsewhere in the plugin (`outputFiles`, `classNames`, etc.).
57
+ */
58
+ function mapTemplateUpdatesToFiles(templateUpdates) {
59
+ const updatesByFile = /* @__PURE__ */ new Map();
60
+ templateUpdates?.forEach((code, encodedUpdateId) => {
61
+ const [file, className = ""] = decodeURIComponent(encodedUpdateId).split("@");
62
+ const resolvedFile = normalizePath(resolve(process.cwd(), file));
63
+ updatesByFile.set(resolvedFile, {
64
+ className,
65
+ code
66
+ });
67
+ });
68
+ return updatesByFile;
69
+ }
70
+ function describeStylesheetContent(code) {
71
+ return {
72
+ length: code.length,
73
+ digest: createHash("sha256").update(code).digest("hex").slice(0, 12),
74
+ preview: code.replace(/\s+/g, " ").trim().slice(0, 160)
75
+ };
76
+ }
77
+ /**
78
+ * Refreshes any already-served stylesheet records that map back to a changed
79
+ * source file.
80
+ *
81
+ * This is the critical bridge for externalized Angular component styles during
82
+ * HMR. Angular's resource watcher can notice that `/src/...component.css`
83
+ * changed before Angular recompilation has had a chance to repopulate the
84
+ * stylesheet registry. If we emit a CSS update against the existing virtual
85
+ * stylesheet id without first refreshing the registry content, the browser gets
86
+ * a hot update containing stale CSS. By rewriting the existing served records
87
+ * from disk up front, HMR always pushes the latest source content.
88
+ */
89
+ function refreshStylesheetRegistryForFile(file, stylesheetRegistry, stylePreprocessor) {
90
+ const normalizedFile = normalizePath(file.split("?")[0]);
91
+ if (!stylesheetRegistry || !existsSync(normalizedFile)) return;
92
+ const publicIds = stylesheetRegistry.getPublicIdsForSource(normalizedFile);
93
+ if (publicIds.length === 0) return;
94
+ const rawCss = readFileSync(normalizedFile, "utf-8");
95
+ const preprocessed = preprocessStylesheetResult(rawCss, normalizedFile, stylePreprocessor);
96
+ const servedCss = rewriteRelativeCssImports(preprocessed.code, normalizedFile);
97
+ for (const publicId of publicIds) stylesheetRegistry.registerServedStylesheet({
98
+ publicId,
99
+ sourcePath: normalizedFile,
100
+ originalCode: rawCss,
101
+ normalizedCode: servedCss,
102
+ dependencies: normalizeStylesheetDependencies(preprocessed.dependencies),
103
+ diagnostics: preprocessed.diagnostics,
104
+ tags: preprocessed.tags
105
+ }, [
106
+ normalizedFile,
107
+ normalizePath(normalizedFile),
108
+ basename(normalizedFile),
109
+ normalizedFile.replace(/^\//, "")
110
+ ]);
111
+ debugStylesV("stylesheet registry refreshed from source file", {
112
+ file: normalizedFile,
113
+ publicIds,
114
+ dependencies: preprocessed.dependencies,
115
+ diagnostics: preprocessed.diagnostics,
116
+ tags: preprocessed.tags,
117
+ source: describeStylesheetContent(rawCss),
118
+ served: describeStylesheetContent(servedCss)
119
+ });
120
+ }
121
+ function isTestWatchMode(args = process.argv) {
122
+ if (args.find((arg) => arg.includes("--run"))) return false;
123
+ if (args.find((arg) => arg.includes("--no-run"))) return true;
124
+ const hasWatch = args.find((arg) => arg.includes("watch"));
125
+ if (hasWatch && ["false", "no"].some((neg) => hasWatch.includes(neg))) return false;
126
+ const watchArg = args[args.findIndex((arg) => arg.includes("watch")) + 1];
127
+ if (watchArg && watchArg === "false") return false;
128
+ return true;
129
+ }
130
+ //#endregion
131
+ export { DiagnosticModes, describeStylesheetContent, injectViteIgnoreForHmrMetadata, isIgnoredHmrFile, isTestWatchMode, mapTemplateUpdatesToFiles, refreshStylesheetRegistryForFile, toAngularCompilationFileReplacements };
132
+
133
+ //# sourceMappingURL=compilation-shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compilation-shared.js","names":[],"sources":["../../../../src/lib/utils/compilation-shared.ts"],"sourcesContent":["/**\n * Shared utilities used by both angular-vite-plugin.ts and\n * compilation-api/compilation-api-plugin.ts.\n */\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { basename, isAbsolute, resolve } from 'node:path';\nimport { createHash } from 'node:crypto';\nimport { normalizePath } from 'vite';\n\nimport {\n AnalogStylesheetRegistry,\n preprocessStylesheetResult,\n rewriteRelativeCssImports,\n} from '../stylesheet-registry.js';\nimport { normalizeStylesheetDependencies } from '../style-preprocessor.js';\nimport type { StylePreprocessor } from '../style-preprocessor.js';\nimport type { FileReplacement } from '../plugins/file-replacements.plugin.js';\nimport { debugStylesV } from './debug.js';\n\nexport enum DiagnosticModes {\n None = 0,\n Option = 1 << 0,\n Syntactic = 1 << 1,\n Semantic = 1 << 2,\n All = Option | Syntactic | Semantic,\n}\n\nexport function injectViteIgnoreForHmrMetadata(code: string): string {\n let patched = code.replace(\n /\\bimport\\(([a-zA-Z_$][\\w$]*\\.\\u0275\\u0275getReplaceMetadataURL)/g,\n 'import(/* @vite-ignore */ $1',\n );\n\n if (patched === code) {\n patched = patched.replace(\n /import\\((\\S+getReplaceMetadataURL)/g,\n 'import(/* @vite-ignore */ $1',\n );\n }\n\n return patched;\n}\n\nexport function isIgnoredHmrFile(file: string): boolean {\n return file.endsWith('.tsbuildinfo');\n}\n\n/**\n * Convert Analog/Angular CLI-style file replacements into the flat record\n * expected by `AngularHostOptions.fileReplacements`.\n *\n * Only browser replacements (`{ replace, with }`) are converted. SSR-only\n * replacements (`{ replace, ssr }`) are left for the Vite runtime plugin to\n * handle — they should not be baked into the Angular compilation host because\n * that would apply them to both browser and server builds.\n *\n * Relative paths are resolved against `workspaceRoot` so that the host\n * receives the same absolute paths it would get from the Angular CLI.\n */\nexport function toAngularCompilationFileReplacements(\n replacements: FileReplacement[],\n workspaceRoot: string,\n): Record<string, string> | undefined {\n const mappedReplacements = replacements.flatMap((replacement) => {\n if (!('with' in replacement)) {\n return [];\n }\n\n return [\n [\n isAbsolute(replacement.replace)\n ? replacement.replace\n : resolve(workspaceRoot, replacement.replace),\n isAbsolute(replacement.with)\n ? replacement.with\n : resolve(workspaceRoot, replacement.with),\n ] as const,\n ];\n });\n\n return mappedReplacements.length\n ? Object.fromEntries(mappedReplacements)\n : undefined;\n}\n\n/**\n * Map Angular's `templateUpdates` (keyed by `encodedFilePath@ClassName`)\n * back to absolute file paths with their associated HMR code and component\n * class name.\n *\n * Angular's private Compilation API emits template update keys in the form\n * `encodeURIComponent(relativePath + '@' + className)`. We decode and resolve\n * them so the caller can look up updates by the same normalized absolute path\n * used elsewhere in the plugin (`outputFiles`, `classNames`, etc.).\n */\nexport function mapTemplateUpdatesToFiles(\n templateUpdates: ReadonlyMap<string, string> | undefined,\n): Map<\n string,\n {\n className: string;\n code: string;\n }\n> {\n const updatesByFile = new Map<string, { className: string; code: string }>();\n\n templateUpdates?.forEach((code, encodedUpdateId) => {\n const [file, className = ''] =\n decodeURIComponent(encodedUpdateId).split('@');\n const resolvedFile = normalizePath(resolve(process.cwd(), file));\n\n updatesByFile.set(resolvedFile, {\n className,\n code,\n });\n });\n\n return updatesByFile;\n}\n\nexport function describeStylesheetContent(code: string): {\n length: number;\n digest: string;\n preview: string;\n} {\n return {\n length: code.length,\n digest: createHash('sha256').update(code).digest('hex').slice(0, 12),\n preview: code.replace(/\\s+/g, ' ').trim().slice(0, 160),\n };\n}\n\n/**\n * Refreshes any already-served stylesheet records that map back to a changed\n * source file.\n *\n * This is the critical bridge for externalized Angular component styles during\n * HMR. Angular's resource watcher can notice that `/src/...component.css`\n * changed before Angular recompilation has had a chance to repopulate the\n * stylesheet registry. If we emit a CSS update against the existing virtual\n * stylesheet id without first refreshing the registry content, the browser gets\n * a hot update containing stale CSS. By rewriting the existing served records\n * from disk up front, HMR always pushes the latest source content.\n */\nexport function refreshStylesheetRegistryForFile(\n file: string,\n stylesheetRegistry?: AnalogStylesheetRegistry,\n stylePreprocessor?: StylePreprocessor,\n): void {\n const normalizedFile = normalizePath(file.split('?')[0]);\n if (!stylesheetRegistry || !existsSync(normalizedFile)) {\n return;\n }\n\n const publicIds = stylesheetRegistry.getPublicIdsForSource(normalizedFile);\n if (publicIds.length === 0) {\n return;\n }\n\n const rawCss = readFileSync(normalizedFile, 'utf-8');\n const preprocessed = preprocessStylesheetResult(\n rawCss,\n normalizedFile,\n stylePreprocessor,\n );\n const servedCss = rewriteRelativeCssImports(\n preprocessed.code,\n normalizedFile,\n );\n\n for (const publicId of publicIds) {\n stylesheetRegistry.registerServedStylesheet(\n {\n publicId,\n sourcePath: normalizedFile,\n originalCode: rawCss,\n normalizedCode: servedCss,\n dependencies: normalizeStylesheetDependencies(\n preprocessed.dependencies,\n ),\n diagnostics: preprocessed.diagnostics,\n tags: preprocessed.tags,\n },\n [\n normalizedFile,\n normalizePath(normalizedFile),\n basename(normalizedFile),\n normalizedFile.replace(/^\\//, ''),\n ],\n );\n }\n\n debugStylesV('stylesheet registry refreshed from source file', {\n file: normalizedFile,\n publicIds,\n dependencies: preprocessed.dependencies,\n diagnostics: preprocessed.diagnostics,\n tags: preprocessed.tags,\n source: describeStylesheetContent(rawCss),\n served: describeStylesheetContent(servedCss),\n });\n}\n\nexport function isTestWatchMode(args: string[] = process.argv): boolean {\n // vitest --run\n const hasRun = args.find((arg) => arg.includes('--run'));\n if (hasRun) {\n return false;\n }\n\n // vitest --no-run\n const hasNoRun = args.find((arg) => arg.includes('--no-run'));\n if (hasNoRun) {\n return true;\n }\n\n // check for --watch=false or --no-watch\n const hasWatch = args.find((arg) => arg.includes('watch'));\n if (hasWatch && ['false', 'no'].some((neg) => hasWatch.includes(neg))) {\n return false;\n }\n\n // check for --watch false\n const watchIndex = args.findIndex((arg) => arg.includes('watch'));\n const watchArg = args[watchIndex + 1];\n if (watchArg && watchArg === 'false') {\n return false;\n }\n\n return true;\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,IAAY,kBAAL,yBAAA,iBAAA;AACL,iBAAA,gBAAA,UAAA,KAAA;AACA,iBAAA,gBAAA,YAAA,KAAA;AACA,iBAAA,gBAAA,eA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
2
2
  export interface CompilerPluginOptions {
3
- sourcemap: boolean;
4
- tsconfig: string;
5
- jit?: boolean;
6
- /** Skip TypeScript compilation setup. This is useful to re-use the TypeScript compilation from another plugin. */
7
- noopTypeScriptCompilation?: boolean;
8
- advancedOptimizations?: boolean;
9
- thirdPartySourcemaps?: boolean;
10
- fileReplacements?: Record<string, string>;
11
- sourceFileCache?: SourceFileCache;
12
- incremental: boolean;
3
+ sourcemap: boolean;
4
+ tsconfig: string;
5
+ jit?: boolean;
6
+ /** Skip TypeScript compilation setup. This is useful to re-use the TypeScript compilation from another plugin. */
7
+ noopTypeScriptCompilation?: boolean;
8
+ advancedOptimizations?: boolean;
9
+ thirdPartySourcemaps?: boolean;
10
+ fileReplacements?: Record<string, string>;
11
+ sourceFileCache?: SourceFileCache;
12
+ incremental: boolean;
13
13
  }
@@ -0,0 +1,23 @@
1
+ import type { Debugger } from "obug";
2
+ export type DebugMode = "build" | "dev";
3
+ export interface DebugModeOptions<S extends string = string> {
4
+ scopes?: boolean | S[];
5
+ mode?: DebugMode;
6
+ /**
7
+ * Write debug output to log files under `tmp/debug/` in the workspace root.
8
+ * - `true` or `'single'` — all output to `tmp/debug/analog.log`
9
+ * - `'scoped'` — one file per scope, e.g. `tmp/debug/analog.angular.hmr.log`
10
+ */
11
+ logFile?: boolean | "single" | "scoped";
12
+ }
13
+ export type DebugOption<S extends string = string> = boolean | S[] | DebugModeOptions<S> | DebugModeOptions<S>[];
14
+ export interface DebugHarness<S extends string = string> {
15
+ applyDebugOption(debug: DebugOption<S> | undefined, workspaceRoot?: string): void;
16
+ activateDeferredDebug(command: "build" | "serve"): void;
17
+ /** @internal test-only reset */
18
+ _resetDeferredDebug(): void;
19
+ }
20
+ export declare function createDebugHarness<S extends string = string>(config: {
21
+ fallbackNamespace: string;
22
+ instanceGroups: Debugger[][];
23
+ }): DebugHarness<S>;
@@ -0,0 +1,88 @@
1
+ import { DEBUG_LOG_DIR, DEBUG_LOG_FILENAME, wrapInstancesForFileLog, wrapInstancesForScopedFileLog } from "./debug-log-file.js";
2
+ import { join } from "node:path";
3
+ import { enable } from "obug";
4
+ //#region packages/vite-plugin-angular/src/lib/utils/debug-harness.ts
5
+ /**
6
+ * Duplicates of this file (keep in sync):
7
+ * packages/platform/src/lib/utils/debug-harness.ts
8
+ * packages/vite-plugin-angular/src/lib/utils/debug-harness.ts
9
+ */
10
+ function resolveNamespaces(scopes, fallback) {
11
+ if (scopes === true || scopes === void 0) return fallback;
12
+ if (Array.isArray(scopes) && scopes.length) return scopes.join(",");
13
+ return null;
14
+ }
15
+ function extractLogFile(debug) {
16
+ if (typeof debug === "boolean") return false;
17
+ if (Array.isArray(debug)) {
18
+ if (debug.length === 0 || typeof debug[0] === "string") return false;
19
+ return debug.find((e) => !!e.logFile)?.logFile ?? false;
20
+ }
21
+ return debug.logFile ?? false;
22
+ }
23
+ function createDebugHarness(config) {
24
+ let pendingDebug = [];
25
+ function installFileWrappers(logFile, root) {
26
+ if (logFile === "scoped") {
27
+ const dirPath = join(root, DEBUG_LOG_DIR);
28
+ for (const group of config.instanceGroups) wrapInstancesForScopedFileLog(group, dirPath);
29
+ } else {
30
+ const filePath = join(root, DEBUG_LOG_DIR, DEBUG_LOG_FILENAME);
31
+ for (const group of config.instanceGroups) wrapInstancesForFileLog(group, filePath);
32
+ }
33
+ }
34
+ function applyEntry(entry, fallback, logFile, root) {
35
+ if (!entry.mode) {
36
+ const ns = resolveNamespaces(entry.scopes ?? true, fallback);
37
+ if (ns) enable(ns);
38
+ if (logFile) installFileWrappers(logFile, root);
39
+ } else pendingDebug.push({
40
+ entry,
41
+ logFile,
42
+ root
43
+ });
44
+ }
45
+ return {
46
+ applyDebugOption(debug, workspaceRoot) {
47
+ if (debug == null || debug === false) return;
48
+ const logFile = extractLogFile(debug);
49
+ const root = workspaceRoot ?? process.env["NX_WORKSPACE_ROOT"] ?? process.cwd();
50
+ if (typeof debug === "boolean") {
51
+ const ns = resolveNamespaces(debug, config.fallbackNamespace);
52
+ if (ns) enable(ns);
53
+ return;
54
+ }
55
+ if (Array.isArray(debug)) {
56
+ if (debug.length === 0) return;
57
+ if (typeof debug[0] === "string") {
58
+ const ns = debug.join(",");
59
+ if (ns) enable(ns);
60
+ return;
61
+ }
62
+ for (const entry of debug) {
63
+ const entryLogFile = entry.logFile ?? false;
64
+ applyEntry(entry, config.fallbackNamespace, entryLogFile || logFile, root);
65
+ }
66
+ return;
67
+ }
68
+ applyEntry(debug, config.fallbackNamespace, logFile, root);
69
+ },
70
+ activateDeferredDebug(command) {
71
+ if (pendingDebug.length === 0) return;
72
+ const currentMode = command === "serve" ? "dev" : "build";
73
+ for (const { entry, logFile, root } of pendingDebug) if (entry.mode === currentMode) {
74
+ const ns = resolveNamespaces(entry.scopes ?? true, config.fallbackNamespace);
75
+ if (ns) enable(ns);
76
+ if (logFile) installFileWrappers(logFile, root);
77
+ }
78
+ pendingDebug = [];
79
+ },
80
+ _resetDeferredDebug() {
81
+ pendingDebug = [];
82
+ }
83
+ };
84
+ }
85
+ //#endregion
86
+ export { createDebugHarness };
87
+
88
+ //# sourceMappingURL=debug-harness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-harness.js","names":[],"sources":["../../../../src/lib/utils/debug-harness.ts"],"sourcesContent":["/**\n * Duplicates of this file (keep in sync):\n * packages/platform/src/lib/utils/debug-harness.ts\n * packages/vite-plugin-angular/src/lib/utils/debug-harness.ts\n */\nimport { join } from 'node:path';\nimport { enable } from 'obug';\nimport type { Debugger } from 'obug';\n\nimport {\n DEBUG_LOG_DIR,\n DEBUG_LOG_FILENAME,\n wrapInstancesForFileLog,\n wrapInstancesForScopedFileLog,\n} from './debug-log-file.js';\n\nexport type DebugMode = 'build' | 'dev';\n\nexport interface DebugModeOptions<S extends string = string> {\n scopes?: boolean | S[];\n mode?: DebugMode;\n /**\n * Write debug output to log files under `tmp/debug/` in the workspace root.\n * - `true` or `'single'` — all output to `tmp/debug/analog.log`\n * - `'scoped'` — one file per scope, e.g. `tmp/debug/analog.angular.hmr.log`\n */\n logFile?: boolean | 'single' | 'scoped';\n}\n\nexport type DebugOption<S extends string = string> =\n | boolean\n | S[]\n | DebugModeOptions<S>\n | DebugModeOptions<S>[];\n\nexport interface DebugHarness<S extends string = string> {\n applyDebugOption(\n debug: DebugOption<S> | undefined,\n workspaceRoot?: string,\n ): void;\n activateDeferredDebug(command: 'build' | 'serve'): void;\n /** @internal test-only reset */\n _resetDeferredDebug(): void;\n}\n\nfunction resolveNamespaces(\n scopes: boolean | string[] | undefined,\n fallback: string,\n): string | null {\n if (scopes === true || scopes === undefined) return fallback;\n if (Array.isArray(scopes) && scopes.length) return scopes.join(',');\n return null;\n}\n\nfunction extractLogFile(\n debug: DebugOption,\n): true | 'single' | 'scoped' | false {\n if (typeof debug === 'boolean') return false;\n if (Array.isArray(debug)) {\n if (debug.length === 0 || typeof debug[0] === 'string') return false;\n const entry = (debug as DebugModeOptions[]).find((e) => !!e.logFile);\n return entry?.logFile ?? false;\n }\n return (debug as DebugModeOptions).logFile ?? false;\n}\n\nexport function createDebugHarness<S extends string = string>(config: {\n fallbackNamespace: string;\n instanceGroups: Debugger[][];\n}): DebugHarness<S> {\n interface PendingEntry {\n entry: DebugModeOptions<S>;\n logFile: true | 'single' | 'scoped' | false;\n root: string;\n }\n\n let pendingDebug: PendingEntry[] = [];\n\n function installFileWrappers(\n logFile: true | 'single' | 'scoped',\n root: string,\n ): void {\n if (logFile === 'scoped') {\n const dirPath = join(root, DEBUG_LOG_DIR);\n for (const group of config.instanceGroups) {\n wrapInstancesForScopedFileLog(group, dirPath);\n }\n } else {\n const filePath = join(root, DEBUG_LOG_DIR, DEBUG_LOG_FILENAME);\n for (const group of config.instanceGroups) {\n wrapInstancesForFileLog(group, filePath);\n }\n }\n }\n\n function applyEntry(\n entry: DebugModeOptions<S>,\n fallback: string,\n logFile: true | 'single' | 'scoped' | false,\n root: string,\n ): void {\n if (!entry.mode) {\n const ns = resolveNamespaces(entry.scopes ?? true, fallback);\n if (ns) enable(ns);\n if (logFile) installFileWrappers(logFile, root);\n } else {\n pendingDebug.push({ entry, logFile, root });\n }\n }\n\n return {\n applyDebugOption(\n debug: DebugOption<S> | undefined,\n workspaceRoot?: string,\n ): void {\n if (debug == null || debug === false) return;\n\n const logFile = extractLogFile(debug);\n const root =\n workspaceRoot ?? process.env['NX_WORKSPACE_ROOT'] ?? process.cwd();\n\n if (typeof debug === 'boolean') {\n const ns = resolveNamespaces(debug, config.fallbackNamespace);\n if (ns) enable(ns);\n return;\n }\n\n if (Array.isArray(debug)) {\n if (debug.length === 0) return;\n\n if (typeof debug[0] === 'string') {\n const ns = (debug as string[]).join(',');\n if (ns) enable(ns);\n return;\n }\n\n for (const entry of debug as DebugModeOptions<S>[]) {\n const entryLogFile = entry.logFile ?? false;\n applyEntry(\n entry,\n config.fallbackNamespace,\n entryLogFile || logFile,\n root,\n );\n }\n return;\n }\n\n applyEntry(debug, config.fallbackNamespace, logFile, root);\n },\n\n activateDeferredDebug(command: 'build' | 'serve'): void {\n if (pendingDebug.length === 0) return;\n\n const currentMode = command === 'serve' ? 'dev' : 'build';\n\n for (const { entry, logFile, root } of pendingDebug) {\n if (entry.mode === currentMode) {\n const ns = resolveNamespaces(\n entry.scopes ?? true,\n config.fallbackNamespace,\n );\n if (ns) enable(ns);\n if (logFile) installFileWrappers(logFile, root);\n }\n }\n\n pendingDebug = [];\n },\n\n _resetDeferredDebug(): void {\n pendingDebug = [];\n },\n };\n}\n"],"mappings":";;;;;;;;;AA6CA,SAAS,kBACP,QACA,UACe;AACf,KAAI,WAAW,QAAQ,WAAW,KAAA,EAAW,QAAO;AACpD,KAAI,MAAM,QAAQ,OAAO,IAAI,OAAO,OAAQ,QAAO,OAAO,KAAK,IAAI;AACnE,QAAO;;AAGT,SAAS,eACP,OACoC;AACpC,KAAI,OAAO,UAAU,UAAW,QAAO;AACvC,KAAI,MAAM,QAAQ,MAAM,EAAE;AACxB,MAAI,MAAM,WAAW,KAAK,OAAO,MAAM,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;AAEH;;AAGF,cAAW,OAAO,OAAO,mBAAmB,SAAS,KAAK;;EAG5D,sBAAsB,SAAkC;AACtD,OAAI,aAAa,WAAW,EAAG;GAE/B,MAAM,cAAc,YAAY,UAAU,QAAQ;AAElD,QAAK,MAAM,EAAE,OAAO,SAAS,UAAU,aACrC,KAAI,MAAM,SAAS,aAAa;IAC9B,MAAM,KAAK,kBACT,MAAM,UAAU,MAChB,OAAO,kBACR;AACD,QAAI,GAAI,QAAO,GAAG;AAClB,QAAI,QAAS,qBAAoB,SAAS,KAAK;;AAInD,kBAAe,EAAE;;EAGnB,sBAA4B;AAC1B,kBAAe,EAAE;;EAEpB"}
@@ -0,0 +1,5 @@
1
+ import type { Debugger } from "obug";
2
+ export declare const DEBUG_LOG_DIR = "tmp/debug";
3
+ export declare const DEBUG_LOG_FILENAME = "analog.log";
4
+ export declare function wrapInstancesForFileLog(instances: Debugger[], filePath: string): void;
5
+ export declare function wrapInstancesForScopedFileLog(instances: Debugger[], dirPath: string): void;
@@ -0,0 +1,56 @@
1
+ import { appendFileSync, mkdirSync, writeFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { format } from "node:util";
4
+ //#region packages/vite-plugin-angular/src/lib/utils/debug-log-file.ts
5
+ /**
6
+ * Duplicates of this file (keep in sync):
7
+ * packages/platform/src/lib/utils/debug-log-file.ts
8
+ * packages/vite-plugin-angular/src/lib/utils/debug-log-file.ts
9
+ */
10
+ var TRUNCATED_KEY = "__analogDebugLogTruncated";
11
+ var WRAPPED_KEY = "__analogFileLogWrapped";
12
+ var ANSI_RE = /\x1B\[[0-9;]*[A-Za-z]|\x1B\].*?\x07/g;
13
+ var DEBUG_LOG_DIR = "tmp/debug";
14
+ var DEBUG_LOG_FILENAME = "analog.log";
15
+ function ensureTruncated(filePath) {
16
+ const g = globalThis;
17
+ const truncated = g[TRUNCATED_KEY] ?? /* @__PURE__ */ new Set();
18
+ g[TRUNCATED_KEY] = truncated;
19
+ if (truncated.has(filePath)) return;
20
+ try {
21
+ mkdirSync(dirname(filePath), { recursive: true });
22
+ writeFileSync(filePath, "", "utf-8");
23
+ } catch {}
24
+ truncated.add(filePath);
25
+ }
26
+ function wrapLog(dbg, filePath) {
27
+ const rec = dbg;
28
+ if (rec[WRAPPED_KEY] === filePath) return;
29
+ const originalLog = rec[WRAPPED_KEY] && rec["__analogOriginalLog"] ? rec["__analogOriginalLog"] : dbg.log;
30
+ rec["__analogOriginalLog"] = originalLog;
31
+ dbg.log = function(...args) {
32
+ originalLog.apply(this, args);
33
+ try {
34
+ appendFileSync(filePath, format(...args).replace(ANSI_RE, "") + "\n", "utf-8");
35
+ } catch {}
36
+ };
37
+ rec[WRAPPED_KEY] = filePath;
38
+ }
39
+ function wrapInstancesForFileLog(instances, filePath) {
40
+ ensureTruncated(filePath);
41
+ for (const dbg of instances) wrapLog(dbg, filePath);
42
+ }
43
+ function scopeToFilename(namespace) {
44
+ return namespace.replace(/:/g, ".") + ".log";
45
+ }
46
+ function wrapInstancesForScopedFileLog(instances, dirPath) {
47
+ for (const dbg of instances) {
48
+ const scopedPath = join(dirPath, scopeToFilename(dbg.namespace));
49
+ ensureTruncated(scopedPath);
50
+ wrapLog(dbg, scopedPath);
51
+ }
52
+ }
53
+ //#endregion
54
+ export { DEBUG_LOG_DIR, DEBUG_LOG_FILENAME, wrapInstancesForFileLog, wrapInstancesForScopedFileLog };
55
+
56
+ //# sourceMappingURL=debug-log-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-log-file.js","names":[],"sources":["../../../../src/lib/utils/debug-log-file.ts"],"sourcesContent":["/**\n * Duplicates of this file (keep in sync):\n * packages/platform/src/lib/utils/debug-log-file.ts\n * packages/vite-plugin-angular/src/lib/utils/debug-log-file.ts\n */\nimport { mkdirSync, writeFileSync, appendFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { format } from 'node:util';\nimport type { Debugger } from 'obug';\n\nconst TRUNCATED_KEY = '__analogDebugLogTruncated';\nconst WRAPPED_KEY = '__analogFileLogWrapped';\n// eslint-disable-next-line no-control-regex\nconst ANSI_RE = /\\x1B\\[[0-9;]*[A-Za-z]|\\x1B\\].*?\\x07/g;\n\nexport const DEBUG_LOG_DIR = 'tmp/debug';\nexport const DEBUG_LOG_FILENAME = 'analog.log';\n\nfunction ensureTruncated(filePath: string): void {\n const g = globalThis as Record<string, unknown>;\n const truncated = (g[TRUNCATED_KEY] as Set<string>) ?? new Set<string>();\n g[TRUNCATED_KEY] = truncated;\n if (truncated.has(filePath)) return;\n try {\n mkdirSync(dirname(filePath), { recursive: true });\n writeFileSync(filePath, '', 'utf-8');\n } catch {\n // best-effort: fall through to append mode if truncation fails\n }\n truncated.add(filePath);\n}\n\nfunction wrapLog(dbg: Debugger, filePath: string): void {\n const rec = dbg as Record<string, unknown>;\n if (rec[WRAPPED_KEY] === filePath) return;\n\n const originalLog =\n rec[WRAPPED_KEY] && rec['__analogOriginalLog']\n ? (rec['__analogOriginalLog'] as Debugger['log'])\n : dbg.log;\n\n rec['__analogOriginalLog'] = originalLog;\n dbg.log = function (this: Debugger, ...args: unknown[]) {\n originalLog.apply(this, args);\n try {\n const line = format(...args).replace(ANSI_RE, '') + '\\n';\n appendFileSync(filePath, line, 'utf-8');\n } catch {\n // debug logging must never crash the build\n }\n };\n rec[WRAPPED_KEY] = filePath;\n}\n\nexport function wrapInstancesForFileLog(\n instances: Debugger[],\n filePath: string,\n): void {\n ensureTruncated(filePath);\n for (const dbg of instances) {\n wrapLog(dbg, filePath);\n }\n}\n\nfunction scopeToFilename(namespace: string): string {\n return namespace.replace(/:/g, '.') + '.log';\n}\n\nexport function wrapInstancesForScopedFileLog(\n instances: Debugger[],\n dirPath: string,\n): void {\n for (const dbg of instances) {\n const scopedPath = join(dirPath, scopeToFilename(dbg.namespace));\n ensureTruncated(scopedPath);\n wrapLog(dbg, scopedPath);\n }\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,UAAU;AAEhB,IAAa,gBAAgB;AAC7B,IAAa,qBAAqB;AAElC,SAAS,gBAAgB,UAAwB;CAC/C,MAAM,IAAI;CACV,MAAM,YAAa,EAAE,kCAAkC,IAAI,KAAa;AACxE,GAAE,iBAAiB;AACnB,KAAI,UAAU,IAAI,SAAS,CAAE;AAC7B,KAAI;AACF,YAAU,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AACjD,gBAAc,UAAU,IAAI,QAAQ;SAC9B;AAGR,WAAU,IAAI,SAAS;;AAGzB,SAAS,QAAQ,KAAe,UAAwB;CACtD,MAAM,MAAM;AACZ,KAAI,IAAI,iBAAiB,SAAU;CAEnC,MAAM,cACJ,IAAI,gBAAgB,IAAI,yBACnB,IAAI,yBACL,IAAI;AAEV,KAAI,yBAAyB;AAC7B,KAAI,MAAM,SAA0B,GAAG,MAAiB;AACtD,cAAY,MAAM,MAAM,KAAK;AAC7B,MAAI;AAEF,kBAAe,UADF,OAAO,GAAG,KAAK,CAAC,QAAQ,SAAS,GAAG,GAAG,MACrB,QAAQ;UACjC;;AAIV,KAAI,eAAe;;AAGrB,SAAgB,wBACd,WACA,UACM;AACN,iBAAgB,SAAS;AACzB,MAAK,MAAM,OAAO,UAChB,SAAQ,KAAK,SAAS;;AAI1B,SAAS,gBAAgB,WAA2B;AAClD,QAAO,UAAU,QAAQ,MAAM,IAAI,GAAG;;AAGxC,SAAgB,8BACd,WACA,SACM;AACN,MAAK,MAAM,OAAO,WAAW;EAC3B,MAAM,aAAa,KAAK,SAAS,gBAAgB,IAAI,UAAU,CAAC;AAChE,kBAAgB,WAAW;AAC3B,UAAQ,KAAK,WAAW"}
@@ -0,0 +1,28 @@
1
+ export declare const debugTailwind: unknown;
2
+ export declare const debugHmr: unknown;
3
+ export declare const debugStyles: unknown;
4
+ export declare const debugCompiler: unknown;
5
+ export declare const debugCompilationApi: unknown;
6
+ export declare const debugEmit: unknown;
7
+ export declare const debugStylePipeline: unknown;
8
+ export declare const debugTailwindV: unknown;
9
+ export declare const debugHmrV: unknown;
10
+ export declare const debugStylesV: unknown;
11
+ export declare const debugCompilerV: unknown;
12
+ export declare const debugEmitV: unknown;
13
+ export type DebugScope = "analog:angular:*" | "analog:angular:hmr" | "analog:angular:hmr:v" | "analog:angular:styles" | "analog:angular:styles:v" | "analog:angular:compiler" | "analog:angular:compiler:v" | "analog:angular:compilation-api" | "analog:angular:emit" | "analog:angular:emit:v" | "analog:angular:style-pipeline" | "analog:angular:tailwind" | "analog:angular:tailwind:v" | (string & {});
14
+ export type DebugMode = "build" | "dev";
15
+ export interface DebugModeOptions {
16
+ scopes?: boolean | DebugScope[];
17
+ mode?: DebugMode;
18
+ /**
19
+ * Write debug output to log files under `tmp/debug/` in the workspace root.
20
+ * - `true` or `'single'` — all output to `tmp/debug/analog.log`
21
+ * - `'scoped'` — one file per scope, e.g. `tmp/debug/analog.angular.hmr.log`
22
+ */
23
+ logFile?: boolean | "single" | "scoped";
24
+ }
25
+ export type DebugOption = boolean | DebugScope[] | DebugModeOptions | DebugModeOptions[];
26
+ export declare const applyDebugOption: (debug: DebugOption | undefined, workspaceRoot?: string) => void;
27
+ export declare const activateDeferredDebug: (command: "build" | "serve") => void;
28
+ export declare const _resetDeferredDebug: () => void;