@pithyjs/vite-plugin 0.2.0-beta.6 → 0.2.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/aotCodegen/generateBindings.d.ts +1 -1
  2. package/dist/aotCodegen/generateBindings.d.ts.map +1 -1
  3. package/dist/aotCodegen/generateBindings.js +2 -2
  4. package/dist/aotCodegen/generateBindings.js.map +1 -1
  5. package/dist/aotCodegen/generateDomFactory.d.ts +2 -1
  6. package/dist/aotCodegen/generateDomFactory.d.ts.map +1 -1
  7. package/dist/aotCodegen/generateDomFactory.js +23 -15
  8. package/dist/aotCodegen/generateDomFactory.js.map +1 -1
  9. package/dist/aotCodegen/index.d.ts +2 -2
  10. package/dist/aotCodegen/index.js +1 -1
  11. package/dist/aotCodegen/index.js.map +1 -1
  12. package/dist/aotCodegen/serializeNode.d.ts +1 -1
  13. package/dist/aotCodegen/serializeNode.d.ts.map +1 -1
  14. package/dist/aotCodegen/serializeNode.js +2 -3
  15. package/dist/aotCodegen/serializeNode.js.map +1 -1
  16. package/dist/aotCodegen/structuralCodegen.d.ts +2 -2
  17. package/dist/aotCodegen/structuralCodegen.d.ts.map +1 -1
  18. package/dist/aotCodegen/structuralCodegen.js +2 -2
  19. package/dist/aotCodegen/structuralCodegen.js.map +1 -1
  20. package/dist/aotCodegen/utils.js.map +1 -1
  21. package/dist/babelPlugin/babelPlugin.d.ts +1 -1
  22. package/dist/babelPlugin/babelPlugin.d.ts.map +1 -1
  23. package/dist/babelPlugin/babelPlugin.js +140 -7
  24. package/dist/babelPlugin/babelPlugin.js.map +1 -1
  25. package/dist/babelPlugin/extractUsedIdentifiers.d.ts +13 -3
  26. package/dist/babelPlugin/extractUsedIdentifiers.d.ts.map +1 -1
  27. package/dist/babelPlugin/extractUsedIdentifiers.js +43 -12
  28. package/dist/babelPlugin/extractUsedIdentifiers.js.map +1 -1
  29. package/dist/buildPlugin/plugin.js.map +1 -1
  30. package/dist/designSystemPlugin/channelVars.js.map +1 -1
  31. package/dist/designSystemPlugin/collector.d.ts +1 -1
  32. package/dist/designSystemPlugin/collector.js +1 -1
  33. package/dist/designSystemPlugin/collector.js.map +1 -1
  34. package/dist/designSystemPlugin/cssTokens.d.ts +1 -1
  35. package/dist/designSystemPlugin/cssTokens.js +1 -1
  36. package/dist/designSystemPlugin/cssTokens.js.map +1 -1
  37. package/dist/designSystemPlugin/enumerate.d.ts.map +1 -1
  38. package/dist/designSystemPlugin/enumerate.js +13 -13
  39. package/dist/designSystemPlugin/enumerate.js.map +1 -1
  40. package/dist/designSystemPlugin/extractor.d.ts +1 -1
  41. package/dist/designSystemPlugin/extractor.js.map +1 -1
  42. package/dist/designSystemPlugin/generator.d.ts +1 -1
  43. package/dist/designSystemPlugin/generator.js +3 -3
  44. package/dist/designSystemPlugin/generator.js.map +1 -1
  45. package/dist/designSystemPlugin/index.d.ts +2 -2
  46. package/dist/designSystemPlugin/index.js +1 -1
  47. package/dist/designSystemPlugin/index.js.map +1 -1
  48. package/dist/designSystemPlugin/patterns/a11y.d.ts +1 -1
  49. package/dist/designSystemPlugin/patterns/a11y.js.map +1 -1
  50. package/dist/designSystemPlugin/patterns/borders.d.ts +1 -1
  51. package/dist/designSystemPlugin/patterns/borders.js +1 -1
  52. package/dist/designSystemPlugin/patterns/borders.js.map +1 -1
  53. package/dist/designSystemPlugin/patterns/colors.d.ts +1 -1
  54. package/dist/designSystemPlugin/patterns/colors.js +2 -2
  55. package/dist/designSystemPlugin/patterns/colors.js.map +1 -1
  56. package/dist/designSystemPlugin/patterns/iconography.d.ts +1 -1
  57. package/dist/designSystemPlugin/patterns/iconography.js +1 -1
  58. package/dist/designSystemPlugin/patterns/iconography.js.map +1 -1
  59. package/dist/designSystemPlugin/patterns/index.d.ts +1 -1
  60. package/dist/designSystemPlugin/patterns/index.js +11 -11
  61. package/dist/designSystemPlugin/patterns/index.js.map +1 -1
  62. package/dist/designSystemPlugin/patterns/layout.d.ts +1 -1
  63. package/dist/designSystemPlugin/patterns/layout.js +1 -1
  64. package/dist/designSystemPlugin/patterns/layout.js.map +1 -1
  65. package/dist/designSystemPlugin/patterns/motion.d.ts +1 -1
  66. package/dist/designSystemPlugin/patterns/motion.js +1 -1
  67. package/dist/designSystemPlugin/patterns/motion.js.map +1 -1
  68. package/dist/designSystemPlugin/patterns/radius.d.ts +1 -1
  69. package/dist/designSystemPlugin/patterns/radius.js +1 -1
  70. package/dist/designSystemPlugin/patterns/radius.js.map +1 -1
  71. package/dist/designSystemPlugin/patterns/shadows.d.ts +1 -1
  72. package/dist/designSystemPlugin/patterns/shadows.d.ts.map +1 -1
  73. package/dist/designSystemPlugin/patterns/shadows.js +1 -1
  74. package/dist/designSystemPlugin/patterns/shadows.js.map +1 -1
  75. package/dist/designSystemPlugin/patterns/smartContainer.d.ts +1 -1
  76. package/dist/designSystemPlugin/patterns/smartContainer.js +1 -1
  77. package/dist/designSystemPlugin/patterns/smartContainer.js.map +1 -1
  78. package/dist/designSystemPlugin/patterns/spacing.d.ts +1 -1
  79. package/dist/designSystemPlugin/patterns/spacing.js +1 -1
  80. package/dist/designSystemPlugin/patterns/spacing.js.map +1 -1
  81. package/dist/designSystemPlugin/patterns/typography.d.ts +1 -1
  82. package/dist/designSystemPlugin/patterns/typography.js +1 -1
  83. package/dist/designSystemPlugin/patterns/typography.js.map +1 -1
  84. package/dist/designSystemPlugin/plugin.d.ts +1 -1
  85. package/dist/designSystemPlugin/plugin.js +5 -5
  86. package/dist/designSystemPlugin/plugin.js.map +1 -1
  87. package/dist/designSystemPlugin/types.js.map +1 -1
  88. package/dist/htmlTransform/htmlTransform.d.ts +1 -1
  89. package/dist/htmlTransform/htmlTransform.d.ts.map +1 -1
  90. package/dist/htmlTransform/htmlTransform.js +5 -2
  91. package/dist/htmlTransform/htmlTransform.js.map +1 -1
  92. package/dist/iconsPlugin/index.d.ts +2 -2
  93. package/dist/iconsPlugin/index.js +1 -1
  94. package/dist/iconsPlugin/index.js.map +1 -1
  95. package/dist/iconsPlugin/optimize.js.map +1 -1
  96. package/dist/iconsPlugin/plugin.d.ts +1 -1
  97. package/dist/iconsPlugin/plugin.js +2 -2
  98. package/dist/iconsPlugin/plugin.js.map +1 -1
  99. package/dist/iconsPlugin/types.js.map +1 -1
  100. package/dist/index.d.ts +8 -8
  101. package/dist/index.js +7 -7
  102. package/dist/index.js.map +1 -1
  103. package/dist/pithyPlugin/plugin.d.ts.map +1 -1
  104. package/dist/pithyPlugin/plugin.js +1 -8
  105. package/dist/pithyPlugin/plugin.js.map +1 -1
  106. package/dist/routerPlugin/manifest.js.map +1 -1
  107. package/dist/routerPlugin/plugin.js +2 -2
  108. package/dist/routerPlugin/plugin.js.map +1 -1
  109. package/dist/routerPlugin/scanner.js.map +1 -1
  110. package/dist/ssrPlugin/plugin.d.ts.map +1 -1
  111. package/dist/ssrPlugin/plugin.js +26 -21
  112. package/dist/ssrPlugin/plugin.js.map +1 -1
  113. package/package.json +10 -9
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/designSystemPlugin/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACvE,OAAO,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,EACV,KAAK,EACL,KAAK,GACN,MAAM,MAAM,CAAC;AACd,OAAO,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,GAEnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,q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AmB,EACnB,GAAW;IAEX,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAClD,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7D,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjD,yEAAyE;IACzE,2EAA2E;IAC3E,qEAAqE;IACrE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACjE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin-design-system\",\n \"title\": \"Vite Plugin for Design System CSS Tree-Shaking\",\n \"category\": \"plugin\",\n \"description\": \"CSS tree-shaking plugin that extracts used utility classes from source files and generates only the CSS needed.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": false, \"covered\": false },\n \"integration\": { \"required\": true, \"covered\": true, \"file\": \"integration.test.ts\" },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type { Plugin, ResolvedConfig, ViteDevServer } from 'vite';\nimport { readFileSync, readdirSync, realpathSync, statSync } from 'fs';\nimport {\n join,\n dirname,\n extname,\n relative,\n isAbsolute,\n posix,\n win32,\n} from 'path';\nimport {\n themeToCss,\n resolveTheme,\n designSystemToCss,\n} from '@pithyjs/design-system/palette';\nimport { createCollector, type Collector } from './collector';\nimport {\n collectChannelVarRefs,\n createChannelVarGate,\n isChannelScanCandidate,\n resolveChannelScanRoots,\n scanChannelVarRefs,\n type ChannelVarScan,\n} from './channelVars';\nimport { generateCSS } from './generator';\nimport { enumerateAllUtilities } from './enumerate';\nimport {\n VIRTUAL_MODULE_ID,\n RESOLVED_VIRTUAL_MODULE_ID,\n resolveOptions,\n defaultModeOf,\n type DesignSystemPluginOptions,\n} from './types';\n\n/**\n * Format byte count to human-readable string\n */\nfunction formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n const kb = bytes / 1024;\n return `${kb.toFixed(1)} KB`;\n}\n\n/**\n * Last-resort spelling of the same thing {@link registryExclusions} names exactly:\n * for a path the resolver never produced, such as a `transform` id reaching\n * in through a published install.\n */\nconst UI_KIT_REGISTRY_PATH = /\\/ui-kit\\/(?:src|dist)\\/registry\\//;\n\n/** The one directory inside ui-kit that holds generated modules. */\nconst REGISTRY_DIR_NAME = 'registry';\n\n/** The package whose registry this plugin must not read. */\nconst UI_KIT_NAME = '@pithyjs/ui-kit';\n\n/** Vite's default `resolve.extensions`, for a config that sets none. */\nconst RESOLVE_EXTENSIONS = [\n '.mjs',\n '.js',\n '.mts',\n '.ts',\n '.jsx',\n '.tsx',\n '.json',\n] as const;\n\n/** A JS extension may be the OUTPUT name of a TypeScript source. */\nconst TS_SOURCE_EXTENSIONS: Record<string, readonly string[]> = {\n '.js': ['.ts', '.tsx'],\n '.jsx': ['.tsx'],\n '.mjs': ['.mts', '.mtsx'],\n '.cjs': ['.cts', '.ctsx'],\n};\n\n/** `statSync`, or undefined for a path that does not exist. */\nfunction statOf(p: string) {\n try {\n return statSync(p);\n } catch {\n return undefined;\n }\n}\n\n/** Vite's default `resolve.mainFields`, for a config that sets none. */\nconst MAIN_FIELDS = ['browser', 'module', 'jsnext:main', 'jsnext'] as const;\n\n/**\n * A directory's package entry, in Vite's order: `exports`, each main field,\n * then `main`. `undefined` means no manifest or no entry, so `index` is next;\n * `null` means an entry this does not evaluate (a conditional `exports` map,\n * a `browser` entry Vite would choose by sniffing), and the caller must\n * exclude nothing rather than guess.\n */\nfunction packageEntry(\n dir: string,\n mainFields: readonly string[]\n): string | null | undefined {\n let raw: string;\n try {\n raw = readFileSync(join(dir, 'package.json'), 'utf8');\n } catch {\n return undefined;\n }\n let pkg: Record<string, unknown>;\n try {\n pkg = JSON.parse(raw) as Record<string, unknown>;\n } catch {\n return null;\n }\n if (pkg.exports !== undefined) {\n const exp = pkg.exports as Record<string, unknown> | string | null;\n const root = exp && typeof exp === 'object' && '.' in exp ? exp['.'] : exp;\n return typeof root === 'string' ? root : null;\n }\n for (const field of [...mainFields, 'main']) {\n const value = pkg[field];\n if (field === 'browser') {\n const entry =\n value && typeof value === 'object'\n ? (value as Record<string, unknown>)['.']\n : value;\n if (typeof entry !== 'string') continue;\n // Vite picks between a browser entry and a different `module` entry\n // by sniffing the file for ESM syntax; that is not mirrored here.\n const sniffed =\n mainFields.includes('module') &&\n typeof pkg.module === 'string' &&\n pkg.module !== entry;\n return sniffed ? null : entry;\n }\n // Vite's `entryPoint ||= data.main`: an empty entry is no entry.\n if (typeof value === 'string' && value) return value;\n }\n return undefined;\n}\n\n/**\n * The module file an alias replacement actually resolves to.\n *\n * A replacement is a string substitution, not a module id. Vite's order: the\n * literal file, then the TS source of a JS spelling, then each of the\n * configured `extensions` in order; only then a directory, through its\n * package entry and else its `index`. A directory is never the answer: it\n * names one entry module, not every file in it.\n */\nfunction resolveReplacement(\n replacement: string,\n extensions: readonly string[],\n mainFields: readonly string[],\n readManifest = true\n): string | undefined {\n const direct = statOf(replacement);\n if (direct?.isFile()) return replacement;\n const ext = extname(replacement);\n const stem = ext ? replacement.slice(0, -ext.length) : replacement;\n const candidates = ext\n ? (TS_SOURCE_EXTENSIONS[ext] ?? []).map(e => stem + e)\n : [];\n for (const e of extensions) candidates.push(replacement + e);\n const file = candidates.find(candidate => statOf(candidate)?.isFile());\n if (file || !direct?.isDirectory()) return file;\n\n const entry = readManifest\n ? packageEntry(replacement, mainFields)\n : undefined;\n if (entry === null) return undefined;\n if (entry !== undefined) {\n // With the manifest skipped, as Vite resolves an entry: `main: \".\"`\n // would otherwise resolve this same directory forever.\n return resolveReplacement(\n join(replacement, entry),\n extensions,\n mainFields,\n false\n );\n }\n return extensions\n .map(e => join(replacement, `index${e}`))\n .find(candidate => statOf(candidate)?.isFile());\n}\n\n/**\n * Where generated registry modules live, in this config.\n *\n * `dirs` are whole trees; `files` are individual modules an alias named\n * without saying anything about their siblings. Both spellings of each (as\n * written, and through `realpath`) are present, because the alias stays a\n * symlink while Vite hands `transform` the real path.\n */\ntype RegistryExclusions = { dirs: readonly string[]; files: readonly string[] };\n\n/** A resolved ui-kit directory, and whether the alias identified the PACKAGE. */\ntype UiKitTarget = { dir: string; isPackageRoot: boolean };\n\nconst NO_EXCLUSIONS: RegistryExclusions = { dirs: [], files: [] };\n\n/**\n * ui-kit's generated entry points, as its package.json `exports` lists them.\n * An alias may redirect any one of them on its own, so each is resolved\n * separately rather than inferred from whichever alias named the package.\n */\nconst REGISTRY_SUBPATHS = [\n `/${REGISTRY_DIR_NAME}`,\n `/${REGISTRY_DIR_NAME}/components`,\n `/${REGISTRY_DIR_NAME}/docs`,\n `/${REGISTRY_DIR_NAME}/renderer`,\n] as const;\n\n/**\n * One alias applied to one importee, by Vite's own rules: exact, or a prefix\n * ending at a `/` segment boundary, or a pattern.\n */\nfunction aliasTargetFor(\n alias: { find: string | RegExp; replacement: string },\n importee: string\n): string | undefined {\n if (!alias.replacement) return undefined;\n\n if (typeof alias.find === 'string') {\n if (alias.find === importee) return alias.replacement;\n if (importee.startsWith(`${alias.find}/`)) {\n return alias.replacement + importee.slice(alias.find.length);\n }\n return undefined;\n }\n\n // A LOCAL CLONE. `test` and `[Symbol.replace]` both advance `lastIndex` on\n // a /g or /y expression, and the object belongs to Vite — leaving it\n // advanced made the user's alias stop resolving for the rest of the build.\n const find = new RegExp(alias.find.source, alias.find.flags);\n if (!find.test(importee)) return undefined;\n find.lastIndex = 0;\n return importee.replace(find, alias.replacement);\n}\n\n/** `realpathSync`, or undefined for a path that cannot be resolved. */\nfunction safeRealpath(p: string): string | undefined {\n try {\n return realpathSync(p);\n } catch {\n return undefined;\n }\n}\n\n/**\n * ui-kit's generated registry projection — metadata and documentation prose,\n * never component code, so it holds no utility map to find.\n *\n * It is skipped because it NAMES utility classes in example assertions (\"has\n * u-icon-sm class\"). The scan cannot tell a quoted name in prose from one in a\n * real class map, so those became `!important` rules in every app's entry CSS,\n * where `.u-icon-sm` outweighed Toast's own icon sizing.\n *\n * The exclusions are derived from the RESOLVED aliases, not from the string\n * \"ui-kit\" in the path: the alias may point anywhere, and an alias onto\n * `/vendor/pithy-ui/src` leaked `u-line-clamp-3` back out when this was a\n * path pattern alone. Every form is checked at this one choke point, so the\n * directory walk and the `transform` hook cannot disagree.\n */\nfunction isGeneratedRegistry(\n normalizedPath: string,\n exclusions: RegistryExclusions\n): boolean {\n return (\n exclusions.files.includes(normalizedPath) ||\n exclusions.dirs.some(dir => normalizedPath.startsWith(dir)) ||\n UI_KIT_REGISTRY_PATH.test(normalizedPath)\n );\n}\n\n/**\n * Check if a file path matches the include/exclude patterns\n */\nfunction shouldProcessFile(\n filePath: string,\n include: string[],\n exclude: string[],\n exclusions: RegistryExclusions = NO_EXCLUSIONS\n): boolean {\n // Simple pattern matching - could use micromatch for more robust matching\n const normalizedPath = filePath.replace(/\\\\/g, '/');\n\n if (isGeneratedRegistry(normalizedPath, exclusions)) return false;\n\n // Check excludes first\n for (const pattern of exclude) {\n if (matchPattern(normalizedPath, pattern)) {\n return false;\n }\n }\n\n // Check includes\n for (const pattern of include) {\n if (matchPattern(normalizedPath, pattern)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Simple glob pattern matching\n *\n * Converts glob patterns to regex:\n * `**\\/` → zero or more directory segments (including none)\n * `*` → any characters within a single path segment\n *\n * The pattern is tested both anchored and with an arbitrary prefix\n * so that `src/**\\/*.ts` matches both `src/main.ts` and\n * `/project/src/pages/App.ts`.\n */\nfunction matchPattern(path: string, pattern: string): boolean {\n // Convert glob pattern to regex\n const regexPattern = pattern\n .replace(/\\./g, '\\\\.')\n .replace(/\\*\\*\\//g, '{{GLOBSTAR_SLASH}}')\n .replace(/\\*\\*/g, '{{GLOBSTAR}}')\n .replace(/\\*/g, '[^/]*')\n .replace(/{{GLOBSTAR_SLASH}}/g, '(.*/)?')\n .replace(/{{GLOBSTAR}}/g, '.*');\n\n const regex = new RegExp(`^${regexPattern}$|^.*/${regexPattern}$`);\n return regex.test(path);\n}\n\n/** Channel declarations an UNGATED sheet carries, for the dropped count. */\nfunction fullChannelDeclarationCount(\n theme: Parameters<typeof themeToCss>[0],\n defaultMode: NonNullable<Parameters<typeof themeToCss>[1]>['defaultMode']\n): number {\n const full = themeToCss(theme, { defaultMode });\n return (full.match(/--color-[\\w-]+-(?:rgb|l|c|h)\\s*:/g) ?? []).length;\n}\n\n/**\n * Vite plugin for Pithy Design System CSS tree-shaking\n *\n * Extracts used utility classes from source files and generates\n * only the CSS needed for those utilities.\n *\n * Also prepends the **static design-system token stylesheet** to the virtual\n * module — the color palette plus every other token category (typography,\n * spacing, radius, borders, shadows, motion, a11y, iconography, layout) — so\n * that SSR/SSG output, which never runs the runtime managers, still resolves\n * every `var(--color-*)`, `var(--font-*)`, `var(--control-*)` and friends.\n * Tokens are not gated on utility usage — UI Kit component SCSS references them\n * outside of any `u-*` class, so that would leave those components unstyled. The\n * one exception is each colour token's `-rgb`/`-l`/`-c`/`-h` channel variants,\n * gated on `var()` references found in scanned stylesheets; see\n * `gateChannelVars`.\n *\n * Pass the app's design system config as the `designSystem` option so the\n * emitted tokens match what `initDesignSystem()` will write; if they diverge,\n * hydration rewrites the tokens and the page flashes.\n *\n * Keep that config in its own module and import it from both `pithy.config.ts`\n * and `vite.config.ts`. Do **not** import `./pithy.config` here: `vite.config.ts`\n * is bundled by esbuild and then executed by bare Node, and Vite externalizes\n * bare specifiers, so it would drag `@pithyjs/shared`'s `defineConfig` into a\n * Node ESM import that fails with `ERR_MODULE_NOT_FOUND`. A dedicated module\n * with no runtime imports still gives one source of truth.\n *\n * @example\n * // design-system.config.ts — type import only, so bare Node can load it\n * import type { DesignSystemConfig } from '@pithyjs/design-system/palette';\n *\n * export const designSystem: DesignSystemConfig = {\n * shadows: { preset: 'elevated' },\n * };\n *\n * @example\n * // vite.config.ts\n * import { designSystemPlugin } from '@pithyjs/vite-plugin';\n * import { designSystem } from './design-system.config';\n *\n * export default defineConfig({\n * plugins: [\n * designSystemPlugin({\n * // Same object pithy.config.ts uses — no mirroring, no drift\n * designSystem,\n * safelist: ['u-bg-success', /^u-text-/],\n * debug: true,\n * })\n * ]\n * });\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-design-system\",\"name\":\"designSystemPlugin\",\"stability\":\"experimental\",\"signature\":\"(options?: DesignSystemPluginOptions) => Plugin\"} */\nexport function designSystemPlugin(\n options: DesignSystemPluginOptions = {}\n): Plugin {\n const resolvedOptions = resolveOptions(options);\n const { include, exclude, debug, devMode } = resolvedOptions;\n\n /**\n * Base color tokens are NOT JIT-gated: `var(--color-*)` references come from\n * UI Kit component SCSS as well as from `u-*` utility classes, and the\n * collector only sees utility classes.\n *\n * Their `-rgb`/`-l`/`-c`/`-h` channel variants are gated on references found\n * by {@link scanChannelVarRefs}. `themeToCss` is therefore evaluated per\n * `load()`, not once per plugin instance: the scan it depends on runs in\n * `buildStart`, strictly after this function exists, and in dev it is re-run\n * when a scanned file changes.\n *\n * The gate fails open everywhere detection is uncertain; see\n * {@link scanChannelVarRefs} for why that direction and no other.\n *\n * Imported from the `@pithyjs/design-system/palette` subpath, NOT the package\n * root: the root `dist` entry is not loadable by bare Node (tsc emits\n * extensionless/directory specifiers), and Vite's config bundler externalizes\n * bare specifiers to a path Node then imports — so importing the root here\n * would break every vite.config load. `./palette` is an esbuild-bundled,\n * self-contained, DOM-free ESM file.\n */\n const defaultMode = defaultModeOf(resolvedOptions.designSystem);\n const theme = resolveTheme(resolvedOptions.designSystem.colors);\n\n function paletteCss(utilityCSS: string): string {\n const gate = createChannelVarGate({\n enabled: resolvedOptions.gateChannelVars,\n scan: channelScan,\n // Everything shipped in the same response, not just the utilities: the\n // token sheet is concatenated below, so a channel reference emitted\n // there would otherwise ship while the gate dropped its variable.\n extraRefs: collectChannelVarRefs(utilityCSS + '\\n' + tokensCSS),\n safelist: resolvedOptions.channelVarSafelist,\n });\n log(\n `Channel vars: ${gate.active ? 'gated' : 'all emitted'} — ${gate.reason}`\n );\n // A degraded scan means the feature is off and the build still succeeds,\n // which is indistinguishable from success behind a default-off flag. Warn\n // unconditionally, once, the way collect-css.ts does for its analogous\n // \"no plugin registered\" case.\n if (gate.degraded && resolvedOptions.gateChannelVars && !warnedInactive) {\n warnedInactive = true;\n console.warn(\n `[pithy-design-system] Channel-variable gating is INACTIVE — ${gate.reason}. ` +\n `Every --color-*-rgb/-l/-c/-h variable ships. Pass debug: true for the scan roots.`\n );\n }\n const css = themeToCss(theme, {\n defaultMode,\n keepChannelVar: gate.active ? gate.keep : undefined,\n });\n\n // The ACTIVE path needs a signal too, and until now only the harmless\n // state (gate off, keeping everything) printed anything. Every fail-closed\n // path in this module is silent in a real build otherwise: the only way one\n // has ever been found is by someone reading the scanner. One line, once,\n // naming what was dropped and where it looked.\n if (gate.active && !announcedActive) {\n announcedActive = true;\n const kept = (css.match(/--color-[\\w-]+-(?:rgb|l|c|h)\\s*:/g) ?? [])\n .length;\n const dropped = fullChannelDeclarationCount(theme, defaultMode) - kept;\n console.info(\n `[pithy-design-system] Channel-variable gating ACTIVE — dropped ${dropped} ` +\n `of ${dropped + kept} channel declarations (${gate.reason}). ` +\n `Scanned: ${channelScan?.filesScanned ?? 0} file(s) under ` +\n `${scannedRoots.join(', ') || 'no roots'}. ` +\n `A variable missing with JavaScript disabled means this scan did not see it — ` +\n `add it to channelVarSafelist or a root to channelVarScanRoots.`\n );\n }\n return css;\n }\n\n /**\n * Static stylesheet for every **non-color** token category — typography,\n * spacing, radius, borders, shadows, motion, a11y, iconography, layout.\n *\n * Same problem as the palette above, same shape of fix: those categories are\n * written to `document.documentElement.style` by their runtime managers, so a\n * JS-disabled SSG page had ~106 undefined `var()` references — headers in\n * Times serif, zero-padding buttons, no shadows, no focus rings. Serializing\n * them here makes the page paint correctly with no JavaScript, and the runtime\n * managers then write byte-identical values on hydration (both sides go\n * through the same pure formatters), so hydration is a visual no-op.\n *\n * Driven by the whole `designSystem` config rather than plugin-local defaults:\n * emitting defaults while the app configures `bodyFont: 'Inter'` would just\n * trade \"undefined until JS\" for \"wrong until JS\".\n *\n * Deliberately NOT JIT-gated: UI Kit component SCSS references these tokens\n * outside any `u-*` utility class, so filtering by detected utility usage\n * would leave those components unstyled. Cost is a fixed ~10 KB raw / ~2 KB\n * gzip per page. A usage gate of the shape the palette's channel variants got\n * is possible here too, but these are one variable per token, not five.\n *\n * Computed once per plugin instance — pure, deterministic, and dependent only\n * on plugin options, never on collector state.\n */\n const tokensCSS = designSystemToCss(resolvedOptions.designSystem, {\n defaultMode,\n });\n\n /** Palette + non-color tokens, prepended to every virtual-module response. */\n function staticTokens(utilityCSS: string): string {\n return paletteCss(utilityCSS) + '\\n' + tokensCSS;\n }\n\n let config: ResolvedConfig;\n let devServer: ViteDevServer | null = null;\n let collector: Collector;\n /** Channel-variable references found on disk; `null` until `buildStart`. */\n let channelScan: ChannelVarScan | null = null;\n let cachedCSS: string | null = null;\n let lastHash: string = '';\n let fullCSSBytes: number | null = null;\n\n /**\n * `<resolved ui-kit dir>/registry/`, with the realpath spelling too so an\n * alias onto a symlink and a `transform` id that is the real path both\n * match. `undefined` until first asked; reset in `configResolved`.\n */\n let registryExclusionsCache: RegistryExclusions | undefined;\n\n /** Latch so the degraded-scan warning prints once per build, not per load. */\n let warnedInactive = false;\n /** Same, for the active-path summary. */\n let announcedActive = false;\n /** Roots the last scan actually read, for that summary. */\n let scannedRoots: string[] = [];\n\n /** Log debug messages if debug mode is enabled */\n function log(...args: unknown[]): void {\n if (debug) {\n console.log('[pithy-design-system]', ...args);\n }\n }\n\n /**\n * Resolve the @pithyjs/ui-kit source directory from Vite aliases.\n * Returns the absolute path if found, undefined otherwise.\n *\n * The alias replacement may point to a file (e.g. `.../src/index.ts`)\n * rather than a directory. In that case we normalize to the containing\n * directory so that `walk()` can enumerate the source tree.\n *\n * Matches exact, prefix, subpath and RegExp aliases, in three passes ordered\n * by how strongly each form identifies the package (see the body). A subpath\n * (`@pithyjs/ui-kit/styles`) is peeled back to the package root; one that\n * cannot be peeled is used as-is, last.\n *\n * Hand-rolls Vite's alias semantics, as `aliasReplacement` in\n * channelVars.ts does. #366 proposes replacing both with\n * `config.createResolver()`.\n */\n function resolveUiKitTarget(): UiKitTarget | undefined {\n const aliases = aliasList();\n if (aliases.length === 0) return undefined;\n\n // The loop takes the first USABLE answer, so a weaker form must not run\n // before a stronger one — order of keys in the alias object would decide\n // the result. 0 NAMES the package, 1 DERIVES a root by stripping the\n // subpath, 2 falls back to the aliased directory.\n for (const pass of [0, 1, 2] as const) {\n for (const alias of aliases) {\n const dir = resolveFromAlias(alias, pass);\n // Pass 2 is a module's PARENT, which is a directory to scan and\n // nothing more. Only passes 0 and 1 identify the package itself, so\n // only they may imply where its registry sits.\n if (dir) return { dir, isPackageRoot: pass !== 2 };\n }\n }\n\n return undefined;\n }\n\n function resolveUiKitDir(): string | undefined {\n return resolveUiKitTarget()?.dir;\n }\n\n /** `config.resolve.alias` as a list; Vite's object form is not supported. */\n function aliasList(): { find: string | RegExp; replacement: string }[] {\n const aliases = config.resolve?.alias;\n return Array.isArray(aliases) ? aliases : [];\n }\n\n /**\n * One alias entry -> a usable ui-kit directory, or undefined.\n * `pass` selects which alias forms are eligible; see resolveUiKitDir.\n */\n function resolveFromAlias(\n alias: { find: string | RegExp; replacement: string },\n pass: 0 | 1 | 2\n ): string | undefined {\n if (!alias.replacement) return undefined;\n const NAME = UI_KIT_NAME;\n\n if (typeof alias.find === 'string') {\n // Vite's rule, not exact-only: `=== name`, or a prefix ending at a\n // `/` SEGMENT boundary. Exact-only here meant `{find:'@pithyjs'}`\n // resolved nowhere, so ui-kit's utility classes never reached the\n // collector and its components rendered UNSTYLED in JIT mode.\n if (alias.find === NAME) {\n return pass === 0 ? normalizeToDir(alias.replacement) : undefined;\n }\n if (NAME.startsWith(`${alias.find}/`)) {\n return pass === 0\n ? normalizeToDir(alias.replacement + NAME.slice(alias.find.length))\n : undefined;\n }\n if (alias.find.startsWith(`${NAME}/`)) {\n // A SUBPATH alias (`@pithyjs/ui-kit/styles`) names a directory inside\n // the package, so peel it off to get the root.\n // Neither subpath form may return a path inside the Vite root:\n // `walk(config.root)` covers that tree, and `log()` would report an\n // APP directory as \"ui-kit source\".\n const sub = alias.find.slice(NAME.length);\n const peeled = peelSubpath(alias.replacement, sub);\n if (peeled !== undefined) {\n if (pass !== 1) return undefined;\n const dir = normalizeToDir(peeled);\n return dir && !isInsideRoot(dir) ? dir : undefined;\n }\n // Unpeelable: the replacement points somewhere else entirely, which is\n // what every app here writes (`.../styles/index.scss`).\n //\n // This is only the directory to SCAN. What to exclude is collected\n // separately, over every alias — see `registryExclusions`.\n if (pass !== 2) return undefined;\n const dir = normalizeToDir(alias.replacement);\n return dir && !isInsideRoot(dir) ? dir : undefined;\n }\n return undefined;\n }\n\n if (alias.find instanceof RegExp) {\n // A LOCAL CLONE. The alias object is Vite's, and it calls\n // `pattern.test(importee)` on it for every later import. `test` and\n // `[Symbol.replace]` both advance `lastIndex` on /y or /g, so\n // leaving it advanced made the user's alias stop resolving for the\n // rest of the build — a module-resolution failure caused by a CSS\n // plugin. Resetting before the call did not cover that; not touching\n // the object does.\n if (pass !== 0) return undefined;\n const find = new RegExp(alias.find.source, alias.find.flags);\n if (!find.test(NAME)) return undefined;\n find.lastIndex = 0;\n // STRING replacement so `$1` works — the canonical monorepo alias\n // is `/^@pithyjs\\/(.*)$/` with `packages/$1/src`.\n // Only accept a usable answer: a broad regex matching first must\n // not shadow a later exact alias that would have worked.\n return normalizeToDir(NAME.replace(find, alias.replacement));\n }\n\n return undefined;\n }\n\n /** True when `p` is at or below the Vite root, which `walk()` already covers. */\n function isInsideRoot(p: string): boolean {\n if (!config.root) return false;\n const rel = relative(config.root, p);\n return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel));\n }\n\n /**\n * Ensure a path points to a directory. If the path is a file, return\n * its parent directory. Returns undefined if the path doesn't exist.\n */\n /**\n * Every generated-registry path this config can reach.\n *\n * Two independent sources, because one alias cannot answer both questions.\n * The preferred scan root contributes its own `registry/` subtree. Then\n * EVERY explicit `@pithyjs/ui-kit/registry*` alias contributes its own\n * target: an app may point the docs module at one tree and the package at\n * another, and Vite honours both, so deriving the exclusions from the\n * single preferred root let the override's docs through `transform`.\n */\n function registryExclusions(): RegistryExclusions {\n if (registryExclusionsCache) return registryExclusionsCache;\n const dirs = new Set<string>();\n const files = new Set<string>();\n const addDir = (p: string) => {\n for (const q of [p, safeRealpath(p)]) {\n if (q) dirs.add(`${q.replace(/\\\\/g, '/').replace(/\\/+$/, '')}/`);\n }\n };\n const addFile = (p: string) => {\n for (const q of [p, safeRealpath(p)]) {\n if (q) files.add(q.replace(/\\\\/g, '/'));\n }\n };\n\n // Where the package's own registry sits — but only from an alias that\n // identified the package. A module's parent directory is not a root.\n const target = resolveUiKitTarget();\n if (target?.isPackageRoot) addDir(join(target.dir, REGISTRY_DIR_NAME));\n\n // Then every alias that redirects a registry entry point, by the\n // specifier rather than by the alias name, so a pattern alias counts too.\n for (const sub of REGISTRY_SUBPATHS) {\n for (const alias of aliasList()) {\n const replacement = aliasTargetFor(alias, `${UI_KIT_NAME}${sub}`);\n if (!replacement) continue;\n const resolved = resolveReplacement(\n replacement,\n config.resolve?.extensions ?? RESOLVE_EXTENSIONS,\n config.resolve?.mainFields ?? MAIN_FIELDS\n );\n if (!resolved) continue;\n // ALWAYS the file itself, both spellings: a link on the file is not\n // resolved by taking the realpath of its directory, and Vite hands\n // `transform` the real path.\n addFile(resolved);\n const dir = registryDirOf(resolved, sub);\n if (dir) addDir(dir);\n }\n }\n\n registryExclusionsCache = { dirs: [...dirs], files: [...files] };\n return registryExclusionsCache;\n }\n\n /**\n * The registry DIRECTORY a file replacement implies, or undefined.\n *\n * Only when the path mirrors the alias name: `<x>/registry/docs.ts` for\n * `/registry/docs` puts the module IN the directory the subpath names, so\n * its generated siblings are covered too.\n *\n * A flat `<x>/registry.ts` ends in `/registry` as well, but that is the\n * file's basename — there the registry is a file, and claiming `<x>` or\n * `<x>/registry/` from it took out a real component. A one-segment subpath\n * claims a directory only through that directory's `index` entry.\n */\n function registryDirOf(replacement: string, sub: string): string | undefined {\n const noExt = replacement.replace(/\\\\/g, '/').replace(/\\.[^./]+$/, '');\n const isIndex = noExt.endsWith('/index');\n const logical = isIndex ? noExt.slice(0, -'/index'.length) : noExt;\n if (!logical.endsWith(sub)) return undefined;\n const drop = sub.split('/').length - 2;\n if (drop === 0) return isIndex ? logical : undefined;\n return logical.split('/').slice(0, -drop).join('/');\n }\n\n function normalizeToDir(p: string): string | undefined {\n try {\n const stat = statSync(p);\n if (stat.isDirectory()) return p;\n // It's a file — use the parent directory\n return dirname(p);\n } catch {\n return undefined;\n }\n }\n\n /**\n * Pre-scan source files on disk to populate the collector.\n * Called during buildStart so the virtual CSS module has all\n * utilities available on first load — no timing dependency.\n *\n * Also scans @pithyjs/ui-kit source (via Vite alias) since ui-kit\n * components build utility class names dynamically from maps that\n * the standard app-root walk would miss.\n */\n function scanSourceFiles(): void {\n const files: string[] = [];\n const exclusions = registryExclusions();\n\n function walk(dir: string): void {\n let entries;\n try {\n entries = readdirSync(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n if (\n entry.name === 'node_modules' ||\n entry.name === '.git' ||\n entry.name === 'dist'\n )\n continue;\n walk(fullPath);\n } else if (\n entry.isFile() &&\n shouldProcessFile(fullPath, include, exclude, exclusions)\n ) {\n files.push(fullPath);\n }\n }\n }\n\n // Scan app source files\n walk(config.root);\n\n // Scan @pithyjs/ui-kit source for dynamic utility class maps\n const uiKitDir = resolveUiKitDir();\n if (uiKitDir) {\n walk(uiKitDir);\n log(`Also scanning ui-kit source: ${uiKitDir}`);\n }\n\n for (const file of files) {\n try {\n const content = readFileSync(file, 'utf-8');\n collector.updateFile(file, content);\n } catch {\n // Skip unreadable files\n }\n }\n\n log(\n `Pre-scanned ${files.length} files, found ${collector.getAllUtilities().size} utilities`\n );\n }\n\n /**\n * Scan every stylesheet reachable from this build for channel-variable usage.\n *\n * Separate from `scanSourceFiles`: that walk is driven by `include`, which\n * lists `.ts`/`.tsx`/`.pithy` and no stylesheet at all, and it stops at the\n * app root plus the aliased ui-kit directory.\n */\n /** Whether two scans would gate identically — same refs, wildcards, degraded. */\n function sameChannelScan(\n a: ChannelVarScan | null,\n b: ChannelVarScan | null\n ): boolean {\n if (a === null || b === null) return a === b;\n const sameSet = (x: Set<string>, y: Set<string>) =>\n x.size === y.size && [...x].every(v => y.has(v));\n return (\n a.degraded === b.degraded &&\n sameSet(a.refs, b.refs) &&\n sameSet(\n a.wildcardSuffixes as Set<string>,\n b.wildcardSuffixes as Set<string>\n )\n );\n }\n\n function scanChannelVars(): void {\n if (!resolvedOptions.gateChannelVars) return;\n\n try {\n const plan = resolveChannelScanRoots(\n config.root,\n config.resolve?.alias,\n resolvedOptions.channelVarScanRoots\n );\n // Name the roots. A package outside the Vite root is simply not seen,\n // and the scan cannot report what it never looked at — so the only\n // honest signal is what it DID look at, next to the option that adds\n // more. Without this a sibling workspace package reads as \"clean\".\n log(\n `Channel-var scan roots (add others with \\`channelVarScanRoots\\`):\\n` +\n plan.roots.map(r => ` - ${r.dir}`).join('\\n')\n );\n scannedRoots = plan.roots.map(r => r.dir);\n channelScan = scanChannelVarRefs(plan);\n } catch (err) {\n // An unexpected throw would otherwise escape `buildStart` and fail the\n // build. Uncertainty ships everything; a crash ships nothing.\n channelScan = {\n refs: new Set(),\n wildcardSuffixes: new Set(),\n degraded: true,\n reason: `scan threw: ${String(err)}`,\n filesScanned: 0,\n };\n }\n log(\n `Channel-var scan: ${channelScan.filesScanned} file(s), ` +\n `${channelScan.refs.size} ref(s)` +\n (channelScan.degraded ? ` — DEGRADED: ${channelScan.reason}` : '')\n );\n }\n\n /**\n * Re-run the channel scan after a dev edit, before the HMR update goes out.\n *\n * The generated CSS is regenerated whenever collector state changes, but the\n * scan is not part of that state: without this, adding `var(--color-info-l)`\n * to a stylesheet regenerates the sheet against the scan taken at startup, the\n * variable is never emitted, and the element is unstyled with no error until\n * the dev server is restarted. Dev and build gate identically so the two\n * produce the same sheet — but do NOT read that as dev surfacing a gate\n * miss. `ThemeManager` writes the channel variables as INLINE styles on\n * `documentElement`, which outrank this `:root` sheet, so any app calling\n * `initDesignSystem()` paints correctly in dev and in a hydrated page even\n * when the gate drops a variable it should have kept. The only place a miss\n * is observable is the JavaScript-disabled static export — which is also\n * the only place it is a bug.\n */\n let rescanTimer: ReturnType<typeof setTimeout> | null = null;\n function rescanChannelVarsSoon(): void {\n if (!resolvedOptions.gateChannelVars) return;\n if (rescanTimer) clearTimeout(rescanTimer);\n rescanTimer = setTimeout(() => {\n rescanTimer = null;\n const before = channelScan;\n scanChannelVars();\n // The scan is a full re-glob, so only pay for the reload when the kept\n // set actually moved. Most edits touch no channel reference at all.\n if (sameChannelScan(before, channelScan)) return;\n cachedCSS = null;\n sendHMRUpdate();\n }, 50);\n rescanTimer.unref?.();\n }\n\n /**\n * Invalidate the virtual CSS module and send an HMR update.\n * Used for incremental updates during dev (file edits, additions, deletions).\n */\n function sendHMRUpdate(): void {\n if (!devServer) return;\n const module = devServer.moduleGraph.getModuleById(\n RESOLVED_VIRTUAL_MODULE_ID\n );\n if (module) {\n devServer.moduleGraph.invalidateModule(module);\n const updatePath = module.url || VIRTUAL_MODULE_ID;\n devServer.ws.send({\n type: 'update',\n updates: [\n {\n type: 'css-update',\n path: updatePath,\n acceptedPath: updatePath,\n timestamp: Date.now(),\n },\n ],\n });\n log('HMR update sent for changed utilities');\n }\n }\n\n /**\n * Generate CSS from collected utilities\n */\n function generateAndCacheCSS(): string {\n const utilities = collector.getAllUtilities();\n const currentHash = collector.getHash();\n\n // Return cached CSS if nothing changed\n if (cachedCSS && currentHash === lastHash) {\n log('Using cached CSS');\n return cachedCSS;\n }\n\n log(`Generating CSS for ${utilities.size} utilities...`);\n\n const isJitMode =\n resolvedOptions.jit || (config.command === 'serve' && devMode === 'jit');\n\n if (isJitMode) {\n const result = generateCSS(utilities, resolvedOptions);\n cachedCSS = staticTokens(result.css) + '\\n' + result.css;\n\n if (debug) {\n const { stats } = result;\n log(\n `Generated: ${stats.matched} matched, ${stats.unknown} unknown`,\n Object.entries(stats.byCategory)\n .map(([cat, n]) => `${cat}:${n}`)\n .join(', ')\n );\n\n // Compute full CSS size once for comparison\n if (fullCSSBytes === null) {\n const allUtils = enumerateAllUtilities();\n const fullResult = generateCSS(allUtils, resolvedOptions);\n fullCSSBytes = fullResult.stats.cssBytes;\n }\n\n const pct =\n fullCSSBytes > 0\n ? ((1 - stats.cssBytes / fullCSSBytes) * 100).toFixed(1)\n : '0';\n log(\n `CSS size: ${formatBytes(stats.cssBytes)} (tree-shaken) / ${formatBytes(fullCSSBytes)} (full) — ${pct}% smaller`\n );\n\n if (result.unknown.size > 0) {\n log('Unknown utilities:', [...result.unknown].slice(0, 10));\n if (result.unknown.size > 10) {\n log(` ... and ${result.unknown.size - 10} more`);\n }\n }\n }\n } else {\n // Full mode - include all utilities\n const allUtils = enumerateAllUtilities();\n const result = generateCSS(allUtils, resolvedOptions);\n cachedCSS = staticTokens(result.css) + '\\n' + result.css;\n }\n\n lastHash = currentHash;\n return cachedCSS;\n }\n\n return {\n name: 'pithy-design-system',\n\n // Read by `@pithyjs/ssr`'s static export, which runs a second,\n // declaration-level purge over the CSS this plugin emits and would\n // otherwise drop the runtime-composed names this safelist protects. There\n // is no import either way between the two packages.\n api: {\n channelVarSafelist: resolvedOptions.channelVarSafelist,\n },\n\n configResolved(resolvedConfig) {\n config = resolvedConfig;\n registryExclusionsCache = undefined;\n\n // Initialize collector — pass all enumerated utilities so regex\n // safelist entries (e.g. /^u-text-/) can be expanded correctly.\n collector = createCollector({\n safelist: resolvedOptions.safelist,\n allPossibleUtilities: enumerateAllUtilities(),\n });\n\n log('Plugin initialized');\n log('Include patterns:', include);\n log('Exclude patterns:', exclude);\n log('JIT mode:', resolvedOptions.jit);\n log('Dev mode:', devMode);\n },\n\n resolveId(id) {\n if (id === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_MODULE_ID;\n }\n return null;\n },\n\n load(id) {\n if (id === RESOLVED_VIRTUAL_MODULE_ID) {\n return generateAndCacheCSS();\n }\n return null;\n },\n\n transform(code, id) {\n // Skip if collector not yet initialized or file doesn't match\n if (\n !collector ||\n !shouldProcessFile(id, include, exclude, registryExclusions())\n ) {\n return null;\n }\n\n // Extract utilities from the file\n const diff = collector.updateFile(id, code);\n\n if (diff.hasChanges) {\n // Invalidate cached CSS\n cachedCSS = null;\n\n if (debug) {\n if (diff.added.size > 0) {\n log(`[${id}] Added:`, [...diff.added]);\n }\n if (diff.removed.size > 0) {\n log(`[${id}] Removed:`, [...diff.removed]);\n }\n }\n\n // Trigger HMR so the virtual CSS module reloads\n sendHMRUpdate();\n }\n\n // Don't transform the code, just extract utilities\n return null;\n },\n\n configureServer(srv: ViteDevServer) {\n devServer = srv;\n\n for (const event of ['add', 'change', 'unlink'] as const) {\n srv.watcher.on(event, filePath => {\n if (isChannelScanCandidate(filePath)) rescanChannelVarsSoon();\n });\n }\n\n srv.watcher.on('unlink', filePath => {\n if (\n !shouldProcessFile(filePath, include, exclude, registryExclusions())\n ) {\n return;\n }\n\n log(`File removed: ${filePath}`);\n collector.removeFile(filePath);\n cachedCSS = null;\n\n sendHMRUpdate();\n });\n },\n\n // An in-flight rescan would otherwise fire after the server is disposed,\n // running a full filesystem scan and broadcasting to a closed socket. The\n // SSG export hits this every run: `buildSSG` creates a middleware-mode\n // server whose watcher sees each emitted `.html`, and the last timer lands\n // after `vite.close()`.\n closeBundle() {\n if (rescanTimer) {\n clearTimeout(rescanTimer);\n rescanTimer = null;\n }\n devServer = null;\n },\n\n buildStart() {\n collector.clear();\n cachedCSS = null;\n lastHash = '';\n\n // Pre-scan source files so the collector is populated\n // before the virtual CSS module is first loaded\n scanSourceFiles();\n scanChannelVars();\n\n log('Build started - collector ready');\n },\n };\n}\n\n/**\n * Strip a subpath suffix off an alias replacement, yielding the package root.\n * Returns undefined when the replacement does not end with the subpath, or\n * when the peel is not absolute.\n *\n * Separator-insensitive: `sub` comes from an alias `find` and always uses `/`,\n * while `replacement` comes from `path.resolve`. Comparing them raw made the\n * peel never fire on Windows, and CI has no Windows job.\n */\nexport function peelSubpath(\n replacement: string,\n sub: string\n): string | undefined {\n const norm = (x: string) => x.replace(/\\\\/g, '/');\n if (!norm(replacement).endsWith(norm(sub))) return undefined;\n const peeled = replacement.slice(0, -sub.length);\n // `'./styles'` peels to '.', which made the plugin walk the process CWD.\n // Both platforms, not `isAbsolute`: that follows the host and would reject\n // `C:\\...` on a POSIX runner. Also catches '' from a bare `/styles`.\n if (!posix.isAbsolute(norm(peeled)) && !win32.isAbsolute(peeled)) {\n return undefined;\n }\n return peeled;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/designSystemPlugin/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAuPF;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,mCAAmC,CAAC;AAE9E;;GAEG;AACH,MAAM,eAAe,GAA0B;IAC7C,YAAY,EAAE,EAAE;IAChB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;IAC1C,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC;IAC1D,OAAO,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,CAAC,mBAAmB,IAAI,eAAe,CAAC,mBAAmB;KACrE,CAAC;AACJ,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin-design-system.types\",\n \"title\": \"Design System Plugin Types\",\n \"category\": \"types\",\n \"description\": \"TypeScript interfaces and types for the design system CSS tree-shaking plugin.\",\n \"since\": \"0.0.1\",\n \"stability\": \"experimental\",\n \"testing\": {\n \"unit\": { \"required\": false, \"covered\": false },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type {\n ThemeMode,\n DesignSystemConfig,\n} from '@pithyjs/design-system/palette';\n\n/**\n * Configuration options for the design system tree-shaking plugin\n */\nexport interface DesignSystemPluginOptions {\n /**\n * The app's **whole** design system config — the same object\n * `pithy.config.ts` puts in its `designSystem` block, passed through verbatim:\n *\n * ```ts\n * // design-system.config.ts — no runtime imports, so bare Node can load it\n * import type { DesignSystemConfig } from '@pithyjs/design-system/palette';\n * export const designSystem: DesignSystemConfig = { shadows: { preset: 'elevated' } };\n *\n * // vite.config.ts\n * import { designSystem } from './design-system.config';\n * designSystemPlugin({ designSystem })\n * ```\n *\n * Keep it in its own module rather than importing `./pithy.config` here:\n * `vite.config.ts` is bundled by esbuild and then run by bare Node, and Vite\n * externalizes bare specifiers, so importing the pithy config drags\n * `@pithyjs/shared`'s `defineConfig` into a Node ESM import that fails with\n * `ERR_MODULE_NOT_FOUND`. `pithy.config.ts` imports the same module, so there\n * is still one source of truth.\n *\n * Every non-color token category (typography, spacing, radius, borders,\n * shadows, motion, a11y, iconography) is serialized into the virtual module\n * from this, so SSR/SSG output paints without JavaScript.\n *\n * This is the only way to configure the emitted tokens: the config object is\n * passed through rather than re-declared, so `pithy.config.ts` stays the\n * single source of truth and there is no second place to drift from. Omit it\n * and the design system's own defaults are emitted — correct for an app that\n * also calls `initDesignSystem()` with no arguments, wrong (a hydration\n * rewrite) for an app that configures presets.\n */\n designSystem?: DesignSystemConfig;\n\n /**\n * Enable JIT (Just-In-Time) mode that only includes used utilities\n * @default true in production, false in development\n */\n jit?: boolean;\n\n /**\n * Development mode behavior\n * - 'full': Include all utilities (faster builds, larger CSS)\n * - 'jit': Only include used utilities (slower builds, smaller CSS)\n * @default 'full'\n */\n devMode?: 'full' | 'jit';\n\n /**\n * Classes to always include regardless of usage detection\n * Supports strings and RegExp patterns\n */\n safelist?: Array<string | RegExp>;\n\n /**\n * File patterns to scan for utility classes\n * @default ['src/**\\/*.ts', 'src/**\\/*.tsx', 'src/**\\/*.pithy']\n */\n include?: string[];\n\n /**\n * File patterns to exclude from scanning\n * @default ['**\\/*.test.ts', '**\\/*.spec.ts', 'node_modules/**']\n */\n exclude?: string[];\n\n /**\n * Emit a colour token's `-rgb`/`-l`/`-c`/`-h` variables only where a scanned\n * stylesheet reads them. Base tokens and state variants always ship.\n *\n * **OFF by default, deliberately.** Detection is a scan of source TEXT, so it\n * has to be right about regex-vs-division, string nesting, URL grammar and\n * comment syntax across six languages it does not parse. Eight distinct\n * positions where it read a live reference as a comment were found and fixed\n * during review, two of them inside the code added to fix the previous six —\n * and a missed reference drops a declaration that only renders wrong with\n * JavaScript disabled, which is the hardest place to notice it.\n *\n * It fails open everywhere it is uncertain and warns when it degrades, so\n * turning it on is safe to try; the measured saving on `apps/basic-app` is\n * −13,468 bytes raw / −1,455 gzip. BACKLOG #83 replaces this with a\n * declaration-level pass over the FINAL stylesheet, where interpolation is\n * already resolved and none of those positions can exist — 2.66× the gzip\n * saving, measured. Not \"no blind spots\": that pass has its own, listed on\n * BACKLOG #104.\n *\n * Detection scans the app root, `@pithyjs/ui-kit` and\n * `@pithyjs/design-system`; see the plugin's `channelVars` module.\n *\n * @default false\n */\n gateChannelVars?: boolean;\n\n /**\n * Channel variables to emit regardless of detected usage — for names built at\n * runtime (`--color-${name}-rgb`), which no scan can see.\n *\n * Added to the built-in list, which already covers the brand `-rgb` tints\n * `ShadowManager` composes. Strings match a full custom property name;\n * RegExps are tested against it.\n *\n * Published on the plugin's `api`, so `pithy-ssg`'s static export forwards it\n * into its own declaration-level purge — which cannot see these references\n * either. Setting it here is enough; no need to repeat the names in\n * `PithyConfig.keepCustomProperties`.\n */\n channelVarSafelist?: Array<string | RegExp>;\n\n /**\n * Extra directories to scan for `var(--color-*-rgb|-l|-c|-h)`.\n *\n * For a component library outside the Vite root that the automatic\n * `@pithyjs/*` resolution does not cover. A root that cannot be read disables\n * the gate rather than narrowing it.\n */\n channelVarScanRoots?: string[];\n\n /**\n * Enable debug logging\n * @default false\n */\n debug?: boolean;\n}\n\n/**\n * Resolved plugin options with all defaults applied\n */\nexport interface ResolvedPluginOptions {\n designSystem: DesignSystemConfig;\n jit: boolean;\n devMode: 'full' | 'jit';\n safelist: Array<string | RegExp>;\n include: string[];\n exclude: string[];\n gateChannelVars: boolean;\n channelVarSafelist: Array<string | RegExp>;\n channelVarScanRoots: string[];\n debug: boolean;\n}\n\n/**\n * Result of parsing a utility class with variant\n */\nexport interface ParsedUtility {\n /** The full class name as written (e.g., 'hover:u-bg-primary') */\n full: string;\n /** The variant prefix if any (e.g., 'hover', 'dark') */\n variant: string | null;\n /** The base utility without variant (e.g., 'u-bg-primary') */\n utility: string;\n}\n\n/**\n * Definition for a utility pattern that can generate CSS\n */\nexport interface UtilityPattern {\n /** Pattern name for debugging */\n name: string;\n /** Category for grouping in output */\n category: UtilityCategory;\n /** Regular expression to match utility class names */\n pattern: RegExp;\n /** Generate CSS for a matched utility class */\n generate: (className: string, match: RegExpMatchArray) => string | null;\n /**\n * Mark as externally provided (e.g. by SCSS).\n * When true, the utility is recognized as valid but no CSS is generated\n * (CSS is already provided by another source like compiled SCSS).\n */\n external?: boolean;\n}\n\n/**\n * Categories of utilities for organization (10 categories)\n */\nexport type UtilityCategory =\n | 'colors'\n | 'spacing'\n | 'borders'\n | 'typography'\n | 'layout'\n | 'a11y'\n | 'radius'\n | 'shadows'\n | 'motion'\n | 'iconography';\n\n/**\n * Result of CSS generation\n */\nexport interface GenerationResult {\n /** Generated CSS string */\n css: string;\n /** Utilities that were successfully matched */\n matched: Set<string>;\n /** Utilities that couldn't be matched to any pattern */\n unknown: Set<string>;\n /** Stats for debugging */\n stats: GenerationStats;\n}\n\n/**\n * Statistics from CSS generation\n */\nexport interface GenerationStats {\n total: number;\n matched: number;\n unknown: number;\n byCategory: Partial<Record<UtilityCategory, number>>;\n /** Generated CSS size in bytes */\n cssBytes: number;\n}\n\n/**\n * Collector state tracking utility usage per file\n */\nexport interface CollectorState {\n /** Map of file path to Set of utilities used in that file */\n fileUtilities: Map<string, Set<string>>;\n /** All unique utilities collected across all files */\n allUtilities: Set<string>;\n /** Utilities from safelist */\n safelistedUtilities: Set<string>;\n /** Hash of current state for cache invalidation */\n hash: string;\n}\n\n/**\n * Diff result when utilities change\n */\nexport interface UtilityDiff {\n added: Set<string>;\n removed: Set<string>;\n hasChanges: boolean;\n}\n\n/**\n * Virtual module ID for the generated CSS\n */\nexport const VIRTUAL_MODULE_ID = 'virtual:pithy-design-system';\n\n/**\n * Resolved virtual module ID (with null byte prefix per Vite convention)\n * The .css suffix tells Vite to process this through its CSS pipeline\n */\nexport const RESOLVED_VIRTUAL_MODULE_ID = '\\0virtual:pithy-design-system.css';\n\n/**\n * Default plugin options\n */\nconst DEFAULT_OPTIONS: ResolvedPluginOptions = {\n designSystem: {},\n jit: process.env.NODE_ENV === 'production',\n devMode: 'full',\n safelist: [],\n include: ['src/**/*.ts', 'src/**/*.tsx', 'src/**/*.pithy'],\n exclude: ['**/*.test.ts', '**/*.spec.ts', 'node_modules/**'],\n gateChannelVars: false,\n channelVarSafelist: [],\n channelVarScanRoots: [],\n debug: false,\n};\n\n/**\n * The mode the unqualified `:root` block paints — i.e. what static HTML with no\n * `data-theme` attribute renders as.\n *\n * `ColorsConfig` is a union — `true` / `false` / an object — and only the object\n * form carries a mode. Anything else means the design system's default, which is\n * what `themeToCss()` falls back to when `defaultMode` is undefined.\n *\n * @internal Exported for testing\n */\nexport function defaultModeOf(\n designSystem: DesignSystemConfig\n): ThemeMode | undefined {\n const colors = designSystem.colors;\n return typeof colors === 'object' && colors !== null\n ? colors.mode\n : undefined;\n}\n\n/**\n * Resolve user options with defaults.\n *\n * Colors are not a separate option: they come from `designSystem.colors` like\n * every other category, so there is exactly one place to configure them and\n * nothing to keep in agreement.\n */\nexport function resolveOptions(\n options: DesignSystemPluginOptions = {}\n): ResolvedPluginOptions {\n const designSystem = options.designSystem ?? DEFAULT_OPTIONS.designSystem;\n\n return {\n ...DEFAULT_OPTIONS,\n ...options,\n // Ensure objects/arrays are not undefined\n designSystem,\n safelist: options.safelist ?? DEFAULT_OPTIONS.safelist,\n include: options.include ?? DEFAULT_OPTIONS.include,\n exclude: options.exclude ?? DEFAULT_OPTIONS.exclude,\n gateChannelVars: options.gateChannelVars ?? DEFAULT_OPTIONS.gateChannelVars,\n channelVarSafelist:\n options.channelVarSafelist ?? DEFAULT_OPTIONS.channelVarSafelist,\n channelVarScanRoots:\n options.channelVarScanRoots ?? DEFAULT_OPTIONS.channelVarScanRoots,\n };\n}\n"]}
@@ -14,7 +14,7 @@
14
14
  }
