@csszyx/unplugin 0.15.2 → 0.16.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/dist/css-mangler.cjs +61 -63
- package/dist/css-mangler.d.cts +31 -2
- package/dist/css-mangler.d.mts +31 -2
- package/dist/css-mangler.mjs +61 -64
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/next-prebuild.mjs +2 -2
- package/dist/next-turbo-loader.mjs +3 -3
- package/dist/shared/{unplugin.BT7PqYuK.d.cts → unplugin.Bu2rzRtv.d.mts} +41 -4
- package/dist/shared/{unplugin.Bk9o8_RZ.mjs → unplugin.C-oQU1jl.mjs} +1 -1
- package/dist/shared/{unplugin.DK0b4fr7.mjs → unplugin.Ceq-N4jI.mjs} +1 -1
- package/dist/shared/{unplugin.dz3AdzsO.cjs → unplugin.D3yBoTHP.cjs} +310 -66
- package/dist/shared/{unplugin.BxsTa17g.mjs → unplugin.Dx0ngYWw.mjs} +312 -69
- package/dist/shared/{unplugin.BT7PqYuK.d.mts → unplugin.PKo7wFzu.d.cts} +41 -4
- package/dist/shared/{unplugin.DAzgbtuZ.mjs → unplugin.Vn9x8SBP.mjs} +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +4 -2
- package/dist/vite.d.mts +3 -1
- package/dist/vite.mjs +3 -3
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.d.cts +4 -2
- package/dist/webpack.d.mts +3 -1
- package/dist/webpack.mjs +3 -3
- package/package.json +15 -9
|
@@ -4,6 +4,7 @@ import { Plugin } from 'esbuild';
|
|
|
4
4
|
import { InputPluginOption } from 'rollup';
|
|
5
5
|
import { UnpluginInstance, WebpackPluginInstance } from 'unplugin';
|
|
6
6
|
import { PluginOption } from 'vite';
|
|
7
|
+
import { ClassAttributeSelector } from '../css-mangler.cjs';
|
|
7
8
|
|
|
8
9
|
/** Source location for one CSS custom-property occurrence. */
|
|
9
10
|
interface CssVarLocation {
|
|
@@ -655,6 +656,25 @@ interface MangleHybridHazards {
|
|
|
655
656
|
* DOM class is rewritten to a token with no rule → the element loses styling.
|
|
656
657
|
*/
|
|
657
658
|
orphans: string[];
|
|
659
|
+
/**
|
|
660
|
+
* Attribute selectors on `class` whose match depends on a name the map
|
|
661
|
+
* renamed. `[class*="bg-tag"]` matched `bg-tag-blue-bg` by text; after
|
|
662
|
+
* the rename the element carries `y4`, the rule stops applying, and
|
|
663
|
+
* nothing in the build says so — the CSS is intact and the page renders.
|
|
664
|
+
* Absent when the caller has no selector census.
|
|
665
|
+
*/
|
|
666
|
+
selectorMatches?: MangleSelectorHazard[];
|
|
667
|
+
}
|
|
668
|
+
/** One attribute selector the mangle map breaks or newly satisfies. */
|
|
669
|
+
interface MangleSelectorHazard {
|
|
670
|
+
/** The selector as written: `[class*="bg-tag"]`, with ` i` when case-insensitive. */
|
|
671
|
+
selector: string;
|
|
672
|
+
/** The attribute value the selector compares against, unescaped. */
|
|
673
|
+
value: string;
|
|
674
|
+
/** Map keys the selector was matching by name, sorted; renamed, so it no longer does. */
|
|
675
|
+
renamed: string[];
|
|
676
|
+
/** Tokens the selector would start matching that no class name did before, sorted. */
|
|
677
|
+
matchedTokens: string[];
|
|
658
678
|
}
|
|
659
679
|
/**
|
|
660
680
|
* Detect hybrid-mangle hazards from the accumulated per-asset mangle results.
|
|
@@ -662,9 +682,10 @@ interface MangleHybridHazards {
|
|
|
662
682
|
* @param mangleMap - the full original→token map injected into the runtime.
|
|
663
683
|
* @param mangledSources - map keys that were actually found and renamed in some CSS asset.
|
|
664
684
|
* @param externalClasses - class names found in CSS that are NOT in the mangle map (non-csszyx).
|
|
665
|
-
* @
|
|
685
|
+
* @param attributeSelectors - every `[class …]` selector the emitted CSS contains.
|
|
686
|
+
* @returns the colliding tokens, orphan sources and selector hazards (each sorted, deduped).
|
|
666
687
|
*/
|
|
667
|
-
declare function collectMangleHybridHazards(mangleMap: Record<string, string>, mangledSources: ReadonlySet<string>, externalClasses: ReadonlySet<string
|
|
688
|
+
declare function collectMangleHybridHazards(mangleMap: Record<string, string>, mangledSources: ReadonlySet<string>, externalClasses: ReadonlySet<string>, attributeSelectors?: readonly ClassAttributeSelector[]): MangleHybridHazards;
|
|
668
689
|
/**
|
|
669
690
|
* Build the hybrid-mangle hazard warning, or null when there is nothing to warn.
|
|
670
691
|
*
|
|
@@ -799,6 +820,22 @@ declare function shouldEmitWarning(quiet: QuietMode, devOnly: boolean, isProduct
|
|
|
799
820
|
* @returns True when the diagnostic is an unsilenced missing-CSS failure.
|
|
800
821
|
*/
|
|
801
822
|
declare function shouldEmitMissingCssFallback(quiet: QuietMode, message: string): boolean;
|
|
823
|
+
/**
|
|
824
|
+
* Whether this run holds the advisory fallback list back and counts it instead.
|
|
825
|
+
*
|
|
826
|
+
* A build prints the count once the bundle closes, so holding the list back
|
|
827
|
+
* still leaves a reader a number to act on. A dev server never closes a bundle:
|
|
828
|
+
* anything held back there is held back for good, which is why serving lists
|
|
829
|
+
* its fallbacks whatever the environment says. `NODE_ENV` alone was the whole
|
|
830
|
+
* test, and a monorepo script that exports it while running a dev server turned
|
|
831
|
+
* every advisory into a number nothing would print.
|
|
832
|
+
*
|
|
833
|
+
* @param quiet - Resolved quiet mode.
|
|
834
|
+
* @param serving - Whether this is a dev server rather than a build.
|
|
835
|
+
* @param nodeEnv - `process.env.NODE_ENV` as the process sees it.
|
|
836
|
+
* @returns True when the list is withheld in favour of a count.
|
|
837
|
+
*/
|
|
838
|
+
declare function shouldHoldAdvisories(quiet: QuietMode, serving: boolean, nodeEnv: string | undefined): boolean;
|
|
802
839
|
/**
|
|
803
840
|
* Emit one missing-CSS fallback through the caller's output channel.
|
|
804
841
|
*
|
|
@@ -1042,5 +1079,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
|
|
|
1042
1079
|
*/
|
|
1043
1080
|
declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
|
|
1044
1081
|
|
|
1045
|
-
export {
|
|
1046
|
-
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,
|
|
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 };
|
|
1083
|
+
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 };
|
|
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { extractCrossModuleForwards, extractCrossModuleRegistryEntries, ensureRustTransformAvailable, transformRust, transformWasm, transform } from '@csszyx/compiler';
|
|
4
4
|
import { DEFAULT_IMPORTED_STATIC_SZ } from '@csszyx/types';
|
|
5
|
-
import { c as collectSpecifierAliases, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, b as recordResolvedEntry, f as forwardVisitKey, M as MAX_FORWARD_HOPS, d as isReadableProviderFile, e as createTransformCacheKey, g as readTransformCache, w as writeTransformCache } from './unplugin.
|
|
5
|
+
import { c as collectSpecifierAliases, i as importedSpecifiersIn, s as specifierBases, a as resolveProviderPathWith, b as recordResolvedEntry, f as forwardVisitKey, M as MAX_FORWARD_HOPS, d as isReadableProviderFile, e as createTransformCacheKey, g as readTransformCache, w as writeTransformCache } from './unplugin.C-oQU1jl.mjs';
|
|
6
6
|
import { n as normalizePathSeparators, s as sortStrings } from './unplugin.DH_ij6cf.mjs';
|
|
7
7
|
import { createHash } from 'node:crypto';
|
|
8
8
|
|
package/dist/vite.cjs
CHANGED
package/dist/vite.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export =
|
|
1
|
+
import { ap } from './shared/unplugin.PKo7wFzu.cjs';
|
|
2
|
+
export = ap;
|
|
3
3
|
import '@csszyx/compiler';
|
|
4
4
|
import '@csszyx/types';
|
|
5
5
|
import 'esbuild';
|
|
6
6
|
import 'rollup';
|
|
7
7
|
import 'unplugin';
|
|
8
8
|
import 'vite';
|
|
9
|
+
import './css-mangler.cjs';
|
|
10
|
+
import 'postcss';
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ap as default } from './shared/unplugin.Bu2rzRtv.mjs';
|
|
2
2
|
import '@csszyx/compiler';
|
|
3
3
|
import '@csszyx/types';
|
|
4
4
|
import 'esbuild';
|
|
5
5
|
import 'rollup';
|
|
6
6
|
import 'unplugin';
|
|
7
7
|
import 'vite';
|
|
8
|
+
import './css-mangler.mjs';
|
|
9
|
+
import 'postcss';
|
package/dist/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { a2 as default } from './shared/unplugin.Dx0ngYWw.mjs';
|
|
2
2
|
import 'node:crypto';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:module';
|
|
@@ -13,10 +13,10 @@ import '@csszyx/types';
|
|
|
13
13
|
import '@csszyx/vue-adapter';
|
|
14
14
|
import 'unplugin';
|
|
15
15
|
import './shared/unplugin.DH_ij6cf.mjs';
|
|
16
|
-
import './shared/unplugin.
|
|
16
|
+
import './shared/unplugin.C-oQU1jl.mjs';
|
|
17
17
|
import './css-mangler.mjs';
|
|
18
18
|
import 'postcss';
|
|
19
19
|
import 'postcss-selector-parser';
|
|
20
|
-
import './shared/unplugin.
|
|
20
|
+
import './shared/unplugin.Ceq-N4jI.mjs';
|
|
21
21
|
import 'node:zlib';
|
|
22
22
|
import 'postcss-value-parser';
|
package/dist/webpack.cjs
CHANGED
package/dist/webpack.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export =
|
|
1
|
+
import { ar } from './shared/unplugin.PKo7wFzu.cjs';
|
|
2
|
+
export = ar;
|
|
3
3
|
import '@csszyx/compiler';
|
|
4
4
|
import '@csszyx/types';
|
|
5
5
|
import 'esbuild';
|
|
6
6
|
import 'rollup';
|
|
7
7
|
import 'unplugin';
|
|
8
8
|
import 'vite';
|
|
9
|
+
import './css-mangler.cjs';
|
|
10
|
+
import 'postcss';
|
package/dist/webpack.d.mts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ar as default } from './shared/unplugin.Bu2rzRtv.mjs';
|
|
2
2
|
import '@csszyx/compiler';
|
|
3
3
|
import '@csszyx/types';
|
|
4
4
|
import 'esbuild';
|
|
5
5
|
import 'rollup';
|
|
6
6
|
import 'unplugin';
|
|
7
7
|
import 'vite';
|
|
8
|
+
import './css-mangler.mjs';
|
|
9
|
+
import 'postcss';
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { a4 as default } from './shared/unplugin.Dx0ngYWw.mjs';
|
|
2
2
|
import 'node:crypto';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:module';
|
|
@@ -13,10 +13,10 @@ import '@csszyx/types';
|
|
|
13
13
|
import '@csszyx/vue-adapter';
|
|
14
14
|
import 'unplugin';
|
|
15
15
|
import './shared/unplugin.DH_ij6cf.mjs';
|
|
16
|
-
import './shared/unplugin.
|
|
16
|
+
import './shared/unplugin.C-oQU1jl.mjs';
|
|
17
17
|
import './css-mangler.mjs';
|
|
18
18
|
import 'postcss';
|
|
19
19
|
import 'postcss-selector-parser';
|
|
20
|
-
import './shared/unplugin.
|
|
20
|
+
import './shared/unplugin.Ceq-N4jI.mjs';
|
|
21
21
|
import 'node:zlib';
|
|
22
22
|
import 'postcss-value-parser';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/unplugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Vite and Webpack integration for csszyx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"csszyx",
|
|
@@ -122,11 +122,11 @@
|
|
|
122
122
|
"dist"
|
|
123
123
|
],
|
|
124
124
|
"dependencies": {
|
|
125
|
-
"@csszyx/compiler": "0.
|
|
126
|
-
"@csszyx/core": "0.
|
|
127
|
-
"@csszyx/svelte-adapter": "0.
|
|
128
|
-
"@csszyx/types": "0.
|
|
129
|
-
"@csszyx/vue-adapter": "0.
|
|
125
|
+
"@csszyx/compiler": "0.16.0",
|
|
126
|
+
"@csszyx/core": "0.16.0",
|
|
127
|
+
"@csszyx/svelte-adapter": "0.16.0",
|
|
128
|
+
"@csszyx/types": "0.16.0",
|
|
129
|
+
"@csszyx/vue-adapter": "0.16.0",
|
|
130
130
|
"postcss": "^8.5.26",
|
|
131
131
|
"postcss-selector-parser": "^7.1.5",
|
|
132
132
|
"postcss-value-parser": "^4.2.0",
|
|
@@ -134,11 +134,17 @@
|
|
|
134
134
|
"unplugin": "^3.3.0"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|
|
137
|
-
"@csszyx/runtime": "^0.
|
|
137
|
+
"@csszyx/runtime": "^0.16.0",
|
|
138
|
+
"vite": ">=5.0.0"
|
|
139
|
+
},
|
|
140
|
+
"peerDependenciesMeta": {
|
|
141
|
+
"vite": {
|
|
142
|
+
"optional": true
|
|
143
|
+
}
|
|
138
144
|
},
|
|
139
145
|
"devDependencies": {
|
|
140
|
-
"@csszyx/runtime": "0.
|
|
141
|
-
"@csszyx/tooling-metadata": "0.
|
|
146
|
+
"@csszyx/runtime": "0.16.0",
|
|
147
|
+
"@csszyx/tooling-metadata": "0.16.0",
|
|
142
148
|
"@tailwindcss/node": "4.3.3",
|
|
143
149
|
"@types/node": "^22.20.1",
|
|
144
150
|
"@types/proper-lockfile": "^4.1.4",
|