@csszyx/unplugin 0.11.11 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +11 -7
  3. package/dist/index.d.cts +4 -4
  4. package/dist/index.d.mts +4 -4
  5. package/dist/index.mjs +4 -3
  6. package/dist/next-config.cjs +3 -0
  7. package/dist/next-config.d.cts +10 -0
  8. package/dist/next-config.d.mts +10 -0
  9. package/dist/next-config.mjs +3 -0
  10. package/dist/next-prebuild.cjs +12 -5
  11. package/dist/next-prebuild.d.cts +7 -0
  12. package/dist/next-prebuild.d.mts +7 -0
  13. package/dist/next-prebuild.mjs +12 -5
  14. package/dist/next-turbo-loader.cjs +29 -59
  15. package/dist/next-turbo-loader.d.cts +10 -0
  16. package/dist/next-turbo-loader.d.mts +10 -0
  17. package/dist/next-turbo-loader.mjs +28 -58
  18. package/dist/next-watcher.cjs +1 -1
  19. package/dist/next-watcher.mjs +1 -1
  20. package/dist/shared/unplugin.4du3qMst.cjs +529 -0
  21. package/dist/shared/unplugin.5l4RHMQh.mjs +578 -0
  22. package/dist/shared/unplugin.BB0iWSds.mjs +495 -0
  23. package/dist/shared/{unplugin.DMcbmP01.mjs → unplugin.BU0O4IkX.mjs} +4 -1
  24. package/dist/shared/{unplugin.CJcFsJcf.cjs → unplugin.Bf4fNbp7.cjs} +452 -504
  25. package/dist/shared/{unplugin.BZq6FKn2.cjs → unplugin.CUTa6bY9.cjs} +89 -1
  26. package/dist/shared/{unplugin.DblMogcN.cjs → unplugin.Cji6O5jv.cjs} +4 -1
  27. package/dist/shared/{unplugin.-yLpX1Ck.mjs → unplugin.CogPHmDs.mjs} +73 -3
  28. package/dist/shared/{unplugin.BK7BIeBn.d.cts → unplugin.DCT7DDG6.d.cts} +88 -26
  29. package/dist/shared/{unplugin.BK7BIeBn.d.mts → unplugin.DCT7DDG6.d.mts} +88 -26
  30. package/dist/shared/unplugin.X9a9SL_s.cjs +612 -0
  31. package/dist/shared/{unplugin.B2RUVK6Z.mjs → unplugin.ymMe428s.mjs} +426 -477
  32. package/dist/vite.cjs +4 -3
  33. package/dist/vite.d.cts +2 -2
  34. package/dist/vite.d.mts +1 -1
  35. package/dist/vite.mjs +4 -3
  36. package/dist/webpack.cjs +4 -3
  37. package/dist/webpack.d.cts +2 -2
  38. package/dist/webpack.d.mts +1 -1
  39. package/dist/webpack.mjs +4 -3
  40. package/package.json +13 -11
  41. package/dist/shared/unplugin.CKIOVNOg.cjs +0 -241
  42. package/dist/shared/unplugin.Cnxm1DcC.cjs +0 -53
  43. package/dist/shared/unplugin.Lhzkcj-A.mjs +0 -49
  44. package/dist/shared/unplugin.fOnGXWgS.mjs +0 -217
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Vite, Webpack, and esbuild integration for CSSzyx.
4
4
 
5
- Build-time plugin that transforms `sz` props into Tailwind classes, generates static CSS, mangles class names in production, and injects hydration scripts for SSR.
5
+ Build-time plugin that transforms `sz` props into Tailwind classes, generates static CSS, optionally mangles class names in production (opt-in), and injects hydration scripts for SSR.
6
6
 
7
7
  ## Installation
8
8
 
package/dist/index.cjs CHANGED
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const cssMangler = require('./css-mangler.cjs');
6
- const unplugin = require('./shared/unplugin.CJcFsJcf.cjs');
6
+ const unplugin = require('./shared/unplugin.Bf4fNbp7.cjs');
7
+ const themeGroupsFile = require('./shared/unplugin.X9a9SL_s.cjs');
7
8
  const types = require('@csszyx/types');
8
9
  require('postcss');
9
10
  require('postcss-selector-parser');
@@ -19,9 +20,9 @@ require('@csszyx/core/native');
19
20
  require('@csszyx/svelte-adapter');
20
21
  require('@csszyx/vue-adapter');
21
22
  require('unplugin');
22
- require('./shared/unplugin.CKIOVNOg.cjs');
23
- require('./shared/unplugin.Cnxm1DcC.cjs');
23
+ require('./shared/unplugin.4du3qMst.cjs');
24
24
  require('./shared/unplugin.BkRah5Ot.cjs');
25
+ require('node:zlib');
25
26
  require('postcss-value-parser');
26
27
 
27
28
 
@@ -45,6 +46,7 @@ exports.cssHasContentScope = unplugin.cssHasContentScope;
45
46
  exports.cssImportsTailwind = unplugin.cssImportsTailwind;
46
47
  exports.default = unplugin.unplugin;
47
48
  exports.deleteRSCModuleRecord = unplugin.deleteRSCModuleRecord;
