@csszyx/unplugin 0.11.6 → 0.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/css-mangler.cjs +44 -41
- package/dist/css-mangler.mjs +44 -41
- package/dist/index.cjs +5 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -4
- package/dist/next-config.cjs +1 -1
- package/dist/next-config.mjs +1 -1
- package/dist/next-prebuild.cjs +5 -5
- package/dist/next-prebuild.mjs +5 -5
- package/dist/next-turbo-loader.cjs +13 -12
- package/dist/next-turbo-loader.mjs +13 -12
- package/dist/next-watcher.cjs +2 -2
- package/dist/next-watcher.mjs +2 -2
- package/dist/shared/{unplugin.BFN_Ueyx.cjs → unplugin.C9dMG7ye.cjs} +7 -5
- package/dist/shared/{unplugin.PhOFTQpB.d.cts → unplugin.CNwV3RrQ.d.cts} +18 -5
- package/dist/shared/{unplugin.PhOFTQpB.d.mts → unplugin.CNwV3RrQ.d.mts} +18 -5
- package/dist/shared/unplugin.CcA7jP1r.cjs +48 -0
- package/dist/shared/{unplugin.ByzV6iZE.mjs → unplugin.D-K57LNR.mjs} +13 -7
- package/dist/shared/{unplugin.D0N9bprz.cjs → unplugin.DVCQC5wq.cjs} +12 -5
- package/dist/shared/{unplugin.CBKZoxQ1.cjs → unplugin.DdtOZANG.cjs} +51 -50
- package/dist/shared/{unplugin.ChwZMl_w.mjs → unplugin.Dg1tGPSd.mjs} +8 -6
- package/dist/shared/{unplugin.Rov-j_Wm.cjs → unplugin.DmuOKVS4.cjs} +21 -0
- package/dist/shared/{unplugin.CP2cz9bA.cjs → unplugin.DtPQz8Kg.cjs} +1291 -938
- package/dist/shared/{unplugin.BS60onPk.mjs → unplugin.DtYxS8M8.mjs} +1290 -938
- package/dist/shared/{unplugin.B3cvNxnk.mjs → unplugin.Rl8sIkHi.mjs} +51 -50
- package/dist/shared/unplugin.TtmP77BS.mjs +40 -0
- package/dist/shared/unplugin.nnsa7OVW.mjs +49 -0
- package/dist/vite.cjs +4 -4
- package/dist/vite.d.cts +2 -25
- package/dist/vite.d.mts +1 -25
- package/dist/vite.mjs +4 -8
- package/dist/webpack.cjs +4 -4
- package/dist/webpack.d.cts +2 -5
- package/dist/webpack.d.mts +1 -5
- package/dist/webpack.mjs +4 -8
- package/package.json +7 -7
- package/dist/shared/unplugin.B1mblcm-.mjs +0 -9
- package/dist/shared/unplugin.B3RHYokB.mjs +0 -29
- package/dist/shared/unplugin.BCwRIUs_.cjs +0 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { ensureRustTransformAvailable, transformSourceCode, transformRust, transformOxc, transform } from '@csszyx/compiler';
|
|
3
|
-
import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache } from './unplugin.
|
|
3
|
+
import { c as createTransformCacheKey, a as readTransformCache, w as writeTransformCache, n as normalizePathSeparators } from './unplugin.D-K57LNR.mjs';
|
|
4
4
|
import { createHash } from 'node:crypto';
|
|
5
|
-
import { s as sortStrings } from './unplugin.
|
|
5
|
+
import { s as sortStrings } from './unplugin.TtmP77BS.mjs';
|
|
6
6
|
|
|
7
7
|
function readPackageVersion(relativePackageJson, fromUrl) {
|
|
8
8
|
try {
|
|
@@ -59,61 +59,19 @@ function stripJsCommentsAndStrings(source) {
|
|
|
59
59
|
const char = source[index];
|
|
60
60
|
const peek = index + 1 < length ? source[index + 1] : "";
|
|
61
61
|
if (char === "/" && peek === "/") {
|
|
62
|
-
index
|
|
63
|
-
while (index < length && source[index] !== "\n") {
|
|
64
|
-
index++;
|
|
65
|
-
}
|
|
62
|
+
index = skipLineComment(source, index);
|
|
66
63
|
continue;
|
|
67
64
|
}
|
|
68
65
|
if (char === "/" && peek === "*") {
|
|
69
|
-
index
|
|
70
|
-
while (index + 1 < length && !(source[index] === "*" && source[index + 1] === "/")) {
|
|
71
|
-
index++;
|
|
72
|
-
}
|
|
73
|
-
index = Math.min(length, index + 2);
|
|
66
|
+
index = skipBlockComment(source, index);
|
|
74
67
|
continue;
|
|
75
68
|
}
|
|
76
69
|
if (char === "/" && isRegexLiteralStart(out)) {
|
|
77
|
-
index
|
|
78
|
-
let inCharClass = false;
|
|
79
|
-
while (index < length) {
|
|
80
|
-
const current = source[index];
|
|
81
|
-
if (current === "\\" && index + 1 < length) {
|
|
82
|
-
index += 2;
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (current === "[") {
|
|
86
|
-
inCharClass = true;
|
|
87
|
-
index++;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (current === "]") {
|
|
91
|
-
inCharClass = false;
|
|
92
|
-
index++;
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
if (current === "/" && !inCharClass) {
|
|
96
|
-
index++;
|
|
97
|
-
while (/[a-z]/i.test(source[index] ?? "")) {
|
|
98
|
-
index++;
|
|
99
|
-
}
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
index++;
|
|
103
|
-
}
|
|
70
|
+
index = skipRegexLiteral(source, index);
|
|
104
71
|
continue;
|
|
105
72
|
}
|
|
106
73
|
if (char === '"' || char === "'" || char === "`") {
|
|
107
|
-
|
|
108
|
-
index++;
|
|
109
|
-
while (index < length && source[index] !== quote) {
|
|
110
|
-
if (source[index] === "\\" && index + 1 < length) {
|
|
111
|
-
index += 2;
|
|
112
|
-
} else {
|
|
113
|
-
index++;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
index++;
|
|
74
|
+
index = skipQuotedSource(source, index, char);
|
|
117
75
|
continue;
|
|
118
76
|
}
|
|
119
77
|
out += char;
|
|
@@ -121,6 +79,46 @@ function stripJsCommentsAndStrings(source) {
|
|
|
121
79
|
}
|
|
122
80
|
return out;
|
|
123
81
|
}
|
|
82
|
+
function skipLineComment(source, start) {
|
|
83
|
+
const newline = source.indexOf("\n", start + 2);
|
|
84
|
+
return newline === -1 ? source.length : newline;
|
|
85
|
+
}
|
|
86
|
+
function skipBlockComment(source, start) {
|
|
87
|
+
const close = source.indexOf("*/", start + 2);
|
|
88
|
+
return close === -1 ? source.length : close + 2;
|
|
89
|
+
}
|
|
90
|
+
function skipRegexLiteral(source, start) {
|
|
91
|
+
let index = start + 1;
|
|
92
|
+
let inCharClass = false;
|
|
93
|
+
while (index < source.length) {
|
|
94
|
+
const current = source[index];
|
|
95
|
+
if (current === "\\" && index + 1 < source.length) {
|
|
96
|
+
index += 2;
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (current === "[") {
|
|
100
|
+
inCharClass = true;
|
|
101
|
+
} else if (current === "]") {
|
|
102
|
+
inCharClass = false;
|
|
103
|
+
} else if (current === "/" && !inCharClass) {
|
|
104
|
+
return skipRegexFlags(source, index + 1);
|
|
105
|
+
}
|
|
106
|
+
index++;
|
|
107
|
+
}
|
|
108
|
+
return index;
|
|
109
|
+
}
|
|
110
|
+
function skipRegexFlags(source, start) {
|
|
111
|
+
let index = start;
|
|
112
|
+
while (/[a-z]/i.test(source[index] ?? "")) index++;
|
|
113
|
+
return index;
|
|
114
|
+
}
|
|
115
|
+
function skipQuotedSource(source, start, quote) {
|
|
116
|
+
let index = start + 1;
|
|
117
|
+
while (index < source.length && source[index] !== quote) {
|
|
118
|
+
index += source[index] === "\\" && index + 1 < source.length ? 2 : 1;
|
|
119
|
+
}
|
|
120
|
+
return index + 1;
|
|
121
|
+
}
|
|
124
122
|
function isRegexLiteralStart(emitted) {
|
|
125
123
|
const trimmed = emitted.trimEnd();
|
|
126
124
|
const previous = trimmed.length > 0 ? trimmed.charAt(trimmed.length - 1) : void 0;
|
|
@@ -174,13 +172,16 @@ function createNextSourceTransformCacheInput(input, filename, producer) {
|
|
|
174
172
|
};
|
|
175
173
|
}
|
|
176
174
|
function normalizeSourceFilename(filename) {
|
|
177
|
-
return filename
|
|
175
|
+
return normalizePathSeparators(filename);
|
|
178
176
|
}
|
|
179
177
|
function normalizeGlobalVarAliasesForCache(aliases) {
|
|
180
178
|
if (!aliases) {
|
|
181
179
|
return [];
|
|
182
180
|
}
|
|
183
|
-
|
|
181
|
+
let entries;
|
|
182
|
+
if (aliases instanceof Map) entries = aliases.entries();
|
|
183
|
+
else if (Array.isArray(aliases)) entries = aliases;
|
|
184
|
+
else entries = Object.entries(aliases);
|
|
184
185
|
const normalized = /* @__PURE__ */ new Map();
|
|
185
186
|
for (const [original, alias] of entries) {
|
|
186
187
|
if (original.startsWith("--") && alias.startsWith("--")) {
|
|
@@ -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.split(search).join(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,49 @@
|
|
|
1
|
+
const LEADING_WHITESPACE_RE = /^\s+/;
|
|
2
|
+
const LINE_COMMENT_RE = /^\/\/[^\n]*(?:\n|$)/;
|
|
3
|
+
const BLOCK_COMMENT_RE = /^\/\*[\s\S]*?\*\//;
|
|
4
|
+
const USE_DIRECTIVE_RE = /^['"]use (?:client|server)['"];?\s*/;
|
|
5
|
+
function insertAfterUseDirective(code, insertion) {
|
|
6
|
+
let offset = 0;
|
|
7
|
+
while (offset < code.length) {
|
|
8
|
+
const triviaLength = leadingTriviaLength(code.slice(offset));
|
|
9
|
+
if (triviaLength === 0) break;
|
|
10
|
+
offset += triviaLength;
|
|
11
|
+
}
|
|
12
|
+
const directive = code.slice(offset).match(USE_DIRECTIVE_RE);
|
|
13
|
+
if (!directive) return `${insertion}${code}`;
|
|
14
|
+
const insertionOffset = offset + directive[0].length;
|
|
15
|
+
return `${code.slice(0, insertionOffset)}${insertion}${code.slice(insertionOffset)}`;
|
|
16
|
+
}
|
|
17
|
+
function leadingTriviaLength(source) {
|
|
18
|
+
return source.match(LEADING_WHITESPACE_RE)?.[0].length ?? source.match(LINE_COMMENT_RE)?.[0].length ?? source.match(BLOCK_COMMENT_RE)?.[0].length ?? 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
|
|
22
|
+
function clauseNames(clauseBody) {
|
|
23
|
+
const names = [];
|
|
24
|
+
for (const part of clauseBody.split(",")) {
|
|
25
|
+
const trimmed = part.trim();
|
|
26
|
+
if (!trimmed) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const spaceAt = trimmed.search(/\s/);
|
|
30
|
+
names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
|
|
31
|
+
}
|
|
32
|
+
return names;
|
|
33
|
+
}
|
|
34
|
+
function importsRuntimeHelper(code, helper) {
|
|
35
|
+
RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
|
|
36
|
+
for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
|
|
37
|
+
if (clauseNames(match[1]).includes(helper)) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
|
|
44
|
+
function findRuntimeImportClause(code) {
|
|
45
|
+
const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
|
|
46
|
+
return match ? { statement: match[0], prefixWithBody: match[1] } : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { insertAfterUseDirective as a, findRuntimeImportClause as f, importsRuntimeHelper as i };
|
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.DtPQz8Kg.cjs');
|
|
6
6
|
require('node:crypto');
|
|
7
7
|
require('node:fs');
|
|
8
8
|
require('node:module');
|
|
@@ -19,9 +19,9 @@ require('unplugin');
|
|
|
19
19
|
require('./css-mangler.cjs');
|
|
20
20
|
require('postcss');
|
|
21
21
|
require('postcss-selector-parser');
|
|
22
|
-
require('./shared/unplugin.
|
|
23
|
-
require('./shared/unplugin.
|
|
24
|
-
require('./shared/unplugin.
|
|
22
|
+
require('./shared/unplugin.DmuOKVS4.cjs');
|
|
23
|
+
require('./shared/unplugin.DVCQC5wq.cjs');
|
|
24
|
+
require('./shared/unplugin.CcA7jP1r.cjs');
|
|
25
25
|
require('postcss-value-parser');
|
|
26
26
|
|
|
27
27
|
|
package/dist/vite.d.cts
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ae } from './shared/unplugin.CNwV3RrQ.cjs';
|
|
2
|
+
export = ae;
|
|
2
3
|
import '@csszyx/compiler';
|
|
3
4
|
import '@csszyx/types';
|
|
4
5
|
import 'esbuild';
|
|
5
6
|
import 'rollup';
|
|
6
7
|
import 'unplugin';
|
|
7
8
|
import 'vite';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Vite plugin export for csszyx.
|
|
11
|
-
*
|
|
12
|
-
* This exports the Vite-specific plugin configuration which includes
|
|
13
|
-
* both pre and post transformation phases for optimal CSS processing.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* import { defineConfig } from 'vite';
|
|
18
|
-
* import csszyx from '@csszyx/unplugin/vite';
|
|
19
|
-
*
|
|
20
|
-
* export default defineConfig({
|
|
21
|
-
* plugins: [
|
|
22
|
-
* csszyx({
|
|
23
|
-
* development: { debug: true },
|
|
24
|
-
* production: { injectChecksum: true }
|
|
25
|
-
* })
|
|
26
|
-
* ]
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
export = vitePlugin;
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,31 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { ae as default } from './shared/unplugin.CNwV3RrQ.mjs';
|
|
2
2
|
import '@csszyx/compiler';
|
|
3
3
|
import '@csszyx/types';
|
|
4
4
|
import 'esbuild';
|
|
5
5
|
import 'rollup';
|
|
6
6
|
import 'unplugin';
|
|
7
7
|
import 'vite';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Vite plugin export for csszyx.
|
|
11
|
-
*
|
|
12
|
-
* This exports the Vite-specific plugin configuration which includes
|
|
13
|
-
* both pre and post transformation phases for optimal CSS processing.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* import { defineConfig } from 'vite';
|
|
18
|
-
* import csszyx from '@csszyx/unplugin/vite';
|
|
19
|
-
*
|
|
20
|
-
* export default defineConfig({
|
|
21
|
-
* plugins: [
|
|
22
|
-
* csszyx({
|
|
23
|
-
* development: { debug: true },
|
|
24
|
-
* production: { injectChecksum: true }
|
|
25
|
-
* })
|
|
26
|
-
* ]
|
|
27
|
-
* });
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
export { vitePlugin as default };
|
package/dist/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export { $ as default } from './shared/unplugin.DtYxS8M8.mjs';
|
|
2
2
|
import 'node:crypto';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:module';
|
|
@@ -15,11 +15,7 @@ import 'unplugin';
|
|
|
15
15
|
import './css-mangler.mjs';
|
|
16
16
|
import 'postcss';
|
|
17
17
|
import 'postcss-selector-parser';
|
|
18
|
-
import './shared/unplugin.
|
|
19
|
-
import './shared/unplugin.
|
|
20
|
-
import './shared/unplugin.
|
|
18
|
+
import './shared/unplugin.nnsa7OVW.mjs';
|
|
19
|
+
import './shared/unplugin.D-K57LNR.mjs';
|
|
20
|
+
import './shared/unplugin.TtmP77BS.mjs';
|
|
21
21
|
import 'postcss-value-parser';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { vitePlugin as default };
|
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.DtPQz8Kg.cjs');
|
|
6
6
|
require('node:crypto');
|
|
7
7
|
require('node:fs');
|
|
8
8
|
require('node:module');
|
|
@@ -19,9 +19,9 @@ require('unplugin');
|
|
|
19
19
|
require('./css-mangler.cjs');
|
|
20
20
|
require('postcss');
|
|
21
21
|
require('postcss-selector-parser');
|
|
22
|
-
require('./shared/unplugin.
|
|
23
|
-
require('./shared/unplugin.
|
|
24
|
-
require('./shared/unplugin.
|
|
22
|
+
require('./shared/unplugin.DmuOKVS4.cjs');
|
|
23
|
+
require('./shared/unplugin.DVCQC5wq.cjs');
|
|
24
|
+
require('./shared/unplugin.CcA7jP1r.cjs');
|
|
25
25
|
require('postcss-value-parser');
|
|
26
26
|
|
|
27
27
|
|
package/dist/webpack.d.cts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { af } from './shared/unplugin.CNwV3RrQ.cjs';
|
|
2
|
+
export = af;
|
|
2
3
|
import '@csszyx/compiler';
|
|
3
4
|
import '@csszyx/types';
|
|
4
5
|
import 'esbuild';
|
|
5
6
|
import 'rollup';
|
|
6
7
|
import 'unplugin';
|
|
7
8
|
import 'vite';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export = webpackPlugin;
|
package/dist/webpack.d.mts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { af as default } from './shared/unplugin.CNwV3RrQ.mjs';
|
|
2
2
|
import '@csszyx/compiler';
|
|
3
3
|
import '@csszyx/types';
|
|
4
4
|
import 'esbuild';
|
|
5
5
|
import 'rollup';
|
|
6
6
|
import 'unplugin';
|
|
7
7
|
import 'vite';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { webpackPlugin as default };
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export { a0 as default } from './shared/unplugin.DtYxS8M8.mjs';
|
|
2
2
|
import 'node:crypto';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:module';
|
|
@@ -15,11 +15,7 @@ import 'unplugin';
|
|
|
15
15
|
import './css-mangler.mjs';
|
|
16
16
|
import 'postcss';
|
|
17
17
|
import 'postcss-selector-parser';
|
|
18
|
-
import './shared/unplugin.
|
|
19
|
-
import './shared/unplugin.
|
|
20
|
-
import './shared/unplugin.
|
|
18
|
+
import './shared/unplugin.nnsa7OVW.mjs';
|
|
19
|
+
import './shared/unplugin.D-K57LNR.mjs';
|
|
20
|
+
import './shared/unplugin.TtmP77BS.mjs';
|
|
21
21
|
import 'postcss-value-parser';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export { webpackPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/unplugin",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.8",
|
|
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/
|
|
122
|
-
"@csszyx/
|
|
123
|
-
"@csszyx/
|
|
124
|
-
"@csszyx/
|
|
120
|
+
"@csszyx/core": "0.11.8",
|
|
121
|
+
"@csszyx/types": "0.11.8",
|
|
122
|
+
"@csszyx/vue-adapter": "0.11.8",
|
|
123
|
+
"@csszyx/compiler": "0.11.8",
|
|
124
|
+
"@csszyx/svelte-adapter": "0.11.8"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@csszyx/runtime": "^0.11.
|
|
127
|
+
"@csszyx/runtime": "^0.11.8"
|
|
128
128
|
},
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@tailwindcss/node": "4.3.2",
|
|
@@ -1,9 +0,0 @@
|
|
|
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,29 +0,0 @@
|
|
|
1
|
-
const RUNTIME_IMPORT_CLAUSE_RE = /(?:import|export)\s+\{([^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/g;
|
|
2
|
-
function clauseNames(clauseBody) {
|
|
3
|
-
const names = [];
|
|
4
|
-
for (const part of clauseBody.split(",")) {
|
|
5
|
-
const trimmed = part.trim();
|
|
6
|
-
if (!trimmed) {
|
|
7
|
-
continue;
|
|
8
|
-
}
|
|
9
|
-
const spaceAt = trimmed.search(/\s/);
|
|
10
|
-
names.push(spaceAt === -1 ? trimmed : trimmed.slice(0, spaceAt));
|
|
11
|
-
}
|
|
12
|
-
return names;
|
|
13
|
-
}
|
|
14
|
-
function importsRuntimeHelper(code, helper) {
|
|
15
|
-
RUNTIME_IMPORT_CLAUSE_RE.lastIndex = 0;
|
|
16
|
-
for (let match = RUNTIME_IMPORT_CLAUSE_RE.exec(code); match; match = RUNTIME_IMPORT_CLAUSE_RE.exec(code)) {
|
|
17
|
-
if (clauseNames(match[1]).includes(helper)) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
const RUNTIME_IMPORT_APPEND_RE = /(import\s+\{[^{}]*)\}\s*from\s*['"]@csszyx\/runtime['"]/;
|
|
24
|
-
function findRuntimeImportClause(code) {
|
|
25
|
-
const match = RUNTIME_IMPORT_APPEND_RE.exec(code);
|
|
26
|
-
return match ? { statement: match[0], prefixWithBody: match[1] } : null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { findRuntimeImportClause as f, importsRuntimeHelper as i };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function sortStrings(values) {
|
|
4
|
-
return [...values].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function escapeHtmlAttribute(value) {
|
|
8
|
-
return value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
exports.escapeHtmlAttribute = escapeHtmlAttribute;
|
|
12
|
-
exports.sortStrings = sortStrings;
|