@component-compass/cli 0.1.23 → 0.1.24

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 (223) hide show
  1. package/dist/cli.js +103503 -104
  2. package/package.json +21 -25
  3. package/dist/auth/browser.d.ts +0 -13
  4. package/dist/auth/browser.js +0 -21
  5. package/dist/auth/browser.js.map +0 -1
  6. package/dist/auth/client.d.ts +0 -48
  7. package/dist/auth/client.js +0 -89
  8. package/dist/auth/client.js.map +0 -1
  9. package/dist/auth/paths.d.ts +0 -2
  10. package/dist/auth/paths.js +0 -14
  11. package/dist/auth/paths.js.map +0 -1
  12. package/dist/auth/session.d.ts +0 -38
  13. package/dist/auth/session.js +0 -88
  14. package/dist/auth/session.js.map +0 -1
  15. package/dist/auth/store.d.ts +0 -16
  16. package/dist/auth/store.js +0 -37
  17. package/dist/auth/store.js.map +0 -1
  18. package/dist/auth/upload-auth.d.ts +0 -22
  19. package/dist/auth/upload-auth.js +0 -51
  20. package/dist/auth/upload-auth.js.map +0 -1
  21. package/dist/cli/help.d.ts +0 -4
  22. package/dist/cli/help.js +0 -52
  23. package/dist/cli/help.js.map +0 -1
  24. package/dist/cli/parse.d.ts +0 -14
  25. package/dist/cli/parse.js +0 -75
  26. package/dist/cli/parse.js.map +0 -1
  27. package/dist/cli/suggest.d.ts +0 -4
  28. package/dist/cli/suggest.js +0 -38
  29. package/dist/cli/suggest.js.map +0 -1
  30. package/dist/cli.d.ts +0 -2
  31. package/dist/cli.js.map +0 -1
  32. package/dist/commands/auth.d.ts +0 -33
  33. package/dist/commands/auth.js +0 -248
  34. package/dist/commands/auth.js.map +0 -1
  35. package/dist/commands/init.d.ts +0 -11
  36. package/dist/commands/init.js +0 -112
  37. package/dist/commands/init.js.map +0 -1
  38. package/dist/commands/scan.d.ts +0 -33
  39. package/dist/commands/scan.js +0 -691
  40. package/dist/commands/scan.js.map +0 -1
  41. package/dist/composition-rollup.d.ts +0 -23
  42. package/dist/composition-rollup.js +0 -64
  43. package/dist/composition-rollup.js.map +0 -1
  44. package/dist/config/loader.d.ts +0 -6
  45. package/dist/config/loader.js +0 -71
  46. package/dist/config/loader.js.map +0 -1
  47. package/dist/config/schema.d.ts +0 -18
  48. package/dist/config/schema.js +0 -15
  49. package/dist/config/schema.js.map +0 -1
  50. package/dist/dispatcher.d.ts +0 -8
  51. package/dist/dispatcher.js +0 -22
  52. package/dist/dispatcher.js.map +0 -1
  53. package/dist/envelope/git.d.ts +0 -13
  54. package/dist/envelope/git.js +0 -69
  55. package/dist/envelope/git.js.map +0 -1
  56. package/dist/envelope/index.d.ts +0 -1
  57. package/dist/envelope/index.js +0 -12
  58. package/dist/envelope/index.js.map +0 -1
  59. package/dist/envelope/repo-id.d.ts +0 -16
  60. package/dist/envelope/repo-id.js +0 -40
  61. package/dist/envelope/repo-id.js.map +0 -1
  62. package/dist/identity.d.ts +0 -56
  63. package/dist/identity.js +0 -115
  64. package/dist/identity.js.map +0 -1
  65. package/dist/index.d.ts +0 -3
  66. package/dist/index.js +0 -3
  67. package/dist/index.js.map +0 -1
  68. package/dist/local-index/declared-props.d.ts +0 -15
  69. package/dist/local-index/declared-props.js +0 -101
  70. package/dist/local-index/declared-props.js.map +0 -1
  71. package/dist/local-index/detect-react.d.ts +0 -3
  72. package/dist/local-index/detect-react.js +0 -378
  73. package/dist/local-index/detect-react.js.map +0 -1
  74. package/dist/local-index/detect-vue.d.ts +0 -16
  75. package/dist/local-index/detect-vue.js +0 -284
  76. package/dist/local-index/detect-vue.js.map +0 -1
  77. package/dist/local-index/detect-wc.d.ts +0 -8
  78. package/dist/local-index/detect-wc.js +0 -70
  79. package/dist/local-index/detect-wc.js.map +0 -1
  80. package/dist/local-index/index.d.ts +0 -14
  81. package/dist/local-index/index.js +0 -46
  82. package/dist/local-index/index.js.map +0 -1
  83. package/dist/local-index/types.d.ts +0 -2
  84. package/dist/local-index/types.js +0 -2
  85. package/dist/local-index/types.js.map +0 -1
  86. package/dist/manifest/barrel-parser.d.ts +0 -35
  87. package/dist/manifest/barrel-parser.js +0 -76
  88. package/dist/manifest/barrel-parser.js.map +0 -1
  89. package/dist/manifest/lazy-resolver.d.ts +0 -123
  90. package/dist/manifest/lazy-resolver.js +0 -712
  91. package/dist/manifest/lazy-resolver.js.map +0 -1
  92. package/dist/occurrences.d.ts +0 -15
  93. package/dist/occurrences.js +0 -101
  94. package/dist/occurrences.js.map +0 -1
  95. package/dist/parse-by-ext.d.ts +0 -21
  96. package/dist/parse-by-ext.js +0 -53
  97. package/dist/parse-by-ext.js.map +0 -1
  98. package/dist/prompts/adapter.d.ts +0 -43
  99. package/dist/prompts/adapter.js +0 -32
  100. package/dist/prompts/adapter.js.map +0 -1
  101. package/dist/reporter/diagnostic-lines.d.ts +0 -7
  102. package/dist/reporter/diagnostic-lines.js +0 -40
  103. package/dist/reporter/diagnostic-lines.js.map +0 -1
  104. package/dist/reporter/index.d.ts +0 -39
  105. package/dist/reporter/index.js +0 -144
  106. package/dist/reporter/index.js.map +0 -1
  107. package/dist/reporter/json.d.ts +0 -6
  108. package/dist/reporter/json.js +0 -11
  109. package/dist/reporter/json.js.map +0 -1
  110. package/dist/reporter/stdout.d.ts +0 -3
  111. package/dist/reporter/stdout.js +0 -41
  112. package/dist/reporter/stdout.js.map +0 -1
  113. package/dist/rollup.d.ts +0 -26
  114. package/dist/rollup.js +0 -135
  115. package/dist/rollup.js.map +0 -1
  116. package/dist/scan/cem-index.d.ts +0 -38
  117. package/dist/scan/cem-index.js +0 -139
  118. package/dist/scan/cem-index.js.map +0 -1
  119. package/dist/scan/entry-packages.d.ts +0 -42
  120. package/dist/scan/entry-packages.js +0 -87
  121. package/dist/scan/entry-packages.js.map +0 -1
  122. package/dist/scan/framework-root.d.ts +0 -1
  123. package/dist/scan/framework-root.js +0 -22
  124. package/dist/scan/framework-root.js.map +0 -1
  125. package/dist/scan/git-mtime.d.ts +0 -2
  126. package/dist/scan/git-mtime.js +0 -22
  127. package/dist/scan/git-mtime.js.map +0 -1
  128. package/dist/scan/global-components.d.ts +0 -37
  129. package/dist/scan/global-components.js +0 -228
  130. package/dist/scan/global-components.js.map +0 -1
  131. package/dist/scan/meta.d.ts +0 -5
  132. package/dist/scan/meta.js +0 -58
  133. package/dist/scan/meta.js.map +0 -1
  134. package/dist/scan/stamp-version.d.ts +0 -18
  135. package/dist/scan/stamp-version.js +0 -94
  136. package/dist/scan/stamp-version.js.map +0 -1
  137. package/dist/scan/stamp-wraps.d.ts +0 -11
  138. package/dist/scan/stamp-wraps.js +0 -24
  139. package/dist/scan/stamp-wraps.js.map +0 -1
  140. package/dist/scan/wrap-relationships.d.ts +0 -12
  141. package/dist/scan/wrap-relationships.js +0 -38
  142. package/dist/scan/wrap-relationships.js.map +0 -1
  143. package/dist/seeds.d.ts +0 -81
  144. package/dist/seeds.js +0 -258
  145. package/dist/seeds.js.map +0 -1
  146. package/dist/types/brand.d.ts +0 -11
  147. package/dist/types/brand.js +0 -5
  148. package/dist/types/brand.js.map +0 -1
  149. package/dist/types/component-id.d.ts +0 -2
  150. package/dist/types/component-id.js +0 -2
  151. package/dist/types/component-id.js.map +0 -1
  152. package/dist/types.d.ts +0 -13
  153. package/dist/types.js +0 -2
  154. package/dist/types.js.map +0 -1
  155. package/dist/upload.d.ts +0 -18
  156. package/dist/upload.js +0 -34
  157. package/dist/upload.js.map +0 -1
  158. package/dist/util/color.d.ts +0 -24
  159. package/dist/util/color.js +0 -45
  160. package/dist/util/color.js.map +0 -1
  161. package/dist/util/git.d.ts +0 -10
  162. package/dist/util/git.js +0 -95
  163. package/dist/util/git.js.map +0 -1
  164. package/dist/util/interactive.d.ts +0 -17
  165. package/dist/util/interactive.js +0 -19
  166. package/dist/util/interactive.js.map +0 -1
  167. package/dist/util/log.d.ts +0 -9
  168. package/dist/util/log.js +0 -20
  169. package/dist/util/log.js.map +0 -1
  170. package/dist/util/pkg.d.ts +0 -1
  171. package/dist/util/pkg.js +0 -13
  172. package/dist/util/pkg.js.map +0 -1
  173. package/dist/util/pnp-check.d.ts +0 -1
  174. package/dist/util/pnp-check.js +0 -6
  175. package/dist/util/pnp-check.js.map +0 -1
  176. package/dist/util/posix.d.ts +0 -2
  177. package/dist/util/posix.js +0 -15
  178. package/dist/util/posix.js.map +0 -1
  179. package/dist/util/progress.d.ts +0 -21
  180. package/dist/util/progress.js +0 -54
  181. package/dist/util/progress.js.map +0 -1
  182. package/dist/util/version.d.ts +0 -7
  183. package/dist/util/version.js +0 -13
  184. package/dist/util/version.js.map +0 -1
  185. package/dist/walker/bounded-definition-resolver.d.ts +0 -9
  186. package/dist/walker/bounded-definition-resolver.js +0 -125
  187. package/dist/walker/bounded-definition-resolver.js.map +0 -1
  188. package/dist/walker/files.d.ts +0 -7
  189. package/dist/walker/files.js +0 -24
  190. package/dist/walker/files.js.map +0 -1
  191. package/dist/walker/package-alias-layers.d.ts +0 -7
  192. package/dist/walker/package-alias-layers.js +0 -40
  193. package/dist/walker/package-alias-layers.js.map +0 -1
  194. package/dist/walker/resolve-import.d.ts +0 -25
  195. package/dist/walker/resolve-import.js +0 -243
  196. package/dist/walker/resolve-import.js.map +0 -1
  197. package/dist/walker/tsconfig-discovery.d.ts +0 -36
  198. package/dist/walker/tsconfig-discovery.js +0 -52
  199. package/dist/walker/tsconfig-discovery.js.map +0 -1
  200. package/dist/walker/tsconfig-loader.d.ts +0 -35
  201. package/dist/walker/tsconfig-loader.js +0 -138
  202. package/dist/walker/tsconfig-loader.js.map +0 -1
  203. package/dist/walker/workspace-exports.d.ts +0 -3
  204. package/dist/walker/workspace-exports.js +0 -120
  205. package/dist/walker/workspace-exports.js.map +0 -1
  206. package/dist/workspace/build-graph.d.ts +0 -15
  207. package/dist/workspace/build-graph.js +0 -120
  208. package/dist/workspace/build-graph.js.map +0 -1
  209. package/dist/workspace/declared-deps.d.ts +0 -5
  210. package/dist/workspace/declared-deps.js +0 -42
  211. package/dist/workspace/declared-deps.js.map +0 -1
  212. package/dist/workspace/find-owning-package.d.ts +0 -8
  213. package/dist/workspace/find-owning-package.js +0 -69
  214. package/dist/workspace/find-owning-package.js.map +0 -1
  215. package/dist/workspace/find-workspace-root.d.ts +0 -1
  216. package/dist/workspace/find-workspace-root.js +0 -60
  217. package/dist/workspace/find-workspace-root.js.map +0 -1
  218. package/dist/workspace/index.d.ts +0 -4
  219. package/dist/workspace/index.js +0 -4
  220. package/dist/workspace/index.js.map +0 -1
  221. package/dist/workspace/types.d.ts +0 -49
  222. package/dist/workspace/types.js +0 -13
  223. package/dist/workspace/types.js.map +0 -1