49
+ exports.emitMissingCssFallback = unplugin.emitMissingCssFallback;
48
50
  exports.esbuildPlugin = unplugin.esbuildPlugin;
49
51
  exports.extractGlobalVarAliasesForManifest = unplugin.extractGlobalVarAliasesForManifest;
50
52
  exports.fileMayContainSafelistableSz = unplugin.fileMayContainSafelistableSz;
@@ -52,7 +54,6 @@ exports.findLocalImportSources = unplugin.findLocalImportSources;
52
54
  exports.findRSCBoundaryViolation = unplugin.findRSCBoundaryViolation;
53
55
  exports.findRSCGraphViolation = unplugin.findRSCGraphViolation;
54
56
  exports.hasInjectableTailwindCandidate = unplugin.hasInjectableTailwindCandidate;
55
- exports.hasTokens = unplugin.hasTokens;
56
57
  exports.hasUseClientDirective = unplugin.hasUseClientDirective;
57
58
  exports.hasUseServerDirective = unplugin.hasUseServerDirective;
58
59
  exports.isCompileSourceOptedIn = unplugin.isCompileSourceOptedIn;
@@ -64,20 +65,19 @@ exports.isTailwindReservedGlobalVar = unplugin.isTailwindReservedGlobalVar;
64
65
  exports.mangleCodeClassesSync = unplugin.mangleCodeClassesSync;
65
66
  exports.mangleEligibleClasses = unplugin.mangleEligibleClasses;
66
67
  exports.mangleHybridHazardMessage = unplugin.mangleHybridHazardMessage;
67
- exports.mergeThemes = unplugin.mergeThemes;
68
68
  exports.missingTailwindEntryMessage = unplugin.missingTailwindEntryMessage;
69
69
  exports.normalizeGlobalVarAliasesForCache = unplugin.normalizeGlobalVarAliasesForCache;
70
- exports.parseThemeBlocks = unplugin.parseThemeBlocks;
71
70
  exports.planGlobalVarAliases = unplugin.planGlobalVarAliases;
72
71
  exports.readGlobalVarScanCache = unplugin.readGlobalVarScanCache;
73
72
  exports.recordGlobalVarSourceFile = unplugin.recordGlobalVarSourceFile;
74
73
  exports.resolveCompileSourceDirs = unplugin.resolveCompileSourceDirs;
75
74
  exports.resolveGlobalVarScanCacheDir = unplugin.resolveGlobalVarScanCacheDir;
76
75
  exports.resolveNativeCacheIdentity = unplugin.resolveNativeCacheIdentity;
76
+ exports.resolveQuietMode = unplugin.resolveQuietMode;
77
77
  exports.rewriteGlobalVarCssAliases = unplugin.rewriteGlobalVarCssAliases;
78
78
  exports.rollupPlugin = unplugin.rollupPlugin;
79
- exports.scanCustomPropertyNames = unplugin.scanCustomPropertyNames;
80
79
  exports.scanGlobalVarCss = unplugin.scanGlobalVarCss;
80
+ exports.shouldEmitMissingCssFallback = unplugin.shouldEmitMissingCssFallback;
81
81
  exports.shouldEmitWarning = unplugin.shouldEmitWarning;
82
82
  exports.shouldTrackGlobalVarSources = unplugin.shouldTrackGlobalVarSources;
83
83
  exports.shouldWarnMissingTailwindEntry = unplugin.shouldWarnMissingTailwindEntry;
@@ -89,5 +89,9 @@ exports.validateGlobalVarAliasInputs = unplugin.validateGlobalVarAliasInputs;
89
89
  exports.vitePlugin = unplugin.vitePlugin;
90
90
  exports.webpackPlugin = unplugin.webpackPlugin;
91
91
  exports.writeGlobalVarScanCache = unplugin.writeGlobalVarScanCache;
92
+ exports.hasTokens = themeGroupsFile.hasTokens;
93
+ exports.mergeThemes = themeGroupsFile.mergeThemes;
94
+ exports.parseThemeBlocks = themeGroupsFile.parseThemeBlocks;
95
+ exports.scanCustomPropertyNames = themeGroupsFile.scanCustomPropertyNames;
92
96
  exports.CSSZYX_GLOBAL_ALIAS_PREFIX = types.CSSZYX_GLOBAL_ALIAS_PREFIX;
