@csszyx/unplugin 0.15.0 → 0.15.1

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 (43) hide show
  1. package/dist/index.cjs +4 -4
  2. package/dist/index.d.cts +2 -2
  3. package/dist/index.d.mts +2 -2
  4. package/dist/index.mjs +4 -4
  5. package/dist/next-prebuild.cjs +4 -4
  6. package/dist/next-prebuild.d.cts +2 -2
  7. package/dist/next-prebuild.d.mts +2 -2
  8. package/dist/next-prebuild.mjs +4 -4
  9. package/dist/next-turbo-loader.cjs +5 -5
  10. package/dist/next-turbo-loader.d.cts +1 -1
  11. package/dist/next-turbo-loader.d.mts +1 -1
  12. package/dist/next-turbo-loader.mjs +5 -5
  13. package/dist/next-watcher.cjs +2 -2
  14. package/dist/next-watcher.d.cts +2 -2
  15. package/dist/next-watcher.d.mts +2 -2
  16. package/dist/next-watcher.mjs +2 -2
  17. package/dist/shared/{unplugin.BLbrShMZ.cjs → unplugin.8KYddE6x.cjs} +60 -15
  18. package/dist/shared/{unplugin.C2ilavL1.d.cts → unplugin.BGog1Bib.d.cts} +7 -6
  19. package/dist/shared/{unplugin.C2ilavL1.d.mts → unplugin.BGog1Bib.d.mts} +7 -6
  20. package/dist/shared/{unplugin.DmCOQc-b.mjs → unplugin.BLptVbUe.mjs} +1 -46
  21. package/dist/shared/{unplugin.BHfqCocB.d.cts → unplugin.BT7PqYuK.d.cts} +1 -1
  22. package/dist/shared/{unplugin.BHfqCocB.d.mts → unplugin.BT7PqYuK.d.mts} +1 -1
  23. package/dist/shared/{unplugin.Dai5wlZ3.cjs → unplugin.BWnmKv07.cjs} +7 -52
  24. package/dist/shared/{unplugin.AGR7mihU.mjs → unplugin.Bk9o8_RZ.mjs} +1 -1
  25. package/dist/shared/{unplugin.DX3rYT4P.cjs → unplugin.BzF0V2kw.cjs} +1 -1
  26. package/dist/shared/{unplugin.CXCaQ3-s.d.cts → unplugin.COlI0dJs.d.mts} +1 -1
  27. package/dist/shared/{unplugin.BGufkSFT.mjs → unplugin.D68hyqgb.mjs} +58 -13
  28. package/dist/shared/{unplugin.Dbc26ty6.mjs → unplugin.DAzgbtuZ.mjs} +2 -2
  29. package/dist/shared/{unplugin.KnDCM-sr.cjs → unplugin.DDSWQJYX.cjs} +48 -0
  30. package/dist/shared/{unplugin.CqJS0BbD.mjs → unplugin.DH_ij6cf.mjs} +48 -1
  31. package/dist/shared/{unplugin.BourSpnZ.mjs → unplugin.DK0b4fr7.mjs} +1 -1
  32. package/dist/shared/{unplugin.C7i0agiO.cjs → unplugin.J6ue_lRJ.cjs} +1 -1
  33. package/dist/shared/{unplugin.BbBYWFGT.cjs → unplugin.gksolKh2.cjs} +2 -2
  34. package/dist/shared/{unplugin.CbNydVwv.d.mts → unplugin.rWOMecQs.d.cts} +1 -1
  35. package/dist/vite.cjs +4 -4
  36. package/dist/vite.d.cts +1 -1
  37. package/dist/vite.d.mts +1 -1
  38. package/dist/vite.mjs +4 -4
  39. package/dist/webpack.cjs +4 -4
  40. package/dist/webpack.d.cts +1 -1
  41. package/dist/webpack.d.mts +1 -1
  42. package/dist/webpack.mjs +4 -4
  43. package/package.json +9 -9
package/dist/index.cjs CHANGED
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const cssMangler = require('./css-mangler.cjs');
6
- const unplugin = require('./shared/unplugin.BLbrShMZ.cjs');
7
- const themeGroupsFile = require('./shared/unplugin.C7i0agiO.cjs');
6
+ const unplugin = require('./shared/unplugin.8KYddE6x.cjs');
7
+ const themeGroupsFile = require('./shared/unplugin.J6ue_lRJ.cjs');
8
8
  const types = require('@csszyx/types');
9
- const safelistSource = require('./shared/unplugin.KnDCM-sr.cjs');
9
+ const safelistSource = require('./shared/unplugin.DDSWQJYX.cjs');
10
10
  require('postcss');
11
11
  require('postcss-selector-parser');
12
12
  require('node:crypto');
@@ -21,7 +21,7 @@ require('@csszyx/core/native');
21
21
  require('@csszyx/svelte-adapter');
22
22
  require('@csszyx/vue-adapter');
23
23
  require('unplugin');
24
- require('./shared/unplugin.DX3rYT4P.cjs');
24
+ require('./shared/unplugin.BzF0V2kw.cjs');
25
25
  require('node:zlib');
26
26
  require('postcss-value-parser');
27
27
 
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.BHfqCocB.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.BT7PqYuK.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, M as MangleHybridHazards, o as ParsedTheme, p as ParsedUtilities, Q as QuietMode, q as RSCBoundaryViolation, r as RSCModuleRecord, s as allocateMangleTokens, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, A as deleteRSCModuleRecord, B as emitMissingCssFallback, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, T as isAdvisoryDiagnostic, U as isCompileSourceOptedIn, W as isHardIgnoredPath, X as isMangleableCssId, Y as isMonorepoPackage, Z as isPackagesSkippedSource, _ as isRSCServerModule, $ as lateMangleCensusMessage, a0 as mangleCodeClassesSync, a1 as mangleEligibleClasses, a2 as mangleHybridHazardMessage, a3 as mergeThemes, a4 as missingTailwindEntryMessage, a5 as normalizeGlobalVarAliasesForCache, a6 as parseThemeBlocks, a7 as parseUtilityBlocks, a8 as realContentHashDisabledMessage, a9 as recordGlobalVarSourceFile, aa as resolveCompileSourceDirs, ab as resolveNativeCacheIdentity, ac as resolveQuietMode, ad as rollupPlugin, ae as scanCustomPropertyNames, af as shouldEmitMissingCssFallback, ag as shouldEmitWarning, ah as shouldTrackGlobalVarSources, ai as shouldWarnMissingTailwindEntry, aj as shouldWarnUnscopedMonorepo, ak as skippedSzFilesMessage, al as suppressedAdvisoryMessage, z as unplugin, am as unscopedMonorepoMessage, an as vitePlugin, ao as watchModeMangleMessage, ap as webpackPlugin } from './shared/unplugin.BHfqCocB.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, M as MangleHybridHazards, o as ParsedTheme, p as ParsedUtilities, Q as QuietMode, q as RSCBoundaryViolation, r as RSCModuleRecord, s as allocateMangleTokens, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, A as deleteRSCModuleRecord, B as emitMissingCssFallback, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, T as isAdvisoryDiagnostic, U as isCompileSourceOptedIn, W as isHardIgnoredPath, X as isMangleableCssId, Y as isMonorepoPackage, Z as isPackagesSkippedSource, _ as isRSCServerModule, $ as lateMangleCensusMessage, a0 as mangleCodeClassesSync, a1 as mangleEligibleClasses, a2 as mangleHybridHazardMessage, a3 as mergeThemes, a4 as missingTailwindEntryMessage, a5 as normalizeGlobalVarAliasesForCache, a6 as parseThemeBlocks, a7 as parseUtilityBlocks, a8 as realContentHashDisabledMessage, a9 as recordGlobalVarSourceFile, aa as resolveCompileSourceDirs, ab as resolveNativeCacheIdentity, ac as resolveQuietMode, ad as rollupPlugin, ae as scanCustomPropertyNames, af as shouldEmitMissingCssFallback, ag as shouldEmitWarning, ah as shouldTrackGlobalVarSources, ai as shouldWarnMissingTailwindEntry, aj as shouldWarnUnscopedMonorepo, ak as skippedSzFilesMessage, al as suppressedAdvisoryMessage, z as unplugin, am as unscopedMonorepoMessage, an as vitePlugin, ao as watchModeMangleMessage, ap as webpackPlugin } from './shared/unplugin.BT7PqYuK.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.BHfqCocB.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, M as MangleHybridHazards, o as ParsedTheme, p as ParsedUtilities, Q as QuietMode, q as RSCBoundaryViolation, r as RSCModuleRecord, s as allocateMangleTokens, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as default, A as deleteRSCModuleRecord, B as emitMissingCssFallback, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, T as isAdvisoryDiagnostic, U as isCompileSourceOptedIn, W as isHardIgnoredPath, X as isMangleableCssId, Y as isMonorepoPackage, Z as isPackagesSkippedSource, _ as isRSCServerModule, $ as lateMangleCensusMessage, a0 as mangleCodeClassesSync, a1 as mangleEligibleClasses, a2 as mangleHybridHazardMessage, a3 as mergeThemes, a4 as missingTailwindEntryMessage, a5 as normalizeGlobalVarAliasesForCache, a6 as parseThemeBlocks, a7 as parseUtilityBlocks, a8 as realContentHashDisabledMessage, a9 as recordGlobalVarSourceFile, aa as resolveCompileSourceDirs, ab as resolveNativeCacheIdentity, ac as resolveQuietMode, ad as rollupPlugin, ae as scanCustomPropertyNames, af as shouldEmitMissingCssFallback, ag as shouldEmitWarning, ah as shouldTrackGlobalVarSources, ai as shouldWarnMissingTailwindEntry, aj as shouldWarnUnscopedMonorepo, ak as skippedSzFilesMessage, al as suppressedAdvisoryMessage, z as unplugin, am as unscopedMonorepoMessage, an as vitePlugin, ao as watchModeMangleMessage, ap as webpackPlugin } from './shared/unplugin.BHfqCocB.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.BT7PqYuK.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, M as MangleHybridHazards, o as ParsedTheme, p as ParsedUtilities, Q as QuietMode, q as RSCBoundaryViolation, r as RSCModuleRecord, s as allocateMangleTokens, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as default, A as deleteRSCModuleRecord, B as emitMissingCssFallback, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, T as isAdvisoryDiagnostic, U as isCompileSourceOptedIn, W as isHardIgnoredPath, X as isMangleableCssId, Y as isMonorepoPackage, Z as isPackagesSkippedSource, _ as isRSCServerModule, $ as lateMangleCensusMessage, a0 as mangleCodeClassesSync, a1 as mangleEligibleClasses, a2 as mangleHybridHazardMessage, a3 as mergeThemes, a4 as missingTailwindEntryMessage, a5 as normalizeGlobalVarAliasesForCache, a6 as parseThemeBlocks, a7 as parseUtilityBlocks, a8 as realContentHashDisabledMessage, a9 as recordGlobalVarSourceFile, aa as resolveCompileSourceDirs, ab as resolveNativeCacheIdentity, ac as resolveQuietMode, ad as rollupPlugin, ae as scanCustomPropertyNames, af as shouldEmitMissingCssFallback, ag as shouldEmitWarning, ah as shouldTrackGlobalVarSources, ai as shouldWarnMissingTailwindEntry, aj as shouldWarnUnscopedMonorepo, ak as skippedSzFilesMessage, al as suppressedAdvisoryMessage, z as unplugin, am as unscopedMonorepoMessage, an as vitePlugin, ao as watchModeMangleMessage, ap as webpackPlugin } from './shared/unplugin.BT7PqYuK.mjs';
5
5
  import 'postcss';
