@csszyx/unplugin 0.11.7 → 0.11.9
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 +9 -6
- package/dist/css-mangler.mjs +9 -6
- 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 +7 -12
- package/dist/next-turbo-loader.mjs +7 -12
- package/dist/next-watcher.cjs +2 -2
- package/dist/next-watcher.mjs +2 -2
- package/dist/shared/{unplugin.Dqt1aLCX.mjs → unplugin.7TELUwsj.mjs} +5 -3
- package/dist/shared/unplugin.B3XoSRB8.mjs +40 -0
- package/dist/shared/unplugin.BkRah5Ot.cjs +48 -0
- package/dist/shared/{unplugin.VSslRpfN.mjs → unplugin.Bqx2WfBV.mjs} +51 -50
- package/dist/shared/{unplugin.PhOFTQpB.d.cts → unplugin.CjCKWnoX.d.cts} +25 -6
- package/dist/shared/{unplugin.PhOFTQpB.d.mts → unplugin.CjCKWnoX.d.mts} +25 -6
- package/dist/shared/{unplugin.CwcOd1q3.mjs → unplugin.D-K57LNR.mjs} +6 -1
- package/dist/shared/{unplugin.ByAzFdqO.cjs → unplugin.DUI48s3S.cjs} +1181 -766
- package/dist/shared/{unplugin.D8vSG36M.cjs → unplugin.DVCQC5wq.cjs} +6 -0
- package/dist/shared/{unplugin.Rov-j_Wm.cjs → unplugin.DmuOKVS4.cjs} +21 -0
- package/dist/shared/{unplugin.D6hes1O8.cjs → unplugin.WVn08Fln.cjs} +5 -3
- package/dist/shared/{unplugin.CZKUWN1J.cjs → unplugin.jZsBqx54.cjs} +51 -50
- package/dist/shared/unplugin.nnsa7OVW.mjs +49 -0
- package/dist/shared/{unplugin.CtHwCYxE.mjs → unplugin.wx3cvxxX.mjs} +1180 -766
- 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,11 +8,12 @@ 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
|
+
if (escapedName[i] !== BACKSLASH) {
|
|
16
17
|
result += escapedName[i];
|
|
17
18
|
i++;
|
|
18
19
|
continue;
|
|
@@ -34,24 +35,26 @@ function readCssEscape(source, start) {
|
|
|
34
35
|
next++;
|
|
35
36
|
}
|
|
36
37
|
if (source[next] === " ") next++;
|
|
37
|
-
const codePoint = parseInt(hex, 16);
|
|
38
|
+
const codePoint = Number.parseInt(hex, 16);
|
|
38
39
|
return { value: codePoint > 0 ? String.fromCodePoint(codePoint) : "", next };
|
|
39
40
|
}
|
|
40
41
|
function escapeLeadingClassCharacter(className, char) {
|
|
41
42
|
if (/\d/.test(char)) {
|
|
42
|
-
return
|
|
43
|
+
return `${BACKSLASH}3${char} `;
|
|
43
44
|
}
|
|
44
45
|
if (char === "-" && className.length > 1) {
|
|
45
46
|
const next = className[1];
|
|
46
47
|
if (/\d/.test(next) || next === "-") {
|
|
47
|
-
return
|
|
48
|
+
return `${BACKSLASH}-`;
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
return null;
|
|
51
52
|
}
|
|
52
53
|
function escapeClassCharacter(char) {
|
|
53
|
-
|
|
54
|
-
|
|
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}`;
|
|
55
58
|
}
|
|
56
59
|
return char;
|
|
57
60
|
}
|
package/dist/css-mangler.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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
|
+
if (escapedName[i] !== BACKSLASH) {
|
|
9
10
|
result += escapedName[i];
|
|
10
11
|
i++;
|
|
11
12
|
continue;
|
|
@@ -27,24 +28,26 @@ function readCssEscape(source, start) {
|
|
|
27
28
|
next++;
|
|
28
29
|
}
|
|
29
30
|
if (source[next] === " ") next++;
|
|
30
|
-
const codePoint = parseInt(hex, 16);
|
|
31
|
+
const codePoint = Number.parseInt(hex, 16);
|
|
31
32
|
return { value: codePoint > 0 ? String.fromCodePoint(codePoint) : "", next };
|
|
32
33
|
}
|
|
33
34
|
function escapeLeadingClassCharacter(className, char) {
|
|
34
35
|
if (/\d/.test(char)) {
|
|
35
|
-
return
|
|
36
|
+
return `${BACKSLASH}3${char} `;
|
|
36
37
|
}
|
|
37
38
|
if (char === "-" && className.length > 1) {
|
|
38
39
|
const next = className[1];
|
|
39
40
|
if (/\d/.test(next) || next === "-") {
|
|
40
|
-
return
|
|
41
|
+
return `${BACKSLASH}-`;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
return null;
|
|
44
45
|
}
|
|
45
46
|
function escapeClassCharacter(char) {
|
|
46
|
-
|
|
47
|
-
|
|
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}`;
|
|
48
51
|
}
|
|
49
52
|
return char;
|
|
50
53
|
}
|
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.DUI48s3S.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.BkRah5Ot.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.CjCKWnoX.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.CjCKWnoX.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.CjCKWnoX.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.CjCKWnoX.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.wx3cvxxX.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.B3XoSRB8.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.jZsBqx54.cjs');
|
|
7
|
+
const nextWatcherCycle = require('./shared/unplugin.WVn08Fln.cjs');
|
|
8
|
+
const transformCache = require('./shared/unplugin.DVCQC5wq.cjs');
|
|
9
9
|
require('@csszyx/compiler');
|
|
10
|
-
require('./shared/unplugin.
|
|
10
|
+
require('./shared/unplugin.BkRah5Ot.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.Bqx2WfBV.mjs';
|
|
5
|
+
import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.7TELUwsj.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.B3XoSRB8.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.WVn08Fln.cjs');
|
|
8
|
+
const nextTransformMetadata = require('./shared/unplugin.jZsBqx54.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.BkRah5Ot.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) {
|
|
@@ -75,11 +74,7 @@ function runtimeHelpersFromUsage(usage) {
|
|
|
75
74
|
return helpers;
|
|
76
75
|
}
|
|
77
76
|
function insertRuntimeImport(code, importStmt) {
|
|
78
|
-
|
|
79
|
-
if (!directiveMatch) {
|
|
80
|
-
return `${importStmt}${code}`;
|
|
81
|
-
}
|
|
82
|
-
return code.replace(directiveMatch[0], `${directiveMatch[1]}${directiveMatch[2]}${importStmt}`);
|
|
77
|
+
return runtimeImportScan.insertAfterUseDirective(code, importStmt);
|
|
83
78
|
}
|
|
84
79
|
|
|
85
80
|
function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
|
|
@@ -223,7 +218,7 @@ function hasEnabledMangleVars(config) {
|
|
|
223
218
|
return config.mangleVars === true;
|
|
224
219
|
}
|
|
225
220
|
function createShardCacheKey(context, metadata) {
|
|
226
|
-
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");
|
|
227
222
|
}
|
|
228
223
|
|
|
229
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.7TELUwsj.mjs';
|
|
4
|
+
import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.Bqx2WfBV.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.B3XoSRB8.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) {
|
|
@@ -56,11 +55,7 @@ function runtimeHelpersFromUsage(usage) {
|
|
|
56
55
|
return helpers;
|
|
57
56
|
}
|
|
58
57
|
function insertRuntimeImport(code, importStmt) {
|
|
59
|
-
|
|
60
|
-
if (!directiveMatch) {
|
|
61
|
-
return `${importStmt}${code}`;
|
|
62
|
-
}
|
|
63
|
-
return code.replace(directiveMatch[0], `${directiveMatch[1]}${directiveMatch[2]}${importStmt}`);
|
|
58
|
+
return insertAfterUseDirective(code, importStmt);
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
function runNextTurboLoader(source, loaderContext, explicitOptions = {}) {
|
|
@@ -204,7 +199,7 @@ function hasEnabledMangleVars(config) {
|
|
|
204
199
|
return config.mangleVars === true;
|
|
205
200
|
}
|
|
206
201
|
function createShardCacheKey(context, metadata) {
|
|
207
|
-
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");
|
|
208
203
|
}
|
|
209
204
|
|
|
210
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.WVn08Fln.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.BkRah5Ot.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.7TELUwsj.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.B3XoSRB8.mjs';
|
|
8
8
|
|
|
9
9
|
class NextWatcherLoop {
|
|
10
10
|
context;
|
|
@@ -3,7 +3,7 @@ import * as fs from 'node:fs';
|
|
|
3
3
|
import { createHash, randomUUID } from 'node:crypto';
|
|
4
4
|
import { hostname } from 'node:os';
|
|
5
5
|
import lockfile from 'proper-lockfile';
|
|
6
|
-
import { s as sortStrings, e as escapeHtmlAttribute } from './unplugin.
|
|
6
|
+
import { s as sortStrings, e as escapeHtmlAttribute, r as renderTailwindScannerCandidates } from './unplugin.B3XoSRB8.mjs';
|
|
7
7
|
|
|
8
8
|
const DEFAULT_RENAME_RETRIES = 5;
|
|
9
9
|
const DEFAULT_RENAME_RETRY_DELAY_MS = 10;
|
|
@@ -233,8 +233,10 @@ function renderTailwindSourceHtml(classNames) {
|
|
|
233
233
|
if (classNames.length === 0) {
|
|
234
234
|
return "<!-- csszyx Next safelist: empty -->\n";
|
|
235
235
|
}
|
|
236
|
-
|
|
237
|
-
|
|
236
|
+
const structuralHtml = classNames.map((className) => `<div class="${escapeHtmlAttribute(className)}"></div>`).join("\n");
|
|
237
|
+
const scannerCandidates = renderTailwindScannerCandidates(classNames);
|
|
238
|
+
return `${structuralHtml}
|
|
239
|
+
${scannerCandidates}`;
|
|
238
240
|
}
|
|
239
241
|
function createLockMetadata(options) {
|
|
240
242
|
const now = new Date(options.now ?? Date.now()).toISOString();
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function sortStrings(values) {
|
|
2
|
+
return [...values].sort((a, b) => {
|
|
3
|
+
if (a < b) return -1;
|
|
4
|
+
if (a > b) return 1;
|
|
5
|
+
return 0;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const BACKSLASH = String.fromCodePoint(92);
|
|
10
|
+
function unicodeEscape(hexadecimal) {
|
|
11
|
+
return `${BACKSLASH}u${hexadecimal}`;
|
|
12
|
+
}
|
|
13
|
+
function replaceEveryLiteral(value, search, replacement) {
|
|
14
|
+
return value.replaceAll(search, () => replacement);
|
|
15
|
+
}
|
|
16
|
+
function escapeSingleQuotedString(value) {
|
|
17
|
+
let escaped = replaceEveryLiteral(value, BACKSLASH, BACKSLASH.repeat(2));
|
|
18
|
+
escaped = replaceEveryLiteral(escaped, "'", `${BACKSLASH}'`);
|
|
19
|
+
escaped = replaceEveryLiteral(escaped, "\r", `${BACKSLASH}r`);
|
|
20
|
+
return replaceEveryLiteral(escaped, "\n", `${BACKSLASH}n`);
|
|
21
|
+
}
|
|
22
|
+
function escapeDoubleQuotedString(value) {
|
|
23
|
+
const escaped = replaceEveryLiteral(value, BACKSLASH, BACKSLASH.repeat(2));
|
|
24
|
+
return replaceEveryLiteral(escaped, '"', `${BACKSLASH}"`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function escapeHtmlAttribute(value) {
|
|
28
|
+
let escaped = replaceEveryLiteral(value, "&", "&");
|
|
29
|
+
escaped = replaceEveryLiteral(escaped, '"', """);
|
|
30
|
+
escaped = replaceEveryLiteral(escaped, "<", "<");
|
|
31
|
+
return replaceEveryLiteral(escaped, ">", ">");
|
|
32
|
+
}
|
|
33
|
+
const RAW_SAFELIST_MARKER = "<!-- csszyx exact scanner candidates -->";
|
|
34
|
+
function renderTailwindScannerCandidates(classNames) {
|
|
35
|
+
return `${RAW_SAFELIST_MARKER}
|
|
36
|
+
${classNames.join("\n")}
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { replaceEveryLiteral as a, escapeDoubleQuotedString as b, escapeSingleQuotedString as c, escapeHtmlAttribute as e, renderTailwindScannerCandidates as r, sortStrings as s, unicodeEscape as u };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function sortStrings(values) {
|
|
4
|
+
return [...values].sort((a, b) => {
|
|
5
|
+
if (a < b) return -1;
|
|
6
|
+
if (a > b) return 1;
|
|
7
|
+
return 0;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const BACKSLASH = String.fromCodePoint(92);
|
|
12
|
+
function unicodeEscape(hexadecimal) {
|
|
13
|
+
return `${BACKSLASH}u${hexadecimal}`;
|
|
14
|
+
}
|
|
15
|
+
function replaceEveryLiteral(value, search, replacement) {
|
|
16
|
+
return value.replaceAll(search, () => replacement);
|
|
17
|
+
}
|
|
18
|
+
function escapeSingleQuotedString(value) {
|
|
19
|
+
let escaped = replaceEveryLiteral(value, BACKSLASH, BACKSLASH.repeat(2));
|
|
20
|
+
escaped = replaceEveryLiteral(escaped, "'", `${BACKSLASH}'`);
|
|
21
|
+
escaped = replaceEveryLiteral(escaped, "\r", `${BACKSLASH}r`);
|
|
22
|
+
return replaceEveryLiteral(escaped, "\n", `${BACKSLASH}n`);
|
|
23
|
+
}
|
|
24
|
+
function escapeDoubleQuotedString(value) {
|
|
25
|
+
const escaped = replaceEveryLiteral(value, BACKSLASH, BACKSLASH.repeat(2));
|
|
26
|
+
return replaceEveryLiteral(escaped, '"', `${BACKSLASH}"`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function escapeHtmlAttribute(value) {
|
|
30
|
+
let escaped = replaceEveryLiteral(value, "&", "&");
|
|
31
|
+
escaped = replaceEveryLiteral(escaped, '"', """);
|
|
32
|
+
escaped = replaceEveryLiteral(escaped, "<", "<");
|
|
33
|
+
return replaceEveryLiteral(escaped, ">", ">");
|
|
34
|
+
}
|
|
35
|
+
const RAW_SAFELIST_MARKER = "<!-- csszyx exact scanner candidates -->";
|
|
36
|
+
function renderTailwindScannerCandidates(classNames) {
|
|
37
|
+
return `${RAW_SAFELIST_MARKER}
|
|
38
|
+
${classNames.join("\n")}
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.escapeDoubleQuotedString = escapeDoubleQuotedString;
|
|
43
|
+
exports.escapeHtmlAttribute = escapeHtmlAttribute;
|
|
44
|
+
exports.escapeSingleQuotedString = escapeSingleQuotedString;
|
|
45
|
+
exports.renderTailwindScannerCandidates = renderTailwindScannerCandidates;
|
|
46
|
+
exports.replaceEveryLiteral = replaceEveryLiteral;
|
|
47
|
+
exports.sortStrings = sortStrings;
|
|
48
|
+
exports.unicodeEscape = unicodeEscape;
|