@component-compass/plugin-core 0.1.0 → 0.1.2

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.
@@ -15,13 +15,12 @@ export type Diagnostic = {
15
15
  nameType: string;
16
16
  detail: string;
17
17
  } | {
18
- code: "vue-tag-low-confidence";
18
+ code: "low-confidence-tag";
19
19
  severity: "info";
20
20
  filePath: string;
21
21
  line?: number;
22
22
  column?: number;
23
23
  tagName: string;
24
- emittedAs: "vue-component" | "custom-element";
25
24
  } | {
26
25
  code: "local-index-duplicate-tag";
27
26
  severity: "warning";
@@ -27,7 +27,7 @@ function dedupKey(d) {
27
27
  switch (d.code) {
28
28
  case "jsx-shape-unsupported":
29
29
  return `${d.code}::${d.filePath}::${d.line ?? ""}::${d.column ?? ""}::${d.nameType}`;
30
- case "vue-tag-low-confidence":
30
+ case "low-confidence-tag":
31
31
  return `${d.code}::${d.filePath}::${d.line ?? ""}::${d.column ?? ""}::${d.tagName}`;
32
32
  case "local-index-duplicate-tag":
33
33
  return `${d.code}::${d.filePath}::${d.tagName}`;
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgFH,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,uBAAuB;YAC1B,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,IAAI,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;QACvF,KAAK,wBAAwB;YAC3B,OAAO,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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"}
@@ -4,20 +4,12 @@ import type { IndexedComponent } from "./scan-types.js";
4
4
  *
5
5
  * - "authored": leaf shipped a `custom-elements.json` or
6
6
  * `component-compass-manifest.json` at its package root.
7
- * - "derived": leaf carries no authored manifest but `manifest-react` /
8
- * `manifest-vue` extractors (Phase 4) produced one from source.
9
7
  * - null: no enrichment available — identity stays opaque
10
8
  * (`components[].manifest === null` in the artifact).
11
- *
12
- * Open envelope: `data` shape grows in Phase 3 (CEM depth) and Phase 4
13
- * (extractor maturity) without changing this discriminator.
14
9
  */
15
10
  export type Enrichment = {
16
11
  source: "authored";
17
12
  data: AuthoredLeafPayload;
18
- } | {
19
- source: "derived";
20
- data: DerivedLeafPayload;
21
13
  } | null;
22
14
  /**
23
15
  * Payload shape held by the lazy resolver for a successfully-loaded leaf
@@ -34,12 +26,3 @@ export type AuthoredLeafPayload = {
34
26
  /** Leaf package's `version` field, when readable. */
35
27
  packageVersion?: string;
36
28
  };
37
- /**
38
- * Phase 4 hook: per-leaf payload populated by the source-extraction fallback
39
- * (manifest-react / manifest-vue extractors). Same per-leaf shape as
40
- * `AuthoredLeafPayload`; field set narrows to whatever the extractors recover.
41
- */
42
- export type DerivedLeafPayload = {
43
- /** Components extracted from leaf source by Phase 4 extractors. */
44
- components: IndexedComponent[];
45
- };
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { manifestJsonSchema } from "./schema.js";
6
6
  export { ManifestBuilder } from "./builder.js";
7
7
  export type { TagName, WrapperId, ImportRole, ImportEntry, 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
8
  export { asTagName, asWrapperId, emptyLocalIndex } from "./scan-types.js";
9
- export type { Enrichment, AuthoredLeafPayload, DerivedLeafPayload } from "./enrichment.js";
9
+ export type { Enrichment, AuthoredLeafPayload } from "./enrichment.js";
10
10
  export { normalizeOwnerPath } from "./owner-utils.js";
11
11
  export { computeOccurrenceId } from "./occurrence-id.js";
12
12
  export type { CompositionRollup } from "./output-types.js";
@@ -45,6 +45,25 @@ export type OutputIdentity = {
45
45
  line: number;
46
46
  column: number;
47
47
  };
48
+ /**
49
+ * Cross-link from a React wrapper to the underlying custom element it wraps.
50
+ * Set on react-component identities whose package's CEM declares a
51
+ * custom-element with `className === this.exportName`.
52
+ * Absent when no CEM match or for non-wrapper imports.
53
+ * Does NOT participate in componentId hashing.
54
+ */
55
+ wraps?: {
56
+ kind: "custom-element";
57
+ tagName: string;
58
+ packageName: string;
59
+ };
60
+ /**
61
+ * Cross-link from a custom element to all React wrappers pointing at it.
62
+ * Sorted array of componentIds (deterministic order). Populated in the
63
+ * post-resolve aggregation phase of scan.ts.
64
+ * Does NOT participate in componentId hashing.
65
+ */
66
+ wrappedBy?: string[];
48
67
  };
49
68
  export type PropDecl = {
50
69
  type?: string;
@@ -77,17 +96,6 @@ export type AuthoredManifestData = {
77
96
  slots?: Record<string, SlotDecl>;
78
97
  invocable?: Record<string, InvocableDecl>;
79
98
  };
80
- /**
81
- * Phase 4 hook: per-component payload populated by source-extraction fallback.
82
- * Structurally a subset of `AuthoredManifestData`; ships empty in Phase 3.
83
- */
84
- export type DerivedManifestData = {
85
- description?: string;
86
- lifecycle?: Lifecycle;
87
- props?: Record<string, PropDecl>;
88
- slots?: Record<string, SlotDecl>;
89
- invocable?: Record<string, InvocableDecl>;
90
- };
91
99
  /**
92
100
  * Per-occurrence prop value:
93
101
  * - a literal (string/number/boolean/null) when the source value is statically known,
@@ -120,9 +128,6 @@ export type OutputComponent = {
120
128
  manifest: {
121
129
  source: "authored";
122
130
  data: AuthoredManifestData;
123
- } | {
124
- source: "derived";
125
- data: DerivedManifestData;
126
131
  } | null;
127
132
  stats: {
128
133
  occurrenceCount: number;
package/dist/types.d.ts CHANGED
@@ -6,6 +6,7 @@ export type ComponentSource = {
6
6
  } | {
7
7
  type: "local";
8
8
  filePath: string;
9
+ exportName?: string;
9
10
  } | {
10
11
  type: "unknown";
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-compass/plugin-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",