@styleframe/plugin 2.4.0 → 3.0.0

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 (49) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/astro.d.ts +1 -1
  3. package/dist/astro.d.ts.map +1 -1
  4. package/dist/astro.js +2 -3
  5. package/dist/astro.js.map +1 -1
  6. package/dist/esbuild.d.ts +3 -3
  7. package/dist/esbuild.js +1 -2
  8. package/dist/esbuild.js.map +1 -1
  9. package/dist/farm.d.ts +1 -1
  10. package/dist/farm.js +1 -2
  11. package/dist/farm.js.map +1 -1
  12. package/dist/index-CXVebONK.d.ts +36 -0
  13. package/dist/index-CXVebONK.d.ts.map +1 -0
  14. package/dist/index.d.ts +2 -10
  15. package/dist/index.js +2 -3
  16. package/dist/nuxt.d.ts +1 -1
  17. package/dist/nuxt.js +3 -4
  18. package/dist/nuxt.js.map +1 -1
  19. package/dist/plugin-WmJKFcn_.js +595 -0
  20. package/dist/plugin-WmJKFcn_.js.map +1 -0
  21. package/dist/rollup.d.ts +1 -1
  22. package/dist/rollup.js +1 -2
  23. package/dist/rollup.js.map +1 -1
  24. package/dist/rspack.d.ts +1 -1
  25. package/dist/rspack.js +1 -2
  26. package/dist/rspack.js.map +1 -1
  27. package/dist/{vite-Cd6Z9GAd.js → vite-zWsCwvYT.js} +2 -2
  28. package/dist/vite-zWsCwvYT.js.map +1 -0
  29. package/dist/vite.d.ts +1 -1
  30. package/dist/vite.js +2 -3
  31. package/dist/{webpack-yNnIZ6Rq.js → webpack-De3KlGzm.js} +2 -2
  32. package/dist/webpack-De3KlGzm.js.map +1 -0
  33. package/dist/webpack.d.ts +3 -3
  34. package/dist/webpack.js +2 -3
  35. package/package.json +9 -5
  36. package/dist/constants-CnbAL4bY.js +0 -17
  37. package/dist/constants-CnbAL4bY.js.map +0 -1
  38. package/dist/constants.d.ts +0 -17
  39. package/dist/constants.d.ts.map +0 -1
  40. package/dist/constants.js +0 -3
  41. package/dist/index.d.ts.map +0 -1
  42. package/dist/src-BfsicZRP.js +0 -160
  43. package/dist/src-BfsicZRP.js.map +0 -1
  44. package/dist/types-Clt7t35T.d.ts +0 -12
  45. package/dist/types-Clt7t35T.d.ts.map +0 -1
  46. package/dist/types.d.ts +0 -2
  47. package/dist/types.js +0 -1
  48. package/dist/vite-Cd6Z9GAd.js.map +0 -1
  49. package/dist/webpack-yNnIZ6Rq.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-WmJKFcn_.js","names":["DEFAULT_OPTIONS: Options","_exhaustive: never","extensionShimPath: string | null","fs","unpluginFactory: UnpluginFactory<Options | undefined>","scannerState: PluginScannerState | null","typeGenTimeout: ReturnType<typeof setTimeout> | null","esbuildTransform"],"sources":["../src/plugin/constants.ts","../src/plugin/state.ts","../src/plugin/discovery.ts","../src/plugin/errors.ts","../src/plugin/global-loader.ts","../src/plugin/generate/extension-module.ts","../src/plugin/generate/consumer-module.ts","../src/plugin/generate/global-css.ts","../src/plugin/generate/dts.ts","../src/plugin/scanner.ts","../src/plugin/index.ts"],"sourcesContent":["import type { Options } from \"./types\";\n\nexport const DEFAULT_ENTRY = \"./styleframe.config.ts\";\n\nexport const DEFAULT_OPTIONS: Options = {\n\tentry: DEFAULT_ENTRY,\n\tsilent: false,\n};\n\nexport const PLUGIN_NAME = \"styleframe\";\nexport const IMPORT_V_PREFIX = \"virtual:\"; // Vite \"virtual\" module id prefix\nexport const ROLLUP_V_PREFIX = \"\\0\"; // Rollup \"virtual\" id prefix\n\nexport const VIRTUAL_CSS_MODULE_ID = `${IMPORT_V_PREFIX}${PLUGIN_NAME}.css`;\nexport const RESOLVED_VIRTUAL_CSS_MODULE_ID = `${ROLLUP_V_PREFIX}${VIRTUAL_CSS_MODULE_ID}`;\nexport const VIRTUAL_TS_MODULE_ID = `${IMPORT_V_PREFIX}${PLUGIN_NAME}`;\nexport const RESOLVED_VIRTUAL_TS_MODULE_ID = `${ROLLUP_V_PREFIX}${VIRTUAL_TS_MODULE_ID}`;\n\n// Two-faced virtual module resolution targets\nexport const RESOLVED_VIRTUAL_EXTENSION_ID = `${ROLLUP_V_PREFIX}${IMPORT_V_PREFIX}${PLUGIN_NAME}:extension`;\nexport const RESOLVED_VIRTUAL_CONSUMER_ID = `${ROLLUP_V_PREFIX}${IMPORT_V_PREFIX}${PLUGIN_NAME}:consumer`;\n\n// Default ignore patterns for file discovery\nexport const DEFAULT_IGNORE_PATTERNS = [\n\t\"**/node_modules/**\",\n\t\"**/.git/**\",\n\t\"**/dist/**\",\n\t\"**/build/**\",\n\t\"**/.next/**\",\n\t\"**/.nuxt/**\",\n\t\"**/coverage/**\",\n];\n","import type { Styleframe } from \"@styleframe/core\";\nimport type { ExportInfo } from \"@styleframe/loader\";\n\n/**\n * Information about a discovered *.styleframe.ts file\n */\nexport interface StyleframeFileInfo {\n\t/** Absolute path to the file */\n\tpath: string;\n\t/** Order in which file was loaded (for deterministic variable precedence) */\n\tloadOrder: number;\n\t/** Named exports from this file */\n\texports: Map<string, ExportInfo>;\n\t/** Last modification timestamp */\n\tlastModified: number;\n}\n\n/**\n * Global state for the plugin\n */\nexport interface PluginGlobalState {\n\t/** The global styleframe instance (from config) */\n\tglobalInstance: Styleframe | null;\n\t/** Config file info */\n\tconfigFile: StyleframeFileInfo | null;\n\t/** All discovered *.styleframe.ts files (ordered by load order) */\n\tfiles: Map<string, StyleframeFileInfo>;\n\t/** Files currently being loaded (for circular dependency detection) */\n\tloadingFiles: Set<string>;\n\t/** Whether initial discovery has completed */\n\tinitialized: boolean;\n}\n\n/**\n * Create a new plugin state instance\n */\nexport function createPluginState(configPath: string): PluginGlobalState {\n\treturn {\n\t\tglobalInstance: null,\n\t\tconfigFile: {\n\t\t\tpath: configPath,\n\t\t\tloadOrder: -1,\n\t\t\texports: new Map(),\n\t\t\tlastModified: 0,\n\t\t},\n\t\tfiles: new Map(),\n\t\tloadingFiles: new Set(),\n\t\tinitialized: false,\n\t};\n}\n\n/**\n * Find if an export name is already used by another file.\n * Returns the source file path if collision found, null otherwise.\n */\nexport function findExportCollision(\n\tstate: PluginGlobalState,\n\texportName: string,\n\texcludeFile: string,\n): string | null {\n\t// Check config file\n\tif (\n\t\tstate.configFile &&\n\t\tstate.configFile.path !== excludeFile &&\n\t\tstate.configFile.exports.has(exportName)\n\t) {\n\t\treturn state.configFile.path;\n\t}\n\n\t// Check other files\n\tfor (const [filePath, fileInfo] of state.files) {\n\t\tif (filePath === excludeFile) continue;\n\t\tif (fileInfo.exports.has(exportName)) {\n\t\t\treturn filePath;\n\t\t}\n\t}\n\treturn null;\n}\n\n/**\n * Reset all state (used when config changes)\n */\nexport function resetState(state: PluginGlobalState): void {\n\tstate.globalInstance = null;\n\tif (state.configFile) {\n\t\tstate.configFile.exports.clear();\n\t\tstate.configFile.lastModified = 0;\n\t}\n\tstate.files.clear();\n\tstate.loadingFiles.clear();\n\tstate.initialized = false;\n}\n","import path from \"node:path\";\nimport { glob } from \"tinyglobby\";\nimport { DEFAULT_IGNORE_PATTERNS } from \"./constants\";\n\nexport interface DiscoveryOptions {\n\t/** Base directory for glob resolution */\n\tcwd: string;\n\t/** Glob patterns for files to include */\n\tinclude: string[];\n\t/** Glob patterns for files to exclude */\n\texclude: string[];\n}\n\n/**\n * Discover all *.styleframe.ts files in the project\n */\nexport async function discoverStyleframeFiles(\n\toptions: DiscoveryOptions,\n): Promise<string[]> {\n\tconst patterns =\n\t\toptions.include.length > 0 ? options.include : [\"**/*.styleframe.ts\"];\n\n\tconst files = await glob(patterns, {\n\t\tcwd: options.cwd,\n\t\tabsolute: true,\n\t\tignore: [...DEFAULT_IGNORE_PATTERNS, ...options.exclude],\n\t});\n\n\treturn files;\n}\n\n/**\n * Sort files by the specified load order strategy\n */\nexport function sortByLoadOrder(\n\tfiles: string[],\n\tstrategy: \"alphabetical\" | \"depth-first\",\n): string[] {\n\tconst sorted = [...files];\n\n\tswitch (strategy) {\n\t\tcase \"alphabetical\":\n\t\t\treturn sorted.sort((a, b) => a.localeCompare(b));\n\n\t\tcase \"depth-first\":\n\t\t\t// Shorter paths first (closer to root), then alphabetical\n\t\t\treturn sorted.sort((a, b) => {\n\t\t\t\tconst depthA = a.split(path.sep).length;\n\t\t\t\tconst depthB = b.split(path.sep).length;\n\t\t\t\tif (depthA !== depthB) {\n\t\t\t\t\treturn depthA - depthB;\n\t\t\t\t}\n\t\t\t\treturn a.localeCompare(b);\n\t\t\t});\n\n\t\tdefault: {\n\t\t\tconst _exhaustive: never = strategy;\n\t\t\tthrow new Error(`Unknown load order strategy: ${_exhaustive}`);\n\t\t}\n\t}\n}\n","/**\n * Base error class for Styleframe plugin errors\n */\nexport class StyleframePluginError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(`[styleframe] ${message}`);\n\t\tthis.name = \"StyleframePluginError\";\n\t}\n}\n\n/**\n * Thrown when two different files export the same name\n */\nexport class ExportCollisionError extends StyleframePluginError {\n\tconstructor(exportName: string, source1: string, source2: string) {\n\t\tsuper(\n\t\t\t`Export collision: \"${exportName}\" is exported from both:\\n` +\n\t\t\t\t` - ${source1}\\n` +\n\t\t\t\t` - ${source2}\\n\\n` +\n\t\t\t\t`Rename one of the exports to resolve this collision.`,\n\t\t);\n\t\tthis.name = \"ExportCollisionError\";\n\t}\n}\n\n/**\n * Thrown when trying to use the global instance before it's initialized\n */\nexport class GlobalInstanceNotInitializedError extends StyleframePluginError {\n\tconstructor() {\n\t\tsuper(\n\t\t\t\"Global instance not initialized. \" +\n\t\t\t\t\"Make sure styleframe.config.ts is loaded before *.styleframe.ts files.\",\n\t\t);\n\t\tthis.name = \"GlobalInstanceNotInitializedError\";\n\t}\n}\n\n/**\n * Thrown when a circular dependency is detected\n */\nexport class CircularDependencyError extends StyleframePluginError {\n\tconstructor(filePath: string, chain: string[]) {\n\t\tsuper(\n\t\t\t`Circular dependency detected:\\n` +\n\t\t\t\t` ${chain.join(\" -> \")} -> ${filePath}`,\n\t\t);\n\t\tthis.name = \"CircularDependencyError\";\n\t}\n}\n","import type { Styleframe } from \"@styleframe/core\";\nimport {\n\tloadExtensionModule,\n\tloadModule,\n\ttype ExportInfo,\n} from \"@styleframe/loader\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport type { PluginGlobalState } from \"./state\";\nimport { findExportCollision, resetState } from \"./state\";\nimport {\n\tCircularDependencyError,\n\tExportCollisionError,\n\tGlobalInstanceNotInitializedError,\n} from \"./errors\";\n\n// Global key for injecting the global instance during loading\n// This is necessary because jiti loads files in a separate context,\n// and we need a way to pass the global instance to the extension shim\nconst GLOBAL_INSTANCE_KEY = \"__STYLEFRAME_GLOBAL_INSTANCE__\";\n\n// Extension shim path - created once per process\nlet extensionShimPath: string | null = null;\n\n/**\n * Get or create the extension shim file.\n * The shim reads the global instance from globalThis and exports it.\n */\nfunction getExtensionShimPath(): string {\n\tif (extensionShimPath && fs.existsSync(extensionShimPath)) {\n\t\treturn extensionShimPath;\n\t}\n\n\tconst shimContent = `\nexport function styleframe() {\n\tconst instance = globalThis[\"${GLOBAL_INSTANCE_KEY}\"];\n\tif (!instance) {\n\t\tthrow new Error('[styleframe] Global instance not available during loading');\n\t}\n\treturn instance;\n}\n\nexport default { styleframe };\n`;\n\n\tconst tempDir = os.tmpdir();\n\textensionShimPath = path.join(tempDir, `styleframe-shim-${process.pid}.mjs`);\n\tfs.writeFileSync(extensionShimPath, shimContent);\n\n\treturn extensionShimPath;\n}\n\n/**\n * Check exports for collisions and throw if found.\n */\nfunction checkExportCollisions(\n\tstate: PluginGlobalState,\n\texports: Map<string, ExportInfo>,\n\tfilePath: string,\n): void {\n\tfor (const [name] of exports) {\n\t\tconst collision = findExportCollision(state, name, filePath);\n\t\tif (collision) {\n\t\t\tthrow new ExportCollisionError(name, collision, filePath);\n\t\t}\n\t}\n}\n\n/**\n * Load the config file and initialize the global instance\n */\nexport async function loadConfigFile(\n\tstate: PluginGlobalState,\n): Promise<Styleframe> {\n\tif (!state.configFile) {\n\t\tthrow new Error(\"[styleframe] Config file not set\");\n\t}\n\n\tconst configPath = state.configFile.path;\n\n\t// Use shared loadModule function\n\tconst { instance, exports } = await loadModule(configPath);\n\n\t// Check for collisions\n\tcheckExportCollisions(state, exports, configPath);\n\n\tstate.globalInstance = instance;\n\tstate.configFile.exports = exports;\n\tstate.configFile.lastModified = Date.now();\n\n\treturn instance;\n}\n\n/**\n * Load a single *.styleframe.ts file using the global instance\n */\nexport async function loadStyleframeFile(\n\tstate: PluginGlobalState,\n\tfilePath: string,\n\tloadOrder: number,\n): Promise<void> {\n\tif (!state.globalInstance) {\n\t\tthrow new GlobalInstanceNotInitializedError();\n\t}\n\n\t// Circular dependency detection\n\tif (state.loadingFiles.has(filePath)) {\n\t\tthrow new CircularDependencyError(filePath, [...state.loadingFiles]);\n\t}\n\n\tstate.loadingFiles.add(filePath);\n\n\ttry {\n\t\t// Set the global instance on globalThis for the extension shim to access\n\t\t(globalThis as Record<string, unknown>)[GLOBAL_INSTANCE_KEY] =\n\t\t\tstate.globalInstance;\n\n\t\t// Use shared loadExtensionModule function with alias for virtual:styleframe\n\t\tconst { exports } = await loadExtensionModule(filePath, {\n\t\t\talias: {\n\t\t\t\t\"virtual:styleframe\": getExtensionShimPath(),\n\t\t\t},\n\t\t});\n\n\t\t// Check for collisions\n\t\tcheckExportCollisions(state, exports, filePath);\n\n\t\t// Update file info\n\t\tstate.files.set(filePath, {\n\t\t\tpath: filePath,\n\t\t\tloadOrder,\n\t\t\texports,\n\t\t\tlastModified: Date.now(),\n\t\t});\n\t} finally {\n\t\tstate.loadingFiles.delete(filePath);\n\t\t// Clean up globalThis\n\t\tdelete (globalThis as Record<string, unknown>)[GLOBAL_INSTANCE_KEY];\n\t}\n}\n\n/**\n * Load all styleframe files in order\n */\nexport async function loadAllStyleframeFiles(\n\tstate: PluginGlobalState,\n\tfiles: string[],\n): Promise<void> {\n\tfor (let i = 0; i < files.length; i++) {\n\t\tconst file = files[i];\n\t\tif (file) {\n\t\t\tawait loadStyleframeFile(state, file, i);\n\t\t}\n\t}\n}\n\n/**\n * Reload the config and all styleframe files\n */\nexport async function reloadAll(\n\tstate: PluginGlobalState,\n\tfiles: string[],\n): Promise<void> {\n\t// Clear all state except configPath\n\tresetState(state);\n\n\t// Reload config\n\tawait loadConfigFile(state);\n\n\t// Reload all files\n\tawait loadAllStyleframeFiles(state, files);\n}\n","/**\n * Generate the extension module content.\n * This is what *.styleframe.ts files receive when they import from 'virtual:styleframe'.\n * It imports the config directly and returns the same instance.\n */\nexport function generateExtensionModule(configPath: string): string {\n\tconst normalizedPath = configPath.replace(/\\\\/g, \"/\");\n\treturn `\nimport config from '${normalizedPath}';\n\nexport function styleframe() {\n\treturn config;\n}\n\nexport default config;\n`;\n}\n","import { transpile } from \"@styleframe/transpiler\";\nimport type { PluginGlobalState } from \"../state\";\n\n/**\n * Generate the consumer module content using the transpiler.\n * Uses the TypeScript transpiler to generate proper recipe exports with serialized runtime data.\n */\nexport async function generateConsumerModule(\n\tstate: PluginGlobalState,\n): Promise<string> {\n\tif (!state.globalInstance) {\n\t\treturn `// Styleframe not initialized`;\n\t}\n\n\t// Use the transpiler to generate TypeScript output for all recipes and selectors\n\tconst result = await transpile(state.globalInstance, { type: \"ts\" });\n\treturn result.files.find((f) => f.name === \"index.ts\")?.content ?? \"\";\n}\n","import {\n\tgetLicenseKeyFromEnv,\n\tvalidateInstanceLicense,\n} from \"@styleframe/license\";\nimport { transpile } from \"@styleframe/transpiler\";\nimport { consola } from \"consola\";\nimport type { PluginGlobalState } from \"../state\";\nimport type { Options } from \"../types\";\n\n/**\n * Generate global CSS from the global instance.\n */\nexport async function generateGlobalCSS(\n\tstate: PluginGlobalState,\n\tisBuild: boolean,\n\toptions: Options,\n): Promise<{ code: string }> {\n\tif (!state.globalInstance) {\n\t\treturn { code: \"/* Styleframe not initialized */\" };\n\t}\n\n\tawait validateInstanceLicense(state.globalInstance, {\n\t\tlicenseKey: getLicenseKeyFromEnv() || \"\",\n\t\tenvironment: process.env.NODE_ENV || \"development\",\n\t\tisBuild,\n\t});\n\n\tconst result = await transpile(state.globalInstance, { type: \"css\" });\n\tconst css = result.files.map((f) => f.content).join(\"\\n\");\n\n\tif (!options.silent) {\n\t\tconsola.success(`[styleframe] Built global CSS successfully.`);\n\t}\n\n\treturn { code: css };\n}\n","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { transpile } from \"@styleframe/transpiler\";\nimport { consola } from \"consola\";\nimport type { PluginGlobalState } from \"../state\";\n\nexport interface TypeGeneratorOptions {\n\t/** Directory where types will be written (default: .styleframe) */\n\toutDir?: string;\n}\n\nconst DEFAULT_OUT_DIR = \".styleframe\";\n\n/**\n * Generates type declarations for virtual:styleframe module.\n * Uses the transpiler's dts mode to generate the types.\n */\nexport async function generateTypeDeclarations(\n\tstate: PluginGlobalState,\n\tcwd: string,\n\toptions: TypeGeneratorOptions = {},\n\tsilent = false,\n): Promise<void> {\n\tif (!state.globalInstance) {\n\t\treturn;\n\t}\n\n\tconst outDir = path.resolve(cwd, options.outDir ?? DEFAULT_OUT_DIR);\n\n\t// Ensure output directory exists\n\tawait fs.mkdir(outDir, { recursive: true });\n\n\t// Use transpiler's dts mode to generate type declarations\n\tconst result = await transpile(state.globalInstance, { type: \"dts\" });\n\tconst content =\n\t\tresult.files.find((f) => f.name === \"index.d.ts\")?.content ?? \"\";\n\n\tconst outputPath = path.join(outDir, \"styleframe.d.ts\");\n\tawait fs.writeFile(outputPath, content);\n\n\tif (!silent) {\n\t\tconsola.success(`[styleframe] Generated type declarations.`);\n\t}\n}\n","import {\n\tcreateScanner,\n\ttype ParsedUtility,\n\ttype Scanner,\n\ttype UtilityMatch,\n} from \"@styleframe/scanner\";\nimport type { ModifierFactory, UtilityFactory } from \"@styleframe/core\";\nimport { consola } from \"consola\";\nimport type { PluginGlobalState } from \"./state\";\n\n/**\n * Scanner state managed by the plugin\n */\nexport interface PluginScannerState {\n\t/** The scanner instance */\n\tscanner: Scanner;\n\t/** Set of absolute file paths from the last scan (used for HMR matching) */\n\tscannedFiles: Set<string>;\n}\n\n/**\n * Create a plugin scanner instance.\n *\n * @param contentPatterns Glob patterns for content files to scan\n * @param cwd Working directory for glob resolution\n * @returns Plugin scanner state\n */\nexport function createPluginScanner(\n\tcontentPatterns: string[],\n\tcwd: string,\n): PluginScannerState {\n\tconst scanner = createScanner({\n\t\tcontent: contentPatterns,\n\t\tcwd,\n\t});\n\n\treturn {\n\t\tscanner,\n\t\tscannedFiles: new Set(),\n\t};\n}\n\n/**\n * Full scan: scan all content files and register detected utilities.\n *\n * Used at build start and after reloadAll.\n *\n * @param pluginState The plugin global state\n * @param scannerState The scanner state\n * @param options Options for logging\n * @returns Number of newly registered utility values\n */\nexport async function scanAndRegister(\n\tpluginState: PluginGlobalState,\n\tscannerState: PluginScannerState,\n\toptions?: { silent?: boolean },\n): Promise<number> {\n\tif (!pluginState.globalInstance) {\n\t\treturn 0;\n\t}\n\n\tconst result = await scannerState.scanner.scan();\n\n\t// Update tracked files\n\tscannerState.scannedFiles.clear();\n\tfor (const filePath of result.files.keys()) {\n\t\tscannerState.scannedFiles.add(filePath);\n\t}\n\n\tconst matches = scannerState.scanner.match(\n\t\tresult.allParsed,\n\t\tpluginState.globalInstance.root,\n\t);\n\n\tconst registered = registerMatchedUtilities(pluginState, matches);\n\n\tif (!options?.silent) {\n\t\tconst unmatched = matches.filter((m) => m.factory === null);\n\t\tif (unmatched.length > 0) {\n\t\t\tconst names = [...new Set(unmatched.map((m) => m.parsed.raw))];\n\t\t\tconsola.warn(\n\t\t\t\t`[styleframe] Scanner found ${unmatched.length} utility class(es) without a matching factory: ${names.join(\", \")}`,\n\t\t\t);\n\t\t}\n\n\t\tif (registered > 0) {\n\t\t\tconsola.info(\n\t\t\t\t`[styleframe] Scanner registered ${registered} utility value(s) from ${result.files.size} content file(s).`,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn registered;\n}\n\n/**\n * Incremental scan: scan a single file and register any new utilities.\n *\n * Used for HMR when a content file changes.\n *\n * @param pluginState The plugin global state\n * @param scannerState The scanner state\n * @param filePath The changed file path\n * @returns true if new values were registered (CSS needs invalidation)\n */\nexport async function scanFileAndRegister(\n\tpluginState: PluginGlobalState,\n\tscannerState: PluginScannerState,\n\tfilePath: string,\n): Promise<boolean> {\n\tif (!pluginState.globalInstance) {\n\t\treturn false;\n\t}\n\n\t// Invalidate cache for this file and re-scan it\n\tscannerState.scanner.invalidate(filePath);\n\tconst fileResult = await scannerState.scanner.scanFile(filePath);\n\n\tconst matches = scannerState.scanner.match(\n\t\tfileResult.parsed,\n\t\tpluginState.globalInstance.root,\n\t);\n\n\tconst registered = registerMatchedUtilities(pluginState, matches);\n\n\treturn registered > 0;\n}\n\n/**\n * Check if a file is a tracked content file.\n */\nexport function isContentFile(\n\tscannerState: PluginScannerState | null,\n\tfilePath: string,\n): boolean {\n\treturn scannerState?.scannedFiles.has(filePath) ?? false;\n}\n\ninterface RegistrationEntry {\n\tfactory: UtilityFactory;\n\tparsed: ParsedUtility;\n\tmodifiers: ModifierFactory[];\n}\n\n/**\n * Register utility values detected by the scanner that don't yet exist on the root.\n *\n * For non-arbitrary values, uses the factory's autogenerate function (treating the\n * value key as a token reference). For arbitrary values, registers with the literal\n * CSS value directly.\n *\n * @param pluginState The plugin global state\n * @param matches Scanner match results\n * @returns Number of newly registered values\n */\nexport function registerMatchedUtilities(\n\tpluginState: PluginGlobalState,\n\tmatches: UtilityMatch[],\n): number {\n\t// Filter to unregistered matches with a valid factory\n\tconst unregistered = matches.filter((m) => m.factory !== null && !m.exists);\n\n\tif (unregistered.length === 0) {\n\t\treturn 0;\n\t}\n\n\t// Group by (factory name, value) to deduplicate and merge modifier sets\n\tconst groups = new Map<string, RegistrationEntry>();\n\n\tfor (const match of unregistered) {\n\t\tconst factory = match.factory!;\n\t\tconst key = `${factory.name}:${match.parsed.value}`;\n\t\tconst existing = groups.get(key);\n\n\t\tif (!existing) {\n\t\t\tgroups.set(key, {\n\t\t\t\tfactory,\n\t\t\t\tparsed: match.parsed,\n\t\t\t\tmodifiers: [...match.modifierFactories],\n\t\t\t});\n\t\t} else {\n\t\t\t// Merge modifiers from this match\n\t\t\tfor (const mod of match.modifierFactories) {\n\t\t\t\tconst modKey = mod.key.join(\",\");\n\t\t\t\tif (!existing.modifiers.some((m) => m.key.join(\",\") === modKey)) {\n\t\t\t\t\texisting.modifiers.push(mod);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tlet count = 0;\n\n\tfor (const { factory, parsed, modifiers } of groups.values()) {\n\t\tconst modifierArgs = modifiers.length > 0 ? modifiers : undefined;\n\n\t\tif (parsed.isArbitrary && parsed.arbitraryValue !== undefined) {\n\t\t\t// Arbitrary value: register with the literal CSS value\n\t\t\tfactory.create({ [parsed.value]: parsed.arbitraryValue }, modifierArgs);\n\t\t} else {\n\t\t\t// Non-arbitrary: use autogenerate with token reference syntax\n\t\t\tconst autoGenerated = factory.autogenerate(`@${parsed.value}`);\n\t\t\tfactory.create(autoGenerated, modifierArgs);\n\t\t}\n\n\t\tcount++;\n\t}\n\n\treturn count;\n}\n","import path from \"node:path\";\nimport { consola } from \"consola\";\nimport { transform as esbuildTransform } from \"esbuild\";\nimport type { UnpluginFactory } from \"unplugin\";\nimport { createUnplugin } from \"unplugin\";\nimport {\n\tDEFAULT_ENTRY,\n\tDEFAULT_OPTIONS,\n\tPLUGIN_NAME,\n\tRESOLVED_VIRTUAL_CSS_MODULE_ID,\n\tRESOLVED_VIRTUAL_TS_MODULE_ID,\n\tRESOLVED_VIRTUAL_EXTENSION_ID,\n\tRESOLVED_VIRTUAL_CONSUMER_ID,\n\tVIRTUAL_CSS_MODULE_ID,\n\tVIRTUAL_TS_MODULE_ID,\n} from \"./constants\";\nimport type { Options } from \"./types\";\nexport type { Options } from \"./types\";\nimport { createPluginState } from \"./state\";\nimport { discoverStyleframeFiles, sortByLoadOrder } from \"./discovery\";\nimport {\n\tloadConfigFile,\n\tloadStyleframeFile,\n\tloadAllStyleframeFiles,\n\treloadAll,\n} from \"./global-loader\";\nimport {\n\tgenerateExtensionModule,\n\tgenerateConsumerModule,\n\tgenerateGlobalCSS,\n\tgenerateTypeDeclarations,\n} from \"./generate\";\nimport {\n\tcreatePluginScanner,\n\tscanAndRegister,\n\tscanFileAndRegister,\n\tisContentFile,\n\ttype PluginScannerState,\n} from \"./scanner\";\n\n// Matches the source file: ./button.styleframe.ts\nconst STYLEFRAME_SOURCE_REGEX = /\\.styleframe\\.ts$/;\n\nfunction isStyleframeSourceFile(id: string): boolean {\n\treturn STYLEFRAME_SOURCE_REGEX.test(id);\n}\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (\n\toptions = DEFAULT_OPTIONS,\n) => {\n\tconst cwd = process.cwd();\n\tconst entry = options.entry ?? DEFAULT_ENTRY;\n\tconst configPath = path.isAbsolute(entry) ? entry : path.resolve(cwd, entry);\n\n\t// Create plugin state\n\tconst state = createPluginState(configPath);\n\n\tlet isBuildCommand = false;\n\n\t// Scanner state (created if content option is provided)\n\tlet scannerState: PluginScannerState | null = null;\n\n\t// Debounce timeout for type generation\n\tlet typeGenTimeout: ReturnType<typeof setTimeout> | null = null;\n\n\t// Schedule type generation with debounce\n\tconst scheduleTypeGeneration = () => {\n\t\tif (options.dts?.enabled === false) return;\n\t\tif (typeGenTimeout) clearTimeout(typeGenTimeout);\n\t\ttypeGenTimeout = setTimeout(async () => {\n\t\t\ttry {\n\t\t\t\tawait generateTypeDeclarations(state, cwd, options.dts, options.silent);\n\t\t\t} catch (error) {\n\t\t\t\tconsola.error(`[styleframe] Type generation failed:`, error);\n\t\t\t}\n\t\t}, 100);\n\t};\n\n\treturn {\n\t\tname: PLUGIN_NAME,\n\t\tenforce: \"pre\",\n\n\t\tasync buildStart() {\n\t\t\tisBuildCommand = process.argv.includes(\"build\");\n\n\t\t\tif (!options.silent) {\n\t\t\t\tconsole.log(\"\");\n\t\t\t\tconsola.info(`[styleframe] Initializing...`);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// 1. Load config file\n\t\t\t\tawait loadConfigFile(state);\n\n\t\t\t\t// 2. Discover all *.styleframe.ts files\n\t\t\t\tconst files = await discoverStyleframeFiles({\n\t\t\t\t\tcwd,\n\t\t\t\t\tinclude: options.include ?? [],\n\t\t\t\t\texclude: options.exclude ?? [],\n\t\t\t\t});\n\n\t\t\t\t// Filter out the config file itself\n\t\t\t\tconst styleframeFiles = files.filter((f) => f !== configPath);\n\n\t\t\t\t// 3. Sort by load order\n\t\t\t\tconst sortedFiles = sortByLoadOrder(\n\t\t\t\t\tstyleframeFiles,\n\t\t\t\t\toptions.loadOrder ?? \"alphabetical\",\n\t\t\t\t);\n\n\t\t\t\t// 4. Load all styleframe files\n\t\t\t\tawait loadAllStyleframeFiles(state, sortedFiles);\n\n\t\t\t\t// 5. Scan content files and auto-register utilities\n\t\t\t\tif (options.content?.length) {\n\t\t\t\t\tscannerState = createPluginScanner(options.content, cwd);\n\t\t\t\t\tawait scanAndRegister(state, scannerState, {\n\t\t\t\t\t\tsilent: options.silent,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// 6. Add watch files\n\t\t\t\tthis.addWatchFile(configPath);\n\t\t\t\tfor (const file of sortedFiles) {\n\t\t\t\t\tthis.addWatchFile(file);\n\t\t\t\t}\n\t\t\t\tif (scannerState) {\n\t\t\t\t\tfor (const file of scannerState.scannedFiles) {\n\t\t\t\t\t\tthis.addWatchFile(file);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.initialized = true;\n\n\t\t\t\t// 7. Generate type declarations\n\t\t\t\tif (options.dts?.enabled !== false) {\n\t\t\t\t\tawait generateTypeDeclarations(\n\t\t\t\t\t\tstate,\n\t\t\t\t\t\tcwd,\n\t\t\t\t\t\toptions.dts,\n\t\t\t\t\t\toptions.silent,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (!options.silent) {\n\t\t\t\t\tconsola.success(\n\t\t\t\t\t\t`[styleframe] Initialized with ${sortedFiles.length} styleframe file(s).`,\n\t\t\t\t\t);\n\t\t\t\t\tconsole.log(\"\");\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsola.error(`[styleframe] Initialization failed:`, error);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\n\t\tresolveId(id, importer) {\n\t\t\t// Handle virtual:styleframe with two faces\n\t\t\tif (id === VIRTUAL_TS_MODULE_ID) {\n\t\t\t\tif (importer && isStyleframeSourceFile(importer)) {\n\t\t\t\t\t// Extension face: *.styleframe.ts files get the global instance factory\n\t\t\t\t\treturn RESOLVED_VIRTUAL_EXTENSION_ID;\n\t\t\t\t}\n\t\t\t\t// Consumer face: app code gets aggregated exports\n\t\t\t\treturn RESOLVED_VIRTUAL_CONSUMER_ID;\n\t\t\t}\n\n\t\t\t// Handle virtual:styleframe.css\n\t\t\tif (id === VIRTUAL_CSS_MODULE_ID) {\n\t\t\t\treturn RESOLVED_VIRTUAL_CSS_MODULE_ID;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t},\n\n\t\tasync load(id) {\n\t\t\t// Extension face: return factory that gives global instance\n\t\t\tif (id === RESOLVED_VIRTUAL_EXTENSION_ID) {\n\t\t\t\treturn { code: generateExtensionModule(configPath) };\n\t\t\t}\n\n\t\t\t// Consumer face: return aggregated exports\n\t\t\tif (id === RESOLVED_VIRTUAL_CONSUMER_ID) {\n\t\t\t\treturn { code: await generateConsumerModule(state) };\n\t\t\t}\n\n\t\t\t// Global CSS: all styles from global instance\n\t\t\tif (id === RESOLVED_VIRTUAL_CSS_MODULE_ID) {\n\t\t\t\treturn generateGlobalCSS(state, isBuildCommand, options);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t},\n\n\t\tvite: {\n\t\t\tasync transform(code, id) {\n\t\t\t\t// Transform TypeScript virtual modules since Vite's esbuild doesn't process them\n\t\t\t\tconst isVirtualTsModule =\n\t\t\t\t\tid === RESOLVED_VIRTUAL_TS_MODULE_ID ||\n\t\t\t\t\tid === RESOLVED_VIRTUAL_EXTENSION_ID ||\n\t\t\t\t\tid === RESOLVED_VIRTUAL_CONSUMER_ID;\n\n\t\t\t\tif (isVirtualTsModule) {\n\t\t\t\t\tconst result = await esbuildTransform(code, {\n\t\t\t\t\t\tloader: \"ts\",\n\t\t\t\t\t\tformat: \"esm\",\n\t\t\t\t\t\ttarget: \"esnext\",\n\t\t\t\t\t});\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcode: result.code,\n\t\t\t\t\t\tmap: result.map || null,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tconfigureServer(server) {\n\t\t\t\t// Watch for new *.styleframe.ts files\n\t\t\t\tserver.watcher.on(\"add\", async (file) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tisStyleframeSourceFile(file) &&\n\t\t\t\t\t\tfile !== configPath &&\n\t\t\t\t\t\t!state.files.has(file)\n\t\t\t\t\t) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst loadOrder = state.files.size;\n\t\t\t\t\t\t\tawait loadStyleframeFile(state, file, loadOrder);\n\n\t\t\t\t\t\t\tif (!options.silent) {\n\t\t\t\t\t\t\t\tconsola.info(\n\t\t\t\t\t\t\t\t\t`[styleframe] Discovered new file: ${path.relative(cwd, file)}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Re-scan content after new styleframe file\n\t\t\t\t\t\t\tif (scannerState) {\n\t\t\t\t\t\t\t\tawait scanAndRegister(state, scannerState, {\n\t\t\t\t\t\t\t\t\tsilent: options.silent,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Invalidate consumer and CSS modules\n\t\t\t\t\t\t\tconst consumerMod = server.moduleGraph.getModuleById(\n\t\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CONSUMER_ID,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst cssMod = server.moduleGraph.getModuleById(\n\t\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CSS_MODULE_ID,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (consumerMod) {\n\t\t\t\t\t\t\t\tserver.moduleGraph.invalidateModule(consumerMod);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (cssMod) {\n\t\t\t\t\t\t\t\tserver.moduleGraph.invalidateModule(cssMod);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Regenerate types\n\t\t\t\t\t\t\tscheduleTypeGeneration();\n\n\t\t\t\t\t\t\tserver.ws.send({ type: \"full-reload\" });\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tconsola.error(\n\t\t\t\t\t\t\t\t`[styleframe] Failed to load new file: ${file}`,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Watch for deleted *.styleframe.ts files\n\t\t\t\tserver.watcher.on(\"unlink\", async (file) => {\n\t\t\t\t\tif (state.files.has(file)) {\n\t\t\t\t\t\tif (!options.silent) {\n\t\t\t\t\t\t\tconsola.info(\n\t\t\t\t\t\t\t\t`[styleframe] File removed: ${path.relative(cwd, file)}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Collect remaining files (excluding deleted one), sorted by load order\n\t\t\t\t\t\t\tconst remainingFiles = [...state.files.entries()]\n\t\t\t\t\t\t\t\t.filter(([filePath]) => filePath !== file)\n\t\t\t\t\t\t\t\t.sort(([, a], [, b]) => a.loadOrder - b.loadOrder)\n\t\t\t\t\t\t\t\t.map(([filePath]) => filePath);\n\n\t\t\t\t\t\t\t// Reload everything to rebuild the global instance without the deleted file's contributions\n\t\t\t\t\t\t\tawait reloadAll(state, remainingFiles);\n\n\t\t\t\t\t\t\t// Re-scan content after reload (scanner values were cleared)\n\t\t\t\t\t\t\tif (scannerState) {\n\t\t\t\t\t\t\t\tawait scanAndRegister(state, scannerState, {\n\t\t\t\t\t\t\t\t\tsilent: options.silent,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Invalidate consumer and CSS modules\n\t\t\t\t\t\t\tconst consumerMod = server.moduleGraph.getModuleById(\n\t\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CONSUMER_ID,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst cssMod = server.moduleGraph.getModuleById(\n\t\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CSS_MODULE_ID,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (consumerMod) {\n\t\t\t\t\t\t\t\tserver.moduleGraph.invalidateModule(consumerMod);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (cssMod) {\n\t\t\t\t\t\t\t\tserver.moduleGraph.invalidateModule(cssMod);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Regenerate types\n\t\t\t\t\t\t\tscheduleTypeGeneration();\n\n\t\t\t\t\t\t\tserver.ws.send({ type: \"full-reload\" });\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tconsola.error(\n\t\t\t\t\t\t\t\t`[styleframe] Failed to reload after file removal: ${file}`,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\n\t\t\tasync handleHotUpdate(ctx) {\n\t\t\t\tconst getModuleById = async (id: string) => {\n\t\t\t\t\tconst mod = ctx.server?.moduleGraph.getModuleById(id);\n\t\t\t\t\treturn mod ?? (await ctx.server?.moduleGraph.getModuleByUrl(id));\n\t\t\t\t};\n\n\t\t\t\t// Config change → reload everything\n\t\t\t\tif (ctx.file === configPath) {\n\t\t\t\t\tif (!options.silent) {\n\t\t\t\t\t\tconsola.info(`[styleframe] Config changed, reloading...`);\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst files = [...state.files.keys()];\n\t\t\t\t\t\tawait reloadAll(state, files);\n\n\t\t\t\t\t\t// Re-scan content after reload (scanner values were cleared)\n\t\t\t\t\t\tif (scannerState) {\n\t\t\t\t\t\t\tawait scanAndRegister(state, scannerState, {\n\t\t\t\t\t\t\t\tsilent: options.silent,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Invalidate all virtual modules\n\t\t\t\t\t\tconst cssModule = await getModuleById(\n\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CSS_MODULE_ID,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst extensionModule = await getModuleById(\n\t\t\t\t\t\t\tRESOLVED_VIRTUAL_EXTENSION_ID,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst consumerModule = await getModuleById(\n\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CONSUMER_ID,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst modulesToInvalidate = [\n\t\t\t\t\t\t\tcssModule,\n\t\t\t\t\t\t\textensionModule,\n\t\t\t\t\t\t\tconsumerModule,\n\t\t\t\t\t\t].filter(Boolean);\n\n\t\t\t\t\t\t// Regenerate types\n\t\t\t\t\t\tscheduleTypeGeneration();\n\n\t\t\t\t\t\tif (modulesToInvalidate.length > 0) {\n\t\t\t\t\t\t\treturn modulesToInvalidate as typeof ctx.modules;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconsola.error(`[styleframe] Reload failed:`, error);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ctx.modules;\n\t\t\t\t}\n\n\t\t\t\t// Styleframe file change → reload all to rebuild global instance\n\t\t\t\tif (state.files.has(ctx.file)) {\n\t\t\t\t\tif (!options.silent) {\n\t\t\t\t\t\tconsola.info(\n\t\t\t\t\t\t\t`[styleframe] File changed: ${path.relative(cwd, ctx.file)}`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Must reload all files because the global instance accumulates\n\t\t\t\t\t\t// state (variables, selectors, recipes, etc.) and there's no way\n\t\t\t\t\t\t// to undo a single file's contributions. Without a full reload,\n\t\t\t\t\t\t// removed declarations would persist on the global instance.\n\t\t\t\t\t\tconst files = [...state.files.keys()];\n\t\t\t\t\t\tawait reloadAll(state, files);\n\n\t\t\t\t\t\t// Re-scan content after reload (scanner values were cleared)\n\t\t\t\t\t\tif (scannerState) {\n\t\t\t\t\t\t\tawait scanAndRegister(state, scannerState, {\n\t\t\t\t\t\t\t\tsilent: options.silent,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Invalidate CSS and consumer modules\n\t\t\t\t\t\tconst cssModule = await getModuleById(\n\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CSS_MODULE_ID,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst consumerModule = await getModuleById(\n\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CONSUMER_ID,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst modulesToInvalidate = [cssModule, consumerModule].filter(\n\t\t\t\t\t\t\tBoolean,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Regenerate types\n\t\t\t\t\t\tscheduleTypeGeneration();\n\n\t\t\t\t\t\tif (modulesToInvalidate.length > 0) {\n\t\t\t\t\t\t\treturn modulesToInvalidate as typeof ctx.modules;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconsola.error(`[styleframe] Failed to reload: ${ctx.file}`, error);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ctx.modules;\n\t\t\t\t}\n\n\t\t\t\t// Content file change → incremental scan and register new utilities\n\t\t\t\tif (isContentFile(scannerState, ctx.file)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst hasNewValues = await scanFileAndRegister(\n\t\t\t\t\t\t\tstate,\n\t\t\t\t\t\t\tscannerState!,\n\t\t\t\t\t\t\tctx.file,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (hasNewValues) {\n\t\t\t\t\t\t\tconst cssModule = await getModuleById(\n\t\t\t\t\t\t\t\tRESOLVED_VIRTUAL_CSS_MODULE_ID,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (cssModule) {\n\t\t\t\t\t\t\t\treturn [cssModule, ...ctx.modules];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconsola.error(\n\t\t\t\t\t\t\t`[styleframe] Failed to scan content file: ${ctx.file}`,\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn ctx.modules;\n\t\t\t\t}\n\n\t\t\t\treturn ctx.modules;\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory);\n\nexport default unplugin;\n"],"mappings":";;;;;;;;;;;;;;AAEA,MAAa,gBAAgB;AAE7B,MAAaA,kBAA2B;CACvC,OAAO;CACP,QAAQ;CACR;AAED,MAAa,cAAc;AAC3B,MAAa,kBAAkB;AAC/B,MAAa,kBAAkB;AAE/B,MAAa,wBAAwB,GAAG,kBAAkB,YAAY;AACtE,MAAa,iCAAiC,GAAG,kBAAkB;AACnE,MAAa,uBAAuB,GAAG,kBAAkB;AACzD,MAAa,gCAAgC,GAAG,kBAAkB;AAGlE,MAAa,gCAAgC,GAAG,kBAAkB,kBAAkB,YAAY;AAChG,MAAa,+BAA+B,GAAG,kBAAkB,kBAAkB,YAAY;AAG/F,MAAa,0BAA0B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;;;ACKD,SAAgB,kBAAkB,YAAuC;AACxE,QAAO;EACN,gBAAgB;EAChB,YAAY;GACX,MAAM;GACN,WAAW;GACX,yBAAS,IAAI,KA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OACZ,SAAQ,KACP,8BAA8B,KAAK,SAAS,KAAK,IAAI,KAAK,GAC1D;AAGF,SAAI;AAMH,YAAM,UAAU,OADF,CAAC,GAAG,MAAM,MAAM,MAAM,CAAC,CACR;AAG7B,UAAI,aACH,OAAM,gBAAgB,OAAO,cAAc,EAC1C,QAAQ,QAAQ,QAChB,CAAC;MAWH,MAAM,sBAAsB,CAPV,MAAM,cACvB,+BACA,EACsB,MAAM,cAC5B,6BACA,CAEsD,CAAC,OACvD,QACA;AAGD,8BAAwB;AAExB,UAAI,oBAAoB,SAAS,EAChC,QAAO;cAEA,OAAO;AACf,cAAQ,MAAM,kCAAkC,IAAI,QAAQ,MAAM;;AAGnE,YAAO,IAAI;;AAIZ,QAAI,cAAc,cAAc,IAAI,KAAK,EAAE;AAC1C,SAAI;AAOH,UANqB,MAAM,oBAC1B,OACA,cACA,IAAI,KACJ,EAEiB;OACjB,MAAM,YAAY,MAAM,cACvB,+BACA;AAED,WAAI,UACH,QAAO,CAAC,WAAW,GAAG,IAAI,QAAQ;;cAG5B,OAAO;AACf,cAAQ,MACP,6CAA6C,IAAI,QACjD,MACA;;AAGF,YAAO,IAAI;;AAGZ,WAAO,IAAI;;GAEZ;EACD;;AAGF,MAAa,WAA2B,+BAAe,gBAAgB;AAEvE,qBAAe"}