6
6
  import '@csszyx/compiler';
7
7
  import 'esbuild';
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
- export { a as allocateMangleTokens, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as createGlobalVarAliasValidationOptions, f as createGlobalVarMapAssetSource, g as createGlobalVarScanCacheKey, h as createRSCModuleRecord, i as cssHasContentScope, u as default, j as deleteRSCModuleRecord, k as emitMissingCssFallback, l as esbuildPlugin, m as extractGlobalVarAliasesForManifest, n as fileMayContainSafelistableSz, o as findLocalImportSources, p as findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasUseClientDirective, t as hasUseServerDirective, v as isAdvisoryDiagnostic, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMangleableCssId, z as isMonorepoPackage, A as isPackagesSkippedSource, B as isRSCServerModule, C as isTailwindReservedGlobalVar, D as lateMangleCensusMessage, E as mangleCodeClassesSync, F as mangleEligibleClasses, G as mangleHybridHazardMessage, H as missingTailwindEntryMessage, I as normalizeGlobalVarAliasesForCache, J as planGlobalVarAliases, K as readGlobalVarScanCache, L as realContentHashDisabledMessage, M as recordGlobalVarSourceFile, N as resolveCompileSourceDirs, O as resolveGlobalVarScanCacheDir, P as resolveNativeCacheIdentity, Q as resolveQuietMode, R as rewriteGlobalVarCssAliases, S as rollupPlugin, T as scanGlobalVarCss, U as shouldEmitMissingCssFallback, V as shouldEmitWarning, W as shouldTrackGlobalVarSources, X as shouldWarnMissingTailwindEntry, Y as shouldWarnUnscopedMonorepo, Z as skippedSzFilesMessage, _ as suppressedAdvisoryMessage, u as unplugin, $ as unscopedMonorepoMessage, a0 as validateGlobalVarAliasInputs, a1 as vitePlugin, a2 as watchModeMangleMessage, a3 as webpackPlugin, a4 as writeGlobalVarScanCache } from './shared/unplugin.BGufkSFT.mjs';
3
- export { h as hasTokens, m as mergeThemes, p as parseThemeBlocks, a as parseUtilityBlocks, s as scanCustomPropertyNames } from './shared/unplugin.BourSpnZ.mjs';
2
+ export { a as allocateMangleTokens, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as createGlobalVarAliasValidationOptions, f as createGlobalVarMapAssetSource, g as createGlobalVarScanCacheKey, h as createRSCModuleRecord, i as cssHasContentScope, u as default, j as deleteRSCModuleRecord, k as emitMissingCssFallback, l as esbuildPlugin, m as extractGlobalVarAliasesForManifest, n as fileMayContainSafelistableSz, o as findLocalImportSources, p as findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasUseClientDirective, t as hasUseServerDirective, v as isAdvisoryDiagnostic, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMangleableCssId, z as isMonorepoPackage, A as isPackagesSkippedSource, B as isRSCServerModule, C as isTailwindReservedGlobalVar, D as lateMangleCensusMessage, E as mangleCodeClassesSync, F as mangleEligibleClasses, G as mangleHybridHazardMessage, H as missingTailwindEntryMessage, I as normalizeGlobalVarAliasesForCache, J as planGlobalVarAliases, K as readGlobalVarScanCache, L as realContentHashDisabledMessage, M as recordGlobalVarSourceFile, N as resolveCompileSourceDirs, O as resolveGlobalVarScanCacheDir, P as resolveNativeCacheIdentity, Q as resolveQuietMode, R as rewriteGlobalVarCssAliases, S as rollupPlugin, T as scanGlobalVarCss, U as shouldEmitMissingCssFallback, V as shouldEmitWarning, W as shouldTrackGlobalVarSources, X as shouldWarnMissingTailwindEntry, Y as shouldWarnUnscopedMonorepo, Z as skippedSzFilesMessage, _ as suppressedAdvisoryMessage, u as unplugin, $ as unscopedMonorepoMessage, a0 as validateGlobalVarAliasInputs, a1 as vitePlugin, a2 as watchModeMangleMessage, a3 as webpackPlugin, a4 as writeGlobalVarScanCache } from './shared/unplugin.D68hyqgb.mjs';
3
+ export { h as hasTokens, m as mergeThemes, p as parseThemeBlocks, a as parseUtilityBlocks, s as scanCustomPropertyNames } from './shared/unplugin.DK0b4fr7.mjs';
4
4
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
5
- export { S as SAFELIST_FILE, a as appendTailwindSourceDirective, c as computeSafelistRelPath, b as cssImportsTailwind } from './shared/unplugin.CqJS0BbD.mjs';
5
+ export { S as SAFELIST_FILE, a as appendTailwindSourceDirective, c as computeSafelistRelPath, b as cssImportsTailwind } from './shared/unplugin.DH_ij6cf.mjs';
6
6
  import 'postcss';
7
7
  import 'postcss-selector-parser';
8
8
  import 'node:crypto';
@@ -17,6 +17,6 @@ import '@csszyx/core/native';
17
17
  import '@csszyx/svelte-adapter';
18
18
  import '@csszyx/vue-adapter';
19
19
  import 'unplugin';
20
- import './shared/unplugin.AGR7mihU.mjs';
20
+ import './shared/unplugin.Bk9o8_RZ.mjs';
21
21
  import 'node:zlib';
22
22
  import 'postcss-value-parser';
@@ -3,10 +3,10 @@
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.BbBYWFGT.cjs');
7
- const nextWatcherCycle = require('./shared/unplugin.Dai5wlZ3.cjs');
8
- const safelistSource = require('./shared/unplugin.KnDCM-sr.cjs');
9
- const transformCache = require('./shared/unplugin.DX3rYT4P.cjs');
6
+ const nextTransformMetadata = require('./shared/unplugin.gksolKh2.cjs');
7
+ const nextWatcherCycle = require('./shared/unplugin.BWnmKv07.cjs');
8
+ const safelistSource = require('./shared/unplugin.DDSWQJYX.cjs');
9
+ const transformCache = require('./shared/unplugin.BzF0V2kw.cjs');
10
10
  require('@csszyx/compiler');
11
11
  require('@csszyx/types');
12
12
  require('node:os');
@@ -1,7 +1,7 @@
1
1
  import { TransformSourceCodeOptions } from '@csszyx/compiler';
2
- import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.C2ilavL1.cjs';
2
+ import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.BGog1Bib.cjs';
3
3
  import { N as NextSourceTransformOutput, a as NextSourceParserMode } from './shared/unplugin.B32Exn-K.cjs';
4
- import { N as NextWatcherCycleResult } from './shared/unplugin.CXCaQ3-s.cjs';
4
+ import { N as NextWatcherCycleResult } from './shared/unplugin.rWOMecQs.cjs';
5
5
 
6
6
  /** Serializable options accepted by the Next Turbopack csszyx prebuild core. */
