tailwindcss-patch 9.2.0 → 9.3.0
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.js +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/commands/cli-runtime.d.mts +1 -1
- package/dist/commands/cli-runtime.d.ts +1 -1
- package/dist/commands/cli-runtime.js +1 -1
- package/dist/commands/cli-runtime.mjs +1 -1
- package/dist/{index.bundle-dp_pw5fq.mjs → index.bundle-CsMNxjyL.mjs} +4 -3
- package/dist/{index.bundle-BQ_yKkd8.js → index.bundle-DSIUuQAH.js} +4 -3
- package/dist/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{validate-D5elFZMj.mjs → validate-B_jsptz9.mjs} +269 -12
- package/dist/{validate-Bu_rkfQF.d.ts → validate-Bqych-z9.d.ts} +17 -1
- package/dist/{validate-CIMnzW8O.d.mts → validate-C8-qsOWo.d.mts} +17 -1
- package/dist/{validate-749MHvAC.js → validate-DzKStQUM.js} +280 -11
- package/package.json +2 -2
- package/src/extraction/candidate-extractor.ts +50 -5
- package/src/options/normalize.ts +5 -0
- package/src/options/types.ts +8 -0
- package/src/runtime/class-collector.ts +2 -0
- package/src/v4/bare-arbitrary-values.ts +326 -0
- package/src/v4/candidates.ts +68 -4
- package/src/v4/engine.ts +15 -3
- package/src/v4/types.ts +6 -0
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_validate = require("./validate-
|
|
3
|
-
const require_index_bundle = require("./index.bundle-
|
|
2
|
+
const require_validate = require("./validate-DzKStQUM.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-DSIUuQAH.js");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
6
6
|
//#region src/cli.bundle.ts
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createTailwindcssPatchCli } from "./index.bundle-
|
|
1
|
+
import { j as logger, r as ValidateCommandError } from "./validate-B_jsptz9.mjs";
|
|
2
|
+
import { t as createTailwindcssPatchCli } from "./index.bundle-CsMNxjyL.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
//#region src/cli.bundle.ts
|
|
5
5
|
async function main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-
|
|
1
|
+
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-C8-qsOWo.mjs";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/cli.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-
|
|
1
|
+
import { a as ValidateFailureSummary, c as TailwindcssPatchCliMountOptions, d as TailwindcssPatchCommandContext, f as TailwindcssPatchCommandHandler, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, l as TailwindcssPatchCliOptions, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, o as ValidateJsonFailurePayload, p as TailwindcssPatchCommandHandlerMap, r as ValidateCommandError, s as ValidateJsonSuccessPayload, t as VALIDATE_EXIT_CODES, u as TailwindcssPatchCommand } from "../validate-Bqych-z9.js";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/cli.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../chunk-8l464Juk.js");
|
|
3
|
-
const require_validate = require("../validate-
|
|
3
|
+
const require_validate = require("../validate-DzKStQUM.js");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
6
6
|
let fs_extra = require("fs-extra");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as loadPatchOptionsForWorkspace, O as loadWorkspaceConfigModule, a as tailwindcssPatchCommands, b as groupTokensByFile, i as classifyValidateError, j as logger, n as VALIDATE_FAILURE_REASONS, o as migrateConfigFiles, r as ValidateCommandError, s as restoreConfigFiles, t as VALIDATE_EXIT_CODES, u as TailwindcssPatcher } from "../validate-B_jsptz9.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fs from "fs-extra";
|
|
4
4
|
import path from "pathe";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as canonicalizeBareArbitraryValueCandidates, E as resolveValidTailwindV4Candidates, S as loadTailwindV4DesignSystem, T as replaceBareArbitraryValueSelectors, _ as extractRawCandidates, k as normalizeOptions, v as extractRawCandidatesWithPositions, w as extractTailwindV4InlineSourceCandidates, x as compileTailwindV4Source } from "./validate-B_jsptz9.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import path from "pathe";
|
|
@@ -35,11 +35,12 @@ function createTailwindV4Engine(source) {
|
|
|
35
35
|
async generate(options) {
|
|
36
36
|
const { compiled, dependencies } = await compileTailwindV4Source(source);
|
|
37
37
|
const rawCandidates = await collectRawCandidates(source, options, compiled.sources);
|
|
38
|
-
const classSet = resolveValidTailwindV4Candidates(await loadTailwindV4DesignSystem(source), rawCandidates);
|
|
38
|
+
const classSet = resolveValidTailwindV4Candidates(await loadTailwindV4DesignSystem(source), rawCandidates, { ...options?.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } });
|
|
39
39
|
const inlineSources = extractTailwindV4InlineSourceCandidates(source.css);
|
|
40
40
|
for (const candidate of inlineSources.excluded) classSet.delete(candidate);
|
|
41
|
+
const buildCandidates = canonicalizeBareArbitraryValueCandidates(classSet, options?.bareArbitraryValues);
|
|
41
42
|
return {
|
|
42
|
-
css: compiled.build(
|
|
43
|
+
css: replaceBareArbitraryValueSelectors(compiled.build(buildCandidates), classSet, options?.bareArbitraryValues),
|
|
43
44
|
classSet,
|
|
44
45
|
rawCandidates,
|
|
45
46
|
dependencies: Array.from(dependencies),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_validate = require("./validate-
|
|
2
|
+
const require_validate = require("./validate-DzKStQUM.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
@@ -38,11 +38,12 @@ function createTailwindV4Engine(source) {
|
|
|
38
38
|
async generate(options) {
|
|
39
39
|
const { compiled, dependencies } = await require_validate.compileTailwindV4Source(source);
|
|
40
40
|
const rawCandidates = await collectRawCandidates(source, options, compiled.sources);
|
|
41
|
-
const classSet = require_validate.resolveValidTailwindV4Candidates(await require_validate.loadTailwindV4DesignSystem(source), rawCandidates);
|
|
41
|
+
const classSet = require_validate.resolveValidTailwindV4Candidates(await require_validate.loadTailwindV4DesignSystem(source), rawCandidates, { ...options?.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } });
|
|
42
42
|
const inlineSources = require_validate.extractTailwindV4InlineSourceCandidates(source.css);
|
|
43
43
|
for (const candidate of inlineSources.excluded) classSet.delete(candidate);
|
|
44
|
+
const buildCandidates = require_validate.canonicalizeBareArbitraryValueCandidates(classSet, options?.bareArbitraryValues);
|
|
44
45
|
return {
|
|
45
|
-
css: compiled.build(
|
|
46
|
+
css: require_validate.replaceBareArbitraryValueSelectors(compiled.build(buildCandidates), classSet, options?.bareArbitraryValues),
|
|
46
47
|
classSet,
|
|
47
48
|
rawCandidates,
|
|
48
49
|
dependencies: Array.from(dependencies),
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TailwindTokenByFileMap, A as groupTokensByFile, B as NormalizedTailwindCssPatchOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as CacheStrategy, G as TailwindV4Options, H as TailwindCssPatchOptions, I as ExposeContextOptions, J as PatchCheckStatus, K as ExtractResult, L as ExtendLengthUnitsOptions, M as normalizeOptions, N as ApplyOptions, O as extractRawCandidatesWithPositions, P as CacheOptions, Q as TailwindPatchRuntime, R as ExtractOptions, S as MIGRATION_REPORT_KIND, T as TailwindcssPatcher, U as TailwindV2Options, V as TailwindCssOptions, W as TailwindV3Options, X as PatchStatusEntry, Y as PatchName, Z as PatchStatusReport, _ as ConfigFileMigrationEntry, a as ValidateFailureSummary, at as CacheClearOptions, b as RestoreConfigFilesOptions, c as TailwindcssPatchCliMountOptions, ct as CacheContextDescriptor, d as TailwindcssPatchCommandContext, dt as CacheReadMeta, et as TailwindTokenFileKey, f as TailwindcssPatchCommandHandler, ft as CacheReadResult, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, it as TailwindcssRuntimeContext, j as BareArbitraryValueOptions, k as extractValidCandidates, l as TailwindcssPatchCliOptions, lt as CacheContextMetadata, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, nt as TailwindTokenReport, o as ValidateJsonFailurePayload, ot as CacheClearResult, p as TailwindcssPatchCommandHandlerMap, q as ILengthUnitsPatchOptions, r as ValidateCommandError, rt as TailwindcssClassCache, s as ValidateJsonSuccessPayload, st as CacheClearScope, t as VALIDATE_EXIT_CODES, tt as TailwindTokenLocation, u as TailwindcssPatchCommand, ut as CacheIndexFileV2, v as ConfigFileMigrationReport, w as logger, x as RestoreConfigFilesResult, y as MigrateConfigFilesOptions, z as NormalizedCacheOptions } from "./validate-C8-qsOWo.mjs";
|
|
2
2
|
import { PackageInfo } from "local-pkg";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import { CAC } from "cac";
|
|
@@ -101,6 +101,12 @@ interface TailwindV4CandidateSource {
|
|
|
101
101
|
interface TailwindV4GenerateOptions {
|
|
102
102
|
candidates?: Iterable<string>;
|
|
103
103
|
sources?: TailwindV4CandidateSource[];
|
|
104
|
+
/**
|
|
105
|
+
* Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`.
|
|
106
|
+
*/
|
|
107
|
+
bareArbitraryValues?: boolean | {
|
|
108
|
+
units?: string[];
|
|
109
|
+
};
|
|
104
110
|
/**
|
|
105
111
|
* 扫描文件系统 source entries 中的候选类名。
|
|
106
112
|
*
|
|
@@ -137,7 +143,9 @@ interface TailwindV4Engine {
|
|
|
137
143
|
}
|
|
138
144
|
//#endregion
|
|
139
145
|
//#region src/v4/candidates.d.ts
|
|
140
|
-
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string
|
|
146
|
+
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string>, options?: {
|
|
147
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
148
|
+
}): Set<string>;
|
|
141
149
|
//#endregion
|
|
142
150
|
//#region src/v4/engine.d.ts
|
|
143
151
|
declare function createTailwindV4Engine(source: TailwindV4ResolvedSource): TailwindV4Engine;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TailwindTokenByFileMap, A as groupTokensByFile, B as NormalizedTailwindCssPatchOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as CacheStrategy, G as TailwindV4Options, H as TailwindCssPatchOptions, I as ExposeContextOptions, J as PatchCheckStatus, K as ExtractResult, L as ExtendLengthUnitsOptions, M as normalizeOptions, N as ApplyOptions, O as extractRawCandidatesWithPositions, P as CacheOptions, Q as TailwindPatchRuntime, R as ExtractOptions, S as MIGRATION_REPORT_KIND, T as TailwindcssPatcher, U as TailwindV2Options, V as TailwindCssOptions, W as TailwindV3Options, X as PatchStatusEntry, Y as PatchName, Z as PatchStatusReport, _ as ConfigFileMigrationEntry, a as ValidateFailureSummary, at as CacheClearOptions, b as RestoreConfigFilesOptions, c as TailwindcssPatchCliMountOptions, ct as CacheContextDescriptor, d as TailwindcssPatchCommandContext, dt as CacheReadMeta, et as TailwindTokenFileKey, f as TailwindcssPatchCommandHandler, ft as CacheReadResult, g as tailwindcssPatchCommands, h as TailwindcssPatchCommandOptions, i as ValidateFailureReason, it as TailwindcssRuntimeContext, j as BareArbitraryValueOptions, k as extractValidCandidates, l as TailwindcssPatchCliOptions, lt as CacheContextMetadata, m as TailwindcssPatchCommandOptionDefinition, n as VALIDATE_FAILURE_REASONS, nt as TailwindTokenReport, o as ValidateJsonFailurePayload, ot as CacheClearResult, p as TailwindcssPatchCommandHandlerMap, q as ILengthUnitsPatchOptions, r as ValidateCommandError, rt as TailwindcssClassCache, s as ValidateJsonSuccessPayload, st as CacheClearScope, t as VALIDATE_EXIT_CODES, tt as TailwindTokenLocation, u as TailwindcssPatchCommand, ut as CacheIndexFileV2, v as ConfigFileMigrationReport, w as logger, x as RestoreConfigFilesResult, y as MigrateConfigFilesOptions, z as NormalizedCacheOptions } from "./validate-Bqych-z9.js";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
import { PackageInfo } from "local-pkg";
|
|
4
4
|
import postcss from "postcss";
|
|
@@ -101,6 +101,12 @@ interface TailwindV4CandidateSource {
|
|
|
101
101
|
interface TailwindV4GenerateOptions {
|
|
102
102
|
candidates?: Iterable<string>;
|
|
103
103
|
sources?: TailwindV4CandidateSource[];
|
|
104
|
+
/**
|
|
105
|
+
* Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`.
|
|
106
|
+
*/
|
|
107
|
+
bareArbitraryValues?: boolean | {
|
|
108
|
+
units?: string[];
|
|
109
|
+
};
|
|
104
110
|
/**
|
|
105
111
|
* 扫描文件系统 source entries 中的候选类名。
|
|
106
112
|
*
|
|
@@ -137,7 +143,9 @@ interface TailwindV4Engine {
|
|
|
137
143
|
}
|
|
138
144
|
//#endregion
|
|
139
145
|
//#region src/v4/candidates.d.ts
|
|
140
|
-
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string
|
|
146
|
+
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string>, options?: {
|
|
147
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
148
|
+
}): Set<string>;
|
|
141
149
|
//#endregion
|
|
142
150
|
//#region src/v4/engine.d.ts
|
|
143
151
|
declare function createTailwindV4Engine(source: TailwindV4ResolvedSource): TailwindV4Engine;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_validate = require("./validate-
|
|
3
|
-
const require_index_bundle = require("./index.bundle-
|
|
2
|
+
const require_validate = require("./validate-DzKStQUM.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-DSIUuQAH.js");
|
|
4
4
|
exports.CacheStore = require_validate.CacheStore;
|
|
5
5
|
exports.MIGRATION_REPORT_KIND = require_validate.MIGRATION_REPORT_KIND;
|
|
6
6
|
exports.MIGRATION_REPORT_SCHEMA_VERSION = require_validate.MIGRATION_REPORT_SCHEMA_VERSION;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as resolveTailwindV4SourceFromPatchOptions, i as resolveTailwindV4Source, n as defineConfig, o as createTailwindV4Engine, r as mountTailwindcssPatchCommands, t as createTailwindcssPatchCli } from "./index.bundle-
|
|
1
|
+
import { A as CacheStore, E as resolveValidTailwindV4Candidates, S as loadTailwindV4DesignSystem, _ as extractRawCandidates, a as tailwindcssPatchCommands, b as groupTokensByFile, c as MIGRATION_REPORT_KIND, d as getPatchStatusReport, f as runTailwindBuild, g as extractProjectCandidatesWithPositions, h as collectClassesFromTailwindV4, j as logger, k as normalizeOptions, l as MIGRATION_REPORT_SCHEMA_VERSION, m as collectClassesFromContexts, n as VALIDATE_FAILURE_REASONS, o as migrateConfigFiles, p as loadRuntimeContexts, r as ValidateCommandError, s as restoreConfigFiles, t as VALIDATE_EXIT_CODES, u as TailwindcssPatcher, v as extractRawCandidatesWithPositions, y as extractValidCandidates } from "./validate-B_jsptz9.mjs";
|
|
2
|
+
import { a as resolveTailwindV4SourceFromPatchOptions, i as resolveTailwindV4Source, n as defineConfig, o as createTailwindV4Engine, r as mountTailwindcssPatchCommands, t as createTailwindcssPatchCli } from "./index.bundle-CsMNxjyL.mjs";
|
|
3
3
|
export { CacheStore, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, TailwindcssPatcher, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindV4Engine, createTailwindcssPatchCli, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
|
@@ -16,7 +16,7 @@ import _babelTraverse from "@babel/traverse";
|
|
|
16
16
|
import { parse, parse as parse$1 } from "@babel/parser";
|
|
17
17
|
import { loadConfig } from "tailwindcss-config";
|
|
18
18
|
//#region package.json
|
|
19
|
-
var version = "9.
|
|
19
|
+
var version = "9.3.0";
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/constants.ts
|
|
22
22
|
const pkgName = "tailwindcss-patch";
|
|
@@ -1335,7 +1335,8 @@ function normalizeTailwindV4Options(v4, fallbackBase) {
|
|
|
1335
1335
|
...v4?.css === void 0 ? {} : { css: v4.css },
|
|
1336
1336
|
cssEntries,
|
|
1337
1337
|
sources,
|
|
1338
|
-
hasUserDefinedSources
|
|
1338
|
+
hasUserDefinedSources,
|
|
1339
|
+
bareArbitraryValues: v4?.bareArbitraryValues === true ? {} : typeof v4?.bareArbitraryValues === "object" && v4.bareArbitraryValues !== null ? { ...v4.bareArbitraryValues } : false
|
|
1339
1340
|
};
|
|
1340
1341
|
}
|
|
1341
1342
|
function normalizeTailwindOptions(tailwind, projectRoot, shouldDefaultResolveFromCwd) {
|
|
@@ -1445,23 +1446,257 @@ async function loadPatchOptionsForWorkspace(cwd, overrides) {
|
|
|
1445
1446
|
return merge(overrides ?? {}, base, { projectRoot: cwd });
|
|
1446
1447
|
}
|
|
1447
1448
|
//#endregion
|
|
1449
|
+
//#region src/v4/bare-arbitrary-values.ts
|
|
1450
|
+
const DEFAULT_BARE_ARBITRARY_VALUE_UNITS = [
|
|
1451
|
+
"%",
|
|
1452
|
+
"px",
|
|
1453
|
+
"rpx",
|
|
1454
|
+
"rem",
|
|
1455
|
+
"em",
|
|
1456
|
+
"vw",
|
|
1457
|
+
"vh",
|
|
1458
|
+
"vmin",
|
|
1459
|
+
"vmax",
|
|
1460
|
+
"dvw",
|
|
1461
|
+
"dvh",
|
|
1462
|
+
"svw",
|
|
1463
|
+
"svh",
|
|
1464
|
+
"lvw",
|
|
1465
|
+
"lvh",
|
|
1466
|
+
"ch",
|
|
1467
|
+
"ex",
|
|
1468
|
+
"lh",
|
|
1469
|
+
"rlh",
|
|
1470
|
+
"fr",
|
|
1471
|
+
"deg",
|
|
1472
|
+
"rad",
|
|
1473
|
+
"turn",
|
|
1474
|
+
"s",
|
|
1475
|
+
"ms"
|
|
1476
|
+
];
|
|
1477
|
+
const NUMBER_RE = /^-?(?:\d+|\d*\.\d+)$/;
|
|
1478
|
+
const FUNCTION_VALUE_RE = /^[a-zA-Z_-][a-zA-Z0-9_-]*\(/;
|
|
1479
|
+
function splitVariantPrefix(candidate) {
|
|
1480
|
+
let depth = 0;
|
|
1481
|
+
let quote;
|
|
1482
|
+
let lastSeparator = -1;
|
|
1483
|
+
for (let index = 0; index < candidate.length; index++) {
|
|
1484
|
+
const character = candidate[index];
|
|
1485
|
+
if (character === "\\") {
|
|
1486
|
+
index++;
|
|
1487
|
+
continue;
|
|
1488
|
+
}
|
|
1489
|
+
if (quote) {
|
|
1490
|
+
if (character === quote) quote = void 0;
|
|
1491
|
+
continue;
|
|
1492
|
+
}
|
|
1493
|
+
if (character === "\"" || character === "'") {
|
|
1494
|
+
quote = character;
|
|
1495
|
+
continue;
|
|
1496
|
+
}
|
|
1497
|
+
if (character === "[" || character === "(" || character === "{") {
|
|
1498
|
+
depth++;
|
|
1499
|
+
continue;
|
|
1500
|
+
}
|
|
1501
|
+
if (character === "]" || character === ")" || character === "}") {
|
|
1502
|
+
depth = Math.max(0, depth - 1);
|
|
1503
|
+
continue;
|
|
1504
|
+
}
|
|
1505
|
+
if (depth === 0 && character === ":") lastSeparator = index;
|
|
1506
|
+
}
|
|
1507
|
+
if (lastSeparator === -1) return {
|
|
1508
|
+
prefix: "",
|
|
1509
|
+
body: candidate
|
|
1510
|
+
};
|
|
1511
|
+
return {
|
|
1512
|
+
prefix: candidate.slice(0, lastSeparator + 1),
|
|
1513
|
+
body: candidate.slice(lastSeparator + 1)
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
function isBalancedFunctionValue(value) {
|
|
1517
|
+
let depth = 0;
|
|
1518
|
+
let quote;
|
|
1519
|
+
for (let index = 0; index < value.length; index++) {
|
|
1520
|
+
const character = value[index];
|
|
1521
|
+
if (character === "\\") {
|
|
1522
|
+
index++;
|
|
1523
|
+
continue;
|
|
1524
|
+
}
|
|
1525
|
+
if (quote) {
|
|
1526
|
+
if (character === quote) quote = void 0;
|
|
1527
|
+
continue;
|
|
1528
|
+
}
|
|
1529
|
+
if (character === "\"" || character === "'") {
|
|
1530
|
+
quote = character;
|
|
1531
|
+
continue;
|
|
1532
|
+
}
|
|
1533
|
+
if (character === "(") {
|
|
1534
|
+
depth++;
|
|
1535
|
+
continue;
|
|
1536
|
+
}
|
|
1537
|
+
if (character === ")") {
|
|
1538
|
+
depth--;
|
|
1539
|
+
if (depth < 0) return false;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
return depth === 0 && quote === void 0;
|
|
1543
|
+
}
|
|
1544
|
+
function isHexColorValue(value) {
|
|
1545
|
+
return /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6,8})$/.test(value);
|
|
1546
|
+
}
|
|
1547
|
+
function isQuotedValue(value) {
|
|
1548
|
+
const quote = value[0];
|
|
1549
|
+
if (quote !== "\"" && quote !== "'" || value[value.length - 1] !== quote) return false;
|
|
1550
|
+
let escaped = false;
|
|
1551
|
+
for (let index = 1; index < value.length - 1; index++) {
|
|
1552
|
+
const character = value[index];
|
|
1553
|
+
if (escaped) {
|
|
1554
|
+
escaped = false;
|
|
1555
|
+
continue;
|
|
1556
|
+
}
|
|
1557
|
+
if (character === "\\") escaped = true;
|
|
1558
|
+
}
|
|
1559
|
+
return !escaped;
|
|
1560
|
+
}
|
|
1561
|
+
function normalizeBareArbitraryValueOptions(options) {
|
|
1562
|
+
if (options === false || options === void 0 || options === null) return;
|
|
1563
|
+
const units = options === true ? DEFAULT_BARE_ARBITRARY_VALUE_UNITS : options.units ?? DEFAULT_BARE_ARBITRARY_VALUE_UNITS;
|
|
1564
|
+
const normalizedUnits = [...new Set(units.filter((unit) => typeof unit === "string" && unit.length > 0))];
|
|
1565
|
+
if (normalizedUnits.length === 0) return;
|
|
1566
|
+
return { units: normalizedUnits.sort((a, b) => b.length - a.length) };
|
|
1567
|
+
}
|
|
1568
|
+
function resolveValueWithUnit(body, units) {
|
|
1569
|
+
for (const unit of units) {
|
|
1570
|
+
if (!body.endsWith(unit)) continue;
|
|
1571
|
+
const numberPart = body.slice(0, -unit.length);
|
|
1572
|
+
if (NUMBER_RE.test(numberPart)) return `${numberPart}${unit}`;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
function resolveArbitraryValue(body, units) {
|
|
1576
|
+
const withUnit = resolveValueWithUnit(body, units);
|
|
1577
|
+
if (withUnit) return withUnit;
|
|
1578
|
+
if (isHexColorValue(body)) return body;
|
|
1579
|
+
if (isQuotedValue(body)) return body;
|
|
1580
|
+
if (FUNCTION_VALUE_RE.test(body) && body.endsWith(")") && isBalancedFunctionValue(body)) return body;
|
|
1581
|
+
}
|
|
1582
|
+
function resolveUtilityAndValue(body, units) {
|
|
1583
|
+
let depth = 0;
|
|
1584
|
+
let quote;
|
|
1585
|
+
for (let index = 1; index < body.length; index++) {
|
|
1586
|
+
const character = body[index];
|
|
1587
|
+
if (character === "\\") {
|
|
1588
|
+
index++;
|
|
1589
|
+
continue;
|
|
1590
|
+
}
|
|
1591
|
+
if (quote) {
|
|
1592
|
+
if (character === quote) quote = void 0;
|
|
1593
|
+
continue;
|
|
1594
|
+
}
|
|
1595
|
+
if (character === "\"" || character === "'") {
|
|
1596
|
+
quote = character;
|
|
1597
|
+
continue;
|
|
1598
|
+
}
|
|
1599
|
+
if (character === "(" || character === "{") {
|
|
1600
|
+
depth++;
|
|
1601
|
+
continue;
|
|
1602
|
+
}
|
|
1603
|
+
if (character === ")" || character === "}") {
|
|
1604
|
+
depth = Math.max(0, depth - 1);
|
|
1605
|
+
continue;
|
|
1606
|
+
}
|
|
1607
|
+
if (depth > 0 || character !== "-") continue;
|
|
1608
|
+
const utility = body.slice(0, index);
|
|
1609
|
+
const rawValue = body.slice(index + 1);
|
|
1610
|
+
if (!utility || !rawValue) continue;
|
|
1611
|
+
const value = resolveArbitraryValue(rawValue, units);
|
|
1612
|
+
if (value) return {
|
|
1613
|
+
utility,
|
|
1614
|
+
value
|
|
1615
|
+
};
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
function resolveBareArbitraryValueCandidate(candidate, options) {
|
|
1619
|
+
const normalizedOptions = normalizeBareArbitraryValueOptions(options);
|
|
1620
|
+
if (!normalizedOptions || !candidate || candidate.includes("[") || candidate.includes("]")) return;
|
|
1621
|
+
const { prefix, body } = splitVariantPrefix(candidate);
|
|
1622
|
+
const important = body.startsWith("!") ? "!" : "";
|
|
1623
|
+
let normalizedBody = important ? body.slice(1) : body;
|
|
1624
|
+
const negative = normalizedBody.startsWith("-") ? "-" : "";
|
|
1625
|
+
if (negative) normalizedBody = normalizedBody.slice(1);
|
|
1626
|
+
const resolved = resolveUtilityAndValue(normalizedBody, normalizedOptions.units);
|
|
1627
|
+
if (!resolved) return;
|
|
1628
|
+
return {
|
|
1629
|
+
candidate,
|
|
1630
|
+
canonicalCandidate: `${prefix}${important}${negative}${resolved.utility}-[${resolved.value}]`
|
|
1631
|
+
};
|
|
1632
|
+
}
|
|
1633
|
+
function escapeCssClassName(value) {
|
|
1634
|
+
let result = "";
|
|
1635
|
+
for (let index = 0; index < value.length; index++) {
|
|
1636
|
+
const codeUnit = value.charCodeAt(index);
|
|
1637
|
+
const character = value.charAt(index);
|
|
1638
|
+
if (codeUnit === 0) {
|
|
1639
|
+
result += "�";
|
|
1640
|
+
continue;
|
|
1641
|
+
}
|
|
1642
|
+
if (codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || index === 0 && codeUnit >= 48 && codeUnit <= 57 || index === 1 && codeUnit >= 48 && codeUnit <= 57 && value.charCodeAt(0) === 45) {
|
|
1643
|
+
result += `\\${codeUnit.toString(16)} `;
|
|
1644
|
+
continue;
|
|
1645
|
+
}
|
|
1646
|
+
if (codeUnit >= 128 || codeUnit === 45 || codeUnit === 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
|
|
1647
|
+
result += character;
|
|
1648
|
+
continue;
|
|
1649
|
+
}
|
|
1650
|
+
result += `\\${character}`;
|
|
1651
|
+
}
|
|
1652
|
+
return result;
|
|
1653
|
+
}
|
|
1654
|
+
//#endregion
|
|
1448
1655
|
//#region src/v4/candidates.ts
|
|
1449
|
-
function resolveValidTailwindV4Candidates(designSystem, candidates) {
|
|
1656
|
+
function resolveValidTailwindV4Candidates(designSystem, candidates, options) {
|
|
1450
1657
|
const validCandidates = /* @__PURE__ */ new Set();
|
|
1451
1658
|
const parsedCandidates = [];
|
|
1659
|
+
const originalCandidateByCanonical = /* @__PURE__ */ new Map();
|
|
1452
1660
|
for (const candidate of candidates) {
|
|
1453
|
-
if (!candidate
|
|
1454
|
-
|
|
1661
|
+
if (!candidate) continue;
|
|
1662
|
+
const bareArbitrary = resolveBareArbitraryValueCandidate(candidate, options?.bareArbitraryValues);
|
|
1663
|
+
const candidateToCheck = bareArbitrary?.canonicalCandidate ?? candidate;
|
|
1664
|
+
if (parsedCandidates.includes(candidateToCheck)) continue;
|
|
1665
|
+
if (designSystem.parseCandidate(candidateToCheck).length > 0) {
|
|
1666
|
+
parsedCandidates.push(candidateToCheck);
|
|
1667
|
+
if (bareArbitrary) originalCandidateByCanonical.set(candidateToCheck, candidate);
|
|
1668
|
+
}
|
|
1455
1669
|
}
|
|
1456
1670
|
if (parsedCandidates.length === 0) return validCandidates;
|
|
1457
1671
|
const cssByCandidate = designSystem.candidatesToCss(parsedCandidates);
|
|
1458
1672
|
for (let index = 0; index < parsedCandidates.length; index++) {
|
|
1459
1673
|
const candidate = parsedCandidates[index];
|
|
1460
1674
|
const candidateCss = cssByCandidate[index];
|
|
1461
|
-
if (candidate && typeof candidateCss === "string" && candidateCss.trim().length > 0) validCandidates.add(candidate);
|
|
1675
|
+
if (candidate && typeof candidateCss === "string" && candidateCss.trim().length > 0) validCandidates.add(originalCandidateByCanonical.get(candidate) ?? candidate);
|
|
1462
1676
|
}
|
|
1463
1677
|
return validCandidates;
|
|
1464
1678
|
}
|
|
1679
|
+
function createSelectorAliasMap(candidates, options) {
|
|
1680
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
1681
|
+
for (const candidate of candidates) {
|
|
1682
|
+
const bareArbitrary = resolveBareArbitraryValueCandidate(candidate, options);
|
|
1683
|
+
if (!bareArbitrary) continue;
|
|
1684
|
+
aliases.set(escapeCssClassName(bareArbitrary.canonicalCandidate), escapeCssClassName(bareArbitrary.candidate));
|
|
1685
|
+
}
|
|
1686
|
+
return aliases;
|
|
1687
|
+
}
|
|
1688
|
+
function replaceBareArbitraryValueSelectors(css, candidates, options) {
|
|
1689
|
+
const aliases = createSelectorAliasMap(candidates, options);
|
|
1690
|
+
if (aliases.size === 0) return css;
|
|
1691
|
+
let result = css;
|
|
1692
|
+
for (const [canonicalSelector, bareSelector] of aliases) result = result.replaceAll(canonicalSelector, bareSelector);
|
|
1693
|
+
return result;
|
|
1694
|
+
}
|
|
1695
|
+
function canonicalizeBareArbitraryValueCandidates(candidates, options) {
|
|
1696
|
+
return Array.from(candidates, (candidate) => {
|
|
1697
|
+
return resolveBareArbitraryValueCandidate(candidate, options)?.canonicalCandidate ?? candidate;
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1465
1700
|
function splitTopLevel(value, separator) {
|
|
1466
1701
|
const result = [];
|
|
1467
1702
|
let start = 0;
|
|
@@ -1707,13 +1942,31 @@ async function compileTailwindV4Source(source) {
|
|
|
1707
1942
|
//#region src/extraction/candidate-extractor.ts
|
|
1708
1943
|
let oxideImportPromise;
|
|
1709
1944
|
const designSystemCandidateCache = /* @__PURE__ */ new Map();
|
|
1945
|
+
function createOxideRuntimeDependencyError(cause) {
|
|
1946
|
+
return new Error([
|
|
1947
|
+
"tailwindcss-patch could not load @tailwindcss/oxide, which is required for source candidate scanning.",
|
|
1948
|
+
"This dependency should be installed automatically by tailwindcss-patch.",
|
|
1949
|
+
"Reinstall dependencies without disabling optional dependencies, or install @tailwindcss/oxide@^4.2.4 manually if your package manager omitted it."
|
|
1950
|
+
].join(" "), { cause });
|
|
1951
|
+
}
|
|
1710
1952
|
async function importOxide() {
|
|
1711
|
-
|
|
1953
|
+
try {
|
|
1954
|
+
return await import("@tailwindcss/oxide");
|
|
1955
|
+
} catch (error) {
|
|
1956
|
+
throw createOxideRuntimeDependencyError(error);
|
|
1957
|
+
}
|
|
1712
1958
|
}
|
|
1713
1959
|
function getOxideModule() {
|
|
1714
1960
|
oxideImportPromise ??= importOxide();
|
|
1961
|
+
oxideImportPromise.catch(() => {
|
|
1962
|
+
oxideImportPromise = void 0;
|
|
1963
|
+
});
|
|
1715
1964
|
return oxideImportPromise;
|
|
1716
1965
|
}
|
|
1966
|
+
function createCandidateCacheKey(designSystemKey, options) {
|
|
1967
|
+
if (options.bareArbitraryValues == null || options.bareArbitraryValues === false) return designSystemKey;
|
|
1968
|
+
return `${designSystemKey}:bare-arbitrary:${JSON.stringify(options.bareArbitraryValues)}`;
|
|
1969
|
+
}
|
|
1717
1970
|
async function extractRawCandidatesWithPositions(content, extension = "html") {
|
|
1718
1971
|
const { Scanner } = await getOxideModule();
|
|
1719
1972
|
return new Scanner({}).getCandidatesWithPositions({
|
|
@@ -1753,8 +2006,9 @@ async function extractValidCandidates(options) {
|
|
|
1753
2006
|
};
|
|
1754
2007
|
const designSystemKey = getTailwindV4DesignSystemCacheKey(source);
|
|
1755
2008
|
const designSystem = await loadTailwindV4DesignSystem(source);
|
|
1756
|
-
const
|
|
1757
|
-
designSystemCandidateCache.
|
|
2009
|
+
const candidateCacheKey = createCandidateCacheKey(designSystemKey, providedOptions);
|
|
2010
|
+
const candidateCache = designSystemCandidateCache.get(candidateCacheKey) ?? /* @__PURE__ */ new Map();
|
|
2011
|
+
designSystemCandidateCache.set(candidateCacheKey, candidateCache);
|
|
1758
2012
|
const candidates = await extractRawCandidates(sources);
|
|
1759
2013
|
const validCandidates = [];
|
|
1760
2014
|
const uncachedCandidates = [];
|
|
@@ -1765,14 +2019,15 @@ async function extractValidCandidates(options) {
|
|
|
1765
2019
|
continue;
|
|
1766
2020
|
}
|
|
1767
2021
|
if (cached === false) continue;
|
|
1768
|
-
|
|
2022
|
+
const bareArbitrary = resolveBareArbitraryValueCandidate(rawCandidate, providedOptions.bareArbitraryValues);
|
|
2023
|
+
if (designSystem.parseCandidate(rawCandidate).length > 0 || bareArbitrary && designSystem.parseCandidate(bareArbitrary.canonicalCandidate).length > 0) {
|
|
1769
2024
|
uncachedCandidates.push(rawCandidate);
|
|
1770
2025
|
continue;
|
|
1771
2026
|
}
|
|
1772
2027
|
candidateCache.set(rawCandidate, false);
|
|
1773
2028
|
}
|
|
1774
2029
|
if (uncachedCandidates.length === 0) return validCandidates;
|
|
1775
|
-
const validUncachedCandidates = resolveValidTailwindV4Candidates(designSystem, uncachedCandidates);
|
|
2030
|
+
const validUncachedCandidates = resolveValidTailwindV4Candidates(designSystem, uncachedCandidates, providedOptions.bareArbitraryValues === void 0 ? void 0 : { bareArbitraryValues: providedOptions.bareArbitraryValues });
|
|
1776
2031
|
for (const candidate of uncachedCandidates) {
|
|
1777
2032
|
const isValid = validUncachedCandidates.has(candidate);
|
|
1778
2033
|
candidateCache.set(candidate, isValid);
|
|
@@ -1980,6 +2235,7 @@ async function collectClassesFromTailwindV4(options) {
|
|
|
1980
2235
|
base: firstBase,
|
|
1981
2236
|
baseFallbacks: designSystemBases.slice(1),
|
|
1982
2237
|
css,
|
|
2238
|
+
...v4Options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: v4Options.bareArbitraryValues },
|
|
1983
2239
|
...sources === void 0 ? {} : { sources }
|
|
1984
2240
|
});
|
|
1985
2241
|
for (const candidate of candidates) if (options.filter(candidate)) set.add(candidate);
|
|
@@ -1990,6 +2246,7 @@ async function collectClassesFromTailwindV4(options) {
|
|
|
1990
2246
|
const candidates = await extractValidCandidates({
|
|
1991
2247
|
cwd: options.projectRoot,
|
|
1992
2248
|
base: baseForCss,
|
|
2249
|
+
...v4Options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: v4Options.bareArbitraryValues },
|
|
1993
2250
|
...v4Options.css === void 0 ? {} : { css: v4Options.css },
|
|
1994
2251
|
...sources === void 0 ? {} : { sources }
|
|
1995
2252
|
});
|
|
@@ -3555,4 +3812,4 @@ var ValidateCommandError = class extends Error {
|
|
|
3555
3812
|
}
|
|
3556
3813
|
};
|
|
3557
3814
|
//#endregion
|
|
3558
|
-
export {
|
|
3815
|
+
export { CacheStore as A, canonicalizeBareArbitraryValueCandidates as C, loadPatchOptionsForWorkspace as D, resolveValidTailwindV4Candidates as E, loadWorkspaceConfigModule as O, loadTailwindV4DesignSystem as S, replaceBareArbitraryValueSelectors as T, extractRawCandidates as _, tailwindcssPatchCommands as a, groupTokensByFile as b, MIGRATION_REPORT_KIND as c, getPatchStatusReport as d, runTailwindBuild as f, extractProjectCandidatesWithPositions as g, collectClassesFromTailwindV4 as h, classifyValidateError as i, logger as j, normalizeOptions as k, MIGRATION_REPORT_SCHEMA_VERSION as l, collectClassesFromContexts as m, VALIDATE_FAILURE_REASONS as n, migrateConfigFiles as o, loadRuntimeContexts as p, ValidateCommandError as r, restoreConfigFiles as s, VALIDATE_EXIT_CODES as t, TailwindcssPatcher as u, extractRawCandidatesWithPositions as v, extractTailwindV4InlineSourceCandidates as w, compileTailwindV4Source as x, extractValidCandidates as y };
|
|
@@ -250,6 +250,10 @@ interface TailwindV4Options {
|
|
|
250
250
|
cssEntries?: string[];
|
|
251
251
|
/** Overrides the content sources scanned by the oxide scanner. */
|
|
252
252
|
sources?: SourceEntry[];
|
|
253
|
+
/** Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`. */
|
|
254
|
+
bareArbitraryValues?: boolean | {
|
|
255
|
+
/** Unit allow-list used when detecting bare arbitrary values. */units?: string[];
|
|
256
|
+
} | undefined;
|
|
253
257
|
}
|
|
254
258
|
/**
|
|
255
259
|
* High-level Tailwind patch configuration shared across versions.
|
|
@@ -327,6 +331,9 @@ interface NormalizedTailwindV4Options {
|
|
|
327
331
|
cssEntries: string[];
|
|
328
332
|
sources: SourceEntry[];
|
|
329
333
|
hasUserDefinedSources: boolean;
|
|
334
|
+
bareArbitraryValues: false | {
|
|
335
|
+
units?: string[];
|
|
336
|
+
} | undefined;
|
|
330
337
|
}
|
|
331
338
|
/**
|
|
332
339
|
* Tailwind configuration ready for consumption by the runtime after normalization.
|
|
@@ -414,6 +421,14 @@ type TailwindcssConfigResult = Awaited<ReturnType<TailwindcssConfigModule['getCo
|
|
|
414
421
|
//#region src/runtime/collector.d.ts
|
|
415
422
|
type TailwindMajorVersion = 2 | 3 | 4;
|
|
416
423
|
//#endregion
|
|
424
|
+
//#region src/v4/bare-arbitrary-values.d.ts
|
|
425
|
+
interface BareArbitraryValueOptions {
|
|
426
|
+
/**
|
|
427
|
+
* 允许作为无方括号任意值的单位列表。
|
|
428
|
+
*/
|
|
429
|
+
units?: string[];
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
417
432
|
//#region src/extraction/candidate-extractor.d.ts
|
|
418
433
|
interface ExtractValidCandidatesOption {
|
|
419
434
|
sources?: SourceEntry[];
|
|
@@ -421,6 +436,7 @@ interface ExtractValidCandidatesOption {
|
|
|
421
436
|
baseFallbacks?: string[];
|
|
422
437
|
css?: string;
|
|
423
438
|
cwd?: string;
|
|
439
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
424
440
|
}
|
|
425
441
|
declare function extractRawCandidatesWithPositions(content: string, extension?: string): Promise<{
|
|
426
442
|
rawCandidate: string;
|
|
@@ -683,4 +699,4 @@ declare class ValidateCommandError extends Error {
|
|
|
683
699
|
constructor(summary: ValidateFailureSummary, options?: ErrorOptions);
|
|
684
700
|
}
|
|
685
701
|
//#endregion
|
|
686
|
-
export {
|
|
702
|
+
export { TailwindTokenByFileMap as $, groupTokensByFile as A, NormalizedTailwindCssPatchOptions as B, MIGRATION_REPORT_SCHEMA_VERSION as C, extractRawCandidates as D, extractProjectCandidatesWithPositions as E, CacheStrategy as F, TailwindV4Options as G, TailwindCssPatchOptions as H, ExposeContextOptions as I, PatchCheckStatus as J, ExtractResult as K, ExtendLengthUnitsOptions as L, normalizeOptions as M, ApplyOptions as N, extractRawCandidatesWithPositions as O, CacheOptions as P, TailwindPatchRuntime as Q, ExtractOptions as R, MIGRATION_REPORT_KIND as S, TailwindcssPatcher as T, TailwindV2Options as U, TailwindCssOptions as V, TailwindV3Options as W, PatchStatusEntry as X, PatchName as Y, PatchStatusReport as Z, ConfigFileMigrationEntry as _, ValidateFailureSummary as a, CacheClearOptions as at, RestoreConfigFilesOptions as b, TailwindcssPatchCliMountOptions as c, CacheContextDescriptor as ct, TailwindcssPatchCommandContext as d, CacheReadMeta as dt, TailwindTokenFileKey as et, TailwindcssPatchCommandHandler as f, CacheReadResult as ft, tailwindcssPatchCommands as g, TailwindcssPatchCommandOptions as h, ValidateFailureReason as i, TailwindcssRuntimeContext as it, BareArbitraryValueOptions as j, extractValidCandidates as k, TailwindcssPatchCliOptions as l, CacheContextMetadata as lt, TailwindcssPatchCommandOptionDefinition as m, VALIDATE_FAILURE_REASONS as n, TailwindTokenReport as nt, ValidateJsonFailurePayload as o, CacheClearResult as ot, TailwindcssPatchCommandHandlerMap as p, ILengthUnitsPatchOptions as q, ValidateCommandError as r, TailwindcssClassCache as rt, ValidateJsonSuccessPayload as s, CacheClearScope as st, VALIDATE_EXIT_CODES as t, TailwindTokenLocation as tt, TailwindcssPatchCommand as u, CacheIndexFileV2 as ut, ConfigFileMigrationReport as v, logger as w, RestoreConfigFilesResult as x, MigrateConfigFilesOptions as y, NormalizedCacheOptions as z };
|