@csszyx/unplugin 0.16.0 → 0.17.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 (54) hide show
  1. package/README.md +1 -1
  2. package/dist/index.cjs +15 -4
  3. package/dist/index.d.cts +2 -2
  4. package/dist/index.d.mts +2 -2
  5. package/dist/index.mjs +14 -4
  6. package/dist/jest-transform.cjs +186 -0
  7. package/dist/jest-transform.d.cts +112 -0
  8. package/dist/jest-transform.d.mts +110 -0
  9. package/dist/jest-transform.mjs +175 -0
  10. package/dist/next-prebuild.cjs +7 -6
  11. package/dist/next-prebuild.d.cts +12 -2
  12. package/dist/next-prebuild.d.mts +12 -2
  13. package/dist/next-prebuild.mjs +6 -5
  14. package/dist/next-turbo-loader.cjs +11 -9
  15. package/dist/next-turbo-loader.d.cts +1 -1
  16. package/dist/next-turbo-loader.d.mts +1 -1
  17. package/dist/next-turbo-loader.mjs +8 -6
  18. package/dist/next-watcher.cjs +124 -15
  19. package/dist/next-watcher.d.cts +16 -3
  20. package/dist/next-watcher.d.mts +16 -3
  21. package/dist/next-watcher.mjs +124 -15
  22. package/dist/shared/{unplugin.C-oQU1jl.mjs → unplugin.2uf-U76p.mjs} +1 -1
  23. package/dist/shared/{unplugin.BWnmKv07.cjs → unplugin.BKID6KXV.cjs} +5 -1
  24. package/dist/shared/{unplugin.PKo7wFzu.d.cts → unplugin.BO2_hyS3.d.cts} +38 -5
  25. package/dist/shared/{unplugin.DH_ij6cf.mjs → unplugin.Ba3O1r8M.mjs} +2 -6
  26. package/dist/shared/unplugin.BqKLlo1h.cjs +8 -0
  27. package/dist/shared/{unplugin.Vn9x8SBP.mjs → unplugin.C3bgc29e.mjs} +3 -2
  28. package/dist/shared/{unplugin.Ceq-N4jI.mjs → unplugin.CK-DfKTP.mjs} +21 -111
  29. package/dist/shared/{unplugin.COlI0dJs.d.mts → unplugin.C_2R8vIk.d.cts} +1 -1
  30. package/dist/shared/unplugin.CcSfaIVx.mjs +13547 -0
  31. package/dist/shared/{unplugin.rWOMecQs.d.cts → unplugin.CfXjAV63.d.mts} +1 -1
  32. package/dist/shared/{unplugin.J6ue_lRJ.cjs → unplugin.D0tMgokL.cjs} +24 -115
  33. package/dist/shared/{unplugin.DDSWQJYX.cjs → unplugin.DS6CFjim.cjs} +3 -8
  34. package/dist/shared/{unplugin.gksolKh2.cjs → unplugin.DXzIP7lP.cjs} +5 -4
  35. package/dist/shared/unplugin.DZdsqdQa.cjs +13635 -0
  36. package/dist/shared/unplugin.DcXM9sq5.mjs +109 -0
  37. package/dist/shared/unplugin.Defu9wGh.cjs +115 -0
  38. package/dist/shared/{unplugin.Bu2rzRtv.d.mts → unplugin.DptK3pl4.d.mts} +38 -5
  39. package/dist/shared/{unplugin.BGog1Bib.d.cts → unplugin.XdPo6azz.d.cts} +3 -0
  40. package/dist/shared/{unplugin.BGog1Bib.d.mts → unplugin.XdPo6azz.d.mts} +3 -0
  41. package/dist/shared/{unplugin.BzF0V2kw.cjs → unplugin.YcnV3Izb.cjs} +6 -6
  42. package/dist/shared/{unplugin.BLptVbUe.mjs → unplugin.eCo7_znv.mjs} +4 -2
  43. package/dist/shared/unplugin.wMeicb6E.mjs +6 -0
  44. package/dist/vite.cjs +14 -4
  45. package/dist/vite.d.cts +2 -2
  46. package/dist/vite.d.mts +1 -1
  47. package/dist/vite.mjs +14 -4
  48. package/dist/webpack.cjs +14 -4
  49. package/dist/webpack.d.cts +1 -2
  50. package/dist/webpack.d.mts +1 -1
  51. package/dist/webpack.mjs +14 -4
  52. package/package.json +22 -11
  53. package/dist/shared/unplugin.D3yBoTHP.cjs +0 -5462
  54. package/dist/shared/unplugin.Dx0ngYWw.mjs +0 -5381
