@stencil/unplugin 5.0.0-alpha.27 → 5.0.0-alpha.29

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/docs.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { CustomElementsManifest } from "@stencil/core/compiler";
2
-
3
2
  //#region src/docs.d.ts
4
3
  declare const _default: CustomElementsManifest;
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.mts","names":[],"sources":["../src/docs.ts"],"mappings":";;;cAIqE,QAAA,EAEhD,sBAAsB"}
1
+ {"version":3,"file":"docs.d.mts","names":[],"sources":["../src/docs.ts"],"mappings":";;cAMqB,UAAA"}
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ConfigCompat, CustomElementsManifest, StencilConfig, TranspileOptions } from "@stencil/core/compiler";
2
-
3
2
  //#region src/options.d.ts
4
3
  type TranspileCompatKeys = 'lightDomPatches' | 'lifecycleDOMEvents' | 'initializeNextTick';
5
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/options.ts","../src/plugin.ts","../src/index.ts"],"mappings":";;;KAEK,mBAAA;;AAFuF;;;;AAEpE;KAQZ,mBAAA,GAAsB,IAAA,CAAK,aAAA;EACrC,MAAA,GAAS,IAAA,CAAK,YAAA,EAAc,mBAAA;AAAA;AAAA,UAGb,oBAAA;EAJiB;;;;;EAUhC,gBAAA,GAAmB,IAAA,CACjB,gBAAA;EAX8B;;;;EAmBhC,OAAA;EAlB4B;;AAAmB;EAuB/C,OAAA;EApBmC;;;;;EA2BnC,GAAA;EAqBmC;;;;;;;;;EAVnC,IAAA;EAUmC;AAAA;;;;ACjBrC;;;EDiBE,aAAA,GAAgB,mBAAA;AAAA;;;cCjBL,eAAA;AD7C+E;;;;AAAA,iBCwD5E,aAAA,CAAA,GAAiB,sBAAsB;AAAA,cAkD1C,eAAA,qBAAe,gBAAA,CAAA,oBAAA;;;cCrGf,WAAA,GAAW,OAAA,GAAuB,oBAAvB,oCAAA,UAAA,2BAAA,UAAA;AAAA,cACX,aAAA,GAAa,OAAA,GAAyB,oBAAzB,oCAAA,YAAA,2BAAA,YAAA;AAAA,cACb,cAAA,GAAc,OAAA,GAA0B,oBAAA,iBAA1B,qBAA0B;AAAA,cACxC,cAAA,GAAc,OAAA,GAA0B,oBAA1B,oCAAA,aAAA;AAAA,cACd,aAAA,GAAa,OAAA,GAAyB,oBAAA,iBAAzB,oBAAyB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/options.ts","../src/plugin.ts","../src/index.ts"],"mappings":";;KAEK;;;;;;;KAQO,sBAAsB,KAAK;EACrC,SAAS,KAAK,cAAc;;UAGb;;;;;;EAMf,mBAAmB,KACjB;;;;;EAQF;;;;EAKA;;;;;;EAOA;;;;;;;;;;EAWA;;;;;;;;;EAUA,gBAAgB;;;;cCjBL;;;;;iBAWG,iBAAiB;cA6EpB,oCAAe,iBAAA;;;cChIf,cAAW,UAAX,wDAAW,qCAAA;cACX,gBAAa,UAAb,wDAAa,uCAAA;cACb,iBAAc,UAAd,qCAAc;cACd,iBAAc,UAAd,wDAAc;cACd,gBAAa,UAAb,qCAAa"}
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ import ts from "typescript";
17
17
  * `stencilConfigToOverrides` converts that subset to a `BuildOverrides` object
18
18
  * ready to pass to `transpileSync`.
19
19
  */
