@csszyx/unplugin 0.11.6 → 0.11.8
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 +6 -1
- package/dist/css-mangler.cjs +44 -41
- package/dist/css-mangler.mjs +44 -41
- package/dist/index.cjs +5 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -4
- package/dist/next-config.cjs +1 -1
- package/dist/next-config.mjs +1 -1
- package/dist/next-prebuild.cjs +5 -5
- package/dist/next-prebuild.mjs +5 -5
- package/dist/next-turbo-loader.cjs +13 -12
- package/dist/next-turbo-loader.mjs +13 -12
- package/dist/next-watcher.cjs +2 -2
- package/dist/next-watcher.mjs +2 -2
- package/dist/shared/{unplugin.BFN_Ueyx.cjs → unplugin.C9dMG7ye.cjs} +7 -5
- package/dist/shared/{unplugin.PhOFTQpB.d.cts → unplugin.CNwV3RrQ.d.cts} +18 -5
- package/dist/shared/{unplugin.PhOFTQpB.d.mts → unplugin.CNwV3RrQ.d.mts} +18 -5
- package/dist/shared/unplugin.CcA7jP1r.cjs +48 -0
- package/dist/shared/{unplugin.ByzV6iZE.mjs → unplugin.D-K57LNR.mjs} +13 -7
- package/dist/shared/{unplugin.D0N9bprz.cjs → unplugin.DVCQC5wq.cjs} +12 -5
- package/dist/shared/{unplugin.CBKZoxQ1.cjs → unplugin.DdtOZANG.cjs} +51 -50
- package/dist/shared/{unplugin.ChwZMl_w.mjs → unplugin.Dg1tGPSd.mjs} +8 -6
- package/dist/shared/{unplugin.Rov-j_Wm.cjs → unplugin.DmuOKVS4.cjs} +21 -0
- package/dist/shared/{unplugin.CP2cz9bA.cjs → unplugin.DtPQz8Kg.cjs} +1291 -938
- package/dist/shared/{unplugin.BS60onPk.mjs → unplugin.DtYxS8M8.mjs} +1290 -938
- package/dist/shared/{unplugin.B3cvNxnk.mjs → unplugin.Rl8sIkHi.mjs} +51 -50
- package/dist/shared/unplugin.TtmP77BS.mjs +40 -0
- package/dist/shared/unplugin.nnsa7OVW.mjs +49 -0
- package/dist/vite.cjs +4 -4
- package/dist/vite.d.cts +2 -25
- package/dist/vite.d.mts +1 -25
- package/dist/vite.mjs +4 -8
- package/dist/webpack.cjs +4 -4
- package/dist/webpack.d.cts +2 -5
- package/dist/webpack.d.mts +1 -5
- package/dist/webpack.mjs +4 -8
- package/package.json +7 -7
- package/dist/shared/unplugin.B1mblcm-.mjs +0 -9
- package/dist/shared/unplugin.B3RHYokB.mjs +0 -29
- package/dist/shared/unplugin.BCwRIUs_.cjs +0 -12
package/README.md
CHANGED
|
@@ -69,9 +69,14 @@ module.exports = {
|
|
|
69
69
|
- **sz prop transform** -- Compiles `sz={{ }}` objects into `className` strings. Defaults to the **native Rust engine** through the optional `@csszyx/core-*` platform package; opt back into the previous oxc-parser JavaScript path with `build.parser: "oxc"`, or fall through to Babel with `build.parser: "babel"`.
|
|
70
70
|
- **HTML injection** -- Injects mangle maps and checksums for SSR hydration
|
|
71
71
|
- **HMR support** -- Updates styles instantly during development
|
|
72
|
-
- **CSS mangling** -- Compresses class names (e.g., `text-center` -> `z`)
|
|
72
|
+
- **CSS mangling** -- Compresses owned class names (e.g., `text-center` -> `z`) while retaining names shared with source-visible `class`/`className` strings and template quasis
|
|
73
73
|
- **File filters** -- Top-level `include` / `exclude` (glob or RegExp) skip large generated files before the AST budget guard fires; see [Config Overview](https://csszyx.com/config/overview#file-filters)
|
|
74
74
|
|
|
75
|
+
Class mangling runs in Vite, Webpack, and Rollup final-output hooks. The esbuild
|
|
76
|
+
adapter supports source transforms and safelist generation but disables class
|
|
77
|
+
mangling because esbuild does not expose a mutable final-output hook when writing
|
|
78
|
+
directly to disk; explicit `production.mangle: true` emits a warning.
|
|
79
|
+
|
|
75
80
|
## Parser selection
|
|
76
81
|
|
|
77
82
|
The default parser is `rust`, which runs through the native engine in the
|
package/dist/css-mangler.cjs
CHANGED
|
@@ -8,65 +8,68 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
const postcss__default = /*#__PURE__*/_interopDefaultCompat(postcss);
|
|
9
9
|
const selectorParser__default = /*#__PURE__*/_interopDefaultCompat(selectorParser);
|
|
10
10
|
|
|
11
|
+
const BACKSLASH = String.fromCodePoint(92);
|
|
11
12
|
function unescapeTailwindClass(escapedName) {
|
|
12
13
|
let result = "";
|
|
13
14
|
let i = 0;
|
|
14
15
|
while (i < escapedName.length) {
|
|
15
|
-
if (escapedName[i]
|
|
16
|
-
i++;
|
|
17
|
-
if (i >= escapedName.length) {
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
const char = escapedName[i];
|
|
21
|
-
if (/[0-9a-f]/i.test(char)) {
|
|
22
|
-
let hexStr = "";
|
|
23
|
-
while (i < escapedName.length && /[0-9a-f]/i.test(escapedName[i]) && hexStr.length < 6) {
|
|
24
|
-
hexStr += escapedName[i];
|
|
25
|
-
i++;
|
|
26
|
-
}
|
|
27
|
-
if (i < escapedName.length && escapedName[i] === " ") {
|
|
28
|
-
i++;
|
|
29
|
-
}
|
|
30
|
-
const codePoint = parseInt(hexStr, 16);
|
|
31
|
-
if (codePoint > 0) {
|
|
32
|
-
result += String.fromCodePoint(codePoint);
|
|
33
|
-
}
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
result += char;
|
|
37
|
-
i++;
|
|
38
|
-
} else {
|
|
16
|
+
if (escapedName[i] !== BACKSLASH) {
|
|
39
17
|
result += escapedName[i];
|
|
40
18
|
i++;
|
|
19
|
+
continue;
|
|
41
20
|
}
|
|
21
|
+
const decoded = readCssEscape(escapedName, i + 1);
|
|
22
|
+
if (!decoded) break;
|
|
23
|
+
result += decoded.value;
|
|
24
|
+
i = decoded.next;
|
|
42
25
|
}
|
|
43
26
|
return result;
|
|
44
27
|
}
|
|
28
|
+
function readCssEscape(source, start) {
|
|
29
|
+
if (start >= source.length) return null;
|
|
30
|
+
if (!/[0-9a-f]/i.test(source[start])) return { value: source[start], next: start + 1 };
|
|
31
|
+
let next = start;
|
|
32
|
+
let hex = "";
|
|
33
|
+
while (next < source.length && /[0-9a-f]/i.test(source[next]) && hex.length < 6) {
|
|
34
|
+
hex += source[next];
|
|
35
|
+
next++;
|
|
36
|
+
}
|
|
37
|
+
if (source[next] === " ") next++;
|
|
38
|
+
const codePoint = Number.parseInt(hex, 16);
|
|
39
|
+
return { value: codePoint > 0 ? String.fromCodePoint(codePoint) : "", next };
|
|
40
|
+
}
|
|
41
|
+
function escapeLeadingClassCharacter(className, char) {
|
|
42
|
+
if (/\d/.test(char)) {
|
|
43
|
+
return `${BACKSLASH}3${char} `;
|
|
44
|
+
}
|
|
45
|
+
if (char === "-" && className.length > 1) {
|
|
46
|
+
const next = className[1];
|
|
47
|
+
if (/\d/.test(next) || next === "-") {
|
|
48
|
+
return `${BACKSLASH}-`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function escapeClassCharacter(char) {
|
|
54
|
+
const codePoint = char.codePointAt(0) ?? 0;
|
|
55
|
+
const requiresEscape = codePoint >= 33 && codePoint <= 47 && codePoint !== 45 || codePoint >= 58 && codePoint <= 64 || codePoint >= 91 && codePoint <= 94 || codePoint === 96 || codePoint >= 123 && codePoint <= 126;
|
|
56
|
+
if (requiresEscape) {
|
|
57
|
+
return `${BACKSLASH}${char}`;
|
|
58
|
+
}
|
|
59
|
+
return char;
|
|
60
|
+
}
|
|
45
61
|
function escapeCSSClassName(className) {
|
|
46
62
|
let result = "";
|
|
47
63
|
for (let i = 0; i < className.length; i++) {
|
|
48
64
|
const char = className[i];
|
|
49
|
-
const code = char.charCodeAt(0);
|
|
50
65
|
if (i === 0) {
|
|
51
|
-
|
|
52
|
-
|
|
66
|
+
const escapedLeading = escapeLeadingClassCharacter(className, char);
|
|
67
|
+
if (escapedLeading !== null) {
|
|
68
|
+
result += escapedLeading;
|
|
53
69
|
continue;
|
|
54
70
|
}
|
|
55
|
-
if (char === "-" && i + 1 < className.length) {
|
|
56
|
-
const next = className[i + 1];
|
|
57
|
-
if (/\d/.test(next) || next === "-") {
|
|
58
|
-
result += "\\-";
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/.test(char)) {
|
|
64
|
-
result += `\\${char}`;
|
|
65
|
-
} else if (code >= 128) {
|
|
66
|
-
result += char;
|
|
67
|
-
} else {
|
|
68
|
-
result += char;
|
|
69
71
|
}
|
|
72
|
+
result += escapeClassCharacter(char);
|
|
70
73
|
}
|
|
71
74
|
return result;
|
|
72
75
|
}
|
package/dist/css-mangler.mjs
CHANGED
|
@@ -1,65 +1,68 @@
|
|
|
1
1
|
import postcss from 'postcss';
|
|
2
2
|
import selectorParser from 'postcss-selector-parser';
|
|
3
3
|
|
|
4
|
+
const BACKSLASH = String.fromCodePoint(92);
|
|
4
5
|
function unescapeTailwindClass(escapedName) {
|
|
5
6
|
let result = "";
|
|
6
7
|
let i = 0;
|
|
7
8
|
while (i < escapedName.length) {
|
|
8
|
-
if (escapedName[i]
|
|
9
|
-
i++;
|
|
10
|
-
if (i >= escapedName.length) {
|
|
11
|
-
break;
|
|
12
|
-
}
|
|
13
|
-
const char = escapedName[i];
|
|
14
|
-
if (/[0-9a-f]/i.test(char)) {
|
|
15
|
-
let hexStr = "";
|
|
16
|
-
while (i < escapedName.length && /[0-9a-f]/i.test(escapedName[i]) && hexStr.length < 6) {
|
|
17
|
-
hexStr += escapedName[i];
|
|
18
|
-
i++;
|
|
19
|
-
}
|
|
20
|
-
if (i < escapedName.length && escapedName[i] === " ") {
|
|
21
|
-
i++;
|
|
22
|
-
}
|
|
23
|
-
const codePoint = parseInt(hexStr, 16);
|
|
24
|
-
if (codePoint > 0) {
|
|
25
|
-
result += String.fromCodePoint(codePoint);
|
|
26
|
-
}
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
result += char;
|
|
30
|
-
i++;
|
|
31
|
-
} else {
|
|
9
|
+
if (escapedName[i] !== BACKSLASH) {
|
|
32
10
|
result += escapedName[i];
|
|
33
11
|
i++;
|
|
12
|
+
continue;
|
|
34
13
|
}
|
|
14
|
+
const decoded = readCssEscape(escapedName, i + 1);
|
|
15
|
+
if (!decoded) break;
|
|
16
|
+
result += decoded.value;
|
|
17
|
+
i = decoded.next;
|
|
35
18
|
}
|
|
36
19
|
return result;
|
|
37
20
|
}
|
|
21
|
+
function readCssEscape(source, start) {
|
|
22
|
+
if (start >= source.length) return null;
|
|
23
|
+
if (!/[0-9a-f]/i.test(source[start])) return { value: source[start], next: start + 1 };
|
|
24
|
+
let next = start;
|
|
25
|
+
let hex = "";
|
|
26
|
+
while (next < source.length && /[0-9a-f]/i.test(source[next]) && hex.length < 6) {
|
|
27
|
+
hex += source[next];
|
|
28
|
+
next++;
|
|
29
|
+
}
|
|
30
|
+
if (source[next] === " ") next++;
|
|
31
|
+
const codePoint = Number.parseInt(hex, 16);
|
|
32
|
+
return { value: codePoint > 0 ? String.fromCodePoint(codePoint) : "", next };
|
|
33
|
+
}
|
|
34
|
+
function escapeLeadingClassCharacter(className, char) {
|
|
35
|
+
if (/\d/.test(char)) {
|
|
36
|
+
return `${BACKSLASH}3${char} `;
|
|
37
|
+
}
|
|
38
|
+
if (char === "-" && className.length > 1) {
|
|
39
|
+
const next = className[1];
|
|
40
|
+
if (/\d/.test(next) || next === "-") {
|
|
41
|
+
return `${BACKSLASH}-`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function escapeClassCharacter(char) {
|
|
47
|
+
const codePoint = char.codePointAt(0) ?? 0;
|
|
48
|
+
const requiresEscape = codePoint >= 33 && codePoint <= 47 && codePoint !== 45 || codePoint >= 58 && codePoint <= 64 || codePoint >= 91 && codePoint <= 94 || codePoint === 96 || codePoint >= 123 && codePoint <= 126;
|
|
49
|
+
if (requiresEscape) {
|
|
50
|
+
return `${BACKSLASH}${char}`;
|
|
51
|
+
}
|
|
52
|
+
return char;
|
|
53
|
+
}
|
|
38
54
|
function escapeCSSClassName(className) {
|
|
39
55
|
let result = "";
|
|
40
56
|
for (let i = 0; i < className.length; i++) {
|
|
41
57
|
const char = className[i];
|
|
42
|
-
const code = char.charCodeAt(0);
|
|
43
58
|
if (i === 0) {
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
const escapedLeading = escapeLeadingClassCharacter(className, char);
|
|
60
|
+
if (escapedLeading !== null) {
|
|
61
|
+
result += escapedLeading;
|
|
46
62
|
continue;
|
|
47
63
|
}
|
|
48
|
-
if (char === "-" && i + 1 < className.length) {
|
|
49
|
-
const next = className[i + 1];
|
|
50
|
-
if (/\d/.test(next) || next === "-") {
|
|
51
|
-
result += "\\-";
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/.test(char)) {
|
|
57
|
-
result += `\\${char}`;
|
|
58
|
-
} else if (code >= 128) {
|
|
59
|
-
result += char;
|
|
60
|
-
} else {
|
|
61
|
-
result += char;
|
|
62
64
|
}
|
|
65
|
+
result += escapeClassCharacter(char);
|
|
63
66
|
}
|
|
64
67
|
return result;
|
|
65
68
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const cssMangler = require('./css-mangler.cjs');
|
|
6
|
-
const unplugin = require('./shared/unplugin.
|
|
6
|
+
const unplugin = require('./shared/unplugin.DtPQz8Kg.cjs');
|
|
7
7
|
const types = require('@csszyx/types');
|
|
8
8
|
require('postcss');
|
|
9
9
|
require('postcss-selector-parser');
|
|
@@ -19,9 +19,9 @@ require('@csszyx/core/native');
|
|
|
19
19
|
require('@csszyx/svelte-adapter');
|
|
20
20
|
require('@csszyx/vue-adapter');
|
|
21
21
|
require('unplugin');
|
|
22
|
-
require('./shared/unplugin.
|
|
23
|
-
require('./shared/unplugin.
|
|
24
|
-
require('./shared/unplugin.
|
|
22
|
+
require('./shared/unplugin.DmuOKVS4.cjs');
|
|
23
|
+
require('./shared/unplugin.DVCQC5wq.cjs');
|
|
24
|
+
require('./shared/unplugin.CcA7jP1r.cjs');
|
|
25
25
|
require('postcss-value-parser');
|
|
26
26
|
|
|
27
27
|
|
|
@@ -61,6 +61,7 @@ exports.isPackagesSkippedSource = unplugin.isPackagesSkippedSource;
|
|
|
61
61
|
exports.isRSCServerModule = unplugin.isRSCServerModule;
|
|
62
62
|
exports.isTailwindReservedGlobalVar = unplugin.isTailwindReservedGlobalVar;
|
|
63
63
|
exports.mangleCodeClassesSync = unplugin.mangleCodeClassesSync;
|
|
64
|
+
exports.mangleEligibleClasses = unplugin.mangleEligibleClasses;
|
|
64
65
|
exports.mangleHybridHazardMessage = unplugin.mangleHybridHazardMessage;
|
|
65
66
|
exports.mergeThemes = unplugin.mergeThemes;
|
|
66
67
|
exports.missingTailwindEntryMessage = unplugin.missingTailwindEntryMessage;
|
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.
|
|
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.CNwV3RrQ.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 appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as
|
|
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 appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as mangleEligibleClasses, _ as mangleHybridHazardMessage, $ as mergeThemes, a0 as missingTailwindEntryMessage, a1 as normalizeGlobalVarAliasesForCache, a2 as parseThemeBlocks, a3 as recordGlobalVarSourceFile, a4 as resolveCompileSourceDirs, a5 as resolveNativeCacheIdentity, a6 as rollupPlugin, a7 as scanCustomPropertyNames, a8 as shouldEmitWarning, a9 as shouldTrackGlobalVarSources, aa as shouldWarnMissingTailwindEntry, ab as shouldWarnUnscopedMonorepo, ac as skippedSzFilesMessage, A as unplugin, ad as unscopedMonorepoMessage, ae as vitePlugin, af as webpackPlugin } from './shared/unplugin.CNwV3RrQ.cjs';
|
|
7
7
|
import 'postcss';
|
|
8
8
|
import '@csszyx/compiler';
|
|
9
9
|
import 'esbuild';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
|
|
2
2
|
export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
|
|
3
|
-
import { G as GlobalVarScanCacheKeyInput, C as CssVarScanResult, S as ScanGlobalVarCssOptions, P as PlanGlobalVarAliasesInput, a as GlobalVarAliasPlan, R as RewriteGlobalVarCssAliasesOptions, b as GlobalVarCssAliasRewriteResult, c as CreateGlobalVarAliasValidationOptionsInput, V as ValidateGlobalVarAliasInputsOptions, d as GlobalVarAliasValidationResult } from './shared/unplugin.
|
|
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 appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, A as default, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as
|
|
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.CNwV3RrQ.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 appendTailwindSourceDirective, s as assertNoRSCBoundaryViolation, t as assertNoRSCGraphViolation, u as collectMangleHybridHazards, v as computeSafelistRelPath, w as createGlobalVarMapAssetSource, x as createRSCModuleRecord, y as cssHasContentScope, z as cssImportsTailwind, A as default, B as deleteRSCModuleRecord, D as esbuildPlugin, E as extractGlobalVarAliasesForManifest, F as fileMayContainSafelistableSz, H as findLocalImportSources, I as findRSCBoundaryViolation, J as findRSCGraphViolation, K as hasInjectableTailwindCandidate, L as hasTokens, N as hasUseClientDirective, O as hasUseServerDirective, Q as isCompileSourceOptedIn, T as isHardIgnoredPath, U as isMonorepoPackage, W as isPackagesSkippedSource, X as isRSCServerModule, Y as mangleCodeClassesSync, Z as mangleEligibleClasses, _ as mangleHybridHazardMessage, $ as mergeThemes, a0 as missingTailwindEntryMessage, a1 as normalizeGlobalVarAliasesForCache, a2 as parseThemeBlocks, a3 as recordGlobalVarSourceFile, a4 as resolveCompileSourceDirs, a5 as resolveNativeCacheIdentity, a6 as rollupPlugin, a7 as scanCustomPropertyNames, a8 as shouldEmitWarning, a9 as shouldTrackGlobalVarSources, aa as shouldWarnMissingTailwindEntry, ab as shouldWarnUnscopedMonorepo, ac as skippedSzFilesMessage, A as unplugin, ad as unscopedMonorepoMessage, ae as vitePlugin, af as webpackPlugin } from './shared/unplugin.CNwV3RrQ.mjs';
|
|
5
5
|
import 'postcss';
|
|
6
6
|
import '@csszyx/compiler';
|
|
7
7
|
import 'esbuild';
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
|
|
2
|
-
export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findLocalImportSources, q as findRSCBoundaryViolation, r as findRSCGraphViolation, s as hasInjectableTailwindCandidate, t as hasTokens, v as hasUseClientDirective, w as hasUseServerDirective, x as isCompileSourceOptedIn, y as isHardIgnoredPath, z as isMonorepoPackage, A as isPackagesSkippedSource, B as isRSCServerModule, C as isTailwindReservedGlobalVar, D as mangleCodeClassesSync, E as
|
|
2
|
+
export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findLocalImportSources, q as findRSCBoundaryViolation, r as findRSCGraphViolation, s as hasInjectableTailwindCandidate, t as hasTokens, v as hasUseClientDirective, w as hasUseServerDirective, x as isCompileSourceOptedIn, y as isHardIgnoredPath, z as isMonorepoPackage, A as isPackagesSkippedSource, B as isRSCServerModule, C as isTailwindReservedGlobalVar, D as mangleCodeClassesSync, E as mangleEligibleClasses, F as mangleHybridHazardMessage, G as mergeThemes, H as missingTailwindEntryMessage, I as normalizeGlobalVarAliasesForCache, J as parseThemeBlocks, K as planGlobalVarAliases, L as readGlobalVarScanCache, M as recordGlobalVarSourceFile, N as resolveCompileSourceDirs, O as resolveGlobalVarScanCacheDir, P as resolveNativeCacheIdentity, Q as rewriteGlobalVarCssAliases, R as rollupPlugin, S as scanCustomPropertyNames, T as scanGlobalVarCss, 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.DtYxS8M8.mjs';
|
|
3
3
|
export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
|
|
4
4
|
import 'postcss';
|
|
5
5
|
import 'postcss-selector-parser';
|
|
@@ -15,7 +15,7 @@ import '@csszyx/core/native';
|
|
|
15
15
|
import '@csszyx/svelte-adapter';
|
|
16
16
|
import '@csszyx/vue-adapter';
|
|
17
17
|
import 'unplugin';
|
|
18
|
-
import './shared/unplugin.
|
|
19
|
-
import './shared/unplugin.
|
|
20
|
-
import './shared/unplugin.
|
|
18
|
+
import './shared/unplugin.nnsa7OVW.mjs';
|
|
19
|
+
import './shared/unplugin.D-K57LNR.mjs';
|
|
20
|
+
import './shared/unplugin.TtmP77BS.mjs';
|
|
21
21
|
import 'postcss-value-parser';
|
package/dist/next-config.cjs
CHANGED
package/dist/next-config.mjs
CHANGED
package/dist/next-prebuild.cjs
CHANGED
|
@@ -3,11 +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.
|
|
7
|
-
const nextWatcherCycle = require('./shared/unplugin.
|
|
8
|
-
const transformCache = require('./shared/unplugin.
|
|
6
|
+
const nextTransformMetadata = require('./shared/unplugin.DdtOZANG.cjs');
|
|
7
|
+
const nextWatcherCycle = require('./shared/unplugin.C9dMG7ye.cjs');
|
|
8
|
+
const transformCache = require('./shared/unplugin.DVCQC5wq.cjs');
|
|
9
9
|
require('@csszyx/compiler');
|
|
10
|
-
require('./shared/unplugin.
|
|
10
|
+
require('./shared/unplugin.CcA7jP1r.cjs');
|
|
11
11
|
require('node:os');
|
|
12
12
|
require('proper-lockfile');
|
|
13
13
|
|
|
@@ -143,7 +143,7 @@ function uniqueFiles(files) {
|
|
|
143
143
|
return result;
|
|
144
144
|
}
|
|
145
145
|
function createShardCacheKey(context, metadata) {
|
|
146
|
-
return node_crypto.createHash("sha256").update(context.identity.generation).update("\0").update(path__namespace.relative(context.root, metadata.sourcePath)
|
|
146
|
+
return node_crypto.createHash("sha256").update(context.identity.generation).update("\0").update(transformCache.normalizePathSeparators(path__namespace.relative(context.root, metadata.sourcePath))).digest("hex");
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
exports.runNextPrebuild = runNextPrebuild;
|
package/dist/next-prebuild.mjs
CHANGED
|
@@ -1,11 +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.
|
|
5
|
-
import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.
|
|
6
|
-
import { r as resolveTransformCacheDir } from './shared/unplugin.
|
|
4
|
+
import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.Rl8sIkHi.mjs';
|
|
5
|
+
import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.Dg1tGPSd.mjs';
|
|
6
|
+
import { r as resolveTransformCacheDir, n as normalizePathSeparators } from './shared/unplugin.D-K57LNR.mjs';
|
|
7
7
|
import '@csszyx/compiler';
|
|
8
|
-
import './shared/unplugin.
|
|
8
|
+
import './shared/unplugin.TtmP77BS.mjs';
|
|
9
9
|
import 'node:os';
|
|
10
10
|
import 'proper-lockfile';
|
|
11
11
|
|
|
@@ -126,7 +126,7 @@ function uniqueFiles(files) {
|
|
|
126
126
|
return result;
|
|
127
127
|
}
|
|
128
128
|
function createShardCacheKey(context, metadata) {
|
|
129
|
-
return createHash("sha256").update(context.identity.generation).update("\0").update(path.relative(context.root, metadata.sourcePath)
|
|
129
|
+
return createHash("sha256").update(context.identity.generation).update("\0").update(normalizePathSeparators(path.relative(context.root, metadata.sourcePath))).digest("hex");
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
export { runNextPrebuild };
|
|
@@ -4,14 +4,14 @@ 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.
|
|
8
|
-
const nextTransformMetadata = require('./shared/unplugin.
|
|
9
|
-
const runtimeImportScan = require('./shared/unplugin.
|
|
10
|
-
const transformCache = require('./shared/unplugin.
|
|
7
|
+
const nextWatcherCycle = require('./shared/unplugin.C9dMG7ye.cjs');
|
|
8
|
+
const nextTransformMetadata = require('./shared/unplugin.DdtOZANG.cjs');
|
|
9
|
+
const runtimeImportScan = require('./shared/unplugin.DmuOKVS4.cjs');
|
|
10
|
+
const transformCache = require('./shared/unplugin.DVCQC5wq.cjs');
|
|
11
11
|
require('node:fs');
|
|
12
12
|
require('node:os');
|
|
13
13
|
require('proper-lockfile');
|
|
14
|
-
require('./shared/unplugin.
|
|
14
|
+
require('./shared/unplugin.CcA7jP1r.cjs');
|
|
15
15
|
require('@csszyx/compiler');
|
|
16
16
|
|
|
17
17
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
@@ -29,7 +29,6 @@ function _interopNamespaceCompat(e) {
|
|
|
29
29
|
|
|
30
30
|
const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
|
|
31
31
|
|
|
32
|
-
const DIRECTIVE_PROLOGUE_PREFIX_RE = /^((?:\s|\/\/[^\n]*\n|\/\*(?:[^*]|\*(?!\/))*\*\/)*)(['"]use (?:client|server)['"];?\s*)/;
|
|
33
32
|
function injectNextRuntimeImports(code, usage) {
|
|
34
33
|
const helpers = runtimeHelpersFromUsage(usage);
|
|
35
34
|
if (helpers.length === 0) {
|
|
@@ -66,14 +65,16 @@ function runtimeHelpersFromUsage(usage) {
|
|
|
66
65
|
if (usage.usesColorVar) {
|
|
67
66
|
helpers.push("__szColorVar");
|
|
68
67
|
}
|
|
68
|
+
if (usage.usesSpacingVar) {
|
|
69
|
+
helpers.push("__szSpacingVar");
|
|
70
|
+
}
|
|
71
|
+
if (usage.usesUnitVar) {
|
|
72
|
+
helpers.push("__szUnitVar");
|
|
73
|
+
}
|
|
69
74
|
return helpers;
|
|
70
75
|
}
|
|
71
76
|
function insertRuntimeImport(code, importStmt) {
|
|
72
|
-
|
|
73
|
-
if (!directiveMatch) {
|
|
74
|
-
return `${importStmt}${code}`;
|
|
75
|
-
}
|
|
76
|
-
return code.replace(directiveMatch[0], `${directiveMatch[1]}${directiveMatch[2]}${importStmt}`);
|
|
77
|
+
return runtimeImportScan.insertAfterUseDirective(code, importStmt);
|
|
77
78
|
}
|
|
78
79
|
|
|
79
80
|
function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
|
|
@@ -217,7 +218,7 @@ function hasEnabledMangleVars(config) {
|
|
|
217
218
|
return config.mangleVars === true;
|
|
218
219
|
}
|
|
219
220
|
function createShardCacheKey(context, metadata) {
|
|
220
|
-
return node_crypto.createHash("sha256").update(context.identity.generation).update("\0").update(path__namespace.relative(context.root, metadata.sourcePath)
|
|
221
|
+
return node_crypto.createHash("sha256").update(context.identity.generation).update("\0").update(transformCache.normalizePathSeparators(path__namespace.relative(context.root, metadata.sourcePath))).digest("hex");
|
|
221
222
|
}
|
|
222
223
|
|
|
223
224
|
exports.default = nextTurboLoader;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
|
-
import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, v as validateNextGenerationManifest, a as readNextGenerationManifest } from './shared/unplugin.
|
|
4
|
-
import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.
|
|
5
|
-
import { i as importsRuntimeHelper } from './shared/unplugin.
|
|
6
|
-
import { r as resolveTransformCacheDir } from './shared/unplugin.
|
|
3
|
+
import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, v as validateNextGenerationManifest, a as readNextGenerationManifest } from './shared/unplugin.Dg1tGPSd.mjs';
|
|
4
|
+
import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.Rl8sIkHi.mjs';
|
|
5
|
+
import { i as importsRuntimeHelper, a as insertAfterUseDirective } from './shared/unplugin.nnsa7OVW.mjs';
|
|
6
|
+
import { r as resolveTransformCacheDir, n as normalizePathSeparators } from './shared/unplugin.D-K57LNR.mjs';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:os';
|
|
9
9
|
import 'proper-lockfile';
|
|
10
|
-
import './shared/unplugin.
|
|
10
|
+
import './shared/unplugin.TtmP77BS.mjs';
|
|
11
11
|
import '@csszyx/compiler';
|
|
12
12
|
|
|
13
|
-
const DIRECTIVE_PROLOGUE_PREFIX_RE = /^((?:\s|\/\/[^\n]*\n|\/\*(?:[^*]|\*(?!\/))*\*\/)*)(['"]use (?:client|server)['"];?\s*)/;
|
|
14
13
|
function injectNextRuntimeImports(code, usage) {
|
|
15
14
|
const helpers = runtimeHelpersFromUsage(usage);
|
|
16
15
|
if (helpers.length === 0) {
|
|
@@ -47,14 +46,16 @@ function runtimeHelpersFromUsage(usage) {
|
|
|
47
46
|
if (usage.usesColorVar) {
|
|
48
47
|
helpers.push("__szColorVar");
|
|
49
48
|
}
|
|
49
|
+
if (usage.usesSpacingVar) {
|
|
50
|
+
helpers.push("__szSpacingVar");
|
|
51
|
+
}
|
|
52
|
+
if (usage.usesUnitVar) {
|
|
53
|
+
helpers.push("__szUnitVar");
|
|
54
|
+
}
|
|
50
55
|
return helpers;
|
|
51
56
|
}
|
|
52
57
|
function insertRuntimeImport(code, importStmt) {
|
|
53
|
-
|
|
54
|
-
if (!directiveMatch) {
|
|
55
|
-
return `${importStmt}${code}`;
|
|
56
|
-
}
|
|
57
|
-
return code.replace(directiveMatch[0], `${directiveMatch[1]}${directiveMatch[2]}${importStmt}`);
|
|
58
|
+
return insertAfterUseDirective(code, importStmt);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
|
|
@@ -198,7 +199,7 @@ function hasEnabledMangleVars(config) {
|
|
|
198
199
|
return config.mangleVars === true;
|
|
199
200
|
}
|
|
200
201
|
function createShardCacheKey(context, metadata) {
|
|
201
|
-
return createHash("sha256").update(context.identity.generation).update("\0").update(path.relative(context.root, metadata.sourcePath)
|
|
202
|
+
return createHash("sha256").update(context.identity.generation).update("\0").update(normalizePathSeparators(path.relative(context.root, metadata.sourcePath))).digest("hex");
|
|
202
203
|
}
|
|
203
204
|
|
|
204
205
|
export { nextTurboLoader as default, runNextTurboLoader };
|
package/dist/next-watcher.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const path = require('node:path');
|
|
4
|
-
const nextWatcherCycle = require('./shared/unplugin.
|
|
4
|
+
const nextWatcherCycle = require('./shared/unplugin.C9dMG7ye.cjs');
|
|
5
5
|
require('node:fs');
|
|
6
6
|
require('node:crypto');
|
|
7
7
|
require('node:os');
|
|
8
8
|
require('proper-lockfile');
|
|
9
|
-
require('./shared/unplugin.
|
|
9
|
+
require('./shared/unplugin.CcA7jP1r.cjs');
|
|
10
10
|
|
|
11
11
|
function _interopNamespaceCompat(e) {
|
|
12
12
|
if (e && typeof e === 'object' && 'default' in e) return e;
|
package/dist/next-watcher.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
|
-
import { r as runNextWatcherCycle } from './shared/unplugin.
|
|
2
|
+
import { r as runNextWatcherCycle } from './shared/unplugin.Dg1tGPSd.mjs';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:crypto';
|
|
5
5
|
import 'node:os';
|
|
6
6
|
import 'proper-lockfile';
|
|
7
|
-
import './shared/unplugin.
|
|
7
|
+
import './shared/unplugin.TtmP77BS.mjs';
|
|
8
8
|
|
|
9
9
|
class NextWatcherLoop {
|
|
10
10
|
context;
|
|
@@ -5,7 +5,7 @@ const fs = require('node:fs');
|
|
|
5
5
|
const node_crypto = require('node:crypto');
|
|
6
6
|
const node_os = require('node:os');
|
|
7
7
|
const lockfile = require('proper-lockfile');
|
|
8
|
-
const htmlEscape = require('./unplugin.
|
|
8
|
+
const htmlEscape = require('./unplugin.CcA7jP1r.cjs');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
11
|
|
|
@@ -152,7 +152,7 @@ function atomicWriteFileSync(file, content, options = {}) {
|
|
|
152
152
|
const dir = path__namespace.dirname(file);
|
|
153
153
|
const tmp = path__namespace.join(
|
|
154
154
|
dir,
|
|
155
|
-
`.tmp-${path__namespace.basename(file)}-${process.pid}-${Date.now()}-${
|
|
155
|
+
`.tmp-${path__namespace.basename(file)}-${process.pid}-${Date.now()}-${node_crypto.randomUUID()}`
|
|
156
156
|
);
|
|
157
157
|
fs__namespace.mkdirSync(dir, { recursive: true });
|
|
158
158
|
fs__namespace.writeFileSync(tmp, content, "utf8");
|
|
@@ -253,8 +253,10 @@ function renderTailwindSourceHtml(classNames) {
|
|
|
253
253
|
if (classNames.length === 0) {
|
|
254
254
|
return "<!-- csszyx Next safelist: empty -->\n";
|
|
255
255
|
}
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
const structuralHtml = classNames.map((className) => `<div class="${htmlEscape.escapeHtmlAttribute(className)}"></div>`).join("\n");
|
|
257
|
+
const scannerCandidates = htmlEscape.renderTailwindScannerCandidates(classNames);
|
|
258
|
+
return `${structuralHtml}
|
|
259
|
+
${scannerCandidates}`;
|
|
258
260
|
}
|
|
259
261
|
function createLockMetadata(options) {
|
|
260
262
|
const now = new Date(options.now ?? Date.now()).toISOString();
|
|
@@ -262,7 +264,7 @@ function createLockMetadata(options) {
|
|
|
262
264
|
return {
|
|
263
265
|
version: 1,
|
|
264
266
|
pid,
|
|
265
|
-
token: options.token ?? node_crypto.
|
|
267
|
+
token: options.token ?? node_crypto.randomUUID(),
|
|
266
268
|
hostname: node_os.hostname(),
|
|
267
269
|
root: path__namespace.resolve(options.root ?? process.cwd()),
|
|
268
270
|
mode: options.mode ?? "development",
|
|
@@ -430,12 +430,17 @@ interface PluginState {
|
|
|
430
430
|
/** Memoized `isMonorepoPackage(rootDir)` result; `undefined` until computed. */
|
|
431
431
|
inMonorepo?: boolean;
|
|
432
432
|
/**
|
|
433
|
-
* Classes csszyx generated by lowering `sz` props
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
* JS that references classes by name) owns.
|
|
433
|
+
* Classes csszyx generated by lowering `sz` props. Final map eligibility
|
|
434
|
+
* subtracts authoredClasses because a class can be both generated and used
|
|
435
|
+
* by a raw selector consumer.
|
|
437
436
|
*/
|
|
438
437
|
ownedClasses: Set<string>;
|
|
438
|
+
/**
|
|
439
|
+
* Classes written through author-facing class/className attributes. Any
|
|
440
|
+
* overlap with ownedClasses must keep its original name because bundled
|
|
441
|
+
* helper calls may not preserve enough context for safe string rewriting.
|
|
442
|
+
*/
|
|
443
|
+
authoredClasses: Set<string>;
|
|
439
444
|
/** Unresolvable-spread warnings surfaced to the build log in every mode. */
|
|
440
445
|
spreadWarnings: Set<string>;
|
|
441
446
|
/**
|
|
@@ -706,6 +711,14 @@ declare function isHardIgnoredPath(id: string, sourceDirs?: readonly string[]):
|
|
|
706
711
|
* @returns true when the file should be prescanned for safelist extraction.
|
|
707
712
|
*/
|
|
708
713
|
declare function fileMayContainSafelistableSz(content: string): boolean;
|
|
714
|
+
/**
|
|
715
|
+
* Return csszyx-owned classes that are safe to rename.
|
|
716
|
+
*
|
|
717
|
+
* @param ownedClasses Classes emitted from sz transforms.
|
|
718
|
+
* @param authoredClasses Classes also written in class/className source positions.
|
|
719
|
+
* @returns Owned classes with hybrid raw consumers removed.
|
|
720
|
+
*/
|
|
721
|
+
declare function mangleEligibleClasses(ownedClasses: ReadonlySet<string>, authoredClasses: ReadonlySet<string>): string[];
|
|
709
722
|
/**
|
|
710
723
|
* Whether a file is workspace-package source that csszyx skipped only because it
|
|
711
724
|
* lives under `/packages/` and is not under any opted-in `compileSources`
|
|
@@ -836,5 +849,5 @@ declare const rollupPlugin: (options?: PartialCsszyxConfig) => InputPluginOption
|
|
|
836
849
|
*/
|
|
837
850
|
declare const esbuildPlugin: (options?: PartialCsszyxConfig) => Plugin;
|
|
838
851
|
|
|
839
|
-
export {
|
|
852
|
+
export { mergeThemes as $, unplugin as A, deleteRSCModuleRecord as B, esbuildPlugin as D, extractGlobalVarAliasesForManifest as E, fileMayContainSafelistableSz as F, findLocalImportSources as H, findRSCBoundaryViolation as I, findRSCGraphViolation as J, hasInjectableTailwindCandidate as K, hasTokens as L, hasUseClientDirective as N, hasUseServerDirective as O, isCompileSourceOptedIn as Q, isHardIgnoredPath as T, isMonorepoPackage as U, isPackagesSkippedSource as W, isRSCServerModule as X, mangleCodeClassesSync as Y, mangleEligibleClasses as Z, mangleHybridHazardMessage as _, missingTailwindEntryMessage as a0, normalizeGlobalVarAliasesForCache as a1, parseThemeBlocks as a2, recordGlobalVarSourceFile as a3, resolveCompileSourceDirs as a4, resolveNativeCacheIdentity as a5, rollupPlugin as a6, scanCustomPropertyNames as a7, shouldEmitWarning as a8, shouldTrackGlobalVarSources as a9, shouldWarnMissingTailwindEntry as aa, shouldWarnUnscopedMonorepo as ab, skippedSzFilesMessage as ac, unscopedMonorepoMessage as ad, vitePlugin as ae, webpackPlugin as af, appendTailwindSourceDirective as r, assertNoRSCBoundaryViolation as s, assertNoRSCGraphViolation as t, collectMangleHybridHazards as u, computeSafelistRelPath as v, createGlobalVarMapAssetSource as w, createRSCModuleRecord as x, cssHasContentScope as y, cssImportsTailwind as z };
|
|
840
853
|
export type { CssVarScanResult as C, GlobalVarScanCacheKeyInput as G, MangleHybridHazards as M, PlanGlobalVarAliasesInput as P, 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 };
|