@component-compass/plugin-core 0.1.23 → 0.1.28

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 (63) hide show
  1. package/dist/diagnostic.d.ts +15 -27
  2. package/dist/diagnostic.js +4 -8
  3. package/dist/diagnostic.js.map +1 -1
  4. package/dist/index.d.ts +3 -11
  5. package/dist/index.js +1 -6
  6. package/dist/index.js.map +1 -1
  7. package/dist/occurrence-id.d.ts +4 -4
  8. package/dist/occurrence-id.js +4 -4
  9. package/dist/project-props.d.ts +4 -4
  10. package/dist/project-props.js +3 -3
  11. package/dist/scan-types.d.ts +16 -121
  12. package/dist/scan-types.js +1 -2
  13. package/dist/scan-types.js.map +1 -1
  14. package/dist/types.d.ts +0 -62
  15. package/dist/v2/component-key.d.ts +3 -0
  16. package/dist/v2/component-key.js +12 -0
  17. package/dist/v2/component-key.js.map +1 -0
  18. package/dist/v2/index.d.ts +9 -0
  19. package/dist/v2/index.js +9 -0
  20. package/dist/v2/index.js.map +1 -0
  21. package/dist/v2/resolved-occurrences.d.ts +4 -0
  22. package/dist/v2/resolved-occurrences.js +8 -0
  23. package/dist/v2/resolved-occurrences.js.map +1 -0
  24. package/dist/v2/scan-stats.d.ts +16 -0
  25. package/dist/v2/scan-stats.js +13 -0
  26. package/dist/v2/scan-stats.js.map +1 -0
  27. package/dist/v2/schema-version.d.ts +8 -0
  28. package/dist/v2/schema-version.js +16 -0
  29. package/dist/v2/schema-version.js.map +1 -0
  30. package/dist/v2/schema.d.ts +4875 -0
  31. package/dist/v2/schema.js +188 -0
  32. package/dist/v2/schema.js.map +1 -0
  33. package/dist/v2/tag-attribution.d.ts +9 -0
  34. package/dist/v2/tag-attribution.js +70 -0
  35. package/dist/v2/tag-attribution.js.map +1 -0
  36. package/dist/v2/tag-vocabulary.d.ts +17 -0
  37. package/dist/v2/tag-vocabulary.js +33 -0
  38. package/dist/v2/tag-vocabulary.js.map +1 -0
  39. package/dist/v2/validate.d.ts +18 -0
  40. package/dist/v2/validate.js +20 -0
  41. package/dist/v2/validate.js.map +1 -0
  42. package/package.json +19 -6
  43. package/dist/builder.d.ts +0 -21
  44. package/dist/builder.js +0 -49
  45. package/dist/builder.js.map +0 -1
  46. package/dist/enrichment.d.ts +0 -28
  47. package/dist/enrichment.js +0 -2
  48. package/dist/enrichment.js.map +0 -1
  49. package/dist/logical-id.d.ts +0 -4
  50. package/dist/logical-id.js +0 -48
  51. package/dist/logical-id.js.map +0 -1
  52. package/dist/output-types.d.ts +0 -316
  53. package/dist/output-types.js +0 -2
  54. package/dist/output-types.js.map +0 -1
  55. package/dist/schema.d.ts +0 -204
  56. package/dist/schema.js +0 -62
  57. package/dist/schema.js.map +0 -1
  58. package/dist/validate.d.ts +0 -9
  59. package/dist/validate.js +0 -18
  60. package/dist/validate.js.map +0 -1
  61. package/dist/via-types.d.ts +0 -64
  62. package/dist/via-types.js +0 -2
  63. package/dist/via-types.js.map +0 -1
@@ -7,26 +7,6 @@
7
7
  */
8
8
  export type DiagnosticSeverity = "info" | "warning";
