@csszyx/unplugin 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -10
- package/dist/index.cjs +9 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/next-config.d.cts +3 -2
- package/dist/next-config.d.mts +3 -2
- package/dist/next-prebuild.cjs +3 -4
- package/dist/next-prebuild.d.cts +1 -2
- package/dist/next-prebuild.d.mts +1 -2
- package/dist/next-prebuild.mjs +3 -4
- package/dist/next-turbo-loader.cjs +5 -7
- package/dist/next-turbo-loader.d.cts +1 -2
- package/dist/next-turbo-loader.d.mts +1 -2
- package/dist/next-turbo-loader.mjs +5 -7
- package/dist/shared/{unplugin.CXV7fOa2.d.cts → unplugin.B32Exn-K.d.cts} +2 -2
- package/dist/shared/{unplugin.CXV7fOa2.d.mts → unplugin.B32Exn-K.d.mts} +2 -2
- package/dist/shared/{unplugin.CUTa6bY9.cjs → unplugin.BJiWWF6w.cjs} +5 -23
- package/dist/shared/{unplugin.4du3qMst.cjs → unplugin.BKGCkMgM.cjs} +4 -10
- package/dist/shared/{unplugin.5l4RHMQh.mjs → unplugin.BcsvXjIV.mjs} +1 -0
- package/dist/shared/{unplugin.DCT7DDG6.d.cts → unplugin.BsjD3mtb.d.cts} +91 -4
- package/dist/shared/{unplugin.DCT7DDG6.d.mts → unplugin.BsjD3mtb.d.mts} +91 -4
- package/dist/shared/{unplugin.X9a9SL_s.cjs → unplugin.CkNQjA4G.cjs} +1 -0
- package/dist/shared/{unplugin.BB0iWSds.mjs → unplugin.DKcwO8O4.mjs} +5 -10
- package/dist/shared/{unplugin.CogPHmDs.mjs → unplugin.DjRylBC_.mjs} +6 -24
- package/dist/shared/{unplugin.Bf4fNbp7.cjs → unplugin.ZMa9YE1H.cjs} +309 -89
- package/dist/shared/{unplugin.ymMe428s.mjs → unplugin.gR_h2DVG.mjs} +303 -89
- package/dist/vite.cjs +3 -3
- package/dist/vite.d.cts +2 -2
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +3 -3
- package/dist/webpack.cjs +3 -3
- package/dist/webpack.d.cts +2 -2
- package/dist/webpack.d.mts +1 -1
- package/dist/webpack.mjs +3 -3
- package/package.json +9 -9
|
@@ -458,6 +458,14 @@ interface PluginState {
|
|
|
458
458
|
authoredClasses: Set<string>;
|
|
459
459
|
/** Unresolvable-spread warnings surfaced to the build log in every mode. */
|
|
460
460
|
spreadWarnings: Set<string>;
|
|
461
|
+
/**
|
|
462
|
+
* Advisory sz fallbacks this build declined to list.
|
|
463
|
+
*
|
|
464
|
+
* Counted so the build can say the list is partial. Printing nothing is not
|
|
465
|
+
* the same as printing "nothing happened", and a log that names five
|
|
466
|
+
* fallbacks while holding three back reads as a total.
|
|
467
|
+
*/
|
|
468
|
+
suppressedAdvisories: number;
|
|
461
469
|
/**
|
|
462
470
|
* Workspace-package files under `/packages/` that use csszyx but were
|
|
463
471
|
* skipped by the hard-ignore (not under any `compileSources` dir). Surfaced at
|
|
@@ -627,10 +635,10 @@ declare function collectMangleHybridHazards(mangleMap: Record<string, string>, m
|
|
|
627
635
|
declare function mangleHybridHazardMessage(hazards: MangleHybridHazards): string | null;
|
|
628
636
|
/**
|
|
629
637
|
* Whether a CSS module scopes Tailwind's content detection — `source(none)` or
|
|
630
|
-
* `source("…")` on
|
|
638
|
+
* `source("…")` on a `@import "tailwindcss"`, or any `@source not` exclusion.
|
|
631
639
|
* A plain additive `@source "…"` does NOT count: it only adds a path, it does
|
|
632
|
-
* not stop the automatic
|
|
633
|
-
*
|
|
640
|
+
* not stop the automatic scan. Block comments are stripped first so a
|
|
641
|
+
* commented-out directive does not count.
|
|
634
642
|
*
|
|
635
643
|
* @param code - CSS module source.
|
|
636
644
|
* @returns true when the entry scopes (or excludes from) content detection.
|
|
@@ -663,9 +671,51 @@ declare function shouldWarnUnscopedMonorepo(sawTailwindEntry: boolean, tailwindE
|
|
|
663
671
|
/**
|
|
664
672
|
* Build the unscoped-monorepo warning message: what is wrong, why it matters,
|
|
665
673
|
* the exact two-line fix, the guide link, and how to silence it.
|
|
674
|
+
*
|
|
675
|
+
* Describes the detection BASE rather than promising a climb to the workspace
|
|
676
|
+
* root. Measured on a workspace package built through the Vite plugin, the scan
|
|
677
|
+
* was rooted at the Vite root: files beside the entry were scanned, the sibling
|
|
678
|
+
* package and the workspace root were not. Naming a worse failure than the one
|
|
679
|
+
* that is happening is how an advisory gets discounted — a reader who checks
|
|
680
|
+
* for phantom classes from sibling packages finds none and stops believing the
|
|
681
|
+
* rest of the message.
|
|
682
|
+
*
|
|
683
|
+
* The suggested snippet carries no CSS comment on purpose. A block comment ends
|
|
684
|
+
* at the first `*` followed by `/`, which any recursive glob contains, so
|
|
685
|
+
* inviting the reader to annotate `@source` lines invites a stylesheet that
|
|
686
|
+
* stops parsing where they documented it.
|
|
687
|
+
*
|
|
666
688
|
* @returns the warning string.
|
|
667
689
|
*/
|
|
668
690
|
declare function unscopedMonorepoMessage(): string;
|
|
691
|
+
/**
|
|
692
|
+
* Whether a diagnostic is an advisory one — the class a build may hold back.
|
|
693
|
+
*
|
|
694
|
+
* Spread warnings, budget bails and `missing-css` fallbacks all describe absent
|
|
695
|
+
* output and print regardless. What is left says the runtime path was taken
|
|
696
|
+
* where a compiled one was possible: real, worth acting on, and not a failure.
|
|
697
|
+
*
|
|
698
|
+
* @param message - One raw diagnostic line as an engine emitted it.
|
|
699
|
+
* @returns True when the diagnostic is advisory rather than a build result.
|
|
700
|
+
*/
|
|
701
|
+
declare function isAdvisoryDiagnostic(message: string): boolean;
|
|
702
|
+
/**
|
|
703
|
+
* Build the one-line disclosure that the fallback list above is partial.
|
|
704
|
+
*
|
|
705
|
+
* Four of the five `sz`-site fallback kinds never print in a production build,
|
|
706
|
+
* so a log can list the `szr` fallbacks it found and silently hold every
|
|
707
|
+
* `sz={factory()}` beside them. A consumer counting affected sites from that
|
|
708
|
+
* log counts a lower bound and has no way to know it — one reported a site
|
|
709
|
+
* count that was short by half for exactly this reason, and only caught it by
|
|
710
|
+
* reading sources instead.
|
|
711
|
+
*
|
|
712
|
+
* Suppression is the right default; implying zero is not. One line costs
|
|
713
|
+
* nothing and keeps the difference visible.
|
|
714
|
+
*
|
|
715
|
+
* @param count - Advisory fallbacks the build declined to list.
|
|
716
|
+
* @returns The disclosure, or null when nothing was held back.
|
|
717
|
+
*/
|
|
718
|
+
declare function suppressedAdvisoryMessage(count: number): string | null;
|
|
669
719
|
/**
|
|
670
720
|
* The `quiet` option, normalized.
|
|
671
721
|
*
|
|
@@ -823,6 +873,36 @@ declare function isPackagesSkippedSource(id: string, sourceDirs?: readonly strin
|
|
|
823
873
|
* @returns the warning string.
|
|
824
874
|
*/
|
|
825
875
|
declare function skippedSzFilesMessage(files: readonly string[], szvExportFiles?: readonly string[]): string;
|
|
876
|
+
/**
|
|
877
|
+
* Explains a class census that grew after the mangle map was already frozen.
|
|
878
|
+
*
|
|
879
|
+
* The map is settled right after the prescan because the CSS a build ships is
|
|
880
|
+
* hashed while it is still being transformed. A class discovered later would be
|
|
881
|
+
* mangled in one artifact and not in another, so the build stops here rather
|
|
882
|
+
* than emitting output whose CSS, JS and HTML disagree.
|
|
883
|
+
*
|
|
884
|
+
* @param lateOwned csszyx-owned classes first seen after the freeze.
|
|
885
|
+
* @param lateAuthored raw author classes first seen after the freeze.
|
|
886
|
+
* @returns the error text.
|
|
887
|
+
*/
|
|
888
|
+
declare function lateMangleCensusMessage(lateOwned: readonly string[], lateAuthored: readonly string[]): string;
|
|
889
|
+
/**
|
|
890
|
+
* Explains why a watch build does not mangle.
|
|
891
|
+
*
|
|
892
|
+
* @returns the warning text.
|
|
893
|
+
*/
|
|
894
|
+
declare function watchModeMangleMessage(): string;
|
|
895
|
+
/**
|
|
896
|
+
* Explains why webpack must keep recomputing content hashes.
|
|
897
|
+
*
|
|
898
|
+
* csszyx rewrites webpack assets in `processAssets`, which is only safe
|
|
899
|
+
* because `optimization.realContentHash` runs later and recomputes each hash
|
|
900
|
+
* from the final bytes. Turning it off puts webpack back in the state this
|
|
901
|
+
* release fixed for Vite: same filename, different bytes.
|
|
902
|
+
*
|
|
903
|
+
* @returns the warning text.
|
|
904
|
+
*/
|
|
905
|
+
declare function realContentHashDisabledMessage(): string;
|
|
826
906
|
/**
|
|
827
907
|
* Computes the `@source` target path for a CSS module: the location of the
|
|
828
908
|
* generated safelist file relative to the CSS file, in posix form and always
|
|
@@ -860,6 +940,13 @@ declare function shouldTrackGlobalVarSources(config?: {
|
|
|
860
940
|
* @param code Source text, or null to clear this file.
|
|
861
941
|
*/
|
|
862
942
|
declare function recordGlobalVarSourceFile(state: Pick<PluginState, 'globalVarSourceFilesByFile'>, filename: string, code: string | null): void;
|
|
943
|
+
/**
|
|
944
|
+
* Decides whether a module id is a stylesheet csszyx should rewrite.
|
|
945
|
+
*
|
|
946
|
+
* @param id Bundler module identifier.
|
|
947
|
+
* @returns True for a stylesheet whose text is destined for emitted CSS.
|
|
948
|
+
*/
|
|
949
|
+
declare function isMangleableCssId(id: string): boolean;
|
|
863
950
|
/**
|
|
864
951
|
* Extracts global custom-property aliases for manifest/debug tooling.
|
|
865
952
|
*
|
|
@@ -931,5 +1018,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
|
|
|
931
1018
|
*/
|
|
932
1019
|
declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
|
|
933
1020
|
|
|
934
|
-
export {
|
|
1021
|
+
export { isPackagesSkippedSource as $, cssImportsTailwind as A, unplugin as B, deleteRSCModuleRecord 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, 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, shouldTrackGlobalVarSources as ai, shouldWarnMissingTailwindEntry as aj, shouldWarnUnscopedMonorepo as ak, skippedSzFilesMessage as al, suppressedAdvisoryMessage as am, unscopedMonorepoMessage as an, vitePlugin as ao, watchModeMangleMessage as ap, webpackPlugin as aq, allocateMangleTokens as r, appendTailwindSourceDirective as s, assertNoRSCBoundaryViolation as t, assertNoRSCGraphViolation as u, collectMangleHybridHazards as v, computeSafelistRelPath as w, createGlobalVarMapAssetSource as x, createRSCModuleRecord as y, cssHasContentScope as z };
|
|
935
1022
|
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, ParsedTheme as o, RSCBoundaryViolation as p, RSCModuleRecord as q };
|
|
@@ -458,6 +458,14 @@ interface PluginState {
|
|
|
458
458
|
authoredClasses: Set<string>;
|
|
459
459
|
/** Unresolvable-spread warnings surfaced to the build log in every mode. */
|
|
460
460
|
spreadWarnings: Set<string>;
|
|
461
|
+
/**
|
|
462
|
+
* Advisory sz fallbacks this build declined to list.
|
|
463
|
+
*
|
|
464
|
+
* Counted so the build can say the list is partial. Printing nothing is not
|
|
465
|
+
* the same as printing "nothing happened", and a log that names five
|
|
466
|
+
* fallbacks while holding three back reads as a total.
|
|
467
|
+
*/
|
|
468
|
+
suppressedAdvisories: number;
|
|
461
469
|
/**
|
|
462
470
|
* Workspace-package files under `/packages/` that use csszyx but were
|
|
463
471
|
* skipped by the hard-ignore (not under any `compileSources` dir). Surfaced at
|
|
@@ -627,10 +635,10 @@ declare function collectMangleHybridHazards(mangleMap: Record<string, string>, m
|
|
|
627
635
|
declare function mangleHybridHazardMessage(hazards: MangleHybridHazards): string | null;
|
|
628
636
|
/**
|
|
629
637
|
* Whether a CSS module scopes Tailwind's content detection — `source(none)` or
|
|
630
|
-
* `source("…")` on
|
|
638
|
+
* `source("…")` on a `@import "tailwindcss"`, or any `@source not` exclusion.
|
|
631
639
|
* A plain additive `@source "…"` does NOT count: it only adds a path, it does
|
|
632
|
-
* not stop the automatic
|
|
633
|
-
*
|
|
640
|
+
* not stop the automatic scan. Block comments are stripped first so a
|
|
641
|
+
* commented-out directive does not count.
|
|
634
642
|
*
|
|
635
643
|
* @param code - CSS module source.
|
|
636
644
|
* @returns true when the entry scopes (or excludes from) content detection.
|
|
@@ -663,9 +671,51 @@ declare function shouldWarnUnscopedMonorepo(sawTailwindEntry: boolean, tailwindE
|
|
|
663
671
|
/**
|
|
664
672
|
* Build the unscoped-monorepo warning message: what is wrong, why it matters,
|
|
665
673
|
* the exact two-line fix, the guide link, and how to silence it.
|
|
674
|
+
*
|
|
675
|
+
* Describes the detection BASE rather than promising a climb to the workspace
|
|
676
|
+
* root. Measured on a workspace package built through the Vite plugin, the scan
|
|
677
|
+
* was rooted at the Vite root: files beside the entry were scanned, the sibling
|
|
678
|
+
* package and the workspace root were not. Naming a worse failure than the one
|
|
679
|
+
* that is happening is how an advisory gets discounted — a reader who checks
|
|
680
|
+
* for phantom classes from sibling packages finds none and stops believing the
|
|
681
|
+
* rest of the message.
|
|
682
|
+
*
|
|
683
|
+
* The suggested snippet carries no CSS comment on purpose. A block comment ends
|
|
684
|
+
* at the first `*` followed by `/`, which any recursive glob contains, so
|
|
685
|
+
* inviting the reader to annotate `@source` lines invites a stylesheet that
|
|
686
|
+
* stops parsing where they documented it.
|
|
687
|
+
*
|
|
666
688
|
* @returns the warning string.
|
|
667
689
|
*/
|
|
668
690
|
declare function unscopedMonorepoMessage(): string;
|
|
691
|
+
/**
|
|
692
|
+
* Whether a diagnostic is an advisory one — the class a build may hold back.
|
|
693
|
+
*
|
|
694
|
+
* Spread warnings, budget bails and `missing-css` fallbacks all describe absent
|
|
695
|
+
* output and print regardless. What is left says the runtime path was taken
|
|
696
|
+
* where a compiled one was possible: real, worth acting on, and not a failure.
|
|
697
|
+
*
|
|
698
|
+
* @param message - One raw diagnostic line as an engine emitted it.
|
|
699
|
+
* @returns True when the diagnostic is advisory rather than a build result.
|
|
700
|
+
*/
|
|
701
|
+
declare function isAdvisoryDiagnostic(message: string): boolean;
|
|
702
|
+
/**
|
|
703
|
+
* Build the one-line disclosure that the fallback list above is partial.
|
|
704
|
+
*
|
|
705
|
+
* Four of the five `sz`-site fallback kinds never print in a production build,
|
|
706
|
+
* so a log can list the `szr` fallbacks it found and silently hold every
|
|
707
|
+
* `sz={factory()}` beside them. A consumer counting affected sites from that
|
|
708
|
+
* log counts a lower bound and has no way to know it — one reported a site
|
|
709
|
+
* count that was short by half for exactly this reason, and only caught it by
|
|
710
|
+
* reading sources instead.
|
|
711
|
+
*
|
|
712
|
+
* Suppression is the right default; implying zero is not. One line costs
|
|
713
|
+
* nothing and keeps the difference visible.
|
|
714
|
+
*
|
|
715
|
+
* @param count - Advisory fallbacks the build declined to list.
|
|
716
|
+
* @returns The disclosure, or null when nothing was held back.
|
|
717
|
+
*/
|
|
718
|
+
declare function suppressedAdvisoryMessage(count: number): string | null;
|
|
669
719
|
/**
|
|
670
720
|
* The `quiet` option, normalized.
|
|
671
721
|
*
|
|
@@ -823,6 +873,36 @@ declare function isPackagesSkippedSource(id: string, sourceDirs?: readonly strin
|
|
|
823
873
|
* @returns the warning string.
|
|
824
874
|
*/
|
|
825
875
|
declare function skippedSzFilesMessage(files: readonly string[], szvExportFiles?: readonly string[]): string;
|
|
876
|
+
/**
|
|
877
|
+
* Explains a class census that grew after the mangle map was already frozen.
|
|
878
|
+
*
|
|
879
|
+
* The map is settled right after the prescan because the CSS a build ships is
|
|
880
|
+
* hashed while it is still being transformed. A class discovered later would be
|
|
881
|
+
* mangled in one artifact and not in another, so the build stops here rather
|
|
882
|
+
* than emitting output whose CSS, JS and HTML disagree.
|
|
883
|
+
*
|
|
884
|
+
* @param lateOwned csszyx-owned classes first seen after the freeze.
|
|
885
|
+
* @param lateAuthored raw author classes first seen after the freeze.
|
|
886
|
+
* @returns the error text.
|
|
887
|
+
*/
|
|
888
|
+
declare function lateMangleCensusMessage(lateOwned: readonly string[], lateAuthored: readonly string[]): string;
|
|
889
|
+
/**
|
|
890
|
+
* Explains why a watch build does not mangle.
|
|
891
|
+
*
|
|
892
|
+
* @returns the warning text.
|
|
893
|
+
*/
|
|
894
|
+
declare function watchModeMangleMessage(): string;
|
|
895
|
+
/**
|
|
896
|
+
* Explains why webpack must keep recomputing content hashes.
|
|
897
|
+
*
|
|
898
|
+
* csszyx rewrites webpack assets in `processAssets`, which is only safe
|
|
899
|
+
* because `optimization.realContentHash` runs later and recomputes each hash
|
|
900
|
+
* from the final bytes. Turning it off puts webpack back in the state this
|
|
901
|
+
* release fixed for Vite: same filename, different bytes.
|
|
902
|
+
*
|
|
903
|
+
* @returns the warning text.
|
|
904
|
+
*/
|
|
905
|
+
declare function realContentHashDisabledMessage(): string;
|
|
826
906
|
/**
|
|
827
907
|
* Computes the `@source` target path for a CSS module: the location of the
|
|
828
908
|
* generated safelist file relative to the CSS file, in posix form and always
|
|
@@ -860,6 +940,13 @@ declare function shouldTrackGlobalVarSources(config?: {
|
|
|
860
940
|
* @param code Source text, or null to clear this file.
|
|
861
941
|
*/
|
|
862
942
|
declare function recordGlobalVarSourceFile(state: Pick<PluginState, 'globalVarSourceFilesByFile'>, filename: string, code: string | null): void;
|
|
943
|
+
/**
|
|
944
|
+
* Decides whether a module id is a stylesheet csszyx should rewrite.
|
|
945
|
+
*
|
|
946
|
+
* @param id Bundler module identifier.
|
|
947
|
+
* @returns True for a stylesheet whose text is destined for emitted CSS.
|
|
948
|
+
*/
|
|
949
|
+
declare function isMangleableCssId(id: string): boolean;
|
|
863
950
|
/**
|
|
864
951
|
* Extracts global custom-property aliases for manifest/debug tooling.
|
|
865
952
|
*
|
|
@@ -931,5 +1018,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
|
|
|
931
1018
|
*/
|
|
932
1019
|
declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
|
|
933
1020
|
|
|
934
|
-
export {
|
|
1021
|
+
export { isPackagesSkippedSource as $, cssImportsTailwind as A, unplugin as B, deleteRSCModuleRecord 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, 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, shouldTrackGlobalVarSources as ai, shouldWarnMissingTailwindEntry as aj, shouldWarnUnscopedMonorepo as ak, skippedSzFilesMessage as al, suppressedAdvisoryMessage as am, unscopedMonorepoMessage as an, vitePlugin as ao, watchModeMangleMessage as ap, webpackPlugin as aq, allocateMangleTokens as r, appendTailwindSourceDirective as s, assertNoRSCBoundaryViolation as t, assertNoRSCGraphViolation as u, collectMangleHybridHazards as v, computeSafelistRelPath as w, createGlobalVarMapAssetSource as x, createRSCModuleRecord as y, cssHasContentScope as z };
|
|
935
1022
|
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, ParsedTheme as o, RSCBoundaryViolation as p, RSCModuleRecord as q };
|
|
@@ -304,6 +304,7 @@ function runtimeHelperGroupsFromUsage(usage) {
|
|
|
304
304
|
if (usage.usesColorVar) append("__szColorVar");
|
|
305
305
|
if (usage.usesSpacingVar) append("__szSpacingVar");
|
|
306
306
|
if (usage.usesUnitVar) append("__szUnitVar");
|
|
307
|
+
if (usage.usesBoolClass) append("__szBoolClass");
|
|
307
308
|
return groups;
|
|
308
309
|
}
|
|
309
310
|
function injectNextRuntimeImports(code, usage) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OxcNotImplementedError, extractCrossModuleRegistryEntries } from '@csszyx/compiler';
|
|
2
1
|
import * as path from 'node:path';
|
|
2
|
+
import { extractCrossModuleRegistryEntries } from '@csszyx/compiler';
|
|
3
3
|
import * as fs from 'node:fs';
|
|
4
4
|
import { existsSync, statSync } from 'node:fs';
|
|
5
5
|
import { createHash, randomUUID } from 'node:crypto';
|
|
@@ -9,13 +9,6 @@ function normalizePathSeparators(value) {
|
|
|
9
9
|
return value.split(WINDOWS_PATH_SEPARATOR).join("/");
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function babelFallbackReason(error) {
|
|
13
|
-
if (error instanceof OxcNotImplementedError) {
|
|
14
|
-
return error.detail;
|
|
15
|
-
}
|
|
16
|
-
return error instanceof Error ? error.message : String(error);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
12
|
const TSCONFIG_CANDIDATES = ["tsconfig.json", "jsconfig.json", "tsconfig.app.json"];
|
|
20
13
|
const MAX_EXTENDS_DEPTH = 8;
|
|
21
14
|
function collectSpecifierAliases(rootDir, resolveAlias) {
|
|
@@ -285,7 +278,7 @@ function isReadableProviderFile(candidate) {
|
|
|
285
278
|
}
|
|
286
279
|
}
|
|
287
280
|
|
|
288
|
-
const CACHE_SCHEMA_VERSION =
|
|
281
|
+
const CACHE_SCHEMA_VERSION = 17;
|
|
289
282
|
function resolveTransformCacheDir(rootDir, cacheDir) {
|
|
290
283
|
return path.resolve(rootDir, cacheDir ?? ".csszyx/cache", "transform");
|
|
291
284
|
}
|
|
@@ -407,6 +400,7 @@ function serializeResult(result) {
|
|
|
407
400
|
usesColorVar: result.usesColorVar,
|
|
408
401
|
usesSpacingVar: result.usesSpacingVar,
|
|
409
402
|
usesUnitVar: result.usesUnitVar,
|
|
403
|
+
usesBoolClass: result.usesBoolClass,
|
|
410
404
|
classes: [...result.classes],
|
|
411
405
|
rawClassNames: [...result.rawClassNames],
|
|
412
406
|
diagnostics: [...result.diagnostics],
|
|
@@ -428,6 +422,7 @@ function deserializeResult(result) {
|
|
|
428
422
|
usesColorVar: result.usesColorVar,
|
|
429
423
|
usesSpacingVar: result.usesSpacingVar,
|
|
430
424
|
usesUnitVar: result.usesUnitVar,
|
|
425
|
+
usesBoolClass: result.usesBoolClass,
|
|
431
426
|
classes: new Set(result.classes),
|
|
432
427
|
rawClassNames: new Set(result.rawClassNames),
|
|
433
428
|
diagnostics: [...result.diagnostics],
|
|
@@ -492,4 +487,4 @@ function evictMemoryCacheToBudget(cache, totalCodeChars, maxEntries, maxCodeChar
|
|
|
492
487
|
return total;
|
|
493
488
|
}
|
|
494
489
|
|
|
495
|
-
export { resolveProviderPathWith as a, recordResolvedEntry as b, collectSpecifierAliases as c, isReadableProviderFile as d, createTransformCacheKey as e, readTransformCache as f,
|
|
490
|
+
export { resolveProviderPathWith as a, recordResolvedEntry as b, collectSpecifierAliases as c, isReadableProviderFile as d, createTransformCacheKey as e, readTransformCache as f, recordSzvRegistryFile as g, recordSzObjectRegistryFile as h, importedSpecifiersIn as i, resolveCrossModuleStaticsFor as j, evictOldTransformCacheEntries as k, evictMemoryCacheToBudget as l, mayExportSzvFactories as m, normalizePathSeparators as n, resolveProviderPath as o, resolveTransformCacheDir as r, specifierBases as s, writeTransformCache as w };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import { extractCrossModuleRegistryEntries, ensureRustTransformAvailable,
|
|
3
|
+
import { 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, n as normalizePathSeparators, b as recordResolvedEntry, d as isReadableProviderFile, e as createTransformCacheKey, f as readTransformCache, w as writeTransformCache
|
|
5
|
+
import { c as collectSpecifierAliases, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, n as normalizePathSeparators, b as recordResolvedEntry, d as isReadableProviderFile, e as createTransformCacheKey, f as readTransformCache, w as writeTransformCache } from './unplugin.DKcwO8O4.mjs';
|
|
6
6
|
import { createHash } from 'node:crypto';
|
|
7
7
|
import { s as sortStrings } from './unplugin.B3XoSRB8.mjs';
|
|
8
8
|
|
|
@@ -190,34 +190,16 @@ function isRegexLiteralStart(emitted) {
|
|
|
190
190
|
}
|
|
191
191
|
function runNextSourceTransform(input, filename) {
|
|
192
192
|
const compilerOptions = input.compilerOptions;
|
|
193
|
-
if (input.parserMode === "babel") {
|
|
194
|
-
return {
|
|
195
|
-
result: transformSourceCode(input.source, filename, compilerOptions),
|
|
196
|
-
producer: "babel"
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
193
|
if (input.parserMode === "rust") {
|
|
200
194
|
return {
|
|
201
195
|
result: transformRust(input.source, filename, compilerOptions),
|
|
202
196
|
producer: "rust"
|
|
203
197
|
};
|
|
204
198
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
};
|
|
210
|
-
} catch (error) {
|
|
211
|
-
if (input.allowBabelFallback === false) {
|
|
212
|
-
throw error;
|
|
213
|
-
}
|
|
214
|
-
const result = transformSourceCode(input.source, filename, compilerOptions);
|
|
215
|
-
const reason = babelFallbackReason(error);
|
|
216
|
-
result.diagnostics.push(
|
|
217
|
-
`[csszyx] oxc parser fell back to Babel for ${filename}: ${reason}`
|
|
218
|
-
);
|
|
219
|
-
return { result, producer: "babel-fallback" };
|
|
220
|
-
}
|
|
199
|
+
return {
|
|
200
|
+
result: transformWasm(input.source, filename, compilerOptions),
|
|
201
|
+
producer: "wasm"
|
|
202
|
+
};
|
|
221
203
|
}
|
|
222
204
|
function createNextSourceTransformCacheInput(input, filename, producer) {
|
|
223
205
|
return {
|