@styleframe/plugin 2.3.1 → 2.4.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.
- package/CHANGELOG.md +24 -0
- package/dist/astro.js +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/farm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/nuxt.d.ts +2 -1
- package/dist/nuxt.d.ts.map +1 -1
- package/dist/nuxt.js +3 -3
- package/dist/rollup.js +1 -1
- package/dist/rspack.js +1 -1
- package/dist/{src-DVgZLQc5.js → src-BfsicZRP.js} +4 -4
- package/dist/src-BfsicZRP.js.map +1 -0
- package/dist/{vite-D0xhCTaK.js → vite-Cd6Z9GAd.js} +2 -2
- package/dist/{vite-D0xhCTaK.js.map → vite-Cd6Z9GAd.js.map} +1 -1
- package/dist/vite.js +2 -2
- package/dist/{webpack-D755lXgr.js → webpack-yNnIZ6Rq.js} +2 -2
- package/dist/{webpack-D755lXgr.js.map → webpack-yNnIZ6Rq.js.map} +1 -1
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +2 -2
- package/package.json +3 -3
- package/dist/src-DVgZLQc5.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @styleframe/plugin
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#96](https://github.com/styleframe-dev/styleframe/pull/96) [`8460f16`](https://github.com/styleframe-dev/styleframe/commit/8460f169cec1199810e9203b357dac9f2f128c56) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Rename `?recipe` imports to `?ts` and add named selector export support
|
|
8
|
+
- **Breaking:** Renamed import query parameter from `?recipe` to `?ts` for styleframe files
|
|
9
|
+
- Add support for exporting named selectors alongside recipes via `?ts` imports
|
|
10
|
+
- Add `_exportName` property to `Selector` and `Recipe` types for tracking named exports
|
|
11
|
+
- Replace `c12` with `chokidar` + `jiti` for simpler, more reliable config loading
|
|
12
|
+
- Add `onError` callback to `watchConfiguration` for error reporting during file watch
|
|
13
|
+
- Add file deletion detection with `unlink` handler in watch mode
|
|
14
|
+
- Simplify `loadConfiguration` API by merging `loadConfigurationFromPath`
|
|
15
|
+
- Add comprehensive unit tests for TypeScript selector consumer
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`4e06424`](https://github.com/styleframe-dev/styleframe/commit/4e064245e78903307e6996eebf3f6dae5565de5f) Thanks [@alexgrozav](https://github.com/alexgrozav)! - fix: add Nuxt 4 compatibility
|
|
20
|
+
|
|
21
|
+
Updated `@nuxt/kit` and `@nuxt/schema` dependencies to v4.1.3 via the nuxt catalog. Peer dependencies now accept both `^3 || ^4` to support Nuxt 3 and Nuxt 4 projects.
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`8460f16`](https://github.com/styleframe-dev/styleframe/commit/8460f169cec1199810e9203b357dac9f2f128c56)]:
|
|
24
|
+
- @styleframe/loader@2.4.0
|
|
25
|
+
- @styleframe/transpiler@2.6.0
|
|
26
|
+
|
|
3
27
|
## 2.3.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/astro.js
CHANGED
package/dist/esbuild.js
CHANGED
package/dist/farm.js
CHANGED
package/dist/index.js
CHANGED
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Options } from "./types-Clt7t35T.js";
|
|
2
|
+
import { NuxtModule } from "@nuxt/schema";
|
|
2
3
|
|
|
3
4
|
//#region src/nuxt.d.ts
|
|
4
5
|
interface ModuleOptions extends Options {}
|
|
5
|
-
declare const _default: NuxtModule<
|
|
6
|
+
declare const _default: NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
6
7
|
//#endregion
|
|
7
8
|
export { ModuleOptions, _default as default };
|
|
8
9
|
//# sourceMappingURL=nuxt.d.ts.map
|
package/dist/nuxt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt.d.ts","names":[],"sources":["../src/nuxt.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nuxt.d.ts","names":[],"sources":["../src/nuxt.ts"],"sourcesContent":[],"mappings":";;;;UAMiB,aAAA,SAAsB;AAAvC,cAAiD,QAAlB,YAAQ,cAAO,eAAA,EAAA,KAAA,CAAA"}
|
package/dist/nuxt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./constants-CnbAL4bY.js";
|
|
2
|
-
import "./src-
|
|
3
|
-
import { vite_default } from "./vite-
|
|
4
|
-
import { webpack_default } from "./webpack-
|
|
2
|
+
import "./src-BfsicZRP.js";
|
|
3
|
+
import { vite_default } from "./vite-Cd6Z9GAd.js";
|
|
4
|
+
import { webpack_default } from "./webpack-yNnIZ6Rq.js";
|
|
5
5
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
|
6
6
|
|
|
7
7
|
//#region src/nuxt.ts
|
package/dist/rollup.js
CHANGED
package/dist/rspack.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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
2
|
import path from "node:path";
|
|
3
3
|
import { getLicenseKeyFromEnv, validateInstanceLicense } from "@styleframe/license";
|
|
4
|
-
import {
|
|
4
|
+
import { loadConfiguration } from "@styleframe/loader";
|
|
5
5
|
import { transpile } from "@styleframe/transpiler";
|
|
6
6
|
import { consola } from "consola";
|
|
7
7
|
import { transform } from "esbuild";
|
|
@@ -12,7 +12,7 @@ const STYLEFRAME_SOURCE_REGEX = /\.styleframe\.ts$/;
|
|
|
12
12
|
const STYLEFRAME_CSS_VIRTUAL_PREFIX = `${ROLLUP_V_PREFIX}styleframe.css:`;
|
|
13
13
|
const STYLEFRAME_TS_VIRTUAL_PREFIX = `${ROLLUP_V_PREFIX}styleframe.ts:`;
|
|
14
14
|
async function loadAndBuildEntry(entry, options, isBuild) {
|
|
15
|
-
const instance = await
|
|
15
|
+
const instance = await loadConfiguration({ entry });
|
|
16
16
|
await validateInstanceLicense(instance, {
|
|
17
17
|
licenseKey: getLicenseKeyFromEnv() || "",
|
|
18
18
|
environment: process.env.NODE_ENV || "development",
|
|
@@ -81,7 +81,7 @@ const unpluginFactory = (options = DEFAULT_OPTIONS) => {
|
|
|
81
81
|
const [pathPart, queryPart] = id.split("?");
|
|
82
82
|
if (!pathPart || !/\.styleframe(\.ts)?$/.test(pathPart)) return null;
|
|
83
83
|
const isCss = queryPart === "css";
|
|
84
|
-
if (!isCss && !(queryPart === "
|
|
84
|
+
if (!isCss && !(queryPart === "ts")) return null;
|
|
85
85
|
let sourceFile = pathPart;
|
|
86
86
|
if (!sourceFile.endsWith(".ts")) sourceFile += ".ts";
|
|
87
87
|
const resolvedSourcePath = resolveSourcePath(sourceFile, importer);
|
|
@@ -157,4 +157,4 @@ var src_default = unplugin;
|
|
|
157
157
|
|
|
158
158
|
//#endregion
|
|
159
159
|
export { src_default, unplugin, unpluginFactory };
|
|
160
|
-
//# sourceMappingURL=src-
|
|
160
|
+
//# sourceMappingURL=src-BfsicZRP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,UA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AI,cACH,qBAAoB,KAAK,cAAc;;AAIzC,UAAI,oBAAoB,SAAS,EAChC,QAAO;;;AAKV,WAAO,IAAI;;GAEZ;EACD;;AAGF,MAAa,WAA2B,+BAAe,gBAAgB;AAEvE,kBAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unpluginFactory } from "./src-
|
|
1
|
+
import { unpluginFactory } from "./src-BfsicZRP.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-
|
|
9
|
+
//# sourceMappingURL=vite-Cd6Z9GAd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-
|
|
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"}
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unpluginFactory } from "./src-
|
|
1
|
+
import { unpluginFactory } from "./src-BfsicZRP.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-
|
|
9
|
+
//# sourceMappingURL=webpack-yNnIZ6Rq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack-
|
|
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"}
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Options } from "./types-Clt7t35T.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as unplugin0 from "unplugin";
|
|
3
3
|
|
|
4
4
|
//#region src/webpack.d.ts
|
|
5
|
-
declare const _default: (options?: Options | undefined) =>
|
|
5
|
+
declare const _default: (options?: Options | undefined) => unplugin0.WebpackPluginInstance;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { _default as default };
|
|
8
8
|
//# sourceMappingURL=webpack.d.ts.map
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@styleframe/plugin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.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": [
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@styleframe/license": "^2.0.0",
|
|
82
|
-
"@styleframe/loader": "^2.
|
|
83
|
-
"@styleframe/transpiler": "^2.
|
|
82
|
+
"@styleframe/loader": "^2.4.0",
|
|
83
|
+
"@styleframe/transpiler": "^2.6.0",
|
|
84
84
|
"consola": "^3.4.2",
|
|
85
85
|
"unplugin": "^2.3.4"
|
|
86
86
|
},
|
package/dist/src-DVgZLQc5.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-DVgZLQc5.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 { loadConfigurationFromPath } 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 loadConfigurationFromPath(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 isRecipe = queryPart === \"recipe\";\n\n\t\t\tif (!isCss && !isRecipe) {\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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