@component-compass/parser-vue 0.1.14 → 0.1.15

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.
@@ -1,6 +1,18 @@
1
- import type { ResolveLazyManifest } from "@component-compass/plugin-core";
1
+ import type { DiagnosticCollector, ResolveLazyManifest } from "@component-compass/plugin-core";
2
2
  import type { FileBuilder } from "@component-compass/reference-graph";
3
3
  import type { VueParseWrapper } from "./parse-sfc.js";
4
+ /**
5
+ * Vue tag-form enumeration. A script-bound import resolves both via its
6
+ * lowercased exact form (`Card` → `card`) and its PascalCase→kebab form
7
+ * (`VBtn` → `v-btn`). Pre-computed once per import; ported from src/index.ts.
8
+ */
9
+ export declare function vueTagForms(importName: string): string[];
10
+ /** One auto-import manifest entry: the synthetic import to emit for a tag. */
11
+ export type AutoImportComponent = {
12
+ specifier: string;
13
+ imported: string;
14
+ name: string;
15
+ };
4
16
  /**
5
17
  * Options threaded into the parse5-based Vue SFC emitter. Mirrors the legacy
6
18
  * `walkVueTemplate` surface but consumes the reference-graph FileBuilder
@@ -15,13 +27,31 @@ export type EmitVueTemplateOpts = {
15
27
  fileBuilder: FileBuilder;
16
28
  /**
17
29
  * Optional lazy-manifest priming hook. Vue SFCs commonly side-effect-import
18
- * a WC's register entrypoint (`import "@pkg/components/button"`) so its
19
- * template tag references (`<x-button>`) can be resolved later. Calling
20
- * `resolveLazyManifest` for each side-effect source primes the engine's
21
- * tagIndex / CEM lookup pipeline. Optional when undefined the priming
22
- * loop is skipped (acceptable for synthetic test fixtures).
30
+ * a WC's register entrypoint (`import "@pkg/components/button"`), including
31
+ * through re-export barrels the leaf package may sit below the static
32
+ * CemIndex's top-level `node_modules` glob. Calling `resolveLazyManifest`
33
+ * for each side-effect source walks the re-export chain and primes the
34
+ * lazy resolver's shared `byTag` cache, which the reference-graph engine's
35
+ * `tagIndex.externalByTag` consults so template tag references
36
+ * (`<x-button>`) can be resolved later. Optional — when undefined the
37
+ * priming loop is skipped (acceptable for synthetic test fixtures).
23
38
  */
24
39
  resolveLazyManifest?: ResolveLazyManifest;
40
+ /**
41
+ * Optional auto-import lookup (#346). Consulted for template tags with no
42
+ * script binding, BEFORE the hyphenated custom-element lane. A hit emits a
43
+ * synthetic import + JsxUsage — exactly what an explicit script import of
44
+ * the same component would produce — so engine identity/composition
45
+ * behaviour is identical by construction. Keys are parse5's lowercased tag
46
+ * forms (see `vueTagForms`).
47
+ */
48
+ resolveAutoImport?: (tagForm: string) => AutoImportComponent | undefined;
49
+ /**
50
+ * Optional diagnostic sink. Currently emits `unresolved-component-tag` for
51
+ * authored-uppercase tags that miss every resolution lane (#346 — replaces
52
+ * the silent drop).
53
+ */
54
+ collector?: DiagnosticCollector;
25
55
  /**
26
56
  * Optional pre-resolved SFC component symbol. When omitted, emit-template
27
57
  * falls back to the filename stem (e.g. `button` for `button.vue`). The CLI
@@ -10,7 +10,7 @@ import { extractScriptImports } from "./script-imports.js";
10
10
  * lowercased exact form (`Card` → `card`) and its PascalCase→kebab form
11
11
  * (`VBtn` → `v-btn`). Pre-computed once per import; ported from src/index.ts.
12
12
  */