93
97
  exports.TAILWIND_RESERVED_PREFIXES = types.TAILWIND_RESERVED_PREFIXES;
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.BK7BIeBn.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.DCT7DDG6.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 RSCBoundaryViolation, q as RSCModuleRecord, r as allocateMangleTokens, s as appendTailwindSourceDirective, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as computeSafelistRelPath, x as createGlobalVarMapAssetSource, y as createRSCModuleRecord, z as cssHasContentScope, A as cssImportsTailwind, D as deleteRSCModuleRecord, E as esbuildPlugin, F as extractGlobalVarAliasesForManifest, H as fileMayContainSafelistableSz, I as findLocalImportSources, J as findRSCBoundaryViolation, K as findRSCGraphViolation, L as hasInjectableTailwindCandidate, N as hasTokens, O as hasUseClientDirective, Q as hasUseServerDirective, T as isCompileSourceOptedIn, U as isHardIgnoredPath, W as isMonorepoPackage, X as isPackagesSkippedSource, Y as isRSCServerModule, Z as mangleCodeClassesSync, _ as mangleEligibleClasses, $ as mangleHybridHazardMessage, a0 as mergeThemes, a1 as missingTailwindEntryMessage, a2 as normalizeGlobalVarAliasesForCache, a3 as parseThemeBlocks, a4 as recordGlobalVarSourceFile, a5 as resolveCompileSourceDirs, a6 as resolveNativeCacheIdentity, a7 as rollupPlugin, a8 as scanCustomPropertyNames, a9 as shouldEmitWarning, aa as shouldTrackGlobalVarSources, ab as shouldWarnMissingTailwindEntry, ac as shouldWarnUnscopedMonorepo, ad as skippedSzFilesMessage, B as unplugin, ae as unscopedMonorepoMessage, af as vitePlugin, ag as webpackPlugin } from './shared/unplugin.BK7BIeBn.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, Q as QuietMode, p as RSCBoundaryViolation, q as RSCModuleRecord, r as allocateMangleTokens, s as appendTailwindSourceDirective, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as computeSafelistRelPath, x as createGlobalVarMapAssetSource, y as createRSCModuleRecord, z as cssHasContentScope, A as cssImportsTailwind, D as deleteRSCModuleRecord, E as emitMissingCssFallback, F as esbuildPlugin, H as extractGlobalVarAliasesForManifest, I as fileMayContainSafelistableSz, J as findLocalImportSources, K as findRSCBoundaryViolation, L as findRSCGraphViolation, N as hasInjectableTailwindCandidate, O as hasTokens, T as hasUseClientDirective, U as hasUseServerDirective, W as isCompileSourceOptedIn, X as isHardIgnoredPath, Y as isMonorepoPackage, Z as isPackagesSkippedSource, _ as isRSCServerModule, $ as mangleCodeClassesSync, a0 as mangleEligibleClasses, a1 as mangleHybridHazardMessage, a2 as mergeThemes, a3 as missingTailwindEntryMessage, a4 as normalizeGlobalVarAliasesForCache, a5 as parseThemeBlocks, a6 as recordGlobalVarSourceFile, a7 as resolveCompileSourceDirs, a8 as resolveNativeCacheIdentity, a9 as resolveQuietMode, aa as rollupPlugin, ab as scanCustomPropertyNames, ac as shouldEmitMissingCssFallback, ad as shouldEmitWarning, ae as shouldTrackGlobalVarSources, af as shouldWarnMissingTailwindEntry, ag as shouldWarnUnscopedMonorepo, ah as skippedSzFilesMessage, B as unplugin, ai as unscopedMonorepoMessage, aj as vitePlugin, ak as webpackPlugin } from './shared/unplugin.DCT7DDG6.cjs';
7
7
  import 'postcss';
8
8
  import '@csszyx/compiler';
9
9
  import 'esbuild';
@@ -15,7 +15,7 @@ import 'vite';
15
15
  * Resolves the global variable scan cache directory.
16
16
  *
17
17
  * @param cacheDir csszyx cache root.
18
- * @returns Cache directory for Phase H CSS scans.
18
+ * @returns Cache directory for global-variable CSS scans.
19
19
  */
20
20
  declare function resolveGlobalVarScanCacheDir(cacheDir: string): string;