15
15
  */
16
16
  import type { PluginOption } from 'vite';
17
- import type { ComponentScopesMap } from '../babelPlugin/extractUsedIdentifiers';
17
+ import type { ComponentScopesMap } from '../babelPlugin/extractUsedIdentifiers.js';
18
18
  /** @codexApi {"parent":"pithy.vite.html-transform-plugin","name":"HtmlTransformPluginOptions","stability":"stable","signature":"interface HtmlTransformPluginOptions"} */
19
19
  export interface HtmlTransformPluginOptions {
20
20
  /** Map of component names to variables they inject into children's scope */
@@ -1 +1 @@
1
- {"version":3,"file":"htmlTransform.d.ts","sourceRoot":"","sources":["../../src/htmlTransform/htmlTransform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,MAAM,CAAC;AAIzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAGhF,0KAA0K;AAC1K,MAAM,WAAW,0BAA0B;IACzC,4EAA4E;IAC5E,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC,kFAAkF;IAClF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oHAAoH;IACpH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qLAAqL;AACrL,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,0BAA0B,GACnC,YAAY,CAwEd"}
1
+ {"version":3,"file":"htmlTransform.d.ts","sourceRoot":"","sources":["../../src/htmlTransform/htmlTransform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,MAAM,CAAC;AAIzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAShF,0KAA0K;AAC1K,MAAM,WAAW,0BAA0B;IACzC,4EAA4E;IAC5E,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC,kFAAkF;IAClF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,oHAAoH;IACpH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qLAAqL;AACrL,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,0BAA0B,GACnC,YAAY,CAwEd"}
@@ -13,8 +13,11 @@
13
13
  }
14
14
  }
15
15
  */
16
- import pithyBabelPlugin from '../babelPlugin/babelPlugin';
16
+ import pithyBabelPlugin from '../babelPlugin/babelPlugin.js';
17
17
  import * as babel from '@babel/core';
18
+ import { createRequire } from 'node:module';
19
+ // Babel resolves preset names from the app, which may not see this package's deps.
20
+ const presetTypescript = createRequire(import.meta.url).resolve('@babel/preset-typescript');
18
21
  /**
19
22
  * Vite plugin that transforms `html\`\`` tagged templates and literal `html()` calls
20
23
  * in `.ts` and compiled `.pithy` modules using Babel.
@@ -75,7 +78,7 @@ export function htmlTransformPlugin(options) {
75
78
  plugins: [() => pithyBabelPlugin(babelPluginOptions)],
76
79
  presets: [
77
80
  [
78
- '@babel/preset-typescript',
81
+ presetTypescript,
79
82
  {
80
83
  onlyRemoveTypeImports: true,
81
84
  },
@@ -1 +1 @@
1
- {"version":3,"file":"htmlTransform.js","sourceRoot":"","sources":["../../src/htmlTransform/htmlTransform.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAGF,OAAO,gBAEN,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAYrC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qLAAqL;AACrL,MAAM,UAAU,mBAAmB,CACjC,OAAoC;IAEpC,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI,UAAU,GAAG,IAAI,CAAC;IAEtB,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,KAAc;QAEvB,cAAc,CAAC,MAAsB;YACnC,kEAAkE;YAClE,WAAW,GAAG,OAAO,EAAE,GAAG,IAAI,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC;YAEzD,UAAU,GAAG,MAAM,CAAC,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC;YAErE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC;YACnE,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBAChD,MAAM,IAAI,KAAK,CACb,oFAAoF;oBAClF,gEAAgE,CACnE,CAAC;YACJ,CAAC;QACH,CAAC;QAED,SAAS,CAAC,IAAY,EAAE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C,CAAC,CAAC,CAAC;YAC5C,wDAAwD;YACxD,2EAA2E;YAC3E,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBACnE,OAAO;YACT,IACE,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;gBACvB,CAAC,iEAAiE,CAAC,IAAI,CACrE,IAAI,CACL;gBAED,OAAO;YAET,MAAM,kBAAkB,GAA4B;gBAClD,eAAe,EAAE,OAAO,EAAE,eAAe;gBACzC,GAAG,EAAE,WAAW;gBAChB,SAAS,EAAE,OAAO,EAAE,SAAS;gBAC7B,QAAQ,EAAE,YAAY;aACvB,CAAC;YAEF,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;gBACvC,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;gBACrD,OAAO,EAAE;oBACP;wBACE,gBAAgB;wBAChB;4BACE,qBAAqB,EAAE,IAAI;yBAC5B;qBACF;iBACF;gBACD,UAAU,EAAE;oBACV,UAAU,EAAE,QAAQ;oBACpB,OAAO,EAAE,CAAC,YAAY,CAAC;iBACxB;gBACD,UAAU,EAAE,KAAK;gBACjB,UAAU;aACX,CAAC,CAAC;YAEH,OAAO;gBACL,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,IAAI;gBAC1B,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI;aACzB,CAAC;QACJ,CAAC;KACF,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite.html-transform-plugin\",\n \"title\": \"HTML Transform Vite Plugin\",\n \"category\": \"plugin\",\n \"description\": \"Babel-based Vite plugin that transforms html`…` tagged templates and literal html() calls in .ts and compiled .pithy modules, with optional AOT compilation to eliminate runtime HTML parsing.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"htmlTransformAot.test.ts\" },\n \"integration\": { \"required\": true, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type { PluginOption, ResolvedConfig } from 'vite';\nimport pithyBabelPlugin, {\n type PithyBabelPluginOptions,\n} from '../babelPlugin/babelPlugin';\nimport type { ComponentScopesMap } from '../babelPlugin/extractUsedIdentifiers';\nimport * as babel from '@babel/core';\nimport { createRequire } from 'node:module';\n\n// Babel resolves preset names from the app, which may not see this package's deps.\nconst presetTypescript = createRequire(import.meta.url).resolve(\n '@babel/preset-typescript'\n);\n\n/** @codexApi {\"parent\":\"pithy.vite.html-transform-plugin\",\"name\":\"HtmlTransformPluginOptions\",\"stability\":\"stable\",\"signature\":\"interface HtmlTransformPluginOptions\"} */\nexport interface HtmlTransformPluginOptions {\n /** Map of component names to variables they inject into children's scope */\n componentScopes?: ComponentScopesMap;\n /** Enable AOT template compilation. Default: true in build mode, false in dev. */\n aot?: boolean;\n /** Fail the build if any template falls back to JIT, i.e. any `[pithy:aot:jit-fallback]` report. Default: false. */\n strictAot?: boolean;\n}\n\n/**\n * Vite plugin that transforms `html\\`\\`` tagged templates and literal `html()` calls\n * in `.ts` and compiled `.pithy` modules using Babel.\n *\n * In build mode, templates are AOT-compiled to eliminate runtime HTML parsing.\n * In dev mode, tagged templates only get their context injected and still render\n * through the runtime compiler, unless `aot` is explicitly enabled.\n * `pithyPlugin()` must be listed before this plugin.\n *\n * @param options - Plugin configuration for AOT mode, strict AOT, and component scopes\n * @returns A Vite plugin that transforms html tagged templates\n *\n * @example\n * ```ts\n * import { htmlTransformPlugin } from '@pithyjs/vite-plugin';\n *\n * export default defineConfig({\n * plugins: [htmlTransformPlugin({ aot: true })],\n * });\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.vite.html-transform-plugin\",\"name\":\"htmlTransformPlugin\",\"stability\":\"stable\",\"signature\":\"(options?: HtmlTransformPluginOptions) => PluginOption\"} */\nexport function htmlTransformPlugin(\n options?: HtmlTransformPluginOptions\n): PluginOption {\n let resolvedAot = false;\n let sourceMaps = true;\n\n const plugin = {\n name: 'pithy:html-transform',\n enforce: 'pre' as const,\n\n configResolved(config: ResolvedConfig) {\n // Default: AOT enabled in build, disabled in dev (for faster HMR)\n resolvedAot = options?.aot ?? config.command === 'build';\n\n sourceMaps = config.command === 'serve' || !!config.build?.sourcemap;\n\n const plugins = config.plugins ?? [];\n const sfc = plugins.findIndex(p => p.name === 'vite-plugin-pithy');\n if (sfc !== -1 && sfc > plugins.indexOf(plugin)) {\n throw new Error(\n '[pithy:html-transform] pithyPlugin() must be listed before htmlTransformPlugin(), ' +\n 'so .pithy files reach the template transform already compiled.'\n );\n }\n },\n\n transform(code: string, id: string) {\n // Strip Vite query/hash suffixes (e.g. component.ts?import → component.ts)\n const normalizedId = id.split(/[?#]/, 1)[0];\n // Fast-path: skip files with no pithy tagged templates.\n // Check for html` (common case) or aliased html import from @pithyjs/core.\n if (!normalizedId.endsWith('.ts') && !normalizedId.endsWith('.pithy'))\n return;\n if (\n !code.includes('html`') &&\n !/import\\s*\\{[^}]*\\bhtml\\b[^}]*\\}\\s*from\\s+['\"]@pithyjs\\/core['\"]/.test(\n code\n )\n )\n return;\n\n const babelPluginOptions: PithyBabelPluginOptions = {\n componentScopes: options?.componentScopes,\n aot: resolvedAot,\n strictAot: options?.strictAot,\n filename: normalizedId,\n };\n\n const result = babel.transformSync(code, {\n filename: normalizedId,\n plugins: [() => pithyBabelPlugin(babelPluginOptions)],\n presets: [\n [\n presetTypescript,\n {\n onlyRemoveTypeImports: true,\n },\n ],\n ],\n parserOpts: {\n sourceType: 'module',\n plugins: ['typescript'],\n },\n configFile: false,\n sourceMaps,\n });\n\n return {\n code: result?.code ?? code,\n map: result?.map ?? null,\n };\n },\n };\n return plugin;\n}\n"]}
@@ -13,6 +13,6 @@
13
13
  }
14
14
  }
15
15
  */
16
- export { pithyIcons } from './plugin';
17
- export type { PithyIconsOptions } from './types';
16
+ export { pithyIcons } from './plugin.js';
17
+ export type { PithyIconsOptions } from './types.js';
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -13,5 +13,5 @@
13
13
  }
14
14
  }