7
7
  interface NextPrebuildOptions {
@@ -1,7 +1,7 @@
1
1
  import { TransformSourceCodeOptions } from '@csszyx/compiler';
2
- import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.C2ilavL1.mjs';
2
+ import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.BGog1Bib.mjs';
3
3
  import { N as NextSourceTransformOutput, a as NextSourceParserMode } from './shared/unplugin.B32Exn-K.mjs';
4
- import { N as NextWatcherCycleResult } from './shared/unplugin.CbNydVwv.mjs';
4
+ import { N as NextWatcherCycleResult } from './shared/unplugin.COlI0dJs.mjs';
5
5
 
6
6
  /** Serializable options accepted by the Next Turbopack csszyx prebuild core. */
7
7
  interface NextPrebuildOptions {
@@ -1,10 +1,10 @@
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, c as configWithImportedStaticSz, a as resolveNextCrossModule, t as transformNextSource, w as withCrossModuleStatics, b as collectNextTransformMetadata, d as createNextSafelistShardFromMetadata } from './shared/unplugin.Dbc26ty6.mjs';
5
- import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.DmCOQc-b.mjs';
6
- import { f as findPostcssConfigWithoutCsszyx, m as missingPostcssPluginMessage, n as normalizePathSeparators } from './shared/unplugin.CqJS0BbD.mjs';
7
- import { r as resolveTransformCacheDir } from './shared/unplugin.AGR7mihU.mjs';
4
+ import { r as readPackageVersion, c as configWithImportedStaticSz, a as resolveNextCrossModule, t as transformNextSource, w as withCrossModuleStatics, b as collectNextTransformMetadata, d as createNextSafelistShardFromMetadata } from './shared/unplugin.DAzgbtuZ.mjs';
5
+ import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.BLptVbUe.mjs';
6
+ import { f as findPostcssConfigWithoutCsszyx, m as missingPostcssPluginMessage, n as normalizePathSeparators } from './shared/unplugin.DH_ij6cf.mjs';
7
+ import { r as resolveTransformCacheDir } from './shared/unplugin.Bk9o8_RZ.mjs';
8
8
  import '@csszyx/compiler';
9
9
  import '@csszyx/types';
10
10
  import 'node:os';
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const node_crypto = require('node:crypto');
6
6
  const path = require('node:path');
7
- const themeGroupsFile = require('./shared/unplugin.C7i0agiO.cjs');
8
- const nextTransformMetadata = require('./shared/unplugin.BbBYWFGT.cjs');
9
- const nextWatcherCycle = require('./shared/unplugin.Dai5wlZ3.cjs');
10
- const safelistSource = require('./shared/unplugin.KnDCM-sr.cjs');
11
- const transformCache = require('./shared/unplugin.DX3rYT4P.cjs');
7
+ const themeGroupsFile = require('./shared/unplugin.J6ue_lRJ.cjs');
8
+ const nextTransformMetadata = require('./shared/unplugin.gksolKh2.cjs');
9
+ const nextWatcherCycle = require('./shared/unplugin.BWnmKv07.cjs');
10
+ const safelistSource = require('./shared/unplugin.DDSWQJYX.cjs');
11
+ const transformCache = require('./shared/unplugin.BzF0V2kw.cjs');
12
12
  require('node:fs');
13
13
  require('@csszyx/compiler');
14
14
  require('@csszyx/types');
@@ -1,5 +1,5 @@
1
1
  import { TransformSourceCodeOptions } from '@csszyx/compiler';
2
- import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.C2ilavL1.cjs';
2
+ import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.BGog1Bib.cjs';
3
3
  import { a as NextSourceParserMode, N as NextSourceTransformOutput } from './shared/unplugin.B32Exn-K.cjs';
4
4
 
5
5
  /** Serializable options accepted by the Next Turbopack csszyx loader. */
@@ -1,5 +1,5 @@
1
1
  import { TransformSourceCodeOptions } from '@csszyx/compiler';
2
- import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.C2ilavL1.mjs';
2
+ import { J as JsonLike, A as AtomicWriteOptions, N as NextStateContext } from './shared/unplugin.BGog1Bib.mjs';
3
3
  import { a as NextSourceParserMode, N as NextSourceTransformOutput } from './shared/unplugin.B32Exn-K.mjs';
4
4
 
5
5
  /** Serializable options accepted by the Next Turbopack csszyx loader. */
@@ -1,10 +1,10 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import * as path from 'node:path';
3
- import { i as injectNextRuntimeImports, e as ensureThemeGroupsFile, b as insertAfterUseDirective, t as themeGroupsSpecifier } from './shared/unplugin.BourSpnZ.mjs';
4
- import { r as readPackageVersion, c as configWithImportedStaticSz, a as resolveNextCrossModule, t as transformNextSource, w as withCrossModuleStatics, n as normalizeProviderPaths, b as collectNextTransformMetadata, d as createNextSafelistShardFromMetadata } from './shared/unplugin.Dbc26ty6.mjs';
5
- import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, N as NextSafelistStateLockedError, a as NEXT_WATCH_LOCK_COMMAND, v as validateNextGenerationManifest, b as readNextGenerationManifest } from './shared/unplugin.DmCOQc-b.mjs';
6
- import { n as normalizePathSeparators } from './shared/unplugin.CqJS0BbD.mjs';
7
- import { r as resolveTransformCacheDir } from './shared/unplugin.AGR7mihU.mjs';
3
+ import { i as injectNextRuntimeImports, e as ensureThemeGroupsFile, b as insertAfterUseDirective, t as themeGroupsSpecifier } from './shared/unplugin.DK0b4fr7.mjs';
4
+ import { r as readPackageVersion, c as configWithImportedStaticSz, a as resolveNextCrossModule, t as transformNextSource, w as withCrossModuleStatics, n as normalizeProviderPaths, b as collectNextTransformMetadata, d as createNextSafelistShardFromMetadata } from './shared/unplugin.DAzgbtuZ.mjs';
5
+ import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, N as NextSafelistStateLockedError, a as NEXT_WATCH_LOCK_COMMAND, v as validateNextGenerationManifest, b as readNextGenerationManifest } from './shared/unplugin.BLptVbUe.mjs';
6
+ import { n as normalizePathSeparators } from './shared/unplugin.DH_ij6cf.mjs';
7
+ import { r as resolveTransformCacheDir } from './shared/unplugin.Bk9o8_RZ.mjs';
8
8
  import 'node:fs';
9
9
  import '@csszyx/compiler';
10
10
  import '@csszyx/types';
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  const path = require('node:path');
4
- const nextWatcherCycle = require('./shared/unplugin.Dai5wlZ3.cjs');
4
+ const nextWatcherCycle = require('./shared/unplugin.BWnmKv07.cjs');
5
5
  require('node:fs');
6
+ require('./shared/unplugin.DDSWQJYX.cjs');
6
7
  require('node:crypto');
7
8
  require('node:os');
8
9
  require('proper-lockfile');
9
- require('./shared/unplugin.KnDCM-sr.cjs');
10
10
 
11
11
  function _interopNamespaceCompat(e) {
12
12
  if (e && typeof e === 'object' && 'default' in e) return e;
@@ -1,5 +1,5 @@
1
- import { N as NextStateContext } from './shared/unplugin.C2ilavL1.cjs';
2
- import { a as NextWatcherCycleOptions, N as NextWatcherCycleResult } from './shared/unplugin.CXCaQ3-s.cjs';
1
+ import { N as NextStateContext } from './shared/unplugin.BGog1Bib.cjs';
2
+ import { a as NextWatcherCycleOptions, N as NextWatcherCycleResult } from './shared/unplugin.rWOMecQs.cjs';
3
3
 
4
4
  /**
5
5
  *
@@ -1,5 +1,5 @@
1
- import { N as NextStateContext } from './shared/unplugin.C2ilavL1.mjs';
2
- import { a as NextWatcherCycleOptions, N as NextWatcherCycleResult } from './shared/unplugin.CbNydVwv.mjs';
1
+ import { N as NextStateContext } from './shared/unplugin.BGog1Bib.mjs';
2
+ import { a as NextWatcherCycleOptions, N as NextWatcherCycleResult } from './shared/unplugin.COlI0dJs.mjs';
3
3
 
4
4
  /**
5
5
  *
@@ -1,10 +1,10 @@
1
1
  import * as path from 'node:path';
2
- import { r as runNextWatcherCycle } from './shared/unplugin.DmCOQc-b.mjs';
2
+ import { r as runNextWatcherCycle } from './shared/unplugin.BLptVbUe.mjs';
3
3
  import 'node:fs';
4
+ import './shared/unplugin.DH_ij6cf.mjs';
4
5
  import 'node:crypto';
5
6
  import 'node:os';
6
7
  import 'proper-lockfile';
7
- import './shared/unplugin.CqJS0BbD.mjs';
8
8
 
9
9
  class NextWatcherLoop {
10
10
  context;
@@ -13,10 +13,10 @@ const svelteAdapter = require('@csszyx/svelte-adapter');
13
13
  const types = require('@csszyx/types');
14
14
  const vueAdapter = require('@csszyx/vue-adapter');
15
15
  const unplugin$1 = require('unplugin');
16
- const transformCache = require('./unplugin.DX3rYT4P.cjs');
16
+ const safelistSource = require('./unplugin.DDSWQJYX.cjs');
17
+ const transformCache = require('./unplugin.BzF0V2kw.cjs');
17
18
  const cssMangler = require('../css-mangler.cjs');
18
- const themeGroupsFile = require('./unplugin.C7i0agiO.cjs');
19
- const safelistSource = require('./unplugin.KnDCM-sr.cjs');
19
+ const themeGroupsFile = require('./unplugin.J6ue_lRJ.cjs');
20
20
  const node_zlib = require('node:zlib');
21
21
  const postcss = require('postcss');
22
22
  const valueParser = require('postcss-value-parser');
@@ -2180,13 +2180,14 @@ function findOpeningTag(source, tag) {
2180
2180
  }
2181
2181
  }
2182
2182
  const _warnedClassNameAuthors = /* @__PURE__ */ new Set();
2183
+ const _warnedSafelistWriteFailures = /* @__PURE__ */ new Set();
2183
2184
  let _hasWarnedTsConfig = false;
2184
2185
  let _hasWarnedTransformCacheVersion = false;
2185
2186
  let _hasWarnedNativeFallback = false;
2186
2187
  const _loggedActiveParsers = /* @__PURE__ */ new Set();
2187
- 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.BLbrShMZ.cjs', document.baseURI).href)));
2188
+ 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.8KYddE6x.cjs', document.baseURI).href)));
2188
2189
  const PLUGIN_VERSION = findPackageVersionFromFile(
2189
- node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.BLbrShMZ.cjs', document.baseURI).href))),
2190
+ node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.8KYddE6x.cjs', document.baseURI).href))),
2190
2191
  UNKNOWN_PACKAGE_VERSION
2191
2192
  );
2192
2193
  const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
@@ -2881,6 +2882,17 @@ function normalizeSourceFilename(filename) {
2881
2882
  return safelistSource.normalizePathSeparators(filename);
2882
2883
  }
2883
2884
  const SCRIPT_ID_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
2885
+ const STYLESHEET_FILE_EXTENSIONS = [
2886
+ ".css",
2887
+ ".pcss",
2888
+ ".postcss",
2889
+ ".scss",
2890
+ ".sass",
2891
+ ".less",
2892
+ ".styl",
2893
+ ".stylus",
2894
+ ".sss"
2895
+ ];
2884
2896
  const SOURCE_MODULE_EXTENSIONS = [...SCRIPT_ID_EXTENSIONS, ".cts", ".mts", ".cjs", ".mjs"];
2885
2897
  function matchesScriptExtension(id, extensions) {
2886
2898
  return extensions.some((ext) => id.endsWith(ext) || id.includes(`${ext}?`));
@@ -3668,11 +3680,18 @@ function createCsszyxPlugins(options = {}) {
3668
3680
  }
3669
3681
  }
3670
3682
  if (existing !== content) {
3671
- fs__namespace.mkdirSync(path__namespace.dirname(safelistPath), { recursive: true });
3672
- fs__namespace.writeFileSync(safelistPath, content);
3683
+ safelistSource.atomicWriteFileSync(safelistPath, content);
3673
3684
  safelistSource.removeLegacySafelists(state.rootDir, console.warn);
3674
3685
  }
3675
- } catch {
3686
+ } catch (error) {
3687
+ if (_warnedSafelistWriteFailures.has(safelistPath)) {
3688
+ return;
3689
+ }
3690
+ _warnedSafelistWriteFailures.add(safelistPath);
3691
+ const reason = error instanceof Error ? error.message : String(error);
3692
+ console.warn(
3693
+ `[csszyx] could not write the generated safelist to ${safelistPath}: ${reason}. Tailwind scans that file for the classes csszyx found, so the CSS it generates will be missing them. Check that the directory exists and is writable.`
3694
+ );
3676
3695
  }