package/dist/rollup.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-Clt7t35T.js";
1
+ import { Options } from "./index-CXVebONK.js";
2
2
  import * as rollup0 from "rollup";
3
3
 
4
4
  //#region src/rollup.d.ts
package/dist/rollup.js CHANGED
@@ -1,5 +1,4 @@
1
- import "./constants-CnbAL4bY.js";
2
- import { unpluginFactory } from "./src-BfsicZRP.js";
1
+ import { unpluginFactory } from "./plugin-WmJKFcn_.js";
3
2
  import { createRollupPlugin } from "unplugin";
4
3
 
5
4
  //#region src/rollup.ts
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.js","names":[],"sources":["../src/rollup.ts"],"sourcesContent":["import { createRollupPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createRollupPlugin(unpluginFactory);\n"],"mappings":";;;;;AAGA,qBAAe,mBAAmB,gBAAgB"}
1
+ {"version":3,"file":"rollup.js","names":[],"sources":["../src/rollup.ts"],"sourcesContent":["import { createRollupPlugin } from \"unplugin\";\nimport { unpluginFactory } from \"./plugin\";\n\nexport default createRollupPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,qBAAe,mBAAmB,gBAAgB"}
package/dist/rspack.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-Clt7t35T.js";
1
+ import { Options } from "./index-CXVebONK.js";
2
2
 
3
3
  //#region src/rspack.d.ts
4
4
  declare const _default: (options?: Options | undefined) => RspackPluginInstance;
package/dist/rspack.js CHANGED
@@ -1,5 +1,4 @@
1
- import "./constants-CnbAL4bY.js";
2
- import { unpluginFactory } from "./src-BfsicZRP.js";
1
+ import { unpluginFactory } from "./plugin-WmJKFcn_.js";
3
2
  import { createRspackPlugin } from "unplugin";
4
3
 
5
4
  //#region src/rspack.ts
@@ -1 +1 @@
1
- {"version":3,"file":"rspack.js","names":[],"sources":["../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createRspackPlugin(unpluginFactory);\n"],"mappings":";;;;;AAGA,qBAAe,mBAAmB,gBAAgB"}
1
+ {"version":3,"file":"rspack.js","names":[],"sources":["../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from \"unplugin\";\nimport { unpluginFactory } from \"./plugin\";\n\nexport default createRspackPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,qBAAe,mBAAmB,gBAAgB"}
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-BfsicZRP.js";
1
+ import { unpluginFactory } from "./plugin-WmJKFcn_.js";
2
2
  import { createVitePlugin } from "unplugin";
3
3
 
4
4
  //#region src/vite.ts
@@ -6,4 +6,4 @@ var vite_default = createVitePlugin(unpluginFactory);
6
6
 
7
7
  //#endregion
8
8
  export { vite_default };
9
- //# sourceMappingURL=vite-Cd6Z9GAd.js.map
9
+ //# sourceMappingURL=vite-zWsCwvYT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-zWsCwvYT.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from \"unplugin\";\nimport { unpluginFactory } from \"./plugin\";\n\nexport default createVitePlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,mBAAe,iBAAiB,gBAAgB"}
package/dist/vite.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Options } from "./types-Clt7t35T.js";
1
+ import { Options } from "./index-CXVebONK.js";
2
2
  import * as unplugin0 from "unplugin";
3
3
 
4
4
  //#region src/vite.d.ts
package/dist/vite.js CHANGED
@@ -1,5 +1,4 @@
1
- import "./constants-CnbAL4bY.js";
2
- import "./src-BfsicZRP.js";
3
- import { vite_default } from "./vite-Cd6Z9GAd.js";
1
+ import "./plugin-WmJKFcn_.js";
2
+ import { vite_default } from "./vite-zWsCwvYT.js";
4
3
 
5
4
  export { vite_default as default };
@@ -1,4 +1,4 @@
1
- import { unpluginFactory } from "./src-BfsicZRP.js";
1
+ import { unpluginFactory } from "./plugin-WmJKFcn_.js";
2
2
  import { createWebpackPlugin } from "unplugin";
3
3
 
4
4
  //#region src/webpack.ts
@@ -6,4 +6,4 @@ var webpack_default = createWebpackPlugin(unpluginFactory);
6
6
 
7
7
  //#endregion
8
8
  export { webpack_default };
9
- //# sourceMappingURL=webpack-yNnIZ6Rq.js.map
9
+ //# sourceMappingURL=webpack-De3KlGzm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack-De3KlGzm.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import { createWebpackPlugin } from \"unplugin\";\nimport { unpluginFactory } from \"./plugin\";\n\nexport default createWebpackPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,sBAAe,oBAAoB,gBAAgB"}
package/dist/webpack.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Options } from "./types-Clt7t35T.js";
2
- import * as unplugin0 from "unplugin";
1
+ import { Options } from "./index-CXVebONK.js";
2
+ import * as unplugin1 from "unplugin";
3
3
 
4
4
  //#region src/webpack.d.ts
5
- declare const _default: (options?: Options | undefined) => unplugin0.WebpackPluginInstance;
5
+ declare const _default: (options?: Options | undefined) => unplugin1.WebpackPluginInstance;
6
6
  //#endregion
7
7
  export { _default as default };
8
8
  //# sourceMappingURL=webpack.d.ts.map
package/dist/webpack.js CHANGED
@@ -1,5 +1,4 @@
1
- import "./constants-CnbAL4bY.js";
2
- import "./src-BfsicZRP.js";
3
- import { webpack_default } from "./webpack-yNnIZ6Rq.js";
1
+ import "./plugin-WmJKFcn_.js";
2
+ import { webpack_default } from "./webpack-De3KlGzm.js";
4
3
 
5
4
  export { webpack_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@styleframe/plugin",
3
3
  "type": "module",
4
- "version": "2.4.0",
4
+ "version": "3.0.0",
5
5
  "description": "Unplugin for Styleframe. Use it with Vite, Webpack, Astro, Nuxt, Rollup, Rspack, and more.",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -78,15 +78,19 @@
78
78
  }
79
79
  },