15
15
  */
16
- export { pithyIcons } from './plugin';
16
+ export { pithyIcons } from './plugin.js';
17
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/iconsPlugin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/iconsPlugin/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin-icons.exports\",\n \"title\": \"Vite Icons Plugin Entry\",\n \"category\": \"plugin\",\n \"description\": \"Public entry point re-exporting the icon sprite Vite plugin and its types.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": false, \"covered\": false },\n \"integration\": { \"required\": true, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nexport { pithyIcons } from './plugin';\nexport type { PithyIconsOptions } from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"optimize.js","sourceRoot":"","sources":["../../src/iconsPlugin/optimize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;;;;;;;;GAcG;AAEH,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;;;;;;;;;;GAYG;AACH,MAAM,cAAc,GAClB,+HAA+H,CAAC;AAElI;;;;;;GAMG;AACH,MAAM,WAAW,GACf,yHAAyH,CAAC;AAE5H;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Ac,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAEnC,2EAA2E;IAC3E,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEpD,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ;QAC9C,OAAO;QACP,KAAK;QACL,SAAS;QACT,IAAI;KACL,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E;;GAEG;AACH,4JAA4J;AAC5J,MAAM,UAAU,cAAc,CAAC,KAAsB;IACnD,MAAM,OAAO,GAAG,KAAK;SAClB,GAAG,CAAC,IAAI,CAAC,EAAE;QACV,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,sGAAsG;QACtG,OAAO,eAAe,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,WAAW,CAAC;IAC1H,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,6CAA6C,OAAO,UAAU,CAAC;AACxE,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin-icons.optimize\",\n \"title\": \"SVG Optimization for Icon Sprites\",\n \"category\": \"plugin\",\n \"description\": \"Optimizes SVG icons by stripping metadata, enforcing currentColor, and generating sprite sheets.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"iconsPlugin.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\n/**\n * Lightweight SVG optimization for icon sprites.\n *\n * Strips unnecessary metadata, enforces `currentColor` for theme integration,\n * and extracts the viewBox for sprite symbol generation.\n *\n * Intentionally avoids a full SVGO dependency — covers the 80% case\n * (icon SVGs from standard icon sets) with simple regex transforms.\n *\n * Known limitations of the regex approach:\n * - CDATA sections are not handled (rare in icon SVGs)\n * - Multi-line attributes may not be matched correctly\n * - Nested `<svg>` elements are not supported\n * For complex SVGs, pre-process with SVGO before adding to the icons directory.\n */\n\n// ---------------------------------------------------------------------------\n// Metadata stripping\n// ---------------------------------------------------------------------------\n\n/**\n * Elements to remove entirely (open tag → close tag, or self-closing).\n *\n * Note: `<defs>` and `<style>` are intentionally preserved — they can contain\n * gradients, clip paths, masks, or class-based styling referenced by the icon's\n * child elements. Stripping them would silently break those icons.\n * `<script>` is stripped for security reasons.\n *\n * Limitation: the `[\\s\\S]*?` non-greedy match can over-match if the same tag\n * name appears nested. This is acceptable for `metadata`, `title`, `desc`, and\n * `script` which are never nested in valid icon SVGs. For complex SVGs,\n * pre-process with SVGO before adding to the icons directory.\n */\nconst STRIP_ELEMENTS =\n /<(?:metadata|title|desc|script)\\b[^>]*>[\\s\\S]*?<\\/(?:metadata|title|desc|script)>|<(?:metadata|title|desc|script)\\b[^>]*\\/>/gi;\n\n/**\n * Attributes to remove from all elements.\n *\n * Note: `id` is intentionally preserved — internal IDs are needed for\n * `url(#id)` references (gradients, clip paths, masks). The sprite `<symbol>`\n * gets its own ID from the filename, not from SVG-internal IDs.\n */\nconst STRIP_ATTRS =\n /\\s(?:xmlns:(?:xlink|svg|dc|cc|rdf|sodipodi|inkscape)|data-name|inkscape:[a-z-]+|sodipodi:[a-z-]+)=(?:\"[^\"]*\"|'[^']*')/gi;\n\n/**\n * Inline event handler attributes (e.g. `onload`, `onclick`, `onerror`).\n * Stripped as defense-in-depth against XSS when adding third-party SVGs.\n * While `<use>` references don't execute scripts in modern browsers,\n * removing these attributes avoids any risk if the SVG is used differently.\n */\nconst STRIP_EVENT_HANDLERS = /\\s+on[a-z]+=(?:\"[^\"]*\"|'[^']*')/gi;\n\n/**\n * `href` and `xlink:href` attributes with `javascript:` protocol.\n * Stripped to prevent script execution via link navigation.\n */\nconst STRIP_JS_HREF =\n /\\s+(?:xlink:)?href=(?:\"javascript:[^\"]*\"|'javascript:[^']*')/gi;\n\n/** XML comments */\nconst STRIP_COMMENTS = /<!--[\\s\\S]*?-->/g;\n\n/** XML processing instructions */\nconst STRIP_PI = /<\\?xml[^?]*\\?>/gi;\n\n/** DOCTYPE declarations */\nconst STRIP_DOCTYPE = /<!DOCTYPE[^>]*>/gi;\n\n// ---------------------------------------------------------------------------\n// currentColor enforcement\n// ---------------------------------------------------------------------------\n\n/**\n * Replace hardcoded fill/stroke colors with `currentColor`.\n *\n * Preserves `fill=\"none\"` and `stroke=\"none\"` since those are structural\n * (e.g. a circle with fill=\"none\" is an outlined circle, not a filled one).\n *\n * Skips content inside `<defs>` blocks to preserve gradients, patterns,\n * clip paths, and masks that use explicit colors.\n */\nconst FILL_REPLACE =\n /\\bfill=(?:\"(?!none\")(?!url\\()[^\"]*\"|'(?!none')(?!url\\()[^']*')/gi;\nconst STROKE_REPLACE =\n /\\bstroke=(?:\"(?!none\")(?!url\\()[^\"]*\"|'(?!none')(?!url\\()[^']*')/gi;\nconst DEFS_BLOCK_RE = /<defs\\b[^>]*>[\\s\\S]*?<\\/defs>/gi;\n\nfunction enforceCurrentColor(svg: string): string {\n // Extract <defs> blocks and replace with placeholders to protect them\n const defsBlocks: string[] = [];\n const withoutDefs = svg.replace(DEFS_BLOCK_RE, match => {\n defsBlocks.push(match);\n return `__PITHY_DEFS_${defsBlocks.length - 1}__`;\n });\n\n // Apply currentColor replacement on non-defs content\n let result = withoutDefs\n .replace(FILL_REPLACE, 'fill=\"currentColor\"')\n .replace(STROKE_REPLACE, 'stroke=\"currentColor\"');\n\n // Restore <defs> blocks unchanged\n for (let i = 0; i < defsBlocks.length; i++) {\n result = result.replace(`__PITHY_DEFS_${i}__`, defsBlocks[i]);\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// viewBox extraction\n// ---------------------------------------------------------------------------\n\nconst VIEWBOX_RE = /viewBox=(?:\"([^\"]*)\"|'([^']*)')/i;\n\n/** Validates that a viewBox value contains only safe numeric characters. */\nconst SAFE_VIEWBOX_RE = /^[\\d.\\s,-]+$/;\n\n/** Extract viewBox from an SVG string. Falls back to \"0 0 24 24\". */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons.optimize\",\"name\":\"extractViewBox\",\"stability\":\"stable\",\"signature\":\"(svg: string) => string\"} */\nexport function extractViewBox(svg: string): string {\n const match = VIEWBOX_RE.exec(svg);\n const raw = match?.[1] ?? match?.[2] ?? '0 0 24 24';\n // Validate viewBox contains only numeric/space/dot/comma/dash — prevent attribute breakout\n if (!SAFE_VIEWBOX_RE.test(raw)) {\n console.warn(\n `[pithy:icons] Invalid viewBox value \"${raw}\" — using fallback \"0 0 24 24\"`\n );\n return '0 0 24 24';\n }\n return raw;\n}\n\n// ---------------------------------------------------------------------------\n// SVG inner content extraction + root attribute extraction\n// ---------------------------------------------------------------------------\n\nconst SVG_OPEN_RE = /<svg\\b([^>]*)>/i;\nconst SVG_CLOSE_RE = /<\\/svg>\\s*$/i;\n\n/** Extract the inner content of an SVG (everything between <svg> and </svg>) */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons.optimize\",\"name\":\"extractSvgInner\",\"stability\":\"stable\",\"signature\":\"(svg: string) => string\"} */\nexport function extractSvgInner(svg: string): string {\n return svg\n .replace(/<svg\\b[^>]*>/i, '')\n .replace(SVG_CLOSE_RE, '')\n .trim();\n}\n\n/**\n * Presentational attributes that should be carried from the root `<svg>`\n * onto the `<symbol>` element so child elements inherit them correctly.\n *\n * Without this, stroke-based icons (Feather, Heroicons) lose their\n * `fill=\"none\" stroke=\"currentColor\"` from the root and render as filled.\n */\nconst PRESENTATIONAL_ATTRS = [\n 'fill',\n 'stroke',\n 'stroke-width',\n 'stroke-linecap',\n 'stroke-linejoin',\n];\n\n/** Pre-built regex map for presentational attribute extraction */\nconst ATTR_RE_MAP = new Map<string, RegExp>(\n PRESENTATIONAL_ATTRS.map(name => [\n name,\n new RegExp(`\\\\b${name}=(?:\"([^\"]*)\"|'([^']*)')`, 'i'),\n ])\n);\n\n/** Extract presentational attributes from the root <svg> tag. */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons.optimize\",\"name\":\"extractRootAttrs\",\"stability\":\"stable\",\"signature\":\"(svg: string) => string\"} */\nexport function extractRootAttrs(svg: string): string {\n const match = SVG_OPEN_RE.exec(svg);\n if (!match) return '';\n\n const openTag = match[1];\n const attrs: string[] = [];\n\n for (const name of PRESENTATIONAL_ATTRS) {\n const attrMatch = ATTR_RE_MAP.get(name)!.exec(openTag);\n if (attrMatch) {\n const val = (attrMatch[1] ?? attrMatch[2])!;\n // Validate attribute value — skip if it contains suspicious content\n if (SAFE_ATTR_VALUE_RE.test(val)) {\n attrs.push(`${name}=\"${val}\"`);\n } else {\n attrs.push(`${name}=\"${escapeXmlAttr(val)}\"`);\n }\n }\n }\n\n return attrs.join(' ');\n}\n\n// ---------------------------------------------------------------------------\n// XML escaping\n// ---------------------------------------------------------------------------\n\n/** Escape a string for safe use inside an XML attribute value (double-quoted). */\nfunction escapeXmlAttr(value: string): string {\n return value\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\n\n/** Validate that a value is safe for use as an XML/SVG attribute (no injection). */\nconst SAFE_ATTR_VALUE_RE = /^[a-zA-Z0-9.:\\-_#(),\\s/]+$/;\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\nexport interface OptimizedIcon {\n /** Symbol ID for the sprite */\n id: string;\n /** viewBox attribute value */\n viewBox: string;\n /** Cleaned SVG inner content (for <symbol> body) */\n inner: string;\n /** Presentational attributes from root <svg> (e.g. fill=\"none\" stroke=\"currentColor\") */\n rootAttrs: string;\n /** Search tags derived from filename */\n tags: string[];\n}\n\n/**\n * Optimize an SVG icon for sprite inclusion.\n *\n * @param raw - Raw SVG file content\n * @param name - Icon name (used as symbol ID)\n * @param options - Optimization options\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons.optimize\",\"name\":\"optimizeIcon\",\"stability\":\"stable\",\"signature\":\"(raw: string, name: string, options: { prefix?: string; enforceCurrentColor?: boolean }) => OptimizedIcon\"} */\nexport function optimizeIcon(\n raw: string,\n name: string,\n options: { prefix?: string; enforceCurrentColor?: boolean } = {}\n): OptimizedIcon {\n const { prefix = '', enforceCurrentColor: shouldEnforce = true } = options;\n\n // Sanitize name for use as XML id and URL fragment identifier\n const safeName = name.replace(/[^a-z0-9-_]/gi, '-');\n\n let svg = raw;\n\n // Strip non-content elements\n svg = svg.replace(STRIP_PI, '');\n svg = svg.replace(STRIP_DOCTYPE, '');\n svg = svg.replace(STRIP_COMMENTS, '');\n svg = svg.replace(STRIP_ELEMENTS, '');\n svg = svg.replace(STRIP_ATTRS, '');\n svg = svg.replace(STRIP_EVENT_HANDLERS, '');\n svg = svg.replace(STRIP_JS_HREF, '');\n\n // Safety net: ensure no <script tags survived regex stripping (defense-in-depth)\n if (/<script\\b/i.test(svg)) {\n // Aggressively strip any remaining script-like content\n svg = svg.replace(/<script\\b[^>]*>?[\\s\\S]*?(?:<\\/script>|$)/gi, '');\n console.warn(\n `[pithy:icons] Residual <script> tag detected and stripped in icon \"${name}\"`\n );\n }\n\n // Enforce currentColor for design system integration\n if (shouldEnforce) {\n svg = enforceCurrentColor(svg);\n }\n\n const viewBox = extractViewBox(svg);\n const rootAttrs = extractRootAttrs(svg);\n const inner = extractSvgInner(svg);\n\n // Derive search tags from filename (e.g. \"arrow-left\" → [\"arrow\", \"left\"])\n const tags = safeName.split(/[-_]/).filter(Boolean);\n\n return {\n id: prefix ? `${prefix}${safeName}` : safeName,\n viewBox,\n inner,\n rootAttrs,\n tags,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Sprite generation\n// ---------------------------------------------------------------------------\n\n/**\n * Generate an SVG sprite sheet from optimized icons.\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons.optimize\",\"name\":\"generateSprite\",\"stability\":\"stable\",\"signature\":\"(icons: OptimizedIcon[]) => string\"} */\nexport function generateSprite(icons: OptimizedIcon[]): string {\n const symbols = icons\n .map(icon => {\n const attrs = icon.rootAttrs ? ` ${icon.rootAttrs}` : '';\n // id is already sanitized to [a-zA-Z0-9-_], viewBox validated to numeric — escape as defense-in-depth\n return `<symbol id=\"${escapeXmlAttr(icon.id)}\" viewBox=\"${escapeXmlAttr(icon.viewBox)}\"${attrs}>${icon.inner}</symbol>`;\n })\n .join('\\n');\n\n return `<svg xmlns=\"http://www.w3.org/2000/svg\">\\n${symbols}\\n</svg>`;\n}\n"]}
@@ -14,7 +14,7 @@
14
14
  }