3677
3696
  }
3678
3697
  function recordPackagesSkipIfSz(filePath) {
@@ -4207,7 +4226,9 @@ function createCsszyxPlugins(options = {}) {
4207
4226
  if (!safelistSource.cssImportsTailwind(code)) return null;
4208
4227
  state.sawTailwindEntry = true;
4209
4228
  const [entryFile] = id.split("?");
4210
- state.tailwindEntryFiles.add(entryFile);
4229
+ if (STYLESHEET_FILE_EXTENSIONS.some((ext) => entryFile.endsWith(ext))) {
4230
+ state.tailwindEntryFiles.add(entryFile);
4231
+ }
4211
4232
  if (cssHasContentScope(code)) state.tailwindEntryScoped = true;
4212
4233
  if (!hasInjectableTailwindCandidate(state.classes)) return null;
4213
4234
  const relPath = safelistSource.computeSafelistRelPath(state.rootDir, SAFELIST_FILENAME, id);
@@ -4671,13 +4692,35 @@ ${transformedCode}`;
4671
4692
  /**
4672
4693
  * Vite HMR hook: re-runs theme scan when a watched CSS file changes,
4673
4694
  * and incrementally updates the safelist when a source file gains new sz classes.
4674
- * @param ctx - HMR context containing the changed file
4695
+ *
4696
+ * `hotUpdate` rather than `handleHotUpdate` because the safelist
4697
+ * can arrive as a CREATE. `writeSafelistFile` returns early on an
4698
+ * empty class set, so a project with no `sz` at prescan has no
4699
+ * safelist file, and the first `sz` edit makes one. Vite routes a
4700
+ * create to `hotUpdate` only — its `handleHotUpdate` branch runs
4701
+ * for `type === 'update'` and nothing else — so the legacy hook
4702
+ * left that one event to `@tailwindcss/vite`, which answers a
4703
+ * scanned file whose only modules are asset nodes with an
4704
+ * unaddressed `full-reload`.
4705
+ *
4706
+ * @param this - Vite's plugin context for the pass being run.
4707
+ * @param this.environment - The environment this pass belongs to,
4708
+ * absent when a host calls the hook without one.
4709
+ * @param this.environment.name - `client` for the pass that owns
4710
+ * the page; `ssr` and any custom environment follow it.
4711
+ * @param this.environment.moduleGraph - That environment's own
4712
+ * graph, the one Vite replaces with this hook's answer.
4713
+ * @param ctx - HMR context: the changed file, why it changed, and
4714
+ * the dev server.
4675
4715
  * @returns The modules a safelist write affects, so Vite hot-updates
4676
4716
  * the stylesheet instead of reloading the page; undefined otherwise,
4677
4717
  * which leaves Vite's own handling in place.
4678
4718
  */
4679
- handleHotUpdate(ctx) {
4680
- prescanResultHandoff.clear();
4719
+ hotUpdate(ctx) {
4720
+ const isClientPass = (this.environment?.name ?? "client") === "client";
4721
+ if (isClientPass) {
4722
+ prescanResultHandoff.clear();
4723
+ }
4681
4724
  const scanCss = options.build?.scanCss;
4682
4725
  const reloadThemeGroupsModule = () => {
4683
4726
  const themeGroupsModule = ctx.server.moduleGraph.getModuleById(
@@ -4687,7 +4730,7 @@ ${transformedCode}`;
4687
4730
  ctx.server.moduleGraph.invalidateModule(themeGroupsModule);
4688
4731
  }
4689
4732
  };
