@component-compass/plugin-core 0.0.2 → 0.0.4

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.
package/dist/builder.d.ts CHANGED
@@ -3,19 +3,13 @@ type BuilderOpts = {
3
3
  source: ManifestSource;
4
4
  package: string;
5
5
  };
6
- type AddInput = (Omit<Extract<ManifestComponent, {
6
+ type AddInput = Extract<ManifestComponent, {
7
7
  kind: "custom-element";
8
- }>, "deprecated"> & {
9
- deprecated?: boolean | string;
10
- }) | (Omit<Extract<ManifestComponent, {
8
+ }> | Extract<ManifestComponent, {
11
9
  kind: "react-component";
12
- }>, "deprecated"> & {
13
- deprecated?: boolean | string;
14
- }) | (Omit<Extract<ManifestComponent, {
10
+ }> | Extract<ManifestComponent, {
15
11
  kind: "vue-component";
16
- }>, "deprecated"> & {
17
- deprecated?: boolean | string;
18
- });
12
+ }>;
19
13
  export declare class ManifestBuilder {
20
14
  private readonly source;
21
15
  private readonly packageName;
package/dist/builder.js CHANGED
@@ -19,7 +19,7 @@ export class ManifestBuilder {
19
19
  if (c.kind !== expected) {
20
20
  throw new Error(`Component kind "${c.kind}" does not match builder source "${this.source}" (expected kind "${expected}")`);
21
21
  }
22
- this.components.push({ deprecated: false, ...c });
22
+ this.components.push(c);
23
23
  return this;
24
24
  }
25
25
  build() {
@@ -1 +1 @@
1
- {"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,MAAM,eAAe,GAAsD;IACzE,GAAG,EAAE,gBAAgB;IACrB,KAAK,EAAE,iBAAiB;IACxB,GAAG,EAAE,eAAe;CACrB,CAAC;AASF,MAAM,OAAO,eAAe;IACT,MAAM,CAAiB;IACvB,WAAW,CAAS;IACpB,U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,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC5D,MAAM,GAAG,GAAiB;YACxB,aAAa,EAAE,cAAc;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,WAAW;YACzB,UAAU,EAAE,MAAM;SACnB,CAAC;QACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,CAAoB,EAAE,CAAoB;IACnE,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,IAAI,CAAC,CAAoB;IAChC,IAAI,CAAC,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QAChC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Unified diagnostic surface for parsers, resolver, and local-index.
3
+ * Discriminated union by `code`; severity drives `--strict` exit code.
4
+ *
5
+ * Lives in plugin-core so resolver, parsers, local-index, and CLI all
6
+ * share one source of truth.
7
+ */
8
+ export type DiagnosticSeverity = "info" | "warning";
9
+ export type Diagnostic = {
10
+ code: "jsx-shape-unsupported";
11
+ severity: "warning";
12
+ filePath: string;
13
+ line?: number;
14
+ column?: number;
15
+ nameType: string;
16
+ detail: string;
17
+ } | {
18
+ code: "vue-tag-low-confidence";
19
+ severity: "info";
20
+ filePath: string;
21
+ line?: number;
22
+ column?: number;
23
+ tagName: string;
24
+ emittedAs: "vue-component" | "custom-element";
25
+ } | {
26
+ code: "local-index-duplicate-tag";
27
+ severity: "warning";
28
+ filePath: string;
29
+ tagName: string;
30
+ conflictsWith: string;
31
+ } | {
32
+ code: "cycle-detected";
33
+ severity: "warning";
34
+ filePath: string;
35
+ exportName: string;
36
+ packageName?: string;
37
+ } | {
38
+ code: "chain-too-deep";
39
+ severity: "warning";
40
+ filePath: string;
41
+ exportName: string;
42
+ depth: number;
43
+ packageName?: string;
44
+ };
45
+ export interface DiagnosticCollector {
46
+ emit(d: Diagnostic): void;
47
+ drain(): Diagnostic[];
48
+ }
49
+ export type DiagnosticCode = Diagnostic["code"];
50
+ export declare function createDiagnosticCollector(): DiagnosticCollector;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Unified diagnostic surface for parsers, resolver, and local-index.
3
+ * Discriminated union by `code`; severity drives `--strict` exit code.
4
+ *
5
+ * Lives in plugin-core so resolver, parsers, local-index, and CLI all
6
+ * share one source of truth.
7
+ */
8
+ function assertUnreachable(x) {
9
+ throw new Error(`Unhandled diagnostic code: ${x.code}`);
10
+ }
11
+ /**
12
+ * Compute a stable dedup key for a diagnostic. Two diagnostics with
13
+ * identical keys are treated as the same observation and only emitted once.
14
+ *
15
+ * Keys are constructed per-code from the fields that identify the OBSERVATION
16
+ * (e.g. file + line, or package + resolvedFile) — not the severity or
17
+ * descriptive `detail`/`form` fields.
18
+ *
19
+ * Note on `packageName` omission: for `cycle-detected` and `chain-too-deep`,
20
+ * the diagnostic describes a property of the barrel/re-export (file,
21
+ * exportName), not the consumer package that triggered resolution. Including
22
+ * `packageName` (which is the consumer's package) would un-dedup based on
23
+ * consumer attribution and re-introduce the noise pattern this collector
24
+ * exists to suppress (GH issue #12).
25
+ */
26
+ function dedupKey(d) {
27
+ switch (d.code) {
28
+ case "jsx-shape-unsupported":
29
+ return `${d.code}::${d.filePath}::${d.line ?? ""}::${d.column ?? ""}::${d.nameType}`;
30
+ case "vue-tag-low-confidence":
31
+ return `${d.code}::${d.filePath}::${d.line ?? ""}::${d.column ?? ""}::${d.tagName}`;
32
+ case "local-index-duplicate-tag":
33
+ return `${d.code}::${d.filePath}::${d.tagName}`;
34
+ case "cycle-detected":
35
+ return `${d.code}::${d.filePath}::${d.exportName}`;
36
+ case "chain-too-deep":
37
+ return `${d.code}::${d.filePath}::${d.exportName}`;
38
+ default:
39
+ return assertUnreachable(d);
40
+ }
41
+ }
42
+ export function createDiagnosticCollector() {
43
+ const seen = new Set();
44
+ const ordered = [];
45
+ return {
46
+ emit(d) {
47
+ const key = dedupKey(d);
48
+ if (seen.has(key))
49
+ return;
50
+ seen.add(key);
51
+ ordered.push(d);
52
+ },
53
+ drain() {
54
+ const out = ordered.slice();
55
+ ordered.length = 0;
56
+ seen.clear();
57
+ return out;
58
+ },
59
+ };
60
+ }
61
+ //# sourceMappingURL=diagnostic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqDH,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,C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AAC,CAAC;YACnB,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -14,12 +14,17 @@ import type { IndexedComponent } from "./scan-types.js";
14
14
  */
15
15
  export type Enrichment = {
16
16
  source: "authored";
17
- data: AuthoredManifestData;
17
+ data: AuthoredLeafPayload;
18
18
  } | {
19
19
  source: "derived";
20
- data: DerivedManifestData;
20
+ data: DerivedLeafPayload;
21
21
  } | null;
22
- export type AuthoredManifestData = {
22
+ /**
23
+ * Payload shape held by the lazy resolver for a successfully-loaded leaf
24
+ * manifest. Per-leaf, not per-component — carries every component the leaf
25
+ * declares plus the manifest source metadata.
26
+ */
27
+ export type AuthoredLeafPayload = {
23
28
  /** Every component declared in the leaf's authored manifest. */
24
29
  components: IndexedComponent[];
25
30
  /** Absolute filesystem path of the loaded manifest file. */
@@ -29,7 +34,12 @@ export type AuthoredManifestData = {
29
34
  /** Leaf package's `version` field, when readable. */
30
35
  packageVersion?: string;
31
36
  };
32
- export type DerivedManifestData = {
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 = {
33
43
  /** Components extracted from leaf source by Phase 4 extractors. */
34
44
  components: IndexedComponent[];
35
45
  };
package/dist/id.d.ts CHANGED
@@ -2,3 +2,8 @@ import type { ComponentId, ComponentSource } from "./types.js";
2
2
  export declare function externalPackageOf(source: ComponentSource): string;
3
3
  export declare function serialiseComponentId(id: ComponentId): string;
4
4
  export declare function compareComponentId(a: ComponentId, b: ComponentId): number;
5
+ export declare function parseCompoundExport(exportName: string): {
6
+ root: string;
7
+ path: string[];
8
+ isCompound: boolean;
9
+ };
package/dist/id.js CHANGED
@@ -28,4 +28,12 @@ export function serialiseComponentId(id) {
28
28
  export function compareComponentId(a, b) {
29
29
  return serialiseComponentId(a).localeCompare(serialiseComponentId(b));
30
30
  }
31
+ export function parseCompoundExport(exportName) {
32
+ const [root, ...path] = exportName.split(".");
33
+ return {
34
+ root: root ?? "",
35
+ path,
36
+ isCompound: path.length > 0,
37
+ };
38
+ }
31
39
  //# sourceMappingURL=id.js.map
package/dist/id.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"id.js","sourceRoot":"","sources":["../src/id.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,MAAuB;IACvD,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,MAAM,CAAC,OAAO,CAAC;IACtD,MAAM,IAAI,KAAK,CACb,2DAA2D,MAAM,CAAC,IAAI,qEAAqE,CAC5I,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAuB;IAC5C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,UAAU;YACb,OAAO,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC;QACtC,KAAK,OAAO;YACV,OAAO,SAAS,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpC,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAe;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,gBAAgB;YACnB,OAAO,EAAE,CAAC,OAAO,CAAC;QACpB,KAAK,iBAAiB,CAAC;QACvB,KAAK,eAAe;YAClB,OAAO,EAAE,CAAC,MAAM,CAAC;IACrB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,EAAe;IAClD,OAAO,GAAG,EAAE,CAAC,IAAI,IAAI,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,CAAc,EAAE,CAAc;IAC/D,OAAO,oB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;IAKpD,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,OAAO;QACL,IAAI,EAAE,IAAI,IAAI,EAAE;QAChB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC;KAC5B,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  export type { ComponentId, ComponentKind, ComponentSource, Lifecycle, ManifestComponent, ManifestEvent, ManifestFile, ManifestProp, ManifestSlot, ManifestSource, } from "./types.js";
2
- export { serialiseComponentId, compareComponentId, externalPackageOf } from "./id.js";
2
+ export { serialiseComponentId, compareComponentId, externalPackageOf, parseCompoundExport } from "./id.js";
3
3
  export { validateManifest } from "./validate.js";
4
4
  export type { ValidationResult } from "./validate.js";
5
5
  export { manifestJsonSchema } from "./schema.js";
6
6
  export { ManifestBuilder } from "./builder.js";
7
- export type { TagName, WrapperId, ImportRole, ImportEntry, IndexedComponent, Loc, WarningCode, Warning, ScanConfig, PropUsage, OccurrenceVia, Occurrence, WrapperDef, FileImport, ParseResult, ParseContext, ParserPlugin, ScanEnvelope, ScanOutput, ManifestRef, ScanStats, DetectorId, LocalDefinition, LocalDefinitionIndex, ResolveLazyManifest, LookupByTag, LazyResolverHit, } from "./scan-types.js";
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, LookupByTag, LazyResolverHit, CemIndex, CemIndexEntry, } from "./scan-types.js";
8
8
  export { asTagName, asWrapperId, emptyLocalIndex } from "./scan-types.js";
9
- export type { Enrichment, AuthoredManifestData, DerivedManifestData } from "./enrichment.js";
9
+ export type { Enrichment, AuthoredLeafPayload, DerivedLeafPayload } from "./enrichment.js";
10
10
  export { computeOccurrenceId } from "./occurrence-id.js";
11
11
  export type { CompositionRollup } from "./output-types.js";
12
12
  export * from "./output-types.js";
13
+ export type { Diagnostic, DiagnosticSeverity, DiagnosticCollector, DiagnosticCode } from "./diagnostic.js";
14
+ export { createDiagnosticCollector } from "./diagnostic.js";
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
- export { serialiseComponentId, compareComponentId, externalPackageOf } from "./id.js";
1
+ export { serialiseComponentId, compareComponentId, externalPackageOf, parseCompoundExport } from "./id.js";
2
2
  export { validateManifest } from "./validate.js";
3
3
  export { manifestJsonSchema } from "./schema.js";
4
4
  export { ManifestBuilder } from "./builder.js";
5
5
  export { asTagName, asWrapperId, emptyLocalIndex } from "./scan-types.js";
6
6
  export { computeOccurrenceId } from "./occurrence-id.js";
7
7
  export * from "./output-types.js";
8
+ export { createDiagnosticCollector } from "./diagnostic.js";
8
9
  //# 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,MAAM,SAAS,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAc/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAI1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,cAAc,mBAAmB,CAAC"}
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,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGzD,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -4,38 +4,86 @@
4
4
  * agents) share one source of truth without depending on cli internals.
5
5
  */
6
6
  import type { OccurrenceVia } from "./via-types.js";
7
- export type ComponentScope = "ds" | "external" | "local";
7
+ import type { Lifecycle } from "./types.js";
8
+ export type ComponentScope = "external" | "local";
8
9
  export type ComponentKindOutput = "custom-element" | "react-component" | "vue-component";
9
- export type ViaKindOutput = "html-tag" | "lit-template" | "react-wrapper" | "direct-import" | "vue-template";
10
10
  export type OutputIdentity = {
11
11
  scope: ComponentScope;
12
12
  kind: ComponentKindOutput;
13
- /** Present for ds + external; absent for local. */
13
+ /**
14
+ * For ds + external lanes: the npm package name as resolved by the manifest layer.
15
+ * For local lane: the owning workspace package's name when the file resides inside
16
+ * one. Absent for root-level local files (non-workspace single-package repos).
17
+ */
14
18
  packageName?: string;
19
+ /**
20
+ * For resolver-driven external identities: the file Node's import resolution
21
+ * (and any further chain walking) landed on, relative to the leaf package
22
+ * root, POSIX-normalised. Disambiguates distinct components reached via
23
+ * different subpaths of the same package. Absent for byTag-driven external
24
+ * identities (which disambiguate via `tagName` alone) and for local identities
25
+ * (which use `filePath` instead).
26
+ */
27
+ modulePath?: string;
15
28
  /** For react-component / vue-component. */
16
29
  exportName?: string;
17
30
  /** For custom-element. */
18
31
  tagName?: string;
19
- via: {
20
- kind: ViaKindOutput;
21
- };
22
32
  /** Present for local; absent for ds/external. */
23
33
  repoId?: string;
24
34
  /** Present for local; absent for ds/external. Repo-relative path of the defining file. */
25
35
  filePath?: string;
26
- };
27
- export type OutputManifest = {
28
- source: "authored" | "derived";
29
- lifecycle?: {
30
- status: "stable" | "deprecated";
31
- supersededBy?: {
32
- packageName: string;
33
- exportName: string;
34
- };
36
+ /**
37
+ * Source position of the local-component declaration (the function/class
38
+ * keyword for declarations; the variable identifier for `const Foo = ...`).
39
+ * Only set when `scope === "local"`. Absent for ds / external / wc.
40
+ */
41
+ definition?: {
42
+ line: number;
43
+ column: number;
35
44
  };
36
- props?: Record<string, {
37
- default?: string | number | boolean | null;
38
- }>;
45
+ };
46
+ export type PropDecl = {
47
+ type?: string;
48
+ default?: string | number | boolean | null;
49
+ values?: string[];
50
+ required?: boolean;
51
+ description?: string;
52
+ lifecycle?: Lifecycle;
53
+ };
54
+ export type SlotDecl = {
55
+ description?: string;
56
+ lifecycle?: Lifecycle;
57
+ };
58
+ export type InvocableDecl = {
59
+ kind: "dom-event" | "callback-prop";
60
+ payloadType?: string;
61
+ description?: string;
62
+ lifecycle?: Lifecycle;
63
+ };
64
+ /**
65
+ * Per-component manifest payload as it appears in `component-compass.json`.
66
+ * Field set is the closed-form Phase 3 schema (trimmed): description, lifecycle,
67
+ * and the three per-feature record maps. Methods, CSS surfaces, inheritance,
68
+ * and `since` are deferred to later sub-plans / phases.
69
+ */
70
+ export type AuthoredManifestData = {
71
+ description?: string;
72
+ lifecycle?: Lifecycle;
73
+ props?: Record<string, PropDecl>;
74
+ slots?: Record<string, SlotDecl>;
75
+ invocable?: Record<string, InvocableDecl>;
76
+ };
77
+ /**
78
+ * Phase 4 hook: per-component payload populated by source-extraction fallback.
79
+ * Structurally a subset of `AuthoredManifestData`; ships empty in Phase 3.
80
+ */
81
+ export type DerivedManifestData = {
82
+ description?: string;
83
+ lifecycle?: Lifecycle;
84
+ props?: Record<string, PropDecl>;
85
+ slots?: Record<string, SlotDecl>;
86
+ invocable?: Record<string, InvocableDecl>;
39
87
  };
40
88
  export type DynamicKind = "spread" | "expr" | "identifier";
41
89
  /**
@@ -55,35 +103,40 @@ export type PropDistribution = {
55
103
  defaultApplied: number;
56
104
  };
57
105
  export type CompositionRollup = {
58
- /** child componentId → count of direct-child relationships */
106
+ /** child componentId → count of occurrences owned by this component (owner-edge children). */
59
107
  rendersByCount: Record<string, number>;
60
- /** parent componentId → count of being-direct-child relationships */
108
+ /** parent componentId → count of occurrences in which this component is owned by that parent. */
61
109
  renderedByCount: Record<string, number>;
62
- /** # of this component's occurrences with no tracked parent */
110
+ /** # of this component's occurrences with no ownerComponentId. */
63
111
  isRootCount: number;
64
- /** # of this component's occurrences with no tracked direct children */
112
+ /** # of this component's occurrences whose component has empty rendersByCount. */
65
113
  isLeafCount: number;
66
- /** mean of all occurrences' depth */
67
- avgDepth: number;
68
- /** deepest observed depth */
69
- maxDepth: number;
70
- /** mean direct children per occurrence */
71
- avgChildCount: number;
72
- /** most direct children on any occurrence */
73
- maxChildCount: number;
74
114
  };
75
115
  export type OutputComponent = {
76
116
  id: string;
77
117
  identity: OutputIdentity;
78
- derivedTags: string[];
79
- manifest: OutputManifest | null;
118
+ manifest: {
119
+ source: "authored";
120
+ data: AuthoredManifestData;
121
+ } | {
122
+ source: "derived";
123
+ data: DerivedManifestData;
124
+ } | null;
80
125
  stats: {
81
126
  occurrenceCount: number;
82
127
  fileCount: number;
83
128
  };
84
129
  props: Record<string, PropDistribution>;
85
- /** Phase 2: per-component composition rollup. Omitted when occurrenceCount is 0. */
130
+ /** Per-component composition rollup (owner-edge driven). Always emitted. */
86
131
  composition?: CompositionRollup;
132
+ /** Package version from package.json or CEM. Null for external packages not versioned at scan time. */
133
+ version: string | null;
134
+ /** Deprecation flag from CEM @deprecated declaration. False if the component's CEM declaration does not carry `@deprecated`; CEM declarations on external packages flow through to this field. */
135
+ deprecated: boolean;
136
+ /** Git-mtime: first commit of the declaring file. ISO 8601 string, or null for external packages. */
137
+ createdAt: string | null;
138
+ /** Git-mtime: last commit of the declaring file. ISO 8601 string, or null for external packages. */
139
+ updatedAt: string | null;
87
140
  };
88
141
  export type OutputOccurrence = {
89
142
  componentId: string;
@@ -96,8 +149,48 @@ export type OutputOccurrence = {
96
149
  occurrenceId: string;
97
150
  /** Phase 2: occurrenceId of nearest tracked ancestor. Absent if root in this scope. */
98
151
  parentOccurrenceId?: string;
99
- /** Phase 2: denormalisation of parent's componentId; convenience for downstream queries. */
100
- parentComponentId?: string;
101
152
  /** Phase 2: distance from highest tracked-rootless ancestor in same lexical scope. */
102
153
  depth?: number;
154
+ /**
155
+ * Stable id of the component-definition that lexically contains this call
156
+ * site (the enclosing function/class). Drives the owner-edge composition
157
+ * graph. Absent when the occurrence is module-scope JSX, in a `.html`
158
+ * file, or the parser couldn't resolve an enclosing tracked component.
159
+ */
160
+ ownerComponentId?: string;
161
+ };
162
+ /**
163
+ * Top-level metadata block in the scan artifact.
164
+ * Captures repo identity, git state, and scan timing for cross-scan joins and provenance.
165
+ */
166
+ export type ScanMeta = {
167
+ /** CC version that created this artifact. */
168
+ ccVersion: string;
169
+ /** ULID generated once per scan. Unique across scans; stable within a single run. */
170
+ scanId: string;
171
+ /** ISO 8601 timestamp of the scan. */
172
+ scannedAt: string;
173
+ /** Repository identification and git state. */
174
+ repo: {
175
+ /** Stable repo identifier: git remote basename, config override, or working-directory basename. */
176
+ id: string;
177
+ /** Git remote URL (or null if not configured). For provenance tracking. */
178
+ gitRemote: string | null;
179
+ /** Current HEAD commit SHA. */
180
+ commit: string;
181
+ /** First commit SHA in the repo history. Stable across force-pushes and rebases. Null on shallow clones where git rev-list --max-parents=0 is unavailable. */
182
+ initialCommit: string | null;
183
+ /** Current branch name, or null for detached HEAD / shallow clones where branch is unavailable. */
184
+ branch: string | null;
185
+ };
186
+ };
187
+ /**
188
+ * The complete scan artifact shape produced by the CLI.
189
+ * Two-grain structure: components (rolled-up identity + manifest + composition) +
190
+ * occurrences (per call-site, linked to components by id).
191
+ */
192
+ export type ScanArtifact = {
193
+ meta: ScanMeta;
194
+ components: OutputComponent[];
195
+ occurrences: OutputOccurrence[];
103
196
  };
@@ -5,7 +5,8 @@
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 { OutputComponent, OutputOccurrence } from "./output-types.js";
8
+ import type { OutputComponent, OutputOccurrence, ScanMeta } from "./output-types.js";
9
+ import type { Diagnostic, DiagnosticCollector } from "./diagnostic.js";
9
10
  import type { ComponentId, ManifestComponent, ManifestSource } from "./types.js";
10
11
  import type { OccurrenceVia } from "./via-types.js";
11
12
  declare const __brand: unique symbol;
@@ -17,6 +18,24 @@ export type WrapperId = Brand<string, "WrapperId">;
17
18
  /** Unsafe constructors — use only at the data-ingest boundary. */
18
19
  export declare const asTagName: (s: string) => TagName;
19
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
+ };
20
39
  export type ImportRole = "native" | "react";
21
40
  export type ImportEntry = {
22
41
  specifier: string;
@@ -39,6 +58,8 @@ export type IndexedComponent = (Extract<ManifestComponent, {
39
58
  */
40
59
  export type LazyResolverHit = {
41
60
  leafPackage: string;
61
+ /** Terminal file's path relative to the leaf package root, POSIX-normalised. */
62
+ modulePath: string;
42
63
  matched: IndexedComponent | null;
43
64
  };
44
65
  export type ResolveLazyManifest = (fromFile: string, specifier: string, exportName: string) => LazyResolverHit | null;
@@ -58,6 +79,8 @@ export type LocalDefinition = {
58
79
  /** True when emitted via `export default`. */
59
80
  isDefault: boolean;
60
81
  detector: DetectorId;
82
+ /** Source position of the declaration site. Populated by detectors. */
83
+ loc?: Loc;
61
84
  };
62
85
  export type LocalDefinitionIndex = {
63
86
  /** POSIX repo-relative filePath → definitions in that file. */
@@ -95,7 +118,6 @@ export type Warning = (WarningBase & {
95
118
  * parsers decoupled from CLI-specific fields (configPath, output, etc.).
96
119
  */
97
120
  export type ScanConfig = {
98
- packageScopes: string[];
99
121
  captureValues: boolean;
100
122
  };
101
123
  export type PropUsage = {
@@ -122,9 +144,10 @@ export type Occurrence = {
122
144
  * Phase 2: parser-side parent reference. Index into the same
123
145
  * ParseResult.occurrences array. `undefined` = no tracked parent in this
124
146
  * lexical scope. The CLI's projection layer (`parseResultsToOccurrences`)
125
- * resolves this index into `parentOccurrenceId` / `parentComponentId`
126
- * strings. Cross-file composition is out of scope (per spec non-goal),
127
- * so the index is local to one ParseResult.
147
+ * resolves this index into a `parentOccurrenceId` string; downstream
148
+ * queries needing the parent's componentId look it up via the flat
149
+ * occurrence stream. Cross-file composition is out of scope (per spec
150
+ * non-goal), so the index is local to one ParseResult.
128
151
  */
129
152
  parentRef?: number;
130
153
  /**
@@ -133,6 +156,13 @@ export type Occurrence = {
133
156
  * time the occurrence was emitted.
134
157
  */
135
158
  depth?: number;
159
+ /**
160
+ * ComponentId of the enclosing component-definition. Resolved by parsers
161
+ * via ancestor walk. The CLI projection layer hashes this into
162
+ * `OutputOccurrence.ownerComponentId`. Undefined when no enclosing tracked
163
+ * component was found.
164
+ */
165
+ ownerComponentId?: ComponentId;
136
166
  };
137
167
  export type WrapperDef = {
138
168
  id: WrapperId;
@@ -162,24 +192,34 @@ export type ParseContext = {
162
192
  resolveLazyManifest: ResolveLazyManifest;
163
193
  lookupByTag: LookupByTag;
164
194
  repoRoot: string;
195
+ /** Shared diagnostic collector for the scan run. */
196
+ collector?: DiagnosticCollector;
197
+ /**
198
+ * Pre-parsed AST for the file. Provided by scan.ts when the single-pass
199
+ * pipeline is active. The type is intentionally `unknown` here — concrete
200
+ * narrowing is plugin-specific. Plugin-core stays free of parser-library deps.
201
+ *
202
+ * For babel-family files (.tsx/.ts/.jsx/.js): oxc Program.
203
+ * For .vue: VueParseWrapper (descriptor + optional scriptProgram).
204
+ * For .html: parse5 Document.
205
+ */
206
+ ast?: unknown;
207
+ /**
208
+ * Global CEM index built once at scan startup. Maps hyphenated tag names
209
+ * and package names to their manifest entries, enabling parsers to resolve
210
+ * tags like `<pie-link>` unconditionally.
211
+ * Provided by scan.ts; parsers consume it.
212
+ */
213
+ cemIndex?: CemIndex;
165
214
  };
166
215
  export interface ParserPlugin {
167
216
  name: string;
168
217
  extensions: string[];
169
218
  parse(file: string, source: string, ctx: ParseContext): ParseResult;
170
219
  }
171
- export type ScanEnvelope = {
172
- scanId: string;
173
- repoId: string;
174
- commitSha: string | null;
175
- branch: string | null;
176
- timestamp: string;
177
- toolVersion: string;
178
- cwd: string;
179
- };
180
220
  export type ManifestRef = {
181
221
  source: ManifestSource;
182
- package: string;
222
+ packageName: string;
183
223
  path: string;
184
224
  version: string | null;
185
225
  };
@@ -191,9 +231,10 @@ export type ScanStats = {
191
231
  totalOccurrences: number;
192
232
  };
193
233
  export type ScanOutput = {
194
- envelope: ScanEnvelope;
234
+ meta: ScanMeta;
195
235
  manifests: ManifestRef[];
196
236
  stats: ScanStats;
197
237
  components: OutputComponent[];
198
238
  occurrences: OutputOccurrence[];
239
+ diagnostics: Diagnostic[];
199
240
  };
@@ -1 +1 @@
1
- {"version":3,"file":"scan-types.js","sourceRoot":"","sources":["../src/scan-types.ts"],"names":[],"mappings":"AAqBA,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;AAoFpE,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":"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;AA2GpE,MAAM,CAAC,MAAM,eAAe,GAAyB;IACnD,MAAM,EAAE,IAAI,GAAG,EAAE;IACjB,KAAK,EAAE,IAAI,GAAG,EAAE;CACjB,CAAC"}
package/dist/schema.d.ts CHANGED
@@ -18,7 +18,7 @@ export declare const manifestJsonSchema: {
18
18
  readonly type: "array";
19
19
  readonly items: {
20
20
  readonly type: "object";
21
- readonly required: readonly ["kind", "source", "deprecated", "props"];
21
+ readonly required: readonly ["kind", "source", "props"];
22
22
  readonly properties: {
23
23
  readonly kind: {
24
24
  readonly enum: readonly ["custom-element", "react-component", "vue-component"];
@@ -69,12 +69,11 @@ export declare const manifestJsonSchema: {
69
69
  readonly tagName: {
70
70
  readonly type: "string";
71
71
  };
72
- readonly deprecated: {
73
- readonly oneOf: readonly [{
74
- readonly type: "boolean";
75
- }, {
76
- readonly type: "string";
77
- }];
72
+ readonly description: {
73
+ readonly type: "string";
74
+ };
75
+ readonly lifecycle: {
76
+ readonly type: "object";
78
77
  };
79
78
  readonly props: {
80
79
  readonly type: "array";
package/dist/schema.js CHANGED
@@ -1,4 +1,3 @@
1
- // biome-ignore lint/suspicious/noThenProperty: JSON Schema if/then for source⇄kind validation
2
1
  export const manifestJsonSchema = {
3
2
  $id: "https://component-compass.dev/manifest-2.0.0.json",
4
3
  type: "object",
@@ -12,7 +11,7 @@ export const manifestJsonSchema = {
12
11
  type: "array",
13
12
  items: {
14
13
  type: "object",
15
- required: ["kind", "source", "deprecated", "props"],
14
+ required: ["kind", "source", "props"],
16
15
  properties: {
17
16
  kind: { enum: ["custom-element", "react-component", "vue-component"] },
18
17
  source: {
@@ -32,7 +31,8 @@ export const manifestJsonSchema = {
32
31
  },
33
32
  export: { type: "string" },
34
33
  tagName: { type: "string" },
35
- deprecated: { oneOf: [{ type: "boolean" }, { type: "string" }] },
34
+ description: { type: "string" },
35
+ lifecycle: { type: "object" },
36
36
  props: { type: "array", items: { type: "object", required: ["name"], properties: { name: { type: "string" } } } },
37
37
  events: { type: "array" },
38
38
  slots: { type: "array" },
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,GAAG,EAAE,mDAAmD;IACxD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC;IAC9D,oBAAoB,EAAE,IAAI;IAC1B,UAAU,EAAE;QACV,aAAa,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;QACjC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;QACzC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE;QACzC,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC;gBACnD,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,CAAC,EAAE;oBACtE,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,QAAQ,EAAE,CAAC,MAAM,CAAC;wBAClB,UAAU,EAAE;4BACV,IAAI,EAAE,E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AM,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;KAC7J;CACO,CAAC"}
package/dist/types.d.ts CHANGED
@@ -2,6 +2,7 @@ export type ComponentKind = "custom-element" | "react-component" | "vue-componen
2
2
  export type ComponentSource = {
3
3
  type: "external";
4
4
  package: string;
5
+ modulePath?: string;
5
6
  } | {
6
7
  type: "local";
7
8
  filePath: string;
@@ -21,31 +22,39 @@ export type ComponentId = {
21
22
  export: string;
22
23
  source: ComponentSource;
23
24
  };
25
+ export type Lifecycle = {
26
+ status: "stable";
27
+ } | {
28
+ status: "deprecated";
29
+ supersededBy?: {
30
+ packageName: string;
31
+ exportName: string;
32
+ };
33
+ deprecationReason?: string;
34
+ };
24
35
  export type ManifestProp = {
25
36
  name: string;
26
37
  type?: string;
27
- deprecated?: boolean | string;
28
38
  default?: string | number | boolean | null;
39
+ values?: string[];
40
+ required?: boolean;
41
+ description?: string;
42
+ lifecycle?: Lifecycle;
29
43
  };
30
44
  export type ManifestEvent = {
31
45
  name: string;
32
- deprecated?: boolean | string;
46
+ payloadType?: string;
47
+ description?: string;
48
+ lifecycle?: Lifecycle;
33
49
  };
34
50
  export type ManifestSlot = {
35
51
  name: string;
36
- };
37
- export type Lifecycle = {
38
- status: "stable";
39
- } | {
40
- status: "deprecated";
41
- supersededBy?: {
42
- packageName: string;
43
- exportName: string;
44
- };
52
+ description?: string;
53
+ lifecycle?: Lifecycle;
45
54
  };
46
55
  type ComponentBase = {
47
56
  source: ComponentSource;
48
- deprecated: boolean | string;
57
+ description?: string;
49
58
  props: ManifestProp[];
50
59
  lifecycle?: Lifecycle;
51
60
  };
@@ -21,4 +21,8 @@ export type OccurrenceVia = {
21
21
  kind: "vue-template";
22
22
  specifier: string;
23
23
  import: string;
24
+ } | {
25
+ kind: "context-provider";
26
+ } | {
27
+ kind: "local-component";
24
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-compass/plugin-core",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",