15
15
  */
16
16
  import type { Plugin } from 'vite';
17
- import { type PithyIconsOptions } from './types';
17
+ import { type PithyIconsOptions } from './types.js';
18
18
  /**
19
19
  * Vite plugin for SVG icon sprite generation.
20
20
  *
@@ -15,8 +15,8 @@
15
15
  */
16
16
  import { readFileSync, readdirSync } from 'fs';
17
17
  import { join, basename, dirname, extname, resolve } from 'path';
18
- import { optimizeIcon, generateSprite } from './optimize';
19
- import { VIRTUAL_MODULE_ID, RESOLVED_VIRTUAL_MODULE_ID, SPRITE_CONTENT_MODULE_ID, RESOLVED_SPRITE_CONTENT_MODULE_ID, resolveOptions, } from './types';
18
+ import { optimizeIcon, generateSprite } from './optimize.js';
19
+ import { VIRTUAL_MODULE_ID, RESOLVED_VIRTUAL_MODULE_ID, SPRITE_CONTENT_MODULE_ID, RESOLVED_SPRITE_CONTENT_MODULE_ID, resolveOptions, } from './types.js';
20
20
  /**
21
21
  * Vite plugin for SVG icon s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pB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;6BACtB;yBACF;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin-icons\",\n \"title\": \"Vite Plugin for Icon Sprite Generation\",\n \"category\": \"plugin\",\n \"description\": \"SVG icon sprite generation plugin with optimization, HMR, and virtual module output.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"iconsPlugin.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\nimport type { Plugin, ResolvedConfig } from 'vite';\nimport { readFileSync, readdirSync } from 'fs';\nimport { join, basename, dirname, extname, resolve } from 'path';\nimport { optimizeIcon, generateSprite, type OptimizedIcon } from './optimize';\nimport {\n VIRTUAL_MODULE_ID,\n RESOLVED_VIRTUAL_MODULE_ID,\n SPRITE_CONTENT_MODULE_ID,\n RESOLVED_SPRITE_CONTENT_MODULE_ID,\n resolveOptions,\n type PithyIconsOptions,\n type SpriteIconMeta,\n} from './types';\n\n/**\n * Vite plugin for SVG icon sprite generation.\n *\n * Scans an icons directory, optimizes SVGs (strip metadata, enforce\n * `currentColor`), and generates:\n * - An SVG sprite asset (emitted as a Rollup asset in build, served in dev)\n * - A `virtual:pithy-icons` module exporting `SPRITE_URL`, `ICON_NAMES`,\n * and `ICON_META` for runtime registration\n * - A `virtual:pithy-icons/sprite` module exporting `SPRITE_CONTENT` — the\n * sprite text itself, so static export can inline the symbols a page uses\n * instead of referencing a file it never ships\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { pithyIcons } from '@pithyjs/vite-plugin';\n *\n * export default defineConfig({\n * plugins: [\n * pithyIcons({ dir: 'src/icons' })\n * ]\n * });\n * ```\n *\n * @example\n * ```ts\n * // main.ts — register icons at app startup\n * import { SPRITE_URL, ICON_NAMES, ICON_META } from \"virtual:pithy-icons\";\n * import { registerIconSprite } from \"@pithyjs/ui-kit/icons\";\n * registerIconSprite(SPRITE_URL, ICON_NAMES, ICON_META);\n * ```\n */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons\",\"name\":\"pithyIcons\",\"stability\":\"stable\",\"signature\":\"(options?: PithyIconsOptions) => Plugin\"} */\nexport function pithyIcons(options: PithyIconsOptions = {}): Plugin {\n const resolved = resolveOptions(options);\n\n let config: ResolvedConfig;\n let iconsDir: string;\n let cachedIcons: OptimizedIcon[] | null = null;\n let spriteContent: string | null = null;\n let emittedAssetId: string | null = null;\n\n /** Dev-mode sprite serving path (computed from base config) */\n let devSpritePath: string;\n\n function log(...args: unknown[]): void {\n if (resolved.debug) {\n console.log('[pithy:icons]', ...args);\n }\n }\n\n /**\n * Scan the icons directory and optimize all SVG files.\n */\n function scanIcons(): OptimizedIcon[] {\n if (cachedIcons) return cachedIcons;\n\n const icons: OptimizedIcon[] = [];\n\n let entries: import('fs').Dirent[];\n try {\n entries = readdirSync(iconsDir, {\n withFileTypes: true,\n encoding: 'utf-8',\n });\n } catch {\n log(`Icons directory not found: ${iconsDir}`);\n cachedIcons = icons;\n spriteContent = generateSprite(icons);\n return icons;\n }\n\n for (const entry of entries) {\n if (!entry.isFile()) continue;\n const ext = extname(entry.name).toLowerCase();\n if (ext !== '.svg') continue;\n\n const name = basename(entry.name, ext);\n const filePath = join(iconsDir, entry.name);\n\n try {\n const raw = readFileSync(filePath, 'utf-8');\n const icon = optimizeIcon(raw, name, {\n prefix: resolved.prefix,\n enforceCurrentColor: resolved.enforceCurrentColor,\n });\n icons.push(icon);\n } catch (err) {\n console.warn(\n `[pithy:icons] Failed to process ${entry.name}:`,\n err instanceof Error ? err.message : err\n );\n }\n }\n\n icons.sort((a, b) => a.id.localeCompare(b.id));\n cachedIcons = icons;\n spriteContent = generateSprite(icons);\n\n log(`Scanned ${icons.length} icons from ${iconsDir}`);\n return icons;\n }\n\n /**\n * Generate the virtual module code.\n */\n function generateVirtualModule(icons: OptimizedIcon[]): string {\n const names = icons.map(i => i.id);\n const meta: Record<string, SpriteIconMeta> = {};\n for (const icon of icons) {\n meta[icon.id] = { viewBox: icon.viewBox, tags: icon.tags };\n }\n\n // In dev mode, serve the sprite inline via a data URL or a custom route.\n // In build mode, reference the emitted asset.\n const isBuild = config.command === 'build';\n\n if (isBuild && emittedAssetId) {\n // Rollup asset reference — resolved at bundle time\n return [\n `export const SPRITE_URL = import.meta.ROLLUP_FILE_URL_${emittedAssetId};`,\n `export const ICON_NAMES = ${JSON.stringify(names)};`,\n `export const ICON_META = ${JSON.stringify(meta)};`,\n ].join('\\n');\n }\n\n // Dev mode: serve sprite from a virtual URL (uses pre-computed devSpritePath)\n // HMR: self-accept and re-register the sprite so the runtime registry stays\n // in sync when icon files are added/changed/removed during development.\n return [\n `export const SPRITE_URL = ${JSON.stringify(devSpritePath)};`,\n `export const ICON_NAMES = ${JSON.stringify(names)};`,\n `export const ICON_META = ${JSON.stringify(meta)};`,\n `if (import.meta.hot) {`,\n ` import.meta.hot.accept((newModule) => {`,\n ` if (newModule) {`,\n ` import(\"@pithyjs/ui-kit/icons\").then(({ registerIconSprite }) => {`,\n ` registerIconSprite(newModule.SPRITE_URL, newModule.ICON_NAMES, newModule.ICON_META);`,\n ` });`,\n ` }`,\n ` });`,\n `}`,\n ].join('\\n');\n }\n\n return {\n name: 'pithy:icons',\n\n configResolved(resolvedConfig) {\n config = resolvedConfig;\n iconsDir = resolve(config.root, resolved.dir);\n // Compute dev sprite path from base config (used by both virtual module and middleware)\n let base = config.base ?? '/';\n // Normalize relative bases (e.g. \"./\") and empty strings to \"/\"\n if (base === './' || base === '.' || base === '') base = '/';\n const normalizedBase = base.endsWith('/') ? base.slice(0, -1) : base;\n devSpritePath = `${normalizedBase}/@pithy-icons-sprite.svg`;\n log('Plugin initialized, icons dir:', iconsDir);\n },\n\n buildStart() {\n // Invalidate cache on each build\n cachedIcons = null;\n spriteContent = null;\n emittedAssetId = null;\n\n scanIcons();\n\n // In build mode, emit the sprite as an asset\n if (config.command === 'build' && spriteContent) {\n emittedAssetId = this.emitFile({\n type: 'asset',\n name: 'icons-sprite.svg',\n source: spriteContent,\n });\n log('Emitted sprite asset:', emittedAssetId);\n }\n },\n\n resolveId(id) {\n if (id === VIRTUAL_MODULE_ID) {\n return RESOLVED_VIRTUAL_MODULE_ID;\n }\n if (id === SPRITE_CONTENT_MODULE_ID) {\n return RESOLVED_SPRITE_CONTENT_MODULE_ID;\n }\n return null;\n },\n\n load(id) {\n if (id === RESOLVED_VIRTUAL_MODULE_ID) {\n const icons = scanIcons();\n return generateVirtualModule(icons);\n }\n if (id === RESOLVED_SPRITE_CONTENT_MODULE_ID) {\n const icons = scanIcons();\n const content = spriteContent ?? generateSprite(icons);\n return `export const SPRITE_CONTENT = ${JSON.stringify(content)};`;\n }\n return null;\n },\n\n configureServer(server) {\n // Serve the sprite SVG in dev mode (matches devSpritePath which respects base config)\n server.middlewares.use((req, res, next) => {\n const pathname = req.url?.split('?')[0];\n if (pathname === devSpritePath) {\n const icons = scanIcons();\n const content = spriteContent ?? generateSprite(icons);\n res.setHeader('Content-Type', 'image/svg+xml');\n res.setHeader('Cache-Control', 'no-cache');\n res.end(content);\n return;\n }\n next();\n });\n\n // Watch the icons directory for changes\n server.watcher.add(iconsDir);\n server.watcher.on('all', (event, filePath) => {\n if (resolve(dirname(filePath)) !== resolve(iconsDir)) return;\n if (!filePath.endsWith('.svg')) return;\n if (!['add', 'change', 'unlink'].includes(event)) return;\n\n log(`Icon ${event}: ${basename(filePath)}`);\n\n // Invalidate cache\n cachedIcons = null;\n spriteContent = null;\n\n // Invalidate the virtual module so re-imports get fresh data\n const mod = server.moduleGraph.getModuleById(\n RESOLVED_VIRTUAL_MODULE_ID\n );\n if (mod) {\n server.moduleGraph.invalidateModule(mod);\n // Send a module update so Vite's HMR pipeline picks up the change.\n // Use the module's actual URL from the module graph (not the bare virtual ID)\n // so Vite's client-side HMR can match the update to the imported module.\n const modUrl = mod.url ?? `/${VIRTUAL_MODULE_ID}`;\n server.ws.send({\n type: 'update',\n updates: [\n {\n type: 'js-update',\n path: modUrl,\n acceptedPath: modUrl,\n timestamp: Date.now(),\n },\n ],\n });\n }\n });\n },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/iconsPlugin/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AA+BF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEvD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,GAAG,iBAAiB,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,4BAA4B,CAAC;AAErE,oFAAoF;AACpF,MAAM,CAAC,MAAM,iCAAiC,GAC5C,IAAI,GAAG,wBAAwB,CAAC;AAElC,sBAAsB;AACtB,qKAAqK;AACrK,MAAM,UAAU,cAAc,CAC5B,OAA0B;IAE1B,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,WAAW;QAC/B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;QAC5B,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,IAAI,IAAI;QACxD,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;KAC9B,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/iconsPlugin/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AA+BF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEvD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,GAAG,iBAAiB,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,4BAA4B,CAAC;AAErE,oFAAoF;AACpF,MAAM,CAAC,MAAM,iCAAiC,GAC5C,IAAI,GAAG,wBAAwB,CAAC;AAElC,sBAAsB;AACtB,qKAAqK;AACrK,MAAM,UAAU,cAAc,CAC5B,OAA0B;IAE1B,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,WAAW;QAC/B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;QAC5B,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,IAAI,IAAI;QACxD,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK;KAC9B,CAAC;AACJ,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin-icons-types\",\n \"title\": \"Icon Sprite Plugin Types\",\n \"category\": \"types\",\n \"description\": \"TypeScript interfaces for icon sprite plugin options and resolved configuration.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": true, \"covered\": true, \"file\": \"iconsPlugin.test.ts\" },\n \"integration\": { \"required\": false, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\n/** Plugin configuration options */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons\",\"name\":\"PithyIconsOptions\",\"stability\":\"stable\",\"signature\":\"interface PithyIconsOptions\"} */\nexport interface PithyIconsOptions {\n /** Directory containing SVG icon files. Default: \"src/icons\" */\n dir?: string;\n /** Prefix for symbol IDs in the sprite. Default: \"\" (use filename as-is) */\n prefix?: string;\n /** Whether to strip hardcoded fill/stroke and replace with currentColor. Default: true */\n enforceCurrentColor?: boolean;\n /** Whether to emit debug logging. Default: false */\n debug?: boolean;\n}\n\n/** Resolved plugin configuration with all defaults applied */\nexport interface ResolvedIconsOptions {\n dir: string;\n prefix: string;\n enforceCurrentColor: boolean;\n debug: boolean;\n}\n\n/** Metadata for a single icon in the sprite */\nexport interface SpriteIconMeta {\n /** Original viewBox from the SVG */\n viewBox: string;\n /** Optional search tags (from filename segments) */\n tags: string[];\n}\n\n/** Virtual module ID for the generated icon sprite module */\nexport const VIRTUAL_MODULE_ID = 'virtual:pithy-icons';\n\n/** Resolved virtual module ID (Vite convention: \\0 prefix) */\nexport const RESOLVED_VIRTUAL_MODULE_ID = '\\0' + VIRTUAL_MODULE_ID;\n\n/**\n * Virtual module exposing the sprite's *text*, not its URL.\n *\n * Static export has to fold the used `<symbol>`s into the page, and the sprite\n * only ever existed as a served file or a Rollup asset. Kept as a separate\n * module rather than another export of {@link VIRTUAL_MODULE_ID} so the sheet\n * never rides along in a client bundle that merely wants `SPRITE_URL`.\n */\nexport const SPRITE_CONTENT_MODULE_ID = 'virtual:pithy-icons/sprite';\n\n/** Resolved id for {@link SPRITE_CONTENT_MODULE_ID} (Vite convention: \\0 prefix) */\nexport const RESOLVED_SPRITE_CONTENT_MODULE_ID =\n '\\0' + SPRITE_CONTENT_MODULE_ID;\n\n/** Default options */\n/** @codexApi {\"parent\":\"pithy.vite-plugin-icons\",\"name\":\"resolveOptions\",\"stability\":\"stable\",\"signature\":\"(options: PithyIconsOptions) => ResolvedIconsOptions\"} */\nexport function resolveOptions(\n options: PithyIconsOptions\n): ResolvedIconsOptions {\n return {\n dir: options.dir ?? 'src/icons',\n prefix: options.prefix ?? '',\n enforceCurrentColor: options.enforceCurrentColor ?? true,\n debug: options.debug ?? false,\n };\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -20,12 +20,12 @@