4690
- if (ctx.file.endsWith(".css")) {
4733
+ if (isClientPass && ctx.file.endsWith(".css")) {
4691
4734
  const root = ctx.server.config.root || process.cwd();
4692
4735
  const before = themeGroupsFile.createThemeGroupsModule(themeGroupTokens());
4693
4736
  if (scanCss && matchesAnyPattern(ctx.file, scanCss, root)) {
@@ -4700,9 +4743,11 @@ ${transformedCode}`;
4700
4743
  }
4701
4744
  }
4702
4745
  if (safelistSource.normalizePathSeparators(ctx.file) === safelistSource.normalizePathSeparators(path__namespace.join(state.rootDir, SAFELIST_FILENAME))) {
4703
- return tailwindEntryModules(ctx.server.moduleGraph);
4746
+ return tailwindEntryModules(
4747
+ this.environment?.moduleGraph ?? ctx.server.environments.client.moduleGraph
4748
+ );
4704
4749
  }
4705
- discoverHotFileClasses(ctx.file, ctx.server.watcher);
4750
+ if (isClientPass) discoverHotFileClasses(ctx.file, ctx.server.watcher);
4706
4751
  return void 0;
4707
4752
  },
4708
4753
  transformIndexHtml: {
@@ -9,6 +9,13 @@ interface NextCacheIdentity {
9
9
  generation: string;
10
10
  }
11
11
 
12
+ /** Options for atomic file writes that need to survive Windows file scanners. */
13
+ interface AtomicWriteOptions {
14
+ maxRetries?: number;
15
+ retryDelayMs?: number;
16
+ renameSync?: (from: string, to: string) => void;
17
+ }
18
+
12
19
  /** Files used by the Next Turbopack safelist state machine. */
13
20
  interface NextSafelistStatePaths {
14
21
  /** Project root the safelist and cache live under. */
@@ -25,12 +32,6 @@ interface NextSafelistMaterializeResult {
25
32
  tombstonedSourceCount: number;
26
33
  shardCount: number;
27
34
  }
28
- /** Options for atomic file writes that need to survive Windows file scanners. */
29
- interface AtomicWriteOptions {
30
- maxRetries?: number;
31
- retryDelayMs?: number;
32
- renameSync?: (from: string, to: string) => void;
33
- }
34
35
  /** Options used when acquiring a state lock. */
35
36
  interface NextSafelistStateLockOptions {
36
37
  pid?: number;
@@ -9,6 +9,13 @@ interface NextCacheIdentity {
9
9
  generation: string;
10
10
  }
11
11
 
12
+ /** Options for atomic file writes that need to survive Windows file scanners. */
13
+ interface AtomicWriteOptions {
14
+ maxRetries?: number;
15
+ retryDelayMs?: number;
16
+ renameSync?: (from: string, to: string) => void;
17
+ }
18
+
12
19
  /** Files used by the Next Turbopack safelist state machine. */
13
20
  interface NextSafelistStatePaths {
14
21
  /** Project root the safelist and cache live under. */
@@ -25,12 +32,6 @@ interface NextSafelistMaterializeResult {
25
32
  tombstonedSourceCount: number;
26
33
  shardCount: number;
27
34
  }
28
- /** Options for atomic file writes that need to survive Windows file scanners. */
29
- interface AtomicWriteOptions {
30
- maxRetries?: number;
31
- retryDelayMs?: number;
32
- renameSync?: (from: string, to: string) => void;
33
- }
34
35
  /** Options used when acquiring a state lock. */
35
36
  interface NextSafelistStateLockOptions {
36
37
  pid?: number;
@@ -1,12 +1,10 @@
1
1
  import * as path from 'node:path';
2
2
  import * as fs from 'node:fs';
3
+ import { S as SAFELIST_FILE, d as atomicWriteFileSync, s as sortStrings, r as renderSafelistFile, e as removeLegacySafelists, g as assertNoLegacySourceStylesheet } from './unplugin.DH_ij6cf.mjs';
3
4
  import { createHash, randomUUID } from 'node:crypto';
4
5
  import { hostname } from 'node:os';
5
6
  import lockfile from 'proper-lockfile';
6
- import { S as SAFELIST_FILE, s as sortStrings, r as renderSafelistFile, d as removeLegacySafelists, e as assertNoLegacySourceStylesheet } from './unplugin.CqJS0BbD.mjs';
7
7
 
8
- const DEFAULT_RENAME_RETRIES = 5;
9
- const DEFAULT_RENAME_RETRY_DELAY_MS = 10;
10
8
  const DEFAULT_STALE_LOCK_MS = 3e4;
11
9
  const STALE_RECOVERY_DISABLED_MS = 2147483647;
12
10
  function resolveNextSafelistStatePaths(rootDir, cacheDir = ".csszyx/cache", outputFile = SAFELIST_FILE) {
@@ -130,40 +128,6 @@ function acquireNextSafelistStateLock(lockPath, pidOrOptions = {}) {
130
128
  }
131
129
  };
132
130
  }
133
- function atomicWriteFileSync(file, content, options = {}) {
134
- const dir = path.dirname(file);
135
- const tmp = path.join(
136
- dir,
137
- `.tmp-${path.basename(file)}-${process.pid}-${Date.now()}-${randomUUID()}`
138
- );
139
- fs.mkdirSync(dir, { recursive: true });
140
- fs.writeFileSync(tmp, content, "utf8");
141
- try {
142
- atomicRenameWithRetry(tmp, file, options);
143
- } catch (error) {
144
- try {
145
- fs.rmSync(tmp, { force: true });
146
- } catch {
147
- }
148
- throw error;
149
- }
150
- }
151
- function atomicRenameWithRetry(from, to, options = {}) {
152
- const maxRetries = options.maxRetries ?? DEFAULT_RENAME_RETRIES;
153
- const retryDelayMs = options.retryDelayMs ?? DEFAULT_RENAME_RETRY_DELAY_MS;
154
- const renameSync = options.renameSync ?? fs.renameSync;
155
- for (let attempt = 0; ; attempt++) {
156
- try {
157
- renameSync(from, to);
158
- return;
159
- } catch (error) {
160
- if (!isRetryableRenameError(error) || attempt >= maxRetries) {
161
- throw error;
162
- }
163
- sleepSync(retryDelayMs);
164
- }
165
- }
166
- }
167
131
  function isExistingShardEquivalent(filePath, shard) {
168
132
  try {
169
133
  const parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
@@ -351,15 +315,6 @@ function formatLiveLockError(metadata) {
351
315
  `updatedAt=${metadata.updatedAt}`
352
316
  ].join(" ");
353
317
  }
354
- function isRetryableRenameError(error) {
355
- return typeof error === "object" && error !== null && "code" in error && (error.code === "EBUSY" || error.code === "EPERM" || error.code === "EACCES");
356
- }
357
- function sleepSync(ms) {
358
- if (ms <= 0) {
359
- return;
360
- }
361
- Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
362
- }
363
318
 
364
319
  function createNextCacheIdentity(input) {
365
320
  const configHash = hashString(stableStringify(input.config));
@@ -497,7 +497,7 @@ interface PluginState {
497
497
  * Absolute paths of every CSS file seen importing `tailwindcss`, without
498
498
  * their query. These are the modules whose generated CSS changes when the
499
499
  * safelist does, which is what lets a dev server hot-update instead of
500
- * reloading — see the `handleHotUpdate` safelist branch.
500
+ * reloading — see the `hotUpdate` safelist branch.
501
501
  */
502
502
  tailwindEntryFiles: Set<string>;
503
503
  /**
@@ -497,7 +497,7 @@ interface PluginState {
497
497
  * Absolute paths of every CSS file seen importing `tailwindcss`, without
498
498
  * their query. These are the modules whose generated CSS changes when the
499
499
  * safelist does, which is what lets a dev server hot-update instead of
500
- * reloading — see the `handleHotUpdate` safelist branch.
500
+ * reloading — see the `hotUpdate` safelist branch.
501
501
  */
502
502
  tailwindEntryFiles: Set<string>;
503
503
  /**
@@ -2,10 +2,10 @@
2
2
 
3
3
  const path = require('node:path');
4
4
  const fs = require('node:fs');
5
+ const safelistSource = require('./unplugin.DDSWQJYX.cjs');
5
6
  const node_crypto = require('node:crypto');
6
7
  const node_os = require('node:os');
7
8
  const lockfile = require('proper-lockfile');
8
- const safelistSource = require('./unplugin.KnDCM-sr.cjs');
9
9
 
10
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
11
11
 
@@ -25,8 +25,6 @@ const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
25
25
  const fs__namespace = /*#__PURE__*/_interopNamespaceCompat(fs);
26
26
  const lockfile__default = /*#__PURE__*/_interopDefaultCompat(lockfile);
27
27
 
28
- const DEFAULT_RENAME_RETRIES = 5;
29
- const DEFAULT_RENAME_RETRY_DELAY_MS = 10;
30
28
  const DEFAULT_STALE_LOCK_MS = 3e4;
31
29
  const STALE_RECOVERY_DISABLED_MS = 2147483647;
32
30
  function resolveNextSafelistStatePaths(rootDir, cacheDir = ".csszyx/cache", outputFile = safelistSource.SAFELIST_FILE) {
@@ -45,7 +43,7 @@ function writeNextSafelistShard(shardsDir, input, options = {}) {
45
43
  if (isExistingShardEquivalent(filePath, shard)) {
46
44
  return { filePath, changed: false };
47
45
  }
48
- atomicWriteFileSync(filePath, `${JSON.stringify(shard, null, 2)}
46
+ safelistSource.atomicWriteFileSync(filePath, `${JSON.stringify(shard, null, 2)}
49
47
  `, options);
50
48
  return { filePath, changed: true };
51
49
  }
@@ -69,9 +67,9 @@ function materializeNextSafelist(paths, options = {}) {
69
67
  version: 1,
70
68
  sources: sortedSources.map(([sourcePath, classSet]) => [sourcePath, classSet])
71
69
  };
72
- atomicWriteFileSync(paths.outputPath, safelistSource.renderSafelistFile(classNames), options);
70
+ safelistSource.atomicWriteFileSync(paths.outputPath, safelistSource.renderSafelistFile(classNames), options);
73
71
  safelistSource.removeLegacySafelists(paths.rootDir, console.warn);
74
- atomicWriteFileSync(paths.snapshotPath, `${JSON.stringify(snapshot, null, 2)}
72
+ safelistSource.atomicWriteFileSync(paths.snapshotPath, `${JSON.stringify(snapshot, null, 2)}
75
73
  `, options);
76
74
  return {
77
75
  classCount: classNames.length,
@@ -112,7 +110,7 @@ function acquireNextSafelistStateLock(lockPath, pidOrOptions = {}) {
112
110
  throw new NextSafelistStateLockedError(existing);
113
111
  }
114
112
  try {
115
- atomicWriteFileSync(lockPath, `${JSON.stringify(metadata, null, 2)}
113
+ safelistSource.atomicWriteFileSync(lockPath, `${JSON.stringify(metadata, null, 2)}
116
114
  `);
117
115
  } catch (error) {
118
116
  releaseAdvisory();
@@ -120,7 +118,7 @@ function acquireNextSafelistStateLock(lockPath, pidOrOptions = {}) {
120
118
  }
121
119
  let released = false;
122
120
  const writeCurrentMetadata = (updatedAt) => {
123
- atomicWriteFileSync(lockPath, `${JSON.stringify({ ...metadata, updatedAt }, null, 2)}
121
+ safelistSource.atomicWriteFileSync(lockPath, `${JSON.stringify({ ...metadata, updatedAt }, null, 2)}
124
122
  `);
125
123
  };
126
124
  return {
@@ -150,40 +148,6 @@ function acquireNextSafelistStateLock(lockPath, pidOrOptions = {}) {
150
148
  }
151
149
  };
152
150
  }
153
- function atomicWriteFileSync(file, content, options = {}) {
154
- const dir = path__namespace.dirname(file);
155
- const tmp = path__namespace.join(
156
- dir,
157
- `.tmp-${path__namespace.basename(file)}-${process.pid}-${Date.now()}-${node_crypto.randomUUID()}`
158
- );
159
- fs__namespace.mkdirSync(dir, { recursive: true });
160
- fs__namespace.writeFileSync(tmp, content, "utf8");
161
- try {
162
- atomicRenameWithRetry(tmp, file, options);
163
- } catch (error) {
164
- try {
165
- fs__namespace.rmSync(tmp, { force: true });
166
- } catch {
167
- }
168
- throw error;
169
- }
170
- }
171
- function atomicRenameWithRetry(from, to, options = {}) {
172
- const maxRetries = options.maxRetries ?? DEFAULT_RENAME_RETRIES;
173
- const retryDelayMs = options.retryDelayMs ?? DEFAULT_RENAME_RETRY_DELAY_MS;
174
- const renameSync = options.renameSync ?? fs__namespace.renameSync;
175
- for (let attempt = 0; ; attempt++) {
176
- try {
177
- renameSync(from, to);
178
- return;
179
- } catch (error) {
180
- if (!isRetryableRenameError(error) || attempt >= maxRetries) {
181
- throw error;
182
- }
183
- sleepSync(retryDelayMs);
184
- }
185
- }
186
- }
187
151
  function isExistingShardEquivalent(filePath, shard) {
188
152
  try {
189
153
  const parsed = JSON.parse(fs__namespace.readFileSync(filePath, "utf8"));
@@ -371,15 +335,6 @@ function formatLiveLockError(metadata) {
371
335
  `updatedAt=${metadata.updatedAt}`
372
336
  ].join(" ");
373
337
  }
374
- function isRetryableRenameError(error) {
375
- return typeof error === "object" && error !== null && "code" in error && (error.code === "EBUSY" || error.code === "EPERM" || error.code === "EACCES");
376
- }
377
- function sleepSync(ms) {
378
- if (ms <= 0) {
379
- return;
380
- }
381
- Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
382
- }
383
338
 
384
339
  function createNextCacheIdentity(input) {
385
340
  const configHash = hashString(stableStringify(input.config));
@@ -431,7 +386,7 @@ function resolveNextGenerationManifestPath(rootDir, cacheDir = ".csszyx/cache")
431
386
  return path__namespace.resolve(rootDir, cacheDir, "generation-manifest.json");
432
387
  }
433
388
  function writeNextGenerationManifest(manifestPath, manifest, options = {}) {
434
- atomicWriteFileSync(
389
+ safelistSource.atomicWriteFileSync(
435
390
  manifestPath,
436
391
  `${JSON.stringify(normalizeManifest(manifest), null, 2)}
437
392
  `,
@@ -1,6 +1,6 @@
1
1
  import * as path from 'node:path';
2
2
  import { extractCrossModuleRegistryEntries, extractCrossModuleForwards } from '@csszyx/compiler';
3
- import { n as normalizePathSeparators } from './unplugin.CqJS0BbD.mjs';
3
+ import { n as normalizePathSeparators } from './unplugin.DH_ij6cf.mjs';
4
4
  import * as fs from 'node:fs';
5
5
  import { existsSync, statSync } from 'node:fs';
6
6
  import { createHash, randomUUID } from 'node:crypto';
@@ -2,7 +2,7 @@
2
2
 
3
3
  const path = require('node:path');
4
4
  const compiler = require('@csszyx/compiler');
5
- const safelistSource = require('./unplugin.KnDCM-sr.cjs');
5
+ const safelistSource = require('./unplugin.DDSWQJYX.cjs');
6
6
  const fs = require('node:fs');
7
7
  const node_crypto = require('node:crypto');
8
8
 
@@ -1,4 +1,4 @@
1
- import { a as NextSafelistMaterializeResult, b as NextSafelistStateLockOptions, A as AtomicWriteOptions } from './unplugin.C2ilavL1.cjs';
1
+ import { a as NextSafelistMaterializeResult, b as NextSafelistStateLockOptions, A as AtomicWriteOptions } from './unplugin.BGog1Bib.mjs';
2
2
 
3
3
  /** Options for one synchronous watcher materialization cycle. */
4
4
  interface NextWatcherCycleOptions {
@@ -13,10 +13,10 @@ import { preprocess as preprocess$1 } from '@csszyx/svelte-adapter';
13
13
  import { isTailwindReservedCustomProperty, CSSZYX_GLOBAL_ALIAS_PREFIX, isCsszyxGlobalAliasCustomProperty, DEFAULT_IMPORTED_STATIC_SZ, DEFAULT_BUILD_CONFIG, validateGlobalVarMangleConfig } from '@csszyx/types';
14
14
  import { preprocess } from '@csszyx/vue-adapter';
15
15
  import { createUnplugin } from 'unplugin';
16
- import { c as collectSpecifierAliases, r as resolveTransformCacheDir, h as evictOldTransformCacheEntries, j as recordSzvRegistryFile, k as recordCrossModuleForwards, l as recordSzObjectRegistryFile, m as mayExportSzvFactories, n as resolveCrossModuleStaticsFor, e as createTransformCacheKey, w as writeTransformCache, o as resolveProviderPath, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, g as readTransformCache, p as evictMemoryCacheToBudget, d as isReadableProviderFile } from './unplugin.AGR7mihU.mjs';
16
+ import { s as sortStrings, n as normalizePathSeparators, h as stripCssBlockComments, S as SAFELIST_FILE, i as findLegacySourceDirective, l as legacySourceMessage, b as cssImportsTailwind, c as computeSafelistRelPath, a as appendTailwindSourceDirective, r as renderSafelistFile, d as atomicWriteFileSync, e as removeLegacySafelists } from './unplugin.DH_ij6cf.mjs';
17
+ import { c as collectSpecifierAliases, r as resolveTransformCacheDir, h as evictOldTransformCacheEntries, j as recordSzvRegistryFile, k as recordCrossModuleForwards, l as recordSzObjectRegistryFile, m as mayExportSzvFactories, n as resolveCrossModuleStaticsFor, e as createTransformCacheKey, w as writeTransformCache, o as resolveProviderPath, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, g as readTransformCache, p as evictMemoryCacheToBudget, d as isReadableProviderFile } from './unplugin.Bk9o8_RZ.mjs';
17
18
  import { mangleCSSSync } from '../css-mangler.mjs';
18
- import { c as createMangleRuntimeModule, M as MANGLE_RUNTIME_VIRTUAL_ID, d as createThemeGroupsModule, e as ensureThemeGroupsFile, R as RESOLVED_VIRTUAL_MODULE_ID, f as createMangleMapModule, g as RESOLVED_VIRTUAL_CHECKSUM_ID, j as createChecksumModule, k as RESOLVED_MANGLE_RUNTIME_VIRTUAL_ID, l as RESOLVED_THEME_GROUPS_VIRTUAL_ID, n as isVirtualModule, r as resolveVirtualModule, p as parseThemeBlocks, m as mergeThemes, o as discoverProjectTheme, C as CHECKSUM_PLACEHOLDER, q as CENSUS_PLACEHOLDER, u as importsRuntimeHelper, v as findRuntimeImportClause, T as THEME_GROUPS_VIRTUAL_ID, w as THEME_GROUPS_FILE_MARKER, t as themeGroupsSpecifier, a as parseUtilityBlocks, x as runtimeHelperGroupsFromUsage, b as insertAfterUseDirective, y as MANGLE_MAP_PLACEHOLDER, V as VAR_MANGLE_MAP_PLACEHOLDER } from './unplugin.BourSpnZ.mjs';
19
- import { s as sortStrings, n as normalizePathSeparators, g as stripCssBlockComments, S as SAFELIST_FILE, h as findLegacySourceDirective, l as legacySourceMessage, b as cssImportsTailwind, c as computeSafelistRelPath, a as appendTailwindSourceDirective, r as renderSafelistFile, d as removeLegacySafelists } from './unplugin.CqJS0BbD.mjs';
19
+ import { c as createMangleRuntimeModule, M as MANGLE_RUNTIME_VIRTUAL_ID, d as createThemeGroupsModule, e as ensureThemeGroupsFile, R as RESOLVED_VIRTUAL_MODULE_ID, f as createMangleMapModule, g as RESOLVED_VIRTUAL_CHECKSUM_ID, j as createChecksumModule, k as RESOLVED_MANGLE_RUNTIME_VIRTUAL_ID, l as RESOLVED_THEME_GROUPS_VIRTUAL_ID, n as isVirtualModule, r as resolveVirtualModule, p as parseThemeBlocks, m as mergeThemes, o as discoverProjectTheme, C as CHECKSUM_PLACEHOLDER, q as CENSUS_PLACEHOLDER, u as importsRuntimeHelper, v as findRuntimeImportClause, T as THEME_GROUPS_VIRTUAL_ID, w as THEME_GROUPS_FILE_MARKER, t as themeGroupsSpecifier, a as parseUtilityBlocks, x as runtimeHelperGroupsFromUsage, b as insertAfterUseDirective, y as MANGLE_MAP_PLACEHOLDER, V as VAR_MANGLE_MAP_PLACEHOLDER } from './unplugin.DK0b4fr7.mjs';
20
20
  import { gzipSync } from 'node:zlib';
21
21
  import postcss from 'postcss';
22
22
  import valueParser from 'postcss-value-parser';
@@ -2158,6 +2158,7 @@ function findOpeningTag(source, tag) {
2158
2158
  }
2159
2159
  }
2160
2160
  const _warnedClassNameAuthors = /* @__PURE__ */ new Set();
2161
+ const _warnedSafelistWriteFailures = /* @__PURE__ */ new Set();
2161
2162
  let _hasWarnedTsConfig = false;
2162
2163
  let _hasWarnedTransformCacheVersion = false;
2163
2164
  let _hasWarnedNativeFallback = false;
@@ -2859,6 +2860,17 @@ function normalizeSourceFilename(filename) {
2859
2860
  return normalizePathSeparators(filename);
2860
2861
  }
2861
2862
  const SCRIPT_ID_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
2863
+ const STYLESHEET_FILE_EXTENSIONS = [
2864
+ ".css",
2865
+ ".pcss",
2866
+ ".postcss",
2867
+ ".scss",
2868
+ ".sass",
2869
+ ".less",
2870
+ ".styl",
2871
+ ".stylus",
2872
+ ".sss"
2873
+ ];
2862
2874
  const SOURCE_MODULE_EXTENSIONS = [...SCRIPT_ID_EXTENSIONS, ".cts", ".mts", ".cjs", ".mjs"];
2863
2875
  function matchesScriptExtension(id, extensions) {
2864
2876
  return extensions.some((ext) => id.endsWith(ext) || id.includes(`${ext}?`));
@@ -3646,11 +3658,18 @@ function createCsszyxPlugins(options = {}) {
3646
3658
  }
3647
3659
  }
3648
3660
  if (existing !== content) {
3649
- fs.mkdirSync(path.dirname(safelistPath), { recursive: true });
3650
- fs.writeFileSync(safelistPath, content);
3661
+ atomicWriteFileSync(safelistPath, content);
3651
3662
  removeLegacySafelists(state.rootDir, console.warn);
3652
3663
  }
3653
- } catch {
3664
+ } catch (error) {
3665
+ if (_warnedSafelistWriteFailures.has(safelistPath)) {
3666
+ return;
3667
+ }
3668
+ _warnedSafelistWriteFailures.add(safelistPath);
3669
+ const reason = error instanceof Error ? error.message : String(error);
3670
+ console.warn(
3671
+ `[csszyx] could not write the generated safelist to ${safelistPath}: ${reason}. Tailwind scans that file for the classes csszyx found, so the CSS it generates will be missing them. Check that the directory exists and is writable.`
3672
+ );
3654
3673
  }
3655
3674
  }
3656
3675
  function recordPackagesSkipIfSz(filePath) {
@@ -4185,7 +4204,9 @@ function createCsszyxPlugins(options = {}) {
4185
4204
  if (!cssImportsTailwind(code)) return null;
4186
4205
  state.sawTailwindEntry = true;
4187
4206
  const [entryFile] = id.split("?");
4188
- state.tailwindEntryFiles.add(entryFile);
4207
+ if (STYLESHEET_FILE_EXTENSIONS.some((ext) => entryFile.endsWith(ext))) {
4208
+ state.tailwindEntryFiles.add(entryFile);
4209
+ }
4189
4210
  if (cssHasContentScope(code)) state.tailwindEntryScoped = true;
4190
4211
  if (!hasInjectableTailwindCandidate(state.classes)) return null;
4191
4212
  const relPath = computeSafelistRelPath(state.rootDir, SAFELIST_FILENAME, id);
@@ -4649,13 +4670,35 @@ ${transformedCode}`;
4649
4670
  /**
4650
4671
  * Vite HMR hook: re-runs theme scan when a watched CSS file changes,
4651
4672
  * and incrementally updates the safelist when a source file gains new sz classes.
4652
- * @param ctx - HMR context containing the changed file
4673
+ *
4674
+ * `hotUpdate` rather than `handleHotUpdate` because the safelist
4675
+ * can arrive as a CREATE. `writeSafelistFile` returns early on an
4676
+ * empty class set, so a project with no `sz` at prescan has no
4677
+ * safelist file, and the first `sz` edit makes one. Vite routes a
4678
+ * create to `hotUpdate` only — its `handleHotUpdate` branch runs
4679
+ * for `type === 'update'` and nothing else — so the legacy hook
4680
+ * left that one event to `@tailwindcss/vite`, which answers a
4681
+ * scanned file whose only modules are asset nodes with an
4682
+ * unaddressed `full-reload`.
4683
+ *
4684
+ * @param this - Vite's plugin context for the pass being run.
4685
+ * @param this.environment - The environment this pass belongs to,
4686
+ * absent when a host calls the hook without one.
4687
+ * @param this.environment.name - `client` for the pass that owns
4688
+ * the page; `ssr` and any custom environment follow it.
4689
+ * @param this.environment.moduleGraph - That environment's own
4690
+ * graph, the one Vite replaces with this hook's answer.
4691
+ * @param ctx - HMR context: the changed file, why it changed, and
4692
+ * the dev server.
4653
4693
  * @returns The modules a safelist write affects, so Vite hot-updates
4654
4694
  * the stylesheet instead of reloading the page; undefined otherwise,
4655
4695
  * which leaves Vite's own handling in place.
4656
4696
  */
4657
- handleHotUpdate(ctx) {
4658
- prescanResultHandoff.clear();
4697
+ hotUpdate(ctx) {
4698
+ const isClientPass = (this.environment?.name ?? "client") === "client";
4699
+ if (isClientPass) {
4700
+ prescanResultHandoff.clear();
4701
+ }
4659
4702
  const scanCss = options.build?.scanCss;
4660
4703
  const reloadThemeGroupsModule = () => {
4661
4704
  const themeGroupsModule = ctx.server.moduleGraph.getModuleById(
@@ -4665,7 +4708,7 @@ ${transformedCode}`;
4665
4708
  ctx.server.moduleGraph.invalidateModule(themeGroupsModule);
4666
4709
  }
4667
4710
  };
4668
- if (ctx.file.endsWith(".css")) {
4711
+ if (isClientPass && ctx.file.endsWith(".css")) {
4669
4712
  const root = ctx.server.config.root || process.cwd();
4670
4713
  const before = createThemeGroupsModule(themeGroupTokens());
4671
4714
  if (scanCss && matchesAnyPattern(ctx.file, scanCss, root)) {
@@ -4678,9 +4721,11 @@ ${transformedCode}`;
4678
4721
  }
4679
4722
  }
4680
4723
  if (normalizePathSeparators(ctx.file) === normalizePathSeparators(path.join(state.rootDir, SAFELIST_FILENAME))) {
4681
- return tailwindEntryModules(ctx.server.moduleGraph);
4724
+ return tailwindEntryModules(
4725
+ this.environment?.moduleGraph ?? ctx.server.environments.client.moduleGraph
4726
+ );
4682
4727
  }
4683
- discoverHotFileClasses(ctx.file, ctx.server.watcher);
4728
+ if (isClientPass) discoverHotFileClasses(ctx.file, ctx.server.watcher);
4684
4729
  return void 0;
4685
4730
  },
4686
4731
  transformIndexHtml: {
@@ -2,8 +2,8 @@ import { readFileSync } from 'node:fs';
2
2
  import * as path from 'node:path';
3
3
  import { extractCrossModuleForwards, extractCrossModuleRegistryEntries, ensureRustTransformAvailable, transformRust, transformWasm, transform } from '@csszyx/compiler';
4
4
  import { DEFAULT_IMPORTED_STATIC_SZ } from '@csszyx/types';
5
- import { c as collectSpecifierAliases, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, b as recordResolvedEntry, f as forwardVisitKey, M as MAX_FORWARD_HOPS, d as isReadableProviderFile, e as createTransformCacheKey, g as readTransformCache, w as writeTransformCache } from './unplugin.AGR7mihU.mjs';
6
- import { n as normalizePathSeparators, s as sortStrings } from './unplugin.CqJS0BbD.mjs';
5
+ import { c as collectSpecifierAliases, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, b as recordResolvedEntry, f as forwardVisitKey, M as MAX_FORWARD_HOPS, d as isReadableProviderFile, e as createTransformCacheKey, g as readTransformCache, w as writeTransformCache } from './unplugin.Bk9o8_RZ.mjs';
6
+ import { n as normalizePathSeparators, s as sortStrings } from './unplugin.DH_ij6cf.mjs';
7
7
  import { createHash } from 'node:crypto';
8
8
 
9
9
  function resolveImportedStaticSz(value) {
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const node_crypto = require('node:crypto');
3
4
  const fs = require('node:fs');
4
5
  const path = require('node:path');
5
6
 
@@ -31,6 +32,52 @@ function normalizePathSeparators(value) {
31
32
  return value.split(WINDOWS_PATH_SEPARATOR).join("/");
32
33
  }
33
34
 
35
+ const DEFAULT_RENAME_RETRIES = 5;
36
+ const DEFAULT_RENAME_RETRY_DELAY_MS = 10;
37
+ function isRetryableRenameError(error) {
38
+ return typeof error === "object" && error !== null && "code" in error && (error.code === "EBUSY" || error.code === "EPERM" || error.code === "EACCES");
39
+ }
40
+ function sleepSync(ms) {
41
+ if (ms <= 0) {
42
+ return;
43
+ }
44
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
45
+ }
46
+ function atomicRenameWithRetry(from, to, options = {}) {
47
+ const maxRetries = options.maxRetries ?? DEFAULT_RENAME_RETRIES;
48
+ const retryDelayMs = options.retryDelayMs ?? DEFAULT_RENAME_RETRY_DELAY_MS;
49
+ const renameSync = options.renameSync ?? fs__namespace.renameSync;
50
+ for (let attempt = 0; ; attempt++) {
51
+ try {
52
+ renameSync(from, to);
53
+ return;
54
+ } catch (error) {
55
+ if (!isRetryableRenameError(error) || attempt >= maxRetries) {
56
+ throw error;
57
+ }
58
+ sleepSync(retryDelayMs);
59
+ }
60
+ }
61
+ }
62
+ function atomicWriteFileSync(file, content, options = {}) {
63
+ const dir = path__namespace.dirname(file);
64
+ const tmp = path__namespace.join(
65
+ dir,
66
+ `.tmp-${path__namespace.basename(file)}-${process.pid}-${Date.now()}-${node_crypto.randomUUID()}`
67
+ );
68
+ fs__namespace.mkdirSync(dir, { recursive: true });
69
+ fs__namespace.writeFileSync(tmp, content, "utf8");
70
+ try {
71
+ atomicRenameWithRetry(tmp, file, options);
72
+ } catch (error) {
73
+ try {
74
+ fs__namespace.rmSync(tmp, { force: true });
75
+ } catch {
76
+ }
77
+ throw error;
78
+ }
79
+ }
80
+
34
81
  const SAFELIST_HEADER = "# Auto-generated by csszyx \u2014 DO NOT EDIT\n# Tailwind scans this file for class names, one per line.\n";
35
82
  function renderSafelistFile(classNames) {
36
83
  if (classNames.length === 0) {
@@ -228,6 +275,7 @@ function cssImportsTailwind(code) {
228
275
  exports.SAFELIST_FILE = SAFELIST_FILE;
229
276
  exports.appendTailwindSourceDirective = appendTailwindSourceDirective;
230
277
  exports.assertNoLegacySourceStylesheet = assertNoLegacySourceStylesheet;
278
+ exports.atomicWriteFileSync = atomicWriteFileSync;
231
279
  exports.computeSafelistRelPath = computeSafelistRelPath;
232
280
  exports.cssImportsTailwind = cssImportsTailwind;
233
281
  exports.findLegacySourceDirective = findLegacySourceDirective;
@@ -1,3 +1,4 @@
1
+ import { randomUUID } from 'node:crypto';
1
2
  import * as fs from 'node:fs';
2
3
  import * as path from 'node:path';
3
4
 
@@ -14,6 +15,52 @@ function normalizePathSeparators(value) {
14
15
  return value.split(WINDOWS_PATH_SEPARATOR).join("/");
15
16
  }
16
17
 
18
+ const DEFAULT_RENAME_RETRIES = 5;
19
+ const DEFAULT_RENAME_RETRY_DELAY_MS = 10;
20
+ function isRetryableRenameError(error) {
21
+ return typeof error === "object" && error !== null && "code" in error && (error.code === "EBUSY" || error.code === "EPERM" || error.code === "EACCES");
22
+ }
23
+ function sleepSync(ms) {
24
+ if (ms <= 0) {
25
+ return;
26
+ }
27
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
28
+ }
29
+ function atomicRenameWithRetry(from, to, options = {}) {
30
+ const maxRetries = options.maxRetries ?? DEFAULT_RENAME_RETRIES;
31
+ const retryDelayMs = options.retryDelayMs ?? DEFAULT_RENAME_RETRY_DELAY_MS;
32
+ const renameSync = options.renameSync ?? fs.renameSync;
33
+ for (let attempt = 0; ; attempt++) {
34
+ try {
35
+ renameSync(from, to);
36
+ return;
37
+ } catch (error) {
38
+ if (!isRetryableRenameError(error) || attempt >= maxRetries) {
39
+ throw error;
40
+ }
41
+ sleepSync(retryDelayMs);
42
+ }
43
+ }
44
+ }
45
+ function atomicWriteFileSync(file, content, options = {}) {
46
+ const dir = path.dirname(file);
47
+ const tmp = path.join(
48
+ dir,
49
+ `.tmp-${path.basename(file)}-${process.pid}-${Date.now()}-${randomUUID()}`
50
+ );
51
+ fs.mkdirSync(dir, { recursive: true });
52
+ fs.writeFileSync(tmp, content, "utf8");
53
+ try {
54
+ atomicRenameWithRetry(tmp, file, options);
55
+ } catch (error) {
56
+ try {
57
+ fs.rmSync(tmp, { force: true });
58
+ } catch {
59
+ }
60
+ throw error;
61
+ }
62
+ }
63
+
17
64
  const SAFELIST_HEADER = "# Auto-generated by csszyx \u2014 DO NOT EDIT\n# Tailwind scans this file for class names, one per line.\n";
18
65
  function renderSafelistFile(classNames) {
19
66
  if (classNames.length === 0) {
@@ -208,4 +255,4 @@ function cssImportsTailwind(code) {
208
255
  return TAILWIND_IMPORT.test(stripCssBlockComments(code));
209
256
  }
210
257
 
211
- export { SAFELIST_FILE as S, appendTailwindSourceDirective as a, cssImportsTailwind as b, computeSafelistRelPath as c, removeLegacySafelists as d, assertNoLegacySourceStylesheet as e, findPostcssConfigWithoutCsszyx as f, stripCssBlockComments as g, findLegacySourceDirective as h, legacySourceMessage as l, missingPostcssPluginMessage as m, normalizePathSeparators as n, renderSafelistFile as r, sortStrings as s };
258
+ export { SAFELIST_FILE as S, appendTailwindSourceDirective as a, cssImportsTailwind as b, computeSafelistRelPath as c, atomicWriteFileSync as d, removeLegacySafelists as e, findPostcssConfigWithoutCsszyx as f, assertNoLegacySourceStylesheet as g, stripCssBlockComments as h, findLegacySourceDirective as i, legacySourceMessage as l, missingPostcssPluginMessage as m, normalizePathSeparators as n, renderSafelistFile as r, sortStrings as s };
@@ -1,6 +1,6 @@
1
1
  import fs__default from 'node:fs';
2
2
  import path__default from 'node:path';
3
- import { s as sortStrings } from './unplugin.CqJS0BbD.mjs';
3
+ import { s as sortStrings } from './unplugin.DH_ij6cf.mjs';
4
4
 
5
5
  const EMPTY_THEME = {
6
6
  colors: [],
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('node:fs');
4
4
  const path = require('node:path');
5
- const safelistSource = require('./unplugin.KnDCM-sr.cjs');
5
+ const safelistSource = require('./unplugin.DDSWQJYX.cjs');
6
6
 
7
7
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
8
8
 
@@ -4,8 +4,8 @@ const fs = require('node:fs');
4
4
  const path = require('node:path');
5
5
  const compiler = require('@csszyx/compiler');
6
6
  const types = require('@csszyx/types');
7
- const transformCache = require('./unplugin.DX3rYT4P.cjs');
8
- const safelistSource = require('./unplugin.KnDCM-sr.cjs');
7
+ const transformCache = require('./unplugin.BzF0V2kw.cjs');
8
+ const safelistSource = require('./unplugin.DDSWQJYX.cjs');
9
9
  const node_crypto = require('node:crypto');
10
10
 
11
11
  function _interopNamespaceCompat(e) {
@@ -1,4 +1,4 @@
1
- import { a as NextSafelistMaterializeResult, b as NextSafelistStateLockOptions, A as AtomicWriteOptions } from './unplugin.C2ilavL1.mjs';
1
+ import { a as NextSafelistMaterializeResult, b as NextSafelistStateLockOptions, A as AtomicWriteOptions } from './unplugin.BGog1Bib.cjs';
2
2
 
3
3
  /** Options for one synchronous watcher materialization cycle. */
4
4
  interface NextWatcherCycleOptions {
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.BLbrShMZ.cjs');
5
+ const unplugin = require('./shared/unplugin.8KYddE6x.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -16,12 +16,12 @@ require('@csszyx/svelte-adapter');
16
16
  require('@csszyx/types');
17
17
  require('@csszyx/vue-adapter');
18
18
  require('unplugin');
19
- require('./shared/unplugin.DX3rYT4P.cjs');
20
- require('./shared/unplugin.KnDCM-sr.cjs');
19
+ require('./shared/unplugin.DDSWQJYX.cjs');
20
+ require('./shared/unplugin.BzF0V2kw.cjs');
21
21
  require('./css-mangler.cjs');
22
22
  require('postcss');
23
23
  require('postcss-selector-parser');
24
- require('./shared/unplugin.C7i0agiO.cjs');
24
+ require('./shared/unplugin.J6ue_lRJ.cjs');
25
25
  require('node:zlib');
26
26
  require('postcss-value-parser');
27
27
 
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { an } from './shared/unplugin.BHfqCocB.cjs';
1
+ import { an } from './shared/unplugin.BT7PqYuK.cjs';
2
2
  export = an;
3
3
  import '@csszyx/compiler';
4
4
  import '@csszyx/types';
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { an as default } from './shared/unplugin.BHfqCocB.mjs';
1
+ export { an as default } from './shared/unplugin.BT7PqYuK.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
- export { a1 as default } from './shared/unplugin.BGufkSFT.mjs';
1
+ export { a1 as default } from './shared/unplugin.D68hyqgb.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -12,11 +12,11 @@ import '@csszyx/svelte-adapter';
12
12
  import '@csszyx/types';
13
13
  import '@csszyx/vue-adapter';
14
14
  import 'unplugin';
15
- import './shared/unplugin.AGR7mihU.mjs';
16
- import './shared/unplugin.CqJS0BbD.mjs';
15
+ import './shared/unplugin.DH_ij6cf.mjs';
16
+ import './shared/unplugin.Bk9o8_RZ.mjs';
17
17
  import './css-mangler.mjs';
18
18
  import 'postcss';
19
19
  import 'postcss-selector-parser';
20
- import './shared/unplugin.BourSpnZ.mjs';
20
+ import './shared/unplugin.DK0b4fr7.mjs';
21
21
  import 'node:zlib';
22
22
  import 'postcss-value-parser';
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.BLbrShMZ.cjs');
5
+ const unplugin = require('./shared/unplugin.8KYddE6x.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -16,12 +16,12 @@ require('@csszyx/svelte-adapter');
16
16
  require('@csszyx/types');
17
17
  require('@csszyx/vue-adapter');
18
18
  require('unplugin');
19
- require('./shared/unplugin.DX3rYT4P.cjs');
20
- require('./shared/unplugin.KnDCM-sr.cjs');
19
+ require('./shared/unplugin.DDSWQJYX.cjs');
20
+ require('./shared/unplugin.BzF0V2kw.cjs');
21
21
  require('./css-mangler.cjs');
22
22
  require('postcss');
23
23
  require('postcss-selector-parser');
24
- require('./shared/unplugin.C7i0agiO.cjs');
24
+ require('./shared/unplugin.J6ue_lRJ.cjs');
25
25
  require('node:zlib');
26
26
  require('postcss-value-parser');
27
27
 
@@ -1,4 +1,4 @@
1
- import { ap } from './shared/unplugin.BHfqCocB.cjs';
1
+ import { ap } from './shared/unplugin.BT7PqYuK.cjs';
2
2
  export = ap;
3
3
  import '@csszyx/compiler';
4
4
  import '@csszyx/types';
@@ -1,4 +1,4 @@
1
- export { ap as default } from './shared/unplugin.BHfqCocB.mjs';
1
+ export { ap as default } from './shared/unplugin.BT7PqYuK.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
- export { a3 as default } from './shared/unplugin.BGufkSFT.mjs';
1
+ export { a3 as default } from './shared/unplugin.D68hyqgb.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -12,11 +12,11 @@ import '@csszyx/svelte-adapter';
12
12
  import '@csszyx/types';
13
13
  import '@csszyx/vue-adapter';
14
14
  import 'unplugin';
15
- import './shared/unplugin.AGR7mihU.mjs';
16
- import './shared/unplugin.CqJS0BbD.mjs';
15
+ import './shared/unplugin.DH_ij6cf.mjs';
16
+ import './shared/unplugin.Bk9o8_RZ.mjs';
17
17
  import './css-mangler.mjs';
18
18
  import 'postcss';
19
19
  import 'postcss-selector-parser';
20
- import './shared/unplugin.BourSpnZ.mjs';
20
+ import './shared/unplugin.DK0b4fr7.mjs';
21
21
  import 'node:zlib';
22
22
  import 'postcss-value-parser';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -127,14 +127,14 @@
127
127
  "postcss-value-parser": "^4.2.0",
128
128
  "proper-lockfile": "^4.1.2",
129
129
  "unplugin": "^3.3.0",
130
- "@csszyx/compiler": "0.15.0",
131
- "@csszyx/svelte-adapter": "0.15.0",
132
- "@csszyx/vue-adapter": "0.15.0",
133
- "@csszyx/core": "0.15.0",
134
- "@csszyx/types": "0.15.0"
130
+ "@csszyx/compiler": "0.15.1",
131
+ "@csszyx/svelte-adapter": "0.15.1",
132
+ "@csszyx/types": "0.15.1",
133
+ "@csszyx/vue-adapter": "0.15.1",
134
+ "@csszyx/core": "0.15.1"
135
135
  },
136
136
  "peerDependencies": {
137
- "@csszyx/runtime": "^0.15.0"
137
+ "@csszyx/runtime": "^0.15.1"
138
138
  },
139
139
  "devDependencies": {
140
140
  "@tailwindcss/node": "4.3.3",
@@ -147,8 +147,8 @@
147
147
  "vite": "^8.2.1",
148
148
  "vitest": "^4.1.10",
149
149
  "webpack": "^5.109.0",
150
- "@csszyx/runtime": "0.15.0",
151
- "@csszyx/tooling-metadata": "0.15.0"
150
+ "@csszyx/runtime": "0.15.1",
151
+ "@csszyx/tooling-metadata": "0.15.1"
152
152
  },
153
153
  "sideEffects": false,
154
154
  "engines": {