13
- function vueTagForms(importName) {
13
+ export function vueTagForms(importName) {
14
14
  const lowercased = importName.toLowerCase();
15
15
  const kebab = importName
16
16
  .replace(/([A-Za-z0-9])([A-Z])/g, "$1-$2")
@@ -74,6 +74,7 @@ export function emitVueTemplate(opts) {
74
74
  }
75
75
  if (!parts.templateSource)
76
76
  return;
77
+ const templateSource = parts.templateSource;
77
78
  // SFC owner Reference. Every template-emitted usage attributes back to the
78
79
  // SFC's own BindingDecl (declared above). Module-scope, no member chain.
79
80
  // `originFile` is required by `resolveOwnerChain` to look up the owner's
@@ -104,11 +105,16 @@ export function emitVueTemplate(opts) {
104
105
  }
105
106
  }
106
107
  const doc = parseFragment(parts.templateSource, { sourceCodeLocationInfo: true });
108
+ // Per-SFC dedup so a repeated auto-imported tag (`<FooCard>` used twice)
109
+ // emits its synthetic import once, matching how a real script import only
110
+ // appears once regardless of template usage count.
111
+ const syntheticImports = new Set();
107
112
  function visit(node) {
108
113
  let pushed = false;
109
114
  if (isElement(node)) {
110
115
  const rawTag = node.tagName;
111
116
  const scriptSpec = scriptBindings.get(rawTag);
117
+ const auto = scriptSpec ? undefined : opts.resolveAutoImport?.(rawTag);
112
118
  if (scriptSpec) {
113
119
  const loc = node.sourceCodeLocation;
114
120
  const line = (loc?.startLine ?? 1) + lineOffset;
@@ -136,6 +142,36 @@ export function emitVueTemplate(opts) {
136
142
  });
137
143
  pushed = true;
138
144
  }
145
+ else if (auto) {
146
+ const loc = node.sourceCodeLocation;
147
+ const line = (loc?.startLine ?? 1) + lineOffset;
148
+ const column = loc?.startCol ?? 1;
149
+ if (!syntheticImports.has(auto.name)) {
150
+ syntheticImports.add(auto.name);
151
+ // Synthetic import: models the import the auto-import mechanism
152
+ // (e.g. Nuxt) inserts at build time. From here the usage is
153
+ // indistinguishable from an explicitly-imported component.
154
+ opts.fileBuilder.addImport({
155
+ specifier: auto.specifier,
156
+ imported: auto.imported,
157
+ local: auto.name,
158
+ loc: { line, column },
159
+ });
160
+ }
161
+ const { props, events } = readAttrs(node);
162
+ opts.fileBuilder.addJsxUsage({
163
+ ref: { symbol: auto.name, scope: MODULE_SCOPE, memberChain: [], loc: { line, column } },
164
+ loc: { line, column },
165
+ props,
166
+ events,
167
+ });
168
+ opts.fileBuilder.setOwner(sfcOwnerRef, {
169
+ kind: "vue-template",
170
+ specifier: auto.specifier,
171
+ import: auto.imported,
172
+ });
173
+ pushed = true;
174
+ }
139
175
  else if (rawTag.includes("-")) {
140
176
  // Hyphenated tag with no script binding. Vue's auto-import / runtime
141
177
  // global-component convention (e.g. `<x-button>`, Vuetify's `<v-list>`
@@ -156,9 +192,31 @@ export function emitVueTemplate(opts) {
156
192
  opts.fileBuilder.setTagOwner(sfcOwnerRef);
157
193
  pushed = true;
158
194
  }
159
- // Plain HTML (`<div>`, `<span>`) and unknown PascalCase tags fall
160
- // through without emission they're neither tracked components nor
161
- // hyphenated custom elements.
195
+ else if (opts.collector) {
196
+ // parse5 lowercases tag names, so recover the authored spelling from
197
+ // the source: only an authored-uppercase tag is a component miss —
198
+ // lowercase unknowns are just non-standard HTML.
199
+ const off = node.sourceCodeLocation?.startOffset;
200
+ const authored = off !== undefined
201
+ ? /^[A-Z][A-Za-z0-9]*/.exec(templateSource.slice(off + 1))?.[0]
202
+ : undefined;
203
+ if (authored !== undefined) {
204
+ const loc = node.sourceCodeLocation;
205
+ opts.collector.emit({
206
+ code: "unresolved-component-tag",
207
+ severity: "warning",
208
+ filePath: opts.file,
209
+ line: (loc?.startLine ?? 1) + lineOffset,
210
+ column: loc?.startCol ?? 1,
211
+ tagName: authored,
212
+ });
213
+ }
214
+ }
215
+ // Plain HTML (`<div>`, `<span>`) falls through without emission — never
216
+ // tracked, never diagnosed. A component-cased tag that misses every
217
+ // resolution lane above also emits an `unresolved-component-tag`
218
+ // diagnostic when a collector is present (see above), but even then
219
+ // there is no graph emission — the miss is surfaced, not resolved.
162
220
  }
163
221
  // Tracked elements push themselves as the lexical parent for their
164
222
  // children; non-tracked elements (plain HTML, untracked tags) skip the
@@ -1 +1 @@
1
- {"version":3,"file":"emit-template.js","sourceRoot":"","sources":["../src/emit-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAK3D;;;;GAIG;AACH,SAAS,WAAW,CAAC,UAAkB;IACrC,MAAM,UA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ueTemplate } from "./emit-template.js";
2
- export type { EmitVueTemplateOpts } from "./emit-template.js";
1
+ export { emitVueTemplate, vueTagForms } from "./emit-template.js";
2
+ export type { EmitVueTemplateOpts, AutoImportComponent } from "./emit-template.js";
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { emitVueTemplate } from "./emit-template.js";
1
+ export { emitVueTemplate, vueTagForms } from "./emit-template.js";
2
2
  //# 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,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-compass/parser-vue",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Consumer-scan parser for Vue Single-File Components. Detects component usages in .vue files.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,9 +27,9 @@
27
27
  "clean": "rm -rf dist .turbo"
28
28
  },
29
29
  "dependencies": {
30
- "@component-compass/ast-utils": "0.1.11",
31
- "@component-compass/plugin-core": "0.1.11",
32
- "@component-compass/reference-graph": "0.1.14",
30
+ "@component-compass/ast-utils": "0.1.15",
31
+ "@component-compass/plugin-core": "0.1.15",
32
+ "@component-compass/reference-graph": "0.1.15",
33
33
  "@oxc-project/types": "0.130.0",
34
34
  "@vue/compiler-sfc": "3.5.33",
35
35
  "oxc-walker": "1.0.0",