20
20
  *
21
21
  * @module @pithyjs/vite-plugin
22
22
  */
23
- export { pithyPlugin } from './pithyPlugin/plugin';
24
- export { htmlTransformPlugin, type HtmlTransformPluginOptions, } from './htmlTransform/htmlTransform';
25
- export type { ComponentScopesMap, ComponentScopeConfig, } from './babelPlugin/extractUsedIdentifiers';
26
- export { pithyBuild } from './buildPlugin/plugin';
27
- export { pithyRouter, type PithyRouterPluginOptions, } from './routerPlugin/plugin';
28
- export { designSystemPlugin, type DesignSystemPluginOptions, } from './designSystemPlugin';
29
- export { pithySSR, type PithySSRPluginOptions } from './ssrPlugin/plugin';
30
- export { pithyIcons, type PithyIconsOptions } from './iconsPlugin';
23
+ export { pithyPlugin } from './pithyPlugin/plugin.js';
24
+ export { htmlTransformPlugin, type HtmlTransformPluginOptions, } from './htmlTransform/htmlTransform.js';
25
+ export type { ComponentScopesMap, ComponentScopeConfig, } from './babelPlugin/extractUsedIdentifiers.js';
26
+ export { pithyBuild } from './buildPlugin/plugin.js';
27
+ export { pithyRouter, type PithyRouterPluginOptions, } from './routerPlugin/plugin.js';
28
+ export { designSystemPlugin, type DesignSystemPluginOptions, } from './designSystemPlugin/index.js';
29
+ export { pithySSR, type PithySSRPluginOptions } from './ssrPlugin/plugin.js';
30
+ export { pithyIcons, type PithyIconsOptions } from './iconsPlugin/index.js';
31
31
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -21,17 +21,17 @@
21
21
  * @module @pithyjs/vite-plugin