21
21
  /**
@@ -78,7 +78,7 @@ declare function isTailwindReservedGlobalVar(name: string): boolean;
78
78
  declare function rewriteGlobalVarCssAliases(options: RewriteGlobalVarCssAliasesOptions): GlobalVarCssAliasRewriteResult;
79
79
 
80
80
  /**
81
- * Runs the Phase H pure validation pipeline without mutating build output.
81
+ * Runs the pure global-variable validation pipeline without mutating build output.
82
82
  *
83
83
  * @param options Validation input.
84
84
  * @returns CSS scans, alias plan, and JS/JSX out-of-band diagnostics.
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.BK7BIeBn.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 RSCBoundaryViolation, q as RSCModuleRecord, r as allocateMangleTokens, s as appendTailwindSourceDirective, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as computeSafelistRelPath, x as createGlobalVarMapAssetSource, y as createRSCModuleRecord, z as cssHasContentScope, A as cssImportsTailwind, B as default, D as deleteRSCModuleRecord, E as esbuildPlugin, F as extractGlobalVarAliasesForManifest, H as fileMayContainSafelistableSz, I as findLocalImportSources, J as findRSCBoundaryViolation, K as findRSCGraphViolation, L as hasInjectableTailwindCandidate, N as hasTokens, O as hasUseClientDirective, Q as hasUseServerDirective, T as isCompileSourceOptedIn, U as isHardIgnoredPath, W as isMonorepoPackage, X as isPackagesSkippedSource, Y as isRSCServerModule, Z as mangleCodeClassesSync, _ as mangleEligibleClasses, $ as mangleHybridHazardMessage, a0 as mergeThemes, a1 as missingTailwindEntryMessage, a2 as normalizeGlobalVarAliasesForCache, a3 as parseThemeBlocks, a4 as recordGlobalVarSourceFile, a5 as resolveCompileSourceDirs, a6 as resolveNativeCacheIdentity, a7 as rollupPlugin, a8 as scanCustomPropertyNames, a9 as shouldEmitWarning, aa as shouldTrackGlobalVarSources, ab as shouldWarnMissingTailwindEntry, ac as shouldWarnUnscopedMonorepo, ad as skippedSzFilesMessage, B as unplugin, ae as unscopedMonorepoMessage, af as vitePlugin, ag as webpackPlugin } from './shared/unplugin.BK7BIeBn.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.DCT7DDG6.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, Q as QuietMode, p as RSCBoundaryViolation, q as RSCModuleRecord, r as allocateMangleTokens, s as appendTailwindSourceDirective, t as assertNoRSCBoundaryViolation, u as assertNoRSCGraphViolation, v as collectMangleHybridHazards, w as computeSafelistRelPath, x as createGlobalVarMapAssetSource, y as createRSCModuleRecord, z as cssHasContentScope, A as cssImportsTailwind, B as default, D as deleteRSCModuleRecord, E as emitMissingCssFallback, F as esbuildPlugin, H as extractGlobalVarAliasesForManifest, I as fileMayContainSafelistableSz, J as findLocalImportSources, K as findRSCBoundaryViolation, L as findRSCGraphViolation, N as hasInjectableTailwindCandidate, O as hasTokens, T as hasUseClientDirective, U as hasUseServerDirective, W as isCompileSourceOptedIn, X as isHardIgnoredPath, Y as isMonorepoPackage, Z as isPackagesSkippedSource, _ as isRSCServerModule, $ as mangleCodeClassesSync, a0 as mangleEligibleClasses, a1 as mangleHybridHazardMessage, a2 as mergeThemes, a3 as missingTailwindEntryMessage, a4 as normalizeGlobalVarAliasesForCache, a5 as parseThemeBlocks, a6 as recordGlobalVarSourceFile, a7 as resolveCompileSourceDirs, a8 as resolveNativeCacheIdentity, a9 as resolveQuietMode, aa as rollupPlugin, ab as scanCustomPropertyNames, ac as shouldEmitMissingCssFallback, ad as shouldEmitWarning, ae as shouldTrackGlobalVarSources, af as shouldWarnMissingTailwindEntry, ag as shouldWarnUnscopedMonorepo, ah as skippedSzFilesMessage, B as unplugin, ai as unscopedMonorepoMessage, aj as vitePlugin, ak as webpackPlugin } from './shared/unplugin.DCT7DDG6.mjs';
5
5
  import 'postcss';
6
6
  import '@csszyx/compiler';
7
7
  import 'esbuild';
@@ -13,7 +13,7 @@ import 'vite';
13
13
  * Resolves the global variable scan cache directory.
14
14
  *
15
15
  * @param cacheDir csszyx cache root.
16
- * @returns Cache directory for Phase H CSS scans.
16
+ * @returns Cache directory for global-variable CSS scans.
17
17
  */
18
18
  declare function resolveGlobalVarScanCacheDir(cacheDir: string): string;
