tailwindcss-patch 9.4.0 → 9.4.2
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/cli-D5D3Yj69.mjs +655 -0
- package/dist/cli-DsXcyl2O.js +671 -0
- package/dist/cli.js +4 -4
- package/dist/cli.mjs +3 -3
- package/dist/commands/cli-runtime.d.mts +1 -1
- package/dist/commands/cli-runtime.d.ts +1 -1
- package/dist/commands/cli-runtime.js +4 -661
- package/dist/commands/cli-runtime.mjs +2 -654
- package/dist/index.d.mts +39 -3
- package/dist/index.d.ts +39 -3
- package/dist/index.js +320 -8
- package/dist/index.mjs +283 -3
- package/dist/{validate-D9fDrE9I.js → validate-5eUbRAzl.js} +468 -19
- package/dist/{validate-Ci0W2Fuu.mjs → validate-CInDiiYy.mjs} +331 -21
- package/dist/{validate-DFiRmBtJ.d.ts → validate-CYB-90BG.d.ts} +22 -5
- package/dist/{validate-CDegYLlg.d.mts → validate-D6MO6lZo.d.mts} +22 -5
- package/package.json +1 -1
- package/src/extraction/candidate-extractor.ts +76 -12
- package/src/extraction/split-candidate-tokens.ts +3 -0
- package/src/index.bundle.ts +1 -112
- package/src/index.ts +1 -100
- package/src/public-api.ts +111 -0
- package/src/v4/bare-arbitrary-values.ts +127 -2
- package/src/v4/engine.ts +5 -2
- package/src/v4/index.ts +14 -5
- package/src/v4/node-adapter.ts +1 -1
- package/src/v4/source-scan.ts +1 -1
- package/dist/index.bundle-CGaLDIgy.js +0 -259
- package/dist/index.bundle-D6yHhQ-W.mjs +0 -221
- package/src/cli.bundle.ts +0 -20
|
@@ -8,16 +8,17 @@ import { createHash } from "node:crypto";
|
|
|
8
8
|
import { createConsola } from "consola";
|
|
9
9
|
import path$1 from "node:path";
|
|
10
10
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
-
import { promises } from "node:fs";
|
|
11
|
+
import { promises, realpathSync } from "node:fs";
|
|
12
12
|
import postcss from "postcss";
|
|
13
|
-
import "
|
|
13
|
+
import { stat } from "node:fs/promises";
|
|
14
|
+
import micromatch from "micromatch";
|
|
14
15
|
import * as t from "@babel/types";
|
|
15
16
|
import generate from "@babel/generator";
|
|
16
17
|
import _babelTraverse from "@babel/traverse";
|
|
17
18
|
import { parse, parse as parse$1 } from "@babel/parser";
|
|
18
19
|
import { loadConfig } from "tailwindcss-config";
|
|
19
20
|
//#region package.json
|
|
20
|
-
var version = "9.4.
|
|
21
|
+
var version = "9.4.2";
|
|
21
22
|
//#endregion
|
|
22
23
|
//#region src/constants.ts
|
|
23
24
|
const pkgName = "tailwindcss-patch";
|
|
@@ -1488,6 +1489,8 @@ const DEFAULT_BARE_ARBITRARY_VALUE_UNITS = [
|
|
|
1488
1489
|
const NUMBER_RE = /^-?(?:\d+|\d*\.\d+)$/;
|
|
1489
1490
|
const FUNCTION_VALUE_RE = /^[a-z_-][\w-]*\(/i;
|
|
1490
1491
|
const HEX_ESCAPE_RE = /^[\da-f]$/i;
|
|
1492
|
+
const ASPECT_RATIO_RE = /^\d+\/\d+$/;
|
|
1493
|
+
const ESCAPED_WHITESPACE_RE = /\\[nrt]/g;
|
|
1491
1494
|
function splitVariantPrefix(candidate) {
|
|
1492
1495
|
let depth = 0;
|
|
1493
1496
|
let quote;
|
|
@@ -1607,6 +1610,9 @@ function normalizeBareArbitraryValueOptions(options) {
|
|
|
1607
1610
|
if (normalizedUnits.length === 0) return;
|
|
1608
1611
|
return { units: normalizedUnits.sort((a, b) => b.length - a.length) };
|
|
1609
1612
|
}
|
|
1613
|
+
function isBareArbitraryValuesEnabled(options) {
|
|
1614
|
+
return normalizeBareArbitraryValueOptions(options) !== void 0;
|
|
1615
|
+
}
|
|
1610
1616
|
function normalizeEscapedValue(value) {
|
|
1611
1617
|
let result = "";
|
|
1612
1618
|
for (let index = 0; index < value.length; index++) {
|
|
@@ -1648,13 +1654,17 @@ function resolveValueWithUnit(body, units) {
|
|
|
1648
1654
|
if (NUMBER_RE.test(numberPart)) return `${numberPart}${unit}`;
|
|
1649
1655
|
}
|
|
1650
1656
|
}
|
|
1651
|
-
function resolveArbitraryValue(body, units) {
|
|
1657
|
+
function resolveArbitraryValue(utility, body, units) {
|
|
1652
1658
|
const value = normalizeEscapedValue(body);
|
|
1653
1659
|
const withUnit = resolveValueWithUnit(value, units);
|
|
1654
1660
|
if (withUnit) return withUnit;
|
|
1661
|
+
if (utility === "aspect" && ASPECT_RATIO_RE.test(value)) return value;
|
|
1655
1662
|
if (isHexColorValue(value)) return value;
|
|
1656
1663
|
if (isQuotedValue(value)) return value;
|
|
1657
|
-
if (FUNCTION_VALUE_RE.test(value) && value.endsWith(")") && isBalancedFunctionValue(value))
|
|
1664
|
+
if (FUNCTION_VALUE_RE.test(value) && value.endsWith(")") && isBalancedFunctionValue(value)) {
|
|
1665
|
+
if (utility === "text" && /^var\(/i.test(value)) return `color:${value}`;
|
|
1666
|
+
return value;
|
|
1667
|
+
}
|
|
1658
1668
|
}
|
|
1659
1669
|
function resolveUtilityAndValue(body, units) {
|
|
1660
1670
|
let depth = 0;
|
|
@@ -1682,7 +1692,7 @@ function resolveUtilityAndValue(body, units) {
|
|
|
1682
1692
|
const utility = body.slice(0, index);
|
|
1683
1693
|
const rawValue = body.slice(index + 1);
|
|
1684
1694
|
if (!utility || !rawValue) continue;
|
|
1685
|
-
const value = resolveArbitraryValue(rawValue, units);
|
|
1695
|
+
const value = resolveArbitraryValue(utility, rawValue, units);
|
|
1686
1696
|
if (value) return {
|
|
1687
1697
|
utility,
|
|
1688
1698
|
value
|
|
@@ -1705,6 +1715,65 @@ function resolveBareArbitraryValueCandidate(candidate, options) {
|
|
|
1705
1715
|
canonicalCandidate: `${prefix}${important}${negative}${resolved.utility}-[${resolved.value}]`
|
|
1706
1716
|
};
|
|
1707
1717
|
}
|
|
1718
|
+
function isBareArbitrarySourceSplitter(char) {
|
|
1719
|
+
return /\s/.test(char);
|
|
1720
|
+
}
|
|
1721
|
+
function isQuoteBoundary(content, start, index) {
|
|
1722
|
+
const tokenPrefix = content.slice(start, index);
|
|
1723
|
+
return tokenPrefix.length === 0 || !tokenPrefix.endsWith("-");
|
|
1724
|
+
}
|
|
1725
|
+
function trimBareArbitrarySourceToken(token, start) {
|
|
1726
|
+
let nextToken = token;
|
|
1727
|
+
let nextStart = start;
|
|
1728
|
+
while (nextToken.length > 0 && /^[<{([]$/.test(nextToken[0])) {
|
|
1729
|
+
nextToken = nextToken.slice(1);
|
|
1730
|
+
nextStart++;
|
|
1731
|
+
}
|
|
1732
|
+
while (nextToken.length > 0 && /^[>\],;]$/.test(nextToken[nextToken.length - 1])) nextToken = nextToken.slice(0, -1);
|
|
1733
|
+
return {
|
|
1734
|
+
token: nextToken,
|
|
1735
|
+
start: nextStart
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
function pushBareArbitrarySourceCandidate(result, token, start, options) {
|
|
1739
|
+
const trimmed = trimBareArbitrarySourceToken(token, start);
|
|
1740
|
+
if (!trimmed.token || trimmed.token.includes("=") || trimmed.token.includes("[") || trimmed.token.includes("]")) return;
|
|
1741
|
+
if (!resolveBareArbitraryValueCandidate(trimmed.token, options)) return;
|
|
1742
|
+
result.push({
|
|
1743
|
+
rawCandidate: trimmed.token,
|
|
1744
|
+
start: trimmed.start,
|
|
1745
|
+
end: trimmed.start + trimmed.token.length
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
function extractBareArbitraryValueSourceCandidatesWithPositions(content, options) {
|
|
1749
|
+
if (!isBareArbitraryValuesEnabled(options)) return [];
|
|
1750
|
+
const normalized = content.includes("\\") ? content.replace(ESCAPED_WHITESPACE_RE, " ") : content;
|
|
1751
|
+
const result = [];
|
|
1752
|
+
let depth = 0;
|
|
1753
|
+
let quote;
|
|
1754
|
+
let start = 0;
|
|
1755
|
+
for (let index = 0; index < normalized.length; index++) {
|
|
1756
|
+
const char = normalized[index];
|
|
1757
|
+
if (char === void 0) continue;
|
|
1758
|
+
if (char === "\\") {
|
|
1759
|
+
index++;
|
|
1760
|
+
continue;
|
|
1761
|
+
}
|
|
1762
|
+
if (quote) {
|
|
1763
|
+
if (char === quote) quote = void 0;
|
|
1764
|
+
} else if ((char === "\"" || char === "'" || char === "`") && !isQuoteBoundary(normalized, start, index)) quote = char;
|
|
1765
|
+
else if (char === "(" || char === "{" || char === "[") depth++;
|
|
1766
|
+
else if (char === ")" || char === "}" || char === "]") depth = Math.max(0, depth - 1);
|
|
1767
|
+
if (!isBareArbitrarySourceSplitter(char) && !((char === "\"" || char === "'" || char === "`") && depth === 0 && isQuoteBoundary(normalized, start, index))) continue;
|
|
1768
|
+
pushBareArbitrarySourceCandidate(result, normalized.slice(start, index), start, options);
|
|
1769
|
+
start = index + 1;
|
|
1770
|
+
}
|
|
1771
|
+
pushBareArbitrarySourceCandidate(result, normalized.slice(start), start, options);
|
|
1772
|
+
return result;
|
|
1773
|
+
}
|
|
1774
|
+
function extractBareArbitraryValueSourceCandidates(content, options) {
|
|
1775
|
+
return [...new Set(extractBareArbitraryValueSourceCandidatesWithPositions(content, options).map((candidate) => candidate.rawCandidate))];
|
|
1776
|
+
}
|
|
1708
1777
|
function escapeCssClassName(value) {
|
|
1709
1778
|
let result = "";
|
|
1710
1779
|
for (let index = 0; index < value.length; index++) {
|
|
@@ -2042,7 +2111,110 @@ async function compileTailwindV4Source(source) {
|
|
|
2042
2111
|
}
|
|
2043
2112
|
//#endregion
|
|
2044
2113
|
//#region src/v4/source-scan.ts
|
|
2114
|
+
const TAILWIND_V4_IGNORED_CONTENT_DIRS = [
|
|
2115
|
+
".git",
|
|
2116
|
+
".hg",
|
|
2117
|
+
".jj",
|
|
2118
|
+
".next",
|
|
2119
|
+
".parcel-cache",
|
|
2120
|
+
".pnpm-store",
|
|
2121
|
+
".svelte-kit",
|
|
2122
|
+
".svn",
|
|
2123
|
+
".turbo",
|
|
2124
|
+
".venv",
|
|
2125
|
+
".vercel",
|
|
2126
|
+
".yarn",
|
|
2127
|
+
"__pycache__",
|
|
2128
|
+
"node_modules",
|
|
2129
|
+
"venv"
|
|
2130
|
+
];
|
|
2131
|
+
const TAILWIND_V4_IGNORED_EXTENSIONS = [
|
|
2132
|
+
"less",
|
|
2133
|
+
"lock",
|
|
2134
|
+
"sass",
|
|
2135
|
+
"scss",
|
|
2136
|
+
"styl",
|
|
2137
|
+
"log"
|
|
2138
|
+
];
|
|
2139
|
+
const TAILWIND_V4_IGNORED_FILES = [
|
|
2140
|
+
"package-lock.json",
|
|
2141
|
+
"pnpm-lock.yaml",
|
|
2142
|
+
"bun.lockb",
|
|
2143
|
+
".gitignore",
|
|
2144
|
+
".env",
|
|
2145
|
+
".env.*"
|
|
2146
|
+
];
|
|
2045
2147
|
const TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN = "**/*";
|
|
2148
|
+
function uniqueResolvedPaths(values) {
|
|
2149
|
+
const result = [];
|
|
2150
|
+
for (const value of values) {
|
|
2151
|
+
if (!value) continue;
|
|
2152
|
+
const resolved = path.resolve(value);
|
|
2153
|
+
if (!result.includes(resolved)) result.push(resolved);
|
|
2154
|
+
}
|
|
2155
|
+
return result;
|
|
2156
|
+
}
|
|
2157
|
+
function toPosixPath(value) {
|
|
2158
|
+
return value.replaceAll(path.sep, "/");
|
|
2159
|
+
}
|
|
2160
|
+
function resolveSourceScanPath(value) {
|
|
2161
|
+
const resolved = path.resolve(value);
|
|
2162
|
+
try {
|
|
2163
|
+
return realpathSync.native(resolved);
|
|
2164
|
+
} catch {
|
|
2165
|
+
return resolved;
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
function normalizeGlobPattern(pattern) {
|
|
2169
|
+
return pattern.startsWith("./") ? pattern.slice(2) : pattern;
|
|
2170
|
+
}
|
|
2171
|
+
function hasGlobMagic(value) {
|
|
2172
|
+
return /[*?[\]{}()!+@]/.test(value);
|
|
2173
|
+
}
|
|
2174
|
+
function splitStaticGlobPrefix(pattern) {
|
|
2175
|
+
const segments = normalizeGlobPattern(pattern).split(/[\\/]+/);
|
|
2176
|
+
const prefix = [];
|
|
2177
|
+
const rest = [];
|
|
2178
|
+
let reachedGlob = false;
|
|
2179
|
+
for (const segment of segments) {
|
|
2180
|
+
if (!reachedGlob && segment && !hasGlobMagic(segment)) {
|
|
2181
|
+
prefix.push(segment);
|
|
2182
|
+
continue;
|
|
2183
|
+
}
|
|
2184
|
+
reachedGlob = true;
|
|
2185
|
+
rest.push(segment);
|
|
2186
|
+
}
|
|
2187
|
+
return {
|
|
2188
|
+
prefix,
|
|
2189
|
+
rest
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
async function pathExistsAsDirectory(file) {
|
|
2193
|
+
try {
|
|
2194
|
+
return (await stat(file)).isDirectory();
|
|
2195
|
+
} catch {
|
|
2196
|
+
return false;
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
function createTailwindV4DefaultIgnoreSources(base) {
|
|
2200
|
+
return [
|
|
2201
|
+
...TAILWIND_V4_IGNORED_CONTENT_DIRS.map((pattern) => ({
|
|
2202
|
+
base,
|
|
2203
|
+
pattern: `**/${pattern}/**`,
|
|
2204
|
+
negated: true
|
|
2205
|
+
})),
|
|
2206
|
+
...TAILWIND_V4_IGNORED_EXTENSIONS.map((extension) => ({
|
|
2207
|
+
base,
|
|
2208
|
+
pattern: `**/*.${extension}`,
|
|
2209
|
+
negated: true
|
|
2210
|
+
})),
|
|
2211
|
+
...TAILWIND_V4_IGNORED_FILES.map((pattern) => ({
|
|
2212
|
+
base,
|
|
2213
|
+
pattern: `**/${pattern}`,
|
|
2214
|
+
negated: true
|
|
2215
|
+
}))
|
|
2216
|
+
];
|
|
2217
|
+
}
|
|
2046
2218
|
function createTailwindV4RootSources(root, fallbackBase) {
|
|
2047
2219
|
if (root === "none") return [];
|
|
2048
2220
|
if (root === null) return [{
|
|
@@ -2058,6 +2230,34 @@ function createTailwindV4RootSources(root, fallbackBase) {
|
|
|
2058
2230
|
function createTailwindV4CompiledSourceEntries(root, sources, fallbackBase) {
|
|
2059
2231
|
return [...createTailwindV4RootSources(root, fallbackBase), ...sources];
|
|
2060
2232
|
}
|
|
2233
|
+
async function resolveTailwindV4SourceEntry(sourcePath, base, negated, defaultPattern = TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN) {
|
|
2234
|
+
const absoluteSource = path.isAbsolute(sourcePath) ? path.resolve(sourcePath) : path.resolve(base, sourcePath);
|
|
2235
|
+
if (await pathExistsAsDirectory(absoluteSource)) return {
|
|
2236
|
+
base: absoluteSource,
|
|
2237
|
+
negated,
|
|
2238
|
+
pattern: normalizeGlobPattern(defaultPattern)
|
|
2239
|
+
};
|
|
2240
|
+
if (path.isAbsolute(sourcePath)) return {
|
|
2241
|
+
base: path.dirname(absoluteSource),
|
|
2242
|
+
negated,
|
|
2243
|
+
pattern: normalizeGlobPattern(path.basename(absoluteSource))
|
|
2244
|
+
};
|
|
2245
|
+
const { prefix, rest } = splitStaticGlobPrefix(sourcePath);
|
|
2246
|
+
if (prefix.length > 0 && rest.length > 0) return {
|
|
2247
|
+
base: path.resolve(base, ...prefix),
|
|
2248
|
+
negated,
|
|
2249
|
+
pattern: normalizeGlobPattern(rest.join("/"))
|
|
2250
|
+
};
|
|
2251
|
+
return {
|
|
2252
|
+
base,
|
|
2253
|
+
negated,
|
|
2254
|
+
pattern: normalizeGlobPattern(sourcePath)
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
async function normalizeTailwindV4SourceEntries(sources, options = {}) {
|
|
2258
|
+
const cwd = options.cwd ? path.resolve(options.cwd) : process.cwd();
|
|
2259
|
+
return Promise.all(sources.map((source) => resolveTailwindV4SourceEntry(source.pattern, source.base ? path.resolve(source.base) : cwd, source.negated, options.defaultPattern)));
|
|
2260
|
+
}
|
|
2061
2261
|
function expandBracePattern(pattern) {
|
|
2062
2262
|
const index = pattern.indexOf("{");
|
|
2063
2263
|
if (index === -1) return [pattern];
|
|
@@ -2128,6 +2328,84 @@ function normalizeTailwindV4ScannerSources(sources, cwd, ignoredSources = []) {
|
|
|
2128
2328
|
negated: false
|
|
2129
2329
|
}], ...ignoredSources]);
|
|
2130
2330
|
}
|
|
2331
|
+
function normalizeEntryPattern(entry) {
|
|
2332
|
+
return path.isAbsolute(entry.pattern) ? toPosixPath(path.relative(resolveSourceScanPath(entry.base), entry.pattern)) : normalizeGlobPattern(entry.pattern);
|
|
2333
|
+
}
|
|
2334
|
+
function isFileMatchedByTailwindV4SourceEntry(file, entry) {
|
|
2335
|
+
const relative = toPosixPath(path.relative(resolveSourceScanPath(entry.base), file));
|
|
2336
|
+
return Boolean(relative) && !relative.startsWith("../") && !path.isAbsolute(relative) && micromatch.isMatch(relative, normalizeEntryPattern(entry));
|
|
2337
|
+
}
|
|
2338
|
+
function isFileExcludedByTailwindV4SourceEntries(file, entries) {
|
|
2339
|
+
if (!entries?.length) return false;
|
|
2340
|
+
const resolvedFile = resolveSourceScanPath(file);
|
|
2341
|
+
return entries.some((entry) => entry.negated && isFileMatchedByTailwindV4SourceEntry(resolvedFile, entry));
|
|
2342
|
+
}
|
|
2343
|
+
function isFileMatchedByTailwindV4SourceEntries(file, entries) {
|
|
2344
|
+
if (!entries?.length) return true;
|
|
2345
|
+
const positiveEntries = entries.filter((entry) => !entry.negated);
|
|
2346
|
+
const negativeEntries = entries.filter((entry) => entry.negated);
|
|
2347
|
+
if (positiveEntries.length === 0) return false;
|
|
2348
|
+
const resolvedFile = resolveSourceScanPath(file);
|
|
2349
|
+
if (!positiveEntries.some((entry) => isFileMatchedByTailwindV4SourceEntry(resolvedFile, entry))) return false;
|
|
2350
|
+
return !negativeEntries.some((entry) => isFileMatchedByTailwindV4SourceEntry(resolvedFile, entry));
|
|
2351
|
+
}
|
|
2352
|
+
function createTailwindV4SourceEntryMatcher(entries) {
|
|
2353
|
+
if (!entries?.length) return;
|
|
2354
|
+
return (file) => isFileMatchedByTailwindV4SourceEntries(file, entries);
|
|
2355
|
+
}
|
|
2356
|
+
function createTailwindV4SourceExclusionMatcher(entries) {
|
|
2357
|
+
if (!entries?.length) return;
|
|
2358
|
+
return (file) => isFileExcludedByTailwindV4SourceEntries(file, entries);
|
|
2359
|
+
}
|
|
2360
|
+
function groupTailwindV4SourceEntriesByBase(entries) {
|
|
2361
|
+
const entriesByBase = /* @__PURE__ */ new Map();
|
|
2362
|
+
for (const entry of entries) {
|
|
2363
|
+
const base = path.resolve(entry.base);
|
|
2364
|
+
const group = entriesByBase.get(base) ?? [];
|
|
2365
|
+
group.push({
|
|
2366
|
+
...entry,
|
|
2367
|
+
base,
|
|
2368
|
+
pattern: normalizeGlobPattern(entry.pattern)
|
|
2369
|
+
});
|
|
2370
|
+
entriesByBase.set(base, group);
|
|
2371
|
+
}
|
|
2372
|
+
return entriesByBase;
|
|
2373
|
+
}
|
|
2374
|
+
async function expandTailwindV4SourceEntries(entries, resolveFiles) {
|
|
2375
|
+
if (entries.length === 0) return [];
|
|
2376
|
+
const files = /* @__PURE__ */ new Set();
|
|
2377
|
+
await Promise.all([...groupTailwindV4SourceEntriesByBase(entries).entries()].map(async ([base, group]) => {
|
|
2378
|
+
const matched = await resolveFiles({
|
|
2379
|
+
cwd: base,
|
|
2380
|
+
sources: group
|
|
2381
|
+
});
|
|
2382
|
+
for (const file of matched) files.add(path.resolve(file));
|
|
2383
|
+
}));
|
|
2384
|
+
return [...files].filter((file) => !isFileExcludedByTailwindV4SourceEntries(file, entries));
|
|
2385
|
+
}
|
|
2386
|
+
function mergeTailwindV4SourceEntries(...entries) {
|
|
2387
|
+
const result = [];
|
|
2388
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2389
|
+
for (const group of entries) for (const entry of group ?? []) {
|
|
2390
|
+
const normalized = {
|
|
2391
|
+
base: path.resolve(entry.base),
|
|
2392
|
+
pattern: normalizeGlobPattern(entry.pattern),
|
|
2393
|
+
negated: entry.negated
|
|
2394
|
+
};
|
|
2395
|
+
const key = JSON.stringify(normalized);
|
|
2396
|
+
if (seen.has(key)) continue;
|
|
2397
|
+
seen.add(key);
|
|
2398
|
+
result.push(normalized);
|
|
2399
|
+
}
|
|
2400
|
+
return result;
|
|
2401
|
+
}
|
|
2402
|
+
function resolveTailwindV4SourceBaseCandidates(projectRoot, base, baseFallbacks) {
|
|
2403
|
+
return uniqueResolvedPaths([
|
|
2404
|
+
base,
|
|
2405
|
+
projectRoot,
|
|
2406
|
+
...baseFallbacks
|
|
2407
|
+
]);
|
|
2408
|
+
}
|
|
2131
2409
|
//#endregion
|
|
2132
2410
|
//#region src/extraction/candidate-extractor.ts
|
|
2133
2411
|
let oxideImportPromise;
|
|
@@ -2157,7 +2435,7 @@ const HTML_ATTRIBUTE_NAME_CANDIDATE_RE = /^(?:class|className|hover-class|hoverC
|
|
|
2157
2435
|
const CSS_DIRECTIVE_CANDIDATE_RE = /^@(?:apply|tailwind|source|config|plugin|theme|utility|custom-variant|variant)$/;
|
|
2158
2436
|
const CSS_APPLY_IMPORTANT = "!important";
|
|
2159
2437
|
const CSS_APPLY_RE = /@apply\s+([^;{}]+)/g;
|
|
2160
|
-
const JS_LIKE_SOURCE_EXTENSION_RE = /^
|
|
2438
|
+
const JS_LIKE_SOURCE_EXTENSION_RE = /^[cm]?[jt]sx?$/;
|
|
2161
2439
|
const MIXED_TEMPLATE_SOURCE_EXTENSION_RE = /^(?:vue|uvue|nvue|svelte|mpx)$/;
|
|
2162
2440
|
const CSS_LIKE_SOURCE_EXTENSION_RE = /^(?:css|wxss|acss|jxss|ttss|qss|tyss|scss|sass|less|styl|stylus)$/;
|
|
2163
2441
|
const SFC_SCRIPT_BLOCK_RE = /<script\b[^>]*>([\s\S]*?)<\/script>/gi;
|
|
@@ -2173,7 +2451,7 @@ function isHtmlAttributeNameCandidate(content, candidate) {
|
|
|
2173
2451
|
function isInsideHtmlTagText(content, candidate) {
|
|
2174
2452
|
if (content.lastIndexOf("<", candidate.start) > content.lastIndexOf(">", candidate.start)) return false;
|
|
2175
2453
|
const nextOpen = content.indexOf("<", candidate.end);
|
|
2176
|
-
return nextOpen !== -1 && (nextOpen < content.indexOf(">", candidate.end) || content.
|
|
2454
|
+
return nextOpen !== -1 && (nextOpen < content.indexOf(">", candidate.end) || !content.includes(">", candidate.end));
|
|
2177
2455
|
}
|
|
2178
2456
|
function isCssDirectiveCandidate(candidate) {
|
|
2179
2457
|
return candidate === CSS_APPLY_IMPORTANT || CSS_DIRECTIVE_CANDIDATE_RE.test(candidate);
|
|
@@ -2260,7 +2538,26 @@ function createLocalCandidate(candidate) {
|
|
|
2260
2538
|
end: candidate.localStart + candidate.rawCandidate.length
|
|
2261
2539
|
};
|
|
2262
2540
|
}
|
|
2263
|
-
|
|
2541
|
+
function dedupeCandidatesWithPositions(candidates) {
|
|
2542
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2543
|
+
return candidates.filter((candidate) => {
|
|
2544
|
+
const key = `${candidate.start}:${candidate.end}:${candidate.rawCandidate}`;
|
|
2545
|
+
if (seen.has(key)) return false;
|
|
2546
|
+
seen.add(key);
|
|
2547
|
+
return true;
|
|
2548
|
+
});
|
|
2549
|
+
}
|
|
2550
|
+
function createBareArbitraryValueCandidateContexts(content, extension, offset, options) {
|
|
2551
|
+
return extractBareArbitraryValueSourceCandidatesWithPositions(content, options?.bareArbitraryValues).map((candidate) => ({
|
|
2552
|
+
content,
|
|
2553
|
+
extension,
|
|
2554
|
+
localStart: candidate.start,
|
|
2555
|
+
rawCandidate: candidate.rawCandidate,
|
|
2556
|
+
start: candidate.start + offset,
|
|
2557
|
+
end: candidate.end + offset
|
|
2558
|
+
}));
|
|
2559
|
+
}
|
|
2560
|
+
async function extractCssApplyCandidates(content, extension, options) {
|
|
2264
2561
|
const candidates = [];
|
|
2265
2562
|
CSS_APPLY_RE.lastIndex = 0;
|
|
2266
2563
|
let match = CSS_APPLY_RE.exec(content);
|
|
@@ -2276,11 +2573,12 @@ async function extractCssApplyCandidates(content, extension) {
|
|
|
2276
2573
|
start: candidate.start + applyParamsStart,
|
|
2277
2574
|
end: candidate.end + applyParamsStart
|
|
2278
2575
|
})));
|
|
2576
|
+
candidates.push(...createBareArbitraryValueCandidateContexts(applyParams, "html", applyParamsStart, options));
|
|
2279
2577
|
match = CSS_APPLY_RE.exec(content);
|
|
2280
2578
|
}
|
|
2281
2579
|
return candidates;
|
|
2282
2580
|
}
|
|
2283
|
-
async function extractMixedSourceScriptCandidates(content) {
|
|
2581
|
+
async function extractMixedSourceScriptCandidates(content, options) {
|
|
2284
2582
|
const candidates = [];
|
|
2285
2583
|
SFC_SCRIPT_BLOCK_RE.lastIndex = 0;
|
|
2286
2584
|
let match = SFC_SCRIPT_BLOCK_RE.exec(content);
|
|
@@ -2296,6 +2594,7 @@ async function extractMixedSourceScriptCandidates(content) {
|
|
|
2296
2594
|
start: candidate.start + scriptStart,
|
|
2297
2595
|
end: candidate.end + scriptStart
|
|
2298
2596
|
})));
|
|
2597
|
+
candidates.push(...createBareArbitraryValueCandidateContexts(scriptContent, "js", scriptStart, options));
|
|
2299
2598
|
match = SFC_SCRIPT_BLOCK_RE.exec(content);
|
|
2300
2599
|
}
|
|
2301
2600
|
return candidates;
|
|
@@ -2304,9 +2603,9 @@ function createCandidateCacheKey(designSystemKey, options) {
|
|
|
2304
2603
|
if (options.bareArbitraryValues == null || options.bareArbitraryValues === false) return designSystemKey;
|
|
2305
2604
|
return `${designSystemKey}:bare-arbitrary:${JSON.stringify(options.bareArbitraryValues)}`;
|
|
2306
2605
|
}
|
|
2307
|
-
async function extractRawCandidatesWithPositions(content, extension = "html") {
|
|
2606
|
+
async function extractRawCandidatesWithPositions(content, extension = "html", options) {
|
|
2308
2607
|
const { Scanner } = await getOxideModule();
|
|
2309
|
-
|
|
2608
|
+
const candidates = new Scanner({}).getCandidatesWithPositions({
|
|
2310
2609
|
content,
|
|
2311
2610
|
extension
|
|
2312
2611
|
}).map(({ candidate, position }) => ({
|
|
@@ -2314,16 +2613,18 @@ async function extractRawCandidatesWithPositions(content, extension = "html") {
|
|
|
2314
2613
|
start: position,
|
|
2315
2614
|
end: position + candidate.length
|
|
2316
2615
|
}));
|
|
2616
|
+
candidates.push(...extractBareArbitraryValueSourceCandidatesWithPositions(content, options?.bareArbitraryValues));
|
|
2617
|
+
return dedupeCandidatesWithPositions(candidates);
|
|
2317
2618
|
}
|
|
2318
|
-
async function extractSourceCandidatesWithPositions(content, extension = "html") {
|
|
2619
|
+
async function extractSourceCandidatesWithPositions(content, extension = "html", options) {
|
|
2319
2620
|
const normalizedExtension = extension.replace(/^\./, "");
|
|
2320
|
-
const candidates = CSS_LIKE_SOURCE_EXTENSION_RE.test(normalizedExtension) ? await extractCssApplyCandidates(content, normalizedExtension) : (await extractRawCandidatesWithPositions(content, normalizedExtension)).map((candidate) => ({
|
|
2621
|
+
const candidates = CSS_LIKE_SOURCE_EXTENSION_RE.test(normalizedExtension) ? await extractCssApplyCandidates(content, normalizedExtension, options) : (await extractRawCandidatesWithPositions(content, normalizedExtension, options)).map((candidate) => ({
|
|
2321
2622
|
...candidate,
|
|
2322
2623
|
content,
|
|
2323
2624
|
extension: normalizedExtension,
|
|
2324
2625
|
localStart: candidate.start
|
|
2325
2626
|
}));
|
|
2326
|
-
if (MIXED_TEMPLATE_SOURCE_EXTENSION_RE.test(normalizedExtension)) candidates.push(...await extractMixedSourceScriptCandidates(content));
|
|
2627
|
+
if (MIXED_TEMPLATE_SOURCE_EXTENSION_RE.test(normalizedExtension)) candidates.push(...await extractMixedSourceScriptCandidates(content, options));
|
|
2327
2628
|
const seen = /* @__PURE__ */ new Set();
|
|
2328
2629
|
return candidates.filter((candidate) => {
|
|
2329
2630
|
if (!shouldKeepSourceCandidate(candidate.content, candidate.extension, createLocalCandidate(candidate))) return false;
|
|
@@ -2337,13 +2638,22 @@ async function extractSourceCandidatesWithPositions(content, extension = "html")
|
|
|
2337
2638
|
end
|
|
2338
2639
|
}));
|
|
2339
2640
|
}
|
|
2340
|
-
async function extractSourceCandidates(content, extension = "html") {
|
|
2341
|
-
const candidates = await extractSourceCandidatesWithPositions(content, extension);
|
|
2641
|
+
async function extractSourceCandidates(content, extension = "html", options) {
|
|
2642
|
+
const candidates = await extractSourceCandidatesWithPositions(content, extension, options);
|
|
2342
2643
|
return [...new Set(candidates.map((candidate) => candidate.rawCandidate))];
|
|
2343
2644
|
}
|
|
2344
|
-
async function extractRawCandidates(sources) {
|
|
2645
|
+
async function extractRawCandidates(sources, options) {
|
|
2345
2646
|
const { Scanner } = await getOxideModule();
|
|
2346
|
-
|
|
2647
|
+
const scanner = new Scanner(sources === void 0 ? {} : { sources });
|
|
2648
|
+
const candidates = new Set(scanner.scan());
|
|
2649
|
+
if (options?.bareArbitraryValues !== void 0 && options.bareArbitraryValues !== false) await Promise.all((scanner.files ?? []).map(async (file) => {
|
|
2650
|
+
try {
|
|
2651
|
+
const content = await promises.readFile(file, "utf8");
|
|
2652
|
+
const extension = toExtension(file);
|
|
2653
|
+
for (const candidate of extractBareArbitraryValueSourceCandidatesWithPositions(content, options.bareArbitraryValues)) if (shouldKeepSourceCandidate(content, extension, candidate)) candidates.add(candidate.rawCandidate);
|
|
2654
|
+
} catch {}
|
|
2655
|
+
}));
|
|
2656
|
+
return [...candidates];
|
|
2347
2657
|
}
|
|
2348
2658
|
async function extractValidCandidates(options) {
|
|
2349
2659
|
const providedOptions = options ?? {};
|
|
@@ -2372,7 +2682,7 @@ async function extractValidCandidates(options) {
|
|
|
2372
2682
|
const candidateCacheKey = createCandidateCacheKey(designSystemKey, providedOptions);
|
|
2373
2683
|
const candidateCache = designSystemCandidateCache.get(candidateCacheKey) ?? /* @__PURE__ */ new Map();
|
|
2374
2684
|
designSystemCandidateCache.set(candidateCacheKey, candidateCache);
|
|
2375
|
-
const candidates = await extractRawCandidates(sources);
|
|
2685
|
+
const candidates = await extractRawCandidates(sources, providedOptions.bareArbitraryValues === void 0 ? void 0 : { bareArbitraryValues: providedOptions.bareArbitraryValues });
|
|
2376
2686
|
const inlineSources = extractTailwindV4InlineSourceCandidates(css);
|
|
2377
2687
|
for (const candidate of inlineSources.included) candidates.push(candidate);
|
|
2378
2688
|
for (const candidate of inlineSources.excluded) {
|
|
@@ -4218,4 +4528,4 @@ var ValidateCommandError = class extends Error {
|
|
|
4218
4528
|
}
|
|
4219
4529
|
};
|
|
4220
4530
|
//#endregion
|
|
4221
|
-
export {
|
|
4531
|
+
export { resolveBareArbitraryValueCandidate as $, createTailwindV4RootSources as A, resolveSourceScanPath as B, resolveProjectSourceFiles as C, TAILWIND_V4_IGNORED_FILES as D, TAILWIND_V4_IGNORED_EXTENSIONS as E, isFileExcludedByTailwindV4SourceEntries as F, canonicalizeBareArbitraryValueCandidates as G, resolveTailwindV4SourceEntry as H, isFileMatchedByTailwindV4SourceEntries as I, resolveValidTailwindV4Candidates as J, extractTailwindV4InlineSourceCandidates as K, mergeTailwindV4SourceEntries as L, createTailwindV4SourceExclusionMatcher as M, expandTailwindV4SourceEntries as N, createTailwindV4CompiledSourceEntries as O, expandTailwindV4SourceEntryBraces as P, isBareArbitraryValuesEnabled as Q, normalizeTailwindV4ScannerSources as R, groupTokensByFile as S, TAILWIND_V4_IGNORED_CONTENT_DIRS as T, compileTailwindV4Source as U, resolveTailwindV4SourceBaseCandidates as V, loadTailwindV4DesignSystem as W, extractBareArbitraryValueSourceCandidates as X, escapeCssClassName as Y, extractBareArbitraryValueSourceCandidatesWithPositions as Z, extractRawCandidates as _, tailwindcssPatchCommands as a, extractSourceCandidatesWithPositions as b, MIGRATION_REPORT_KIND as c, getPatchStatusReport as d, loadPatchOptionsForWorkspace as et, runTailwindBuild as f, extractProjectCandidatesWithPositions as g, collectClassesFromTailwindV4 as h, classifyValidateError as i, logger as it, createTailwindV4SourceEntryMatcher as j, createTailwindV4DefaultIgnoreSources as k, MIGRATION_REPORT_SCHEMA_VERSION as l, collectClassesFromContexts as m, VALIDATE_FAILURE_REASONS as n, normalizeOptions as nt, migrateConfigFiles as o, loadRuntimeContexts as p, replaceBareArbitraryValueSelectors as q, ValidateCommandError as r, CacheStore as rt, restoreConfigFiles as s, VALIDATE_EXIT_CODES as t, loadWorkspaceConfigModule as tt, TailwindcssPatcher as u, extractRawCandidatesWithPositions as v, TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN as w, extractValidCandidates as x, extractSourceCandidates as y, normalizeTailwindV4SourceEntries as z };
|
|
@@ -504,6 +504,20 @@ interface BareArbitraryValueOptions {
|
|
|
504
504
|
*/
|
|
505
505
|
units?: string[];
|
|
506
506
|
}
|
|
507
|
+
interface BareArbitraryValueResolveResult {
|
|
508
|
+
candidate: string;
|
|
509
|
+
canonicalCandidate: string;
|
|
510
|
+
}
|
|
511
|
+
interface BareArbitraryValueSourceCandidate {
|
|
512
|
+
rawCandidate: string;
|
|
513
|
+
start: number;
|
|
514
|
+
end: number;
|
|
515
|
+
}
|
|
516
|
+
declare function isBareArbitraryValuesEnabled(options: boolean | BareArbitraryValueOptions | undefined): boolean;
|
|
517
|
+
declare function resolveBareArbitraryValueCandidate(candidate: string, options?: boolean | BareArbitraryValueOptions): BareArbitraryValueResolveResult | undefined;
|
|
518
|
+
declare function extractBareArbitraryValueSourceCandidatesWithPositions(content: string, options?: boolean | BareArbitraryValueOptions): BareArbitraryValueSourceCandidate[];
|
|
519
|
+
declare function extractBareArbitraryValueSourceCandidates(content: string, options?: boolean | BareArbitraryValueOptions): string[];
|
|
520
|
+
declare function escapeCssClassName(value: string): string;
|
|
507
521
|
//#endregion
|
|
508
522
|
//#region src/extraction/candidate-extractor.d.ts
|
|
509
523
|
interface ExtractValidCandidatesOption {
|
|
@@ -514,15 +528,18 @@ interface ExtractValidCandidatesOption {
|
|
|
514
528
|
cwd?: string;
|
|
515
529
|
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
516
530
|
}
|
|
531
|
+
interface ExtractCandidateOptions {
|
|
532
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
533
|
+
}
|
|
517
534
|
interface ExtractSourceCandidate {
|
|
518
535
|
rawCandidate: string;
|
|
519
536
|
start: number;
|
|
520
537
|
end: number;
|
|
521
538
|
}
|
|
522
|
-
declare function extractRawCandidatesWithPositions(content: string, extension?: string): Promise<ExtractSourceCandidate[]>;
|
|
523
|
-
declare function extractSourceCandidatesWithPositions(content: string, extension?: string): Promise<ExtractSourceCandidate[]>;
|
|
524
|
-
declare function extractSourceCandidates(content: string, extension?: string): Promise<string[]>;
|
|
525
|
-
declare function extractRawCandidates(sources?: SourceEntry[]): Promise<string[]>;
|
|
539
|
+
declare function extractRawCandidatesWithPositions(content: string, extension?: string, options?: ExtractCandidateOptions): Promise<ExtractSourceCandidate[]>;
|
|
540
|
+
declare function extractSourceCandidatesWithPositions(content: string, extension?: string, options?: ExtractCandidateOptions): Promise<ExtractSourceCandidate[]>;
|
|
541
|
+
declare function extractSourceCandidates(content: string, extension?: string, options?: ExtractCandidateOptions): Promise<string[]>;
|
|
542
|
+
declare function extractRawCandidates(sources?: SourceEntry[], options?: ExtractCandidateOptions): Promise<string[]>;
|
|
526
543
|
declare function extractValidCandidates(options?: ExtractValidCandidatesOption): Promise<string[]>;
|
|
527
544
|
interface ExtractProjectCandidatesOptions {
|
|
528
545
|
cwd?: string;
|
|
@@ -791,4 +808,4 @@ declare class ValidateCommandError extends Error {
|
|
|
791
808
|
constructor(summary: ValidateFailureSummary, options?: ErrorOptions);
|
|
792
809
|
}
|
|
793
810
|
//#endregion
|
|
794
|
-
export {
|
|
811
|
+
export { TailwindV3Options as $, extractSourceCandidates as A, CacheReadMeta as At, resolveBareArbitraryValueCandidate as B, MIGRATION_REPORT_SCHEMA_VERSION as C, TailwindcssRuntimeContext as Ct, extractProjectCandidatesWithPositions as D, CacheContextDescriptor as Dt, ExtractSourceCandidate as E, CacheClearScope as Et, BareArbitraryValueOptions as F, ExposeContextOptions as G, ApplyOptions as H, escapeCssClassName as I, NormalizedCacheOptions as J, ExtendLengthUnitsOptions as K, extractBareArbitraryValueSourceCandidates as L, extractValidCandidates as M, groupTokensByFile as N, extractRawCandidates as O, CacheContextMetadata as Ot, resolveProjectSourceFiles as P, TailwindV2Options as Q, extractBareArbitraryValueSourceCandidatesWithPositions as R, MIGRATION_REPORT_KIND as S, TailwindcssClassCache as St, TailwindcssPatcher as T, CacheClearResult as Tt, CacheOptions as U, normalizeOptions as V, CacheStrategy as W, TailwindCssOptions as X, NormalizedTailwindCssPatchOptions as Y, TailwindCssPatchOptions as Z, ConfigFileMigrationEntry as _, TailwindPatchRuntime as _t, ValidateFailureSummary as a, TailwindV4Engine as at, RestoreConfigFilesOptions as b, TailwindTokenLocation as bt, TailwindcssPatchCliMountOptions as c, TailwindV4ResolvedSource as ct, TailwindcssPatchCommandContext as d, ExtractResult as dt, TailwindV4Options as et, TailwindcssPatchCommandHandler as f, ILengthUnitsPatchOptions as ft, tailwindcssPatchCommands as g, PatchStatusReport as gt, TailwindcssPatchCommandOptions as h, PatchStatusEntry as ht, ValidateFailureReason as i, TailwindV4DesignSystem as it, extractSourceCandidatesWithPositions as j, CacheReadResult as jt, extractRawCandidatesWithPositions as k, CacheIndexFileV2 as kt, TailwindcssPatchCliOptions as l, TailwindV4SourceOptions as lt, TailwindcssPatchCommandOptionDefinition as m, PatchName as mt, VALIDATE_FAILURE_REASONS as n, TailwindV4CompiledSourceRoot as nt, ValidateJsonFailurePayload as o, TailwindV4GenerateOptions as ot, TailwindcssPatchCommandHandlerMap as p, PatchCheckStatus as pt, ExtractOptions as q, ValidateCommandError as r, TailwindV4CssSource as rt, ValidateJsonSuccessPayload as s, TailwindV4GenerateResult as st, VALIDATE_EXIT_CODES as t, TailwindV4CandidateSource as tt, TailwindcssPatchCommand as u, TailwindV4SourcePattern as ut, ConfigFileMigrationReport as v, TailwindTokenByFileMap as vt, logger as w, CacheClearOptions as wt, RestoreConfigFilesResult as x, TailwindTokenReport as xt, MigrateConfigFilesOptions as y, TailwindTokenFileKey as yt, isBareArbitraryValuesEnabled as z };
|
|
@@ -503,6 +503,20 @@ interface BareArbitraryValueOptions {
|
|
|
503
503
|
*/
|
|
504
504
|
units?: string[];
|
|
505
505
|
}
|
|
506
|
+
interface BareArbitraryValueResolveResult {
|
|
507
|
+
candidate: string;
|
|
508
|
+
canonicalCandidate: string;
|
|
509
|
+
}
|
|
510
|
+
interface BareArbitraryValueSourceCandidate {
|
|
511
|
+
rawCandidate: string;
|
|
512
|
+
start: number;
|
|
513
|
+
end: number;
|
|
514
|
+
}
|
|
515
|
+
declare function isBareArbitraryValuesEnabled(options: boolean | BareArbitraryValueOptions | undefined): boolean;
|
|
516
|
+
declare function resolveBareArbitraryValueCandidate(candidate: string, options?: boolean | BareArbitraryValueOptions): BareArbitraryValueResolveResult | undefined;
|
|
517
|
+
declare function extractBareArbitraryValueSourceCandidatesWithPositions(content: string, options?: boolean | BareArbitraryValueOptions): BareArbitraryValueSourceCandidate[];
|
|
518
|
+
declare function extractBareArbitraryValueSourceCandidates(content: string, options?: boolean | BareArbitraryValueOptions): string[];
|
|
519
|
+
declare function escapeCssClassName(value: string): string;
|
|
506
520
|
//#endregion
|
|
507
521
|
//#region src/extraction/candidate-extractor.d.ts
|
|
508
522
|
interface ExtractValidCandidatesOption {
|
|
@@ -513,15 +527,18 @@ interface ExtractValidCandidatesOption {
|
|
|
513
527
|
cwd?: string;
|
|
514
528
|
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
515
529
|
}
|
|
530
|
+
interface ExtractCandidateOptions {
|
|
531
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
532
|
+
}
|
|
516
533
|
interface ExtractSourceCandidate {
|
|
517
534
|
rawCandidate: string;
|
|
518
535
|
start: number;
|
|
519
536
|
end: number;
|
|
520
537
|
}
|
|
521
|
-
declare function extractRawCandidatesWithPositions(content: string, extension?: string): Promise<ExtractSourceCandidate[]>;
|
|
522
|
-
declare function extractSourceCandidatesWithPositions(content: string, extension?: string): Promise<ExtractSourceCandidate[]>;
|
|
523
|
-
declare function extractSourceCandidates(content: string, extension?: string): Promise<string[]>;
|
|
524
|
-
declare function extractRawCandidates(sources?: SourceEntry[]): Promise<string[]>;
|
|
538
|
+
declare function extractRawCandidatesWithPositions(content: string, extension?: string, options?: ExtractCandidateOptions): Promise<ExtractSourceCandidate[]>;
|
|
539
|
+
declare function extractSourceCandidatesWithPositions(content: string, extension?: string, options?: ExtractCandidateOptions): Promise<ExtractSourceCandidate[]>;
|
|
540
|
+
declare function extractSourceCandidates(content: string, extension?: string, options?: ExtractCandidateOptions): Promise<string[]>;
|
|
541
|
+
declare function extractRawCandidates(sources?: SourceEntry[], options?: ExtractCandidateOptions): Promise<string[]>;
|
|
525
542
|
declare function extractValidCandidates(options?: ExtractValidCandidatesOption): Promise<string[]>;
|
|
526
543
|
interface ExtractProjectCandidatesOptions {
|
|
527
544
|
cwd?: string;
|
|
@@ -790,4 +807,4 @@ declare class ValidateCommandError extends Error {
|
|
|
790
807
|
constructor(summary: ValidateFailureSummary, options?: ErrorOptions);
|
|
791
808
|
}
|
|
792
809
|
//#endregion
|
|
793
|
-
export {
|
|
810
|
+
export { TailwindV3Options as $, extractSourceCandidates as A, CacheReadMeta as At, resolveBareArbitraryValueCandidate as B, MIGRATION_REPORT_SCHEMA_VERSION as C, TailwindcssRuntimeContext as Ct, extractProjectCandidatesWithPositions as D, CacheContextDescriptor as Dt, ExtractSourceCandidate as E, CacheClearScope as Et, BareArbitraryValueOptions as F, ExposeContextOptions as G, ApplyOptions as H, escapeCssClassName as I, NormalizedCacheOptions as J, ExtendLengthUnitsOptions as K, extractBareArbitraryValueSourceCandidates as L, extractValidCandidates as M, groupTokensByFile as N, extractRawCandidates as O, CacheContextMetadata as Ot, resolveProjectSourceFiles as P, TailwindV2Options as Q, extractBareArbitraryValueSourceCandidatesWithPositions as R, MIGRATION_REPORT_KIND as S, TailwindcssClassCache as St, TailwindcssPatcher as T, CacheClearResult as Tt, CacheOptions as U, normalizeOptions as V, CacheStrategy as W, TailwindCssOptions as X, NormalizedTailwindCssPatchOptions as Y, TailwindCssPatchOptions as Z, ConfigFileMigrationEntry as _, TailwindPatchRuntime as _t, ValidateFailureSummary as a, TailwindV4Engine as at, RestoreConfigFilesOptions as b, TailwindTokenLocation as bt, TailwindcssPatchCliMountOptions as c, TailwindV4ResolvedSource as ct, TailwindcssPatchCommandContext as d, ExtractResult as dt, TailwindV4Options as et, TailwindcssPatchCommandHandler as f, ILengthUnitsPatchOptions as ft, tailwindcssPatchCommands as g, PatchStatusReport as gt, TailwindcssPatchCommandOptions as h, PatchStatusEntry as ht, ValidateFailureReason as i, TailwindV4DesignSystem as it, extractSourceCandidatesWithPositions as j, CacheReadResult as jt, extractRawCandidatesWithPositions as k, CacheIndexFileV2 as kt, TailwindcssPatchCliOptions as l, TailwindV4SourceOptions as lt, TailwindcssPatchCommandOptionDefinition as m, PatchName as mt, VALIDATE_FAILURE_REASONS as n, TailwindV4CompiledSourceRoot as nt, ValidateJsonFailurePayload as o, TailwindV4GenerateOptions as ot, TailwindcssPatchCommandHandlerMap as p, PatchCheckStatus as pt, ExtractOptions as q, ValidateCommandError as r, TailwindV4CssSource as rt, ValidateJsonSuccessPayload as s, TailwindV4GenerateResult as st, VALIDATE_EXIT_CODES as t, TailwindV4CandidateSource as tt, TailwindcssPatchCommand as u, TailwindV4SourcePattern as ut, ConfigFileMigrationReport as v, TailwindTokenByFileMap as vt, logger as w, CacheClearOptions as wt, RestoreConfigFilesResult as x, TailwindTokenReport as xt, MigrateConfigFilesOptions as y, TailwindTokenFileKey as yt, isBareArbitraryValuesEnabled as z };
|