@csszyx/unplugin 0.9.5 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const cssMangler = require('./css-mangler.cjs');
6
- const unplugin = require('./shared/unplugin.CFp386gH.cjs');
6
+ const unplugin = require('./shared/unplugin.B2znYY9c.cjs');
7
7
  const types = require('@csszyx/types');
8
8
  require('postcss');
9
9
  require('postcss-selector-parser');
@@ -14,11 +14,12 @@ require('node:perf_hooks');
14
14
  require('node:url');
15
15
  require('@csszyx/compiler');
16
16
  require('@csszyx/core');
17
+ require('@csszyx/core/native');
17
18
  require('@csszyx/svelte-adapter');
18
19
  require('@csszyx/vue-adapter');
19
20
  require('unplugin');
20
21
  require('node:crypto');
21
- require('./shared/unplugin.DUxdYaSG.cjs');
22
+ require('./shared/unplugin.pmTknYLy.cjs');
22
23
  require('postcss-value-parser');
23
24
 
24
25
 
@@ -52,6 +53,7 @@ exports.parseThemeBlocks = unplugin.parseThemeBlocks;
52
53
  exports.planGlobalVarAliases = unplugin.planGlobalVarAliases;
53
54
  exports.readGlobalVarScanCache = unplugin.readGlobalVarScanCache;
54
55
  exports.resolveGlobalVarScanCacheDir = unplugin.resolveGlobalVarScanCacheDir;
56
+ exports.resolveNativeCacheIdentity = unplugin.resolveNativeCacheIdentity;
55
57
  exports.rewriteGlobalVarCssAliases = unplugin.rewriteGlobalVarCssAliases;
56
58
  exports.rollupPlugin = unplugin.rollupPlugin;
57
59
  exports.scanGlobalVarCss = unplugin.scanGlobalVarCss;
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.cjs';
2
2
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
3
- import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.DLrBgECN.cjs';
3
+ import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.CMNZChGZ.cjs';
4
4
  // @ts-ignore
5
5
  export = undefined;
6
- export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as createGlobalVarMapAssetSource, p as esbuildPlugin, q as extractGlobalVarAliasesForManifest, r as mangleCodeClassesSync, s as normalizeGlobalVarAliasesForCache, t as rollupPlugin, u as unplugin, v as vitePlugin, w as webpackPlugin } from './shared/unplugin.DLrBgECN.cjs';
6
+ export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as createGlobalVarMapAssetSource, p as esbuildPlugin, q as extractGlobalVarAliasesForManifest, r as mangleCodeClassesSync, s as normalizeGlobalVarAliasesForCache, t as resolveNativeCacheIdentity, v as rollupPlugin, u as unplugin, w as vitePlugin, x as webpackPlugin } from './shared/unplugin.CMNZChGZ.cjs';
7
7
  import 'postcss';
8
8
  import '@csszyx/compiler';
9
9
  import 'esbuild';
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
2
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
3
- import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.DLrBgECN.mjs';
4
- export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as createGlobalVarMapAssetSource, u as default, p as esbuildPlugin, q as extractGlobalVarAliasesForManifest, r as mangleCodeClassesSync, s as normalizeGlobalVarAliasesForCache, t as rollupPlugin, u as unplugin, v as vitePlugin, w as webpackPlugin } from './shared/unplugin.DLrBgECN.mjs';
3
+ import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.CMNZChGZ.mjs';
4
+ export { e as CssVarDefinition, f as CssVarLocation, g as CssVarReference, h as GlobalVarAliasDiagnostic, i as GlobalVarAliasDiagnosticSeverity, j as GlobalVarAliasEntry, k as GlobalVarCodeSource, l as GlobalVarCssAssetSource, m as GlobalVarCssSource, n as GlobalVarScanCacheEntry, o as createGlobalVarMapAssetSource, u as default, p as esbuildPlugin, q as extractGlobalVarAliasesForManifest, r as mangleCodeClassesSync, s as normalizeGlobalVarAliasesForCache, t as resolveNativeCacheIdentity, v as rollupPlugin, u as unplugin, w as vitePlugin, x as webpackPlugin } from './shared/unplugin.CMNZChGZ.mjs';
5
5
  import 'postcss';
6
6
  import '@csszyx/compiler';