19
19
  /**
@@ -76,7 +76,7 @@ declare function isTailwindReservedGlobalVar(name: string): boolean;
76
76
  declare function rewriteGlobalVarCssAliases(options: RewriteGlobalVarCssAliasesOptions): GlobalVarCssAliasRewriteResult;
77
77
 
78
78
  /**
79
- * Runs the Phase H pure validation pipeline without mutating build output.
79
+ * Runs the pure global-variable validation pipeline without mutating build output.
80
80
  *
81
81
  * @param options Validation input.
82
82
  * @returns CSS scans, alias plan, and JS/JSX out-of-band diagnostics.
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
- export { a as allocateMangleTokens, b as appendTailwindSourceDirective, c as assertNoRSCBoundaryViolation, d as assertNoRSCGraphViolation, e as collectMangleHybridHazards, f as computeSafelistRelPath, g as createGlobalVarAliasValidationOptions, h as createGlobalVarMapAssetSource, i as createGlobalVarScanCacheKey, j as createRSCModuleRecord, k as cssHasContentScope, l as cssImportsTailwind, u as default, m as deleteRSCModuleRecord, n as esbuildPlugin, o as extractGlobalVarAliasesForManifest, p as fileMayContainSafelistableSz, q as findLocalImportSources, r as findRSCBoundaryViolation, s as findRSCGraphViolation, t as hasInjectableTailwindCandidate, v as hasTokens, w as hasUseClientDirective, x as hasUseServerDirective, y as isCompileSourceOptedIn, z as isHardIgnoredPath, A as isMonorepoPackage, B as isPackagesSkippedSource, C as isRSCServerModule, D as isTailwindReservedGlobalVar, E as mangleCodeClassesSync, F as mangleEligibleClasses, G as mangleHybridHazardMessage, H as mergeThemes, I as missingTailwindEntryMessage, J as normalizeGlobalVarAliasesForCache, K as parseThemeBlocks, L as planGlobalVarAliases, M as readGlobalVarScanCache, N as recordGlobalVarSourceFile, O as resolveCompileSourceDirs, P as resolveGlobalVarScanCacheDir, Q as resolveNativeCacheIdentity, R as rewriteGlobalVarCssAliases, S as rollupPlugin, T as scanCustomPropertyNames, U as scanGlobalVarCss, V as shouldEmitWarning, W as shouldTrackGlobalVarSources, X as shouldWarnMissingTailwindEntry, Y as shouldWarnUnscopedMonorepo, Z as skippedSzFilesMessage, u as unplugin, _ as unscopedMonorepoMessage, $ as validateGlobalVarAliasInputs, a0 as vitePlugin, a1 as webpackPlugin, a2 as writeGlobalVarScanCache } from './shared/unplugin.B2RUVK6Z.mjs';
2
+ export { a as allocateMangleTokens, b as appendTailwindSourceDirective, c as assertNoRSCBoundaryViolation, d as assertNoRSCGraphViolation, e as collectMangleHybridHazards, f as computeSafelistRelPath, g as createGlobalVarAliasValidationOptions, h as createGlobalVarMapAssetSource, i as createGlobalVarScanCacheKey, j as createRSCModuleRecord, k as cssHasContentScope, l as cssImportsTailwind, u as default, m as deleteRSCModuleRecord, n as emitMissingCssFallback, o as esbuildPlugin, p as extractGlobalVarAliasesForManifest, q as fileMayContainSafelistableSz, r as findLocalImportSources, s as findRSCBoundaryViolation, t as findRSCGraphViolation, v as hasInjectableTailwindCandidate, w as hasUseClientDirective, x as hasUseServerDirective, y as isCompileSourceOptedIn, z as isHardIgnoredPath, A as isMonorepoPackage, B as isPackagesSkippedSource, C as isRSCServerModule, D as isTailwindReservedGlobalVar, E as mangleCodeClassesSync, F as mangleEligibleClasses, G as mangleHybridHazardMessage, H as missingTailwindEntryMessage, I as normalizeGlobalVarAliasesForCache, J as planGlobalVarAliases, K as readGlobalVarScanCache, L as recordGlobalVarSourceFile, M as resolveCompileSourceDirs, N as resolveGlobalVarScanCacheDir, O as resolveNativeCacheIdentity, P as resolveQuietMode, Q as rewriteGlobalVarCssAliases, R as rollupPlugin, S as scanGlobalVarCss, T as shouldEmitMissingCssFallback, U as shouldEmitWarning, V as shouldTrackGlobalVarSources, W as shouldWarnMissingTailwindEntry, X as shouldWarnUnscopedMonorepo, Y as skippedSzFilesMessage, u as unplugin, Z as unscopedMonorepoMessage, _ as validateGlobalVarAliasInputs, $ as vitePlugin, a0 as webpackPlugin, a1 as writeGlobalVarScanCache } from './shared/unplugin.ymMe428s.mjs';
3
+ export { h as hasTokens, m as mergeThemes, p as parseThemeBlocks, s as scanCustomPropertyNames } from './shared/unplugin.5l4RHMQh.mjs';
3
4
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
4
5
  import 'postcss';
5
6
  import 'postcss-selector-parser';
@@ -15,7 +16,7 @@ import '@csszyx/core/native';
15
16
  import '@csszyx/svelte-adapter';
16
17
  import '@csszyx/vue-adapter';
17
18
  import 'unplugin';
18
- import './shared/unplugin.fOnGXWgS.mjs';
19
- import './shared/unplugin.Lhzkcj-A.mjs';
19
+ import './shared/unplugin.BB0iWSds.mjs';
20
20
  import './shared/unplugin.B3XoSRB8.mjs';
21
+ import 'node:zlib';
21
22
  import 'postcss-value-parser';
@@ -4,6 +4,9 @@ function csszyxTurbopack(existing = {}, options = {}) {
4
4
  const { glob = "*.tsx", parserMode = "rust", safelistOutputFile } = options;
5
5
  const config = options.config ?? { mangleVars: false };
6
6
  const loaderOptions = { parserMode, config };
7
+ if (options.importedStaticSz !== void 0) {
8
+ loaderOptions.importedStaticSz = options.importedStaticSz;
9
+ }
7
10
  if (safelistOutputFile !== void 0) {
8
11
  loaderOptions.safelistOutputFile = safelistOutputFile;
9
12
  }
@@ -32,6 +32,16 @@ interface CsszyxTurbopackOptions {
32
32
  config?: Record<string, unknown>;
33
33
  /** Glob the loader applies to. Defaults to `'*.tsx'` (whole app). */
34
34
  glob?: string;
35
+ /**
36
+ * Compile a plain exported sz object into the modules that import it.
37
+ *
38
+ * On unless set. Whatever it is here, the prebuild must resolve it the
39
+ * same way — it writes the safelist for the classes the loader emits, so a
40
+ * lane that resolves more than the other emits class names with no rule.
41
+ * To turn it off, pass `false` here AND `--no-imported-static-sz` to
42
+ * `csszyx next prebuild` and `csszyx next watch`.
43
+ */
44
+ importedStaticSz?: boolean;
35
45
  }