22
22
  */
23
23
  // Main .pithy file transform plugin
24
- export { pithyPlugin } from './pithyPlugin/plugin';
24
+ export { pithyPlugin } from './pithyPlugin/plugin.js';
25
25
  // HTML template transform plugin (for html`` tagged templates)
26
- export { htmlTransformPlugin, } from './htmlTransform/htmlTransform';
26
+ export { htmlTransformPlugin, } from './htmlTransform/htmlTransform.js';
27
27
  // Build optimization plugin (chunk naming, vendor splitting)
28
- export { pithyBuild } from './buildPlugin/plugin';
28
+ export { pithyBuild } from './buildPlugin/plugin.js';
29
29
  // Router plugin (file-based routing)
30
- export { pithyRouter, } from './routerPlugin/plugin';
30
+ export { pithyRouter, } from './routerPlugin/plugin.js';
31
31
  // Design system CSS tree-shaking plugin
32
- export { designSystemPlugin, } from './designSystemPlugin';
32
+ export { designSystemPlugin, } from './designSystemPlugin/index.js';
33
33
  // SSR dev server plugin
34
- export { pithySSR } from './ssrPlugin/plugin';
34
+ export { pithySSR } from './ssrPlugin/plugin.js';
35
35
  // Icon sprite generation plugin