7
7
  import 'esbuild';
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
- export { a as assertNoRSCBoundaryViolation, b as assertNoRSCGraphViolation, c as createGlobalVarAliasValidationOptions, d as createGlobalVarMapAssetSource, e as createGlobalVarScanCacheKey, f as createRSCModuleRecord, u as default, g as deleteRSCModuleRecord, h as esbuildPlugin, i as extractGlobalVarAliasesForManifest, j as findRSCBoundaryViolation, k as findRSCGraphViolation, l as hasTokens, m as hasUseClientDirective, n as hasUseServerDirective, o as isRSCServerModule, p as isTailwindReservedGlobalVar, q as mangleCodeClassesSync, r as mergeThemes, s as normalizeGlobalVarAliasesForCache, t as parseThemeBlocks, v as planGlobalVarAliases, w as readGlobalVarScanCache, x as resolveGlobalVarScanCacheDir, y as rewriteGlobalVarCssAliases, z as rollupPlugin, A as scanGlobalVarCss, u as unplugin, B as validateGlobalVarAliasInputs, C as vitePlugin, D as webpackPlugin, E as writeGlobalVarScanCache } from './shared/unplugin.BbtspS8t.mjs';
2
+ export { a as assertNoRSCBoundaryViolation, b as assertNoRSCGraphViolation, c as createGlobalVarAliasValidationOptions, d as createGlobalVarMapAssetSource, e as createGlobalVarScanCacheKey, f as createRSCModuleRecord, u as default, g as deleteRSCModuleRecord, h as esbuildPlugin, i as extractGlobalVarAliasesForManifest, j as findRSCBoundaryViolation, k as findRSCGraphViolation, l as hasTokens, m as hasUseClientDirective, n as hasUseServerDirective, o as isRSCServerModule, p as isTailwindReservedGlobalVar, q as mangleCodeClassesSync, r as mergeThemes, s as normalizeGlobalVarAliasesForCache, t as parseThemeBlocks, v as planGlobalVarAliases, w as readGlobalVarScanCache, x as resolveGlobalVarScanCacheDir, y as resolveNativeCacheIdentity, z as rewriteGlobalVarCssAliases, A as rollupPlugin, B as scanGlobalVarCss, u as unplugin, C as validateGlobalVarAliasInputs, D as vitePlugin, E as webpackPlugin, F as writeGlobalVarScanCache } from './shared/unplugin.BxYdELgl.mjs';
3
3
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
4
4
  import 'postcss';
5
5
  import 'postcss-selector-parser';
@@ -10,9 +10,10 @@ import 'node:perf_hooks';
10
10
  import 'node:url';
11
11
  import '@csszyx/compiler';
12
12
  import '@csszyx/core';
13
+ import '@csszyx/core/native';
13
14
  import '@csszyx/svelte-adapter';
14
15
  import '@csszyx/vue-adapter';
15
16
  import 'unplugin';
16
17
  import 'node:crypto';
17
- import './shared/unplugin.BceVw1eW.mjs';
18
+ import './shared/unplugin.BpWUtI9U.mjs';
18
19
  import 'postcss-value-parser';
@@ -3,9 +3,9 @@
3
3
  const node_crypto = require('node:crypto');
4
4
  const fs = require('node:fs');
5
5
  const path = require('node:path');
6
- const nextTransformMetadata = require('./shared/unplugin.B_U4rZvG.cjs');
6
+ const nextTransformMetadata = require('./shared/unplugin.DWtXPCGo.cjs');
7
7
  const nextWatcherCycle = require('./shared/unplugin.s62yJbu1.cjs');
8
- const transformCache = require('./shared/unplugin.DUxdYaSG.cjs');
8
+ const transformCache = require('./shared/unplugin.pmTknYLy.cjs');
9
9
  require('@csszyx/compiler');
10
10
  require('node:os');
11
11
  require('proper-lockfile');
@@ -1,9 +1,9 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
3
  import * as path from 'node:path';
4
- import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.8er8o6rn.mjs';
4
+ import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.C1N5i6Eg.mjs';
5
5
  import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.BtQzlC2C.mjs';
6
- import { r as resolveTransformCacheDir } from './shared/unplugin.BceVw1eW.mjs';
6
+ import { r as resolveTransformCacheDir } from './shared/unplugin.BpWUtI9U.mjs';
7
7
  import '@csszyx/compiler';
8
8
  import 'node:os';
9
9
  import 'proper-lockfile';
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const node_crypto = require('node:crypto');
6
6
  const path = require('node:path');
7
7
  const nextWatcherCycle = require('./shared/unplugin.s62yJbu1.cjs');
8
- const nextTransformMetadata = require('./shared/unplugin.B_U4rZvG.cjs');
9
- const transformCache = require('./shared/unplugin.DUxdYaSG.cjs');
8
+ const nextTransformMetadata = require('./shared/unplugin.DWtXPCGo.cjs');
9
+ const transformCache = require('./shared/unplugin.pmTknYLy.cjs');
10
10
  require('node:fs');
11
11
  require('node:os');
12
12
  require('proper-lockfile');
@@ -1,8 +1,8 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import * as path from 'node:path';
3
3
  import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, v as validateNextGenerationManifest, a as readNextGenerationManifest } from './shared/unplugin.BtQzlC2C.mjs';