36
46
  /** Minimal shape of a Next.js `turbopack` config block (only what we touch). */
37
47
  interface TurbopackConfig {
@@ -32,6 +32,16 @@ interface CsszyxTurbopackOptions {
32
32
  config?: Record<string, unknown>;
33
33
  /** Glob the loader applies to. Defaults to `'*.tsx'` (whole app). */
34
34
  glob?: string;
35
+ /**
36
+ * Compile a plain exported sz object into the modules that import it.
37
+ *
38
+ * On unless set. Whatever it is here, the prebuild must resolve it the
39
+ * same way — it writes the safelist for the classes the loader emits, so a
40
+ * lane that resolves more than the other emits class names with no rule.
41
+ * To turn it off, pass `false` here AND `--no-imported-static-sz` to
42
+ * `csszyx next prebuild` and `csszyx next watch`.
43
+ */
44
+ importedStaticSz?: boolean;
35
45
  }
36
46
  /** Minimal shape of a Next.js `turbopack` config block (only what we touch). */
37
47
  interface TurbopackConfig {
@@ -2,6 +2,9 @@ function csszyxTurbopack(existing = {}, options = {}) {
2
2
  const { glob = "*.tsx", parserMode = "rust", safelistOutputFile } = options;
3
3
  const config = options.config ?? { mangleVars: false };
4
4
  const loaderOptions = { parserMode, config };
5
+ if (options.importedStaticSz !== void 0) {
6
+ loaderOptions.importedStaticSz = options.importedStaticSz;
7
+ }
5
8
  if (safelistOutputFile !== void 0) {
6
9
  loaderOptions.safelistOutputFile = safelistOutputFile;
7
10
  }
@@ -3,10 +3,11 @@
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.BZq6FKn2.cjs');
7
- const nextWatcherCycle = require('./shared/unplugin.DblMogcN.cjs');
8
- const transformCache = require('./shared/unplugin.CKIOVNOg.cjs');
6
+ const nextTransformMetadata = require('./shared/unplugin.CUTa6bY9.cjs');
7
+ const nextWatcherCycle = require('./shared/unplugin.Cji6O5jv.cjs');
8
+ const transformCache = require('./shared/unplugin.4du3qMst.cjs');
9
9
  require('@csszyx/compiler');
10
+ require('@csszyx/types');
10
11
  require('./shared/unplugin.BkRah5Ot.cjs');
11
12
  require('node:os');
12
13
  require('proper-lockfile');
@@ -39,7 +40,7 @@ function runNextPrebuild(options) {
39
40
  cwd: options.cwd,
40
41
  cacheDir: options.cacheDir,
41
42
  safelistOutputFile: options.safelistOutputFile,
42
- config: options.config ?? {},
43
+ config: nextTransformMetadata.configWithImportedStaticSz(options.config ?? {}, options.importedStaticSz),
43
44
  env: options.env ?? process.env,
44
45
  envKeys: options.envKeys,
45
46
  nextVersion,
@@ -62,11 +63,17 @@ function runNextPrebuild(options) {
62
63
  continue;
63
64
  }
64
65
  const source = fs.readFileSync(filename, "utf8");
66
+ const crossModule = nextTransformMetadata.resolveNextCrossModule({
67
+ filename,
68
+ source,
69
+ root: context.root,
70
+ importedStaticSz: options.importedStaticSz
71
+ });
65
72
  const transform = nextTransformMetadata.transformNextSource({
66
73
  source,
67
74
  filename,
68
75
  parserMode: options.parserMode ?? "rust",
69
- compilerOptions: options.compilerOptions,
76
+ compilerOptions: nextTransformMetadata.withCrossModuleStatics(options.compilerOptions, crossModule.statics),
70
77
  cacheRoot,
71
78
  pluginVersion: csszyxVersion,
72
79
  compilerVersion,
@@ -14,6 +14,13 @@ interface NextPrebuildOptions {
14
14
  safelistOutputFile?: string;
15
15
  parserMode?: NextSourceParserMode;
16
16
  compilerOptions?: TransformSourceCodeOptions;
17
+ /**
18
+ * Whether a plain exported sz object may be compiled into its importers.
19
+ *
20
+ * Must match what the Turbopack loader is given: this pass writes the
21
+ * safelist the loader's emitted classes rely on.
22
+ */
23
+ importedStaticSz?: boolean;
17
24
  config?: JsonLike;
18
25
  env?: Record<string, string | undefined>;
19
26
  envKeys?: readonly string[];
@@ -14,6 +14,13 @@ interface NextPrebuildOptions {
14
14
  safelistOutputFile?: string;
15
15
  parserMode?: NextSourceParserMode;
16
16
  compilerOptions?: TransformSourceCodeOptions;
17
+ /**
18
+ * Whether a plain exported sz object may be compiled into its importers.
19
+ *
20
+ * Must match what the Turbopack loader is given: this pass writes the
21
+ * safelist the loader's emitted classes rely on.
22
+ */
23
+ importedStaticSz?: boolean;
17
24
  config?: JsonLike;
18
25
  env?: Record<string, string | undefined>;
19
26
  envKeys?: readonly string[];
@@ -1,10 +1,11 @@
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.-yLpX1Ck.mjs';
5
- import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.DMcbmP01.mjs';
6
- import { r as resolveTransformCacheDir, n as normalizePathSeparators } from './shared/unplugin.fOnGXWgS.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.CogPHmDs.mjs';
5
+ import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.BU0O4IkX.mjs';
6
+ import { r as resolveTransformCacheDir, n as normalizePathSeparators } from './shared/unplugin.BB0iWSds.mjs';
7
7
  import '@csszyx/compiler';
8
+ import '@csszyx/types';
8
9
  import './shared/unplugin.B3XoSRB8.mjs';
9
10
  import 'node:os';
10
11
  import 'proper-lockfile';
@@ -22,7 +23,7 @@ function runNextPrebuild(options) {
22
23
  cwd: options.cwd,
23
24
  cacheDir: options.cacheDir,
24
25
  safelistOutputFile: options.safelistOutputFile,
25
- config: options.config ?? {},
26
+ config: configWithImportedStaticSz(options.config ?? {}, options.importedStaticSz),
26
27
  env: options.env ?? process.env,
27
28
  envKeys: options.envKeys,
28
29
  nextVersion,
@@ -45,11 +46,17 @@ function runNextPrebuild(options) {
45
46
  continue;
46
47
  }
47
48
  const source = readFileSync(filename, "utf8");
49
+ const crossModule = resolveNextCrossModule({
50
+ filename,
51
+ source,
52
+ root: context.root,
53
+ importedStaticSz: options.importedStaticSz
54
+ });
48
55
  const transform = transformNextSource({
49
56
  source,
50
57
  filename,
51
58
  parserMode: options.parserMode ?? "rust",
52
- compilerOptions: options.compilerOptions,
59
+ compilerOptions: withCrossModuleStatics(options.compilerOptions, crossModule.statics),
53
60
  cacheRoot,
54
61
  pluginVersion: csszyxVersion,
55
62
  compilerVersion,
@@ -4,15 +4,16 @@ 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 nextWatcherCycle = require('./shared/unplugin.DblMogcN.cjs');
8
- const nextTransformMetadata = require('./shared/unplugin.BZq6FKn2.cjs');
9
- const runtimeImportScan = require('./shared/unplugin.Cnxm1DcC.cjs');
10
- const transformCache = require('./shared/unplugin.CKIOVNOg.cjs');
7
+ const themeGroupsFile = require('./shared/unplugin.X9a9SL_s.cjs');
8
+ const nextTransformMetadata = require('./shared/unplugin.CUTa6bY9.cjs');
9
+ const nextWatcherCycle = require('./shared/unplugin.Cji6O5jv.cjs');
10
+ const transformCache = require('./shared/unplugin.4du3qMst.cjs');
11
11
  require('node:fs');
12
- require('node:os');
13
- require('proper-lockfile');
14
12
  require('./shared/unplugin.BkRah5Ot.cjs');
15
13
  require('@csszyx/compiler');
14
+ require('@csszyx/types');
15
+ require('node:os');
16
+ require('proper-lockfile');
16
17
 
17
18
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
18
19
  function _interopNamespaceCompat(e) {
@@ -29,54 +30,6 @@ function _interopNamespaceCompat(e) {
29
30
 
30
31
  const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
31
32
 
32
- function injectNextRuntimeImports(code, usage) {
33
- const helpers = runtimeHelpersFromUsage(usage);
34
- if (helpers.length === 0) {
35
- return { code, injected: [] };
36
- }
37
- const hasRuntimeImport = code.includes("@csszyx/runtime");
38
- const missing = hasRuntimeImport ? helpers.filter((helper) => !runtimeImportScan.importsRuntimeHelper(code, helper)) : helpers;
39
- if (missing.length === 0) {
40
- return { code, injected: [] };
41
- }
42
- return {
43
- code: insertRuntimeImport(
44
- code,
45
- `import { ${missing.join(", ")} } from '@csszyx/runtime';
46
- `
47
- ),
48
- injected: missing
49
- };
50
- }
51
- function runtimeHelpersFromUsage(usage) {
52
- const helpers = [];
53
- if (usage.usesRuntime) {
54
- helpers.push("_sz");
55
- }
56
- if (usage.usesMerge) {
57
- helpers.push("_szMerge");
58
- }
59
- if (usage.usesSzcn) {
60
- helpers.push("_szcn");
61
- }
62
- if (usage.usesSzPart) {
63
- helpers.push("_szPart");
64
- }
65
- if (usage.usesColorVar) {
66
- helpers.push("__szColorVar");
67
- }
68
- if (usage.usesSpacingVar) {
69
- helpers.push("__szSpacingVar");
70
- }
71
- if (usage.usesUnitVar) {
72
- helpers.push("__szUnitVar");
73
- }
74
- return helpers;
75
- }
76
- function insertRuntimeImport(code, importStmt) {
77
- return runtimeImportScan.insertAfterUseDirective(code, importStmt);
78
- }
79
-
80
33
  function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
81
34
  const options = normalizeOptions(loaderContext, explicitOptions);
82
35
  assertTurbopackMangleBoundary(options, loaderContext.resourcePath);
@@ -86,7 +39,7 @@ function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
86
39
  loaderContext: loaderContext.context,
87
40
  cacheDir: options.cacheDir,
88
41
  safelistOutputFile: options.safelistOutputFile,
89
- config: options.config ?? {},
42
+ config: nextTransformMetadata.configWithImportedStaticSz(options.config ?? {}, options.importedStaticSz),
90
43
  env: options.env ?? process.env,
91
44
  envKeys: options.envKeys,
92
45
  nextVersion: options.nextVersion ?? "unknown-next",
@@ -95,11 +48,17 @@ function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
95
48
  mode: options.mode ?? normalizeMode(loaderContext.mode)
96
49
  });
97
50
  assertProductionManifestReady(context, options);
51
+ const crossModule = nextTransformMetadata.resolveNextCrossModule({
52
+ filename: loaderContext.resourcePath,
53
+ source,
54
+ root: context.root,
55
+ importedStaticSz: options.importedStaticSz
56
+ });
98
57
  const transform = nextTransformMetadata.transformNextSource({
99
58
  source,
100
59
  filename: loaderContext.resourcePath,
101
60
  parserMode: options.parserMode ?? "rust",
102
- compilerOptions: options.compilerOptions,
61
+ compilerOptions: nextTransformMetadata.withCrossModuleStatics(options.compilerOptions, crossModule.statics),
103
62
  cacheRoot: transformCache.resolveTransformCacheDir(
104
63
  context.root,
105
64
  path__namespace.relative(context.root, context.cacheDir)
@@ -109,7 +68,18 @@ function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
109
68
  astBudget: options.astBudget,
110
69
  allowBabelFallback: options.allowBabelFallback
111
70
  });
112
- const injected = injectNextRuntimeImports(transform.result.code, transform.result);
71
+ const injected = themeGroupsFile.injectNextRuntimeImports(transform.result.code, transform.result);
72
+ const callsSzcn = transform.result.usesSzcn || /\bszcn\s*\(/.test(source);
73
+ const themeGroups = callsSzcn ? themeGroupsFile.ensureThemeGroupsFile(context.root, path__namespace.join(context.root, ".csszyx")) : { file: null, watch: [] };
74
+ for (const stylesheet of themeGroups.watch) loaderContext.addDependency?.(stylesheet);
75
+ for (const provider of nextTransformMetadata.normalizeProviderPaths(crossModule.providers)) {
76
+ loaderContext.addDependency?.(provider);
77
+ }
78
+ const code = themeGroups.file === null ? injected.code : themeGroupsFile.insertAfterUseDirective(
79
+ injected.code,
80
+ `import '${themeGroupsFile.themeGroupsSpecifier(loaderContext.resourcePath, themeGroups.file)}';
81
+ `
82
+ );
113
83
  const metadata = nextTransformMetadata.collectNextTransformMetadata(
114
84
  transform.result,
115
85
  source,
@@ -135,12 +105,12 @@ function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
135
105
  materialized = true;
136
106
  }
137
107
  return {
138
- code: injected.code,
108
+ code,
139
109
  context,
140
110
  transform,
141
111
  shardPath,
142
112
  materialized,
143
- dependencies: []
113
+ dependencies: themeGroups.watch
144
114
  };
145
115
  }
146
116
  function nextTurboLoader(source) {
@@ -22,6 +22,16 @@ interface NextTurboLoaderOptions {
22
22
  allowProductionMangling?: boolean;
23
23
  materializeSafelist?: boolean;
24
24
  writeOptions?: AtomicWriteOptions;
25
+ /**
26
+ * Whether a plain exported sz object may be compiled into its importers.
27
+ *
28
+ * The same setting the other lanes spell `build.importedStaticSz`, on
29
+ * unless given, and `csszyx next prebuild` has to resolve it identically —
30
+ * the prebuild is what safelists the classes the loader then emits, so a
31
+ * lane that resolves more than the other would emit class names with no
32
+ * rule behind them.
33
+ */
34
+ importedStaticSz?: boolean;
25
35
  }
26
36
  /** Minimal Webpack-compatible loader context used by Turbopack. */
27
37
  interface NextTurboLoaderContext {
@@ -22,6 +22,16 @@ interface NextTurboLoaderOptions {
22
22
  allowProductionMangling?: boolean;
23
23
  materializeSafelist?: boolean;
24
24
  writeOptions?: AtomicWriteOptions;
25
+ /**
26
+ * Whether a plain exported sz object may be compiled into its importers.
27
+ *
28
+ * The same setting the other lanes spell `build.importedStaticSz`, on
29
+ * unless given, and `csszyx next prebuild` has to resolve it identically —
30
+ * the prebuild is what safelists the classes the loader then emits, so a
31
+ * lane that resolves more than the other would emit class names with no
32
+ * rule behind them.
33
+ */
34
+ importedStaticSz?: boolean;
25
35
  }
26
36
  /** Minimal Webpack-compatible loader context used by Turbopack. */
27
37
  interface NextTurboLoaderContext {