tailwindcss-patch 9.3.2 → 9.3.4
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-CcVIAfDb.js → index.bundle-BIcthh-J.js} +25 -6
- package/dist/{index.bundle-DjS24i5r.mjs → index.bundle-BU7uUzRH.mjs} +25 -6
- package/dist/index.d.mts +2 -67
- package/dist/index.d.ts +2 -67
- package/dist/index.js +4 -2
- package/dist/index.mjs +3 -3
- package/dist/{validate-Bqych-z9.d.ts → validate-Bd5gnHL1.d.mts} +84 -7
- package/dist/{validate-Sq_yuh3r.mjs → validate-BoTQvn7s.mjs} +184 -7
- package/dist/{validate-CF0M_7KH.js → validate-DmELQoI2.js} +195 -6
- package/dist/{validate-C8-qsOWo.d.mts → validate-ZwyABmFW.d.ts} +85 -6
- package/package.json +1 -1
- package/src/extraction/candidate-extractor.ts +222 -1
- package/src/index.bundle.ts +5 -0
- package/src/index.ts +4 -0
- package/src/options/normalize.ts +14 -0
- package/src/options/types.ts +4 -0
- package/src/runtime/class-collector.ts +33 -13
- package/src/v4/index.ts +1 -0
- package/src/v4/source.ts +48 -6
- package/src/v4/types.ts +8 -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-DmELQoI2.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-BIcthh-J.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 { N as logger, r as ValidateCommandError } from "./validate-BoTQvn7s.mjs";
|
|
2
|
+
import { t as createTailwindcssPatchCli } from "./index.bundle-BU7uUzRH.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-Bd5gnHL1.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-ZwyABmFW.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-DmELQoI2.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 { A as loadWorkspaceConfigModule, N as logger, S as groupTokensByFile, a as tailwindcssPatchCommands, i as classifyValidateError, k as loadPatchOptionsForWorkspace, n as VALIDATE_FAILURE_REASONS, o as migrateConfigFiles, r as ValidateCommandError, s as restoreConfigFiles, t as VALIDATE_EXIT_CODES, u as TailwindcssPatcher } from "../validate-BoTQvn7s.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fs from "fs-extra";
|
|
4
4
|
import path from "pathe";
|
|
@@ -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-DmELQoI2.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);
|
|
@@ -109,6 +109,22 @@ async function resolveCssEntries(entries, projectRoot, base) {
|
|
|
109
109
|
dependencies
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
+
function resolveCssSources(sources, projectRoot, base) {
|
|
113
|
+
const resolvedSources = sources.map((source) => ({
|
|
114
|
+
...source,
|
|
115
|
+
base: source.base === void 0 ? void 0 : resolveBase(source.base, projectRoot),
|
|
116
|
+
file: source.file === void 0 ? void 0 : pathe.default.isAbsolute(source.file) ? pathe.default.resolve(source.file) : pathe.default.resolve(projectRoot, source.file),
|
|
117
|
+
dependencies: source.dependencies?.map((dependency) => pathe.default.isAbsolute(dependency) ? pathe.default.resolve(dependency) : pathe.default.resolve(projectRoot, dependency)) ?? []
|
|
118
|
+
}));
|
|
119
|
+
const firstSource = resolvedSources[0];
|
|
120
|
+
const resolvedBase = base ?? firstSource?.base ?? (firstSource?.file ? pathe.default.dirname(firstSource.file) : projectRoot);
|
|
121
|
+
const dependencies = resolvedSources.flatMap((source) => [source.file, ...source.dependencies]).filter((dependency) => Boolean(dependency));
|
|
122
|
+
return {
|
|
123
|
+
base: resolvedBase,
|
|
124
|
+
css: resolvedSources.map((source) => source.css).join("\n"),
|
|
125
|
+
dependencies
|
|
126
|
+
};
|
|
127
|
+
}
|
|
112
128
|
function normalizeResolvedSource(source) {
|
|
113
129
|
const baseFallbacks = uniquePaths([
|
|
114
130
|
...source.baseFallbacks,
|
|
@@ -136,15 +152,17 @@ async function resolveTailwindV4Source(options = {}) {
|
|
|
136
152
|
css: options.css,
|
|
137
153
|
dependencies: []
|
|
138
154
|
});
|
|
139
|
-
if (options.cssEntries?.length) {
|
|
140
|
-
const entries = await resolveCssEntries(options.cssEntries, projectRoot, configuredBase);
|
|
155
|
+
if (options.cssEntries?.length || options.cssSources?.length) {
|
|
156
|
+
const entries = options.cssEntries?.length ? await resolveCssEntries(options.cssEntries, projectRoot, configuredBase) : void 0;
|
|
157
|
+
const sources = options.cssSources?.length ? resolveCssSources(options.cssSources, projectRoot, configuredBase) : void 0;
|
|
158
|
+
const css = [entries?.css, sources?.css].filter(Boolean).join("\n");
|
|
141
159
|
return normalizeResolvedSource({
|
|
142
160
|
projectRoot,
|
|
143
161
|
cwd,
|
|
144
|
-
base: entries
|
|
162
|
+
base: configuredBase ?? entries?.base ?? sources?.base ?? cwd,
|
|
145
163
|
baseFallbacks,
|
|
146
|
-
css
|
|
147
|
-
dependencies: entries
|
|
164
|
+
css,
|
|
165
|
+
dependencies: [...entries?.dependencies ?? [], ...sources?.dependencies ?? []]
|
|
148
166
|
});
|
|
149
167
|
}
|
|
150
168
|
return normalizeResolvedSource({
|
|
@@ -176,6 +194,7 @@ function createSourceOptionsFromNormalizedPatchOptions(options) {
|
|
|
176
194
|
...v4?.configuredBase === void 0 ? {} : { base: v4.configuredBase },
|
|
177
195
|
baseFallbacks,
|
|
178
196
|
...v4?.css === void 0 ? {} : { css: v4.css },
|
|
197
|
+
...v4?.cssSources === void 0 ? {} : { cssSources: v4.cssSources },
|
|
179
198
|
...v4?.cssEntries === void 0 ? {} : { cssEntries: v4.cssEntries },
|
|
180
199
|
packageName: options.tailwind.packageName
|
|
181
200
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as compileTailwindV4Source, D as replaceBareArbitraryValueSelectors, E as extractTailwindV4InlineSourceCandidates, O as resolveValidTailwindV4Candidates, T as canonicalizeBareArbitraryValueCandidates, _ as extractRawCandidates, j as normalizeOptions, v as extractRawCandidatesWithPositions, w as loadTailwindV4DesignSystem } from "./validate-BoTQvn7s.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import path from "pathe";
|
|
@@ -106,6 +106,22 @@ async function resolveCssEntries(entries, projectRoot, base) {
|
|
|
106
106
|
dependencies
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
+
function resolveCssSources(sources, projectRoot, base) {
|
|
110
|
+
const resolvedSources = sources.map((source) => ({
|
|
111
|
+
...source,
|
|
112
|
+
base: source.base === void 0 ? void 0 : resolveBase(source.base, projectRoot),
|
|
113
|
+
file: source.file === void 0 ? void 0 : path.isAbsolute(source.file) ? path.resolve(source.file) : path.resolve(projectRoot, source.file),
|
|
114
|
+
dependencies: source.dependencies?.map((dependency) => path.isAbsolute(dependency) ? path.resolve(dependency) : path.resolve(projectRoot, dependency)) ?? []
|
|
115
|
+
}));
|
|
116
|
+
const firstSource = resolvedSources[0];
|
|
117
|
+
const resolvedBase = base ?? firstSource?.base ?? (firstSource?.file ? path.dirname(firstSource.file) : projectRoot);
|
|
118
|
+
const dependencies = resolvedSources.flatMap((source) => [source.file, ...source.dependencies]).filter((dependency) => Boolean(dependency));
|
|
119
|
+
return {
|
|
120
|
+
base: resolvedBase,
|
|
121
|
+
css: resolvedSources.map((source) => source.css).join("\n"),
|
|
122
|
+
dependencies
|
|
123
|
+
};
|
|
124
|
+
}
|
|
109
125
|
function normalizeResolvedSource(source) {
|
|
110
126
|
const baseFallbacks = uniquePaths([
|
|
111
127
|
...source.baseFallbacks,
|
|
@@ -133,15 +149,17 @@ async function resolveTailwindV4Source(options = {}) {
|
|
|
133
149
|
css: options.css,
|
|
134
150
|
dependencies: []
|
|
135
151
|
});
|
|
136
|
-
if (options.cssEntries?.length) {
|
|
137
|
-
const entries = await resolveCssEntries(options.cssEntries, projectRoot, configuredBase);
|
|
152
|
+
if (options.cssEntries?.length || options.cssSources?.length) {
|
|
153
|
+
const entries = options.cssEntries?.length ? await resolveCssEntries(options.cssEntries, projectRoot, configuredBase) : void 0;
|
|
154
|
+
const sources = options.cssSources?.length ? resolveCssSources(options.cssSources, projectRoot, configuredBase) : void 0;
|
|
155
|
+
const css = [entries?.css, sources?.css].filter(Boolean).join("\n");
|
|
138
156
|
return normalizeResolvedSource({
|
|
139
157
|
projectRoot,
|
|
140
158
|
cwd,
|
|
141
|
-
base: entries
|
|
159
|
+
base: configuredBase ?? entries?.base ?? sources?.base ?? cwd,
|
|
142
160
|
baseFallbacks,
|
|
143
|
-
css
|
|
144
|
-
dependencies: entries
|
|
161
|
+
css,
|
|
162
|
+
dependencies: [...entries?.dependencies ?? [], ...sources?.dependencies ?? []]
|
|
145
163
|
});
|
|
146
164
|
}
|
|
147
165
|
return normalizeResolvedSource({
|
|
@@ -173,6 +191,7 @@ function createSourceOptionsFromNormalizedPatchOptions(options) {
|
|
|
173
191
|
...v4?.configuredBase === void 0 ? {} : { base: v4.configuredBase },
|
|
174
192
|
baseFallbacks,
|
|
175
193
|
...v4?.css === void 0 ? {} : { css: v4.css },
|
|
194
|
+
...v4?.cssSources === void 0 ? {} : { cssSources: v4.cssSources },
|
|
176
195
|
...v4?.cssEntries === void 0 ? {} : { cssEntries: v4.cssEntries },
|
|
177
196
|
packageName: options.tailwind.packageName
|
|
178
197
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TailwindV4GenerateResult, A as extractSourceCandidatesWithPositions, B as ExtractOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as ApplyOptions, G as TailwindV2Options, H as NormalizedTailwindCssPatchOptions, I as CacheOptions, J as TailwindV4CandidateSource, K as TailwindV3Options, L as CacheStrategy, M as groupTokensByFile, N as BareArbitraryValueOptions, O as extractRawCandidatesWithPositions, P as normalizeOptions, Q as TailwindV4GenerateOptions, R as ExposeContextOptions, S as MIGRATION_REPORT_KIND, St as CacheReadResult, T as TailwindcssPatcher, U as TailwindCssOptions, V as NormalizedCacheOptions, W as TailwindCssPatchOptions, X as TailwindV4DesignSystem, Y as TailwindV4CssSource, Z as TailwindV4Engine, _ as ConfigFileMigrationEntry, _t as CacheClearScope, a as ValidateFailureSummary, at as PatchName, b as RestoreConfigFilesOptions, bt as CacheIndexFileV2, c as TailwindcssPatchCliMountOptions, ct as TailwindPatchRuntime, d as TailwindcssPatchCommandContext, dt as TailwindTokenLocation, et as TailwindV4ResolvedSource, f as TailwindcssPatchCommandHandler, ft as TailwindTokenReport, g as tailwindcssPatchCommands, gt as CacheClearResult, h as TailwindcssPatchCommandOptions, ht as CacheClearOptions, i as ValidateFailureReason, it as PatchCheckStatus, j as extractValidCandidates, k as extractSourceCandidates, l as TailwindcssPatchCliOptions, lt as TailwindTokenByFileMap, m as TailwindcssPatchCommandOptionDefinition, mt as TailwindcssRuntimeContext, n as VALIDATE_FAILURE_REASONS, nt as ExtractResult, o as ValidateJsonFailurePayload, ot as PatchStatusEntry, p as TailwindcssPatchCommandHandlerMap, pt as TailwindcssClassCache, q as TailwindV4Options, r as ValidateCommandError, rt as ILengthUnitsPatchOptions, s as ValidateJsonSuccessPayload, st as PatchStatusReport, t as VALIDATE_EXIT_CODES, tt as TailwindV4SourceOptions, u as TailwindcssPatchCommand, ut as TailwindTokenFileKey, v as ConfigFileMigrationReport, vt as CacheContextDescriptor, w as logger, x as RestoreConfigFilesResult, xt as CacheReadMeta, y as MigrateConfigFilesOptions, yt as CacheContextMetadata, z as ExtendLengthUnitsOptions } from "./validate-Bd5gnHL1.mjs";
|
|
2
2
|
import { PackageInfo } from "local-pkg";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import { CAC } from "cac";
|
|
@@ -77,71 +77,6 @@ interface PatchStatusContext {
|
|
|
77
77
|
}
|
|
78
78
|
declare function getPatchStatusReport(context: PatchStatusContext): PatchStatusReport;
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region src/v4/types.d.ts
|
|
81
|
-
interface TailwindV4SourceOptions {
|
|
82
|
-
projectRoot?: string;
|
|
83
|
-
cwd?: string;
|
|
84
|
-
base?: string;
|
|
85
|
-
baseFallbacks?: string[];
|
|
86
|
-
css?: string;
|
|
87
|
-
cssEntries?: string[];
|
|
88
|
-
packageName?: string;
|
|
89
|
-
}
|
|
90
|
-
interface TailwindV4ResolvedSource {
|
|
91
|
-
projectRoot: string;
|
|
92
|
-
base: string;
|
|
93
|
-
baseFallbacks: string[];
|
|
94
|
-
css: string;
|
|
95
|
-
dependencies: string[];
|
|
96
|
-
}
|
|
97
|
-
interface TailwindV4CandidateSource {
|
|
98
|
-
content: string;
|
|
99
|
-
extension?: string;
|
|
100
|
-
}
|
|
101
|
-
interface TailwindV4GenerateOptions {
|
|
102
|
-
candidates?: Iterable<string>;
|
|
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
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* 扫描文件系统 source entries 中的候选类名。
|
|
112
|
-
*
|
|
113
|
-
* - `true`:使用 Tailwind v4 编译入口解析出的 `@source` 列表。
|
|
114
|
-
* - `TailwindV4SourcePattern[]`:使用调用方显式传入的 source 列表。
|
|
115
|
-
*/
|
|
116
|
-
scanSources?: boolean | TailwindV4SourcePattern[];
|
|
117
|
-
}
|
|
118
|
-
interface TailwindV4SourcePattern {
|
|
119
|
-
base: string;
|
|
120
|
-
pattern: string;
|
|
121
|
-
negated: boolean;
|
|
122
|
-
}
|
|
123
|
-
interface TailwindV4GenerateResult {
|
|
124
|
-
css: string;
|
|
125
|
-
classSet: Set<string>;
|
|
126
|
-
rawCandidates: Set<string>;
|
|
127
|
-
dependencies: string[];
|
|
128
|
-
sources: TailwindV4SourcePattern[];
|
|
129
|
-
root: null | 'none' | {
|
|
130
|
-
base: string;
|
|
131
|
-
pattern: string;
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
interface TailwindV4DesignSystem {
|
|
135
|
-
parseCandidate: (candidate: string) => unknown[];
|
|
136
|
-
candidatesToCss: (candidates: string[]) => Array<string | null | undefined>;
|
|
137
|
-
}
|
|
138
|
-
interface TailwindV4Engine {
|
|
139
|
-
source: TailwindV4ResolvedSource;
|
|
140
|
-
loadDesignSystem: () => Promise<TailwindV4DesignSystem>;
|
|
141
|
-
validateCandidates: (candidates: Iterable<string>) => Promise<Set<string>>;
|
|
142
|
-
generate: (options?: TailwindV4GenerateOptions) => Promise<TailwindV4GenerateResult>;
|
|
143
|
-
}
|
|
144
|
-
//#endregion
|
|
145
80
|
//#region src/v4/candidates.d.ts
|
|
146
81
|
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string>, options?: {
|
|
147
82
|
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
@@ -162,4 +97,4 @@ declare function mountTailwindcssPatchCommands(cli: CAC, options?: TailwindcssPa
|
|
|
162
97
|
declare function createTailwindcssPatchCli(options?: TailwindcssPatchCliOptions): CAC;
|
|
163
98
|
declare function defineConfig<T extends TailwindcssMangleConfig>(config: T): T;
|
|
164
99
|
//#endregion
|
|
165
|
-
export { ApplyOptions, CacheClearOptions, CacheClearResult, CacheClearScope, CacheContextMetadata, CacheOptions, CacheReadMeta, CacheStore, CacheStrategy, type ConfigFileMigrationEntry, type ConfigFileMigrationReport, ExposeContextOptions, ExtendLengthUnitsOptions, ExtractOptions, ExtractResult, ILengthUnitsPatchOptions, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, type MigrateConfigFilesOptions, NormalizedTailwindCssPatchOptions, PatchCheckStatus, PatchName, PatchStatusEntry, PatchStatusReport, type RestoreConfigFilesOptions, type RestoreConfigFilesResult, TailwindCssOptions, type TailwindCssPatchOptions, TailwindPatchRuntime, TailwindTokenByFileMap, TailwindTokenFileKey, TailwindTokenLocation, TailwindTokenReport, TailwindV2Options, TailwindV3Options, type TailwindV4CandidateSource, type TailwindV4DesignSystem, type TailwindV4Engine, type TailwindV4GenerateOptions, type TailwindV4GenerateResult, TailwindV4Options, type TailwindV4ResolvedSource, type TailwindV4SourceOptions, TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, TailwindcssPatcher, TailwindcssRuntimeContext, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, type ValidateFailureReason, type ValidateFailureSummary, type ValidateJsonFailurePayload, type ValidateJsonSuccessPayload, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindV4Engine, createTailwindcssPatchCli, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
|
100
|
+
export { ApplyOptions, CacheClearOptions, CacheClearResult, CacheClearScope, CacheContextMetadata, CacheOptions, CacheReadMeta, CacheStore, CacheStrategy, type ConfigFileMigrationEntry, type ConfigFileMigrationReport, ExposeContextOptions, ExtendLengthUnitsOptions, ExtractOptions, ExtractResult, ILengthUnitsPatchOptions, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, type MigrateConfigFilesOptions, NormalizedTailwindCssPatchOptions, PatchCheckStatus, PatchName, PatchStatusEntry, PatchStatusReport, type RestoreConfigFilesOptions, type RestoreConfigFilesResult, TailwindCssOptions, type TailwindCssPatchOptions, TailwindPatchRuntime, TailwindTokenByFileMap, TailwindTokenFileKey, TailwindTokenLocation, TailwindTokenReport, TailwindV2Options, TailwindV3Options, type TailwindV4CandidateSource, type TailwindV4CssSource, type TailwindV4DesignSystem, type TailwindV4Engine, type TailwindV4GenerateOptions, type TailwindV4GenerateResult, TailwindV4Options, type TailwindV4ResolvedSource, type TailwindV4SourceOptions, TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, TailwindcssPatcher, TailwindcssRuntimeContext, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, type ValidateFailureReason, type ValidateFailureSummary, type ValidateJsonFailurePayload, type ValidateJsonSuccessPayload, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindV4Engine, createTailwindcssPatchCli, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractSourceCandidates, extractSourceCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TailwindV4GenerateResult, A as extractSourceCandidatesWithPositions, B as ExtractOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as ApplyOptions, G as TailwindV2Options, H as NormalizedTailwindCssPatchOptions, I as CacheOptions, J as TailwindV4CandidateSource, K as TailwindV3Options, L as CacheStrategy, M as groupTokensByFile, N as BareArbitraryValueOptions, O as extractRawCandidatesWithPositions, P as normalizeOptions, Q as TailwindV4GenerateOptions, R as ExposeContextOptions, S as MIGRATION_REPORT_KIND, St as CacheReadResult, T as TailwindcssPatcher, U as TailwindCssOptions, V as NormalizedCacheOptions, W as TailwindCssPatchOptions, X as TailwindV4DesignSystem, Y as TailwindV4CssSource, Z as TailwindV4Engine, _ as ConfigFileMigrationEntry, _t as CacheClearScope, a as ValidateFailureSummary, at as PatchName, b as RestoreConfigFilesOptions, bt as CacheIndexFileV2, c as TailwindcssPatchCliMountOptions, ct as TailwindPatchRuntime, d as TailwindcssPatchCommandContext, dt as TailwindTokenLocation, et as TailwindV4ResolvedSource, f as TailwindcssPatchCommandHandler, ft as TailwindTokenReport, g as tailwindcssPatchCommands, gt as CacheClearResult, h as TailwindcssPatchCommandOptions, ht as CacheClearOptions, i as ValidateFailureReason, it as PatchCheckStatus, j as extractValidCandidates, k as extractSourceCandidates, l as TailwindcssPatchCliOptions, lt as TailwindTokenByFileMap, m as TailwindcssPatchCommandOptionDefinition, mt as TailwindcssRuntimeContext, n as VALIDATE_FAILURE_REASONS, nt as ExtractResult, o as ValidateJsonFailurePayload, ot as PatchStatusEntry, p as TailwindcssPatchCommandHandlerMap, pt as TailwindcssClassCache, q as TailwindV4Options, r as ValidateCommandError, rt as ILengthUnitsPatchOptions, s as ValidateJsonSuccessPayload, st as PatchStatusReport, t as VALIDATE_EXIT_CODES, tt as TailwindV4SourceOptions, u as TailwindcssPatchCommand, ut as TailwindTokenFileKey, v as ConfigFileMigrationReport, vt as CacheContextDescriptor, w as logger, x as RestoreConfigFilesResult, xt as CacheReadMeta, y as MigrateConfigFilesOptions, yt as CacheContextMetadata, z as ExtendLengthUnitsOptions } from "./validate-ZwyABmFW.js";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
import { PackageInfo } from "local-pkg";
|
|
4
4
|
import postcss from "postcss";
|
|
@@ -77,71 +77,6 @@ interface PatchStatusContext {
|
|
|
77
77
|
}
|
|
78
78
|
declare function getPatchStatusReport(context: PatchStatusContext): PatchStatusReport;
|
|
79
79
|
//#endregion
|
|
80
|
-
//#region src/v4/types.d.ts
|
|
81
|
-
interface TailwindV4SourceOptions {
|
|
82
|
-
projectRoot?: string;
|
|
83
|
-
cwd?: string;
|
|
84
|
-
base?: string;
|
|
85
|
-
baseFallbacks?: string[];
|
|
86
|
-
css?: string;
|
|
87
|
-
cssEntries?: string[];
|
|
88
|
-
packageName?: string;
|
|
89
|
-
}
|
|
90
|
-
interface TailwindV4ResolvedSource {
|
|
91
|
-
projectRoot: string;
|
|
92
|
-
base: string;
|
|
93
|
-
baseFallbacks: string[];
|
|
94
|
-
css: string;
|
|
95
|
-
dependencies: string[];
|
|
96
|
-
}
|
|
97
|
-
interface TailwindV4CandidateSource {
|
|
98
|
-
content: string;
|
|
99
|
-
extension?: string;
|
|
100
|
-
}
|
|
101
|
-
interface TailwindV4GenerateOptions {
|
|
102
|
-
candidates?: Iterable<string>;
|
|
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
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* 扫描文件系统 source entries 中的候选类名。
|
|
112
|
-
*
|
|
113
|
-
* - `true`:使用 Tailwind v4 编译入口解析出的 `@source` 列表。
|
|
114
|
-
* - `TailwindV4SourcePattern[]`:使用调用方显式传入的 source 列表。
|
|
115
|
-
*/
|
|
116
|
-
scanSources?: boolean | TailwindV4SourcePattern[];
|
|
117
|
-
}
|
|
118
|
-
interface TailwindV4SourcePattern {
|
|
119
|
-
base: string;
|
|
120
|
-
pattern: string;
|
|
121
|
-
negated: boolean;
|
|
122
|
-
}
|
|
123
|
-
interface TailwindV4GenerateResult {
|
|
124
|
-
css: string;
|
|
125
|
-
classSet: Set<string>;
|
|
126
|
-
rawCandidates: Set<string>;
|
|
127
|
-
dependencies: string[];
|
|
128
|
-
sources: TailwindV4SourcePattern[];
|
|
129
|
-
root: null | 'none' | {
|
|
130
|
-
base: string;
|
|
131
|
-
pattern: string;
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
interface TailwindV4DesignSystem {
|
|
135
|
-
parseCandidate: (candidate: string) => unknown[];
|
|
136
|
-
candidatesToCss: (candidates: string[]) => Array<string | null | undefined>;
|
|
137
|
-
}
|
|
138
|
-
interface TailwindV4Engine {
|
|
139
|
-
source: TailwindV4ResolvedSource;
|
|
140
|
-
loadDesignSystem: () => Promise<TailwindV4DesignSystem>;
|
|
141
|
-
validateCandidates: (candidates: Iterable<string>) => Promise<Set<string>>;
|
|
142
|
-
generate: (options?: TailwindV4GenerateOptions) => Promise<TailwindV4GenerateResult>;
|
|
143
|
-
}
|
|
144
|
-
//#endregion
|
|
145
80
|
//#region src/v4/candidates.d.ts
|
|
146
81
|
declare function resolveValidTailwindV4Candidates(designSystem: TailwindV4DesignSystem, candidates: Iterable<string>, options?: {
|
|
147
82
|
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
@@ -162,4 +97,4 @@ declare function mountTailwindcssPatchCommands(cli: CAC, options?: TailwindcssPa
|
|
|
162
97
|
declare function createTailwindcssPatchCli(options?: TailwindcssPatchCliOptions): CAC;
|
|
163
98
|
declare function defineConfig<T extends TailwindcssMangleConfig>(config: T): T;
|
|
164
99
|
//#endregion
|
|
165
|
-
export { ApplyOptions, CacheClearOptions, CacheClearResult, CacheClearScope, CacheContextMetadata, CacheOptions, CacheReadMeta, CacheStore, CacheStrategy, type ConfigFileMigrationEntry, type ConfigFileMigrationReport, ExposeContextOptions, ExtendLengthUnitsOptions, ExtractOptions, ExtractResult, ILengthUnitsPatchOptions, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, type MigrateConfigFilesOptions, NormalizedTailwindCssPatchOptions, PatchCheckStatus, PatchName, PatchStatusEntry, PatchStatusReport, type RestoreConfigFilesOptions, type RestoreConfigFilesResult, TailwindCssOptions, type TailwindCssPatchOptions, TailwindPatchRuntime, TailwindTokenByFileMap, TailwindTokenFileKey, TailwindTokenLocation, TailwindTokenReport, TailwindV2Options, TailwindV3Options, type TailwindV4CandidateSource, type TailwindV4DesignSystem, type TailwindV4Engine, type TailwindV4GenerateOptions, type TailwindV4GenerateResult, TailwindV4Options, type TailwindV4ResolvedSource, type TailwindV4SourceOptions, TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, TailwindcssPatcher, TailwindcssRuntimeContext, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, type ValidateFailureReason, type ValidateFailureSummary, type ValidateJsonFailurePayload, type ValidateJsonSuccessPayload, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindV4Engine, createTailwindcssPatchCli, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
|
100
|
+
export { ApplyOptions, CacheClearOptions, CacheClearResult, CacheClearScope, CacheContextMetadata, CacheOptions, CacheReadMeta, CacheStore, CacheStrategy, type ConfigFileMigrationEntry, type ConfigFileMigrationReport, ExposeContextOptions, ExtendLengthUnitsOptions, ExtractOptions, ExtractResult, ILengthUnitsPatchOptions, MIGRATION_REPORT_KIND, MIGRATION_REPORT_SCHEMA_VERSION, type MigrateConfigFilesOptions, NormalizedTailwindCssPatchOptions, PatchCheckStatus, PatchName, PatchStatusEntry, PatchStatusReport, type RestoreConfigFilesOptions, type RestoreConfigFilesResult, TailwindCssOptions, type TailwindCssPatchOptions, TailwindPatchRuntime, TailwindTokenByFileMap, TailwindTokenFileKey, TailwindTokenLocation, TailwindTokenReport, TailwindV2Options, TailwindV3Options, type TailwindV4CandidateSource, type TailwindV4CssSource, type TailwindV4DesignSystem, type TailwindV4Engine, type TailwindV4GenerateOptions, type TailwindV4GenerateResult, TailwindV4Options, type TailwindV4ResolvedSource, type TailwindV4SourceOptions, TailwindcssClassCache, type TailwindcssPatchCliMountOptions, type TailwindcssPatchCliOptions, type TailwindcssPatchCommand, type TailwindcssPatchCommandContext, type TailwindcssPatchCommandHandler, type TailwindcssPatchCommandHandlerMap, type TailwindcssPatchCommandOptionDefinition, type TailwindcssPatchCommandOptions, TailwindcssPatcher, TailwindcssRuntimeContext, VALIDATE_EXIT_CODES, VALIDATE_FAILURE_REASONS, ValidateCommandError, type ValidateFailureReason, type ValidateFailureSummary, type ValidateJsonFailurePayload, type ValidateJsonSuccessPayload, collectClassesFromContexts, collectClassesFromTailwindV4, createTailwindV4Engine, createTailwindcssPatchCli, defineConfig, extractProjectCandidatesWithPositions, extractRawCandidates, extractRawCandidatesWithPositions, extractSourceCandidates, extractSourceCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
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-DmELQoI2.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-BIcthh-J.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;
|
|
@@ -16,6 +16,8 @@ exports.defineConfig = require_index_bundle.defineConfig;
|
|
|
16
16
|
exports.extractProjectCandidatesWithPositions = require_validate.extractProjectCandidatesWithPositions;
|
|
17
17
|
exports.extractRawCandidates = require_validate.extractRawCandidates;
|
|
18
18
|
exports.extractRawCandidatesWithPositions = require_validate.extractRawCandidatesWithPositions;
|
|
19
|
+
exports.extractSourceCandidates = require_validate.extractSourceCandidates;
|
|
20
|
+
exports.extractSourceCandidatesWithPositions = require_validate.extractSourceCandidatesWithPositions;
|
|
19
21
|
exports.extractValidCandidates = require_validate.extractValidCandidates;
|
|
20
22
|
exports.getPatchStatusReport = require_validate.getPatchStatusReport;
|
|
21
23
|
exports.groupTokensByFile = require_validate.groupTokensByFile;
|
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-
|
|
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 };
|
|
1
|
+
import { M as CacheStore, N as logger, O as resolveValidTailwindV4Candidates, S as groupTokensByFile, _ as extractRawCandidates, a as tailwindcssPatchCommands, b as extractSourceCandidatesWithPositions, c as MIGRATION_REPORT_KIND, d as getPatchStatusReport, f as runTailwindBuild, g as extractProjectCandidatesWithPositions, h as collectClassesFromTailwindV4, j 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, w as loadTailwindV4DesignSystem, x as extractValidCandidates, y as extractSourceCandidates } from "./validate-BoTQvn7s.mjs";
|
|
2
|
+
import { a as resolveTailwindV4SourceFromPatchOptions, i as resolveTailwindV4Source, n as defineConfig, o as createTailwindV4Engine, r as mountTailwindcssPatchCommands, t as createTailwindcssPatchCli } from "./index.bundle-BU7uUzRH.mjs";
|
|
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, extractSourceCandidates, extractSourceCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { CAC, Command } from "cac";
|
|
2
1
|
import { PackageInfo, PackageResolvingOptions } from "local-pkg";
|
|
3
|
-
import
|
|
2
|
+
import * as _$consola from "consola";
|
|
4
3
|
import { Node, Rule } from "postcss";
|
|
4
|
+
import { CAC, Command } from "cac";
|
|
5
|
+
import { SourceEntry } from "@tailwindcss/oxide";
|
|
5
6
|
import { Config } from "tailwindcss";
|
|
6
|
-
import * as _$consola from "consola";
|
|
7
|
-
|
|
8
7
|
//#region src/cache/types.d.ts
|
|
9
8
|
declare const CACHE_SCHEMA_VERSION = 2;
|
|
10
9
|
declare const CACHE_FINGERPRINT_VERSION = 1;
|
|
@@ -159,6 +158,78 @@ interface PatchStatusReport {
|
|
|
159
158
|
entries: PatchStatusEntry[];
|
|
160
159
|
}
|
|
161
160
|
//#endregion
|
|
161
|
+
//#region src/v4/types.d.ts
|
|
162
|
+
interface TailwindV4SourceOptions {
|
|
163
|
+
projectRoot?: string;
|
|
164
|
+
cwd?: string;
|
|
165
|
+
base?: string;
|
|
166
|
+
baseFallbacks?: string[];
|
|
167
|
+
css?: string;
|
|
168
|
+
cssSources?: TailwindV4CssSource[];
|
|
169
|
+
cssEntries?: string[];
|
|
170
|
+
packageName?: string;
|
|
171
|
+
}
|
|
172
|
+
interface TailwindV4CssSource {
|
|
173
|
+
css: string;
|
|
174
|
+
base?: string;
|
|
175
|
+
file?: string;
|
|
176
|
+
dependencies?: string[];
|
|
177
|
+
}
|
|
178
|
+
interface TailwindV4ResolvedSource {
|
|
179
|
+
projectRoot: string;
|
|
180
|
+
base: string;
|
|
181
|
+
baseFallbacks: string[];
|
|
182
|
+
css: string;
|
|
183
|
+
dependencies: string[];
|
|
184
|
+
}
|
|
185
|
+
interface TailwindV4CandidateSource {
|
|
186
|
+
content: string;
|
|
187
|
+
extension?: string;
|
|
188
|
+
}
|
|
189
|
+
interface TailwindV4GenerateOptions {
|
|
190
|
+
candidates?: Iterable<string>;
|
|
191
|
+
sources?: TailwindV4CandidateSource[];
|
|
192
|
+
/**
|
|
193
|
+
* Enables UnoCSS-style bare arbitrary values such as `p-10%` and `p-2.5px`.
|
|
194
|
+
*/
|
|
195
|
+
bareArbitraryValues?: boolean | {
|
|
196
|
+
units?: string[];
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* 扫描文件系统 source entries 中的候选类名。
|
|
200
|
+
*
|
|
201
|
+
* - `true`:使用 Tailwind v4 编译入口解析出的 `@source` 列表。
|
|
202
|
+
* - `TailwindV4SourcePattern[]`:使用调用方显式传入的 source 列表。
|
|
203
|
+
*/
|
|
204
|
+
scanSources?: boolean | TailwindV4SourcePattern[];
|
|
205
|
+
}
|
|
206
|
+
interface TailwindV4SourcePattern {
|
|
207
|
+
base: string;
|
|
208
|
+
pattern: string;
|
|
209
|
+
negated: boolean;
|
|
210
|
+
}
|
|
211
|
+
interface TailwindV4GenerateResult {
|
|
212
|
+
css: string;
|
|
213
|
+
classSet: Set<string>;
|
|
214
|
+
rawCandidates: Set<string>;
|
|
215
|
+
dependencies: string[];
|
|
216
|
+
sources: TailwindV4SourcePattern[];
|
|
217
|
+
root: null | 'none' | {
|
|
218
|
+
base: string;
|
|
219
|
+
pattern: string;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
interface TailwindV4DesignSystem {
|
|
223
|
+
parseCandidate: (candidate: string) => unknown[];
|
|
224
|
+
candidatesToCss: (candidates: string[]) => Array<string | null | undefined>;
|
|
225
|
+
}
|
|
226
|
+
interface TailwindV4Engine {
|
|
227
|
+
source: TailwindV4ResolvedSource;
|
|
228
|
+
loadDesignSystem: () => Promise<TailwindV4DesignSystem>;
|
|
229
|
+
validateCandidates: (candidates: Iterable<string>) => Promise<Set<string>>;
|
|
230
|
+
generate: (options?: TailwindV4GenerateOptions) => Promise<TailwindV4GenerateResult>;
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
162
233
|
//#region src/options/types.d.ts
|
|
163
234
|
type CacheStrategy = 'merge' | 'overwrite';
|
|
164
235
|
type CacheDriver = 'file' | 'memory' | 'noop';
|
|
@@ -246,6 +317,8 @@ interface TailwindV4Options {
|
|
|
246
317
|
base?: string;
|
|
247
318
|
/** Raw CSS passed directly to the v4 design system. */
|
|
248
319
|
css?: string;
|
|
320
|
+
/** 构建器在 CSS 落盘前捕获的内存 CSS 入口。 */
|
|
321
|
+
cssSources?: TailwindV4CssSource[];
|
|
249
322
|
/** Set of CSS entry files that should be scanned for `@config` directives. */
|
|
250
323
|
cssEntries?: string[];
|
|
251
324
|
/** Overrides the content sources scanned by the oxide scanner. */
|
|
@@ -328,6 +401,7 @@ interface NormalizedTailwindV4Options {
|
|
|
328
401
|
base: string;
|
|
329
402
|
configuredBase?: string;
|
|
330
403
|
css?: string;
|
|
404
|
+
cssSources: TailwindV4CssSource[];
|
|
331
405
|
cssEntries: string[];
|
|
332
406
|
sources: SourceEntry[];
|
|
333
407
|
hasUserDefinedSources: boolean;
|
|
@@ -438,11 +512,14 @@ interface ExtractValidCandidatesOption {
|
|
|
438
512
|
cwd?: string;
|
|
439
513
|
bareArbitraryValues?: boolean | BareArbitraryValueOptions;
|
|
440
514
|
}
|
|
441
|
-
|
|
515
|
+
interface ExtractSourceCandidate {
|
|
442
516
|
rawCandidate: string;
|
|
443
517
|
start: number;
|
|
444
518
|
end: number;
|
|
445
|
-
}
|
|
519
|
+
}
|
|
520
|
+
declare function extractRawCandidatesWithPositions(content: string, extension?: string): Promise<ExtractSourceCandidate[]>;
|
|
521
|
+
declare function extractSourceCandidatesWithPositions(content: string, extension?: string): Promise<ExtractSourceCandidate[]>;
|
|
522
|
+
declare function extractSourceCandidates(content: string, extension?: string): Promise<string[]>;
|
|
446
523
|
declare function extractRawCandidates(sources?: SourceEntry[]): Promise<string[]>;
|
|
447
524
|
declare function extractValidCandidates(options?: ExtractValidCandidatesOption): Promise<string[]>;
|
|
448
525
|
interface ExtractProjectCandidatesOptions {
|
|
@@ -699,4 +776,4 @@ declare class ValidateCommandError extends Error {
|
|
|
699
776
|
constructor(summary: ValidateFailureSummary, options?: ErrorOptions);
|
|
700
777
|
}
|
|
701
778
|
//#endregion
|
|
702
|
-
export {
|
|
779
|
+
export { TailwindV4GenerateResult as $, extractSourceCandidatesWithPositions as A, ExtractOptions as B, MIGRATION_REPORT_SCHEMA_VERSION as C, extractRawCandidates as D, extractProjectCandidatesWithPositions as E, ApplyOptions as F, TailwindV2Options as G, NormalizedTailwindCssPatchOptions as H, CacheOptions as I, TailwindV4CandidateSource as J, TailwindV3Options as K, CacheStrategy as L, groupTokensByFile as M, BareArbitraryValueOptions as N, extractRawCandidatesWithPositions as O, normalizeOptions as P, TailwindV4GenerateOptions as Q, ExposeContextOptions as R, MIGRATION_REPORT_KIND as S, CacheReadResult as St, TailwindcssPatcher as T, TailwindCssOptions as U, NormalizedCacheOptions as V, TailwindCssPatchOptions as W, TailwindV4DesignSystem as X, TailwindV4CssSource as Y, TailwindV4Engine as Z, ConfigFileMigrationEntry as _, CacheClearScope as _t, ValidateFailureSummary as a, PatchName as at, RestoreConfigFilesOptions as b, CacheIndexFileV2 as bt, TailwindcssPatchCliMountOptions as c, TailwindPatchRuntime as ct, TailwindcssPatchCommandContext as d, TailwindTokenLocation as dt, TailwindV4ResolvedSource as et, TailwindcssPatchCommandHandler as f, TailwindTokenReport as ft, tailwindcssPatchCommands as g, CacheClearResult as gt, TailwindcssPatchCommandOptions as h, CacheClearOptions as ht, ValidateFailureReason as i, PatchCheckStatus as it, extractValidCandidates as j, extractSourceCandidates as k, TailwindcssPatchCliOptions as l, TailwindTokenByFileMap as lt, TailwindcssPatchCommandOptionDefinition as m, TailwindcssRuntimeContext as mt, VALIDATE_FAILURE_REASONS as n, ExtractResult as nt, ValidateJsonFailurePayload as o, PatchStatusEntry as ot, TailwindcssPatchCommandHandlerMap as p, TailwindcssClassCache as pt, TailwindV4Options as q, ValidateCommandError as r, ILengthUnitsPatchOptions as rt, ValidateJsonSuccessPayload as s, PatchStatusReport as st, VALIDATE_EXIT_CODES as t, TailwindV4SourceOptions as tt, TailwindcssPatchCommand as u, TailwindTokenFileKey as ut, ConfigFileMigrationReport as v, CacheContextDescriptor as vt, logger as w, RestoreConfigFilesResult as x, CacheReadMeta as xt, MigrateConfigFilesOptions as y, CacheContextMetadata as yt, ExtendLengthUnitsOptions as z };
|