4
- import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.8er8o6rn.mjs';
5
- import { r as resolveTransformCacheDir } from './shared/unplugin.BceVw1eW.mjs';
4
+ import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.C1N5i6Eg.mjs';
5
+ import { r as resolveTransformCacheDir } from './shared/unplugin.BpWUtI9U.mjs';
6
6
  import 'node:fs';
7
7
  import 'node:os';
8
8
  import 'proper-lockfile';
@@ -7,13 +7,14 @@ const node_perf_hooks = require('node:perf_hooks');
7
7
  const node_url = require('node:url');
8
8
  const compiler = require('@csszyx/compiler');
9
9
  const core = require('@csszyx/core');
10
+ const native = require('@csszyx/core/native');
10
11
  const svelteAdapter = require('@csszyx/svelte-adapter');
11
12
  const types = require('@csszyx/types');
12
13
  const vueAdapter = require('@csszyx/vue-adapter');
13
14
  const unplugin$1 = require('unplugin');
14
15
  const cssMangler = require('../css-mangler.cjs');
15
16
  const node_crypto = require('node:crypto');
16
- const transformCache = require('./unplugin.DUxdYaSG.cjs');
17
+ const transformCache = require('./unplugin.pmTknYLy.cjs');
17
18
  const postcss = require('postcss');
18
19
  const valueParser = require('postcss-value-parser');
19
20
 
@@ -1554,12 +1555,34 @@ const RUNTIME_HELPER_IMPORT_RE = {
1554
1555
  };
1555
1556
  let _hasWarnedTsConfig = false;
1556
1557
  let _hasWarnedTransformCacheVersion = false;
1557
- const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CFp386gH.cjs', document.baseURI).href)));
1558
+ const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.B2znYY9c.cjs', document.baseURI).href)));
1558
1559
  const PLUGIN_VERSION = findPackageVersionFromFile(
1559
- node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CFp386gH.cjs', document.baseURI).href))),
1560
+ node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.B2znYY9c.cjs', document.baseURI).href))),
1560
1561
  UNKNOWN_PACKAGE_VERSION
1561
1562
  );
1562
1563
  const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
1564
+ let cachedNativeCacheIdentity = null;
1565
+ function resolveNativeCacheIdentity() {
1566
+ if (cachedNativeCacheIdentity !== null) {
1567
+ return cachedNativeCacheIdentity;
1568
+ }
1569
+ try {
1570
+ const packageName = native.getNativePackageName();
1571
+ if (!packageName) {
1572
+ cachedNativeCacheIdentity = "unavailable";
1573
+ return cachedNativeCacheIdentity;
1574
+ }
1575
+ const version = requireFromHere(`${packageName}/package.json`).version;
1576
+ const binaryPath = requireFromHere.resolve(packageName);
1577
+ const stats = fs__namespace.statSync(binaryPath);
1578
+ cachedNativeCacheIdentity = `${packageName}@${version ?? "0"}:${Math.floor(
1579
+ stats.mtimeMs
1580
+ )}:${stats.size}`;
1581
+ } catch {
1582
+ cachedNativeCacheIdentity = "unresolved";
1583
+ }
1584
+ return cachedNativeCacheIdentity;
1585
+ }
1563
1586
  const BENCH_TRACE_ENABLED = process.env.CSSZYX_BENCH_TRACE === "1";
1564
1587
  const BENCH_TRACE_FILE = process.env.CSSZYX_BENCH_TRACE_FILE;
