@csszyx/unplugin 0.9.7 → 0.9.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/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{unplugin.BxYdELgl.mjs → unplugin.CMsKFZ-l.mjs} +12 -5
- package/dist/shared/{unplugin.B2znYY9c.cjs → unplugin.Dfao2VkS.cjs} +14 -7
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +7 -7
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.Dfao2VkS.cjs');
|
|
7
7
|
const types = require('@csszyx/types');
|
|
8
8
|
require('postcss');
|
|
9
9
|
require('postcss-selector-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 assertNoRSCBoundaryViolation, b as assertNoRSCGraphViolation, c as createGlobalVarAliasValidationOptions, d as createGlobalVarMapAssetSource, e as createGlobalVarScanCacheKey, f as createRSCModuleRecord, u as default, g as deleteRSCModuleRecord, h as esbuildPlugin, i as extractGlobalVarAliasesForManifest, j as findRSCBoundaryViolation, k as findRSCGraphViolation, l as hasTokens, m as hasUseClientDirective, n as hasUseServerDirective, o as isRSCServerModule, p as isTailwindReservedGlobalVar, q as mangleCodeClassesSync, r as mergeThemes, s as normalizeGlobalVarAliasesForCache, t as parseThemeBlocks, v as planGlobalVarAliases, w as readGlobalVarScanCache, x as resolveGlobalVarScanCacheDir, y as resolveNativeCacheIdentity, z as rewriteGlobalVarCssAliases, A as rollupPlugin, B as scanGlobalVarCss, u as unplugin, C as validateGlobalVarAliasInputs, D as vitePlugin, E as webpackPlugin, F as writeGlobalVarScanCache } from './shared/unplugin.
|
|
2
|
+
export { a as assertNoRSCBoundaryViolation, b as assertNoRSCGraphViolation, c as createGlobalVarAliasValidationOptions, d as createGlobalVarMapAssetSource, e as createGlobalVarScanCacheKey, f as createRSCModuleRecord, u as default, g as deleteRSCModuleRecord, h as esbuildPlugin, i as extractGlobalVarAliasesForManifest, j as findRSCBoundaryViolation, k as findRSCGraphViolation, l as hasTokens, m as hasUseClientDirective, n as hasUseServerDirective, o as isRSCServerModule, p as isTailwindReservedGlobalVar, q as mangleCodeClassesSync, r as mergeThemes, s as normalizeGlobalVarAliasesForCache, t as parseThemeBlocks, v as planGlobalVarAliases, w as readGlobalVarScanCache, x as resolveGlobalVarScanCacheDir, y as resolveNativeCacheIdentity, z as rewriteGlobalVarCssAliases, A as rollupPlugin, B as scanGlobalVarCss, u as unplugin, C as validateGlobalVarAliasInputs, D as vitePlugin, E as webpackPlugin, F as writeGlobalVarScanCache } from './shared/unplugin.CMsKFZ-l.mjs';
|
|
3
3
|
export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
|
|
4
4
|
import 'postcss';
|
|
5
5
|
import 'postcss-selector-parser';
|
|
@@ -1388,6 +1388,13 @@ function injectRecoveryManifest(html, manifest) {
|
|
|
1388
1388
|
return html + scriptTag;
|
|
1389
1389
|
}
|
|
1390
1390
|
|
|
1391
|
+
function escapeJsonForInlineScript(json) {
|
|
1392
|
+
return json.replace(/`/g, "\\u0060").replace(/\$/g, "\\u0024").replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
1393
|
+
}
|
|
1394
|
+
function escapeForDoubleQuotedString(value) {
|
|
1395
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1391
1398
|
const DEFAULT_MAX_ATTEMPTS = 3;
|
|
1392
1399
|
const NODE_FS = {
|
|
1393
1400
|
openSync: fs.openSync,
|
|
@@ -2635,13 +2642,13 @@ function createCsszyxPlugins(options = {}) {
|
|
|
2635
2642
|
result = result.split(CHECKSUM_PLACEHOLDER).join(state.checksum);
|
|
2636
2643
|
}
|
|
2637
2644
|
if (result.includes(MANGLE_MAP_PLACEHOLDER)) {
|
|
2638
|
-
const jsonMap = JSON.stringify(state.mangleMap);
|
|
2639
|
-
const escapedMap = result.includes("eval(") ? jsonMap
|
|
2645
|
+
const jsonMap = escapeJsonForInlineScript(JSON.stringify(state.mangleMap));
|
|
2646
|
+
const escapedMap = result.includes("eval(") ? escapeForDoubleQuotedString(jsonMap) : jsonMap;
|
|
2640
2647
|
result = result.split(MANGLE_MAP_PLACEHOLDER).join(escapedMap);
|
|
2641
2648
|
}
|
|
2642
2649
|
if (result.includes(VAR_MANGLE_MAP_PLACEHOLDER)) {
|
|
2643
|
-
const jsonMap = JSON.stringify(state.varMangleMap);
|
|
2644
|
-
const escapedMap = result.includes("eval(") ? jsonMap
|
|
2650
|
+
const jsonMap = escapeJsonForInlineScript(JSON.stringify(state.varMangleMap));
|
|
2651
|
+
const escapedMap = result.includes("eval(") ? escapeForDoubleQuotedString(jsonMap) : jsonMap;
|
|
2645
2652
|
result = result.split(VAR_MANGLE_MAP_PLACEHOLDER).join(escapedMap);
|
|
2646
2653
|
}
|
|
2647
2654
|
return result;
|
|
@@ -2792,7 +2799,7 @@ ${sourceDirective}`
|
|
|
2792
2799
|
/<html([^>]*)>/i,
|
|
2793
2800
|
`<html$1 ${attrName}="${CHECKSUM_PLACEHOLDER}">`
|
|
2794
2801
|
);
|
|
2795
|
-
const debugScript = `<script dangerouslySetInnerHTML={{__html: \`(function(){var m=${MANGLE_MAP_PLACEHOLDER};var vm=${VAR_MANGLE_MAP_PLACEHOLDER};var gp=decodeURIComponent(${JSON.stringify(encodedGlobalVarAliasPrefix)});var r={};var vr={};for(var k in m)r[m[k]]=k;for(var vk in vm){var vv=vm[vk];var vs=Array.isArray(vv)?vv:[vv];for(var vi=0;vi<vs.length;vi++)(vr[vs[vi]]||(vr[vs[vi]]=[])).push(vk)}window.__csszyx={mangleMap:m,varMangleMap:vm,checksum:"${CHECKSUM_PLACEHOLDER}",decode:function(c){return r[c]},encode:function(c){return m[c]},decodeVar:function(v){return vr[v]||[]},encodeVar:function(v){return vm[v]},decodeGlobalVar:function(v){var a=vr[v]||[];return v.indexOf(gp)===0?a[0]:void 0},decodeAll:function(el){return(el.className||"").split(" ").map(function(c){return r[c]||c})}}})()\`}} />`;
|
|
2802
|
+
const debugScript = `<script dangerouslySetInnerHTML={{__html: \`(function(){var m=${MANGLE_MAP_PLACEHOLDER};var vm=${VAR_MANGLE_MAP_PLACEHOLDER};var gp=decodeURIComponent(${escapeJsonForInlineScript(JSON.stringify(encodedGlobalVarAliasPrefix))});var r={};var vr={};for(var k in m)r[m[k]]=k;for(var vk in vm){var vv=vm[vk];var vs=Array.isArray(vv)?vv:[vv];for(var vi=0;vi<vs.length;vi++)(vr[vs[vi]]||(vr[vs[vi]]=[])).push(vk)}window.__csszyx={mangleMap:m,varMangleMap:vm,checksum:"${CHECKSUM_PLACEHOLDER}",decode:function(c){return r[c]},encode:function(c){return m[c]},decodeVar:function(v){return vr[v]||[]},encodeVar:function(v){return vm[v]},decodeGlobalVar:function(v){var a=vr[v]||[];return v.indexOf(gp)===0?a[0]:void 0},decodeAll:function(el){return(el.className||"").split(" ").map(function(c){return r[c]||c})}}})()\`}} />`;
|
|
2796
2803
|
if (transformedCode.includes("<body")) {
|
|
2797
2804
|
transformedCode = transformedCode.replace(
|
|
2798
2805
|
/(<body[^>]*>)/i,
|
|
@@ -1408,6 +1408,13 @@ function injectRecoveryManifest(html, manifest) {
|
|
|
1408
1408
|
return html + scriptTag;
|
|
1409
1409
|
}
|
|
1410
1410
|
|
|
1411
|
+
function escapeJsonForInlineScript(json) {
|
|
1412
|
+
return json.replace(/`/g, "\\u0060").replace(/\$/g, "\\u0024").replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
1413
|
+
}
|
|
1414
|
+
function escapeForDoubleQuotedString(value) {
|
|
1415
|
+
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1411
1418
|
const DEFAULT_MAX_ATTEMPTS = 3;
|
|
1412
1419
|
const NODE_FS = {
|
|
1413
1420
|
openSync: fs__namespace.openSync,
|
|
@@ -1555,9 +1562,9 @@ const RUNTIME_HELPER_IMPORT_RE = {
|
|
|
1555
1562
|
};
|
|
1556
1563
|
let _hasWarnedTsConfig = false;
|
|
1557
1564
|
let _hasWarnedTransformCacheVersion = false;
|
|
1558
|
-
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.
|
|
1565
|
+
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.Dfao2VkS.cjs', document.baseURI).href)));
|
|
1559
1566
|
const PLUGIN_VERSION = findPackageVersionFromFile(
|
|
1560
|
-
node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.
|
|
1567
|
+
node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.Dfao2VkS.cjs', document.baseURI).href))),
|
|
1561
1568
|
UNKNOWN_PACKAGE_VERSION
|
|
1562
1569
|
);
|
|
1563
1570
|
const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
|
|
@@ -2655,13 +2662,13 @@ function createCsszyxPlugins(options = {}) {
|
|
|
2655
2662
|
result = result.split(CHECKSUM_PLACEHOLDER).join(state.checksum);
|
|
2656
2663
|
}
|
|
2657
2664
|
if (result.includes(MANGLE_MAP_PLACEHOLDER)) {
|
|
2658
|
-
const jsonMap = JSON.stringify(state.mangleMap);
|
|
2659
|
-
const escapedMap = result.includes("eval(") ? jsonMap
|
|
2665
|
+
const jsonMap = escapeJsonForInlineScript(JSON.stringify(state.mangleMap));
|
|
2666
|
+
const escapedMap = result.includes("eval(") ? escapeForDoubleQuotedString(jsonMap) : jsonMap;
|
|
2660
2667
|
result = result.split(MANGLE_MAP_PLACEHOLDER).join(escapedMap);
|
|
2661
2668
|
}
|
|
2662
2669
|
if (result.includes(VAR_MANGLE_MAP_PLACEHOLDER)) {
|
|
2663
|
-
const jsonMap = JSON.stringify(state.varMangleMap);
|
|
2664
|
-
const escapedMap = result.includes("eval(") ? jsonMap
|
|
2670
|
+
const jsonMap = escapeJsonForInlineScript(JSON.stringify(state.varMangleMap));
|
|
2671
|
+
const escapedMap = result.includes("eval(") ? escapeForDoubleQuotedString(jsonMap) : jsonMap;
|
|
2665
2672
|
result = result.split(VAR_MANGLE_MAP_PLACEHOLDER).join(escapedMap);
|
|
2666
2673
|
}
|
|
2667
2674
|
return result;
|
|
@@ -2812,7 +2819,7 @@ ${sourceDirective}`
|
|
|
2812
2819
|
/<html([^>]*)>/i,
|
|
2813
2820
|
`<html$1 ${attrName}="${CHECKSUM_PLACEHOLDER}">`
|
|
2814
2821
|
);
|
|
2815
|
-
const debugScript = `<script dangerouslySetInnerHTML={{__html: \`(function(){var m=${MANGLE_MAP_PLACEHOLDER};var vm=${VAR_MANGLE_MAP_PLACEHOLDER};var gp=decodeURIComponent(${JSON.stringify(encodedGlobalVarAliasPrefix)});var r={};var vr={};for(var k in m)r[m[k]]=k;for(var vk in vm){var vv=vm[vk];var vs=Array.isArray(vv)?vv:[vv];for(var vi=0;vi<vs.length;vi++)(vr[vs[vi]]||(vr[vs[vi]]=[])).push(vk)}window.__csszyx={mangleMap:m,varMangleMap:vm,checksum:"${CHECKSUM_PLACEHOLDER}",decode:function(c){return r[c]},encode:function(c){return m[c]},decodeVar:function(v){return vr[v]||[]},encodeVar:function(v){return vm[v]},decodeGlobalVar:function(v){var a=vr[v]||[];return v.indexOf(gp)===0?a[0]:void 0},decodeAll:function(el){return(el.className||"").split(" ").map(function(c){return r[c]||c})}}})()\`}} />`;
|
|
2822
|
+
const debugScript = `<script dangerouslySetInnerHTML={{__html: \`(function(){var m=${MANGLE_MAP_PLACEHOLDER};var vm=${VAR_MANGLE_MAP_PLACEHOLDER};var gp=decodeURIComponent(${escapeJsonForInlineScript(JSON.stringify(encodedGlobalVarAliasPrefix))});var r={};var vr={};for(var k in m)r[m[k]]=k;for(var vk in vm){var vv=vm[vk];var vs=Array.isArray(vv)?vv:[vv];for(var vi=0;vi<vs.length;vi++)(vr[vs[vi]]||(vr[vs[vi]]=[])).push(vk)}window.__csszyx={mangleMap:m,varMangleMap:vm,checksum:"${CHECKSUM_PLACEHOLDER}",decode:function(c){return r[c]},encode:function(c){return m[c]},decodeVar:function(v){return vr[v]||[]},encodeVar:function(v){return vm[v]},decodeGlobalVar:function(v){var a=vr[v]||[];return v.indexOf(gp)===0?a[0]:void 0},decodeAll:function(el){return(el.className||"").split(" ").map(function(c){return r[c]||c})}}})()\`}} />`;
|
|
2816
2823
|
if (transformedCode.includes("<body")) {
|
|
2817
2824
|
transformedCode = transformedCode.replace(
|
|
2818
2825
|
/(<body[^>]*>)/i,
|
package/dist/vite.cjs
CHANGED
package/dist/vite.mjs
CHANGED
package/dist/webpack.cjs
CHANGED
package/dist/webpack.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/unplugin",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.9",
|
|
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/
|
|
121
|
-
"@csszyx/svelte-adapter": "0.9.
|
|
122
|
-
"@csszyx/
|
|
123
|
-
"@csszyx/
|
|
124
|
-
"@csszyx/
|
|
120
|
+
"@csszyx/compiler": "0.9.9",
|
|
121
|
+
"@csszyx/svelte-adapter": "0.9.9",
|
|
122
|
+
"@csszyx/core": "0.9.9",
|
|
123
|
+
"@csszyx/vue-adapter": "0.9.9",
|
|
124
|
+
"@csszyx/types": "0.9.9"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@csszyx/runtime": "^0.9.
|
|
127
|
+
"@csszyx/runtime": "^0.9.9"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@types/node": "^20.11.0",
|