@@ -0,0 +1,109 @@
1
+ const LEADING_WHITESPACE_RE = /^\s+/;
2
+ const LINE_COMMENT_RE = /^\/\/[^\n]*(?:\n|$)/;
3
+ const BLOCK_COMMENT_RE = /^\/\*[\s\S]*?\*\//;
4
+ const USE_DIRECTIVE_RE = /^['"]use (?:client|server)['"];?\s*/;
5
+ function insertAfterUseDirective(code, insertion) {
6
+ let offset = 0;
7
+ while (offset < code.length) {
8
+ const triviaLength = leadingTriviaLength(code.slice(offset));
9
+ if (triviaLength === 0) break;
10
+ offset += triviaLength;
11
+ }
12
+ const directive = USE_DIRECTIVE_RE.exec(code.slice(offset));
13
+ if (!directive) return `${insertion}${code}`;
14
+ const insertionOffset = offset + directive[0].length;
15
+ return `${code.slice(0, insertionOffset)}${insertion}${code.slice(insertionOffset)}`;
16
+ }
17
+ function leadingTriviaLength(source) {
18
+ return LEADING_WHITESPACE_RE.exec(source)?.[0].length ?? LINE_COMMENT_RE.exec(source)?.[0].length ?? BLOCK_COMMENT_RE.exec(source)?.[0].length ?? 0;
19
+ }
20
+
21
+ const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
22
+ function clauseNames(clauseBody) {
23
+ const names = [];
24
+ for (const part of clauseBody.split(",")) {
25
+ const trimmed = part.trim();
26
+ if (!trimmed) {
27
+ continue;
28
+ }
29
+ const spaceAt = trimmed.search(/\s/);
30
+ names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
31
+ }
32
+ return names;
33
+ }
34
+ function importsRuntimeHelper(code, helper) {
35
+ RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
36
+ for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
37
+ if (clauseNames(match[1]).includes(helper)) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ }
43
+ const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
44
+ function findRuntimeImportClause(code) {
45
+ const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
46
+ return match ? { statement: match[0], prefixWithBody: match[1] } : null;
47
+ }
48
+
49
+ function runtimeHelperGroupsFromUsage(usage) {
50
+ const slim = usage.usesSzPart === true && usage.szPartArgsProvable === true && usage.usesRuntime !== true && usage.usesMerge !== true;
51
+ const groups = { all: [], barrel: [], merge: [] };
52
+ const append = (helper, toMerge = false) => {
53
+ groups.all.push(helper);
54
+ (toMerge ? groups.merge : groups.barrel).push(helper);
55
+ };
56
+ if (usage.usesRuntime) append("_sz");
57
+ if (usage.usesMerge) append("_szMerge");
58
+ if (usage.usesSzcn) append("_szcn", slim);
59
+ if (usage.usesSzPart) append("_szPart", slim);
60
+ if (usage.usesSzvPick) append("__szvPick");
61
+ if (usage.usesSzvPick1) append("__szvPick1");
62
+ if (usage.usesColorVar) append("__szColorVar");
63
+ if (usage.usesSpacingVar) append("__szSpacingVar");
64
+ if (usage.usesUnitVar) append("__szUnitVar");
65
+ if (usage.usesBoolClass) append("__szBoolClass");
66
+ return groups;
67
+ }
68
+ function injectNextRuntimeImports(code, usage) {
69
+ const groups = runtimeHelperGroupsFromUsage(usage);
70
+ const helpers = groups.all;
71
+ if (helpers.length === 0) {
72
+ return { code, injected: [] };
73
+ }
74
+ const hasRuntimeImport = code.includes("@csszyx/runtime");
75
+ const missing = hasRuntimeImport ? helpers.filter((helper) => !importsRuntimeHelper(code, helper)) : helpers;
76
+ if (missing.length === 0) {
77
+ return { code, injected: [] };
78
+ }
79
+ if (groups.merge.length > 0) {
80
+ const mergeHelpers = missing.filter((helper) => groups.merge.includes(helper));
81
+ const barrelHelpers = missing.filter((helper) => groups.barrel.includes(helper));
82
+ let next = insertRuntimeImport(
83
+ code,
84
+ `import { ${mergeHelpers.join(", ")} } from '@csszyx/runtime/merge';
85
+ `
86
+ );
87
+ if (barrelHelpers.length > 0) {
88
+ next = insertRuntimeImport(
89
+ next,
90
+ `import { ${barrelHelpers.join(", ")} } from '@csszyx/runtime';
91
+ `
92
+ );
93
+ }
94
+ return { code: next, injected: missing };
95
+ }
96
+ return {
97
+ code: insertRuntimeImport(
98
+ code,
99
+ `import { ${missing.join(", ")} } from '@csszyx/runtime';
100
+ `
101
+ ),
102
+ injected: missing
103
+ };
104
+ }
105
+ function insertRuntimeImport(code, importStmt) {
106
+ return insertAfterUseDirective(code, importStmt);
107
+ }
108
+
109
+ export { insertAfterUseDirective as a, importsRuntimeHelper as b, findRuntimeImportClause as f, injectNextRuntimeImports as i, runtimeHelperGroupsFromUsage as r };
@@ -0,0 +1,115 @@
1
+ 'use strict';
2
+
3
+ const LEADING_WHITESPACE_RE = /^\s+/;
4
+ const LINE_COMMENT_RE = /^\/\/[^\n]*(?:\n|$)/;
5
+ const BLOCK_COMMENT_RE = /^\/\*[\s\S]*?\*\//;
6
+ const USE_DIRECTIVE_RE = /^['"]use (?:client|server)['"];?\s*/;
7
+ function insertAfterUseDirective(code, insertion) {
8
+ let offset = 0;
9
+ while (offset < code.length) {
10
+ const triviaLength = leadingTriviaLength(code.slice(offset));
11
+ if (triviaLength === 0) break;
12
+ offset += triviaLength;
13
+ }
14
+ const directive = USE_DIRECTIVE_RE.exec(code.slice(offset));
15
+ if (!directive) return `${insertion}${code}`;
16
+ const insertionOffset = offset + directive[0].length;
17
+ return `${code.slice(0, insertionOffset)}${insertion}${code.slice(insertionOffset)}`;
18
+ }
19
+ function leadingTriviaLength(source) {
20
+ return LEADING_WHITESPACE_RE.exec(source)?.[0].length ?? LINE_COMMENT_RE.exec(source)?.[0].length ?? BLOCK_COMMENT_RE.exec(source)?.[0].length ?? 0;
21
+ }
22
+
23
+ const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
24
+ function clauseNames(clauseBody) {
25
+ const names = [];
26
+ for (const part of clauseBody.split(",")) {
27
+ const trimmed = part.trim();
28
+ if (!trimmed) {
29
+ continue;
30
+ }
31
+ const spaceAt = trimmed.search(/\s/);
32
+ names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
33
+ }
34
+ return names;
35
+ }
36
+ function importsRuntimeHelper(code, helper) {
37
+ RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
38
+ for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
39
+ if (clauseNames(match[1]).includes(helper)) {
40
+ return true;
41
+ }
42
+ }
43
+ return false;
44
+ }
45
+ const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
46
+ function findRuntimeImportClause(code) {
47
+ const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
48
+ return match ? { statement: match[0], prefixWithBody: match[1] } : null;
49
+ }
50
+
51
+ function runtimeHelperGroupsFromUsage(usage) {
52
+ const slim = usage.usesSzPart === true && usage.szPartArgsProvable === true && usage.usesRuntime !== true && usage.usesMerge !== true;
53
+ const groups = { all: [], barrel: [], merge: [] };
54
+ const append = (helper, toMerge = false) => {
55
+ groups.all.push(helper);
56
+ (toMerge ? groups.merge : groups.barrel).push(helper);
57
+ };
58
+ if (usage.usesRuntime) append("_sz");
59
+ if (usage.usesMerge) append("_szMerge");
60
+ if (usage.usesSzcn) append("_szcn", slim);
61
+ if (usage.usesSzPart) append("_szPart", slim);
62
+ if (usage.usesSzvPick) append("__szvPick");
63
+ if (usage.usesSzvPick1) append("__szvPick1");
64
+ if (usage.usesColorVar) append("__szColorVar");
65
+ if (usage.usesSpacingVar) append("__szSpacingVar");
66
+ if (usage.usesUnitVar) append("__szUnitVar");
67
+ if (usage.usesBoolClass) append("__szBoolClass");
68
+ return groups;
69
+ }
70
+ function injectNextRuntimeImports(code, usage) {
71
+ const groups = runtimeHelperGroupsFromUsage(usage);
72
+ const helpers = groups.all;
73
+ if (helpers.length === 0) {
74
+ return { code, injected: [] };
75
+ }
76
+ const hasRuntimeImport = code.includes("@csszyx/runtime");
77
+ const missing = hasRuntimeImport ? helpers.filter((helper) => !importsRuntimeHelper(code, helper)) : helpers;
78
+ if (missing.length === 0) {
79
+ return { code, injected: [] };
80
+ }
81
+ if (groups.merge.length > 0) {
82
+ const mergeHelpers = missing.filter((helper) => groups.merge.includes(helper));
83
+ const barrelHelpers = missing.filter((helper) => groups.barrel.includes(helper));
84
+ let next = insertRuntimeImport(
85
+ code,
86
+ `import { ${mergeHelpers.join(", ")} } from '@csszyx/runtime/merge';
87
+ `
88
+ );
89
+ if (barrelHelpers.length > 0) {
90
+ next = insertRuntimeImport(
91
+ next,
92
+ `import { ${barrelHelpers.join(", ")} } from '@csszyx/runtime';
93
+ `
94
+ );
95
+ }
96
+ return { code: next, injected: missing };
97
+ }
98
+ return {
99
+ code: insertRuntimeImport(
100
+ code,
101
+ `import { ${missing.join(", ")} } from '@csszyx/runtime';
102
+ `
103
+ ),
104
+ injected: missing
105
+ };
106
+ }
107
+ function insertRuntimeImport(code, importStmt) {
108
+ return insertAfterUseDirective(code, importStmt);
109
+ }
110
+
111
+ exports.findRuntimeImportClause = findRuntimeImportClause;
112
+ exports.importsRuntimeHelper = importsRuntimeHelper;
113
+ exports.injectNextRuntimeImports = injectNextRuntimeImports;
114
+ exports.insertAfterUseDirective = insertAfterUseDirective;
115
+ exports.runtimeHelperGroupsFromUsage = runtimeHelperGroupsFromUsage;
@@ -523,6 +523,14 @@ interface PluginState {
523
523
  * by a raw selector consumer.
524
524
  */
525
525
  ownedClasses: Set<string>;
526
+ /**
527
+ * Owned classes that a mangle map WOULD carry: `ownedClasses` minus the
528
+ * authored ones and minus `manglePreserve`. Recorded whether or not
529
+ * mangling runs, because the bundle manifest lists them either way and used
530
+ * to read them off the map's keys — which is why the map had to be
531
+ * allocated on a build that never mangles.
532
+ */
533
+ mangleEligible: string[];
526
534
  /**
527
535
  * Classes written through author-facing class/className attributes. Any
528
536
  * overlap with ownedClasses must keep its original name because bundled
@@ -751,9 +759,18 @@ declare function unscopedMonorepoMessage(): string;
751
759
  /**
752
760
  * Whether a diagnostic is an advisory one — the class a build may hold back.
753
761
  *
754
- * Spread warnings, budget bails and `missing-css` fallbacks all describe absent
755
- * output and print regardless. What is left says the runtime path was taken
756
- * where a compiled one was possible: real, worth acting on, and not a failure.
762
+ * Advisory means one thing: the styles are THERE, and the note is about how
763
+ * they got there. An `sz`-site nudge fallback took the runtime path where a
764
+ * compiled one was possible; the precedence advisory says which of two sources
765
+ * won. Everything else describes output that is absent or dead, and a
766
+ * production build has to print it.
767
+ *
768
+ * Asked positively on purpose. The predicate used to be "not one of three known
769
+ * kinds", which quietly made every key and value diagnostic advisory: a
770
+ * production build of a file with five typo'd keys printed nothing but a census
771
+ * calling them fallbacks, while `csszyx check` on the same tree named all six.
772
+ * A classifier written by exclusion cannot stay right as diagnostics are added,
773
+ * because a new one joins the silent side by default.
757
774
  *
758
775
  * @param message - One raw diagnostic line as an engine emitted it.
759
776
  * @returns True when the diagnostic is advisory rather than a build result.
@@ -772,7 +789,7 @@ declare function isAdvisoryDiagnostic(message: string): boolean;
772
789
  * Suppression is the right default; implying zero is not. One line costs
773
790
  * nothing and keeps the difference visible.
774
791
  *
775
- * @param count - Advisory fallbacks the build declined to list.
792
+ * @param count - Advisory notes the build declined to list.
776
793
  * @returns The disclosure, or null when nothing was held back.
777
794
  */
778
795
  declare function suppressedAdvisoryMessage(count: number): string | null;
@@ -807,6 +824,22 @@ declare function resolveQuietMode(quiet: boolean | 'nudges' | QuietMode | undefi
807
824
  * @returns true when the warning should be printed.
808
825
  */
809
826
  declare function shouldEmitWarning(quiet: QuietMode, devOnly: boolean, isProduction: boolean): boolean;
827
+ /**
828
+ * Emit one key or value diagnostic — the family that says a class is dead.
829
+ *
830
+ * Its own channel because the two that existed both answer a different
831
+ * question: `emitMissingCssFallback` handles fallback sites, and the advisory
832
+ * channel handles notes about styles that ARE present. A typo'd key matched
833
+ * neither, so a production build dropped it on the floor while `csszyx check`
834
+ * on the same tree exited 1 and named it. Muted only by `quiet: true`, on the
835
+ * same reasoning as the missing-css channel: wrong output is not a usage nudge.
836
+ *
837
+ * @param quiet - Resolved quiet mode.
838
+ * @param message - Compiler diagnostic to classify and emit.
839
+ * @param id - Bundler module identifier included in the warning.
840
+ * @param emit - Warning output channel.
841
+ */
842
+ declare function emitKeyValueDiagnostic(quiet: QuietMode, message: string, id: string, emit: (message: string) => void): void;
810
843
  /**
811
844
  * Whether a transform diagnostic describes missing CSS and may be printed.
812
845
  *
@@ -1079,5 +1112,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
1079
1112
  */
1080
1113
  declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
1081
1114
 
1082
- export { isRSCServerModule as $, unplugin as A, deleteRSCModuleRecord as B, emitMissingCssFallback as D, esbuildPlugin as E, extractGlobalVarAliasesForManifest as F, fileMayContainSafelistableSz as H, findLocalImportSources as I, findRSCBoundaryViolation as J, findRSCGraphViolation as K, hasInjectableTailwindCandidate as L, hasTokens as N, hasUseClientDirective as O, hasUseServerDirective as T, isAdvisoryDiagnostic as U, isCompileSourceOptedIn as W, isHardIgnoredPath as X, isMangleableCssId as Y, isMonorepoPackage as Z, isPackagesSkippedSource as _, lateMangleCensusMessage as a0, mangleCodeClassesSync as a1, mangleEligibleClasses as a2, mangleHybridHazardMessage as a3, mergeThemes as a4, missingTailwindEntryMessage as a5, normalizeGlobalVarAliasesForCache as a6, parseThemeBlocks as a7, parseUtilityBlocks as a8, realContentHashDisabledMessage as a9, recordGlobalVarSourceFile as aa, resolveCompileSourceDirs as ab, resolveNativeCacheIdentity as ac, resolveQuietMode as ad, rollupPlugin as ae, scanCustomPropertyNames as af, shouldEmitMissingCssFallback as ag, shouldEmitWarning as ah, shouldHoldAdvisories as ai, shouldTrackGlobalVarSources as aj, shouldWarnMissingTailwindEntry as ak, shouldWarnUnscopedMonorepo as al, skippedSzFilesMessage as am, suppressedAdvisoryMessage as an, unscopedMonorepoMessage as ao, vitePlugin as ap, watchModeMangleMessage as aq, webpackPlugin as ar, allocateMangleTokens as t, assertNoRSCBoundaryViolation as u, assertNoRSCGraphViolation as v, collectMangleHybridHazards as w, createGlobalVarMapAssetSource as x, createRSCModuleRecord as y, cssHasContentScope as z };
1115
+ export { isPackagesSkippedSource as $, unplugin as A, deleteRSCModuleRecord as B, emitKeyValueDiagnostic as D, emitMissingCssFallback as E, esbuildPlugin as F, extractGlobalVarAliasesForManifest as H, fileMayContainSafelistableSz as I, findLocalImportSources as J, findRSCBoundaryViolation as K, findRSCGraphViolation as L, hasInjectableTailwindCandidate as N, hasTokens as O, hasUseClientDirective as T, hasUseServerDirective as U, isAdvisoryDiagnostic as W, isCompileSourceOptedIn as X, isHardIgnoredPath as Y, isMangleableCssId as Z, isMonorepoPackage as _, isRSCServerModule as a0, lateMangleCensusMessage as a1, mangleCodeClassesSync as a2, mangleEligibleClasses as a3, mangleHybridHazardMessage as a4, mergeThemes as a5, missingTailwindEntryMessage as a6, normalizeGlobalVarAliasesForCache as a7, parseThemeBlocks as a8, parseUtilityBlocks as a9, realContentHashDisabledMessage as aa, recordGlobalVarSourceFile as ab, resolveCompileSourceDirs as ac, resolveNativeCacheIdentity as ad, resolveQuietMode as ae, rollupPlugin as af, scanCustomPropertyNames as ag, shouldEmitMissingCssFallback as ah, shouldEmitWarning as ai, shouldHoldAdvisories as aj, shouldTrackGlobalVarSources as ak, shouldWarnMissingTailwindEntry as al, shouldWarnUnscopedMonorepo as am, skippedSzFilesMessage as an, suppressedAdvisoryMessage as ao, unscopedMonorepoMessage as ap, vitePlugin as aq, watchModeMangleMessage as ar, webpackPlugin as as, allocateMangleTokens as t, assertNoRSCBoundaryViolation as u, assertNoRSCGraphViolation as v, collectMangleHybridHazards as w, createGlobalVarMapAssetSource as x, createRSCModuleRecord as y, cssHasContentScope as z };
1083
1116
  export type { CssVarScanResult as C, GlobalVarScanCacheKeyInput as G, MangleHybridHazards as M, PlanGlobalVarAliasesInput as P, QuietMode as Q, RewriteGlobalVarCssAliasesOptions as R, ScanGlobalVarCssOptions as S, ValidateGlobalVarAliasInputsOptions as V, GlobalVarAliasPlan as a, GlobalVarCssAliasRewriteResult as b, CreateGlobalVarAliasValidationOptionsInput as c, GlobalVarAliasValidationResult as d, CssVarDefinition as e, CssVarLocation as f, CssVarReference as g, GlobalVarAliasDiagnostic as h, GlobalVarAliasDiagnosticSeverity as i, GlobalVarAliasEntry as j, GlobalVarCodeSource as k, GlobalVarCssAssetSource as l, GlobalVarCssSource as m, GlobalVarScanCacheEntry as n, MangleSelectorHazard as o, ParsedTheme as p, ParsedUtilities as q, RSCBoundaryViolation as r, RSCModuleRecord as s };
@@ -44,6 +44,8 @@ interface NextSafelistStateLockOptions {
44
44
  hostname?: string;
45
45
  token?: string;
46
46
  }
47
+ /** The `command` a `csszyx next watch` process records on the lock. */
48
+ declare const NEXT_WATCH_LOCK_COMMAND = "csszyx next watch";
47
49
 
48
50
  /** Mode represented by a Next Turbopack generation manifest. */
49
51
  type NextGenerationMode = 'development' | 'production';
@@ -77,4 +79,5 @@ interface NextStateContext {
77
79
  manifestExpectation: NextGenerationManifestExpectation;
78
80
  }
79
81
 
82
+ export { NEXT_WATCH_LOCK_COMMAND as c };
80
83
  export type { AtomicWriteOptions as A, JsonLike as J, NextStateContext as N, NextSafelistMaterializeResult as a, NextSafelistStateLockOptions as b };
@@ -44,6 +44,8 @@ interface NextSafelistStateLockOptions {
44
44
  hostname?: string;
45
45
  token?: string;
46
46
  }
47
+ /** The `command` a `csszyx next watch` process records on the lock. */
48
+ declare const NEXT_WATCH_LOCK_COMMAND = "csszyx next watch";
47
49
 
48
50
  /** Mode represented by a Next Turbopack generation manifest. */
49
51
  type NextGenerationMode = 'development' | 'production';
@@ -77,4 +79,5 @@ interface NextStateContext {
77
79
  manifestExpectation: NextGenerationManifestExpectation;
78
80
  }
79
81
 
82
+ export { NEXT_WATCH_LOCK_COMMAND as c };
80
83
  export type { AtomicWriteOptions as A, JsonLike as J, NextStateContext as N, NextSafelistMaterializeResult as a, NextSafelistStateLockOptions as b };
@@ -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.DDSWQJYX.cjs');
5
+ const pathNormalization = require('./unplugin.BqKLlo1h.cjs');
6
6
  const fs = require('node:fs');
7
7
  const node_crypto = require('node:crypto');
8
8
 
@@ -111,12 +111,12 @@ function aliasedSpecifierBases(specifier, aliases) {
111
111
  continue;
112
112
  }
113
113
  if (!specifier.startsWith(alias.find)) continue;
114
- bases.push(safelistSource.normalizePathSeparators(alias.replacement + specifier.slice(alias.find.length)));
114
+ bases.push(pathNormalization.normalizePathSeparators(alias.replacement + specifier.slice(alias.find.length)));
115
115
  }
116
116
  return bases;
117
117
  }
118
118
  function absolute(directory, target) {
119
- const resolved = safelistSource.normalizePathSeparators(path__namespace.resolve(directory, target));
119
+ const resolved = pathNormalization.normalizePathSeparators(path__namespace.resolve(directory, target));
120
120
  const declaredTrailingSlash = target.endsWith("/") || target.endsWith("\\");
121
121
  return declaredTrailingSlash && !resolved.endsWith("/") ? `${resolved}/` : resolved;
122
122
  }
@@ -185,7 +185,7 @@ function recordSzObjectRegistryFile(registry, filePath, content) {
185
185
  );
186
186
  }