9
9
  export type Diagnostic = {
10
- code: "low-confidence-tag";
11
- severity: "info";
12
- filePath: string;
13
- line?: number;
14
- column?: number;
15
- tagName: string;
16
- } | {
17
- code: "local-index-duplicate-tag";
18
- severity: "warning";
19
- filePath: string;
20
- tagName: string;
21
- conflictsWith: string;
22
- } | {
23
- code: "unresolved-import";
24
- severity: "warning";
25
- filePath: string;
26
- line: number;
27
- column: number;
28
- specifier: string;
29
- } | {
30
10
  code: "lazy-import-unsupported";
31
11
  severity: "warning";
32
12
  filePath: string;
@@ -34,13 +14,6 @@ export type Diagnostic = {
34
14
  column: number;
35
15
  specifier: string;
36
16
  detail: string;
37
- } | {
38
- code: "unresolved-component-tag";
39
- severity: "warning";
40
- filePath: string;
41
- line?: number;
42
- column?: number;
43
- tagName: string;
44
17
  } | {
45
18
  code: "auto-import-stale-entry";
46
19
  severity: "warning";
@@ -60,6 +33,14 @@ export type Diagnostic = {
60
33
  column: number;
61
34
  symbol: string;
62
35
  memberChain: string[];
36
+ } | {
37
+ code: "late-bound-render";
38
+ severity: "info";
39
+ filePath: string;
40
+ line: number;
41
+ column: number;
42
+ symbol: string;
43
+ memberChain: string[];
63
44
  } | {
64
45
  code: "cycle-detected";
65
46
  severity: "warning";
@@ -73,6 +54,13 @@ export type Diagnostic = {
73
54
  exportName: string;
74
55
  depth: number;
75
56
  packageName?: string;
57
+ } | {
58
+ code: "dependency-not-installed";
59
+ severity: "warning";
60
+ packageName: string;
61
+ occurrenceCount: number;
62
+ /** Repository-relative path of the package.json that declares the package. */
63
+ declaredIn: string;
76
64
  };
77
65
  export interface DiagnosticCollector {
78
66
  emit(d: Diagnostic): void;
@@ -25,26 +25,22 @@ function assertUnreachable(x) {
25
25
  */
26
26
  function dedupKey(d) {
27
27
  switch (d.code) {
28
- case "low-confidence-tag":
29
- return `${d.code}::${d.filePath}::${d.line ?? ""}::${d.column ?? ""}::${d.tagName}`;
30
- case "local-index-duplicate-tag":
31
- return `${d.code}::${d.filePath}::${d.tagName}`;
32
- case "unresolved-import":
33
- return `${d.code}::${d.filePath}::${d.line}::${d.column}::${d.specifier}`;
34
28
  case "lazy-import-unsupported":
35
29
  return `${d.code}::${d.filePath}::${d.line}::${d.column}::${d.specifier}`;
36
- case "unresolved-component-tag":
37
- return `${d.code}::${d.filePath}::${d.line ?? ""}::${d.column ?? ""}::${d.tagName}`;
38
30
  case "auto-import-stale-entry":
39
31
  return `${d.code}::${d.componentName}::${d.target}`;
40
32
  case "auto-import-manifest-missing":
41
33
  return `${d.code}::${d.filePath}`;
42
34
  case "unresolved-reference":
43
35
  return `${d.code}::${d.filePath}::${d.line}::${d.column}::${d.symbol}::${d.memberChain.join(".")}`;
36
+ case "late-bound-render":
37
+ return `${d.code}::${d.filePath}::${d.line}::${d.column}::${d.symbol}::${d.memberChain.join(".")}`;
44
38
  case "cycle-detected":
45
39
  return `${d.code}::${d.filePath}::${d.exportName}`;
46
40
  case "chain-too-deep":
47
41
  return `${d.code}::${d.filePath}::${d.exportName}`;
42
+ case "dependency-not-installed":
43
+ return `${d.code}::${d.packageName}`;
48
44
  default:
49
45
  return assertUnreachable(d);
50
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiFH,SAAS,iBAAiB,CAAC,CAAQ;IACjC,MAAM,IAAI,KAAK,CAAC,8BAA+B,CAAsB,CAAC,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAS,QAAQ,CAAC,CAAa;IAC7B,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,yBAAyB;YAC5B,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,SAAS,EAAE,CAAC;QAC5E,KAAK,yBAAyB;YAC5B,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QACtD,KAAK,8BAA8B;YACjC,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;QACpC,KAAK,sBAAsB;YACzB,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACrG,KAAK,mBAAmB;YACtB,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACrG,KAAK,gBAAgB;YACnB,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC;QACrD,KAAK,gBAAgB;YACnB,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC;QACrD,KAAK,0BAA0B;YAC7B,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;QACvC;YACE,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;AACH,CAAC;AAID,MAAM,UAAU,yBAAyB;IACvC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,OAAO;QACL,IAAI,CAAC,CAAC;YACJ,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO;YAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,KAAK;YACH,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;YAC5B,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;YACnB,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,19 +1,11 @@
1
- export type { ComponentId, ComponentKind, ComponentSource, Lifecycle, ManifestComponent, ManifestEvent, ManifestFile, ManifestProp, ManifestSlot, ManifestSource, } from "./types.js";
1
+ export type { ComponentId, ComponentKind, ComponentSource } from "./types.js";
2
2
  export { serialiseComponentId, compareComponentId, externalPackageOf, parseCompoundExport } from "./id.js";
3
- export { validateManifest } from "./validate.js";
4
- export type { ValidationResult } from "./validate.js";
5
- export { manifestJsonSchema } from "./schema.js";
6
- export { ManifestBuilder } from "./builder.js";
7
- export type { TagName, WrapperId, IndexedComponent, Loc, WarningCode, Warning, ScanConfig, PropUsage, OccurrenceVia, Occurrence, WrapperDef, FileImport, ParseResult, ParseContext, ParserPlugin, ScanOutput, ManifestRef, ScanStats, DetectorId, LocalDefinition, LocalDefinitionIndex, ResolveLazyManifest, ResolveLocalExport, LookupByTag, LazyResolverHit, CemIndex, CemIndexEntry, } from "./scan-types.js";
8
- export { asTagName, asWrapperId, emptyLocalIndex } from "./scan-types.js";
9
- export type { Enrichment, AuthoredLeafPayload } from "./enrichment.js";
3
+ export type { TagName, Loc, Warning, PropUsage, Occurrence, FileImport, ParseResult, ParseContext, ParserPlugin, DetectorId, LocalDefinition, LocalDefinitionIndex, ResolveLocalExport, } from "./scan-types.js";
4
+ export { asTagName, emptyLocalIndex } from "./scan-types.js";
10
5
  export { normalizeOwnerPath } from "./owner-utils.js";
11
6
  export { posixPath } from "./posix.js";
12
- export { logicalKeyFor, hashLogicalKey, computeLogicalId } from "./logical-id.js";
13
7
  export { computeOccurrenceId } from "./occurrence-id.js";
14
8
  export { projectPropUsages, classifyExprText } from "./project-props.js";
15
- export type { CompositionRollup, DeclaredProp, DeclaredPropApi } from "./output-types.js";
16
- export * from "./output-types.js";
17
9
  export type { Diagnostic, DiagnosticSeverity, DiagnosticCollector, DiagnosticCode } from "./diagnostic.js";
18
10
  export { createDiagnosticCollector } from "./diagnostic.js";
19
11
  export type { ResolveImport } from "./resolve-import-type.js";
package/dist/index.js CHANGED
@@ -1,13 +1,8 @@
1
1
  export { serialiseComponentId, compareComponentId, externalPackageOf, parseCompoundExport } from "./id.js";
2
- export { validateManifest } from "./validate.js";
3
- export { manifestJsonSchema } from "./schema.js";
4
- export { ManifestBuilder } from "./builder.js";
5
- export { asTagName, asWrapperId, emptyLocalIndex } from "./scan-types.js";
2
+ export { asTagName, emptyLocalIndex } from "./scan-types.js";
6
3
  export { normalizeOwnerPath } from "./owner-utils.js";
7
4
  export { posixPath } from "./posix.js";
8
- export { logicalKeyFor, hashLogicalKey, computeLogicalId } from "./logical-id.js";
9
5
  export { computeOccurrenceId } from "./occurrence-id.js";
10
6
  export { projectPropUsages, classifyExprText } from "./project-props.js";
11
- export * from "./output-types.js";
12
7
  export { createDiagnosticCollector } from "./diagnostic.js";
13
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC3G,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAe/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAI1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGzE,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAW3G,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -2,10 +2,10 @@
2
2
  * Stable per-occurrence id keyed on (componentId, filePath, line, column,
3
3
  * ownerComponentId?).
4
4
  *
5
- * Inputs use the FINAL artifact componentId strings (the hashed forms that
6
- * appear on `OutputOccurrence.componentId` / `OutputOccurrence.ownerComponentId`),
7
- * so downstream consumers can re-derive:
8
- * id === computeOccurrenceId(o.componentId, o.filePath, o.line, o.column, o.ownerComponentId)
5
+ * Inputs use the FINAL artifact id strings (the ones that appear on an
6
+ * occurrence's `resolution.componentId` and `ownerComponentId`), so downstream
7
+ * consumers can re-derive a resolved occurrence's id:
8
+ * id === computeOccurrenceId(o.resolution.componentId, o.filePath, o.line, o.column, o.ownerComponentId)
9
9
  *
10
10
  * `ownerComponentId` participates in the hash so that one JSX call site
11
11
  * fanning out to multiple owner resolutions (helper-call fanout) produces
@@ -3,10 +3,10 @@ import { createHash } from "node:crypto";
3
3
  * Stable per-occurrence id keyed on (componentId, filePath, line, column,
4
4
  * ownerComponentId?).
5
5
  *
6
- * Inputs use the FINAL artifact componentId strings (the hashed forms that
7
- * appear on `OutputOccurrence.componentId` / `OutputOccurrence.ownerComponentId`),
8
- * so downstream consumers can re-derive:
9
- * id === computeOccurrenceId(o.componentId, o.filePath, o.line, o.column, o.ownerComponentId)
6
+ * Inputs use the FINAL artifact id strings (the ones that appear on an
7
+ * occurrence's `resolution.componentId` and `ownerComponentId`), so downstream
8
+ * consumers can re-derive a resolved occurrence's id:
9
+ * id === computeOccurrenceId(o.resolution.componentId, o.filePath, o.line, o.column, o.ownerComponentId)
10
10
  *
11
11
  * `ownerComponentId` participates in the hash so that one JSX call site
12
12
  * fanning out to multiple owner resolutions (helper-call fanout) produces
@@ -1,12 +1,12 @@
1
1
  import type { PropUsage } from "./scan-types.js";
2
- import type { PropValueState } from "./output-types.js";
2
+ import type { PropValueState } from "./v2/schema.js";
3
3
  /** Project parser-emitted PropUsage[] onto the per-occurrence value map. */
4
4
  export declare function projectPropUsages(usages: PropUsage[]): Record<string, PropValueState>;
5
5
  /**
6
- * Classify an already-extracted expression *string* (Vue template binding /
7
- * Lit placeholder) as a bare `reference` (identifier or dotted member path)
6
+ * Classify an already-extracted Vue template expression *string* as a bare
7
+ * `reference` (identifier or dotted member path)
8
8
  * or `dynamic`. AST-based parsers (React) do NOT use this — they classify
9
- * structurally. This is the single seam so Vue and Lit don't re-derive it.
9
+ * structurally. Vue template bindings use this single seam.
10
10
  */
11
11
  export declare function classifyExprText(text: string): {
12
12
  tier: "reference";
@@ -22,10 +22,10 @@ export function projectPropUsages(usages) {
22
22
  const IDENT_RE = /^[A-Za-z_$][\w$]*$/;
23
23
  const MEMBER_PATH_RE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\w$]*)+$/;
24
24
  /**
25
- * Classify an already-extracted expression *string* (Vue template binding /
26
- * Lit placeholder) as a bare `reference` (identifier or dotted member path)
25
+ * Classify an already-extracted Vue template expression *string* as a bare
26
+ * `reference` (identifier or dotted member path)
27
27
  * or `dynamic`. AST-based parsers (React) do NOT use this — they classify
28
- * structurally. This is the single seam so Vue and Lit don't re-derive it.
28
+ * structurally. Vue template bindings use this single seam.
29
29
  */
30
30
  export function classifyExprText(text) {
31
31
  const t = text.trim();
@@ -1,67 +1,20 @@
1
1
  /**
2
2
  * Shared types consumed by all parser packages and the CLI host.
3
3
  *
4
- * Parsers (`parser-react`, `parser-vue`, `parser-lit`, `parser-html`) cannot
4
+ * Parsers (`parser-react`, `parser-vue`) cannot
5
5
  * depend on the CLI package (circular), so every type that crosses the
6
6
  * parser ↔ CLI boundary lives here in `plugin-core`.
7
7
  */
8
- import type { DeclaredPropApi, OutputComponent, OutputOccurrence, RelationshipEdge, ScanMeta } from "./output-types.js";
9
- import type { Diagnostic, DiagnosticCollector } from "./diagnostic.js";
10
- import type { ComponentId, ManifestComponent, ManifestSource } from "./types.js";
11
- import type { OccurrenceVia } from "./via-types.js";
8
+ import type { DiagnosticCollector } from "./diagnostic.js";
9
+ import type { ComponentId } from "./types.js";
10
+ import type { DeclaredPropApi } from "./v2/schema.js";
12
11
  declare const __brand: unique symbol;
13
12
  type Brand<K, T> = K & {
14
13
  readonly [__brand]: T;
15
14
  };
16
15
  export type TagName = Brand<string, "TagName">;
17
- export type WrapperId = Brand<string, "WrapperId">;
18
- /** Unsafe constructors — use only at the data-ingest boundary. */
16
+ /** Unsafe constructor — use only at the data-ingest boundary. */
19
17
  export declare const asTagName: (s: string) => TagName;
20
- export declare const asWrapperId: (s: string) => WrapperId;
21
- export type CemIndexEntry = {
22
- packageName: string;
23
- manifest: unknown;
24
- };
25
- /**
26
- * Structural interface for the global CEM index built by `buildCemIndex` in
27
- * the CLI. Defined here as a structural type (not importing from CLI) so
28
- * parsers can reference it without creating a circular dependency.
29
- *
30
- * The actual `CemIndex` implementation lives in
31
- * `packages/cli/src/scan/cem-index.ts` and satisfies this interface.
32
- */
33
- export type CemIndex = {
34
- byTag: Map<string, CemIndexEntry>;
35
- byPackageName: Map<string, {
36
- manifest: unknown;
37
- }>;
38
- };
39
- export type IndexedComponent = (Extract<ManifestComponent, {
40
- kind: "custom-element";
41
- }> & {
42
- className?: string;
43
- }) | Extract<ManifestComponent, {
44
- kind: "react-component" | "vue-component";
45
- }>;
46
- /**
47
- * A single resolution outcome for one `(fromFile, specifier, exportName)`
48
- * triple. `matched` is null when the resolved leaf has no manifest entry
49
- * for `exportName` — the caller should fall back to opaque opportunistic
50
- * emission (current `react-component` / `vue-component` with `manifest: null`
51
- * shape, package = `leafPackage`).
52
- */
53
- export type LazyResolverHit = {
54
- leafPackage: string;
55
- /** Terminal file's path relative to the leaf package root, POSIX-normalised. */
56
- modulePath: string;
57
- /**
58
- * Export name at the terminal file after the walk. Equals the input
59
- * exportName unless a hop renamed it (`export { X as Y } from ...`).
60
- */
61
- exportName: string;
62
- matched: IndexedComponent | null;
63
- };
64
- export type ResolveLazyManifest = (fromFile: string, specifier: string, exportName: string) => LazyResolverHit | null;
65
18
  /**
66
19
  * File-path-anchored local barrel walker. Given a known-local file and an
67
20
  * export name, walks `export { X } from "./Y"` / `export * from "./Y"` chains
@@ -76,17 +29,14 @@ export type ResolveLocalExport = (filePath: string, exportName: string) => {
76
29
  filePath: string;
77
30
  exportName: string;
78
31
  } | null;
79
- export type LookupByTag = (tagName: string) => Extract<IndexedComponent, {
80
- kind: "custom-element";
81
- }> | null;
82
- export type DetectorId = "react-default-fn" | "react-arrow" | "react-class" | "react-forward-ref" | "react-memo" | "vue-sfc" | "vue-define-component" | "vue-functional" | "wc-decorator" | "wc-customelements-define";
32
+ export type DetectorId = "vue-sfc" | "vue-define-component" | "vue-functional" | "wc-decorator" | "wc-customelements-define";
83
33
  export type LocalDefinition = {
84
34
  /** componentId.source is always { type: "local", filePath }. */
85
35
  componentId: ComponentId;
86
36
  /**
87
- * Local export identifier. For default exports, this is the declaration
88
- * name (e.g. "Button" for `export default function Button()`); use
89
- * `isDefault` to distinguish default from named-with-same-name.
37
+ * Local export identifier. For a Vue default export, this is the
38
+ * component's name (e.g. "UserCard" for `user-card.vue` with no `name`
39
+ * option); use `isDefault` to distinguish default from named-with-same-name.
90
40
  */
91
41
  exportName: string;
92
42
  /** True when emitted via `export default`. */
@@ -100,8 +50,8 @@ export type LocalDefinition = {
100
50
  export type LocalDefinitionIndex = {
101
51
  /** POSIX repo-relative filePath → definitions in that file. */
102
52
  byPath: Map<string, LocalDefinition[]>;
103
- /** hyphenated-tag → WC local definition. */
104
- byTag: Map<string, LocalDefinition>;
53
+ /** Canonical custom-element tag → every local registration of it. */
54
+ byTag: Map<string, LocalDefinition[]>;
105
55
  };
106
56
  export declare const emptyLocalIndex: LocalDefinitionIndex;
107
57
  export type Loc = {
@@ -109,7 +59,6 @@ export type Loc = {
109
59
  line: number;
110
60
  column: number;
111
61
  };
112
- export type WarningCode = "PARSE_FAILURE" | "IMPORT_UNRESOLVABLE" | "MANIFEST_TAG_COLLISION" | "EMPTY_INCLUDE";
113
62
  interface WarningBase {
114
63
  message: string;
115
64
  }
@@ -127,12 +76,6 @@ export type Warning = (WarningBase & {
127
76
  }) | (WarningBase & {
128
77
  code: "EMPTY_INCLUDE";
129
78
  });
130
- /**
131
- * The subset of the CLI's resolved configuration that parsers actually consume.
132
- * Using a structural interface rather than the full `ResolvedConfig` keeps
133
- * parsers decoupled from CLI-specific fields (configPath, output, etc.).
134
- */
135
- export type ScanConfig = {};
136
79
  /**
137
80
  * Per-attribute usage emitted by a parser. Four-tier floor:
138
81
  * - written: a literal value present verbatim in source (incl. a folded
@@ -156,21 +99,16 @@ export type PropUsage = {
156
99
  name: string;
157
100
  tier: "dynamic";
158
101
  };
159
- export type { OccurrenceVia } from "./via-types.js";
160
102
  export type Occurrence = {
161
103
  componentId: ComponentId;
162
104
  loc: Loc;
163
- via: OccurrenceVia;
164
105
  props: PropUsage[];
165
106
  events: string[];
166
107
  /**
167
108
  * Parser-side parent reference. Index into the same
168
109
  * ParseResult.occurrences array. `undefined` = no tracked parent in this
169
- * lexical scope. The CLI's projection layer (`parseResultsToOccurrences`)
170
- * resolves this index into a `parentOccurrenceId` string; downstream
171
- * queries needing the parent's componentId look it up via the flat
172
- * occurrence stream. Cross-file composition is out of scope, so the index
173
- * is local to one ParseResult.
110
+ * lexical scope. Cross-file composition is out of scope, so the index is
111
+ * local to one ParseResult.
174
112
  */
175
113
  parentRef?: number;
176
114
  /**
@@ -182,8 +120,8 @@ export type Occurrence = {
182
120
  /**
183
121
  * Identity of the Component definition that owns this Occurrence (i.e.
184
122
  * lexically encloses it in source). Resolved by parsers via ancestor walk.
185
- * The CLI projection layer (Assemble) hashes this into
186
- * `OutputOccurrence.ownerComponentId` and drives the composition rollup.
123
+ * The CLI projection layer (Assemble) hashes this into the artifact
124
+ * occurrence's `ownerComponentId` and drives the composition rollup.
187
125
  *
188
126
  * Convention for parsers that emit `ownerComponentId`:
189
127
  * - Absent (undefined) ⇒ Occurrence is a "root" — no enclosing Component
@@ -197,21 +135,12 @@ export type Occurrence = {
197
135
  * Per-language framing:
198
136
  * - parser-vue: owner = enclosing SFC's vue-component Identity.
199
137
  * - parser-react: owner = nearest enclosing function/class Component binding.
200
- * - parser-lit (planned): owner = enclosing @customElement class Identity.
201
- * - parser-html: no owner; HTML files are not Component definitions.
202
138
  *
203
139
  * Path-based identity resolution must use `normalizeOwnerPath` (from
204
140
  * `@component-compass/plugin-core`) to match local-index keys.
205
141
  */
206
142
  ownerComponentId?: ComponentId;
207
143
  };
208
- export type WrapperDef = {
209
- id: WrapperId;
210
- name: string;
211
- file: string;
212
- exportName: string;
213
- componentDeps: ComponentId[];
214
- };
215
144
  export type FileImport = {
216
145
  file: string;
217
146
  /** Local binding name as used at the import site. */
@@ -221,18 +150,14 @@ export type FileImport = {
221
150
  };
222
151
  export type ParseResult = {
223
152
  occurrences: Occurrence[];
224
- wrappers: WrapperDef[];
225
153
  imports: FileImport[];
226
154
  warnings: Warning[];
227
155
  };
228
156
  export type ParseContext = {
229
157
  /** Local-component definitions discovered in repo source. */
230
158
  localIndex: LocalDefinitionIndex;
231
- config: ScanConfig;
232
159
  resolveImport: (from: string, spec: string) => string | null;
233
- resolveLazyManifest: ResolveLazyManifest;
234
160
  resolveLocalExport: ResolveLocalExport;
235
- lookupByTag: LookupByTag;
236
161
  repoRoot: string;
237
162
  /** Shared diagnostic collector for the scan run. */
238
163
  collector?: DiagnosticCollector;
@@ -243,42 +168,12 @@ export type ParseContext = {
243
168
  *
244
169
  * For babel-family files (.tsx/.ts/.jsx/.js): oxc Program.
245
170
  * For .vue: VueParseWrapper (descriptor + optional scriptProgram).
246
- * For .html: parse5 Document.
247
171
  */
248
172
  ast?: unknown;
249
- /**
250
- * Global CEM index built once at scan startup. Maps hyphenated tag names
251
- * and package names to their manifest entries, enabling parsers to resolve
252
- * tags like `<x-link>` unconditionally.
253
- * Provided by scan.ts; parsers consume it.
254
- */
255
- cemIndex?: CemIndex;
256
173
  };
257
174
  export interface ParserPlugin {
258
175
  name: string;
259
176
  extensions: string[];
260
177
  parse(file: string, source: string, ctx: ParseContext): ParseResult;
261
178
  }
262
- export type ManifestRef = {
263
- source: ManifestSource;
264
- packageName: string;
265
- path: string;
266
- version: string | null;
267
- };
268
- export type ScanStats = {
269
- filesScanned: number;
270
- filesWithUsage: number;
271
- scanDurationMs: number;
272
- componentsDetected: number;
273
- totalOccurrences: number;
274
- };
275
- export type ScanOutput = {
276
- meta: ScanMeta;
277
- manifests: ManifestRef[];
278
- stats: ScanStats;
279
- components: OutputComponent[];
280
- occurrences: OutputOccurrence[];
281
- diagnostics: Diagnostic[];
282
- /** Realization edges. Populated post-resolve by applyWrapRelationships (scan.ts). */
283
- relationships: RelationshipEdge[];
284
- };
179
+ export {};
@@ -1,6 +1,5 @@
1
- /** Unsafe constructors — use only at the data-ingest boundary. */
1
+ /** Unsafe constructor — use only at the data-ingest boundary. */
2
2
  export const asTagName = (s) => s;
3
- export const asWrapperId = (s) => s;
4
3
  export const emptyLocalIndex = {
5
4
  byPath: new Map(),
6
5
  byTag: new Map(),
@@ -1 +1 @@
1
- {"version":3,"file":"scan-types.js","sourceRoot":"","sources":["../src/scan-types.ts"],"names":[],"mappings":"AAsBA,kEAAkE;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,CAAY,CAAC;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAS,EAAa,EAAE,CAAC,CAAc,CAAC;AAyHpE,MAAM,CAAC,MAAM,eAAe,GAAyB;IACnD,MAAM,EAAE,IAAI,GAAG,EAAE;IACjB,KAAK,EAAE,IAAI,GAAG,EAAE;CACjB,CAAC"}
1
+ {"version":3,"file":"scan-types.js","sourceRoot":"","sources":["../src/scan-types.ts"],"names":[],"mappings":"AAoBA,iEAAiE;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,CAAY,CAAC;AAyD9D,MAAM,CAAC,MAAM,eAAe,GAAyB;IACnD,MAAM,EAAE,IAAI,GAAG,EAAE;IACjB,KAAK,EAAE,IAAI,GAAG,EAAE;CACjB,CAAC"}
package/dist/types.d.ts CHANGED
@@ -23,65 +23,3 @@ export type ComponentId = {
23
23
  export: string;
24
24
  source: ComponentSource;
25
25
  };
26
- export type Lifecycle = {
27
- status: "stable";
28
- } | {
29
- status: "deprecated";
30
- supersededBy?: {
31
- packageName: string;
32
- exportName: string;
33
- };
34
- deprecationReason?: string;
35
- };
36
- export type ManifestProp = {
37
- name: string;
38
- type?: string;
39
- default?: string | number | boolean | null;
40
- values?: string[];
41
- required?: boolean;
42
- description?: string;
43
- lifecycle?: Lifecycle;
44
- };
45
- export type ManifestEvent = {
46
- name: string;
47
- payloadType?: string;
48
- description?: string;
49
- lifecycle?: Lifecycle;
50
- };
51
- export type ManifestSlot = {
52
- name: string;
53
- description?: string;
54
- lifecycle?: Lifecycle;
55
- };
56
- type ComponentBase = {
57
- source: ComponentSource;
58
- description?: string;
59
- props: ManifestProp[];
60
- lifecycle?: Lifecycle;
61
- };
62
- export type ManifestComponent = (ComponentBase & {
63
- kind: "custom-element";
64
- tagName: string;
65
- events?: ManifestEvent[];
66
- slots?: ManifestSlot[];
67
- cssParts?: Array<{
68
- name: string;
69
- }>;
70
- cssProperties?: Array<{
71
- name: string;
72
- }>;
73
- }) | (ComponentBase & {
74
- kind: "react-component";
75
- export: string;
76
- }) | (ComponentBase & {
77
- kind: "vue-component";
78
- export: string;
79
- });
80
- export type ManifestSource = "cem" | "react" | "vue";
81
- export type ManifestFile = {
82
- schemaVersion: "2.0.0";
83
- source: ManifestSource;
84
- package: string;
85
- components: ManifestComponent[];
86
- };
87
- export {};
@@ -0,0 +1,3 @@
1
+ import type { Identity } from "./schema.js";
2
+ /** Canonical identity → component id. Isomorphic: runs in the CLI and in the browser bundle. */
3
+ export declare function componentKey(identity: Identity): string;
@@ -0,0 +1,12 @@
1
+ import { sha1 } from "@noble/hashes/legacy";
2
+ import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils";
3
+ /** Canonical identity → component id. Isomorphic: runs in the CLI and in the browser bundle. */
4
+ export function componentKey(identity) {
5
+ const tuple = identity.kind === "package-export"
6
+ ? [identity.kind, identity.packageName, identity.publicEntry, identity.exportName]
7
+ : identity.kind === "repository-declaration"
8
+ ? [identity.kind, identity.repoId, identity.filePath, identity.exportName]
9
+ : [identity.kind, identity.tagName];
10
+ return bytesToHex(sha1(utf8ToBytes(JSON.stringify(tuple)))).slice(0, 16);
11
+ }
12
+ //# sourceMappingURL=component-key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-key.js","sourceRoot":"","sources":["../../src/v2/component-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG9D,gGAAgG;AAChG,MAAM,UAAU,YAAY,CAAC,QAAkB;IAC7C,MAAM,KAAK,GACT,QAAQ,CAAC,IAAI,KAAK,gBAAgB;QAChC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;QAClF,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,wBAAwB;YAC1C,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC;YAC1E,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1C,OAAO,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type { AttributionTarget, ChainBailedCode, Component, CompositionRollup, Credit, DeclaredProp, DeclaredPropApi, EvidenceRecord, Framework, Identity, Known, KnownEvidenceRecord, Occurrence, PropDistribution, PropValueEntry, PropValueState, Resolution, ResolvedOccurrence, ScanArtifact, ScanMeta, SourceLoc, TagAttribution, TraceStep, UnresolvedReason, } from "./schema.js";
2
+ export { componentKey } from "./component-key.js";
3
+ export { isKind } from "./schema.js";
4
+ export { isResolved, resolvedOccurrences } from "./resolved-occurrences.js";
5
+ export { buildScanStats, type ScanStats } from "./scan-stats.js";
6
+ export { SCHEMA_VERSION, schemaVersionOf } from "./schema-version.js";
7
+ export { resolveTagAttribution } from "./tag-attribution.js";
8
+ export { RESERVED_CUSTOM_ELEMENT_NAMES, canonicalTagName, isValidCustomElementName } from "./tag-vocabulary.js";
9
+ export { type ValidationResult, validateArtifact } from "./validate.js";
@@ -0,0 +1,9 @@
1
+ export { componentKey } from "./component-key.js";
2
+ export { isKind } from "./schema.js";
3
+ export { isResolved, resolvedOccurrences } from "./resolved-occurrences.js";
4
+ export { buildScanStats } from "./scan-stats.js";
5
+ export { SCHEMA_VERSION, schemaVersionOf } from "./schema-version.js";
6
+ export { resolveTagAttribution } from "./tag-attribution.js";
7
+ export { RESERVED_CUSTOM_ELEMENT_NAMES, canonicalTagName, isValidCustomElementName } from "./tag-vocabulary.js";
8
+ export { validateArtifact } from "./validate.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v2/index.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAyB,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Occurrence, ResolvedOccurrence } from "./schema.js";
2
+ export declare function isResolved(o: Occurrence): o is ResolvedOccurrence;
3
+ /** The only way component-facing code reads occurrences: unresolved ones have no component. */
4
+ export declare function resolvedOccurrences(occurrences: readonly Occurrence[]): ResolvedOccurrence[];
@@ -0,0 +1,8 @@
1
+ export function isResolved(o) {
2
+ return o.resolution.status === "resolved";
3
+ }
4
+ /** The only way component-facing code reads occurrences: unresolved ones have no component. */
5
+ export function resolvedOccurrences(occurrences) {
6
+ return occurrences.filter(isResolved);
7
+ }
8
+ //# sourceMappingURL=resolved-occurrences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolved-occurrences.js","sourceRoot":"","sources":["../../src/v2/resolved-occurrences.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,UAAU,CAAC,CAAa;IACtC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC;AAC5C,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,mBAAmB,CAAC,WAAkC;IACpE,OAAO,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Occurrence } from "./schema.js";
2
+ /** A scan's summary counts. The scan file doesn't carry them. */
3
+ export type ScanStats = {
4
+ filesScanned: number;
5
+ scanDurationMs: number;
6
+ componentCount: number;
7
+ occurrenceCount: number;
8
+ resolvedOccurrenceCount: number;
9
+ filesWithResolvedOccurrences: number;
10
+ };
11
+ export declare function buildScanStats(input: {
12
+ filesScanned: number;
13
+ scanDurationMs: number;
14
+ components: readonly unknown[];
15
+ occurrences: readonly Occurrence[];
16
+ }): ScanStats;