80
80
  "dependencies": {
81
- "@styleframe/license": "^2.0.0",
82
- "@styleframe/loader": "^2.4.0",
83
- "@styleframe/transpiler": "^2.6.0",
81
+ "@styleframe/license": "^2.0.2",
82
+ "@styleframe/loader": "^3.0.0",
83
+ "@styleframe/scanner": "^3.0.0",
84
+ "@styleframe/transpiler": "^3.0.0",
84
85
  "consola": "^3.4.2",
86
+ "tinyglobby": "^0.2.15",
87
+ "jiti": "^2.4.2",
85
88
  "unplugin": "^2.3.4"
86
89
  },
87
90
  "devDependencies": {
88
91
  "@farmfe/core": "^1.7.11",
89
- "@styleframe/config-typescript": "^2",
92
+ "@styleframe/config-typescript": "^3.0.0",
93
+ "@styleframe/core": "^3.0.0",
90
94
  "@vitest/coverage-v8": "^3.2.4",
91
95
  "@nuxt/kit": "4.1.3",
92
96
  "@nuxt/schema": "4.1.3",
@@ -1,17 +0,0 @@
1
- //#region src/constants.ts
2
- const DEFAULT_ENTRY = "./styleframe.config.ts";
3
- const DEFAULT_OPTIONS = {
4
- entry: DEFAULT_ENTRY,
5
- silent: false
6
- };
7
- const PLUGIN_NAME = "styleframe";
8
- const IMPORT_V_PREFIX = "virtual:";
9
- const ROLLUP_V_PREFIX = "\0";
10
- const VIRTUAL_CSS_MODULE_ID = `${IMPORT_V_PREFIX}${PLUGIN_NAME}.css`;
11
- const RESOLVED_VIRTUAL_CSS_MODULE_ID = `${ROLLUP_V_PREFIX}${VIRTUAL_CSS_MODULE_ID}`;
12
- const VIRTUAL_TS_MODULE_ID = `${IMPORT_V_PREFIX}${PLUGIN_NAME}`;
13
- const RESOLVED_VIRTUAL_TS_MODULE_ID = `${ROLLUP_V_PREFIX}${VIRTUAL_TS_MODULE_ID}`;
14
-
15
- //#endregion
16
- export { DEFAULT_ENTRY, DEFAULT_OPTIONS, IMPORT_V_PREFIX, PLUGIN_NAME, RESOLVED_VIRTUAL_CSS_MODULE_ID, RESOLVED_VIRTUAL_TS_MODULE_ID, ROLLUP_V_PREFIX, VIRTUAL_CSS_MODULE_ID, VIRTUAL_TS_MODULE_ID };
17
- //# sourceMappingURL=constants-CnbAL4bY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-CnbAL4bY.js","names":["DEFAULT_OPTIONS: Options"],"sources":["../src/constants.ts"],"sourcesContent":["import type { Options } from \"./types\";\n\nexport const DEFAULT_ENTRY = \"./styleframe.config.ts\";\n\nexport const DEFAULT_OPTIONS: Options = {\n\tentry: DEFAULT_ENTRY,\n\tsilent: false,\n};\n\nexport const PLUGIN_NAME = \"styleframe\";\nexport const IMPORT_V_PREFIX = \"virtual:\"; // Vite \"virtual\" module id prefix\nexport const ROLLUP_V_PREFIX = \"\\0\"; // Rollup \"virtual\" id prefix\n\nexport const VIRTUAL_CSS_MODULE_ID = `${IMPORT_V_PREFIX}${PLUGIN_NAME}.css`;\nexport const RESOLVED_VIRTUAL_CSS_MODULE_ID = `${ROLLUP_V_PREFIX}${VIRTUAL_CSS_MODULE_ID}`;\nexport const VIRTUAL_TS_MODULE_ID = `${IMPORT_V_PREFIX}${PLUGIN_NAME}`;\nexport const RESOLVED_VIRTUAL_TS_MODULE_ID = `${ROLLUP_V_PREFIX}${VIRTUAL_TS_MODULE_ID}`;\n"],"mappings":";AAEA,MAAa,gBAAgB;AAE7B,MAAaA,kBAA2B;CACvC,OAAO;CACP,QAAQ;CACR;AAED,MAAa,cAAc;AAC3B,MAAa,kBAAkB;AAC/B,MAAa,kBAAkB;AAE/B,MAAa,wBAAwB,GAAG,kBAAkB,YAAY;AACtE,MAAa,iCAAiC,GAAG,kBAAkB;AACnE,MAAa,uBAAuB,GAAG,kBAAkB;AACzD,MAAa,gCAAgC,GAAG,kBAAkB"}
@@ -1,17 +0,0 @@
1
- import { Options } from "./types-Clt7t35T.js";
2
-
3
- //#region src/constants.d.ts
4
- declare const DEFAULT_ENTRY = "./styleframe.config.ts";
5
- declare const DEFAULT_OPTIONS: Options;
6
- declare const PLUGIN_NAME = "styleframe";
7
- declare const IMPORT_V_PREFIX = "virtual:";
8
- declare const ROLLUP_V_PREFIX = "\0";
9
- declare const VIRTUAL_CSS_MODULE_ID = "virtual:styleframe.css";
10
- declare const RESOLVED_VIRTUAL_CSS_MODULE_ID = "\0virtual:styleframe.css";
11
- declare const VIRTUAL_TS_MODULE_ID = "virtual:styleframe";
12
- declare const RESOLVED_VIRTUAL_TS_MODULE_ID = "\0virtual:styleframe";
13
- //# sourceMappingURL=constants.d.ts.map
14
-
15
- //#endregion
16
- export { DEFAULT_ENTRY, DEFAULT_OPTIONS, IMPORT_V_PREFIX, PLUGIN_NAME, RESOLVED_VIRTUAL_CSS_MODULE_ID, RESOLVED_VIRTUAL_TS_MODULE_ID, ROLLUP_V_PREFIX, VIRTUAL_CSS_MODULE_ID, VIRTUAL_TS_MODULE_ID };
17
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"sourcesContent":[],"mappings":";;;cAEa,aAAA;cAEA,iBAAiB;AAFjB,cAOA,WAAA,GAPa,YAAA;AAEb,cAMA,eAAA,GANiB,UAG7B;AAEY,cAEA,eAAA,GAFW,IAAA;AACX,cAGA,qBAAA,GAHe,wBAAA;AACf,cAGA,8BAAA,GAHe,0BAAA;AAEf,cAEA,oBAAA,GAFqB,oBAAA;AACrB,cAEA,6BAAA,GAF8B,sBAAA;AAC3C"}
package/dist/constants.js DELETED
@@ -1,3 +0,0 @@
1
- import { DEFAULT_ENTRY, DEFAULT_OPTIONS, IMPORT_V_PREFIX, PLUGIN_NAME, RESOLVED_VIRTUAL_CSS_MODULE_ID, RESOLVED_VIRTUAL_TS_MODULE_ID, ROLLUP_V_PREFIX, VIRTUAL_CSS_MODULE_ID, VIRTUAL_TS_MODULE_ID } from "./constants-CnbAL4bY.js";
2
-
3
- export { DEFAULT_ENTRY, DEFAULT_OPTIONS, IMPORT_V_PREFIX, PLUGIN_NAME, RESOLVED_VIRTUAL_CSS_MODULE_ID, RESOLVED_VIRTUAL_TS_MODULE_ID, ROLLUP_V_PREFIX, VIRTUAL_CSS_MODULE_ID, VIRTUAL_TS_MODULE_ID };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;cAiJa,iBAAiB,gBAAgB;cAiLjC,UAAQ,SAAA,CAAA,iBAAA"}
@@ -1,160 +0,0 @@
1
- import { DEFAULT_ENTRY, DEFAULT_OPTIONS, PLUGIN_NAME, RESOLVED_VIRTUAL_CSS_MODULE_ID, RESOLVED_VIRTUAL_TS_MODULE_ID, ROLLUP_V_PREFIX, VIRTUAL_CSS_MODULE_ID, VIRTUAL_TS_MODULE_ID } from "./constants-CnbAL4bY.js";
2
- import path from "node:path";
3
- import { getLicenseKeyFromEnv, validateInstanceLicense } from "@styleframe/license";
4
- import { loadConfiguration } from "@styleframe/loader";
5
- import { transpile } from "@styleframe/transpiler";
6
- import { consola } from "consola";
7
- import { transform } from "esbuild";
8
- import { createUnplugin } from "unplugin";
9
-
10
- //#region src/index.ts
11
- const STYLEFRAME_SOURCE_REGEX = /\.styleframe\.ts$/;
12
- const STYLEFRAME_CSS_VIRTUAL_PREFIX = `${ROLLUP_V_PREFIX}styleframe.css:`;
13
- const STYLEFRAME_TS_VIRTUAL_PREFIX = `${ROLLUP_V_PREFIX}styleframe.ts:`;
14
- async function loadAndBuildEntry(entry, options, isBuild) {
15
- const instance = await loadConfiguration({ entry });
16
- await validateInstanceLicense(instance, {
17
- licenseKey: getLicenseKeyFromEnv() || "",
18
- environment: process.env.NODE_ENV || "development",
19
- isBuild
20
- });
21
- return transpile(instance, options);
22
- }
23
- function isStyleframeSourceFile(id) {
24
- return STYLEFRAME_SOURCE_REGEX.test(id);
25
- }
26
- function getResolvedVirtualId(filePath, type) {
27
- return `${type === "css" ? STYLEFRAME_CSS_VIRTUAL_PREFIX : STYLEFRAME_TS_VIRTUAL_PREFIX}${type === "css" ? filePath.replace(/\.ts$/, ".css") : filePath}`;
28
- }
29
- function parseVirtualId(id) {
30
- if (id.startsWith(STYLEFRAME_CSS_VIRTUAL_PREFIX)) return {
31
- type: "css",
32
- filePath: id.slice(STYLEFRAME_CSS_VIRTUAL_PREFIX.length).replace(/\.css$/, ".ts")
33
- };
34
- if (id.startsWith(STYLEFRAME_TS_VIRTUAL_PREFIX)) return {
35
- type: "ts",
36
- filePath: id.slice(STYLEFRAME_TS_VIRTUAL_PREFIX.length)
37
- };
38
- return null;
39
- }
40
- function resolveSourcePath(file, importer) {
41
- if (path.isAbsolute(file)) return file;
42
- if (importer) return path.resolve(path.dirname(importer), file);
43
- return path.resolve(process.cwd(), file);
44
- }
45
- async function buildEntries(ctx, entries, type, outputName, options, isBuildCommand) {
46
- let hasError = false;
47
- const isGlobalConfig = outputName.startsWith("styleframe.config");
48
- if (!options.silent) {
49
- if (isGlobalConfig) console.log("");
50
- consola.info(`[styleframe] Building ${outputName}...`);
51
- }
52
- const results = [];
53
- for (const entry of entries) {
54
- ctx.addWatchFile(entry);
55
- try {
56
- results.push(await loadAndBuildEntry(entry, { type }, isBuildCommand));
57
- } catch (error) {
58
- hasError = true;
59
- consola.error(`[styleframe] Failed to build: ${entry}`, error);
60
- if (!isGlobalConfig) throw error;
61
- }
62
- }
63
- const code = results.reduce((acc, result) => acc + "\n" + result.files.reduce((fileAcc, file) => `${fileAcc}\n${file.content}`, ""), "");
64
- if (!options.silent && !hasError) {
65
- consola.success(`[styleframe] Built ${outputName} successfully.`);
66
- if (isGlobalConfig) console.log("");
67
- }
68
- return { code };
69
- }
70
- const unpluginFactory = (options = DEFAULT_OPTIONS) => {
71
- const rawEntry = options.entry ?? DEFAULT_ENTRY;
72
- const entries = (typeof rawEntry === "string" ? [rawEntry] : rawEntry).map((p) => path.isAbsolute(p) ? p : path.resolve(process.cwd(), p));
73
- let isBuildCommand = false;
74
- const sourceToVirtualModules = /* @__PURE__ */ new Map();
75
- return {
76
- name: PLUGIN_NAME,
77
- enforce: "pre",
78
- resolveId(id, importer) {
79
- if (id === VIRTUAL_CSS_MODULE_ID) return RESOLVED_VIRTUAL_CSS_MODULE_ID;
80
- else if (id === VIRTUAL_TS_MODULE_ID) return RESOLVED_VIRTUAL_TS_MODULE_ID;
81
- const [pathPart, queryPart] = id.split("?");
82
- if (!pathPart || !/\.styleframe(\.ts)?$/.test(pathPart)) return null;
83
- const isCss = queryPart === "css";
84
- if (!isCss && !(queryPart === "ts")) return null;
85
- let sourceFile = pathPart;
86
- if (!sourceFile.endsWith(".ts")) sourceFile += ".ts";
87
- const resolvedSourcePath = resolveSourcePath(sourceFile, importer);
88
- const virtualId = getResolvedVirtualId(resolvedSourcePath, isCss ? "css" : "ts");
89
- let modules = sourceToVirtualModules.get(resolvedSourcePath);
90
- if (!modules) {
91
- modules = /* @__PURE__ */ new Set();
92
- sourceToVirtualModules.set(resolvedSourcePath, modules);
93
- }
94
- modules.add(virtualId);
95
- return virtualId;
96
- },
97
- buildStart() {
98
- isBuildCommand = process.argv.includes("build");
99
- },
100
- async load(id) {
101
- if (id === RESOLVED_VIRTUAL_CSS_MODULE_ID || id === RESOLVED_VIRTUAL_TS_MODULE_ID) {
102
- const type = id.endsWith(".css") ? "css" : "ts";
103
- return buildEntries(this, entries, type, `styleframe.config.${type}`, options, isBuildCommand);
104
- }
105
- const parsed = parseVirtualId(id);
106
- if (parsed) {
107
- const { type, filePath } = parsed;
108
- const relativePath = path.relative(process.cwd(), filePath);
109
- const consolePath = type === "css" ? relativePath.replace(".ts", ".css") : relativePath;
110
- return buildEntries(this, [filePath], type, consolePath, options, isBuildCommand);
111
- }
112
- return null;
113
- },
114
- vite: {
115
- async transform(code, id) {
116
- if (id === RESOLVED_VIRTUAL_TS_MODULE_ID || id.startsWith(STYLEFRAME_TS_VIRTUAL_PREFIX)) {
117
- const result = await transform(code, {
118
- loader: "ts",
119
- format: "esm",
120
- target: "esnext"
121
- });
122
- return {
123
- code: result.code,
124
- map: result.map || null
125
- };
126
- }
127
- return null;
128
- },
129
- async handleHotUpdate(ctx) {
130
- const getModuleById = async (id) => {
131
- return ctx.server?.moduleGraph.getModuleById(id) ?? await ctx.server?.moduleGraph.getModuleByUrl(id);
132
- };
133
- if (entries.includes(ctx.file)) {
134
- const cssModule = await getModuleById(RESOLVED_VIRTUAL_CSS_MODULE_ID) ?? await getModuleById(VIRTUAL_CSS_MODULE_ID);
135
- const tsModule = await getModuleById(RESOLVED_VIRTUAL_TS_MODULE_ID) ?? await getModuleById(VIRTUAL_TS_MODULE_ID);
136
- if (cssModule || tsModule) return [...cssModule ? [cssModule] : [], ...tsModule ? [tsModule] : []];
137
- ctx.server?.ws.send({ type: "full-reload" });
138
- }
139
- if (isStyleframeSourceFile(ctx.file)) {
140
- const virtualModuleIds = sourceToVirtualModules.get(ctx.file);
141
- if (virtualModuleIds && virtualModuleIds.size > 0) {
142
- const modulesToInvalidate = [];
143
- for (const virtualId of virtualModuleIds) {
144
- const virtualModule = await getModuleById(virtualId);
145
- if (virtualModule) modulesToInvalidate.push(virtualModule);
146
- }
147
- if (modulesToInvalidate.length > 0) return modulesToInvalidate;
148
- }
149
- }
150
- return ctx.modules;
151
- }
152
- }
153
- };
154
- };
155
- const unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
156
- var src_default = unplugin;
157
-
158
- //#endregion
159
- export { src_default, unplugin, unpluginFactory };
160
- //# sourceMappingURL=src-BfsicZRP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"src-BfsicZRP.js","names":["unpluginFactory: UnpluginFactory<Options | undefined>","entries: string[]","esbuildTransform"],"sources":["../src/index.ts"],"sourcesContent":["import path from \"node:path\";\nimport {\n\tgetLicenseKeyFromEnv,\n\tvalidateInstanceLicense,\n} from \"@styleframe/license\";\nimport { loadConfiguration } from \"@styleframe/loader\";\nimport type { TranspileOptions } from \"@styleframe/transpiler\";\nimport { transpile } from \"@styleframe/transpiler\";\nimport { consola } from \"consola\";\nimport { transform as esbuildTransform } from \"esbuild\";\nimport type { UnpluginBuildContext, UnpluginFactory } from \"unplugin\";\nimport { createUnplugin } from \"unplugin\";\nimport {\n\tDEFAULT_ENTRY,\n\tDEFAULT_OPTIONS,\n\tPLUGIN_NAME,\n\tRESOLVED_VIRTUAL_CSS_MODULE_ID,\n\tRESOLVED_VIRTUAL_TS_MODULE_ID,\n\tROLLUP_V_PREFIX,\n\tVIRTUAL_CSS_MODULE_ID,\n\tVIRTUAL_TS_MODULE_ID,\n} from \"./constants\";\nimport type { Options } from \"./types\";\n\n// Matches the source file: ./button.styleframe.ts\nconst STYLEFRAME_SOURCE_REGEX = /\\.styleframe\\.ts$/;\n\n// Virtual module prefixes for styleframe files\nconst STYLEFRAME_CSS_VIRTUAL_PREFIX = `${ROLLUP_V_PREFIX}styleframe.css:`;\nconst STYLEFRAME_TS_VIRTUAL_PREFIX = `${ROLLUP_V_PREFIX}styleframe.ts:`;\n\nasync function loadAndBuildEntry(\n\tentry: string,\n\toptions: TranspileOptions,\n\tisBuild: boolean,\n) {\n\tconst instance = await loadConfiguration({ entry });\n\n\tawait validateInstanceLicense(instance, {\n\t\tlicenseKey: getLicenseKeyFromEnv() || \"\",\n\t\tenvironment: process.env.NODE_ENV || \"development\",\n\t\tisBuild,\n\t});\n\n\treturn transpile(instance, options);\n}\n\nfunction isStyleframeSourceFile(id: string): boolean {\n\treturn STYLEFRAME_SOURCE_REGEX.test(id);\n}\n\nfunction getResolvedVirtualId(filePath: string, type: \"css\" | \"ts\"): string {\n\tconst prefix =\n\t\ttype === \"css\"\n\t\t\t? STYLEFRAME_CSS_VIRTUAL_PREFIX\n\t\t\t: STYLEFRAME_TS_VIRTUAL_PREFIX;\n\t// Change extension based on output type for proper handling by Vite/Rollup\n\t// CSS virtual modules end in .css, TS virtual modules end in .ts\n\tconst outputPath =\n\t\ttype === \"css\" ? filePath.replace(/\\.ts$/, \".css\") : filePath;\n\treturn `${prefix}${outputPath}`;\n}\n\nfunction parseVirtualId(\n\tid: string,\n): { type: \"css\" | \"ts\"; filePath: string } | null {\n\tif (id.startsWith(STYLEFRAME_CSS_VIRTUAL_PREFIX)) {\n\t\treturn {\n\t\t\ttype: \"css\",\n\t\t\t// Convert back to source .ts path\n\t\t\tfilePath: id\n\t\t\t\t.slice(STYLEFRAME_CSS_VIRTUAL_PREFIX.length)\n\t\t\t\t.replace(/\\.css$/, \".ts\"),\n\t\t};\n\t}\n\tif (id.startsWith(STYLEFRAME_TS_VIRTUAL_PREFIX)) {\n\t\treturn {\n\t\t\ttype: \"ts\",\n\t\t\tfilePath: id.slice(STYLEFRAME_TS_VIRTUAL_PREFIX.length),\n\t\t};\n\t}\n\treturn null;\n}\n\nfunction resolveSourcePath(file: string, importer?: string): string {\n\tif (path.isAbsolute(file)) {\n\t\treturn file;\n\t}\n\tif (importer) {\n\t\treturn path.resolve(path.dirname(importer), file);\n\t}\n\treturn path.resolve(process.cwd(), file);\n}\n\nasync function buildEntries(\n\tctx: UnpluginBuildContext,\n\tentries: string[],\n\ttype: \"css\" | \"ts\",\n\toutputName: string,\n\toptions: Options,\n\tisBuildCommand: boolean,\n) {\n\tlet hasError = false;\n\tconst isGlobalConfig = outputName.startsWith(\"styleframe.config\");\n\n\tif (!options.silent) {\n\t\tif (isGlobalConfig) {\n\t\t\tconsole.log(\"\");\n\t\t}\n\t\tconsola.info(`[styleframe] Building ${outputName}...`);\n\t}\n\n\tconst results = [];\n\tfor (const entry of entries) {\n\t\tctx.addWatchFile(entry);\n\n\t\ttry {\n\t\t\tresults.push(await loadAndBuildEntry(entry, { type }, isBuildCommand));\n\t\t} catch (error) {\n\t\t\thasError = true;\n\t\t\tconsola.error(`[styleframe] Failed to build: ${entry}`, error);\n\t\t\tif (!isGlobalConfig) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\tconst code = results.reduce(\n\t\t(acc, result) =>\n\t\t\tacc +\n\t\t\t\"\\n\" +\n\t\t\tresult.files.reduce((fileAcc, file) => `${fileAcc}\\n${file.content}`, \"\"),\n\t\t\"\",\n\t);\n\n\tif (!options.silent && !hasError) {\n\t\tconsola.success(`[styleframe] Built ${outputName} successfully.`);\n\t\tif (isGlobalConfig) {\n\t\t\tconsole.log(\"\");\n\t\t}\n\t}\n\n\treturn { code };\n}\n\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (\n\toptions = DEFAULT_OPTIONS,\n) => {\n\tconst rawEntry = options.entry ?? DEFAULT_ENTRY;\n\tconst entries: string[] = (\n\t\ttypeof rawEntry === \"string\" ? [rawEntry] : rawEntry\n\t).map((p) => (path.isAbsolute(p) ? p : path.resolve(process.cwd(), p)));\n\n\tlet isBuildCommand = false;\n\n\t// Track styleframe source files and their virtual module mappings\n\tconst sourceToVirtualModules = new Map<string, Set<string>>();\n\n\treturn {\n\t\tname: PLUGIN_NAME,\n\t\tenforce: \"pre\",\n\t\tresolveId(id, importer) {\n\t\t\t// Handle existing virtual modules\n\t\t\tif (id === VIRTUAL_CSS_MODULE_ID) {\n\t\t\t\treturn RESOLVED_VIRTUAL_CSS_MODULE_ID;\n\t\t\t} else if (id === VIRTUAL_TS_MODULE_ID) {\n\t\t\t\treturn RESOLVED_VIRTUAL_TS_MODULE_ID;\n\t\t\t}\n\n\t\t\t// Parse query parameters\n\t\t\tconst [pathPart, queryPart] = id.split(\"?\");\n\n\t\t\t// Only handle .styleframe files with specific queries\n\t\t\t// .styleframe or .styleframe.ts\n\t\t\tif (!pathPart || !/\\.styleframe(\\.ts)?$/.test(pathPart)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst isCss = queryPart === \"css\";\n\t\t\tconst isTs = queryPart === \"ts\";\n\n\t\t\tif (!isCss && !isTs) {\n\t\t\t\t// Pass through for default resolution (e.g. importing the instance itself)\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Resolve the source file path\n\t\t\tlet sourceFile = pathPart;\n\t\t\tif (!sourceFile.endsWith(\".ts\")) {\n\t\t\t\tsourceFile += \".ts\";\n\t\t\t}\n\n\t\t\tconst resolvedSourcePath = resolveSourcePath(sourceFile, importer);\n\t\t\tconst type = isCss ? \"css\" : \"ts\";\n\t\t\tconst virtualId = getResolvedVirtualId(resolvedSourcePath, type);\n\n\t\t\t// Track the mapping for HMR\n\t\t\tlet modules = sourceToVirtualModules.get(resolvedSourcePath);\n\t\t\tif (!modules) {\n\t\t\t\tmodules = new Set();\n\t\t\t\tsourceToVirtualModules.set(resolvedSourcePath, modules);\n\t\t\t}\n\t\t\tmodules.add(virtualId);\n\n\t\t\treturn virtualId;\n\t\t},\n\t\tbuildStart() {\n\t\t\tisBuildCommand = process.argv.includes(\"build\");\n\t\t},\n\t\tasync load(id) {\n\t\t\t// Handle existing virtual CSS/TS modules\n\t\t\tif (\n\t\t\t\tid === RESOLVED_VIRTUAL_CSS_MODULE_ID ||\n\t\t\t\tid === RESOLVED_VIRTUAL_TS_MODULE_ID\n\t\t\t) {\n\t\t\t\tconst type = id.endsWith(\".css\") ? \"css\" : \"ts\";\n\t\t\t\treturn buildEntries(\n\t\t\t\t\tthis,\n\t\t\t\t\tentries,\n\t\t\t\t\ttype,\n\t\t\t\t\t`styleframe.config.${type}`,\n\t\t\t\t\toptions,\n\t\t\t\t\tisBuildCommand,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Handle .styleframe virtual modules\n\t\t\tconst parsed = parseVirtualId(id);\n\t\t\tif (parsed) {\n\t\t\t\tconst { type, filePath } = parsed;\n\t\t\t\tconst relativePath = path.relative(process.cwd(), filePath);\n\t\t\t\tconst consolePath =\n\t\t\t\t\ttype === \"css\" ? relativePath.replace(\".ts\", \".css\") : relativePath;\n\n\t\t\t\treturn buildEntries(\n\t\t\t\t\tthis,\n\t\t\t\t\t[filePath],\n\t\t\t\t\ttype,\n\t\t\t\t\tconsolePath,\n\t\t\t\t\toptions,\n\t\t\t\t\tisBuildCommand,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t},\n\t\tvite: {\n\t\t\tasync transform(code, id) {\n\t\t\t\t// Transform TypeScript virtual modules since Vite's esbuild doesn't process them\n\t\t\t\tconst isVirtualTsModule =\n\t\t\t\t\tid === RESOLVED_VIRTUAL_TS_MODULE_ID ||\n\t\t\t\t\tid.startsWith(STYLEFRAME_TS_VIRTUAL_PREFIX);\n\n\t\t\t\tif (isVirtualTsModule) {\n\t\t\t\t\tconst result = await esbuildTransform(code, {\n\t\t\t\t\t\tloader: \"ts\",\n\t\t\t\t\t\tformat: \"esm\",\n\t\t\t\t\t\ttarget: \"esnext\",\n\t\t\t\t\t});\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcode: result.code,\n\t\t\t\t\t\tmap: result.map || null,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t},\n\t\t\tasync handleHotUpdate(ctx) {\n\t\t\t\tconst getModuleById = async (id: string) => {\n\t\t\t\t\tconst mod = ctx.server?.moduleGraph.getModuleById(id);\n\t\t\t\t\treturn mod ?? (await ctx.server?.moduleGraph.getModuleByUrl(id));\n\t\t\t\t};\n\n\t\t\t\t// If a tracked entry changed, rebuild it and invalidate the virtual css module\n\t\t\t\tif (entries.includes(ctx.file)) {\n\t\t\t\t\t// Invalidate the virtual module so HMR pushes the updated css\n\t\t\t\t\tconst cssModule =\n\t\t\t\t\t\t(await getModuleById(RESOLVED_VIRTUAL_CSS_MODULE_ID)) ??\n\t\t\t\t\t\t(await getModuleById(VIRTUAL_CSS_MODULE_ID));\n\n\t\t\t\t\t// Invalidate the virtual module so HMR pushes the updated typescript module\n\t\t\t\t\tconst tsModule =\n\t\t\t\t\t\t(await getModuleById(RESOLVED_VIRTUAL_TS_MODULE_ID)) ??\n\t\t\t\t\t\t(await getModuleById(VIRTUAL_TS_MODULE_ID));\n\n\t\t\t\t\tif (cssModule || tsModule) {\n\t\t\t\t\t\t// Tell Vite that this module is affected\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\t...(cssModule ? [cssModule] : []),\n\t\t\t\t\t\t\t...(tsModule ? [tsModule] : []),\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\t// Fall back to a full reload if for some reason we didn't find the module\n\t\t\t\t\tctx.server?.ws.send({ type: \"full-reload\" });\n\t\t\t\t}\n\n\t\t\t\t// Handle HMR for .styleframe.ts source files\n\t\t\t\tif (isStyleframeSourceFile(ctx.file)) {\n\t\t\t\t\tconst virtualModuleIds = sourceToVirtualModules.get(ctx.file);\n\n\t\t\t\t\tif (virtualModuleIds && virtualModuleIds.size > 0) {\n\t\t\t\t\t\tconst modulesToInvalidate = [];\n\n\t\t\t\t\t\tfor (const virtualId of virtualModuleIds) {\n\t\t\t\t\t\t\tconst virtualModule = await getModuleById(virtualId);\n\t\t\t\t\t\t\tif (virtualModule) {\n\t\t\t\t\t\t\t\tmodulesToInvalidate.push(virtualModule);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (modulesToInvalidate.length > 0) {\n\t\t\t\t\t\t\treturn modulesToInvalidate;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn ctx.modules;\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport const unplugin = /* #__PURE__ */ createUnplugin(unpluginFactory);\n\nexport default unplugin;\n"],"mappings":";;;;;;;;;;AAyBA,MAAM,0BAA0B;AAGhC,MAAM,gCAAgC,GAAG,gBAAgB;AACzD,MAAM,+BAA+B,GAAG,gBAAgB;AAExD,eAAe,kBACd,OACA,SACA,SACC;CACD,MAAM,WAAW,MAAM,kBAAkB,EAAE,OAAO,CAAC;AAEnD,OAAM,wBAAwB,UAAU;EACvC,YAAY,sBAAsB,IAAI;EACtC,aAAa,QAAQ,IAAI,YAAY;EACrC;EACA,CAAC;AAEF,QAAO,UAAU,UAAU,QAAQ;;AAGpC,SAAS,uBAAuB,IAAqB;AACpD,QAAO,wBAAwB,KAAK,GAAG;;AAGxC,SAAS,qBAAqB,UAAkB,MAA4B;AAS3E,QAAO,GAPN,SAAS,QACN,gCACA,+BAIH,SAAS,QAAQ,SAAS,QAAQ,SAAS,OAAO,GAAG;;AAIvD,SAAS,eACR,IACkD;AAClD,KAAI,GAAG,WAAW,8BAA8B,CAC/C,QAAO;EACN,MAAM;EAEN,UAAU,GACR,MAAM,8BAA8B,OAAO,CAC3C,QAAQ,UAAU,MAAM;EAC1B;AAEF,KAAI,GAAG,WAAW,6BAA6B,CAC9C,QAAO;EACN,MAAM;EACN,UAAU,GAAG,MAAM,6BAA6B,OAAO;EACvD;AAEF,QAAO;;AAGR,SAAS,kBAAkB,MAAc,UAA2B;AACnE,KAAI,KAAK,WAAW,KAAK,CACxB,QAAO;AAER,KAAI,SACH,QAAO,KAAK,QAAQ,KAAK,QAAQ,SAA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GAER,MAAM,gBAAgB,KAAK;IAC1B,MAAM,gBAAgB,OAAO,OAAe;AAE3C,YADY,IAAI,QAAQ,YAAY,cAAc,GAAG,IACtC,MAAM,IAAI,QAAQ,YAAY,eAAe,GAAG;;AAIhE,QAAI,QAAQ,SAAS,IAAI,KAAK,EAAE;KAE/B,MAAM,YACJ,MAAM,cAAc,+BAA+B,IACnD,MAAM,cAAc,sBAAsB;KAG5C,MAAM,WACJ,MAAM,cAAc,8BAA8B,IAClD,MAAM,cAAc,qBAAqB;AAE3C,SAAI,aAAa,SAEhB,QAAO,CACN,GAAI,YAAY,CAAC,UAAU,GAAG,EAAE,EAChC,GAAI,WAAW,CAAC,SAAS,GAAG,EAAE,CAC9B;AAGF,SAAI,QAAQ,GAAG,KAAK,EAAE,MAAM,eAAe,CAAC;;AAI7C,QAAI,uBAAuB,IAAI,KAAK,EAAE;KACrC,MAAM,mBAAmB,uBAAuB,IAAI,IAAI,KAAK;AAE7D,SAAI,oBAAoB,iBAAiB,OAAO,GAAG;MAClD,MAAM,sBAAsB,EAAE;AAE9B,WAAK,MAAM,aAAa,kBAAkB;OACzC,MAAM,gBAAgB,MAAM,cAAc,UAAU;AACpD,WAAI,cACH,qBAAoB,KAAK,cAAc;;AAIzC,UAAI,oBAAoB,SAAS,EAChC,QAAO;;;AAKV,WAAO,IAAI;;GAEZ;EACD;;AAGF,MAAa,WAA2B,+BAAe,gBAAgB;AAEvE,kBAAe"}
@@ -1,12 +0,0 @@
1
- import { TranspileOptions } from "@styleframe/transpiler";
2
-
3
- //#region src/types.d.ts
4
- interface Options {
5
- entry?: string | string[];
6
- silent?: boolean;
7
- transpiler?: TranspileOptions;
8
- }
9
- //# sourceMappingURL=types.d.ts.map
10
- //#endregion
11
- export { Options };
12
- //# sourceMappingURL=types-Clt7t35T.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-Clt7t35T.d.ts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;UAEiB,OAAA;;EAAA,MAAA,CAAA,EAAA,OAAO;eAGV"}
package/dist/types.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Options } from "./types-Clt7t35T.js";
2
- export { Options };
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite-Cd6Z9GAd.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createVitePlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,mBAAe,iBAAiB,gBAAgB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"webpack-yNnIZ6Rq.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import { createWebpackPlugin } from \"unplugin\";\nimport { unpluginFactory } from \".\";\n\nexport default createWebpackPlugin(unpluginFactory);\n"],"mappings":";;;;AAGA,sBAAe,oBAAoB,gBAAgB"}