1565
1588
  function cssVariableEntries(result) {
@@ -2293,6 +2316,7 @@ function createCsszyxPlugins(options = {}) {
2293
2316
  return {
2294
2317
  pluginVersion: PLUGIN_VERSION,
2295
2318
  compilerVersion: COMPILER_VERSION,
2319
+ nativeIdentity: parserMode === "rust" ? resolveNativeCacheIdentity() : void 0,
2296
2320
  parserMode,
2297
2321
  producer: parserMode,
2298
2322
  astBudget: astBudgetOverride,
@@ -3311,6 +3335,7 @@ exports.parseThemeBlocks = parseThemeBlocks;
3311
3335
  exports.planGlobalVarAliases = planGlobalVarAliases;
3312
3336
  exports.readGlobalVarScanCache = readGlobalVarScanCache;
3313
3337
  exports.resolveGlobalVarScanCacheDir = resolveGlobalVarScanCacheDir;
3338
+ exports.resolveNativeCacheIdentity = resolveNativeCacheIdentity;
3314
3339
  exports.rewriteGlobalVarCssAliases = rewriteGlobalVarCssAliases;
3315
3340
  exports.rollupPlugin = rollupPlugin;
3316
3341
  exports.scanGlobalVarCss = scanGlobalVarCss;
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto';
2
2
  import * as fs from 'node:fs';
3
3
  import * as path from 'node:path';
4
4
 
5
- const CACHE_SCHEMA_VERSION = 6;
5
+ const CACHE_SCHEMA_VERSION = 7;
6
6
  function resolveTransformCacheDir(rootDir, cacheDir) {
7
7
  return path.resolve(rootDir, cacheDir ?? ".csszyx/cache", "transform");
8
8
  }
@@ -13,6 +13,7 @@ function createTransformCacheKey(input) {
13
13
  `schema=${CACHE_SCHEMA_VERSION}`,
14
14
  `plugin=${input.pluginVersion}`,
15
15
  `compiler=${input.compilerVersion}`,
16
+ `native=${input.nativeIdentity ?? "none"}`,
16
17
  `parser=${input.parserMode}`,
17
18
  `producer=${input.producer}`,
18
19
  `astBudget=${input.astBudget ?? "default"}`,
@@ -37,7 +38,7 @@ function readTransformCache(cacheRoot, input, precomputedKey) {
37
38
  } catch {
38
39
  return null;
39
40
  }
40
- if (entry.version !== CACHE_SCHEMA_VERSION || entry.pluginVersion !== input.pluginVersion || entry.compilerVersion !== input.compilerVersion || entry.parserMode !== input.parserMode || entry.producer !== input.producer || entry.astBudget !== (input.astBudget ?? null) || entry.mangleVars !== (input.mangleVars === true) || entry.mangleVarHoistMaxDepth !== (input.mangleVarHoistMaxDepth ?? null) || !sameGlobalVarAliases(entry.globalVarAliases, globalVarAliases) || entry.filename !== input.filename || entry.inputSha256 !== inputSha256) {
41
+ if (entry.version !== CACHE_SCHEMA_VERSION || entry.pluginVersion !== input.pluginVersion || entry.compilerVersion !== input.compilerVersion || entry.nativeIdentity !== (input.nativeIdentity ?? null) || entry.parserMode !== input.parserMode || entry.producer !== input.producer || entry.astBudget !== (input.astBudget ?? null) || entry.mangleVars !== (input.mangleVars === true) || entry.mangleVarHoistMaxDepth !== (input.mangleVarHoistMaxDepth ?? null) || !sameGlobalVarAliases(entry.globalVarAliases, globalVarAliases) || entry.filename !== input.filename || entry.inputSha256 !== inputSha256) {
41
42
  return null;
42
43
  }
43
44
  return deserializeResult(entry.result);
@@ -55,6 +56,7 @@ function writeTransformCache(cacheRoot, input, result, precomputedKey) {
55
56
  version: CACHE_SCHEMA_VERSION,
56
57
  pluginVersion: input.pluginVersion,
57
58
  compilerVersion: input.compilerVersion,
59
+ nativeIdentity: input.nativeIdentity ?? null,
58
60
  parserMode: input.parserMode,
59
61
  producer: input.producer,
60
62
  astBudget: input.astBudget ?? null,
@@ -7,13 +7,14 @@ import { performance } from 'node:perf_hooks';
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import { scanGlobalVarUsages, ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transformRustBatch, transform } from '@csszyx/compiler';
9
9
  import { encode, compute_mangle_checksum } from '@csszyx/core';
10
+ import { getNativePackageName } from '@csszyx/core/native';
10
11
  import { preprocess as preprocess$1 } from '@csszyx/svelte-adapter';
11
12
  import { isTailwindReservedCustomProperty, CSSZYX_GLOBAL_ALIAS_PREFIX, isCsszyxGlobalAliasCustomProperty, DEFAULT_BUILD_CONFIG, validateGlobalVarMangleConfig } from '@csszyx/types';
12
13
  import { preprocess } from '@csszyx/vue-adapter';
13
14
  import { createUnplugin } from 'unplugin';
14
15
  import { mangleCSSSync } from '../css-mangler.mjs';
15
16
  import { createHash } from 'node:crypto';
16
- import { r as resolveTransformCacheDir, c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache, e as evictOldTransformCacheEntries } from './unplugin.BceVw1eW.mjs';
17
+ import { r as resolveTransformCacheDir, c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache, e as evictOldTransformCacheEntries } from './unplugin.BpWUtI9U.mjs';
17
18
  import postcss from 'postcss';
18
19
  import valueParser from 'postcss-value-parser';
19
20
 
@@ -1540,6 +1541,28 @@ const PLUGIN_VERSION = findPackageVersionFromFile(
1540
1541
  UNKNOWN_PACKAGE_VERSION
1541
1542
  );
1542
1543
  const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
1544
+ let cachedNativeCacheIdentity = null;
1545
+ function resolveNativeCacheIdentity() {
1546
+ if (cachedNativeCacheIdentity !== null) {
1547
+ return cachedNativeCacheIdentity;
1548
+ }
1549
+ try {
1550
+ const packageName = getNativePackageName();
1551
+ if (!packageName) {
1552
+ cachedNativeCacheIdentity = "unavailable";
1553
+ return cachedNativeCacheIdentity;
1554
+ }
1555
+ const version = requireFromHere(`${packageName}/package.json`).version;
1556
+ const binaryPath = requireFromHere.resolve(packageName);
1557
+ const stats = fs.statSync(binaryPath);
1558
+ cachedNativeCacheIdentity = `${packageName}@${version ?? "0"}:${Math.floor(
1559
+ stats.mtimeMs
1560
+ )}:${stats.size}`;
1561
+ } catch {
1562
+ cachedNativeCacheIdentity = "unresolved";
1563
+ }
1564
+ return cachedNativeCacheIdentity;
1565
+ }
1543
1566
  const BENCH_TRACE_ENABLED = process.env.CSSZYX_BENCH_TRACE === "1";
1544
1567
  const BENCH_TRACE_FILE = process.env.CSSZYX_BENCH_TRACE_FILE;
1545
1568
  function cssVariableEntries(result) {
@@ -2273,6 +2296,7 @@ function createCsszyxPlugins(options = {}) {
2273
2296
  return {
2274
2297
  pluginVersion: PLUGIN_VERSION,
2275
2298
  compilerVersion: COMPILER_VERSION,
2299
+ nativeIdentity: parserMode === "rust" ? resolveNativeCacheIdentity() : void 0,
2276
2300
  parserMode,
2277
2301
  producer: parserMode,
2278
2302
  astBudget: astBudgetOverride,
@@ -3268,4 +3292,4 @@ const esbuildPlugin = (options = {}) => {
3268
3292
  };
3269
3293
  };
3270
3294
 
3271
- export { scanGlobalVarCss as A, validateGlobalVarAliasInputs as B, vitePlugin as C, webpackPlugin as D, writeGlobalVarScanCache as E, assertNoRSCBoundaryViolation as a, assertNoRSCGraphViolation as b, createGlobalVarAliasValidationOptions as c, createGlobalVarMapAssetSource as d, createGlobalVarScanCacheKey as e, createRSCModuleRecord as f, deleteRSCModuleRecord as g, esbuildPlugin as h, extractGlobalVarAliasesForManifest as i, findRSCBoundaryViolation as j, findRSCGraphViolation as k, hasTokens as l, hasUseClientDirective as m, hasUseServerDirective as n, isRSCServerModule as o, isTailwindReservedGlobalVar as p, mangleCodeClassesSync as q, mergeThemes as r, normalizeGlobalVarAliasesForCache as s, parseThemeBlocks as t, unplugin as u, planGlobalVarAliases as v, readGlobalVarScanCache as w, resolveGlobalVarScanCacheDir as x, rewriteGlobalVarCssAliases as y, rollupPlugin as z };
3295
+ export { rollupPlugin as A, scanGlobalVarCss as B, validateGlobalVarAliasInputs as C, vitePlugin as D, webpackPlugin as E, writeGlobalVarScanCache as F, assertNoRSCBoundaryViolation as a, assertNoRSCGraphViolation as b, createGlobalVarAliasValidationOptions as c, createGlobalVarMapAssetSource as d, createGlobalVarScanCacheKey as e, createRSCModuleRecord as f, deleteRSCModuleRecord as g, esbuildPlugin as h, extractGlobalVarAliasesForManifest as i, findRSCBoundaryViolation as j, findRSCGraphViolation as k, hasTokens as l, hasUseClientDirective as m, hasUseServerDirective as n, isRSCServerModule as o, isTailwindReservedGlobalVar as p, mangleCodeClassesSync as q, mergeThemes as r, normalizeGlobalVarAliasesForCache as s, parseThemeBlocks as t, unplugin as u, planGlobalVarAliases as v, readGlobalVarScanCache as w, resolveGlobalVarScanCacheDir as x, resolveNativeCacheIdentity as y, rewriteGlobalVarCssAliases as z };
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transform } from '@csszyx/compiler';
3
- import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache } from './unplugin.BceVw1eW.mjs';
3
+ import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache } from './unplugin.BpWUtI9U.mjs';
4
4
  import { createHash } from 'node:crypto';
5
5
 
6
6
  function readPackageVersion(relativePackageJson, fromUrl) {
@@ -207,6 +207,19 @@ interface GlobalVarCssAliasRewriteResult {
207
207
  diagnostics: GlobalVarAliasDiagnostic[];
208
208
  }
209
209
 
210
+ /**
211
+ * Identity of the installed native engine binary for transform-cache keys.
212
+ *
213
+ * Rust-mode output depends on the `.node` binary, and its package version is
214
+ * not enough: rebuilding the same version from changed sources (workspace
215
+ * development) previously kept serving stale cached transforms. Combine the
216
+ * native package version with the resolved binary's mtime and size so an
217
+ * engine rebuild invalidates the cache; a re-install can only cause an extra
218
+ * miss, never a stale hit.
219
+ *
220
+ * @returns A stable identity string, or a sentinel when unresolvable.
221
+ */
222
+ declare function resolveNativeCacheIdentity(): string;
210
223
  /**
211
224
  * Extracts Phase H global custom-property aliases for manifest/debug tooling.
212
225
  *
@@ -278,5 +291,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
278
291
  */
279
292
  declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
280
293
 
281
- export { createGlobalVarMapAssetSource as o, esbuildPlugin as p, extractGlobalVarAliasesForManifest as q, mangleCodeClassesSync as r, normalizeGlobalVarAliasesForCache as s, rollupPlugin as t, unplugin as u, vitePlugin as v, webpackPlugin as w };
294
+ export { createGlobalVarMapAssetSource as o, esbuildPlugin as p, extractGlobalVarAliasesForManifest as q, mangleCodeClassesSync as r, normalizeGlobalVarAliasesForCache as s, resolveNativeCacheIdentity as t, unplugin as u, rollupPlugin as v, vitePlugin as w, webpackPlugin as x };
282
295
  export type { CssVarScanResult as C, GlobalVarScanCacheKeyInput as G, PlanGlobalVarAliasesInput as P, RewriteGlobalVarCssAliasesOptions as R, ScanGlobalVarCssOptions as S, ValidateGlobalVarAliasInputsOptions as V, GlobalVarAliasPlan as a, GlobalVarCssAliasRewriteResult as b, CreateGlobalVarAliasValidationOptionsInput as c, GlobalVarAliasValidationResult as d, CssVarDefinition as e, CssVarLocation as f, CssVarReference as g, GlobalVarAliasDiagnostic as h, GlobalVarAliasDiagnosticSeverity as i, GlobalVarAliasEntry as j, GlobalVarCodeSource as k, GlobalVarCssAssetSource as l, GlobalVarCssSource as m, GlobalVarScanCacheEntry as n };
@@ -207,6 +207,19 @@ interface GlobalVarCssAliasRewriteResult {
207
207
  diagnostics: GlobalVarAliasDiagnostic[];
208
208
  }
209
209
 
210
+ /**
211
+ * Identity of the installed native engine binary for transform-cache keys.
212
+ *
213
+ * Rust-mode output depends on the `.node` binary, and its package version is
214
+ * not enough: rebuilding the same version from changed sources (workspace
215
+ * development) previously kept serving stale cached transforms. Combine the
216
+ * native package version with the resolved binary's mtime and size so an
217
+ * engine rebuild invalidates the cache; a re-install can only cause an extra
218
+ * miss, never a stale hit.
219
+ *
220
+ * @returns A stable identity string, or a sentinel when unresolvable.
221
+ */
222
+ declare function resolveNativeCacheIdentity(): string;
210
223
  /**
211
224
  * Extracts Phase H global custom-property aliases for manifest/debug tooling.
212
225
  *
@@ -278,5 +291,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
278
291
  */
279
292
  declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
280
293
 
281
- export { createGlobalVarMapAssetSource as o, esbuildPlugin as p, extractGlobalVarAliasesForManifest as q, mangleCodeClassesSync as r, normalizeGlobalVarAliasesForCache as s, rollupPlugin as t, unplugin as u, vitePlugin as v, webpackPlugin as w };
294
+ export { createGlobalVarMapAssetSource as o, esbuildPlugin as p, extractGlobalVarAliasesForManifest as q, mangleCodeClassesSync as r, normalizeGlobalVarAliasesForCache as s, resolveNativeCacheIdentity as t, unplugin as u, rollupPlugin as v, vitePlugin as w, webpackPlugin as x };
282
295
  export type { CssVarScanResult as C, GlobalVarScanCacheKeyInput as G, PlanGlobalVarAliasesInput as P, RewriteGlobalVarCssAliasesOptions as R, ScanGlobalVarCssOptions as S, ValidateGlobalVarAliasInputsOptions as V, GlobalVarAliasPlan as a, GlobalVarCssAliasRewriteResult as b, CreateGlobalVarAliasValidationOptionsInput as c, GlobalVarAliasValidationResult as d, CssVarDefinition as e, CssVarLocation as f, CssVarReference as g, GlobalVarAliasDiagnostic as h, GlobalVarAliasDiagnosticSeverity as i, GlobalVarAliasEntry as j, GlobalVarCodeSource as k, GlobalVarCssAssetSource as l, GlobalVarCssSource as m, GlobalVarScanCacheEntry as n };
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('node:fs');
4
4
  const compiler = require('@csszyx/compiler');
5
- const transformCache = require('./unplugin.DUxdYaSG.cjs');
5
+ const transformCache = require('./unplugin.pmTknYLy.cjs');
6
6
  const node_crypto = require('node:crypto');
7
7
 
8
8
  function readPackageVersion(relativePackageJson, fromUrl) {
@@ -19,7 +19,7 @@ function _interopNamespaceCompat(e) {
19
19
  const fs__namespace = /*#__PURE__*/_interopNamespaceCompat(fs);
20
20
  const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
21
21
 
22
- const CACHE_SCHEMA_VERSION = 6;
22
+ const CACHE_SCHEMA_VERSION = 7;
23
23
  function resolveTransformCacheDir(rootDir, cacheDir) {
24
24
  return path__namespace.resolve(rootDir, cacheDir ?? ".csszyx/cache", "transform");
25
25
  }
@@ -30,6 +30,7 @@ function createTransformCacheKey(input) {
30
30
  `schema=${CACHE_SCHEMA_VERSION}`,
31
31
  `plugin=${input.pluginVersion}`,
32
32
  `compiler=${input.compilerVersion}`,
33
+ `native=${input.nativeIdentity ?? "none"}`,
33
34
  `parser=${input.parserMode}`,
34
35
  `producer=${input.producer}`,
35
36
  `astBudget=${input.astBudget ?? "default"}`,
@@ -54,7 +55,7 @@ function readTransformCache(cacheRoot, input, precomputedKey) {
54
55
  } catch {
55
56
  return null;
56
57
  }
57
- if (entry.version !== CACHE_SCHEMA_VERSION || entry.pluginVersion !== input.pluginVersion || entry.compilerVersion !== input.compilerVersion || entry.parserMode !== input.parserMode || entry.producer !== input.producer || entry.astBudget !== (input.astBudget ?? null) || entry.mangleVars !== (input.mangleVars === true) || entry.mangleVarHoistMaxDepth !== (input.mangleVarHoistMaxDepth ?? null) || !sameGlobalVarAliases(entry.globalVarAliases, globalVarAliases) || entry.filename !== input.filename || entry.inputSha256 !== inputSha256) {
58
+ if (entry.version !== CACHE_SCHEMA_VERSION || entry.pluginVersion !== input.pluginVersion || entry.compilerVersion !== input.compilerVersion || entry.nativeIdentity !== (input.nativeIdentity ?? null) || entry.parserMode !== input.parserMode || entry.producer !== input.producer || entry.astBudget !== (input.astBudget ?? null) || entry.mangleVars !== (input.mangleVars === true) || entry.mangleVarHoistMaxDepth !== (input.mangleVarHoistMaxDepth ?? null) || !sameGlobalVarAliases(entry.globalVarAliases, globalVarAliases) || entry.filename !== input.filename || entry.inputSha256 !== inputSha256) {
58
59
  return null;
59
60
  }
60
61
  return deserializeResult(entry.result);
@@ -72,6 +73,7 @@ function writeTransformCache(cacheRoot, input, result, precomputedKey) {
72
73
  version: CACHE_SCHEMA_VERSION,
73
74
  pluginVersion: input.pluginVersion,
74
75
  compilerVersion: input.compilerVersion,
76
+ nativeIdentity: input.nativeIdentity ?? null,
75
77
  parserMode: input.parserMode,
76
78
  producer: input.producer,
77
79
  astBudget: input.astBudget ?? null,
package/dist/vite.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CFp386gH.cjs');
5
+ const unplugin = require('./shared/unplugin.B2znYY9c.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
@@ -10,6 +10,7 @@ require('node:perf_hooks');
10
10
  require('node:url');
11
11
  require('@csszyx/compiler');
12
12
  require('@csszyx/core');
13
+ require('@csszyx/core/native');
13
14
  require('@csszyx/svelte-adapter');
14
15
  require('@csszyx/types');
15
16
  require('@csszyx/vue-adapter');
@@ -18,7 +19,7 @@ require('./css-mangler.cjs');
18
19
  require('postcss');
19
20
  require('postcss-selector-parser');
20
21
  require('node:crypto');
21
- require('./shared/unplugin.DUxdYaSG.cjs');
22
+ require('./shared/unplugin.pmTknYLy.cjs');
22
23
  require('postcss-value-parser');
23
24
 
24
25
 
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { v as vitePlugin } from './shared/unplugin.DLrBgECN.cjs';
1
+ import { w as vitePlugin } from './shared/unplugin.CMNZChGZ.cjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { v as vitePlugin } from './shared/unplugin.DLrBgECN.mjs';
1
+ import { w as vitePlugin } from './shared/unplugin.CMNZChGZ.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { C as vitePlugin } from './shared/unplugin.BbtspS8t.mjs';
1
+ import { D as vitePlugin } from './shared/unplugin.BxYdELgl.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
@@ -6,6 +6,7 @@ import 'node:perf_hooks';
6
6
  import 'node:url';
7
7
  import '@csszyx/compiler';
8
8
  import '@csszyx/core';
9
+ import '@csszyx/core/native';
9
10
  import '@csszyx/svelte-adapter';
10
11
  import '@csszyx/types';
11
12
  import '@csszyx/vue-adapter';
@@ -14,7 +15,7 @@ import './css-mangler.mjs';
14
15
  import 'postcss';
15
16
  import 'postcss-selector-parser';
16
17
  import 'node:crypto';
17
- import './shared/unplugin.BceVw1eW.mjs';
18
+ import './shared/unplugin.BpWUtI9U.mjs';
18
19
  import 'postcss-value-parser';
19
20
 
20
21
 
package/dist/webpack.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CFp386gH.cjs');
5
+ const unplugin = require('./shared/unplugin.B2znYY9c.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
@@ -10,6 +10,7 @@ require('node:perf_hooks');
10
10
  require('node:url');
11
11
  require('@csszyx/compiler');
12
12
  require('@csszyx/core');
13
+ require('@csszyx/core/native');
13
14
  require('@csszyx/svelte-adapter');
14
15
  require('@csszyx/types');
15
16
  require('@csszyx/vue-adapter');
@@ -18,7 +19,7 @@ require('./css-mangler.cjs');
18
19
  require('postcss');
19
20
  require('postcss-selector-parser');
20
21
  require('node:crypto');
21
- require('./shared/unplugin.DUxdYaSG.cjs');
22
+ require('./shared/unplugin.pmTknYLy.cjs');
22
23
  require('postcss-value-parser');
23
24
 
24
25
 
@@ -1,4 +1,4 @@
1
- import { w as webpackPlugin } from './shared/unplugin.DLrBgECN.cjs';
1
+ import { x as webpackPlugin } from './shared/unplugin.CMNZChGZ.cjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
@@ -1,4 +1,4 @@
1
- import { w as webpackPlugin } from './shared/unplugin.DLrBgECN.mjs';
1
+ import { x as webpackPlugin } from './shared/unplugin.CMNZChGZ.mjs';
2
2
  import '@csszyx/compiler';
3
3
  import '@csszyx/types';
4
4
  import 'esbuild';
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { D as webpackPlugin } from './shared/unplugin.BbtspS8t.mjs';
1
+ import { E as webpackPlugin } from './shared/unplugin.BxYdELgl.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
@@ -6,6 +6,7 @@ import 'node:perf_hooks';
6
6
  import 'node:url';
7
7
  import '@csszyx/compiler';
8
8
  import '@csszyx/core';
9
+ import '@csszyx/core/native';
9
10
  import '@csszyx/svelte-adapter';
10
11
  import '@csszyx/types';
11
12
  import '@csszyx/vue-adapter';
@@ -14,7 +15,7 @@ import './css-mangler.mjs';
14
15
  import 'postcss';
15
16
  import 'postcss-selector-parser';
16
17
  import 'node:crypto';
17
- import './shared/unplugin.BceVw1eW.mjs';
18
+ import './shared/unplugin.BpWUtI9U.mjs';
18
19
  import 'postcss-value-parser';
19
20
 
20
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.9.5",
3
+ "version": "0.9.6",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -117,14 +117,14 @@
117
117
  "postcss-value-parser": "^4.2.0",
118
118
  "proper-lockfile": "^4.1.2",
119
119
  "unplugin": "^1.10.1",
120
- "@csszyx/compiler": "0.9.5",
121
- "@csszyx/core": "0.9.5",
122
- "@csszyx/vue-adapter": "0.9.5",
123
- "@csszyx/types": "0.9.5",
124
- "@csszyx/svelte-adapter": "0.9.5"
120
+ "@csszyx/compiler": "0.9.6",
121
+ "@csszyx/core": "0.9.6",
122
+ "@csszyx/svelte-adapter": "0.9.6",
123
+ "@csszyx/types": "0.9.6",
124
+ "@csszyx/vue-adapter": "0.9.6"
125
125
  },
126
126
  "peerDependencies": {
127
- "@csszyx/runtime": "^0.9.5"
127
+ "@csszyx/runtime": "^0.9.6"
128
128
  },
129
129
  "devDependencies": {
130
130
  "@types/node": "^20.11.0",