20
- const STENCIL_CONFIG_KEYS = new Set([
20
+ const STENCIL_CONFIG_KEYS = /* @__PURE__ */ new Set([
21
21
  "namespace",
22
22
  "srcDir",
23
23
  "outputTargets",
@@ -143,7 +143,8 @@ function resolveStencilCss(specifier, importer) {
143
143
  const [base, query] = specifier.split("?");
144
144
  const absBase = resolve(dirname(importer), base);
145
145
  const ext = extname(absBase);
146
- return `${STENCIL_CSS_PREFIX}${absBase.slice(0, absBase.length - ext.length)}?${query}&__ext=${encodeURIComponent(ext.slice(1))}`;
146
+ const stem = absBase.slice(0, absBase.length - ext.length);
147
+ return `${STENCIL_CSS_PREFIX}${stem}?${query}&__ext=${encodeURIComponent(ext.slice(1))}`;
147
148
  }
148
149
  function isStencilCss(id) {
149
150
  return id.startsWith(STENCIL_CSS_PREFIX);
@@ -290,6 +291,13 @@ function resolveTypesFilePath(specifier, fromDir) {
290
291
  const candidate = base + ext;
291
292
  if (existsSync(candidate)) return candidate;
292
293
  }
294
+ if (base.endsWith(".js")) {
295
+ const stem = base.slice(0, -3);
296
+ for (const ext of [".ts", ".tsx"]) {
297
+ const candidate = stem + ext;
298
+ if (existsSync(candidate)) return candidate;
299
+ }
300
+ }
293
301
  }
294
302
  function getTypesFileEntry(absPath) {
295
303
  const cached = typesFileCache.get(absPath);
@@ -336,21 +344,30 @@ function patchType(original, references, fromDir) {
336
344
  }
337
345
  return result;
338
346
  }
347
+ const hasReferences = (references) => !!references && Object.keys(references).length > 0;
339
348
  /**
340
- * Patches `prop.type` and `event.detail` in-place for any imported types that
341
- * resolved to `"any"` in single-file transpile mode.
349
+ * Patches `prop.type` and `event.detail` in-place for any imported/inherited
350
+ * types that weren't fully resolved by Stencil's compiler.
351
+ *
352
+ * Under-resolved types don't always show up as the literal string `"any"` -
353
+ * a prop inherited from a same-project base class (merged via a single-file
354
+ * mini `ts.Program`, which can't follow cross-file imports) can resolve to
355
+ * the type's own unexpanded name instead (e.g. `"Validator"`), since that's
356
+ * what a TypeScript checker falls back to for a type it can't bind. Either
357
+ * way, a `location: 'import'` reference on the prop means there's something
358
+ * worth trying to expand here.
342
359
  * @param component The CEM docs component to patch
343
360
  * @param componentAbsPath The absolute path to the component's source file (used to resolve relative imports)
344
361
  */
345
362
  function resolveImportedTypes(component, componentAbsPath) {
346
363
  const dir = dirname(componentAbsPath);
347
364
  for (const prop of component.props) {
348
- if (prop.type !== "any" || !prop.complexType?.references) continue;
365
+ if (!prop.complexType || !hasReferences(prop.complexType.references)) continue;
349
366
  const patched = patchType(prop.complexType.original, prop.complexType.references, dir);
350
367
  if (patched !== prop.complexType.original) prop.type = patched;
351
368
  }
352
369
  for (const event of component.events) {
353
- if (event.detail !== "any" || !event.complexType?.references) continue;
370
+ if (!event.complexType || !hasReferences(event.complexType.references)) continue;
354
371
  const patched = patchType(event.complexType.original, event.complexType.references, dir);
355
372
  if (patched !== event.complexType.original) event.detail = patched;
356
373
  }
@@ -461,8 +478,9 @@ function transformStencil(code, id, options, dev = false, framework = "", onBase
461
478
  if (!id.endsWith(".tsx") && !id.endsWith(".ts")) return null;
462
479
  if (id.endsWith(".d.ts")) return null;
463
480
  if (!/(@Component|@Prop|@State|@Event|@Method|@Watch|@Listen)\s*[(\s]/.test(code)) return null;
481
+ const jsxOpts = resolveJsxOpts(code, process.cwd());
464
482
  const result = transpileSync(code, {
465
- ...resolveJsxOpts(code, process.cwd()),
483
+ ...jsxOpts,
466
484
  ...options.transpileOptions,
467
485
  file: id,
468
486
  componentExport: "customelement",
@@ -582,22 +600,42 @@ function getStencilCEM() {
582
600
  return generateManifest({ components: [...docsRegistry.values()] });
583
601
  }
584
602
  /**
585
- * Scan the project for component source files and pre-populate the docs registry.
586
- * @param filter A function to filter which files should be included.
587
- * @returns A promise that resolves when the scan is complete.
603
+ * Recursively collect `.tsx`/`.ts` file paths under `dir`, pruning
604
+ * `node_modules` and hidden directories (`.git`, `.vite`, etc.) as it goes.
605
+ *
606
+ * `readdirSync(dir, { recursive: true })` can't prune during traversal - it
607
+ * walks everything first and only lets the caller filter the flat result
608
+ * afterward, which is disastrous under a symlink-heavy `node_modules` (e.g.
609
+ * pnpm's `.pnpm` store, which flattens every dependency in the workspace) -
610
+ * it can take minutes just to list, blocking `buildStart` the whole time.
611
+ *
612
+ * @param dir the directory to walk
613
+ * @param out accumulator array of absolute file paths, mutated in place
588
614
  */
589
- async function scanDocs(filter) {
590
- const cwd = process.cwd();
615
+ function collectSourceFiles(dir, out) {
591
616
  let entries;
592
617
  try {
593
- entries = readdirSync(cwd, {
594
- recursive: true,
595
- encoding: "utf-8"
596
- });
618
+ entries = readdirSync(dir, { withFileTypes: true });
597
619
  } catch {
598
620
  return;
599
621
  }
600
- const files = entries.filter((rel) => (rel.endsWith(".tsx") || rel.endsWith(".ts")) && !rel.endsWith(".d.ts")).map((rel) => join(cwd, rel)).filter((abs) => filter(abs));
622
+ for (const entry of entries) {
623
+ if (entry.name === "node_modules" || entry.name.startsWith(".")) continue;
624
+ const abs = join(dir, entry.name);
625
+ if (entry.isDirectory()) collectSourceFiles(abs, out);
626
+ else if (entry.isFile() && (abs.endsWith(".tsx") || abs.endsWith(".ts")) && !abs.endsWith(".d.ts")) out.push(abs);
627
+ }
628
+ }
629
+ /**
630
+ * Scan the project for component source files and pre-populate the docs registry.
631
+ * @param filter A function to filter which files should be included.
632
+ * @returns A promise that resolves when the scan is complete.
633
+ */
634
+ async function scanDocs(filter) {
635
+ const cwd = process.cwd();
636
+ const allFiles = [];
637
+ collectSourceFiles(cwd, allFiles);
638
+ const files = allFiles.filter((abs) => filter(abs));
601
639
  await Promise.all(files.map(async (abs) => {
602
640
  let code;
603
641
  try {
@@ -736,7 +774,8 @@ const unpluginStencil = createUnplugin((options = {}, meta) => {
736
774
  let cemChanged = false;
737
775
  try {
738
776
  const prevSnapshot = JSON.stringify(docsRegistry.get(tsxTag));
739
- const result = await transpile(readFileSync(file, "utf-8"), {
777
+ const code = readFileSync(file, "utf-8");
778
+ const result = await transpile(code, {
740
779
  file,
741
780
  componentExport: "customelement"
742
781
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/config.ts","../src/css.ts","../src/resolve-types.ts","../src/transform.ts","../src/plugin.ts","../src/index.ts"],"sourcesContent":["/**\n * Stencil config auto-detection for @stencil/unplugin.\n *\n * Searches for a `stencil.config.ts` (or `.js` variant) in the project root,\n * loads it via jiti (so TypeScript is handled without a separate compile step),\n * and extracts the subset of flags that are meaningful at transpile time.\n *\n * `stencilConfigToOverrides` converts that subset to a `BuildOverrides` object\n * ready to pass to `transpileSync`.\n */\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { BuildOverrides, LightDomPatches } from '@stencil/core/compiler';\n\nimport type { StencilConfigSubset } from './options.js';\n\n// A real Stencil config always has at least one of these keys. Used to\n// distinguish an actual default-exported config from jiti's CJS interop\n// artefact where the module namespace itself lands on `mod.default`.\nconst STENCIL_CONFIG_KEYS = new Set([\n 'namespace',\n 'srcDir',\n 'outputTargets',\n 'plugins',\n 'signalBacking',\n 'compat',\n]);\n\nconst looksLikeConfig = (v: unknown): v is Record<string, unknown> =>\n v !== null &&\n typeof v === 'object' &&\n !Array.isArray(v) &&\n Object.keys(v as object).some((k) => STENCIL_CONFIG_KEYS.has(k));\n\nconst CONFIG_CANDIDATES = [\n 'stencil.config.ts',\n 'stencil.config.mts',\n 'stencil.config.js',\n 'stencil.config.mjs',\n];\n\n/**\n * Attempt to load the project's `stencil.config.ts` and return the\n * transpile-relevant fields. Returns `null` if no config file is found or\n * if loading fails for any reason.\n * @param cwd - project root to search in (usually `process.cwd()`)\n * @returns a subset of the Stencil config, or `null` if none is found\n */\nexport async function loadStencilConfig(cwd: string): Promise<StencilConfigSubset | null> {\n for (const filename of CONFIG_CANDIDATES) {\n const configPath = join(cwd, filename);\n if (!existsSync(configPath)) continue;\n try {\n const { createJiti } = await import('jiti');\n const jiti = createJiti(import.meta.url);\n const mod = (await jiti.import(configPath)) as Record<string, unknown>;\n // Named `config` export is the Stencil convention; fall back to a default\n // export only when it looks like a real config object (has at least one\n // known Stencil key) — otherwise jiti's CJS interop may surface the\n // module namespace object as `default`, which we must not treat as config.\n const raw = mod['config'] ?? (looksLikeConfig(mod['default']) ? mod['default'] : null);\n if (!raw || typeof raw !== 'object') return null;\n return extractSubset(raw as Record<string, unknown>);\n } catch {\n return null;\n }\n }\n return null;\n}\n\nfunction extractSubset(c: Record<string, unknown>): StencilConfigSubset {\n const result: StencilConfigSubset = {};\n if (c['signalBacking'] === true) result.signalBacking = true;\n const compat = c['compat'];\n if (compat && typeof compat === 'object') {\n const co = compat as Record<string, unknown>;\n const ldp = co['lightDomPatches'];\n const lifecycleDOMEvents = co['lifecycleDOMEvents'];\n const initializeNextTick = co['initializeNextTick'];\n if (ldp !== undefined || lifecycleDOMEvents !== undefined || initializeNextTick !== undefined) {\n result.compat = {};\n if (typeof ldp === 'boolean') result.compat.lightDomPatches = ldp;\n else if (ldp && typeof ldp === 'object')\n result.compat.lightDomPatches = ldp as LightDomPatches;\n if (lifecycleDOMEvents === true) result.compat.lifecycleDOMEvents = true;\n if (initializeNextTick === true) result.compat.initializeNextTick = true;\n }\n }\n return result;\n}\n\n/**\n * Convert a {@link StencilConfigSubset} to a {@link BuildOverrides} object.\n * The caller is responsible for merging this with any explicit\n * `transpileOptions.buildOverrides` (which should take precedence).\n * @param config - the Stencil config subset to convert\n * @returns a `BuildOverrides` object suitable for passing to `transpileSync`\n */\nexport function stencilConfigToOverrides(config: StencilConfigSubset): BuildOverrides {\n const o: BuildOverrides = {};\n if (config.signalBacking) {\n o.signalBacking = true;\n o.vdomSignals = true; // signalBacking implies vdomSignals\n }\n\n const compat = config.compat;\n if (!compat) return o;\n if (compat.lifecycleDOMEvents) o.lifecycleDOMEvents = true;\n if (compat.initializeNextTick) o.initializeNextTick = true;\n\n const ldp = compat.lightDomPatches;\n if (ldp === false) {\n // Explicitly disable — standalone runtime defaults all to true.\n o.lightDomPatches = false;\n o.slotChildNodes = false;\n o.slotCloneNode = false;\n o.slotDomMutations = false;\n o.slotTextContent = false;\n } else if (typeof ldp === 'object') {\n // Granular: enable only the named patches; disable the rest (defaults are all-true).\n o.lightDomPatches = true;\n o.slotChildNodes = !!ldp.childNodes;\n o.slotCloneNode = !!ldp.cloneNode;\n o.slotDomMutations = !!ldp.domMutations;\n o.slotTextContent = !!ldp.textContent;\n }\n // ldp === true or undefined: no-op — already the default in the standalone runtime.\n return o;\n}\n","/**\n * CSS pipeline for Stencil component stylesheets.\n *\n * When the Stencil compiler emits a style import such as\n * `./foo.css?tag=my-cmp&encapsulation=shadow`, `resolveStencilCss` rewrites it\n * to a `\\0stencil-css:` virtual module ID. The bundler then calls `load`, which\n * reads the real file and runs it through any installed preprocessors in order:\n * Sass/Less → PostCSS → lightningcss → scoped-selector rewrite (for scoped\n * encapsulation). The result is returned as `export default () => \"…css…\"` so\n * the bundler treats it as a normal JS module dependency.\n *\n * Each preprocessor step is silently skipped if the relevant peer dep is absent.\n */\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, extname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { getScopeId, scopeCss } from '@stencil/core/compiler';\nimport { isPackageExists } from 'local-pkg';\n\n// Matches Stencil's emitted style imports: `./foo.css?tag=my-cmp&…`\nconst STENCIL_CSS_RE = /\\.(?:css|scss|sass|less|styl)\\?[^/]*\\btag=/;\nconst STENCIL_CSS_PREFIX = '\\0stencil-css:';\n\n// Evaluated once at startup — avoids repeated filesystem probes per CSS file.\nconst PKG = {\n sass: isPackageExists('sass'),\n less: isPackageExists('less'),\n postcss: isPackageExists('postcss') && isPackageExists('postcss-load-config'),\n lightningcss: isPackageExists('lightningcss'),\n};\n\n/**\n * Rewrites a Stencil CSS import to a `\\0stencil-css:` virtual module ID.\n * The file extension is stored dotless as `__ext` so Vite's `CSS_LANGS_RE`\n * never matches the virtual ID and tries to own the module itself.\n * @param specifier - the raw import specifier from the component source\n * @param importer - absolute path of the importing file\n * @returns virtual module ID, or `null` for non-Stencil CSS imports\n */\nexport function resolveStencilCss(specifier: string, importer: string): string | null {\n if (!STENCIL_CSS_RE.test(specifier)) return null;\n const [base, query] = specifier.split('?');\n const absBase = resolve(dirname(importer), base);\n const ext = extname(absBase);\n const stem = absBase.slice(0, absBase.length - ext.length);\n return `${STENCIL_CSS_PREFIX}${stem}?${query}&__ext=${encodeURIComponent(ext.slice(1))}`;\n}\n\nexport function isStencilCss(id: string): boolean {\n return id.startsWith(STENCIL_CSS_PREFIX);\n}\n\n/**\n * Extracts the real CSS file path from a `\\0stencil-css:` virtual module ID.\n * @param id - virtual module ID produced by `resolveStencilCss`\n * @returns absolute file path, or `null` if not a Stencil CSS virtual module\n */\nexport function getRealCssPath(id: string): string | null {\n if (!id.startsWith(STENCIL_CSS_PREFIX)) return null;\n const withoutPrefix = id.slice(STENCIL_CSS_PREFIX.length);\n const qIdx = withoutPrefix.indexOf('?');\n const stem = qIdx === -1 ? withoutPrefix : withoutPrefix.slice(0, qIdx);\n const query = qIdx === -1 ? '' : withoutPrefix.slice(qIdx + 1);\n const ext = decodeURIComponent(new URLSearchParams(query).get('__ext') ?? 'css');\n return `${stem}.${ext}`;\n}\n\nasync function compileSass(\n source: string,\n filePath: string,\n indented: boolean,\n): Promise<{ css: string; deps: string[] }> {\n const sass = await import('sass');\n const mainUrl = `file://${filePath}`;\n const result = sass.compileString(source, {\n url: new URL(mainUrl),\n syntax: indented ? 'indented' : 'scss',\n });\n const deps = result.loadedUrls\n .filter((u) => u.protocol === 'file:' && u.href !== mainUrl)\n .map((u) => fileURLToPath(u));\n return { css: result.css, deps };\n}\n\nasync function compileLess(\n source: string,\n filePath: string,\n): Promise<{ css: string; deps: string[] }> {\n const less = await import('less');\n const result = await less.default.render(source, {\n filename: filePath,\n paths: [dirname(filePath)],\n });\n return { css: result.css, deps: result.imports ?? [] };\n}\n\n// Cache PostCSS config per directory to avoid repeated filesystem lookups.\nconst postcssConfigCache = new Map<\n string,\n { plugins: unknown[]; options: Record<string, unknown> } | null\n>();\n\nasync function runPostCss(css: string, filePath: string): Promise<string> {\n const dir = dirname(filePath);\n let config = postcssConfigCache.get(dir);\n\n if (config === undefined) {\n try {\n const { default: loadConfig } = await import('postcss-load-config');\n const loaded = await loadConfig({}, dir);\n config = {\n plugins: loaded.plugins as unknown[],\n options: loaded.options as Record<string, unknown>,\n };\n } catch {\n config = null;\n }\n postcssConfigCache.set(dir, config);\n }\n\n if (!config?.plugins.length) return css;\n\n const { default: postcss } = await import('postcss');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = await postcss(config.plugins as any[]).process(css, {\n ...config.options,\n from: filePath,\n });\n return result.css;\n}\n\nasync function runLightningCss(css: string, filePath: string, minify: boolean): Promise<string> {\n const { transform } = await import('lightningcss');\n const result = transform({\n filename: filePath,\n code: Buffer.from(css),\n minify,\n });\n return result.code.toString();\n}\n\n/**\n * Loads a Stencil CSS virtual module.\n *\n * Processing order:\n * 1. Read raw file\n * 2. Preprocessor: Sass/SCSS (`sass`) or Less (`less`) if installed\n * 3. PostCSS with `postcss.config.*` if `postcss` + `postcss-load-config` are installed\n * 4. lightningcss if installed — syntax lowering, vendor prefixes, minification in prod\n * 5. Scoped selector rewrite for `encapsulation: 'scoped'`\n *\n * Each step is skipped silently if the relevant peer dep is not installed.\n * Returns `export default \"css string\"` so bundlers treat the import as a JS module.\n * @param id - virtual module id produced by `resolveStencilCss`\n * @param isDev - `true` in dev mode (disables minification)\n * @returns ESM string export of the processed CSS, or `null` if not a Stencil CSS virtual module\n */\nexport async function loadStencilCss(\n id: string,\n isDev = true,\n): Promise<{ code: string; deps: string[] } | null> {\n if (!id.startsWith(STENCIL_CSS_PREFIX)) return null;\n\n const withoutPrefix = id.slice(STENCIL_CSS_PREFIX.length);\n const qIdx = withoutPrefix.indexOf('?');\n const stem = qIdx === -1 ? withoutPrefix : withoutPrefix.slice(0, qIdx);\n const query = qIdx === -1 ? '' : withoutPrefix.slice(qIdx + 1);\n const params = new URLSearchParams(query);\n const tag = params.get('tag') ?? '';\n const encapsulation = params.get('encapsulation') ?? 'none';\n const ext = decodeURIComponent(params.get('__ext') ?? 'css');\n const filePath = `${stem}.${ext}`;\n\n if (!existsSync(filePath)) return { code: 'export default () => \"\"', deps: [] };\n\n let css = readFileSync(filePath, 'utf-8');\n let deps: string[] = [];\n\n if (PKG.sass && (ext === 'scss' || ext === 'sass')) {\n const r = await compileSass(css, filePath, ext === 'sass');\n css = r.css;\n deps = r.deps;\n } else if (PKG.less && ext === 'less') {\n const r = await compileLess(css, filePath);\n css = r.css;\n deps = r.deps;\n }\n\n if (PKG.postcss) css = await runPostCss(css, filePath);\n if (PKG.lightningcss) css = await runLightningCss(css, filePath, !isDev);\n\n if (encapsulation === 'scoped' && tag) {\n css = scopeCss(css, getScopeId(tag), false);\n }\n\n return { code: `export default () => ${JSON.stringify(css)};`, deps };\n}\n","/**\n * Resolves imported type references in CEM docs components.\n *\n * `transpileSync` uses a single-file TypeScript host, so imported types (e.g.\n * `ButtonVariant` from `'../types'`) can't be followed — `complexType.resolved`\n * ends up as `\"any\"`. This module creates a minimal ts.Program per referenced\n * types file (cached) and substitutes the actual expanded type text back into\n * the component's doc data before it enters the registry.\n */\nimport { existsSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport ts from 'typescript';\nimport type { ComponentCompilerTypeReferences, JsonDocsComponent } from '@stencil/core/compiler';\n\nconst TYPE_FORMAT_FLAGS =\n ts.TypeFormatFlags.NoTruncation |\n ts.TypeFormatFlags.InTypeAlias |\n ts.TypeFormatFlags.InElementType;\n\ninterface TypesFileEntry {\n checker: ts.TypeChecker;\n exportTypes: Map<string, ts.Type>;\n}\n\nconst typesFileCache = new Map<string, TypesFileEntry>();\n\nfunction resolveTypesFilePath(specifier: string, fromDir: string): string | undefined {\n const base = resolve(fromDir, specifier);\n if (existsSync(base)) return base;\n for (const ext of ['.ts', '.tsx', '.d.ts']) {\n const candidate = base + ext;\n if (existsSync(candidate)) return candidate;\n }\n return undefined;\n}\n\nfunction getTypesFileEntry(absPath: string): TypesFileEntry {\n const cached = typesFileCache.get(absPath);\n if (cached) return cached;\n\n const options: ts.CompilerOptions = {\n ...ts.getDefaultCompilerOptions(),\n noEmit: true,\n module: ts.ModuleKind.ESNext,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n };\n const program = ts.createProgram([absPath], options);\n const checker = program.getTypeChecker();\n const sourceFile = program.getSourceFile(absPath);\n const exportTypes = new Map<string, ts.Type>();\n\n if (sourceFile) {\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n if (moduleSymbol) {\n for (const symbol of checker.getExportsOfModule(moduleSymbol)) {\n exportTypes.set(symbol.name, checker.getDeclaredTypeOfSymbol(symbol));\n }\n }\n }\n\n const entry: TypesFileEntry = { checker, exportTypes };\n typesFileCache.set(absPath, entry);\n return entry;\n}\n\nfunction expandTypeName(\n typeName: string,\n references: ComponentCompilerTypeReferences,\n fromDir: string,\n): string | undefined {\n const ref = references[typeName];\n if (!ref || ref.location !== 'import' || !ref.path) return undefined;\n\n const absPath = resolveTypesFilePath(ref.path, fromDir);\n if (!absPath) return undefined;\n\n const { checker, exportTypes } = getTypesFileEntry(absPath);\n const type = exportTypes.get(typeName);\n if (!type) return undefined;\n\n return checker.typeToString(type, undefined, TYPE_FORMAT_FLAGS);\n}\n\nconst escapeRegExp = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\nfunction patchType(\n original: string,\n references: ComponentCompilerTypeReferences | undefined,\n fromDir: string,\n): string {\n if (!references) return original;\n let result = original;\n for (const typeName of Object.keys(references)) {\n const expanded = expandTypeName(typeName, references, fromDir);\n if (!expanded || expanded === typeName) continue;\n // Wrap in parens when substituting into a potentially larger expression\n // e.g. `ButtonVariant | undefined` → `('sm' | 'md') | undefined`\n result = result.replace(\n new RegExp(`\\\\b${escapeRegExp(typeName)}\\\\b`, 'g'),\n expanded.includes('|') || expanded.includes('&') ? `(${expanded})` : expanded,\n );\n }\n return result;\n}\n\n/**\n * Patches `prop.type` and `event.detail` in-place for any imported types that\n * resolved to `\"any\"` in single-file transpile mode.\n * @param component The CEM docs component to patch\n * @param componentAbsPath The absolute path to the component's source file (used to resolve relative imports)\n */\nexport function resolveImportedTypes(component: JsonDocsComponent, componentAbsPath: string): void {\n const dir = dirname(componentAbsPath);\n\n for (const prop of component.props) {\n if (prop.type !== 'any' || !prop.complexType?.references) continue;\n const patched = patchType(prop.complexType.original, prop.complexType.references, dir);\n if (patched !== prop.complexType.original) prop.type = patched;\n }\n\n for (const event of component.events) {\n if (event.detail !== 'any' || !event.complexType?.references) continue;\n const patched = patchType(event.complexType.original, event.complexType.references, dir);\n if (patched !== event.complexType.original) event.detail = patched;\n }\n}\n","/**\n * Component transpilation and base-class discovery.\n *\n * `transformStencil` is the main entry point: it calls `transpileSync` with\n * `componentExport: 'customelement'` so each component self-registers when\n * imported. Two code paths come out:\n *\n * - **Component** (`@Component` present): full customelement output with\n * `defineCustomElement`, optional HMR snippet appended in dev mode.\n * - **Decorated base class** (`@Prop`/`@State`/etc. but no `@Component`):\n * returned as-is — the compiler's `isStencilBaseClass` check already injects\n * `extends HTMLElement` via `updateNativeBaseClass`.\n *\n * `makeResolver` supplies the `resolveImport` callback that `transpileSync`\n * uses during metadata collection. It serves two purposes at once: returning\n * raw source so the compiler can merge inherited props/states into the\n * component's metadata, and calling `onBaseClass` so the plugin can\n * pre-transform and cache the file before the bundler's resolveId hook fires.\n */\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { cmpMetaToDocsComponent, transpileSync } from '@stencil/core/compiler';\nimport type { BuildOverrides, JsonDocsComponent } from '@stencil/core/compiler';\nimport type { SupportedFramework } from 'unplugin';\n\nimport type { StencilPluginOptions } from './options.js';\n\nconst SOURCE_EXTS = ['.tsx', '.ts', '.js'];\n\n// TypeScript JsxEmit enum values — stable across TS versions.\nconst JSX_EMIT: Record<string, number> = {\n react: 2,\n 'react-jsx': 4,\n 'react-jsxdev': 5,\n preserve: 1,\n 'react-native': 3,\n};\n\ntype JsxOpts = { jsx?: number; jsxImportSource?: string };\n\nlet cachedTsConfigJsx: JsxOpts | undefined;\n\nfunction readJsxOptsFromTsConfig(cwd: string): JsxOpts {\n if (cachedTsConfigJsx !== undefined) return cachedTsConfigJsx;\n const tsconfigPath = join(cwd, 'tsconfig.json');\n if (!existsSync(tsconfigPath)) return (cachedTsConfigJsx = {});\n try {\n const raw = readFileSync(tsconfigPath, 'utf-8');\n const stripped = raw.replace(/\\/\\/[^\\n]*/g, '').replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n const tsconfig = JSON.parse(stripped);\n const co = tsconfig?.compilerOptions ?? {};\n const jsxStr: string | undefined = co.jsx?.toLowerCase();\n if (jsxStr && jsxStr in JSX_EMIT) {\n return (cachedTsConfigJsx = {\n jsx: JSX_EMIT[jsxStr],\n jsxImportSource: co.jsxImportSource,\n });\n }\n } catch {\n // ignore unreadable / malformed tsconfig\n }\n return (cachedTsConfigJsx = {});\n}\n\n// Detects classic JSX mode: `import { …, h, … } from '@stencil/core'`\nconst IMPORTS_H_RE = /import\\s+\\{[^}]*\\bh\\b[^}]*\\}\\s+from\\s+['\"]@stencil\\/core['\"]/;\n\n/* Resolve jsx/jsxImportSource for transpileSync.\n * Priority: tsconfig.json > source heuristic (h import → classic; otherwise automatic runtime). */\nfunction resolveJsxOpts(code: string, cwd: string): JsxOpts {\n const fromTsConfig = readJsxOptsFromTsConfig(cwd);\n if (fromTsConfig.jsx !== undefined) return fromTsConfig;\n if (IMPORTS_H_RE.test(code)) {\n return { jsx: JSX_EMIT['react'] }; // jsxFactory: 'h' auto-applied by transpile-module\n }\n return { jsx: JSX_EMIT['react-jsx'], jsxImportSource: '@stencil/core' };\n}\n\n/**\n * Resolve an import specifier to an absolute path, trying source extensions\n * and the TypeScript ESM `.js` → `.ts`/`.tsx` remap.\n * @param specifier - the import specifier (relative or extensionless)\n * @param importer - absolute path of the importing file\n * @returns absolute path to the resolved file, or `null` if nothing found on disk\n */\nexport function resolveSpecifier(specifier: string, importer: string): string | null {\n const base = resolve(dirname(importer), specifier);\n // Vite normalizes module IDs to forward slashes; we must match that so\n // virtual-module keys stay consistent on Windows.\n const norm = (p: string) => p.replace(/\\\\/g, '/');\n\n if (existsSync(base)) return norm(base);\n\n for (const ext of SOURCE_EXTS) {\n const candidate = base + ext;\n if (existsSync(candidate)) return norm(candidate);\n }\n\n // TypeScript ESM: `./foo.js` may physically be `./foo.ts` or `./foo.tsx`\n if (base.endsWith('.js')) {\n const stem = base.slice(0, -3);\n for (const ext of ['.ts', '.tsx']) {\n const candidate = stem + ext;\n if (existsSync(candidate)) return norm(candidate);\n }\n }\n\n return null;\n}\n\n/**\n * Transpile a `.tsx`/`.ts` file for use in a bundler.\n *\n * Returns `{ code, map, tagName }` for Stencil component or base-class files,\n * `null` for everything else (plain TS utilities, non-TS files, etc.).\n * `tagName` is empty string for base classes with no `@Component`.\n *\n * `onBaseClass` is called for every file the compiler resolves via\n * `resolveImport` during metadata collection. The plugin uses this to\n * pre-transform those files before the bundler's resolveId hook fires.\n * @param code - source file contents\n * @param id - absolute file path\n * @param options - plugin options\n * @param dev - `true` in dev/watch mode (enables HMR snippet)\n * @param framework - active unplugin framework\n * @param onBaseClass - called for each file in the inheritance chain with its abs path and raw source\n * @param configOverrides - pass stencil config option overrides to the transpiler\n * @returns transformed output, or `null` if the file is not a Stencil file\n */\nexport function transformStencil(\n code: string,\n id: string,\n options: StencilPluginOptions,\n dev = false,\n framework: SupportedFramework | '' = '',\n onBaseClass?: (absPath: string, rawCode: string) => void,\n configOverrides?: BuildOverrides,\n): {\n code: string;\n map: string | null;\n tagName: string;\n docsComponent: JsonDocsComponent | null;\n} | null {\n if (!id.endsWith('.tsx') && !id.endsWith('.ts')) return null;\n if (id.endsWith('.d.ts')) return null;\n\n // Cheap regex guard — avoids paying transpileSync cost for plain TS files.\n if (!/(@Component|@Prop|@State|@Event|@Method|@Watch|@Listen)\\s*[(\\s]/.test(code)) return null;\n\n const jsxOpts = resolveJsxOpts(code, process.cwd());\n const result = transpileSync(code, {\n ...jsxOpts,\n ...options.transpileOptions,\n file: id,\n componentExport: 'customelement',\n styleImportData: 'queryparams',\n resolveImport: makeResolver(onBaseClass),\n buildOverrides: {\n ...configOverrides,\n ...options.transpileOptions?.buildOverrides,\n ...(dev ? { hotModuleReplacement: true, isDev: true } : {}),\n },\n });\n\n if (result.diagnostics.some((d) => d.level === 'error')) {\n const msgs = result.diagnostics\n .filter((d) => d.level === 'error')\n .map((d) => d.messageText)\n .join('\\n');\n throw new Error(`[@stencil/unplugin] transpile error in ${id}:\\n${msgs}`);\n }\n\n if (!result.data?.length) {\n // No @Component — this is a base class or mixin factory. Return the\n // compiled output; for decorated classes the compiler's isStencilBaseClass\n // check already injected `extends HTMLElement`. Plain classes without\n // decorators are handled via the baseClassRegistry virtual-module path.\n if (!/@Component\\s*[(\\s]/.test(code)) {\n return { code: result.code, map: result.map ?? null, tagName: '', docsComponent: null };\n }\n return null;\n }\n\n const tagName = result.data[0].tagName;\n const className = result.data[0].componentClassName;\n\n // customelement mode strips the export keyword, so re-export the class\n // ourselves — consumers import it by name, and\n // hmrStandalone needs it in the re-imported module in dev mode\n const namedExport = `\\nexport{${className}};`;\n const out = dev\n ? result.code + namedExport + buildHmrSnippet(tagName, className, framework)\n : result.code + namedExport;\n\n const docsComponent = cmpMetaToDocsComponent(result.data[0], id);\n\n return { code: out, map: result.map ?? null, tagName, docsComponent };\n}\n\n/**\n * Transpile a base-class file with `transformAsBaseClass: true` so the\n * compiler injects `extends HTMLElement` into any class without an existing\n * heritage clause, regardless of whether it carries Stencil decorators.\n *\n * The result is cached in `baseClassRegistry` (in plugin.ts) and served as a\n * virtual module, ensuring the bundler always sees the injected version even\n * for plain lifecycle-only classes that the `transform` hook would otherwise skip.\n * @param rawCode - raw source of the base-class file\n * @param absPath - absolute path to the file (used as `file` for source maps)\n * @param options - plugin options forwarded to `transpileSync`\n * @returns compiled JS output\n */\nexport function transpileBaseClass(\n rawCode: string,\n absPath: string,\n options: StencilPluginOptions,\n): string {\n const result = transpileSync(rawCode, {\n ...options.transpileOptions,\n file: absPath,\n componentExport: 'customelement',\n styleImportData: 'queryparams',\n transformAsBaseClass: true,\n });\n return result.code;\n}\n\n/* Builds the HMR client snippet appended to component output in dev mode.\n *\n * Two strategies depending on bundler:\n * - Vite / Farm: server sends a `stencil:hmr` WebSocket event via\n * `handleHotUpdate`; the client calls `el['s-hmr'](version)` which triggers\n * a cache-busted re-import and forced re-render.\n * - webpack / rspack / bun: use the `module.hot` re-execution pattern —\n * `dispose` marks the reload with a flag, `accept` re-runs the module, and\n * the new prototype is patched onto existing instances in-place. */\nfunction buildHmrSnippet(\n tagName: string,\n className: string,\n framework: SupportedFramework | '',\n): string {\n const tag = JSON.stringify(tagName);\n\n if (framework === 'webpack' || framework === 'rspack' || framework === 'bun') {\n const hotExpr =\n framework === 'bun'\n ? 'import.meta.hot'\n : \"(typeof module !== 'undefined' && module.hot) || import.meta.webpackHot\";\n\n return (\n `\\n${className}.__stencil_module__ = import.meta.url;` +\n `\\nvar _sHot = ${hotExpr};` +\n `\\nif (_sHot) {` +\n `\\n if (_sHot.data && _sHot.data.stencilHmr) {` +\n `\\n var _sCtor = customElements.get(${tag});` +\n `\\n if (_sCtor) Object.getOwnPropertyNames(${className}.prototype).forEach(function(k) {` +\n `\\n if (k !== 'constructor') Object.defineProperty(_sCtor.prototype, k, Object.getOwnPropertyDescriptor(${className}.prototype, k));` +\n `\\n });` +\n `\\n document.querySelectorAll(${tag}).forEach(function(el) { el.connectedCallback && el.connectedCallback(); });` +\n `\\n }` +\n `\\n _sHot.dispose(function(data) { data.stencilHmr = true; });` +\n `\\n _sHot.accept();` +\n `\\n}`\n );\n }\n\n // Vite and Farm both implement the Vite HMR API.\n // The s-hmr guard prevents ?s-hmr= re-imports from stacking up additional listeners.\n return (\n `\\n${className}.__stencil_module__ = import.meta.url;` +\n `\\nif (import.meta.hot && !import.meta.url.includes('s-hmr=')) {` +\n `\\n import.meta.hot.accept(() => {});` +\n `\\n import.meta.hot.on('stencil:hmr', function({ tagName }) {` +\n `\\n if (tagName === ${tag}) {` +\n `\\n var v = Date.now().toString(36);` +\n `\\n document.querySelectorAll(${tag}).forEach(function(el) { el['s-hmr'] && el['s-hmr'](v); });` +\n `\\n }` +\n `\\n });` +\n `\\n}`\n );\n}\n\n/* Builds the `resolveImport` callback for `transpileSync`.\n *\n * The compiler calls this for every import it encounters while walking the\n * inheritance chain during metadata collection. The callback returns the raw\n * source so the compiler can merge inherited props/states/events into the\n * component's metadata. As a side-effect it calls `onBaseClass` with the same\n * raw source, giving the plugin a chance to pre-transform and cache the file\n * before the bundler's resolveId hook fires for it. */\nfunction makeResolver(onBaseClass?: (absPath: string, rawCode: string) => void) {\n return (specifier: string, currentImporter: string): { code: string; path: string } | null => {\n const absPath = resolveSpecifier(specifier, currentImporter);\n if (!absPath) return null;\n\n const code = readFileSync(absPath, 'utf-8');\n onBaseClass?.(absPath, code);\n return { code, path: absPath };\n };\n}\n","/**\n * Unplugin factory for @stencil/unplugin.\n *\n * Wires together four concerns into a single plugin that works across Vite,\n * Rollup, webpack, rspack, and bun:\n *\n * 1. **Component transform** - `transform` drives `transpileSync` on every\n * `.tsx`/`.ts` file that carries Stencil decorators, producing\n * `customelement` output (self-registering class + `defineCustomElement`).\n *\n * 2. **CSS virtual modules** - Stencil emits `./foo.css?tag=my-cmp&…`\n * imports. `resolveId` rewrites these to `\\0stencil-css:` virtual IDs;\n * `load` reads the real file, runs it through any installed preprocessors,\n * and returns `export default () => \"…css…\"`.\n *\n * 3. **Base-class inheritance** - when a component extends a class that does\n * not itself extend `HTMLElement`, the custom-element registration breaks.\n * The plugin intercepts every file the compiler resolves via `resolveImport`\n * (during `transpileSync`), pre-transforms it with `transformAsBaseClass: true`\n * so it gets `extends HTMLElement`, and caches the result. `resolveId` then\n * redirects imports of those files to `\\0stencil-base:` virtual modules so\n * the bundler always sees the injected version - regardless of module-graph\n * processing order.\n *\n * 4. **HMR** - Vite receives a custom `stencil:hmr` WebSocket event when a\n * component file changes; other bundlers use the `module.hot` re-execution\n * pattern. CSS changes are covered automatically by `addWatchFile`.\n */\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createFilter } from '@rollup/pluginutils';\nimport { transpile, cmpMetaToDocsComponent, generateManifest } from '@stencil/core/compiler';\nimport { createUnplugin } from 'unplugin';\nimport type {\n BuildOverrides,\n CustomElementsManifest,\n JsonDocsComponent,\n} from '@stencil/core/compiler';\n\nimport { loadStencilConfig, stencilConfigToOverrides } from './config.js';\nimport { getRealCssPath, isStencilCss, loadStencilCss, resolveStencilCss } from './css.js';\nimport { resolveImportedTypes } from './resolve-types.js';\nimport { resolveSpecifier, transformStencil, transpileBaseClass } from './transform.js';\nimport type { StencilPluginOptions } from './options.js';\n\nexport const STENCIL_DOCS_ID = '@stencil/unplugin/docs';\nconst VIRTUAL_DOCS_PREFIX = '\\0stencil-docs:';\n\n// Module-level registry so getStencilDocs() is callable from outside the plugin\n// (e.g. from a Storybook preset running in Node.js).\nconst docsRegistry = new Map<string, JsonDocsComponent>();\n\n/**\n * Returns the current CEM. Only populated when `docs: true` is set.\n * @returns the current CEM, or an empty CEM if `docs: true` was not set.\n */\nexport function getStencilCEM(): CustomElementsManifest {\n return generateManifest({ components: [...docsRegistry.values()] });\n}\n\n/**\n * Scan the project for component source files and pre-populate the docs registry.\n * @param filter A function to filter which files should be included.\n * @returns A promise that resolves when the scan is complete.\n */\nasync function scanDocs(filter: (id: string) => boolean): Promise<void> {\n const cwd = process.cwd();\n let entries: string[];\n try {\n entries = readdirSync(cwd, { recursive: true, encoding: 'utf-8' }) as string[];\n } catch {\n return;\n }\n\n const files = entries\n .filter((rel) => (rel.endsWith('.tsx') || rel.endsWith('.ts')) && !rel.endsWith('.d.ts'))\n .map((rel) => join(cwd, rel))\n .filter((abs) => filter(abs));\n\n await Promise.all(\n files.map(async (abs) => {\n let code: string;\n try {\n code = readFileSync(abs, 'utf-8');\n } catch {\n return;\n }\n if (!/(@Component|@Prop|@State|@Event|@Method|@Watch|@Listen)\\s*[(\\s]/.test(code)) return;\n const result = await transpile(code, { file: abs, componentExport: 'customelement' });\n for (const item of result.data ?? []) {\n if (!item.tagName) continue;\n const component = cmpMetaToDocsComponent(item, abs);\n resolveImportedTypes(component, abs);\n docsRegistry.set(item.tagName, component);\n }\n }),\n );\n}\n\n// Null-byte prefix marks a virtual module - Rollup/Vite convention that\n// prevents the ID from being treated as a real filesystem path.\nconst VIRTUAL_BASE_PREFIX = '\\0stencil-base:';\n\n// Mirrors the compiler's hasSignalsImport check in static-to-meta/import.ts.\nconst SIGNALS_IMPORT_RE = /from\\s+['\"]@stencil\\/core\\/signals['\"]/;\n\nexport const unpluginStencil = createUnplugin(\n (options: StencilPluginOptions | undefined = {}, meta) => {\n const { framework } = meta;\n const filter = createFilter(\n options.include ?? [/\\.tsx?$/],\n options.exclude ?? ['node_modules/**'],\n );\n\n // Vite auto-detects dev mode via configResolved; other bundlers use options.dev.\n let isDev = options.dev ?? false;\n\n // For Vite, configResolved sets this to config.root (more accurate than process.cwd()).\n // For other bundlers, process.cwd() is the fallback.\n let projectRoot = process.cwd();\n\n // Merged BUILD overrides from auto-detected stencil.config + explicit stencilConfig.\n // Populated in buildStart; explicit transpileOptions.buildOverrides takes precedence\n // over this in transformStencil.\n let configOverrides: BuildOverrides = {};\n\n // Tracks which source file owns which custom-element tag name, used by the\n // Vite HMR handler to send targeted `stencil:hmr` events.\n const fileToTagName = new Map<string, string>();\n\n // Maps CSS file paths → tag names that use them. A shared CSS file can be\n // used by multiple components, so this is a Set per file path.\n const cssFileToTagNames = new Map<string, Set<string>>();\n\n // Maps real CSS file path → virtual CSS module IDs (\\0stencil-css:...).\n // Multiple components may share the same CSS file, each with their own\n // virtual module ID (different tag/encapsulation query params).\n const cssRealToVirtualIds = new Map<string, Set<string>>();\n\n function trackCssFile(realPath: string, tag: string, virtualId: string) {\n if (!cssFileToTagNames.has(realPath)) cssFileToTagNames.set(realPath, new Set());\n cssFileToTagNames.get(realPath)!.add(tag);\n if (!cssRealToVirtualIds.has(realPath)) cssRealToVirtualIds.set(realPath, new Set());\n cssRealToVirtualIds.get(realPath)!.add(virtualId);\n }\n\n // absPath → HTMLElement-injected JS. Populated during `transform` when\n // `transpileSync`'s resolveImport callback discovers a base-class file.\n // Rollup guarantees that resolveId for imports in a module's *output* fires\n // after the transform that produced them - so by the time the bundler asks\n // to resolve a base-class import, this map is already populated.\n const baseClassRegistry = new Map<string, string>();\n\n function registerBaseClass(absPath: string, rawCode: string) {\n if (baseClassRegistry.has(absPath)) return; // already processed this build\n baseClassRegistry.set(absPath, transpileBaseClass(rawCode, absPath, options));\n }\n\n return {\n name: '@stencil/unplugin',\n\n async buildStart() {\n const detected = await loadStencilConfig(projectRoot);\n // Merge: auto-detected config is the base; explicit stencilConfig overrides field-by-field.\n const merged = detected\n ? {\n ...detected,\n ...options.stencilConfig,\n compat: { ...detected.compat, ...options.stencilConfig?.compat },\n }\n : (options.stencilConfig ?? {});\n configOverrides = stencilConfigToOverrides(merged);\n if (options.docs) await scanDocs(filter);\n },\n\n resolveId(id, importer) {\n if (id === STENCIL_DOCS_ID) return VIRTUAL_DOCS_PREFIX;\n if (!importer) return null;\n\n const css = resolveStencilCss(id, importer);\n if (css) return css;\n\n if (baseClassRegistry.size > 0) {\n // Imports inside a virtual base-class module use the virtual ID as\n // importer - strip the prefix so resolveSpecifier works against the\n // real path on disk. This matters for multi-level inheritance chains.\n\n const realImporter = importer.startsWith(VIRTUAL_BASE_PREFIX)\n ? importer.slice(VIRTUAL_BASE_PREFIX.length)\n : importer;\n\n const abs = resolveSpecifier(id, realImporter);\n if (abs && baseClassRegistry.has(abs)) {\n return VIRTUAL_BASE_PREFIX + abs;\n }\n }\n\n return null;\n },\n\n transformInclude(id) {\n return filter(id.split('?')[0]);\n },\n\n transform(code, id) {\n const cleanId = id.split('?')[0];\n if (!configOverrides.vdomSignals && SIGNALS_IMPORT_RE.test(code)) {\n configOverrides = { ...configOverrides, vdomSignals: true };\n }\n const result = transformStencil(\n code,\n cleanId,\n options,\n isDev,\n framework,\n registerBaseClass,\n configOverrides,\n );\n if (result?.tagName) fileToTagName.set(cleanId, result.tagName);\n if (result?.docsComponent && options.docs) {\n resolveImportedTypes(result.docsComponent, cleanId);\n docsRegistry.set(result.docsComponent.tag, result.docsComponent);\n }\n return result;\n },\n\n loadInclude(id) {\n return id === VIRTUAL_DOCS_PREFIX || isStencilCss(id) || id.startsWith(VIRTUAL_BASE_PREFIX);\n },\n\n async load(id) {\n if (id === VIRTUAL_DOCS_PREFIX) {\n return `export default ${JSON.stringify(getStencilCEM())}`;\n }\n if (id.startsWith(VIRTUAL_BASE_PREFIX)) {\n const realPath = id.slice(VIRTUAL_BASE_PREFIX.length);\n this.addWatchFile(realPath); // re-invalidate this virtual module when the source changes\n return { code: baseClassRegistry.get(realPath) ?? '', map: null };\n }\n const realPath = getRealCssPath(id);\n const qIdx = id.indexOf('?');\n const tag = qIdx !== -1 ? new URLSearchParams(id.slice(qIdx + 1)).get('tag') : null;\n if (realPath) {\n this.addWatchFile(realPath);\n if (tag) trackCssFile(realPath, tag, id);\n }\n const cssResult = await loadStencilCss(id, isDev);\n if (cssResult) {\n if (tag) {\n for (const dep of cssResult.deps) {\n this.addWatchFile(dep);\n trackCssFile(dep, tag, id);\n }\n }\n return { code: cssResult.code, map: null };\n }\n return null;\n },\n\n vite: {\n // Must run before Vite/rolldown's built-in TSX transform, which would\n // otherwise claim the file and emit react/jsx-dev-runtime imports.\n enforce: 'pre' as const,\n\n configResolved(config: { command: string; root: string }) {\n isDev = options.dev ?? config.command === 'serve';\n projectRoot = config.root;\n },\n\n async handleHotUpdate({\n file,\n server,\n }: {\n file: string;\n server: {\n ws: { send: (msg: unknown) => void };\n moduleGraph: {\n invalidateModule(\n mod: unknown,\n seen?: Set<unknown>,\n timestamp?: number,\n isHmr?: boolean,\n ): void;\n getModuleById?(id: string): unknown;\n idToModuleMap?: Map<string, unknown>;\n };\n };\n }) {\n // Collect all tag names affected by this file change\n const tsxTag = fileToTagName.get(file);\n const cssTagNames = cssFileToTagNames.get(file);\n const tagNames = new Set<string>(cssTagNames);\n if (tsxTag) tagNames.add(tsxTag);\n if (tagNames.size === 0) return;\n\n // Invalidate every virtual CSS module that depends on this file so\n // Vite adds ?t=timestamp when re-serving the TSX - busts browser cache.\n const virtualIds = cssRealToVirtualIds.get(file);\n if (virtualIds) {\n for (const virtualId of virtualIds) {\n const virtualMod =\n server.moduleGraph.getModuleById?.(virtualId) ??\n server.moduleGraph.idToModuleMap?.get(virtualId);\n if (virtualMod)\n server.moduleGraph.invalidateModule(virtualMod, new Set(), Date.now(), true);\n }\n }\n // Update the docs registry and notify the client only when the CEM\n // actually changed (new/renamed prop, type update, JSDoc edit, etc.).\n // Pure implementation changes leave the CEM identical and fall through\n // to normal stencil:hmr so HMR is not disrupted.\n if (options.docs && tsxTag) {\n let cemChanged = false;\n try {\n const prevSnapshot = JSON.stringify(docsRegistry.get(tsxTag));\n const code = readFileSync(file, 'utf-8');\n const result = await transpile(code, { file, componentExport: 'customelement' });\n for (const item of result.data ?? []) {\n if (!item.tagName) continue;\n const component = cmpMetaToDocsComponent(item, file);\n resolveImportedTypes(component, file);\n docsRegistry.set(item.tagName, component);\n }\n cemChanged = JSON.stringify(docsRegistry.get(tsxTag)) !== prevSnapshot;\n } catch {\n // stale docs are acceptable on transpile error\n }\n if (cemChanged) {\n const docsVirtualMod =\n server.moduleGraph.getModuleById?.(VIRTUAL_DOCS_PREFIX) ??\n server.moduleGraph.idToModuleMap?.get(VIRTUAL_DOCS_PREFIX);\n if (docsVirtualMod)\n server.moduleGraph.invalidateModule(docsVirtualMod, new Set(), Date.now(), true);\n server.ws.send({ type: 'custom', event: 'stencil:docs-update' });\n }\n }\n for (const tagName of tagNames) {\n server.ws.send({ type: 'custom', event: 'stencil:hmr', data: { tagName } });\n }\n return [];\n },\n },\n };\n },\n);\n","export { unpluginStencil, getStencilCEM, STENCIL_DOCS_ID } from './plugin.js';\nexport type { StencilPluginOptions } from './options.js';\n\nimport { unpluginStencil } from './plugin.js';\n\nexport const stencilVite = unpluginStencil.vite;\nexport const stencilRollup = unpluginStencil.rollup;\nexport const stencilWebpack = unpluginStencil.webpack;\nexport const stencilEsbuild = unpluginStencil.esbuild;\nexport const stencilRspack = unpluginStencil.rspack;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,sBAAsB,IAAI,IAAI;CAClC;CAC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,QAAQ,CAAC,GAAG;OACpC,IAAI,CAAC,KAAK,SAAS;OACnB,MAAM,YAAY,uBAAuB,MAAM,IAAI;OACnD,qBAAqB,WAAW,IAAI;OACpC,aAAa,IAAI,KAAK,SAAS,SAAS;MAC1C;MACA,aAAa,KAAK,UAAU,aAAa,IAAI,MAAM,CAAC,MAAM;KAC5D,QAAQ,CAER;KACA,IAAI,YAAY;MACd,MAAM,iBACJ,OAAO,YAAY,gBAAgB,mBAAmB,KACtD,OAAO,YAAY,eAAe,IAAI,mBAAmB;MAC3D,IAAI,gBACF,OAAO,YAAY,iBAAiB,gCAAgB,IAAI,IAAI,GAAG,KAAK,IAAI,GAAG,IAAI;MACjF,OAAO,GAAG,KAAK;OAAE,MAAM;OAAU,OAAO;MAAsB,CAAC;KACjE;IACF;IACA,KAAK,MAAM,WAAW,UACpB,OAAO,GAAG,KAAK;KAAE,MAAM;KAAU,OAAO;KAAe,MAAM,EAAE,QAAQ;IAAE,CAAC;IAE5E,OAAO,CAAC;GACV;EACF;CACF;AACF,CACF;;;ACnVA,MAAa,cAAc,gBAAgB;AAC3C,MAAa,gBAAgB,gBAAgB;AAC7C,MAAa,iBAAiB,gBAAgB;AAC9C,MAAa,iBAAiB,gBAAgB;AAC9C,MAAa,gBAAgB,gBAAgB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/config.ts","../src/css.ts","../src/resolve-types.ts","../src/transform.ts","../src/plugin.ts","../src/index.ts"],"sourcesContent":["/**\n * Stencil config auto-detection for @stencil/unplugin.\n *\n * Searches for a `stencil.config.ts` (or `.js` variant) in the project root,\n * loads it via jiti (so TypeScript is handled without a separate compile step),\n * and extracts the subset of flags that are meaningful at transpile time.\n *\n * `stencilConfigToOverrides` converts that subset to a `BuildOverrides` object\n * ready to pass to `transpileSync`.\n */\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport type { BuildOverrides, LightDomPatches } from '@stencil/core/compiler';\n\nimport type { StencilConfigSubset } from './options.js';\n\n// A real Stencil config always has at least one of these keys. Used to\n// distinguish an actual default-exported config from jiti's CJS interop\n// artefact where the module namespace itself lands on `mod.default`.\nconst STENCIL_CONFIG_KEYS = new Set([\n 'namespace',\n 'srcDir',\n 'outputTargets',\n 'plugins',\n 'signalBacking',\n 'compat',\n]);\n\nconst looksLikeConfig = (v: unknown): v is Record<string, unknown> =>\n v !== null &&\n typeof v === 'object' &&\n !Array.isArray(v) &&\n Object.keys(v as object).some((k) => STENCIL_CONFIG_KEYS.has(k));\n\nconst CONFIG_CANDIDATES = [\n 'stencil.config.ts',\n 'stencil.config.mts',\n 'stencil.config.js',\n 'stencil.config.mjs',\n];\n\n/**\n * Attempt to load the project's `stencil.config.ts` and return the\n * transpile-relevant fields. Returns `null` if no config file is found or\n * if loading fails for any reason.\n * @param cwd - project root to search in (usually `process.cwd()`)\n * @returns a subset of the Stencil config, or `null` if none is found\n */\nexport async function loadStencilConfig(cwd: string): Promise<StencilConfigSubset | null> {\n for (const filename of CONFIG_CANDIDATES) {\n const configPath = join(cwd, filename);\n if (!existsSync(configPath)) continue;\n try {\n const { createJiti } = await import('jiti');\n const jiti = createJiti(import.meta.url);\n const mod = (await jiti.import(configPath)) as Record<string, unknown>;\n // Named `config` export is the Stencil convention; fall back to a default\n // export only when it looks like a real config object (has at least one\n // known Stencil key) — otherwise jiti's CJS interop may surface the\n // module namespace object as `default`, which we must not treat as config.\n const raw = mod['config'] ?? (looksLikeConfig(mod['default']) ? mod['default'] : null);\n if (!raw || typeof raw !== 'object') return null;\n return extractSubset(raw as Record<string, unknown>);\n } catch {\n return null;\n }\n }\n return null;\n}\n\nfunction extractSubset(c: Record<string, unknown>): StencilConfigSubset {\n const result: StencilConfigSubset = {};\n if (c['signalBacking'] === true) result.signalBacking = true;\n const compat = c['compat'];\n if (compat && typeof compat === 'object') {\n const co = compat as Record<string, unknown>;\n const ldp = co['lightDomPatches'];\n const lifecycleDOMEvents = co['lifecycleDOMEvents'];\n const initializeNextTick = co['initializeNextTick'];\n if (ldp !== undefined || lifecycleDOMEvents !== undefined || initializeNextTick !== undefined) {\n result.compat = {};\n if (typeof ldp === 'boolean') result.compat.lightDomPatches = ldp;\n else if (ldp && typeof ldp === 'object')\n result.compat.lightDomPatches = ldp as LightDomPatches;\n if (lifecycleDOMEvents === true) result.compat.lifecycleDOMEvents = true;\n if (initializeNextTick === true) result.compat.initializeNextTick = true;\n }\n }\n return result;\n}\n\n/**\n * Convert a {@link StencilConfigSubset} to a {@link BuildOverrides} object.\n * The caller is responsible for merging this with any explicit\n * `transpileOptions.buildOverrides` (which should take precedence).\n * @param config - the Stencil config subset to convert\n * @returns a `BuildOverrides` object suitable for passing to `transpileSync`\n */\nexport function stencilConfigToOverrides(config: StencilConfigSubset): BuildOverrides {\n const o: BuildOverrides = {};\n if (config.signalBacking) {\n o.signalBacking = true;\n o.vdomSignals = true; // signalBacking implies vdomSignals\n }\n\n const compat = config.compat;\n if (!compat) return o;\n if (compat.lifecycleDOMEvents) o.lifecycleDOMEvents = true;\n if (compat.initializeNextTick) o.initializeNextTick = true;\n\n const ldp = compat.lightDomPatches;\n if (ldp === false) {\n // Explicitly disable — standalone runtime defaults all to true.\n o.lightDomPatches = false;\n o.slotChildNodes = false;\n o.slotCloneNode = false;\n o.slotDomMutations = false;\n o.slotTextContent = false;\n } else if (typeof ldp === 'object') {\n // Granular: enable only the named patches; disable the rest (defaults are all-true).\n o.lightDomPatches = true;\n o.slotChildNodes = !!ldp.childNodes;\n o.slotCloneNode = !!ldp.cloneNode;\n o.slotDomMutations = !!ldp.domMutations;\n o.slotTextContent = !!ldp.textContent;\n }\n // ldp === true or undefined: no-op — already the default in the standalone runtime.\n return o;\n}\n","/**\n * CSS pipeline for Stencil component stylesheets.\n *\n * When the Stencil compiler emits a style import such as\n * `./foo.css?tag=my-cmp&encapsulation=shadow`, `resolveStencilCss` rewrites it\n * to a `\\0stencil-css:` virtual module ID. The bundler then calls `load`, which\n * reads the real file and runs it through any installed preprocessors in order:\n * Sass/Less → PostCSS → lightningcss → scoped-selector rewrite (for scoped\n * encapsulation). The result is returned as `export default () => \"…css…\"` so\n * the bundler treats it as a normal JS module dependency.\n *\n * Each preprocessor step is silently skipped if the relevant peer dep is absent.\n */\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, extname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { getScopeId, scopeCss } from '@stencil/core/compiler';\nimport { isPackageExists } from 'local-pkg';\n\n// Matches Stencil's emitted style imports: `./foo.css?tag=my-cmp&…`\nconst STENCIL_CSS_RE = /\\.(?:css|scss|sass|less|styl)\\?[^/]*\\btag=/;\nconst STENCIL_CSS_PREFIX = '\\0stencil-css:';\n\n// Evaluated once at startup — avoids repeated filesystem probes per CSS file.\nconst PKG = {\n sass: isPackageExists('sass'),\n less: isPackageExists('less'),\n postcss: isPackageExists('postcss') && isPackageExists('postcss-load-config'),\n lightningcss: isPackageExists('lightningcss'),\n};\n\n/**\n * Rewrites a Stencil CSS import to a `\\0stencil-css:` virtual module ID.\n * The file extension is stored dotless as `__ext` so Vite's `CSS_LANGS_RE`\n * never matches the virtual ID and tries to own the module itself.\n * @param specifier - the raw import specifier from the component source\n * @param importer - absolute path of the importing file\n * @returns virtual module ID, or `null` for non-Stencil CSS imports\n */\nexport function resolveStencilCss(specifier: string, importer: string): string | null {\n if (!STENCIL_CSS_RE.test(specifier)) return null;\n const [base, query] = specifier.split('?');\n const absBase = resolve(dirname(importer), base);\n const ext = extname(absBase);\n const stem = absBase.slice(0, absBase.length - ext.length);\n return `${STENCIL_CSS_PREFIX}${stem}?${query}&__ext=${encodeURIComponent(ext.slice(1))}`;\n}\n\nexport function isStencilCss(id: string): boolean {\n return id.startsWith(STENCIL_CSS_PREFIX);\n}\n\n/**\n * Extracts the real CSS file path from a `\\0stencil-css:` virtual module ID.\n * @param id - virtual module ID produced by `resolveStencilCss`\n * @returns absolute file path, or `null` if not a Stencil CSS virtual module\n */\nexport function getRealCssPath(id: string): string | null {\n if (!id.startsWith(STENCIL_CSS_PREFIX)) return null;\n const withoutPrefix = id.slice(STENCIL_CSS_PREFIX.length);\n const qIdx = withoutPrefix.indexOf('?');\n const stem = qIdx === -1 ? withoutPrefix : withoutPrefix.slice(0, qIdx);\n const query = qIdx === -1 ? '' : withoutPrefix.slice(qIdx + 1);\n const ext = decodeURIComponent(new URLSearchParams(query).get('__ext') ?? 'css');\n return `${stem}.${ext}`;\n}\n\nasync function compileSass(\n source: string,\n filePath: string,\n indented: boolean,\n): Promise<{ css: string; deps: string[] }> {\n const sass = await import('sass');\n const mainUrl = `file://${filePath}`;\n const result = sass.compileString(source, {\n url: new URL(mainUrl),\n syntax: indented ? 'indented' : 'scss',\n });\n const deps = result.loadedUrls\n .filter((u) => u.protocol === 'file:' && u.href !== mainUrl)\n .map((u) => fileURLToPath(u));\n return { css: result.css, deps };\n}\n\nasync function compileLess(\n source: string,\n filePath: string,\n): Promise<{ css: string; deps: string[] }> {\n const less = await import('less');\n const result = await less.default.render(source, {\n filename: filePath,\n paths: [dirname(filePath)],\n });\n return { css: result.css, deps: result.imports ?? [] };\n}\n\n// Cache PostCSS config per directory to avoid repeated filesystem lookups.\nconst postcssConfigCache = new Map<\n string,\n { plugins: unknown[]; options: Record<string, unknown> } | null\n>();\n\nasync function runPostCss(css: string, filePath: string): Promise<string> {\n const dir = dirname(filePath);\n let config = postcssConfigCache.get(dir);\n\n if (config === undefined) {\n try {\n const { default: loadConfig } = await import('postcss-load-config');\n const loaded = await loadConfig({}, dir);\n config = {\n plugins: loaded.plugins as unknown[],\n options: loaded.options as Record<string, unknown>,\n };\n } catch {\n config = null;\n }\n postcssConfigCache.set(dir, config);\n }\n\n if (!config?.plugins.length) return css;\n\n const { default: postcss } = await import('postcss');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = await postcss(config.plugins as any[]).process(css, {\n ...config.options,\n from: filePath,\n });\n return result.css;\n}\n\nasync function runLightningCss(css: string, filePath: string, minify: boolean): Promise<string> {\n const { transform } = await import('lightningcss');\n const result = transform({\n filename: filePath,\n code: Buffer.from(css),\n minify,\n });\n return result.code.toString();\n}\n\n/**\n * Loads a Stencil CSS virtual module.\n *\n * Processing order:\n * 1. Read raw file\n * 2. Preprocessor: Sass/SCSS (`sass`) or Less (`less`) if installed\n * 3. PostCSS with `postcss.config.*` if `postcss` + `postcss-load-config` are installed\n * 4. lightningcss if installed — syntax lowering, vendor prefixes, minification in prod\n * 5. Scoped selector rewrite for `encapsulation: 'scoped'`\n *\n * Each step is skipped silently if the relevant peer dep is not installed.\n * Returns `export default \"css string\"` so bundlers treat the import as a JS module.\n * @param id - virtual module id produced by `resolveStencilCss`\n * @param isDev - `true` in dev mode (disables minification)\n * @returns ESM string export of the processed CSS, or `null` if not a Stencil CSS virtual module\n */\nexport async function loadStencilCss(\n id: string,\n isDev = true,\n): Promise<{ code: string; deps: string[] } | null> {\n if (!id.startsWith(STENCIL_CSS_PREFIX)) return null;\n\n const withoutPrefix = id.slice(STENCIL_CSS_PREFIX.length);\n const qIdx = withoutPrefix.indexOf('?');\n const stem = qIdx === -1 ? withoutPrefix : withoutPrefix.slice(0, qIdx);\n const query = qIdx === -1 ? '' : withoutPrefix.slice(qIdx + 1);\n const params = new URLSearchParams(query);\n const tag = params.get('tag') ?? '';\n const encapsulation = params.get('encapsulation') ?? 'none';\n const ext = decodeURIComponent(params.get('__ext') ?? 'css');\n const filePath = `${stem}.${ext}`;\n\n if (!existsSync(filePath)) return { code: 'export default () => \"\"', deps: [] };\n\n let css = readFileSync(filePath, 'utf-8');\n let deps: string[] = [];\n\n if (PKG.sass && (ext === 'scss' || ext === 'sass')) {\n const r = await compileSass(css, filePath, ext === 'sass');\n css = r.css;\n deps = r.deps;\n } else if (PKG.less && ext === 'less') {\n const r = await compileLess(css, filePath);\n css = r.css;\n deps = r.deps;\n }\n\n if (PKG.postcss) css = await runPostCss(css, filePath);\n if (PKG.lightningcss) css = await runLightningCss(css, filePath, !isDev);\n\n if (encapsulation === 'scoped' && tag) {\n css = scopeCss(css, getScopeId(tag), false);\n }\n\n return { code: `export default () => ${JSON.stringify(css)};`, deps };\n}\n","/**\n * Resolves imported type references in CEM docs components.\n *\n * `transpileSync` uses a single-file TypeScript host, so imported types (e.g.\n * `ButtonVariant` from `'../types'`) can't be followed — `complexType.resolved`\n * ends up as `\"any\"`. This module creates a minimal ts.Program per referenced\n * types file (cached) and substitutes the actual expanded type text back into\n * the component's doc data before it enters the registry.\n */\nimport { existsSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport ts from 'typescript';\nimport type { ComponentCompilerTypeReferences, JsonDocsComponent } from '@stencil/core/compiler';\n\nconst TYPE_FORMAT_FLAGS =\n ts.TypeFormatFlags.NoTruncation |\n ts.TypeFormatFlags.InTypeAlias |\n ts.TypeFormatFlags.InElementType;\n\ninterface TypesFileEntry {\n checker: ts.TypeChecker;\n exportTypes: Map<string, ts.Type>;\n}\n\nconst typesFileCache = new Map<string, TypesFileEntry>();\n\nfunction resolveTypesFilePath(specifier: string, fromDir: string): string | undefined {\n const base = resolve(fromDir, specifier);\n if (existsSync(base)) return base;\n for (const ext of ['.ts', '.tsx', '.d.ts']) {\n const candidate = base + ext;\n if (existsSync(candidate)) return candidate;\n }\n // TypeScript ESM: `./foo.js` may physically be `./foo.ts` or `./foo.tsx` -\n // mirrors resolveSpecifier's remap in transform.ts.\n if (base.endsWith('.js')) {\n const stem = base.slice(0, -3);\n for (const ext of ['.ts', '.tsx']) {\n const candidate = stem + ext;\n if (existsSync(candidate)) return candidate;\n }\n }\n return undefined;\n}\n\nfunction getTypesFileEntry(absPath: string): TypesFileEntry {\n const cached = typesFileCache.get(absPath);\n if (cached) return cached;\n\n const options: ts.CompilerOptions = {\n ...ts.getDefaultCompilerOptions(),\n noEmit: true,\n module: ts.ModuleKind.ESNext,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n };\n const program = ts.createProgram([absPath], options);\n const checker = program.getTypeChecker();\n const sourceFile = program.getSourceFile(absPath);\n const exportTypes = new Map<string, ts.Type>();\n\n if (sourceFile) {\n const moduleSymbol = checker.getSymbolAtLocation(sourceFile);\n if (moduleSymbol) {\n for (const symbol of checker.getExportsOfModule(moduleSymbol)) {\n exportTypes.set(symbol.name, checker.getDeclaredTypeOfSymbol(symbol));\n }\n }\n }\n\n const entry: TypesFileEntry = { checker, exportTypes };\n typesFileCache.set(absPath, entry);\n return entry;\n}\n\nfunction expandTypeName(\n typeName: string,\n references: ComponentCompilerTypeReferences,\n fromDir: string,\n): string | undefined {\n const ref = references[typeName];\n if (!ref || ref.location !== 'import' || !ref.path) return undefined;\n\n const absPath = resolveTypesFilePath(ref.path, fromDir);\n if (!absPath) return undefined;\n\n const { checker, exportTypes } = getTypesFileEntry(absPath);\n const type = exportTypes.get(typeName);\n if (!type) return undefined;\n\n return checker.typeToString(type, undefined, TYPE_FORMAT_FLAGS);\n}\n\nconst escapeRegExp = (s: string) => s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\nfunction patchType(\n original: string,\n references: ComponentCompilerTypeReferences | undefined,\n fromDir: string,\n): string {\n if (!references) return original;\n let result = original;\n for (const typeName of Object.keys(references)) {\n const expanded = expandTypeName(typeName, references, fromDir);\n if (!expanded || expanded === typeName) continue;\n // Wrap in parens when substituting into a potentially larger expression\n // e.g. `ButtonVariant | undefined` → `('sm' | 'md') | undefined`\n result = result.replace(\n new RegExp(`\\\\b${escapeRegExp(typeName)}\\\\b`, 'g'),\n expanded.includes('|') || expanded.includes('&') ? `(${expanded})` : expanded,\n );\n }\n return result;\n}\n\nconst hasReferences = (references: ComponentCompilerTypeReferences | undefined): boolean =>\n !!references && Object.keys(references).length > 0;\n\n/**\n * Patches `prop.type` and `event.detail` in-place for any imported/inherited\n * types that weren't fully resolved by Stencil's compiler.\n *\n * Under-resolved types don't always show up as the literal string `\"any\"` -\n * a prop inherited from a same-project base class (merged via a single-file\n * mini `ts.Program`, which can't follow cross-file imports) can resolve to\n * the type's own unexpanded name instead (e.g. `\"Validator\"`), since that's\n * what a TypeScript checker falls back to for a type it can't bind. Either\n * way, a `location: 'import'` reference on the prop means there's something\n * worth trying to expand here.\n * @param component The CEM docs component to patch\n * @param componentAbsPath The absolute path to the component's source file (used to resolve relative imports)\n */\nexport function resolveImportedTypes(component: JsonDocsComponent, componentAbsPath: string): void {\n const dir = dirname(componentAbsPath);\n\n for (const prop of component.props) {\n if (!prop.complexType || !hasReferences(prop.complexType.references)) continue;\n const patched = patchType(prop.complexType.original, prop.complexType.references, dir);\n if (patched !== prop.complexType.original) prop.type = patched;\n }\n\n for (const event of component.events) {\n if (!event.complexType || !hasReferences(event.complexType.references)) continue;\n const patched = patchType(event.complexType.original, event.complexType.references, dir);\n if (patched !== event.complexType.original) event.detail = patched;\n }\n}\n","/**\n * Component transpilation and base-class discovery.\n *\n * `transformStencil` is the main entry point: it calls `transpileSync` with\n * `componentExport: 'customelement'` so each component self-registers when\n * imported. Two code paths come out:\n *\n * - **Component** (`@Component` present): full customelement output with\n * `defineCustomElement`, optional HMR snippet appended in dev mode.\n * - **Decorated base class** (`@Prop`/`@State`/etc. but no `@Component`):\n * returned as-is — the compiler's `isStencilBaseClass` check already injects\n * `extends HTMLElement` via `updateNativeBaseClass`.\n *\n * `makeResolver` supplies the `resolveImport` callback that `transpileSync`\n * uses during metadata collection. It serves two purposes at once: returning\n * raw source so the compiler can merge inherited props/states into the\n * component's metadata, and calling `onBaseClass` so the plugin can\n * pre-transform and cache the file before the bundler's resolveId hook fires.\n */\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, resolve } from 'node:path';\nimport { cmpMetaToDocsComponent, transpileSync } from '@stencil/core/compiler';\nimport type { BuildOverrides, JsonDocsComponent } from '@stencil/core/compiler';\nimport type { SupportedFramework } from 'unplugin';\n\nimport type { StencilPluginOptions } from './options.js';\n\nconst SOURCE_EXTS = ['.tsx', '.ts', '.js'];\n\n// TypeScript JsxEmit enum values — stable across TS versions.\nconst JSX_EMIT: Record<string, number> = {\n react: 2,\n 'react-jsx': 4,\n 'react-jsxdev': 5,\n preserve: 1,\n 'react-native': 3,\n};\n\ntype JsxOpts = { jsx?: number; jsxImportSource?: string };\n\nlet cachedTsConfigJsx: JsxOpts | undefined;\n\nfunction readJsxOptsFromTsConfig(cwd: string): JsxOpts {\n if (cachedTsConfigJsx !== undefined) return cachedTsConfigJsx;\n const tsconfigPath = join(cwd, 'tsconfig.json');\n if (!existsSync(tsconfigPath)) return (cachedTsConfigJsx = {});\n try {\n const raw = readFileSync(tsconfigPath, 'utf-8');\n const stripped = raw.replace(/\\/\\/[^\\n]*/g, '').replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n const tsconfig = JSON.parse(stripped);\n const co = tsconfig?.compilerOptions ?? {};\n const jsxStr: string | undefined = co.jsx?.toLowerCase();\n if (jsxStr && jsxStr in JSX_EMIT) {\n return (cachedTsConfigJsx = {\n jsx: JSX_EMIT[jsxStr],\n jsxImportSource: co.jsxImportSource,\n });\n }\n } catch {\n // ignore unreadable / malformed tsconfig\n }\n return (cachedTsConfigJsx = {});\n}\n\n// Detects classic JSX mode: `import { …, h, … } from '@stencil/core'`\nconst IMPORTS_H_RE = /import\\s+\\{[^}]*\\bh\\b[^}]*\\}\\s+from\\s+['\"]@stencil\\/core['\"]/;\n\n/* Resolve jsx/jsxImportSource for transpileSync.\n * Priority: tsconfig.json > source heuristic (h import → classic; otherwise automatic runtime). */\nfunction resolveJsxOpts(code: string, cwd: string): JsxOpts {\n const fromTsConfig = readJsxOptsFromTsConfig(cwd);\n if (fromTsConfig.jsx !== undefined) return fromTsConfig;\n if (IMPORTS_H_RE.test(code)) {\n return { jsx: JSX_EMIT['react'] }; // jsxFactory: 'h' auto-applied by transpile-module\n }\n return { jsx: JSX_EMIT['react-jsx'], jsxImportSource: '@stencil/core' };\n}\n\n/**\n * Resolve an import specifier to an absolute path, trying source extensions\n * and the TypeScript ESM `.js` → `.ts`/`.tsx` remap.\n * @param specifier - the import specifier (relative or extensionless)\n * @param importer - absolute path of the importing file\n * @returns absolute path to the resolved file, or `null` if nothing found on disk\n */\nexport function resolveSpecifier(specifier: string, importer: string): string | null {\n const base = resolve(dirname(importer), specifier);\n // Vite normalizes module IDs to forward slashes; we must match that so\n // virtual-module keys stay consistent on Windows.\n const norm = (p: string) => p.replace(/\\\\/g, '/');\n\n if (existsSync(base)) return norm(base);\n\n for (const ext of SOURCE_EXTS) {\n const candidate = base + ext;\n if (existsSync(candidate)) return norm(candidate);\n }\n\n // TypeScript ESM: `./foo.js` may physically be `./foo.ts` or `./foo.tsx`\n if (base.endsWith('.js')) {\n const stem = base.slice(0, -3);\n for (const ext of ['.ts', '.tsx']) {\n const candidate = stem + ext;\n if (existsSync(candidate)) return norm(candidate);\n }\n }\n\n return null;\n}\n\n/**\n * Transpile a `.tsx`/`.ts` file for use in a bundler.\n *\n * Returns `{ code, map, tagName }` for Stencil component or base-class files,\n * `null` for everything else (plain TS utilities, non-TS files, etc.).\n * `tagName` is empty string for base classes with no `@Component`.\n *\n * `onBaseClass` is called for every file the compiler resolves via\n * `resolveImport` during metadata collection. The plugin uses this to\n * pre-transform those files before the bundler's resolveId hook fires.\n * @param code - source file contents\n * @param id - absolute file path\n * @param options - plugin options\n * @param dev - `true` in dev/watch mode (enables HMR snippet)\n * @param framework - active unplugin framework\n * @param onBaseClass - called for each file in the inheritance chain with its abs path and raw source\n * @param configOverrides - pass stencil config option overrides to the transpiler\n * @returns transformed output, or `null` if the file is not a Stencil file\n */\nexport function transformStencil(\n code: string,\n id: string,\n options: StencilPluginOptions,\n dev = false,\n framework: SupportedFramework | '' = '',\n onBaseClass?: (absPath: string, rawCode: string) => void,\n configOverrides?: BuildOverrides,\n): {\n code: string;\n map: string | null;\n tagName: string;\n docsComponent: JsonDocsComponent | null;\n} | null {\n if (!id.endsWith('.tsx') && !id.endsWith('.ts')) return null;\n if (id.endsWith('.d.ts')) return null;\n\n // Cheap regex guard — avoids paying transpileSync cost for plain TS files.\n if (!/(@Component|@Prop|@State|@Event|@Method|@Watch|@Listen)\\s*[(\\s]/.test(code)) return null;\n\n const jsxOpts = resolveJsxOpts(code, process.cwd());\n const result = transpileSync(code, {\n ...jsxOpts,\n ...options.transpileOptions,\n file: id,\n componentExport: 'customelement',\n styleImportData: 'queryparams',\n resolveImport: makeResolver(onBaseClass),\n buildOverrides: {\n ...configOverrides,\n ...options.transpileOptions?.buildOverrides,\n ...(dev ? { hotModuleReplacement: true, isDev: true } : {}),\n },\n });\n\n if (result.diagnostics.some((d) => d.level === 'error')) {\n const msgs = result.diagnostics\n .filter((d) => d.level === 'error')\n .map((d) => d.messageText)\n .join('\\n');\n throw new Error(`[@stencil/unplugin] transpile error in ${id}:\\n${msgs}`);\n }\n\n if (!result.data?.length) {\n // No @Component — this is a base class or mixin factory. Return the\n // compiled output; for decorated classes the compiler's isStencilBaseClass\n // check already injected `extends HTMLElement`. Plain classes without\n // decorators are handled via the baseClassRegistry virtual-module path.\n if (!/@Component\\s*[(\\s]/.test(code)) {\n return { code: result.code, map: result.map ?? null, tagName: '', docsComponent: null };\n }\n return null;\n }\n\n const tagName = result.data[0].tagName;\n const className = result.data[0].componentClassName;\n\n // customelement mode strips the export keyword, so re-export the class\n // ourselves — consumers import it by name, and\n // hmrStandalone needs it in the re-imported module in dev mode\n const namedExport = `\\nexport{${className}};`;\n const out = dev\n ? result.code + namedExport + buildHmrSnippet(tagName, className, framework)\n : result.code + namedExport;\n\n const docsComponent = cmpMetaToDocsComponent(result.data[0], id);\n\n return { code: out, map: result.map ?? null, tagName, docsComponent };\n}\n\n/**\n * Transpile a base-class file with `transformAsBaseClass: true` so the\n * compiler injects `extends HTMLElement` into any class without an existing\n * heritage clause, regardless of whether it carries Stencil decorators.\n *\n * The result is cached in `baseClassRegistry` (in plugin.ts) and served as a\n * virtual module, ensuring the bundler always sees the injected version even\n * for plain lifecycle-only classes that the `transform` hook would otherwise skip.\n * @param rawCode - raw source of the base-class file\n * @param absPath - absolute path to the file (used as `file` for source maps)\n * @param options - plugin options forwarded to `transpileSync`\n * @returns compiled JS output\n */\nexport function transpileBaseClass(\n rawCode: string,\n absPath: string,\n options: StencilPluginOptions,\n): string {\n const result = transpileSync(rawCode, {\n ...options.transpileOptions,\n file: absPath,\n componentExport: 'customelement',\n styleImportData: 'queryparams',\n transformAsBaseClass: true,\n });\n return result.code;\n}\n\n/* Builds the HMR client snippet appended to component output in dev mode.\n *\n * Two strategies depending on bundler:\n * - Vite / Farm: server sends a `stencil:hmr` WebSocket event via\n * `handleHotUpdate`; the client calls `el['s-hmr'](version)` which triggers\n * a cache-busted re-import and forced re-render.\n * - webpack / rspack / bun: use the `module.hot` re-execution pattern —\n * `dispose` marks the reload with a flag, `accept` re-runs the module, and\n * the new prototype is patched onto existing instances in-place. */\nfunction buildHmrSnippet(\n tagName: string,\n className: string,\n framework: SupportedFramework | '',\n): string {\n const tag = JSON.stringify(tagName);\n\n if (framework === 'webpack' || framework === 'rspack' || framework === 'bun') {\n const hotExpr =\n framework === 'bun'\n ? 'import.meta.hot'\n : \"(typeof module !== 'undefined' && module.hot) || import.meta.webpackHot\";\n\n return (\n `\\n${className}.__stencil_module__ = import.meta.url;` +\n `\\nvar _sHot = ${hotExpr};` +\n `\\nif (_sHot) {` +\n `\\n if (_sHot.data && _sHot.data.stencilHmr) {` +\n `\\n var _sCtor = customElements.get(${tag});` +\n `\\n if (_sCtor) Object.getOwnPropertyNames(${className}.prototype).forEach(function(k) {` +\n `\\n if (k !== 'constructor') Object.defineProperty(_sCtor.prototype, k, Object.getOwnPropertyDescriptor(${className}.prototype, k));` +\n `\\n });` +\n `\\n document.querySelectorAll(${tag}).forEach(function(el) { el.connectedCallback && el.connectedCallback(); });` +\n `\\n }` +\n `\\n _sHot.dispose(function(data) { data.stencilHmr = true; });` +\n `\\n _sHot.accept();` +\n `\\n}`\n );\n }\n\n // Vite and Farm both implement the Vite HMR API.\n // The s-hmr guard prevents ?s-hmr= re-imports from stacking up additional listeners.\n return (\n `\\n${className}.__stencil_module__ = import.meta.url;` +\n `\\nif (import.meta.hot && !import.meta.url.includes('s-hmr=')) {` +\n `\\n import.meta.hot.accept(() => {});` +\n `\\n import.meta.hot.on('stencil:hmr', function({ tagName }) {` +\n `\\n if (tagName === ${tag}) {` +\n `\\n var v = Date.now().toString(36);` +\n `\\n document.querySelectorAll(${tag}).forEach(function(el) { el['s-hmr'] && el['s-hmr'](v); });` +\n `\\n }` +\n `\\n });` +\n `\\n}`\n );\n}\n\n/* Builds the `resolveImport` callback for `transpileSync`.\n *\n * The compiler calls this for every import it encounters while walking the\n * inheritance chain during metadata collection. The callback returns the raw\n * source so the compiler can merge inherited props/states/events into the\n * component's metadata. As a side-effect it calls `onBaseClass` with the same\n * raw source, giving the plugin a chance to pre-transform and cache the file\n * before the bundler's resolveId hook fires for it. */\nfunction makeResolver(onBaseClass?: (absPath: string, rawCode: string) => void) {\n return (specifier: string, currentImporter: string): { code: string; path: string } | null => {\n const absPath = resolveSpecifier(specifier, currentImporter);\n if (!absPath) return null;\n\n const code = readFileSync(absPath, 'utf-8');\n onBaseClass?.(absPath, code);\n return { code, path: absPath };\n };\n}\n","/**\n * Unplugin factory for @stencil/unplugin.\n *\n * Wires together four concerns into a single plugin that works across Vite,\n * Rollup, webpack, rspack, and bun:\n *\n * 1. **Component transform** - `transform` drives `transpileSync` on every\n * `.tsx`/`.ts` file that carries Stencil decorators, producing\n * `customelement` output (self-registering class + `defineCustomElement`).\n *\n * 2. **CSS virtual modules** - Stencil emits `./foo.css?tag=my-cmp&…`\n * imports. `resolveId` rewrites these to `\\0stencil-css:` virtual IDs;\n * `load` reads the real file, runs it through any installed preprocessors,\n * and returns `export default () => \"…css…\"`.\n *\n * 3. **Base-class inheritance** - when a component extends a class that does\n * not itself extend `HTMLElement`, the custom-element registration breaks.\n * The plugin intercepts every file the compiler resolves via `resolveImport`\n * (during `transpileSync`), pre-transforms it with `transformAsBaseClass: true`\n * so it gets `extends HTMLElement`, and caches the result. `resolveId` then\n * redirects imports of those files to `\\0stencil-base:` virtual modules so\n * the bundler always sees the injected version - regardless of module-graph\n * processing order.\n *\n * 4. **HMR** - Vite receives a custom `stencil:hmr` WebSocket event when a\n * component file changes; other bundlers use the `module.hot` re-execution\n * pattern. CSS changes are covered automatically by `addWatchFile`.\n */\nimport { readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createFilter } from '@rollup/pluginutils';\nimport { transpile, cmpMetaToDocsComponent, generateManifest } from '@stencil/core/compiler';\nimport { createUnplugin } from 'unplugin';\nimport type {\n BuildOverrides,\n CustomElementsManifest,\n JsonDocsComponent,\n} from '@stencil/core/compiler';\n\nimport { loadStencilConfig, stencilConfigToOverrides } from './config.js';\nimport { getRealCssPath, isStencilCss, loadStencilCss, resolveStencilCss } from './css.js';\nimport { resolveImportedTypes } from './resolve-types.js';\nimport { resolveSpecifier, transformStencil, transpileBaseClass } from './transform.js';\nimport type { StencilPluginOptions } from './options.js';\n\nexport const STENCIL_DOCS_ID = '@stencil/unplugin/docs';\nconst VIRTUAL_DOCS_PREFIX = '\\0stencil-docs:';\n\n// Module-level registry so getStencilDocs() is callable from outside the plugin\n// (e.g. from a Storybook preset running in Node.js).\nconst docsRegistry = new Map<string, JsonDocsComponent>();\n\n/**\n * Returns the current CEM. Only populated when `docs: true` is set.\n * @returns the current CEM, or an empty CEM if `docs: true` was not set.\n */\nexport function getStencilCEM(): CustomElementsManifest {\n return generateManifest({ components: [...docsRegistry.values()] });\n}\n\n/**\n * Recursively collect `.tsx`/`.ts` file paths under `dir`, pruning\n * `node_modules` and hidden directories (`.git`, `.vite`, etc.) as it goes.\n *\n * `readdirSync(dir, { recursive: true })` can't prune during traversal - it\n * walks everything first and only lets the caller filter the flat result\n * afterward, which is disastrous under a symlink-heavy `node_modules` (e.g.\n * pnpm's `.pnpm` store, which flattens every dependency in the workspace) -\n * it can take minutes just to list, blocking `buildStart` the whole time.\n *\n * @param dir the directory to walk\n * @param out accumulator array of absolute file paths, mutated in place\n */\nfunction collectSourceFiles(dir: string, out: string[]): void {\n let entries: import('node:fs').Dirent[];\n try {\n entries = readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue;\n const abs = join(dir, entry.name);\n if (entry.isDirectory()) {\n collectSourceFiles(abs, out);\n } else if (\n entry.isFile() &&\n (abs.endsWith('.tsx') || abs.endsWith('.ts')) &&\n !abs.endsWith('.d.ts')\n ) {\n out.push(abs);\n }\n }\n}\n\n/**\n * Scan the project for component source files and pre-populate the docs registry.\n * @param filter A function to filter which files should be included.\n * @returns A promise that resolves when the scan is complete.\n */\nasync function scanDocs(filter: (id: string) => boolean): Promise<void> {\n const cwd = process.cwd();\n const allFiles: string[] = [];\n collectSourceFiles(cwd, allFiles);\n const files = allFiles.filter((abs) => filter(abs));\n\n await Promise.all(\n files.map(async (abs) => {\n let code: string;\n try {\n code = readFileSync(abs, 'utf-8');\n } catch {\n return;\n }\n if (!/(@Component|@Prop|@State|@Event|@Method|@Watch|@Listen)\\s*[(\\s]/.test(code)) return;\n const result = await transpile(code, { file: abs, componentExport: 'customelement' });\n for (const item of result.data ?? []) {\n if (!item.tagName) continue;\n const component = cmpMetaToDocsComponent(item, abs);\n resolveImportedTypes(component, abs);\n docsRegistry.set(item.tagName, component);\n }\n }),\n );\n}\n\n// Null-byte prefix marks a virtual module - Rollup/Vite convention that\n// prevents the ID from being treated as a real filesystem path.\nconst VIRTUAL_BASE_PREFIX = '\\0stencil-base:';\n\n// Mirrors the compiler's hasSignalsImport check in static-to-meta/import.ts.\nconst SIGNALS_IMPORT_RE = /from\\s+['\"]@stencil\\/core\\/signals['\"]/;\n\nexport const unpluginStencil = createUnplugin(\n (options: StencilPluginOptions | undefined = {}, meta) => {\n const { framework } = meta;\n const filter = createFilter(\n options.include ?? [/\\.tsx?$/],\n options.exclude ?? ['node_modules/**'],\n );\n\n // Vite auto-detects dev mode via configResolved; other bundlers use options.dev.\n let isDev = options.dev ?? false;\n\n // For Vite, configResolved sets this to config.root (more accurate than process.cwd()).\n // For other bundlers, process.cwd() is the fallback.\n let projectRoot = process.cwd();\n\n // Merged BUILD overrides from auto-detected stencil.config + explicit stencilConfig.\n // Populated in buildStart; explicit transpileOptions.buildOverrides takes precedence\n // over this in transformStencil.\n let configOverrides: BuildOverrides = {};\n\n // Tracks which source file owns which custom-element tag name, used by the\n // Vite HMR handler to send targeted `stencil:hmr` events.\n const fileToTagName = new Map<string, string>();\n\n // Maps CSS file paths → tag names that use them. A shared CSS file can be\n // used by multiple components, so this is a Set per file path.\n const cssFileToTagNames = new Map<string, Set<string>>();\n\n // Maps real CSS file path → virtual CSS module IDs (\\0stencil-css:...).\n // Multiple components may share the same CSS file, each with their own\n // virtual module ID (different tag/encapsulation query params).\n const cssRealToVirtualIds = new Map<string, Set<string>>();\n\n function trackCssFile(realPath: string, tag: string, virtualId: string) {\n if (!cssFileToTagNames.has(realPath)) cssFileToTagNames.set(realPath, new Set());\n cssFileToTagNames.get(realPath)!.add(tag);\n if (!cssRealToVirtualIds.has(realPath)) cssRealToVirtualIds.set(realPath, new Set());\n cssRealToVirtualIds.get(realPath)!.add(virtualId);\n }\n\n // absPath → HTMLElement-injected JS. Populated during `transform` when\n // `transpileSync`'s resolveImport callback discovers a base-class file.\n // Rollup guarantees that resolveId for imports in a module's *output* fires\n // after the transform that produced them - so by the time the bundler asks\n // to resolve a base-class import, this map is already populated.\n const baseClassRegistry = new Map<string, string>();\n\n function registerBaseClass(absPath: string, rawCode: string) {\n if (baseClassRegistry.has(absPath)) return; // already processed this build\n baseClassRegistry.set(absPath, transpileBaseClass(rawCode, absPath, options));\n }\n\n return {\n name: '@stencil/unplugin',\n\n async buildStart() {\n const detected = await loadStencilConfig(projectRoot);\n // Merge: auto-detected config is the base; explicit stencilConfig overrides field-by-field.\n const merged = detected\n ? {\n ...detected,\n ...options.stencilConfig,\n compat: { ...detected.compat, ...options.stencilConfig?.compat },\n }\n : (options.stencilConfig ?? {});\n configOverrides = stencilConfigToOverrides(merged);\n if (options.docs) await scanDocs(filter);\n },\n\n resolveId(id, importer) {\n if (id === STENCIL_DOCS_ID) return VIRTUAL_DOCS_PREFIX;\n if (!importer) return null;\n\n const css = resolveStencilCss(id, importer);\n if (css) return css;\n\n if (baseClassRegistry.size > 0) {\n // Imports inside a virtual base-class module use the virtual ID as\n // importer - strip the prefix so resolveSpecifier works against the\n // real path on disk. This matters for multi-level inheritance chains.\n\n const realImporter = importer.startsWith(VIRTUAL_BASE_PREFIX)\n ? importer.slice(VIRTUAL_BASE_PREFIX.length)\n : importer;\n\n const abs = resolveSpecifier(id, realImporter);\n if (abs && baseClassRegistry.has(abs)) {\n return VIRTUAL_BASE_PREFIX + abs;\n }\n }\n\n return null;\n },\n\n transformInclude(id) {\n return filter(id.split('?')[0]);\n },\n\n transform(code, id) {\n const cleanId = id.split('?')[0];\n if (!configOverrides.vdomSignals && SIGNALS_IMPORT_RE.test(code)) {\n configOverrides = { ...configOverrides, vdomSignals: true };\n }\n const result = transformStencil(\n code,\n cleanId,\n options,\n isDev,\n framework,\n registerBaseClass,\n configOverrides,\n );\n if (result?.tagName) fileToTagName.set(cleanId, result.tagName);\n if (result?.docsComponent && options.docs) {\n resolveImportedTypes(result.docsComponent, cleanId);\n docsRegistry.set(result.docsComponent.tag, result.docsComponent);\n }\n return result;\n },\n\n loadInclude(id) {\n return id === VIRTUAL_DOCS_PREFIX || isStencilCss(id) || id.startsWith(VIRTUAL_BASE_PREFIX);\n },\n\n async load(id) {\n if (id === VIRTUAL_DOCS_PREFIX) {\n return `export default ${JSON.stringify(getStencilCEM())}`;\n }\n if (id.startsWith(VIRTUAL_BASE_PREFIX)) {\n const realPath = id.slice(VIRTUAL_BASE_PREFIX.length);\n this.addWatchFile(realPath); // re-invalidate this virtual module when the source changes\n return { code: baseClassRegistry.get(realPath) ?? '', map: null };\n }\n const realPath = getRealCssPath(id);\n const qIdx = id.indexOf('?');\n const tag = qIdx !== -1 ? new URLSearchParams(id.slice(qIdx + 1)).get('tag') : null;\n if (realPath) {\n this.addWatchFile(realPath);\n if (tag) trackCssFile(realPath, tag, id);\n }\n const cssResult = await loadStencilCss(id, isDev);\n if (cssResult) {\n if (tag) {\n for (const dep of cssResult.deps) {\n this.addWatchFile(dep);\n trackCssFile(dep, tag, id);\n }\n }\n return { code: cssResult.code, map: null };\n }\n return null;\n },\n\n vite: {\n // Must run before Vite/rolldown's built-in TSX transform, which would\n // otherwise claim the file and emit react/jsx-dev-runtime imports.\n enforce: 'pre' as const,\n\n configResolved(config: { command: string; root: string }) {\n isDev = options.dev ?? config.command === 'serve';\n projectRoot = config.root;\n },\n\n async handleHotUpdate({\n file,\n server,\n }: {\n file: string;\n server: {\n ws: { send: (msg: unknown) => void };\n moduleGraph: {\n invalidateModule(\n mod: unknown,\n seen?: Set<unknown>,\n timestamp?: number,\n isHmr?: boolean,\n ): void;\n getModuleById?(id: string): unknown;\n idToModuleMap?: Map<string, unknown>;\n };\n };\n }) {\n // Collect all tag names affected by this file change\n const tsxTag = fileToTagName.get(file);\n const cssTagNames = cssFileToTagNames.get(file);\n const tagNames = new Set<string>(cssTagNames);\n if (tsxTag) tagNames.add(tsxTag);\n if (tagNames.size === 0) return;\n\n // Invalidate every virtual CSS module that depends on this file so\n // Vite adds ?t=timestamp when re-serving the TSX - busts browser cache.\n const virtualIds = cssRealToVirtualIds.get(file);\n if (virtualIds) {\n for (const virtualId of virtualIds) {\n const virtualMod =\n server.moduleGraph.getModuleById?.(virtualId) ??\n server.moduleGraph.idToModuleMap?.get(virtualId);\n if (virtualMod)\n server.moduleGraph.invalidateModule(virtualMod, new Set(), Date.now(), true);\n }\n }\n // Update the docs registry and notify the client only when the CEM\n // actually changed (new/renamed prop, type update, JSDoc edit, etc.).\n // Pure implementation changes leave the CEM identical and fall through\n // to normal stencil:hmr so HMR is not disrupted.\n if (options.docs && tsxTag) {\n let cemChanged = false;\n try {\n const prevSnapshot = JSON.stringify(docsRegistry.get(tsxTag));\n const code = readFileSync(file, 'utf-8');\n const result = await transpile(code, { file, componentExport: 'customelement' });\n for (const item of result.data ?? []) {\n if (!item.tagName) continue;\n const component = cmpMetaToDocsComponent(item, file);\n resolveImportedTypes(component, file);\n docsRegistry.set(item.tagName, component);\n }\n cemChanged = JSON.stringify(docsRegistry.get(tsxTag)) !== prevSnapshot;\n } catch {\n // stale docs are acceptable on transpile error\n }\n if (cemChanged) {\n const docsVirtualMod =\n server.moduleGraph.getModuleById?.(VIRTUAL_DOCS_PREFIX) ??\n server.moduleGraph.idToModuleMap?.get(VIRTUAL_DOCS_PREFIX);\n if (docsVirtualMod)\n server.moduleGraph.invalidateModule(docsVirtualMod, new Set(), Date.now(), true);\n server.ws.send({ type: 'custom', event: 'stencil:docs-update' });\n }\n }\n for (const tagName of tagNames) {\n server.ws.send({ type: 'custom', event: 'stencil:hmr', data: { tagName } });\n }\n return [];\n },\n },\n };\n },\n);\n","export { unpluginStencil, getStencilCEM, STENCIL_DOCS_ID } from './plugin.js';\nexport type { StencilPluginOptions } from './options.js';\n\nimport { unpluginStencil } from './plugin.js';\n\nexport const stencilVite = unpluginStencil.vite;\nexport const stencilRollup = unpluginStencil.rollup;\nexport const stencilWebpack = unpluginStencil.webpack;\nexport const stencilEsbuild = unpluginStencil.esbuild;\nexport const stencilRspack = unpluginStencil.rspack;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,MAAM,sCAAsB,IAAI,IAAI;CAClC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,mBAAmB,MACvB,MAAM,QACN,OAAO,MAAM,YACb,CAAC,MAAM,QAAQ,CAAC,KAChB,OAAO,KAAK,CAAW,CAAC,CAAC,MAAM,MAAM,oBAAoB,IAAI,CAAC,CAAC;AAEjE,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;AACF;;;;;;;;AASA,eAAsB,kBAAkB,KAAkD;CACxF,KAAK,MAAM,YAAY,mBAAmB;EACxC,MAAM,aAAa,KAAK,KAAK,QAAQ;EACrC,IAAI,CAAC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 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/unplugin",
3
- "version": "5.0.0-alpha.27",
3
+ "version": "5.0.0-alpha.29",
4
4
  "description": "Universal bundler plugin for Stencil components (Vite, Rollup, Webpack, esbuild)",
5
5
  "homepage": "https://stenciljs.com/",
6
6
  "license": "MIT",
@@ -28,24 +28,24 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@rollup/pluginutils": "^5.4.0",
31
- "jiti": "^2.0.0",
31
+ "jiti": "^2.7.0",
32
32
  "local-pkg": "^1.2.1",
33
- "unplugin": "^3.0.0"
33
+ "unplugin": "^3.3.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/less": "^3.0.8",
37
- "@vitest/browser": "^4.1.7",
38
- "@vitest/browser-playwright": "^4.1.7",
39
- "less": "^4.6.7",
40
- "lightningcss": "^1.32.0",
41
- "postcss": "^8.5.15",
37
+ "@vitest/browser": "^4.1.10",
38
+ "@vitest/browser-playwright": "^4.1.10",
39
+ "less": "^4.8.1",
40
+ "lightningcss": "^1.33.0",
41
+ "postcss": "^8.5.26",
42
42
  "postcss-load-config": "^6.0.1",
43
- "sass": "^1.101.0",
44
- "tsdown": ">=0.21.0 <1.0.0",
45
- "typescript": ">4.0.0 <7.0.0",
46
- "vite": "^8.1.0",
47
- "vitest": "^4.1.7",
48
- "@stencil/core": "5.0.0-alpha.27"
43
+ "sass": "^1.102.0",
44
+ "tsdown": "^0.22.14",
45
+ "typescript": "^6.0.3",
46
+ "vite": "^8.2.1",
47
+ "vitest": "^4.1.10",
48
+ "@stencil/core": "5.0.0-alpha.29"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "less": "^4.0.0",
@@ -54,7 +54,7 @@
54
54
  "postcss-load-config": "^4.0.0 || ^5.0.0 || ^6.0.0",
55
55
  "sass": "^1.0.0",
56
56
  "typescript": ">=5.0.0",
57
- "@stencil/core": "^5.0.0 || 5.0.0-alpha.27"
57
+ "@stencil/core": "^5.0.0 || 5.0.0-alpha.29"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "less": {
File without changes