@csszyx/unplugin 0.10.8 → 0.10.10
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/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/next-prebuild.cjs +3 -3
- package/dist/next-prebuild.mjs +3 -3
- package/dist/next-turbo-loader.cjs +3 -3
- package/dist/next-turbo-loader.mjs +3 -3
- package/dist/next-watcher.cjs +2 -2
- package/dist/next-watcher.mjs +2 -2
- package/dist/shared/unplugin.B1mblcm-.mjs +9 -0
- package/dist/shared/{unplugin.DoBHTRra.cjs → unplugin.BCwRIUs_.cjs} +5 -0
- package/dist/shared/{unplugin.Cwe-dz1f.cjs → unplugin.BFN_Ueyx.cjs} +7 -7
- package/dist/shared/{unplugin.C3H4KqpP.cjs → unplugin.BImj9Vcx.cjs} +3 -2
- package/dist/shared/{unplugin.mdW7U-K4.mjs → unplugin.Ble541_h.mjs} +47 -33
- package/dist/shared/{unplugin.CLjhn81z.mjs → unplugin.ChwZMl_w.mjs} +7 -7
- package/dist/shared/{unplugin.DlGyBb8o.cjs → unplugin.Cq_8AIBn.cjs} +48 -34
- package/dist/shared/{unplugin.D2_Q3rOU.mjs → unplugin.uLmLkr10.mjs} +3 -2
- package/dist/vite.cjs +2 -2
- package/dist/vite.mjs +2 -2
- package/dist/webpack.cjs +2 -2
- package/dist/webpack.mjs +2 -2
- package/package.json +8 -8
- package/dist/shared/unplugin.3UumZ5gn.mjs +0 -5
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.Cq_8AIBn.cjs');
|
|
7
7
|
const types = require('@csszyx/types');
|
|
8
8
|
require('postcss');
|
|
9
9
|
require('postcss-selector-parser');
|
|
@@ -18,7 +18,7 @@ require('@csszyx/core/native');
|
|
|
18
18
|
require('@csszyx/svelte-adapter');
|
|
19
19
|
require('@csszyx/vue-adapter');
|
|
20
20
|
require('unplugin');
|
|
21
|
-
require('./shared/unplugin.
|
|
21
|
+
require('./shared/unplugin.BCwRIUs_.cjs');
|
|
22
22
|
require('node:crypto');
|
|
23
23
|
require('./shared/unplugin.pmTknYLy.cjs');
|
|
24
24
|
require('postcss-value-parser');
|
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 findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasTokens, t as hasUseClientDirective, v as hasUseServerDirective, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMonorepoPackage, z as isPackagesSkippedSource, A as isRSCServerModule, B as isTailwindReservedGlobalVar, C as mangleCodeClassesSync, D as mangleHybridHazardMessage, E as mergeThemes, F as missingTailwindEntryMessage, G as normalizeGlobalVarAliasesForCache, H as parseThemeBlocks, I as planGlobalVarAliases, J as readGlobalVarScanCache, K as resolveCompileSourceDirs, L as resolveGlobalVarScanCacheDir, M as resolveNativeCacheIdentity, N as rewriteGlobalVarCssAliases, O as rollupPlugin, P as scanGlobalVarCss, Q as shouldEmitWarning, R as shouldWarnMissingTailwindEntry, S as shouldWarnUnscopedMonorepo, T as skippedSzFilesMessage, u as unplugin, U as unscopedMonorepoMessage, V as validateGlobalVarAliasInputs, W as vitePlugin, X as webpackPlugin, Y as writeGlobalVarScanCache } from './shared/unplugin.
|
|
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 findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasTokens, t as hasUseClientDirective, v as hasUseServerDirective, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMonorepoPackage, z as isPackagesSkippedSource, A as isRSCServerModule, B as isTailwindReservedGlobalVar, C as mangleCodeClassesSync, D as mangleHybridHazardMessage, E as mergeThemes, F as missingTailwindEntryMessage, G as normalizeGlobalVarAliasesForCache, H as parseThemeBlocks, I as planGlobalVarAliases, J as readGlobalVarScanCache, K as resolveCompileSourceDirs, L as resolveGlobalVarScanCacheDir, M as resolveNativeCacheIdentity, N as rewriteGlobalVarCssAliases, O as rollupPlugin, P as scanGlobalVarCss, Q as shouldEmitWarning, R as shouldWarnMissingTailwindEntry, S as shouldWarnUnscopedMonorepo, T as skippedSzFilesMessage, u as unplugin, U as unscopedMonorepoMessage, V as validateGlobalVarAliasInputs, W as vitePlugin, X as webpackPlugin, Y as writeGlobalVarScanCache } from './shared/unplugin.Ble541_h.mjs';
|
|
3
3
|
export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
|
|
4
4
|
import 'postcss';
|
|
5
5
|
import 'postcss-selector-parser';
|
|
@@ -14,7 +14,7 @@ import '@csszyx/core/native';
|
|
|
14
14
|
import '@csszyx/svelte-adapter';
|
|
15
15
|
import '@csszyx/vue-adapter';
|
|
16
16
|
import 'unplugin';
|
|
17
|
-
import './shared/unplugin.
|
|
17
|
+
import './shared/unplugin.B1mblcm-.mjs';
|
|
18
18
|
import 'node:crypto';
|
|
19
19
|
import './shared/unplugin.BpWUtI9U.mjs';
|
|
20
20
|
import 'postcss-value-parser';
|
package/dist/next-prebuild.cjs
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
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.
|
|
6
|
+
const nextTransformMetadata = require('./shared/unplugin.BImj9Vcx.cjs');
|
|
7
|
+
const nextWatcherCycle = require('./shared/unplugin.BFN_Ueyx.cjs');
|
|
8
8
|
const transformCache = require('./shared/unplugin.pmTknYLy.cjs');
|
|
9
9
|
require('@csszyx/compiler');
|
|
10
|
+
require('./shared/unplugin.BCwRIUs_.cjs');
|
|
10
11
|
require('node:os');
|
|
11
12
|
require('proper-lockfile');
|
|
12
|
-
require('./shared/unplugin.DoBHTRra.cjs');
|
|
13
13
|
|
|
14
14
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
15
15
|
function _interopNamespaceCompat(e) {
|
package/dist/next-prebuild.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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.
|
|
4
|
+
import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.uLmLkr10.mjs';
|
|
5
|
+
import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle } from './shared/unplugin.ChwZMl_w.mjs';
|
|
6
6
|
import { r as resolveTransformCacheDir } from './shared/unplugin.BpWUtI9U.mjs';
|
|
7
7
|
import '@csszyx/compiler';
|
|
8
|
+
import './shared/unplugin.B1mblcm-.mjs';
|
|
8
9
|
import 'node:os';
|
|
9
10
|
import 'proper-lockfile';
|
|
10
|
-
import './shared/unplugin.3UumZ5gn.mjs';
|
|
11
11
|
|
|
12
12
|
function runNextPrebuild(options) {
|
|
13
13
|
assertProductionManglingBoundary(options);
|
|
@@ -4,13 +4,13 @@ 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.
|
|
7
|
+
const nextWatcherCycle = require('./shared/unplugin.BFN_Ueyx.cjs');
|
|
8
|
+
const nextTransformMetadata = require('./shared/unplugin.BImj9Vcx.cjs');
|
|
9
9
|
const transformCache = require('./shared/unplugin.pmTknYLy.cjs');
|
|
10
10
|
require('node:fs');
|
|
11
11
|
require('node:os');
|
|
12
12
|
require('proper-lockfile');
|
|
13
|
-
require('./shared/unplugin.
|
|
13
|
+
require('./shared/unplugin.BCwRIUs_.cjs');
|
|
14
14
|
require('@csszyx/compiler');
|
|
15
15
|
|
|
16
16
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
@@ -1,12 +1,12 @@
|
|
|
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.
|
|
3
|
+
import { c as createNextStateContext, w as writeNextSafelistShard, r as runNextWatcherCycle, v as validateNextGenerationManifest, a as readNextGenerationManifest } from './shared/unplugin.ChwZMl_w.mjs';
|
|
4
|
+
import { r as readPackageVersion, t as transformNextSource, c as collectNextTransformMetadata, a as createNextSafelistShardFromMetadata } from './shared/unplugin.uLmLkr10.mjs';
|
|
5
5
|
import { r as resolveTransformCacheDir } from './shared/unplugin.BpWUtI9U.mjs';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:os';
|
|
8
8
|
import 'proper-lockfile';
|
|
9
|
-
import './shared/unplugin.
|
|
9
|
+
import './shared/unplugin.B1mblcm-.mjs';
|
|
10
10
|
import '@csszyx/compiler';
|
|
11
11
|
|
|
12
12
|
const DIRECTIVE_PROLOGUE_PREFIX_RE = /^((?:\s|\/\/[^\n]*\n|\/\*(?:[^*]|\*(?!\/))*\*\/)*)(['"]use (?:client|server)['"];?\s*)/;
|
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.BFN_Ueyx.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.BCwRIUs_.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.ChwZMl_w.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.B1mblcm-.mjs';
|
|
8
8
|
|
|
9
9
|
class NextWatcherLoop {
|
|
10
10
|
context;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function sortStrings(values) {
|
|
2
|
+
return [...values].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function escapeHtmlAttribute(value) {
|
|
6
|
+
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { escapeHtmlAttribute as e, sortStrings as s };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
function sortStrings(values) {
|
|
4
|
+
return [...values].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
function escapeHtmlAttribute(value) {
|
|
4
8
|
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
exports.escapeHtmlAttribute = escapeHtmlAttribute;
|
|
12
|
+
exports.sortStrings = sortStrings;
|
|
@@ -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.BCwRIUs_.cjs');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
11
|
|
|
@@ -62,8 +62,8 @@ function materializeNextSafelist(paths, options = {}) {
|
|
|
62
62
|
recordsBySource.set(record.data.sourcePath, record);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const sortedSources = [...recordsBySource.values()].map(({ data }) => [data.sourcePath,
|
|
66
|
-
const classNames =
|
|
65
|
+
const sortedSources = [...recordsBySource.values()].map(({ data }) => [data.sourcePath, htmlEscape.sortStrings(new Set(data.classes))]).sort(([left], [right]) => left.localeCompare(right));
|
|
66
|
+
const classNames = htmlEscape.sortStrings(new Set(sortedSources.flatMap(([, classSet]) => classSet)));
|
|
67
67
|
const snapshot = {
|
|
68
68
|
version: 1,
|
|
69
69
|
sources: sortedSources.map(([sourcePath, classSet]) => [sourcePath, classSet])
|
|
@@ -192,9 +192,9 @@ function isExistingShardEquivalent(filePath, shard) {
|
|
|
192
192
|
}
|
|
193
193
|
function normalizeShardInput(input) {
|
|
194
194
|
const sourcePath = path__namespace.resolve(input.sourcePath);
|
|
195
|
-
const classes =
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
const classes = htmlEscape.sortStrings(
|
|
196
|
+
new Set(input.classes.map((className) => className.trim()).filter(Boolean))
|
|
197
|
+
);
|
|
198
198
|
const cacheKey = input.cacheKey ?? node_crypto.createHash("sha256").update(sourcePath).update("\0").update(input.sourceHash).digest("hex");
|
|
199
199
|
return {
|
|
200
200
|
version: 1,
|
|
@@ -469,7 +469,7 @@ function stableStringify(value) {
|
|
|
469
469
|
}
|
|
470
470
|
function pickEnv(env, envKeys) {
|
|
471
471
|
const selected = {};
|
|
472
|
-
for (const key of
|
|
472
|
+
for (const key of htmlEscape.sortStrings(new Set(envKeys))) {
|
|
473
473
|
const value = env[key];
|
|
474
474
|
if (value !== void 0) {
|
|
475
475
|
selected[key] = value;
|
|
@@ -4,6 +4,7 @@ const fs = require('node:fs');
|
|
|
4
4
|
const compiler = require('@csszyx/compiler');
|
|
5
5
|
const transformCache = require('./unplugin.pmTknYLy.cjs');
|
|
6
6
|
const node_crypto = require('node:crypto');
|
|
7
|
+
const htmlEscape = require('./unplugin.BCwRIUs_.cjs');
|
|
7
8
|
|
|
8
9
|
function readPackageVersion(relativePackageJson, fromUrl) {
|
|
9
10
|
try {
|
|
@@ -197,8 +198,8 @@ function collectNextTransformMetadata(result, source, sourcePath) {
|
|
|
197
198
|
return {
|
|
198
199
|
sourcePath,
|
|
199
200
|
sourceHash: node_crypto.createHash("sha256").update(source).digest("hex"),
|
|
200
|
-
classes:
|
|
201
|
-
rawClassNames:
|
|
201
|
+
classes: htmlEscape.sortStrings(classes),
|
|
202
|
+
rawClassNames: htmlEscape.sortStrings(result.rawClassNames),
|
|
202
203
|
recoveryTokenCount: result.recoveryTokens.size,
|
|
203
204
|
cssVariableCount: result.cssVariableMap.size
|
|
204
205
|
};
|
|
@@ -5,7 +5,7 @@ import * as path from 'node:path';
|
|
|
5
5
|
import { dirname } from 'node:path';
|
|
6
6
|
import { performance } from 'node:perf_hooks';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import { scanGlobalVarUsages, ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transformRustBatch, transform, isRustTransformAvailable } from '@csszyx/compiler';
|
|
8
|
+
import { scanGlobalVarUsages, sortStrings as sortStrings$1, ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transformRustBatch, transform, isRustTransformAvailable } from '@csszyx/compiler';
|
|
9
9
|
import { encode, compute_mangle_checksum } from '@csszyx/core';
|
|
10
10
|
import { getNativePackageName } from '@csszyx/core/native';
|
|
11
11
|
import { preprocess as preprocess$1 } from '@csszyx/svelte-adapter';
|
|
@@ -13,7 +13,7 @@ import { isTailwindReservedCustomProperty, CSSZYX_GLOBAL_ALIAS_PREFIX, isCsszyxG
|
|
|
13
13
|
import { preprocess } from '@csszyx/vue-adapter';
|
|
14
14
|
import { createUnplugin } from 'unplugin';
|
|
15
15
|
import { mangleCSSSync } from '../css-mangler.mjs';
|
|
16
|
-
import { e as escapeHtmlAttribute } from './unplugin.
|
|
16
|
+
import { s as sortStrings, e as escapeHtmlAttribute } from './unplugin.B1mblcm-.mjs';
|
|
17
17
|
import { createHash } from 'node:crypto';
|
|
18
18
|
import { r as resolveTransformCacheDir, c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache, e as evictOldTransformCacheEntries } from './unplugin.BpWUtI9U.mjs';
|
|
19
19
|
import postcss from 'postcss';
|
|
@@ -145,7 +145,7 @@ function scanGlobalVarCss(css, options = {}) {
|
|
|
145
145
|
filePath,
|
|
146
146
|
definitions,
|
|
147
147
|
references,
|
|
148
|
-
registered:
|
|
148
|
+
registered: sortStrings(registered),
|
|
149
149
|
thirdParty: isThirdPartyCssPath(filePath)
|
|
150
150
|
};
|
|
151
151
|
}
|
|
@@ -164,7 +164,7 @@ function extractVarReferences(value) {
|
|
|
164
164
|
for (const match of value.matchAll(VAR_REFERENCE_RE)) {
|
|
165
165
|
references.add(match[1]);
|
|
166
166
|
}
|
|
167
|
-
return
|
|
167
|
+
return sortStrings(references);
|
|
168
168
|
}
|
|
169
169
|
function isThirdPartyCssPath(filePath) {
|
|
170
170
|
return filePath.split(/[\\/]/).includes("node_modules");
|
|
@@ -205,9 +205,9 @@ function planGlobalVarAliases(input) {
|
|
|
205
205
|
entries.push({
|
|
206
206
|
original,
|
|
207
207
|
alias,
|
|
208
|
-
scopes:
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
scopes: sortStrings(
|
|
209
|
+
new Set((definitions.get(original) ?? []).map((definition) => definition.scopeId))
|
|
210
|
+
)
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
return {
|
|
@@ -240,7 +240,7 @@ function collectCandidates(input, definitions) {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
return
|
|
243
|
+
return sortStrings(candidates);
|
|
244
244
|
}
|
|
245
245
|
function validateCandidates(candidates, definitions, reserved, aliasPrefix) {
|
|
246
246
|
const diagnostics = [];
|
|
@@ -1114,12 +1114,12 @@ function parseThemeBlocks(cssContent) {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
1116
|
return {
|
|
1117
|
-
colors:
|
|
1118
|
-
spacings:
|
|
1119
|
-
fonts:
|
|
1120
|
-
radii:
|
|
1121
|
-
shadows:
|
|
1122
|
-
breakpoints:
|
|
1117
|
+
colors: sortStrings(result.colors),
|
|
1118
|
+
spacings: sortStrings(result.spacings),
|
|
1119
|
+
fonts: sortStrings(result.fonts),
|
|
1120
|
+
radii: sortStrings(result.radii),
|
|
1121
|
+
shadows: sortStrings(result.shadows),
|
|
1122
|
+
breakpoints: sortStrings(result.breakpoints)
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
1125
1125
|
function mergeThemes(themes) {
|
|
@@ -1142,12 +1142,12 @@ function mergeThemes(themes) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
return {
|
|
1145
|
-
colors:
|
|
1146
|
-
spacings:
|
|
1147
|
-
fonts:
|
|
1148
|
-
radii:
|
|
1149
|
-
shadows:
|
|
1150
|
-
breakpoints:
|
|
1145
|
+
colors: sortStrings(merged.colors),
|
|
1146
|
+
spacings: sortStrings(merged.spacings),
|
|
1147
|
+
fonts: sortStrings(merged.fonts),
|
|
1148
|
+
radii: sortStrings(merged.radii),
|
|
1149
|
+
shadows: sortStrings(merged.shadows),
|
|
1150
|
+
breakpoints: sortStrings(merged.breakpoints)
|
|
1151
1151
|
};
|
|
1152
1152
|
}
|
|
1153
1153
|
function hasTokens(theme) {
|
|
@@ -1267,7 +1267,7 @@ function expandFilePatterns(rootDir, patterns) {
|
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
|
-
return
|
|
1270
|
+
return sortStrings(files);
|
|
1271
1271
|
}
|
|
1272
1272
|
|
|
1273
1273
|
function safeJsonForScriptTag(value, prettyPrint = false) {
|
|
@@ -1361,7 +1361,7 @@ function buildRecoveryManifest(tokens, options) {
|
|
|
1361
1361
|
const stripped = options.production === true;
|
|
1362
1362
|
const strippedDevOnlyPaths = [];
|
|
1363
1363
|
const sorted = {};
|
|
1364
|
-
const sortedKeys =
|
|
1364
|
+
const sortedKeys = sortStrings(tokens.keys());
|
|
1365
1365
|
for (const key of sortedKeys) {
|
|
1366
1366
|
const data = tokens.get(key);
|
|
1367
1367
|
if (!data) {
|
|
@@ -1672,8 +1672,10 @@ function missingTailwindEntryMessage(ownedClassCount) {
|
|
|
1672
1672
|
}
|
|
1673
1673
|
function collectMangleHybridHazards(mangleMap, mangledSources, externalClasses) {
|
|
1674
1674
|
const tokenValues = new Set(Object.values(mangleMap));
|
|
1675
|
-
const collisions = [...tokenValues].filter((token) => externalClasses.has(token))
|
|
1676
|
-
const orphans =
|
|
1675
|
+
const collisions = sortStrings$1([...tokenValues].filter((token) => externalClasses.has(token)));
|
|
1676
|
+
const orphans = sortStrings$1(
|
|
1677
|
+
Object.keys(mangleMap).filter((source) => !mangledSources.has(source))
|
|
1678
|
+
);
|
|
1677
1679
|
return { collisions, orphans };
|
|
1678
1680
|
}
|
|
1679
1681
|
function mangleHybridHazardMessage(hazards) {
|
|
@@ -1795,7 +1797,7 @@ function isHardIgnoredPath(id, sourceDirs = []) {
|
|
|
1795
1797
|
return false;
|
|
1796
1798
|
}
|
|
1797
1799
|
function fileMayContainSafelistableSz(content) {
|
|
1798
|
-
return content.includes("sz=") || content.includes("sz:") || content.includes("szv(");
|
|
1800
|
+
return content.includes("sz=") || content.includes("szs=") || content.includes("sz:") || content.includes("szv(");
|
|
1799
1801
|
}
|
|
1800
1802
|
function isPackagesSkippedSource(id, sourceDirs = []) {
|
|
1801
1803
|
const p = normalizeForMatch(id);
|
|
@@ -1953,7 +1955,7 @@ CSS alias plan ${actualJson} does not match source-transform alias table ${expec
|
|
|
1953
1955
|
}
|
|
1954
1956
|
function buildVarMangleMap(entriesByFile) {
|
|
1955
1957
|
const next = {};
|
|
1956
|
-
const files =
|
|
1958
|
+
const files = sortStrings$1(entriesByFile.keys());
|
|
1957
1959
|
for (const file of files) {
|
|
1958
1960
|
for (const [original, mangled] of entriesByFile.get(file) ?? []) {
|
|
1959
1961
|
addVarMangleMapping(next, original, mangled);
|
|
@@ -2002,7 +2004,7 @@ function createEarlyGlobalVarAliasEntries(config, aliasPrefix) {
|
|
|
2002
2004
|
if (config?.enabled !== true || !config.tokens || config.tokens.length === 0) {
|
|
2003
2005
|
return [];
|
|
2004
2006
|
}
|
|
2005
|
-
const tokens =
|
|
2007
|
+
const tokens = sortStrings$1(new Set(config.tokens));
|
|
2006
2008
|
return tokens.map((original, index) => [original, `${aliasPrefix}${encode(index)}`]);
|
|
2007
2009
|
}
|
|
2008
2010
|
function shouldEmitGlobalVarMapAsset(config) {
|
|
@@ -2089,7 +2091,7 @@ function collectCSSVariableMetrics(code) {
|
|
|
2089
2091
|
}
|
|
2090
2092
|
function buildCSSVariableMetrics(metricsByFile) {
|
|
2091
2093
|
const total = emptyCSSVariableMetrics();
|
|
2092
|
-
for (const file of
|
|
2094
|
+
for (const file of sortStrings$1(metricsByFile.keys())) {
|
|
2093
2095
|
const metrics = metricsByFile.get(file);
|
|
2094
2096
|
if (!metrics) {
|
|
2095
2097
|
continue;
|
|
@@ -2403,6 +2405,16 @@ function mangleCodeClassesSync(code, mangleMap) {
|
|
|
2403
2405
|
}
|
|
2404
2406
|
return `${sep}${ws}"${mangled.join(" ")}"`;
|
|
2405
2407
|
});
|
|
2408
|
+
result = result.replace(/\bszs:\s*\{([^{}]*)\}/g, (whole, body) => {
|
|
2409
|
+
const mangledBody = body.replace(
|
|
2410
|
+
/"((?:[^"\\]|\\.)*)"/g,
|
|
2411
|
+
(_m, inner) => `"${mangleClassString(inner)}"`
|
|
2412
|
+
).replace(
|
|
2413
|
+
/'((?:[^'\\]|\\.)*)'/g,
|
|
2414
|
+
(_m, inner) => `'${mangleClassString(inner)}'`
|
|
2415
|
+
);
|
|
2416
|
+
return whole.replace(body, mangledBody);
|
|
2417
|
+
});
|
|
2406
2418
|
return result;
|
|
2407
2419
|
}
|
|
2408
2420
|
function assertGlobalVarMangleConfig(options) {
|
|
@@ -2819,7 +2831,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
2819
2831
|
} catch {
|
|
2820
2832
|
return;
|
|
2821
2833
|
}
|
|
2822
|
-
if (content.includes("sz=") || content.includes("sz:")) {
|
|
2834
|
+
if (content.includes("sz=") || content.includes("szs=") || content.includes("sz:")) {
|
|
2823
2835
|
state.skippedSzFiles.add(filePath);
|
|
2824
2836
|
}
|
|
2825
2837
|
}
|
|
@@ -3138,7 +3150,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3138
3150
|
let usesColorVar = false;
|
|
3139
3151
|
let transformed = false;
|
|
3140
3152
|
let szClasses;
|
|
3141
|
-
const hasSzProp = code.includes("sz=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
|
|
3153
|
+
const hasSzProp = code.includes("sz=") || code.includes("szs=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
|
|
3142
3154
|
if (hasSzProp) {
|
|
3143
3155
|
if (id.endsWith(".vue")) {
|
|
3144
3156
|
const result = preprocess(code, options);
|
|
@@ -3281,7 +3293,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3281
3293
|
}
|
|
3282
3294
|
if (!state.skipWarningEmitted && state.skippedSzFiles.size > 0) {
|
|
3283
3295
|
state.skipWarningEmitted = true;
|
|
3284
|
-
emitWarning(skippedSzFilesMessage(
|
|
3296
|
+
emitWarning(skippedSzFilesMessage(sortStrings$1(state.skippedSzFiles)), {
|
|
3285
3297
|
devOnly: true
|
|
3286
3298
|
});
|
|
3287
3299
|
}
|
|
@@ -3367,7 +3379,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3367
3379
|
} catch {
|
|
3368
3380
|
return;
|
|
3369
3381
|
}
|
|
3370
|
-
if (!fileContent.includes("sz=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
|
|
3382
|
+
if (!fileContent.includes("sz=") && !fileContent.includes("szs=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
|
|
3371
3383
|
recordGlobalVarSourceFile(state, ctx.file, fileContent);
|
|
3372
3384
|
recordFileVarMangleEntries(state, ctx.file, []);
|
|
3373
3385
|
recordFileCSSVariableMetrics(state, ctx.file, null);
|
|
@@ -3422,7 +3434,9 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3422
3434
|
finalizeMangleMap();
|
|
3423
3435
|
const injectedMangleMap = manglingEnabled ? state.mangleMap : {};
|
|
3424
3436
|
let result = transformIndexHtml(html, injectedMangleMap, state.checksum, {
|
|
3425
|
-
|
|
3437
|
+
// Always 'script'; the checksum itself is injected by
|
|
3438
|
+
// injectHydrationData regardless of this mode.
|
|
3439
|
+
mode: "script",
|
|
3426
3440
|
minify: process.env.NODE_ENV === "production",
|
|
3427
3441
|
varMangleMap: state.varMangleMap,
|
|
3428
3442
|
globalVarAliasPrefix
|
|
@@ -3,7 +3,7 @@ import * as fs from 'node:fs';
|
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
import { hostname } from 'node:os';
|
|
5
5
|
import lockfile from 'proper-lockfile';
|
|
6
|
-
import { e as escapeHtmlAttribute } from './unplugin.
|
|
6
|
+
import { s as sortStrings, e as escapeHtmlAttribute } from './unplugin.B1mblcm-.mjs';
|
|
7
7
|
|
|
8
8
|
const DEFAULT_RENAME_RETRIES = 5;
|
|
9
9
|
const DEFAULT_RENAME_RETRY_DELAY_MS = 10;
|
|
@@ -42,8 +42,8 @@ function materializeNextSafelist(paths, options = {}) {
|
|
|
42
42
|
recordsBySource.set(record.data.sourcePath, record);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
const sortedSources = [...recordsBySource.values()].map(({ data }) => [data.sourcePath,
|
|
46
|
-
const classNames =
|
|
45
|
+
const sortedSources = [...recordsBySource.values()].map(({ data }) => [data.sourcePath, sortStrings(new Set(data.classes))]).sort(([left], [right]) => left.localeCompare(right));
|
|
46
|
+
const classNames = sortStrings(new Set(sortedSources.flatMap(([, classSet]) => classSet)));
|
|
47
47
|
const snapshot = {
|
|
48
48
|
version: 1,
|
|
49
49
|
sources: sortedSources.map(([sourcePath, classSet]) => [sourcePath, classSet])
|
|
@@ -172,9 +172,9 @@ function isExistingShardEquivalent(filePath, shard) {
|
|
|
172
172
|
}
|
|
173
173
|
function normalizeShardInput(input) {
|
|
174
174
|
const sourcePath = path.resolve(input.sourcePath);
|
|
175
|
-
const classes =
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
const classes = sortStrings(
|
|
176
|
+
new Set(input.classes.map((className) => className.trim()).filter(Boolean))
|
|
177
|
+
);
|
|
178
178
|
const cacheKey = input.cacheKey ?? createHash("sha256").update(sourcePath).update("\0").update(input.sourceHash).digest("hex");
|
|
179
179
|
return {
|
|
180
180
|
version: 1,
|
|
@@ -449,7 +449,7 @@ function stableStringify(value) {
|
|
|
449
449
|
}
|
|
450
450
|
function pickEnv(env, envKeys) {
|
|
451
451
|
const selected = {};
|
|
452
|
-
for (const key of
|
|
452
|
+
for (const key of sortStrings(new Set(envKeys))) {
|
|
453
453
|
const value = env[key];
|
|
454
454
|
if (value !== void 0) {
|
|
455
455
|
selected[key] = value;
|
|
@@ -13,7 +13,7 @@ const types = require('@csszyx/types');
|
|
|
13
13
|
const vueAdapter = require('@csszyx/vue-adapter');
|
|
14
14
|
const unplugin$1 = require('unplugin');
|
|
15
15
|
const cssMangler = require('../css-mangler.cjs');
|
|
16
|
-
const htmlEscape = require('./unplugin.
|
|
16
|
+
const htmlEscape = require('./unplugin.BCwRIUs_.cjs');
|
|
17
17
|
const node_crypto = require('node:crypto');
|
|
18
18
|
const transformCache = require('./unplugin.pmTknYLy.cjs');
|
|
19
19
|
const postcss = require('postcss');
|
|
@@ -165,7 +165,7 @@ function scanGlobalVarCss(css, options = {}) {
|
|
|
165
165
|
filePath,
|
|
166
166
|
definitions,
|
|
167
167
|
references,
|
|
168
|
-
registered:
|
|
168
|
+
registered: htmlEscape.sortStrings(registered),
|
|
169
169
|
thirdParty: isThirdPartyCssPath(filePath)
|
|
170
170
|
};
|
|
171
171
|
}
|
|
@@ -184,7 +184,7 @@ function extractVarReferences(value) {
|
|
|
184
184
|
for (const match of value.matchAll(VAR_REFERENCE_RE)) {
|
|
185
185
|
references.add(match[1]);
|
|
186
186
|
}
|
|
187
|
-
return
|
|
187
|
+
return htmlEscape.sortStrings(references);
|
|
188
188
|
}
|
|
189
189
|
function isThirdPartyCssPath(filePath) {
|
|
190
190
|
return filePath.split(/[\\/]/).includes("node_modules");
|
|
@@ -225,9 +225,9 @@ function planGlobalVarAliases(input) {
|
|
|
225
225
|
entries.push({
|
|
226
226
|
original,
|
|
227
227
|
alias,
|
|
228
|
-
scopes:
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
scopes: htmlEscape.sortStrings(
|
|
229
|
+
new Set((definitions.get(original) ?? []).map((definition) => definition.scopeId))
|
|
230
|
+
)
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
return {
|
|
@@ -260,7 +260,7 @@ function collectCandidates(input, definitions) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
return
|
|
263
|
+
return htmlEscape.sortStrings(candidates);
|
|
264
264
|
}
|
|
265
265
|
function validateCandidates(candidates, definitions, reserved, aliasPrefix) {
|
|
266
266
|
const diagnostics = [];
|
|
@@ -1134,12 +1134,12 @@ function parseThemeBlocks(cssContent) {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
1136
|
return {
|
|
1137
|
-
colors:
|
|
1138
|
-
spacings:
|
|
1139
|
-
fonts:
|
|
1140
|
-
radii:
|
|
1141
|
-
shadows:
|
|
1142
|
-
breakpoints:
|
|
1137
|
+
colors: htmlEscape.sortStrings(result.colors),
|
|
1138
|
+
spacings: htmlEscape.sortStrings(result.spacings),
|
|
1139
|
+
fonts: htmlEscape.sortStrings(result.fonts),
|
|
1140
|
+
radii: htmlEscape.sortStrings(result.radii),
|
|
1141
|
+
shadows: htmlEscape.sortStrings(result.shadows),
|
|
1142
|
+
breakpoints: htmlEscape.sortStrings(result.breakpoints)
|
|
1143
1143
|
};
|
|
1144
1144
|
}
|
|
1145
1145
|
function mergeThemes(themes) {
|
|
@@ -1162,12 +1162,12 @@ function mergeThemes(themes) {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
1164
|
return {
|
|
1165
|
-
colors:
|
|
1166
|
-
spacings:
|
|
1167
|
-
fonts:
|
|
1168
|
-
radii:
|
|
1169
|
-
shadows:
|
|
1170
|
-
breakpoints:
|
|
1165
|
+
colors: htmlEscape.sortStrings(merged.colors),
|
|
1166
|
+
spacings: htmlEscape.sortStrings(merged.spacings),
|
|
1167
|
+
fonts: htmlEscape.sortStrings(merged.fonts),
|
|
1168
|
+
radii: htmlEscape.sortStrings(merged.radii),
|
|
1169
|
+
shadows: htmlEscape.sortStrings(merged.shadows),
|
|
1170
|
+
breakpoints: htmlEscape.sortStrings(merged.breakpoints)
|
|
1171
1171
|
};
|
|
1172
1172
|
}
|
|
1173
1173
|
function hasTokens(theme) {
|
|
@@ -1287,7 +1287,7 @@ function expandFilePatterns(rootDir, patterns) {
|
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
|
-
return
|
|
1290
|
+
return htmlEscape.sortStrings(files);
|
|
1291
1291
|
}
|
|
1292
1292
|
|
|
1293
1293
|
function safeJsonForScriptTag(value, prettyPrint = false) {
|
|
@@ -1381,7 +1381,7 @@ function buildRecoveryManifest(tokens, options) {
|
|
|
1381
1381
|
const stripped = options.production === true;
|
|
1382
1382
|
const strippedDevOnlyPaths = [];
|
|
1383
1383
|
const sorted = {};
|
|
1384
|
-
const sortedKeys =
|
|
1384
|
+
const sortedKeys = htmlEscape.sortStrings(tokens.keys());
|
|
1385
1385
|
for (const key of sortedKeys) {
|
|
1386
1386
|
const data = tokens.get(key);
|
|
1387
1387
|
if (!data) {
|
|
@@ -1611,9 +1611,9 @@ let _hasWarnedTransformCacheVersion = false;
|
|
|
1611
1611
|
let _hasWarnedNativeFallback = false;
|
|
1612
1612
|
let _hasLoggedActiveParser = false;
|
|
1613
1613
|
const _babelFallbackFiles = /* @__PURE__ */ new Set();
|
|
1614
|
-
const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.
|
|
1614
|
+
const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.Cq_8AIBn.cjs', document.baseURI).href)));
|
|
1615
1615
|
const PLUGIN_VERSION = findPackageVersionFromFile(
|
|
1616
|
-
node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.
|
|
1616
|
+
node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.Cq_8AIBn.cjs', document.baseURI).href))),
|
|
1617
1617
|
UNKNOWN_PACKAGE_VERSION
|
|
1618
1618
|
);
|
|
1619
1619
|
const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
|
|
@@ -1692,8 +1692,10 @@ function missingTailwindEntryMessage(ownedClassCount) {
|
|
|
1692
1692
|
}
|
|
1693
1693
|
function collectMangleHybridHazards(mangleMap, mangledSources, externalClasses) {
|
|
1694
1694
|
const tokenValues = new Set(Object.values(mangleMap));
|
|
1695
|
-
const collisions = [...tokenValues].filter((token) => externalClasses.has(token))
|
|
1696
|
-
const orphans =
|
|
1695
|
+
const collisions = compiler.sortStrings([...tokenValues].filter((token) => externalClasses.has(token)));
|
|
1696
|
+
const orphans = compiler.sortStrings(
|
|
1697
|
+
Object.keys(mangleMap).filter((source) => !mangledSources.has(source))
|
|
1698
|
+
);
|
|
1697
1699
|
return { collisions, orphans };
|
|
1698
1700
|
}
|
|
1699
1701
|
function mangleHybridHazardMessage(hazards) {
|
|
@@ -1815,7 +1817,7 @@ function isHardIgnoredPath(id, sourceDirs = []) {
|
|
|
1815
1817
|
return false;
|
|
1816
1818
|
}
|
|
1817
1819
|
function fileMayContainSafelistableSz(content) {
|
|
1818
|
-
return content.includes("sz=") || content.includes("sz:") || content.includes("szv(");
|
|
1820
|
+
return content.includes("sz=") || content.includes("szs=") || content.includes("sz:") || content.includes("szv(");
|
|
1819
1821
|
}
|
|
1820
1822
|
function isPackagesSkippedSource(id, sourceDirs = []) {
|
|
1821
1823
|
const p = normalizeForMatch(id);
|
|
@@ -1973,7 +1975,7 @@ CSS alias plan ${actualJson} does not match source-transform alias table ${expec
|
|
|
1973
1975
|
}
|
|
1974
1976
|
function buildVarMangleMap(entriesByFile) {
|
|
1975
1977
|
const next = {};
|
|
1976
|
-
const files =
|
|
1978
|
+
const files = compiler.sortStrings(entriesByFile.keys());
|
|
1977
1979
|
for (const file of files) {
|
|
1978
1980
|
for (const [original, mangled] of entriesByFile.get(file) ?? []) {
|
|
1979
1981
|
addVarMangleMapping(next, original, mangled);
|
|
@@ -2022,7 +2024,7 @@ function createEarlyGlobalVarAliasEntries(config, aliasPrefix) {
|
|
|
2022
2024
|
if (config?.enabled !== true || !config.tokens || config.tokens.length === 0) {
|
|
2023
2025
|
return [];
|
|
2024
2026
|
}
|
|
2025
|
-
const tokens =
|
|
2027
|
+
const tokens = compiler.sortStrings(new Set(config.tokens));
|
|
2026
2028
|
return tokens.map((original, index) => [original, `${aliasPrefix}${core.encode(index)}`]);
|
|
2027
2029
|
}
|
|
2028
2030
|
function shouldEmitGlobalVarMapAsset(config) {
|
|
@@ -2109,7 +2111,7 @@ function collectCSSVariableMetrics(code) {
|
|
|
2109
2111
|
}
|
|
2110
2112
|
function buildCSSVariableMetrics(metricsByFile) {
|
|
2111
2113
|
const total = emptyCSSVariableMetrics();
|
|
2112
|
-
for (const file of
|
|
2114
|
+
for (const file of compiler.sortStrings(metricsByFile.keys())) {
|
|
2113
2115
|
const metrics = metricsByFile.get(file);
|
|
2114
2116
|
if (!metrics) {
|
|
2115
2117
|
continue;
|
|
@@ -2423,6 +2425,16 @@ function mangleCodeClassesSync(code, mangleMap) {
|
|
|
2423
2425
|
}
|
|
2424
2426
|
return `${sep}${ws}"${mangled.join(" ")}"`;
|
|
2425
2427
|
});
|
|
2428
|
+
result = result.replace(/\bszs:\s*\{([^{}]*)\}/g, (whole, body) => {
|
|
2429
|
+
const mangledBody = body.replace(
|
|
2430
|
+
/"((?:[^"\\]|\\.)*)"/g,
|
|
2431
|
+
(_m, inner) => `"${mangleClassString(inner)}"`
|
|
2432
|
+
).replace(
|
|
2433
|
+
/'((?:[^'\\]|\\.)*)'/g,
|
|
2434
|
+
(_m, inner) => `'${mangleClassString(inner)}'`
|
|
2435
|
+
);
|
|
2436
|
+
return whole.replace(body, mangledBody);
|
|
2437
|
+
});
|
|
2426
2438
|
return result;
|
|
2427
2439
|
}
|
|
2428
2440
|
function assertGlobalVarMangleConfig(options) {
|
|
@@ -2839,7 +2851,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
2839
2851
|
} catch {
|
|
2840
2852
|
return;
|
|
2841
2853
|
}
|
|
2842
|
-
if (content.includes("sz=") || content.includes("sz:")) {
|
|
2854
|
+
if (content.includes("sz=") || content.includes("szs=") || content.includes("sz:")) {
|
|
2843
2855
|
state.skippedSzFiles.add(filePath);
|
|
2844
2856
|
}
|
|
2845
2857
|
}
|
|
@@ -3158,7 +3170,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3158
3170
|
let usesColorVar = false;
|
|
3159
3171
|
let transformed = false;
|
|
3160
3172
|
let szClasses;
|
|
3161
|
-
const hasSzProp = code.includes("sz=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
|
|
3173
|
+
const hasSzProp = code.includes("sz=") || code.includes("szs=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
|
|
3162
3174
|
if (hasSzProp) {
|
|
3163
3175
|
if (id.endsWith(".vue")) {
|
|
3164
3176
|
const result = vueAdapter.preprocess(code, options);
|
|
@@ -3301,7 +3313,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3301
3313
|
}
|
|
3302
3314
|
if (!state.skipWarningEmitted && state.skippedSzFiles.size > 0) {
|
|
3303
3315
|
state.skipWarningEmitted = true;
|
|
3304
|
-
emitWarning(skippedSzFilesMessage(
|
|
3316
|
+
emitWarning(skippedSzFilesMessage(compiler.sortStrings(state.skippedSzFiles)), {
|
|
3305
3317
|
devOnly: true
|
|
3306
3318
|
});
|
|
3307
3319
|
}
|
|
@@ -3387,7 +3399,7 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3387
3399
|
} catch {
|
|
3388
3400
|
return;
|
|
3389
3401
|
}
|
|
3390
|
-
if (!fileContent.includes("sz=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
|
|
3402
|
+
if (!fileContent.includes("sz=") && !fileContent.includes("szs=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
|
|
3391
3403
|
recordGlobalVarSourceFile(state, ctx.file, fileContent);
|
|
3392
3404
|
recordFileVarMangleEntries(state, ctx.file, []);
|
|
3393
3405
|
recordFileCSSVariableMetrics(state, ctx.file, null);
|
|
@@ -3442,7 +3454,9 @@ function createCsszyxPlugins(options = {}) {
|
|
|
3442
3454
|
finalizeMangleMap();
|
|
3443
3455
|
const injectedMangleMap = manglingEnabled ? state.mangleMap : {};
|
|
3444
3456
|
let result = transformIndexHtml(html, injectedMangleMap, state.checksum, {
|
|
3445
|
-
|
|
3457
|
+
// Always 'script'; the checksum itself is injected by
|
|
3458
|
+
// injectHydrationData regardless of this mode.
|
|
3459
|
+
mode: "script",
|
|
3446
3460
|
minify: process.env.NODE_ENV === "production",
|
|
3447
3461
|
varMangleMap: state.varMangleMap,
|
|
3448
3462
|
globalVarAliasPrefix
|
|
@@ -2,6 +2,7 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transform } from '@csszyx/compiler';
|
|
3
3
|
import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache } from './unplugin.BpWUtI9U.mjs';
|
|
4
4
|
import { createHash } from 'node:crypto';
|
|
5
|
+
import { s as sortStrings } from './unplugin.B1mblcm-.mjs';
|
|
5
6
|
|
|
6
7
|
function readPackageVersion(relativePackageJson, fromUrl) {
|
|
7
8
|
try {
|
|
@@ -195,8 +196,8 @@ function collectNextTransformMetadata(result, source, sourcePath) {
|
|
|
195
196
|
return {
|
|
196
197
|
sourcePath,
|
|
197
198
|
sourceHash: createHash("sha256").update(source).digest("hex"),
|
|
198
|
-
classes:
|
|
199
|
-
rawClassNames:
|
|
199
|
+
classes: sortStrings(classes),
|
|
200
|
+
rawClassNames: sortStrings(result.rawClassNames),
|
|
200
201
|
recoveryTokenCount: result.recoveryTokens.size,
|
|
201
202
|
cssVariableCount: result.cssVariableMap.size
|
|
202
203
|
};
|
package/dist/vite.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const unplugin = require('./shared/unplugin.
|
|
5
|
+
const unplugin = require('./shared/unplugin.Cq_8AIBn.cjs');
|
|
6
6
|
require('node:fs');
|
|
7
7
|
require('node:module');
|
|
8
8
|
require('node:path');
|
|
@@ -18,7 +18,7 @@ require('unplugin');
|
|
|
18
18
|
require('./css-mangler.cjs');
|
|
19
19
|
require('postcss');
|
|
20
20
|
require('postcss-selector-parser');
|
|
21
|
-
require('./shared/unplugin.
|
|
21
|
+
require('./shared/unplugin.BCwRIUs_.cjs');
|
|
22
22
|
require('node:crypto');
|
|
23
23
|
require('./shared/unplugin.pmTknYLy.cjs');
|
|
24
24
|
require('postcss-value-parser');
|
package/dist/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as vitePlugin } from './shared/unplugin.
|
|
1
|
+
import { W as vitePlugin } from './shared/unplugin.Ble541_h.mjs';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:module';
|
|
4
4
|
import 'node:path';
|
|
@@ -14,7 +14,7 @@ import 'unplugin';
|
|
|
14
14
|
import './css-mangler.mjs';
|
|
15
15
|
import 'postcss';
|
|
16
16
|
import 'postcss-selector-parser';
|
|
17
|
-
import './shared/unplugin.
|
|
17
|
+
import './shared/unplugin.B1mblcm-.mjs';
|
|
18
18
|
import 'node:crypto';
|
|
19
19
|
import './shared/unplugin.BpWUtI9U.mjs';
|
|
20
20
|
import 'postcss-value-parser';
|
package/dist/webpack.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const unplugin = require('./shared/unplugin.
|
|
5
|
+
const unplugin = require('./shared/unplugin.Cq_8AIBn.cjs');
|
|
6
6
|
require('node:fs');
|
|
7
7
|
require('node:module');
|
|
8
8
|
require('node:path');
|
|
@@ -18,7 +18,7 @@ require('unplugin');
|
|
|
18
18
|
require('./css-mangler.cjs');
|
|
19
19
|
require('postcss');
|
|
20
20
|
require('postcss-selector-parser');
|
|
21
|
-
require('./shared/unplugin.
|
|
21
|
+
require('./shared/unplugin.BCwRIUs_.cjs');
|
|
22
22
|
require('node:crypto');
|
|
23
23
|
require('./shared/unplugin.pmTknYLy.cjs');
|
|
24
24
|
require('postcss-value-parser');
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { X as webpackPlugin } from './shared/unplugin.
|
|
1
|
+
import { X as webpackPlugin } from './shared/unplugin.Ble541_h.mjs';
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:module';
|
|
4
4
|
import 'node:path';
|
|
@@ -14,7 +14,7 @@ import 'unplugin';
|
|
|
14
14
|
import './css-mangler.mjs';
|
|
15
15
|
import 'postcss';
|
|
16
16
|
import 'postcss-selector-parser';
|
|
17
|
-
import './shared/unplugin.
|
|
17
|
+
import './shared/unplugin.B1mblcm-.mjs';
|
|
18
18
|
import 'node:crypto';
|
|
19
19
|
import './shared/unplugin.BpWUtI9U.mjs';
|
|
20
20
|
import 'postcss-value-parser';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/unplugin",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.10",
|
|
4
4
|
"description": "Vite and Webpack integration for csszyx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"csszyx",
|
|
@@ -117,14 +117,14 @@
|
|
|
117
117
|
"postcss-value-parser": "^4.2.0",
|
|
118
118
|
"proper-lockfile": "^4.1.2",
|
|
119
119
|
"unplugin": "^1.10.1",
|
|
120
|
-
"@csszyx/compiler": "0.10.
|
|
121
|
-
"@csszyx/
|
|
122
|
-
"@csszyx/
|
|
123
|
-
"@csszyx/
|
|
124
|
-
"@csszyx/vue-adapter": "0.10.
|
|
120
|
+
"@csszyx/compiler": "0.10.10",
|
|
121
|
+
"@csszyx/svelte-adapter": "0.10.10",
|
|
122
|
+
"@csszyx/types": "0.10.10",
|
|
123
|
+
"@csszyx/core": "0.10.10",
|
|
124
|
+
"@csszyx/vue-adapter": "0.10.10"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@csszyx/runtime": "^0.10.
|
|
127
|
+
"@csszyx/runtime": "^0.10.10"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@types/node": "^20.11.0",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"typescript": "^6.0.3",
|
|
135
135
|
"unbuild": "^3.6.1",
|
|
136
136
|
"vite": "^8.0.13",
|
|
137
|
-
"vitest": "^4.1.
|
|
137
|
+
"vitest": "^4.1.9",
|
|
138
138
|
"webpack": "^5.104.1"
|
|
139
139
|
},
|
|
140
140
|
"sideEffects": false,
|