@@ -1,41 +0,0 @@
1
- import { createColor } from "../util/color.js";
2
- export function printSummary(out, outputPath, color = createColor({ isTTY: Boolean(process.stdout.isTTY) })) {
3
- const { meta, components, stats } = out;
4
- const lines = [];
5
- lines.push("");
6
- lines.push(color.bold("component-compass scan"));
7
- lines.push("──────────────────────");
8
- lines.push(color.dim(`scanId: ${meta.scanId}`));
9
- lines.push(color.dim(`repoId: ${meta.repo.id}`));
10
- lines.push(color.dim(`timestamp: ${meta.scannedAt}`));
11
- lines.push("");
12
- lines.push(`Scanned ${color.bold(String(stats.filesScanned))} files in ${(stats.scanDurationMs / 1000).toFixed(1)}s — ${stats.filesWithUsage} files use design system components`);
13
- lines.push(`Components detected: ${color.bold(String(stats.componentsDetected))}`);
14
- lines.push(`Total occurrences: ${color.bold(String(stats.totalOccurrences))}`);
15
- lines.push("");
16
- const sorted = [...components].sort((a, b) => b.stats.occurrenceCount - a.stats.occurrenceCount).slice(0, 5);
17
- if (sorted.length > 0) {
18
- lines.push("Top by usage:");
19
- const labels = sorted.map(componentLabel);
20
- const widest = Math.max(...labels.map((l) => l.length));
21
- for (const [i, c] of sorted.entries()) {
22
- const label = labels[i] ?? "";
23
- const pad = " ".repeat(widest - label.length + 2);
24
- lines.push(` ${label}${pad}${color.bold(String(c.stats.occurrenceCount))} ${color.dim(`[${c.identity.kind}]`)}`);
25
- }
26
- lines.push("");
27
- }
28
- // Status line: green check + word carries success; the path (a literal code
29
- // string) stays uncoloured per the Code-Honest Rule.
30
- lines.push(`${color.green("✓")} Wrote ${outputPath}`);
31
- lines.push("");
32
- process.stdout.write(lines.join("\n"));
33
- }
34
- function componentLabel(c) {
35
- const { identity } = c;
36
- if (identity.kind === "custom-element")
37
- return identity.tagName ?? "(unknown)";
38
- const pkg = identity.packageName ?? identity.filePath ?? "(unknown)";
39
- return `${pkg}::${identity.exportName ?? "(unknown)"}`;
40
- }
41
- //# sourceMappingURL=stdout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdout.js","sourceRoot":"","sources":["../../src/reporter/stdout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAE/D,MAAM,UAAU,YAAY,CAC1B,GAAe,EACf,UAAkB,EAClB,QAAmB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAExE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC;IACjD,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACrC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACpD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACtD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,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B,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC;QACrH,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,4EAA4E;IAC5E,qDAAqD;IACrD,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,UAAU,EAAE,CAAC,CAAC;IACtD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,cAAc,CAAC,CAAkB;IACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IACvB,IAAI,QAAQ,CAAC,IAAI,KAAK,gBAAgB;QAAE,OAAO,QAAQ,CAAC,OAAO,IAAI,WAAW,CAAC;IAC/E,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,QAAQ,IAAI,WAAW,CAAC;IACrE,OAAO,GAAG,GAAG,KAAK,QAAQ,CAAC,UAAU,IAAI,WAAW,EAAE,CAAC;AACzD,CAAC"}
package/dist/rollup.d.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * Folds a flat occurrence stream plus per-component seeds (identity + manifest)
3
- * into the rolled `OutputComponent[]` shape.
4
- *
5
- * Math invariant per prop:
6
- * sum(values[].count) + dynamic + (other ?? 0) + omitted === stats.occurrenceCount
7
- * `defaultApplied` is a SUBSET of `omitted` (the slice where the manifest
8
- * declares a default), not additive.
9
- *
10
- * Components with zero occurrences still emit identity + zeroed stats so that
11
- * design-system components present in the manifest snapshot surface even
12
- * when not yet used.
13
- */
14
- import type { AuthoredManifestData, DeclaredPropApi, OutputComponent, OutputIdentity, OutputOccurrence } from "@component-compass/plugin-core";
15
- export type ComponentSeed = {
16
- id: string;
17
- identity: OutputIdentity;
18
- manifest: {
19
- source: "authored";
20
- data: AuthoredManifestData;
21
- } | null;
22
- declared?: DeclaredPropApi;
23
- /** True when the local definition is `export default` (root eligibility). */
24
- isDefaultExport?: boolean;
25
- };
26
- export declare function rollupOccurrencesToComponents(occurrences: OutputOccurrence[], seeds: ComponentSeed[]): OutputComponent[];
package/dist/rollup.js DELETED
@@ -1,135 +0,0 @@
1
- /**
2
- * Folds a flat occurrence stream plus per-component seeds (identity + manifest)
3
- * into the rolled `OutputComponent[]` shape.
4
- *
5
- * Math invariant per prop:
6
- * sum(values[].count) + dynamic + (other ?? 0) + omitted === stats.occurrenceCount
7
- * `defaultApplied` is a SUBSET of `omitted` (the slice where the manifest
8
- * declares a default), not additive.
9
- *
10
- * Components with zero occurrences still emit identity + zeroed stats so that
11
- * design-system components present in the manifest snapshot surface even
12
- * when not yet used.
13
- */
14
- import { computeLogicalId } from "@component-compass/plugin-core";
15
- import { isFrameworkRootPath } from "./scan/framework-root.js";
16
- const CARDINALITY_CAP = 100;
17
- const stringifyLiteral = (v) => v === null ? "null" : String(v);
18
- const canonicalSet = (vs) => [...new Set(vs)].sort((a, b) => stringifyLiteral(a).localeCompare(stringifyLiteral(b)));
19
- function bucketKey(v) {
20
- if (v.tier === "reference")
21
- return `r:${v.ref}`;
22
- if ("valueSet" in v)
23
- return `ws:${JSON.stringify(canonicalSet(v.valueSet))}`;
24
- // written scalar
25
- const val = v.value;
26
- return `w:${val === null ? "null" : `${typeof val}:${String(val)}`}`;
27
- }
28
- function newEntry(v) {
29
- if (v.tier === "reference")
30
- return { provenance: "reference", ref: v.ref, count: 0 };
31
- return "valueSet" in v
32
- ? { provenance: "written", valueSet: canonicalSet(v.valueSet), count: 0 }
33
- : { provenance: "written", value: v.value, count: 0 };
34
- }
35
- function buildDistribution(name, occs, hasDefault) {
36
- let dynamic = 0;
37
- let omitted = 0;
38
- let defaultApplied = 0;
39
- const buckets = new Map();
40
- for (const o of occs) {
41
- if (!(name in o.props)) {
42
- omitted += 1;
43
- if (hasDefault)
44
- defaultApplied += 1;
45
- continue;
46
- }
47
- const v = o.props[name];
48
- if (v.tier === "dynamic") {
49
- dynamic += 1;
50
- continue;
51
- }
52
- const key = bucketKey(v);
53
- const entry = buckets.get(key) ?? newEntry(v);
54
- entry.count += 1;
55
- buckets.set(key, entry);
56
- }
57
- const values = [...buckets.values()].sort((a, b) => b.count - a.count);
58
- const dist = { values, dynamic, omitted, defaultApplied };
59
- if (values.length > CARDINALITY_CAP) {
60
- const dropped = values.slice(CARDINALITY_CAP);
61
- dist.values = values.slice(0, CARDINALITY_CAP);
62
- dist.other = dropped.reduce((s, e) => s + e.count, 0);
63
- dist.truncated = dropped.length;
64
- }
65
- return dist;
66
- }
67
- export function rollupOccurrencesToComponents(occurrences, seeds) {
68
- const byId = new Map();
69
- for (const o of occurrences) {
70
- const list = byId.get(o.componentId);
71
- if (list) {
72
- list.push(o);
73
- }
74
- else {
75
- byId.set(o.componentId, [o]);
76
- }
77
- }
78
- return seeds.map((seed) => {
79
- const occs = byId.get(seed.id) ?? [];
80
- const fileSet = new Set();
81
- const propsSeen = new Set();
82
- for (const o of occs) {
83
- fileSet.add(o.filePath);
84
- for (const name of Object.keys(o.props))
85
- propsSeen.add(name);
86
- }
87
- // Manifest-declared props with no occurrence usage still need a slot so
88
- // the rollup can surface "prop X is universally unused / always defaulted".
89
- for (const name of Object.keys(seed.manifest?.data?.props ?? {}))
90
- propsSeen.add(name);
91
- const props = {};
92
- for (const name of propsSeen) {
93
- const hasDefault = seed.manifest?.data?.props?.[name]?.default !== undefined;
94
- props[name] = buildDistribution(name, occs, hasDefault);
95
- }
96
- const events = {};
97
- for (const o of occs) {
98
- const names = new Set([
99
- ...(o.events ?? []),
100
- // React on* handlers: name convention AND dynamic value (handlers are
101
- // functions → dynamic). The dynamic gate excludes literal-valued on*
102
- // *value* props like onLabel="On" / onColor="#0f0".
103
- ...Object.keys(o.props).filter((k) => /^on[A-Z]/.test(k) && o.props[k].tier === "dynamic"),
104
- ]);
105
- for (const name of names) {
106
- events[name] = { boundCount: (events[name]?.boundCount ?? 0) + 1 };
107
- }
108
- }
109
- const usage = occs.length > 0
110
- ? "direct"
111
- : seed.isDefaultExport === true &&
112
- seed.identity.filePath !== undefined &&
113
- isFrameworkRootPath(seed.identity.filePath)
114
- ? "root"
115
- : "none";
116
- return {
117
- id: seed.id,
118
- identity: seed.identity,
119
- // Wraps cross-links (scan.ts:644-651) are already patched onto seed.identity
120
- // by the time this runs, so this is correct on the first pass, not just a
121
- // typecheck-satisfier; applyWrapRelationships re-stamps identically post-resolve.
122
- logicalId: computeLogicalId(seed.identity, seed.id),
123
- manifest: seed.manifest,
124
- stats: { occurrenceCount: occs.length, fileCount: fileSet.size },
125
- usage,
126
- props,
127
- ...(Object.keys(events).length > 0 ? { events } : {}),
128
- ...(seed.declared ? { declared: seed.declared } : {}),
129
- version: null,
130
- createdAt: null,
131
- updatedAt: null,
132
- };
133
- });
134
- }
135
- //# sourceMappingURL=rollup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rollup.js","sourceRoot":"","sources":["../src/rollup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAcH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAW/D,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,gBAAgB,GAAG,CAAC,CAAmC,EAAU,EAAE,CACvE,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAA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AE,CAAC;YACrE,CAAC;QACH,CAAC;QAED,MAAM,KAAK,GACT,IAAI,CAAC,MAAM,GAAG,CAAC;YACb,CAAC,CAAC,QAAQ;YACV,CAAC,CAAC,IAAI,CAAC,eAAe,KAAK,IAAI;gBAC3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS;gBACpC,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAC7C,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,MAAM,CAAC;QAEf,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,6EAA6E;YAC7E,0EAA0E;YAC1E,kFAAkF;YAClF,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;YACnD,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,EAAE,eAAe,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE;YAChE,KAAK;YACL,KAAK;YACL,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrD,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrD,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,38 +0,0 @@
1
- /**
2
- * A single entry in `CemIndex.byTag`.
3
- *
4
- * `manifest` is the **per-declaration** payload — one component's data, not
5
- * the full package manifest. For CCM this is one entry from `components[]`;
6
- * for CEM this is one declaration from `modules[].declarations[]`.
7
- * Use `CemIndex.byPackageName` to retrieve the full-package manifest.
8
- */
9
- export type CemIndexEntry = {
10
- packageName: string;
11
- manifest: unknown;
12
- };
13
- export type CemIndex = {
14
- byTag: Map<string, CemIndexEntry>;
15
- byPackageName: Map<string, {
16
- manifest: unknown;
17
- }>;
18
- };
19
- /**
20
- * Build a global CEM index from all packages reachable from `<root>/node_modules`.
21
- *
22
- * Yarn workspace packages are symlinked into `node_modules/<name>`, so they
23
- * are indexed automatically alongside published dependencies. There's no
24
- * separate workspace-enumeration pass — `node_modules` covers both.
25
- *
26
- * For each package found:
27
- * - If it ships a `component-compass-manifest.json` (CCM), index its
28
- * declarations. CCM takes precedence over CEM.
29
- * - Otherwise, if it ships a CEM (`pkg.customElements` field or
30
- * `custom-elements.json` at the package root), index its declarations.
31
- *
32
- * Each declaration with a `tagName` is added to `byTag`. Each package
33
- * with any indexed manifest is added to `byPackageName`.
34
- *
35
- * @param root Absolute or relative path to the repository root containing
36
- * a `node_modules` directory.
37
- */
38
- export declare function buildCemIndex(root: string): Promise<CemIndex>;
@@ -1,139 +0,0 @@
1
- /**
2
- * Global CEM index — built once at scan startup.
3
- *
4
- * Enumerates every package.json under <root>/node_modules, finds any
5
- * CEM (`custom-elements.json`) or CCM (`component-compass-manifest.json`)
6
- * files, and builds two lookup tables:
7
- * - `byTag` tagName → { packageName, manifest }
8
- * - `byPackageName` packageName → { manifest }
9
- *
10
- * CCM takes precedence over CEM when both exist.
11
- *
12
- * Parsers use `byTag` to resolve hyphenated tags (<x-link>, <sl-button>)
13
- * unconditionally — no consumer-side config required.
14
- *
15
- * Shape contract:
16
- * - `byTag` entry.manifest is the **per-declaration** manifest payload —
17
- * a single component's data, not the full package manifest. For CCM this
18
- * is one entry from `components[]`; for CEM this is one declaration from
19
- * `modules[].declarations[]`. Use `byPackageName` for the full-package view.
20
- * - `byPackageName` entry.manifest is the full top-level manifest document
21
- * (the CCM root object or the CEM root object).
22
- */
23
- import { readFile } from "node:fs/promises";
24
- import { existsSync } from "node:fs";
25
- import { join, dirname } from "node:path";
26
- import { globby } from "globby";
27
- /**
28
- * Walk a CEM document and collect all custom-element declarations that carry a
29
- * `tagName`. Returns each declaration object paired with its tag name so the
30
- * caller can store the per-declaration entry in `byTag`.
31
- */
32
- function walkCemForTagDeclarations(cem) {
33
- const results = [];
34
- for (const mod of cem.modules ?? []) {
35
- for (const decl of mod.declarations ?? []) {
36
- if (decl.customElement === true && typeof decl.tagName === "string") {
37
- results.push({ tagName: decl.tagName, decl });
38
- }
39
- }
40
- }
41
- return results;
42
- }
43
- /**
44
- * Build a global CEM index from all packages reachable from `<root>/node_modules`.
45
- *
46
- * Yarn workspace packages are symlinked into `node_modules/<name>`, so they
47
- * are indexed automatically alongside published dependencies. There's no
48
- * separate workspace-enumeration pass — `node_modules` covers both.
49
- *
50
- * For each package found:
51
- * - If it ships a `component-compass-manifest.json` (CCM), index its
52
- * declarations. CCM takes precedence over CEM.
53
- * - Otherwise, if it ships a CEM (`pkg.customElements` field or
54
- * `custom-elements.json` at the package root), index its declarations.
55
- *
56
- * Each declaration with a `tagName` is added to `byTag`. Each package
57
- * with any indexed manifest is added to `byPackageName`.
58
- *
59
- * @param root Absolute or relative path to the repository root containing
60
- * a `node_modules` directory.
61
- */
62
- export async function buildCemIndex(root) {
63
- const index = {
64
- byTag: new Map(),
65
- byPackageName: new Map(),
66
- };
67
- // Enumerate: unscoped node_modules/*/package.json and scoped node_modules/@*/*/package.json
68
- const pkgJsonPaths = await globby([
69
- "node_modules/*/package.json",
70
- "node_modules/@*/*/package.json",
71
- ], {
72
- cwd: root,
73
- absolute: true,
74
- onlyFiles: true,
75
- suppressErrors: true,
76
- // Don't traverse into nested node_modules — only the top-level
77
- // dependency tree is relevant for CEM discovery.
78
- ignore: ["node_modules/*/node_modules/**", "node_modules/@*/*/node_modules/**"],
79
- });
80
- await Promise.all(pkgJsonPaths.map(async (pkgJsonPath) => {
81
- const pkgDir = dirname(pkgJsonPath);
82
- let pkg = null;
83
- try {
84
- pkg = JSON.parse(await readFile(pkgJsonPath, "utf8"));
85
- }
86
- catch {
87
- return;
88
- }
89
- if (!pkg || typeof pkg.name !== "string")
90
- return;
91
- const packageName = pkg.name;
92
- // CCM takes precedence: if both exist, CCM wins.
93
- const ccmPath = join(pkgDir, "component-compass-manifest.json");
94
- if (existsSync(ccmPath)) {
95
- try {
96
- const ccmJson = JSON.parse(await readFile(ccmPath, "utf8"));
97
- // CCM format has `components[]` — custom-element entries carry tagName
98
- if (ccmJson && Array.isArray(ccmJson.components)) {
99
- for (const c of ccmJson.components) {
100
- if (c.kind === "custom-element" && typeof c.tagName === "string") {
101
- index.byTag.set(c.tagName, { packageName, manifest: c });
102
- }
103
- }
104
- }
105
- index.byPackageName.set(packageName, { manifest: ccmJson });
106
- }
107
- catch {
108
- // Malformed CCM — skip.
109
- }
110
- return; // CCM found; don't also load CEM for this package.
111
- }
112
- // CEM: check `pkg.customElements` field first (authoritative path),
113
- // then fall back to the conventional `custom-elements.json`.
114
- const cemRelPath = typeof pkg.customElements === "string"
115
- ? pkg.customElements
116
- : "custom-elements.json";
117
- const cemPath = join(pkgDir, cemRelPath);
118
- if (!existsSync(cemPath))
119
- return;
120
- try {
121
- const cemJson = JSON.parse(await readFile(cemPath, "utf8"));
122
- const tagDecls = walkCemForTagDeclarations(cemJson);
123
- // byPackageName is always populated for any CEM-shipping package,
124
- // regardless of whether it declares any custom elements (e.g. mixin-only
125
- // packages have no tagName entries but are still valid CEM consumers).
126
- index.byPackageName.set(packageName, { manifest: cemJson });
127
- for (const { tagName, decl } of tagDecls) {
128
- // Store the per-declaration entry so byTag consumers get the specific
129
- // component's data, not a haystack to search. Mirrors CCM behaviour.
130
- index.byTag.set(tagName, { packageName, manifest: decl });
131
- }
132
- }
133
- catch {
134
- // Malformed CEM — skip.
135
- }
136
- }));
137
- return index;
138
- }
139
- //# sourceMappingURL=cem-index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cem-index.js","sourceR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,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,CAAC;YAAC,MAAM,CAAC;gBACP,wBAAwB;YAC1B,CAAC;YACD,OAAO,CAAC,mDAAmD;QAC7D,CAAC;QAED,oEAAoE;QACpE,6DAA6D;QAC7D,MAAM,UAAU,GACd,OAAO,GAAG,CAAC,cAAc,KAAK,QAAQ;YACpC,CAAC,CAAC,GAAG,CAAC,cAAc;YACpB,CAAC,CAAC,sBAAsB,CAAC;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACzC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAAE,OAAO;QAEjC,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAY,CAAC;YACvE,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;YACpD,kEAAkE;YAClE,yEAAyE;YACzE,uEAAuE;YACvE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;YAC5D,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,QAAQ,EAAE,CAAC;gBACzC,sEAAsE;gBACtE,qEAAqE;gBACrE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,42 +0,0 @@
1
- import type { OutputComponent } from "@component-compass/plugin-core";
2
- /**
3
- * What a recorded entry-package observation attaches to:
4
- * - "identity": the JS lane. The relabelled external identity
5
- * {leafPackage, modulePath, exportName} the engine will emit. `modulePath`
6
- * here is the resolver's terminal-file path (extension INTACT, e.g.
7
- * "dist/react.js"); matching strips it through `externalSubpath`.
8
- * - "leaf-package": the side-effect lane. Attaches to every custom-element
9
- * rollup entry whose identity.packageName equals `leafPackage`.
10
- */
11
- export type EntryPackageTarget = {
12
- kind: "identity";
13
- leafPackage: string;
14
- modulePath: string;
15
- exportName: string;
16
- } | {
17
- kind: "leaf-package";
18
- leafPackage: string;
19
- };
20
- export type EntryPackageRecord = {
21
- package: string;
22
- version: string | null;
23
- target: EntryPackageTarget;
24
- };
25
- export type EntryPackageRecorder = {
26
- /** `entry` is the entry package's root as found by the resolver's
27
- * findPackageRoot(initialAbs) — name + on-disk dir of the installed copy. */
28
- record(entry: {
29
- name: string;
30
- dir: string;
31
- }, target: EntryPackageTarget): void;
32
- drain(): EntryPackageRecord[];
33
- };
34
- export declare function createEntryPackageRecorder(): EntryPackageRecorder;
35
- /**
36
- * Post-resolve pass: attach entry-package provenance to rollup
37
- * entries. Runs AFTER applyWrapRelationships: with synthetic
38
- * zero-occurrence CE materialisation gone, leaf-package-lane records for an
39
- * UNOBSERVED wrap target match no row and drop — the relationship edge
40
- * carries that provenance instead. Pure — returns a new array.
41
- */
42
- export declare function applyEntryPackages(components: OutputComponent[], records: EntryPackageRecord[]): OutputComponent[];
@@ -1,87 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { externalSubpath } from "@component-compass/reference-graph";
4
- export function createEntryPackageRecorder() {
5
- const records = new Map();
6
- // Installed-version reads cached per package dir (one read per installed copy).
7
- const versionByDir = new Map();
8
- const versionOf = (dir) => {
9
- const cached = versionByDir.get(dir);
10
- if (cached !== undefined)
11
- return cached;
12
- let version = null;
13
- try {
14
- const pkg = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
15
- version = pkg.version ?? null;
16
- }
17
- catch {
18
- // Best-effort: unreadable/missing package.json → null.
19
- }
20
- versionByDir.set(dir, version);
21
- return version;
22
- };
23
- return {
24
- record(entry, target) {
25
- const record = {
26
- package: entry.name,
27
- version: versionOf(entry.dir),
28
- target,
29
- };
30
- records.set(JSON.stringify(record), record);
31
- },
32
- drain() {
33
- return [...records.values()];
34
- },
35
- };
36
- }
37
- /** Sort key: package asc, then version asc with null last. */
38
- function compareRefs(a, b) {
39
- if (a.package !== b.package)
40
- return a.package < b.package ? -1 : 1;
41
- if (a.version === b.version)
42
- return 0;
43
- if (a.version === null)
44
- return 1;
45
- if (b.version === null)
46
- return -1;
47
- return a.version < b.version ? -1 : 1;
48
- }
49
- /**
50
- * Post-resolve pass: attach entry-package provenance to rollup
51
- * entries. Runs AFTER applyWrapRelationships: with synthetic
52
- * zero-occurrence CE materialisation gone, leaf-package-lane records for an
53
- * UNOBSERVED wrap target match no row and drop — the relationship edge
54
- * carries that provenance instead. Pure — returns a new array.
55
- */
56
- export function applyEntryPackages(components, records) {
57
- if (records.length === 0)
58
- return components;
59
- return components.map((c) => {
60
- const refs = new Map();
61
- for (const r of records) {
62
- if (!matches(c, r.target))
63
- continue;
64
- refs.set(JSON.stringify([r.package, r.version]), { package: r.package, version: r.version });
65
- }
66
- if (refs.size === 0)
67
- return c;
68
- const entryPackages = [...refs.values()].sort(compareRefs);
69
- return { ...c, entryPackages };
70
- });
71
- }
72
- function matches(c, t) {
73
- if (c.identity.scope !== "external")
74
- return false;
75
- if (t.kind === "leaf-package") {
76
- return c.identity.kind === "custom-element" && c.identity.packageName === t.leafPackage;
77
- }
78
- // Identity grain: the engine derived identity.modulePath from the relabelled
79
- // specifier via externalSubpath (extension stripped). Route the resolver's
80
- // extension-intact modulePath through the SAME seam — never re-strip here.
81
- const identityModulePath = externalSubpath(t.leafPackage, `${t.leafPackage}/${t.modulePath}`);
82
- return ((c.identity.kind === "react-component" || c.identity.kind === "vue-component") &&
83
- c.identity.packageName === t.leafPackage &&
84
- c.identity.modulePath === identityModulePath &&
85
- c.identity.exportName === t.exportName);
86
- }
87
- //# sourceMappingURL=entry-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/**
3
- * Framework entry-point conventions. Built-in only — no config
4
- * knob until a concrete miss forces one. Matched against outputRoot-relative
5
- * POSIX filePaths, so every pattern floats (`**` prefix): under an ancestor
6
- * --repo-root the path is prefixed with the app directory.
7
- * Other frameworks' conventions (Nuxt pages/layouts/app.vue, …) are
8
- * deliberately deferred; their entry files classify as "none" for now.
9
- */
10
- const ROOT_PATTERNS = [
11
- "**/app/**/{page,layout,template,error,loading,not-found}.{tsx,jsx}",
12
- "**/pages/**/*.{tsx,jsx}",
13
- ];
14
- const ROOT_EXCLUDE = ["**/pages/api/**"];
15
- const matchers = ROOT_PATTERNS.map((p) => picomatch(p));
16
- const excluders = ROOT_EXCLUDE.map((p) => picomatch(p));
17
- export function isFrameworkRootPath(filePath) {
18
- if (excluders.some((m) => m(filePath)))
19
- return false;
20
- return matchers.some((m) => m(filePath));
21
- }
22
- //# sourceMappingURL=framework-root.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-root.js","sourceRoot":"","sources":["../../src/scan/framework-root.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG;IACpB,oEAAoE;IACpE,yBAAyB;CAC1B,CAAC;AACF,MAAM,YAAY,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAEzC,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAExD,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3C,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { OutputComponent } from "@component-compass/plugin-core";
2
- export declare function stampGitMTime(root: string, components: OutputComponent[]): Promise<void>;
@@ -1,22 +0,0 @@
1
- import { readFileMTimes } from "../util/git.js";
2
- export async function stampGitMTime(root, components) {
3
- const localPaths = new Set();
4
- for (const c of components) {
5
- if (c.identity.scope === "local" && c.identity.filePath) {
6
- localPaths.add(c.identity.filePath);
7
- }
8
- }
9
- const map = await readFileMTimes(root, [...localPaths]);
10
- for (const c of components) {
11
- if (c.identity.scope === "local" && c.identity.filePath) {
12
- const range = map.get(c.identity.filePath);
13
- c.createdAt = range?.firstCommitAt ?? null;
14
- c.updatedAt = range?.lastCommitAt ?? null;
15
- }
16
- else {
17
- c.createdAt = null;
18
- c.updatedAt = null;
19
- }
20
- }
21
- }
22
- //# sourceMappingURL=git-mtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git-mtime.js","sourceRoot":"","sources":["../../src/scan/git-mtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAY,EACZ,UAA6B;IAE7B,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACxD,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IACxD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,KAAK,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACxD,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC3C,CAAC,CAAC,SAAS,GAAG,KAAK,EAAE,aAAa,IAAI,IAAI,CAAC;YAC3C,CAAC,CAAC,SAAS,GAAG,KAAK,EAAE,YAAY,IAAI,IAAI,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,37 +0,0 @@
1
- import { type AutoImportComponent } from "@component-compass/parser-vue";
2
- /**
3
- * Reader for generated `GlobalComponents` declarations.
4
- *
5
- * `GlobalComponents` is the declaration the whole Vue ecosystem agrees on:
6
- * it is the only lane Vue's own type checker has, so generated files,
7
- * hand-written declarations and library packages all augment it. CC consumes
8
- * the artefact the ecosystem already generates for static tools (tsc/Volar);
9
- * it never re-derives the naming convention.
10
- *
11
- * Nuxt is the first (only) producer we probe for. It writes its registry
12
- * twice — once as an `export const` list, once as this augmentation — and the
13
- * two files moved apart between majors: Nuxt 3 puts both forms in
14
- * `.nuxt/components.d.ts`; Nuxt 4 leaves the `export const` list there and
15
- * moves the augmentation to `.nuxt/types/components.d.ts`. Both paths are
16
- * probed, in that order.
17
- */
18
- export type GlobalComponentsRegistry = {
19
- /** The declaration file the registry was read from. */
20
- declarationPath: string;
21
- /** Keyed by parse5's lowercased tag forms (see `vueTagForms`). */
22
- lookup: (tagForm: string) => AutoImportComponent | undefined;
23
- /** In-repo entries whose resolved file no longer exists (stale declaration). */
24
- stale: Array<{
25
- componentName: string;
26
- target: string;
27
- }>;
28
- };
29
- export declare function loadGlobalComponents(scanRoot: string): GlobalComponentsRegistry | null;
30
- /**
31
- * Warning-only framework sniff: an app that depends on `nuxt` but has no
32
- * generated declarations will scan with auto-imports invisible. Never gates
33
- * behaviour — only feeds the `auto-import-manifest-missing` diagnostic.
34
- */
35
- export declare function detectAutoImportFramework(scanRoot: string): {
36
- expectedPath: string;
37
- } | null;