36
- export { pithyIcons } from './iconsPlugin';
36
+ export { pithyIcons } from './iconsPlugin/index.js';
37
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;GAMG;AAEH,oCAAoC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,+DAA+D;AAC/D,OAAO,EACL,mBAAmB,GAEpB,MAAM,+BAA+B,CAAC;AAMvC,6DAA6D;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,qCAAqC;AACrC,OAAO,EACL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,wCAAwC;AACxC,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAE9B,wBAAwB;AACxB,OAAO,EAAE,QAAQ,EAA8B,MAAM,oBAAoB,CAAC;AAE1E,gCAAgC;AAChC,OAAO,EAAE,UAAU,EAA0B,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;GAMG;AAEH,oCAAoC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,+DAA+D;AAC/D,OAAO,EACL,mBAAmB,GAEpB,MAAM,+BAA+B,CAAC;AAMvC,6DAA6D;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,qCAAqC;AACrC,OAAO,EACL,WAAW,GAEZ,MAAM,uBAAuB,CAAC;AAE/B,wCAAwC;AACxC,OAAO,EACL,kBAAkB,GAEnB,MAAM,sBAAsB,CAAC;AAE9B,wBAAwB;AACxB,OAAO,EAAE,QAAQ,EAA8B,MAAM,oBAAoB,CAAC;AAE1E,gCAAgC;AAChC,OAAO,EAAE,UAAU,EAA0B,MAAM,eAAe,CAAC","sourcesContent":["/** @codex\n{\n \"id\": \"pithy.vite-plugin\",\n \"title\": \"Vite Plugin Entry\",\n \"category\": \"plugin\",\n \"description\": \"Public entry point re-exporting all PithyJS Vite plugins.\",\n \"since\": \"0.0.1\",\n \"stability\": \"stable\",\n \"testing\": {\n \"unit\": { \"required\": false, \"covered\": false },\n \"integration\": { \"required\": true, \"covered\": false },\n \"e2e\": { \"required\": false, \"covered\": false }\n }\n}\n*/\n\n/**\n * @pithyjs/vite-plugin\n *\n * Vite plugins for the PithyJS framework.\n *\n * @module @pithyjs/vite-plugin\n */\n\n// Main .pithy file transform plugin\nexport { pithyPlugin } from './pithyPlugin/plugin';\n\n// HTML template transform plugin (for html`` tagged templates)\nexport {\n htmlTransformPlugin,\n type HtmlTransformPluginOptions,\n} from './htmlTransform/htmlTransform';\nexport type {\n ComponentScopesMap,\n ComponentScopeConfig,\n} from './babelPlugin/extractUsedIdentifiers';\n\n// Build optimization plugin (chunk naming, vendor splitting)\nexport { pithyBuild } from './buildPlugin/plugin';\n\n// Router plugin (file-based routing)\nexport {\n pithyRouter,\n type PithyRouterPluginOptions,\n} from './routerPlugin/plugin';\n\n// Design system CSS tree-shaking plugin\nexport {\n designSystemPlugin,\n type DesignSystemPluginOptions,\n} from './designSystemPlugin';\n\n// SSR dev server plugin\nexport { pithySSR, type PithySSRPluginOptions } from './ssrPlugin/plugin';\n\n// Icon sprite generation plugin\nexport { pithyIcons, type PithyIconsOptions } from './iconsPlugin';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/pithyPlugin/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAWF,OAAO,EAAwB,KAAK,MAAM,EAAmB,MAAM,MAAM,CAAC;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AACH,oHAAoH;AACpH,wBAAgB,WAAW,IAAI,MAAM,CAwDpC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/pithyPlugin/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAIF,OAAO,EAAwB,KAAK,MAAM,EAAmB,MAAM,MAAM,CAAC;AAE1E;;;;;;;;;;;;;;;;;;GAkBG;AACH,oHAAoH;AACpH,wBAAgB,WAAW,IAAI,MAAM,CAwDpC"}
@@ -14,14 +14,7 @@
14
14
  }
15
15
  */
16
16
  import path from 'path';
17
- // NOTE: import from compiler *source* (relative), not the `@pithyjs/compiler`
18
- // package specifier. Vite loads plugins in its config bundler, which externalizes
19
- // bare deps → Node then imports `@pithyjs/compiler`'s dist, whose extensionless
20
- // `export * from './parse'` re-exports throw ERR_UNSUPPORTED_DIR_IMPORT. The
21
- // relative path is bundled by esbuild instead and works. (Making the published
22
- // plugin resolve the compiler is a separate build-tooling task — see R0.4.)
23
- import { parsePithyFile } from '../../../compiler/src/parse/parsePithyFile.js';
24
- import { compileToModule } from '../../../compiler/src/transform/compileToModule.js';
17
+ import { compileToModule, parsePithyFile } from '@pithyjs/compiler';
25
18
  import { transformWithEsbuild } from 'vite';
26
19
  /**
27
20
  * Vite plugin to support `.pithy` single-file components (SFC).