187
187
  function replaceEntriesOfKind(registry, filePath, kind, entries) {
188
- const key = safelistSource.normalizePathSeparators(filePath);
188
+ const key = pathNormalization.normalizePathSeparators(filePath);
189
189
  const byName = emptyNameIndex();
190
190
  for (const [name, recorded] of Object.entries(registry.get(key) ?? {})) {
191
191
  if (recorded.kind !== kind) byName[name] = recorded;
@@ -207,7 +207,7 @@ const EMITTED_EXTENSION_SOURCES = [
207
207
  [".cjs", [".cts"]]
208
208
  ];
209
209
  function recordCrossModuleForwards(index, filePath, content) {
210
- const key = safelistSource.normalizePathSeparators(filePath);
210
+ const key = pathNormalization.normalizePathSeparators(filePath);
211
211
  const forwards = compiler.extractCrossModuleForwards(content, filePath);
212
212
  if (forwards.length === 0) index.delete(key);
213
213
  else index.set(key, forwards);
@@ -317,7 +317,7 @@ function importedSpecifiersIn(source) {
317
317
  }
318
318
  function specifierBases(specifier, directory, aliases) {
319
319
  if (specifier.startsWith(".")) {
320
- return [safelistSource.normalizePathSeparators(path__namespace.resolve(directory, specifier))];
320
+ return [pathNormalization.normalizePathSeparators(path__namespace.resolve(directory, specifier))];
321
321
  }
322
322
  return aliasedSpecifierBases(specifier, aliases);
323
323
  }
@@ -1,6 +1,6 @@
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
+ import { S as SAFELIST_FILE, d as atomicWriteFileSync, s as sortStrings, r as renderSafelistFile, e as removeLegacySafelists, g as assertNoLegacySourceStylesheet } from './unplugin.Ba3O1r8M.mjs';
4
4
  import { createHash, randomUUID } from 'node:crypto';
5
5
  import { hostname } from 'node:os';
6
6
  import lockfile from 'proper-lockfile';
@@ -306,6 +306,8 @@ class NextSafelistStateLockedError extends Error {
306
306
  }
307
307
  }
308
308
  const NEXT_WATCH_LOCK_COMMAND = "csszyx next watch";
309
+ const NEXT_TURBO_LOADER_LOCK_COMMAND = "csszyx next turbo-loader";
310
+ const NEXT_PREBUILD_LOCK_COMMAND = "csszyx next prebuild";
309
311
  function formatLiveLockError(metadata) {
310
312
  return [
311
313
  `csszyx Next safelist state is already locked by process ${metadata.pid}.`,
@@ -573,4 +575,4 @@ function runNextWatcherCycle(context, options = {}) {
573
575
  }
574
576
  }
575
577
 
576
- export { NextSafelistStateLockedError as N, NEXT_WATCH_LOCK_COMMAND as a, readNextGenerationManifest as b, createNextStateContext as c, runNextWatcherCycle as r, validateNextGenerationManifest as v, writeNextSafelistShard as w };
578
+ export { NEXT_PREBUILD_LOCK_COMMAND as N, NEXT_TURBO_LOADER_LOCK_COMMAND as a, NextSafelistStateLockedError as b, createNextStateContext as c, NEXT_WATCH_LOCK_COMMAND as d, readNextGenerationManifest as e, runNextWatcherCycle as r, validateNextGenerationManifest as v, writeNextSafelistShard as w };
@@ -0,0 +1,6 @@
1
+ const WINDOWS_PATH_SEPARATOR = String.fromCodePoint(92);
2
+ function normalizePathSeparators(value) {
3
+ return value.split(WINDOWS_PATH_SEPARATOR).join("/");
4
+ }
5
+
6
+ export { normalizePathSeparators as n };
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.D3yBoTHP.cjs');
5
+ const unplugin = require('./shared/unplugin.DZdsqdQa.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -16,13 +16,23 @@ require('@csszyx/svelte-adapter');
16
16
  require('@csszyx/types');
17
17
  require('@csszyx/vue-adapter');
18
18
  require('unplugin');
19
- require('./shared/unplugin.DDSWQJYX.cjs');
20
- require('./shared/unplugin.BzF0V2kw.cjs');
19
+ require('./shared/unplugin.DS6CFjim.cjs');
20
+ require('./shared/unplugin.BqKLlo1h.cjs');
21
+ require('./shared/unplugin.YcnV3Izb.cjs');
21
22
  require('./css-mangler.cjs');
22
23
  require('postcss');
23
24
  require('postcss-selector-parser');
24
- require('./shared/unplugin.J6ue_lRJ.cjs');
25
+ require('./shared/unplugin.Defu9wGh.cjs');
26
+ require('./shared/unplugin.D0tMgokL.cjs');
25
27
  require('node:zlib');
28
+ require('node:fs/promises');
29
+ require('os');
30
+ require('path');
31
+ require('util');
32
+ require('stream');
33
+ require('events');
34
+ require('fs');
35
+ require('@csszyx/runtime/split');
26
36
  require('postcss-value-parser');
27
37
 
28
38
 
package/dist/vite.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { ap } from './shared/unplugin.PKo7wFzu.cjs';
2
- export = ap;
1
+ import { aq } from './shared/unplugin.BO2_hyS3.cjs';
2
+ export = aq;
3
3
  import '@csszyx/compiler';
4
4
  import '@csszyx/types';
5
5
  import 'esbuild';
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { ap as default } from './shared/unplugin.Bu2rzRtv.mjs';
1
+ export { aq as default } from './shared/unplugin.DptK3pl4.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 { a2 as default } from './shared/unplugin.Dx0ngYWw.mjs';
1
+ export { a3 as default } from './shared/unplugin.CcSfaIVx.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -12,11 +12,21 @@ import '@csszyx/svelte-adapter';
12
12
  import '@csszyx/types';
13
13
  import '@csszyx/vue-adapter';
14
14
  import 'unplugin';
15
- import './shared/unplugin.DH_ij6cf.mjs';
16
- import './shared/unplugin.C-oQU1jl.mjs';
15
+ import './shared/unplugin.Ba3O1r8M.mjs';
16
+ import './shared/unplugin.wMeicb6E.mjs';
17
+ import './shared/unplugin.2uf-U76p.mjs';
17
18
  import './css-mangler.mjs';
18
19
  import 'postcss';
19
20
  import 'postcss-selector-parser';
20
- import './shared/unplugin.Ceq-N4jI.mjs';
21
+ import './shared/unplugin.DcXM9sq5.mjs';
22
+ import './shared/unplugin.CK-DfKTP.mjs';
21
23
  import 'node:zlib';
24
+ import 'node:fs/promises';
25
+ import 'os';
26
+ import 'path';
27
+ import 'util';
28
+ import 'stream';
29
+ import 'events';
30
+ import 'fs';
31
+ import '@csszyx/runtime/split';
22
32
  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.D3yBoTHP.cjs');
5
+ const unplugin = require('./shared/unplugin.DZdsqdQa.cjs');
6
6
  require('node:crypto');
7
7
  require('node:fs');
8
8
  require('node:module');
@@ -16,13 +16,23 @@ require('@csszyx/svelte-adapter');
16
16
  require('@csszyx/types');
17
17
  require('@csszyx/vue-adapter');
18
18
  require('unplugin');
19
- require('./shared/unplugin.DDSWQJYX.cjs');
20
- require('./shared/unplugin.BzF0V2kw.cjs');
19
+ require('./shared/unplugin.DS6CFjim.cjs');
20
+ require('./shared/unplugin.BqKLlo1h.cjs');
21
+ require('./shared/unplugin.YcnV3Izb.cjs');
21
22
  require('./css-mangler.cjs');
22
23
  require('postcss');
23
24
  require('postcss-selector-parser');
24
- require('./shared/unplugin.J6ue_lRJ.cjs');
25
+ require('./shared/unplugin.Defu9wGh.cjs');
26
+ require('./shared/unplugin.D0tMgokL.cjs');
25
27
  require('node:zlib');
28
+ require('node:fs/promises');
29
+ require('os');
30
+ require('path');
31
+ require('util');
32
+ require('stream');
33
+ require('events');
34
+ require('fs');
35
+ require('@csszyx/runtime/split');
26
36
  require('postcss-value-parser');
27
37
 
28
38
 
@@ -1,5 +1,4 @@
1
- import { ar } from './shared/unplugin.PKo7wFzu.cjs';
2
- export = ar;
1
+ export { as as default } from './shared/unplugin.BO2_hyS3.cjs';
3
2
  import '@csszyx/compiler';
4
3
  import '@csszyx/types';
5
4
  import 'esbuild';
@@ -1,4 +1,4 @@
1
- export { ar as default } from './shared/unplugin.Bu2rzRtv.mjs';
1
+ export { as as default } from './shared/unplugin.DptK3pl4.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 { a4 as default } from './shared/unplugin.Dx0ngYWw.mjs';
1
+ export { a5 as default } from './shared/unplugin.CcSfaIVx.mjs';
2
2
  import 'node:crypto';
3
3
  import 'node:fs';
4
4
  import 'node:module';
@@ -12,11 +12,21 @@ import '@csszyx/svelte-adapter';
12
12
  import '@csszyx/types';
13
13
  import '@csszyx/vue-adapter';
14
14
  import 'unplugin';
15
- import './shared/unplugin.DH_ij6cf.mjs';
16
- import './shared/unplugin.C-oQU1jl.mjs';
15
+ import './shared/unplugin.Ba3O1r8M.mjs';
16
+ import './shared/unplugin.wMeicb6E.mjs';
17
+ import './shared/unplugin.2uf-U76p.mjs';
17
18
  import './css-mangler.mjs';
18
19
  import 'postcss';
19
20
  import 'postcss-selector-parser';
20
- import './shared/unplugin.Ceq-N4jI.mjs';
21
+ import './shared/unplugin.DcXM9sq5.mjs';
22
+ import './shared/unplugin.CK-DfKTP.mjs';
21
23
  import 'node:zlib';
24
+ import 'node:fs/promises';
25
+ import 'os';
26
+ import 'path';
27
+ import 'util';
28
+ import 'stream';
29
+ import 'events';
30
+ import 'fs';
31
+ import '@csszyx/runtime/split';
22
32
  import 'postcss-value-parser';