tailwindcss-patch 9.3.6 → 9.4.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-BF-qTWsU.js → index.bundle-CGaLDIgy.js} +2 -13
- package/dist/{index.bundle-BR8XOc2F.mjs → index.bundle-D6yHhQ-W.mjs} +2 -13
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{validate-DoeOD2Su.d.mts → validate-CDegYLlg.d.mts} +5 -4
- package/dist/{validate-BF0OladD.mjs → validate-Ci0W2Fuu.mjs} +93 -82
- package/dist/{validate-CLTQnfBI.js → validate-D9fDrE9I.js} +98 -81
- package/dist/{validate-eCzgDdk_.d.ts → validate-DFiRmBtJ.d.ts} +5 -4
- package/package.json +2 -1
- package/src/extraction/candidate-extractor.ts +10 -99
- package/src/extraction/split-candidate-tokens.ts +98 -0
- package/src/index.ts +26 -0
- package/src/v4/engine.ts +2 -10
- package/src/v4/index.ts +22 -0
- package/src/v4/node-adapter.ts +2 -4
- package/src/v4/source-scan.ts +432 -0
- package/src/v4/types.ts +6 -4
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-D9fDrE9I.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-CGaLDIgy.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 { F as logger, r as ValidateCommandError } from "./validate-Ci0W2Fuu.mjs";
|
|
2
|
+
import { t as createTailwindcssPatchCli } from "./index.bundle-D6yHhQ-W.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-CDegYLlg.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-DFiRmBtJ.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-D9fDrE9I.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 { F as logger, M as loadWorkspaceConfigModule, S as groupTokensByFile, a as tailwindcssPatchCommands, i as classifyValidateError, j 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-Ci0W2Fuu.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-D9fDrE9I.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);
|
|
@@ -9,18 +9,7 @@ let node_fs = require("node:fs");
|
|
|
9
9
|
//#region src/v4/engine.ts
|
|
10
10
|
function resolveScanSources(options, source, compiledRoot, compiledSources) {
|
|
11
11
|
if (Array.isArray(options?.scanSources)) return options.scanSources;
|
|
12
|
-
if (options?.scanSources === true) return
|
|
13
|
-
if (compiledRoot === "none") return [];
|
|
14
|
-
if (compiledRoot === null) return [{
|
|
15
|
-
base: source.base,
|
|
16
|
-
pattern: "**/*",
|
|
17
|
-
negated: false
|
|
18
|
-
}];
|
|
19
|
-
return [{
|
|
20
|
-
...compiledRoot,
|
|
21
|
-
negated: false
|
|
22
|
-
}];
|
|
23
|
-
})(), ...compiledSources];
|
|
12
|
+
if (options?.scanSources === true) return require_validate.createTailwindV4CompiledSourceEntries(compiledRoot, compiledSources, source.base);
|
|
24
13
|
return [];
|
|
25
14
|
}
|
|
26
15
|
async function collectRawCandidates(source, options, compiledRoot, compiledSources = []) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as
|
|
1
|
+
import { A as resolveValidTailwindV4Candidates, D as canonicalizeBareArbitraryValueCandidates, E as loadTailwindV4DesignSystem, N as normalizeOptions, O as extractTailwindV4InlineSourceCandidates, T as compileTailwindV4Source, _ as extractRawCandidates, k as replaceBareArbitraryValueSelectors, v as extractRawCandidatesWithPositions, w as createTailwindV4CompiledSourceEntries } from "./validate-Ci0W2Fuu.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import path from "pathe";
|
|
@@ -6,18 +6,7 @@ import { promises } from "node:fs";
|
|
|
6
6
|
//#region src/v4/engine.ts
|
|
7
7
|
function resolveScanSources(options, source, compiledRoot, compiledSources) {
|
|
8
8
|
if (Array.isArray(options?.scanSources)) return options.scanSources;
|
|
9
|
-
if (options?.scanSources === true) return
|
|
10
|
-
if (compiledRoot === "none") return [];
|
|
11
|
-
if (compiledRoot === null) return [{
|
|
12
|
-
base: source.base,
|
|
13
|
-
pattern: "**/*",
|
|
14
|
-
negated: false
|
|
15
|
-
}];
|
|
16
|
-
return [{
|
|
17
|
-
...compiledRoot,
|
|
18
|
-
negated: false
|
|
19
|
-
}];
|
|
20
|
-
})(), ...compiledSources];
|
|
9
|
+
if (options?.scanSources === true) return createTailwindV4CompiledSourceEntries(compiledRoot, compiledSources, source.base);
|
|
21
10
|
return [];
|
|
22
11
|
}
|
|
23
12
|
async function collectRawCandidates(source, options, compiledRoot, compiledSources = []) {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { $ as TailwindV4GenerateOptions, A as extractSourceCandidatesWithPositions, B as ExtendLengthUnitsOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, Ct as CacheReadResult, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as normalizeOptions, G as TailwindCssPatchOptions, H as NormalizedCacheOptions, I as ApplyOptions, J as TailwindV4Options, K as TailwindV2Options, L as CacheOptions, M as groupTokensByFile, N as resolveProjectSourceFiles, O as extractRawCandidatesWithPositions, P as BareArbitraryValueOptions, Q as TailwindV4Engine, R as CacheStrategy, S as MIGRATION_REPORT_KIND, St as CacheReadMeta, T as TailwindcssPatcher, U as NormalizedTailwindCssPatchOptions, V as ExtractOptions, W as TailwindCssOptions, X as TailwindV4CssSource, Y as TailwindV4CandidateSource, Z as TailwindV4DesignSystem, _ as ConfigFileMigrationEntry, _t as CacheClearResult, a as ValidateFailureSummary, at as PatchCheckStatus, b as RestoreConfigFilesOptions, bt as CacheContextMetadata, c as TailwindcssPatchCliMountOptions, ct as PatchStatusReport, d as TailwindcssPatchCommandContext, dt as TailwindTokenFileKey, et as TailwindV4GenerateResult, f as TailwindcssPatchCommandHandler, ft as TailwindTokenLocation, g as tailwindcssPatchCommands, gt as CacheClearOptions, h as TailwindcssPatchCommandOptions, ht as TailwindcssRuntimeContext, i as ValidateFailureReason, it as ILengthUnitsPatchOptions, j as extractValidCandidates, k as extractSourceCandidates, l as TailwindcssPatchCliOptions, lt as TailwindPatchRuntime, m as TailwindcssPatchCommandOptionDefinition, mt as TailwindcssClassCache, n as VALIDATE_FAILURE_REASONS, nt as TailwindV4SourceOptions, o as ValidateJsonFailurePayload, ot as PatchName, p as TailwindcssPatchCommandHandlerMap, pt as TailwindTokenReport, q as TailwindV3Options, r as ValidateCommandError, rt as ExtractResult, s as ValidateJsonSuccessPayload, st as PatchStatusEntry, t as VALIDATE_EXIT_CODES, tt as TailwindV4ResolvedSource, u as TailwindcssPatchCommand, ut as TailwindTokenByFileMap, v as ConfigFileMigrationReport, vt as CacheClearScope, w as logger, x as RestoreConfigFilesResult, xt as CacheIndexFileV2, y as MigrateConfigFilesOptions, yt as CacheContextDescriptor, z as ExposeContextOptions } from "./validate-
|
|
1
|
+
import { $ as TailwindV4GenerateOptions, A as extractSourceCandidatesWithPositions, B as ExtendLengthUnitsOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, Ct as CacheReadResult, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as normalizeOptions, G as TailwindCssPatchOptions, H as NormalizedCacheOptions, I as ApplyOptions, J as TailwindV4Options, K as TailwindV2Options, L as CacheOptions, M as groupTokensByFile, N as resolveProjectSourceFiles, O as extractRawCandidatesWithPositions, P as BareArbitraryValueOptions, Q as TailwindV4Engine, R as CacheStrategy, S as MIGRATION_REPORT_KIND, St as CacheReadMeta, T as TailwindcssPatcher, U as NormalizedTailwindCssPatchOptions, V as ExtractOptions, W as TailwindCssOptions, X as TailwindV4CssSource, Y as TailwindV4CandidateSource, Z as TailwindV4DesignSystem, _ as ConfigFileMigrationEntry, _t as CacheClearResult, a as ValidateFailureSummary, at as PatchCheckStatus, b as RestoreConfigFilesOptions, bt as CacheContextMetadata, c as TailwindcssPatchCliMountOptions, ct as PatchStatusReport, d as TailwindcssPatchCommandContext, dt as TailwindTokenFileKey, et as TailwindV4GenerateResult, f as TailwindcssPatchCommandHandler, ft as TailwindTokenLocation, g as tailwindcssPatchCommands, gt as CacheClearOptions, h as TailwindcssPatchCommandOptions, ht as TailwindcssRuntimeContext, i as ValidateFailureReason, it as ILengthUnitsPatchOptions, j as extractValidCandidates, k as extractSourceCandidates, l as TailwindcssPatchCliOptions, lt as TailwindPatchRuntime, m as TailwindcssPatchCommandOptionDefinition, mt as TailwindcssClassCache, n as VALIDATE_FAILURE_REASONS, nt as TailwindV4SourceOptions, o as ValidateJsonFailurePayload, ot as PatchName, p as TailwindcssPatchCommandHandlerMap, pt as TailwindTokenReport, q as TailwindV3Options, r as ValidateCommandError, rt as ExtractResult, s as ValidateJsonSuccessPayload, st as PatchStatusEntry, t as VALIDATE_EXIT_CODES, tt as TailwindV4ResolvedSource, u as TailwindcssPatchCommand, ut as TailwindTokenByFileMap, v as ConfigFileMigrationReport, vt as CacheClearScope, w as logger, x as RestoreConfigFilesResult, xt as CacheIndexFileV2, y as MigrateConfigFilesOptions, yt as CacheContextDescriptor, z as ExposeContextOptions } from "./validate-CDegYLlg.mjs";
|
|
2
2
|
import { PackageInfo } from "local-pkg";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import { CAC } from "cac";
|
|
5
|
+
import { SourceEntry } from "@tailwindcss/oxide";
|
|
5
6
|
import { TailwindcssMangleConfig } from "@tailwindcss-mangle/config";
|
|
6
7
|
|
|
7
8
|
//#region src/cache/store.d.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { $ as TailwindV4GenerateOptions, A as extractSourceCandidatesWithPositions, B as ExtendLengthUnitsOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, Ct as CacheReadResult, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as normalizeOptions, G as TailwindCssPatchOptions, H as NormalizedCacheOptions, I as ApplyOptions, J as TailwindV4Options, K as TailwindV2Options, L as CacheOptions, M as groupTokensByFile, N as resolveProjectSourceFiles, O as extractRawCandidatesWithPositions, P as BareArbitraryValueOptions, Q as TailwindV4Engine, R as CacheStrategy, S as MIGRATION_REPORT_KIND, St as CacheReadMeta, T as TailwindcssPatcher, U as NormalizedTailwindCssPatchOptions, V as ExtractOptions, W as TailwindCssOptions, X as TailwindV4CssSource, Y as TailwindV4CandidateSource, Z as TailwindV4DesignSystem, _ as ConfigFileMigrationEntry, _t as CacheClearResult, a as ValidateFailureSummary, at as PatchCheckStatus, b as RestoreConfigFilesOptions, bt as CacheContextMetadata, c as TailwindcssPatchCliMountOptions, ct as PatchStatusReport, d as TailwindcssPatchCommandContext, dt as TailwindTokenFileKey, et as TailwindV4GenerateResult, f as TailwindcssPatchCommandHandler, ft as TailwindTokenLocation, g as tailwindcssPatchCommands, gt as CacheClearOptions, h as TailwindcssPatchCommandOptions, ht as TailwindcssRuntimeContext, i as ValidateFailureReason, it as ILengthUnitsPatchOptions, j as extractValidCandidates, k as extractSourceCandidates, l as TailwindcssPatchCliOptions, lt as TailwindPatchRuntime, m as TailwindcssPatchCommandOptionDefinition, mt as TailwindcssClassCache, n as VALIDATE_FAILURE_REASONS, nt as TailwindV4SourceOptions, o as ValidateJsonFailurePayload, ot as PatchName, p as TailwindcssPatchCommandHandlerMap, pt as TailwindTokenReport, q as TailwindV3Options, r as ValidateCommandError, rt as ExtractResult, s as ValidateJsonSuccessPayload, st as PatchStatusEntry, t as VALIDATE_EXIT_CODES, tt as TailwindV4ResolvedSource, u as TailwindcssPatchCommand, ut as TailwindTokenByFileMap, v as ConfigFileMigrationReport, vt as CacheClearScope, w as logger, x as RestoreConfigFilesResult, xt as CacheIndexFileV2, y as MigrateConfigFilesOptions, yt as CacheContextDescriptor, z as ExposeContextOptions } from "./validate-
|
|
1
|
+
import { $ as TailwindV4GenerateOptions, A as extractSourceCandidatesWithPositions, B as ExtendLengthUnitsOptions, C as MIGRATION_REPORT_SCHEMA_VERSION, Ct as CacheReadResult, D as extractRawCandidates, E as extractProjectCandidatesWithPositions, F as normalizeOptions, G as TailwindCssPatchOptions, H as NormalizedCacheOptions, I as ApplyOptions, J as TailwindV4Options, K as TailwindV2Options, L as CacheOptions, M as groupTokensByFile, N as resolveProjectSourceFiles, O as extractRawCandidatesWithPositions, P as BareArbitraryValueOptions, Q as TailwindV4Engine, R as CacheStrategy, S as MIGRATION_REPORT_KIND, St as CacheReadMeta, T as TailwindcssPatcher, U as NormalizedTailwindCssPatchOptions, V as ExtractOptions, W as TailwindCssOptions, X as TailwindV4CssSource, Y as TailwindV4CandidateSource, Z as TailwindV4DesignSystem, _ as ConfigFileMigrationEntry, _t as CacheClearResult, a as ValidateFailureSummary, at as PatchCheckStatus, b as RestoreConfigFilesOptions, bt as CacheContextMetadata, c as TailwindcssPatchCliMountOptions, ct as PatchStatusReport, d as TailwindcssPatchCommandContext, dt as TailwindTokenFileKey, et as TailwindV4GenerateResult, f as TailwindcssPatchCommandHandler, ft as TailwindTokenLocation, g as tailwindcssPatchCommands, gt as CacheClearOptions, h as TailwindcssPatchCommandOptions, ht as TailwindcssRuntimeContext, i as ValidateFailureReason, it as ILengthUnitsPatchOptions, j as extractValidCandidates, k as extractSourceCandidates, l as TailwindcssPatchCliOptions, lt as TailwindPatchRuntime, m as TailwindcssPatchCommandOptionDefinition, mt as TailwindcssClassCache, n as VALIDATE_FAILURE_REASONS, nt as TailwindV4SourceOptions, o as ValidateJsonFailurePayload, ot as PatchName, p as TailwindcssPatchCommandHandlerMap, pt as TailwindTokenReport, q as TailwindV3Options, r as ValidateCommandError, rt as ExtractResult, s as ValidateJsonSuccessPayload, st as PatchStatusEntry, t as VALIDATE_EXIT_CODES, tt as TailwindV4ResolvedSource, u as TailwindcssPatchCommand, ut as TailwindTokenByFileMap, v as ConfigFileMigrationReport, vt as CacheClearScope, w as logger, x as RestoreConfigFilesResult, xt as CacheIndexFileV2, y as MigrateConfigFilesOptions, yt as CacheContextDescriptor, z as ExposeContextOptions } from "./validate-DFiRmBtJ.js";
|
|
2
2
|
import { CAC } from "cac";
|
|
3
3
|
import { PackageInfo } from "local-pkg";
|
|
4
|
+
import { SourceEntry } from "@tailwindcss/oxide";
|
|
4
5
|
import postcss from "postcss";
|
|
5
6
|
import { TailwindcssMangleConfig } from "@tailwindcss-mangle/config";
|
|
6
7
|
|
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-D9fDrE9I.js");
|
|
3
|
+
const require_index_bundle = require("./index.bundle-CGaLDIgy.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 { C as resolveProjectSourceFiles,
|
|
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 resolveValidTailwindV4Candidates, C as resolveProjectSourceFiles, E as loadTailwindV4DesignSystem, F as logger, N as normalizeOptions, P as CacheStore, 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, 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, x as extractValidCandidates, y as extractSourceCandidates } from "./validate-Ci0W2Fuu.mjs";
|
|
2
|
+
import { a as resolveTailwindV4SourceFromPatchOptions, i as resolveTailwindV4Source, n as defineConfig, o as createTailwindV4Engine, r as mountTailwindcssPatchCommands, t as createTailwindcssPatchCli } from "./index.bundle-D6yHhQ-W.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, extractSourceCandidates, extractSourceCandidatesWithPositions, extractValidCandidates, getPatchStatusReport, groupTokensByFile, loadRuntimeContexts, loadTailwindV4DesignSystem, logger, migrateConfigFiles, mountTailwindcssPatchCommands, normalizeOptions, resolveProjectSourceFiles, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveValidTailwindV4Candidates, restoreConfigFiles, runTailwindBuild, tailwindcssPatchCommands };
|
|
@@ -203,6 +203,10 @@ interface TailwindV4GenerateOptions {
|
|
|
203
203
|
*/
|
|
204
204
|
scanSources?: boolean | TailwindV4SourcePattern[];
|
|
205
205
|
}
|
|
206
|
+
type TailwindV4CompiledSourceRoot = null | 'none' | {
|
|
207
|
+
base: string;
|
|
208
|
+
pattern: string;
|
|
209
|
+
};
|
|
206
210
|
interface TailwindV4SourcePattern {
|
|
207
211
|
base: string;
|
|
208
212
|
pattern: string;
|
|
@@ -214,10 +218,7 @@ interface TailwindV4GenerateResult {
|
|
|
214
218
|
rawCandidates: Set<string>;
|
|
215
219
|
dependencies: string[];
|
|
216
220
|
sources: TailwindV4SourcePattern[];
|
|
217
|
-
root:
|
|
218
|
-
base: string;
|
|
219
|
-
pattern: string;
|
|
220
|
-
};
|
|
221
|
+
root: TailwindV4CompiledSourceRoot;
|
|
221
222
|
}
|
|
222
223
|
interface TailwindV4DesignSystem {
|
|
223
224
|
parseCandidate: (candidate: string) => unknown[];
|
|
@@ -10,13 +10,14 @@ import path$1 from "node:path";
|
|
|
10
10
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
11
|
import { promises } from "node:fs";
|
|
12
12
|
import postcss from "postcss";
|
|
13
|
+
import "micromatch";
|
|
13
14
|
import * as t from "@babel/types";
|
|
14
15
|
import generate from "@babel/generator";
|
|
15
16
|
import _babelTraverse from "@babel/traverse";
|
|
16
17
|
import { parse, parse as parse$1 } from "@babel/parser";
|
|
17
18
|
import { loadConfig } from "tailwindcss-config";
|
|
18
19
|
//#region package.json
|
|
19
|
-
var version = "9.
|
|
20
|
+
var version = "9.4.0";
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region src/constants.ts
|
|
22
23
|
const pkgName = "tailwindcss-patch";
|
|
@@ -2040,6 +2041,94 @@ async function compileTailwindV4Source(source) {
|
|
|
2040
2041
|
throw new Error("Failed to compile Tailwind CSS v4 source.");
|
|
2041
2042
|
}
|
|
2042
2043
|
//#endregion
|
|
2044
|
+
//#region src/v4/source-scan.ts
|
|
2045
|
+
const TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN = "**/*";
|
|
2046
|
+
function createTailwindV4RootSources(root, fallbackBase) {
|
|
2047
|
+
if (root === "none") return [];
|
|
2048
|
+
if (root === null) return [{
|
|
2049
|
+
base: fallbackBase,
|
|
2050
|
+
pattern: TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN,
|
|
2051
|
+
negated: false
|
|
2052
|
+
}];
|
|
2053
|
+
return [{
|
|
2054
|
+
...root,
|
|
2055
|
+
negated: false
|
|
2056
|
+
}];
|
|
2057
|
+
}
|
|
2058
|
+
function createTailwindV4CompiledSourceEntries(root, sources, fallbackBase) {
|
|
2059
|
+
return [...createTailwindV4RootSources(root, fallbackBase), ...sources];
|
|
2060
|
+
}
|
|
2061
|
+
function expandBracePattern(pattern) {
|
|
2062
|
+
const index = pattern.indexOf("{");
|
|
2063
|
+
if (index === -1) return [pattern];
|
|
2064
|
+
const rest = pattern.slice(index);
|
|
2065
|
+
let depth = 0;
|
|
2066
|
+
let endIndex = -1;
|
|
2067
|
+
for (let i = 0; i < rest.length; i++) {
|
|
2068
|
+
const char = rest[i];
|
|
2069
|
+
if (char === "\\") {
|
|
2070
|
+
i += 1;
|
|
2071
|
+
continue;
|
|
2072
|
+
}
|
|
2073
|
+
if (char === "{") {
|
|
2074
|
+
depth += 1;
|
|
2075
|
+
continue;
|
|
2076
|
+
}
|
|
2077
|
+
if (char === "}") {
|
|
2078
|
+
depth -= 1;
|
|
2079
|
+
if (depth === 0) {
|
|
2080
|
+
endIndex = i;
|
|
2081
|
+
break;
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
if (endIndex === -1) return [pattern];
|
|
2086
|
+
const prefix = pattern.slice(0, index);
|
|
2087
|
+
const inner = rest.slice(1, endIndex);
|
|
2088
|
+
const suffix = rest.slice(endIndex + 1);
|
|
2089
|
+
const parts = [];
|
|
2090
|
+
const stack = [];
|
|
2091
|
+
let lastPos = 0;
|
|
2092
|
+
for (let i = 0; i < inner.length; i++) {
|
|
2093
|
+
const char = inner[i];
|
|
2094
|
+
if (char === "\\") {
|
|
2095
|
+
i += 1;
|
|
2096
|
+
continue;
|
|
2097
|
+
}
|
|
2098
|
+
if (char === "{") {
|
|
2099
|
+
stack.push("}");
|
|
2100
|
+
continue;
|
|
2101
|
+
}
|
|
2102
|
+
if (char === "}" && stack[stack.length - 1] === "}") {
|
|
2103
|
+
stack.pop();
|
|
2104
|
+
continue;
|
|
2105
|
+
}
|
|
2106
|
+
if (char === "," && stack.length === 0) {
|
|
2107
|
+
parts.push(inner.slice(lastPos, i));
|
|
2108
|
+
lastPos = i + 1;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
parts.push(inner.slice(lastPos));
|
|
2112
|
+
return parts.flatMap((part) => expandBracePattern(`${prefix}${part}${suffix}`));
|
|
2113
|
+
}
|
|
2114
|
+
function expandTailwindV4SourceEntryBraces(sources) {
|
|
2115
|
+
return sources.flatMap((source) => {
|
|
2116
|
+
const base = path.resolve(source.base);
|
|
2117
|
+
return expandBracePattern(source.pattern).map((pattern) => ({
|
|
2118
|
+
base,
|
|
2119
|
+
pattern,
|
|
2120
|
+
negated: source.negated
|
|
2121
|
+
}));
|
|
2122
|
+
});
|
|
2123
|
+
}
|
|
2124
|
+
function normalizeTailwindV4ScannerSources(sources, cwd, ignoredSources = []) {
|
|
2125
|
+
return expandTailwindV4SourceEntryBraces([...sources?.length ? sources : [{
|
|
2126
|
+
base: cwd,
|
|
2127
|
+
pattern: TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN,
|
|
2128
|
+
negated: false
|
|
2129
|
+
}], ...ignoredSources]);
|
|
2130
|
+
}
|
|
2131
|
+
//#endregion
|
|
2043
2132
|
//#region src/extraction/candidate-extractor.ts
|
|
2044
2133
|
let oxideImportPromise;
|
|
2045
2134
|
const designSystemCandidateCache = /* @__PURE__ */ new Map();
|
|
@@ -2364,78 +2453,11 @@ function toRelativeFile(cwd, filename) {
|
|
|
2364
2453
|
const relative = path.relative(cwd, filename);
|
|
2365
2454
|
return relative === "" ? path.basename(filename) : relative;
|
|
2366
2455
|
}
|
|
2367
|
-
function expandBracePattern(pattern) {
|
|
2368
|
-
const index = pattern.indexOf("{");
|
|
2369
|
-
if (index === -1) return [pattern];
|
|
2370
|
-
const rest = pattern.slice(index);
|
|
2371
|
-
let depth = 0;
|
|
2372
|
-
let endIndex = -1;
|
|
2373
|
-
for (let i = 0; i < rest.length; i++) {
|
|
2374
|
-
const char = rest[i];
|
|
2375
|
-
if (char === "\\") {
|
|
2376
|
-
i += 1;
|
|
2377
|
-
continue;
|
|
2378
|
-
}
|
|
2379
|
-
if (char === "{") {
|
|
2380
|
-
depth += 1;
|
|
2381
|
-
continue;
|
|
2382
|
-
}
|
|
2383
|
-
if (char === "}") {
|
|
2384
|
-
depth -= 1;
|
|
2385
|
-
if (depth === 0) {
|
|
2386
|
-
endIndex = i;
|
|
2387
|
-
break;
|
|
2388
|
-
}
|
|
2389
|
-
}
|
|
2390
|
-
}
|
|
2391
|
-
if (endIndex === -1) return [pattern];
|
|
2392
|
-
const prefix = pattern.slice(0, index);
|
|
2393
|
-
const inner = rest.slice(1, endIndex);
|
|
2394
|
-
const suffix = rest.slice(endIndex + 1);
|
|
2395
|
-
const parts = [];
|
|
2396
|
-
const stack = [];
|
|
2397
|
-
let lastPos = 0;
|
|
2398
|
-
for (let i = 0; i < inner.length; i++) {
|
|
2399
|
-
const char = inner[i];
|
|
2400
|
-
if (char === "\\") {
|
|
2401
|
-
i += 1;
|
|
2402
|
-
continue;
|
|
2403
|
-
}
|
|
2404
|
-
if (char === "{") {
|
|
2405
|
-
stack.push("}");
|
|
2406
|
-
continue;
|
|
2407
|
-
}
|
|
2408
|
-
if (char === "}" && stack[stack.length - 1] === "}") {
|
|
2409
|
-
stack.pop();
|
|
2410
|
-
continue;
|
|
2411
|
-
}
|
|
2412
|
-
if (char === "," && stack.length === 0) {
|
|
2413
|
-
parts.push(inner.slice(lastPos, i));
|
|
2414
|
-
lastPos = i + 1;
|
|
2415
|
-
}
|
|
2416
|
-
}
|
|
2417
|
-
parts.push(inner.slice(lastPos));
|
|
2418
|
-
return parts.flatMap((part) => expandBracePattern(`${prefix}${part}${suffix}`));
|
|
2419
|
-
}
|
|
2420
|
-
function normalizeScannerSources(sources, cwd, ignoredSources = []) {
|
|
2421
|
-
return [...sources?.length ? sources : [{
|
|
2422
|
-
base: cwd,
|
|
2423
|
-
pattern: "**/*",
|
|
2424
|
-
negated: false
|
|
2425
|
-
}], ...ignoredSources].flatMap((source) => {
|
|
2426
|
-
const base = source.base ?? cwd;
|
|
2427
|
-
return expandBracePattern(source.pattern).map((pattern) => ({
|
|
2428
|
-
base,
|
|
2429
|
-
pattern,
|
|
2430
|
-
negated: source.negated
|
|
2431
|
-
}));
|
|
2432
|
-
});
|
|
2433
|
-
}
|
|
2434
2456
|
async function resolveScannerSources(options) {
|
|
2435
2457
|
const cwd = options?.cwd ? path.resolve(options.cwd) : process.cwd();
|
|
2436
2458
|
if (options?.sources?.length || options?.css === void 0) return {
|
|
2437
2459
|
cwd,
|
|
2438
|
-
sources:
|
|
2460
|
+
sources: normalizeTailwindV4ScannerSources(options?.sources, cwd, options?.ignoredSources)
|
|
2439
2461
|
};
|
|
2440
2462
|
const base = options.base ? path.resolve(options.base) : cwd;
|
|
2441
2463
|
const { compiled } = await compileTailwindV4Source({
|
|
@@ -2447,18 +2469,7 @@ async function resolveScannerSources(options) {
|
|
|
2447
2469
|
});
|
|
2448
2470
|
return {
|
|
2449
2471
|
cwd,
|
|
2450
|
-
sources:
|
|
2451
|
-
if (compiled.root === "none") return [];
|
|
2452
|
-
if (compiled.root === null) return [{
|
|
2453
|
-
base,
|
|
2454
|
-
pattern: "**/*",
|
|
2455
|
-
negated: false
|
|
2456
|
-
}];
|
|
2457
|
-
return [{
|
|
2458
|
-
...compiled.root,
|
|
2459
|
-
negated: false
|
|
2460
|
-
}];
|
|
2461
|
-
})(), ...compiled.sources], cwd, options.ignoredSources)
|
|
2472
|
+
sources: normalizeTailwindV4ScannerSources(createTailwindV4CompiledSourceEntries(compiled.root, compiled.sources, base), cwd, options.ignoredSources)
|
|
2462
2473
|
};
|
|
2463
2474
|
}
|
|
2464
2475
|
async function resolveProjectSourceFiles(options) {
|
|
@@ -4207,4 +4218,4 @@ var ValidateCommandError = class extends Error {
|
|
|
4207
4218
|
}
|
|
4208
4219
|
};
|
|
4209
4220
|
//#endregion
|
|
4210
|
-
export {
|
|
4221
|
+
export { resolveValidTailwindV4Candidates as A, resolveProjectSourceFiles as C, canonicalizeBareArbitraryValueCandidates as D, loadTailwindV4DesignSystem as E, logger as F, loadWorkspaceConfigModule as M, normalizeOptions as N, extractTailwindV4InlineSourceCandidates as O, CacheStore as P, groupTokensByFile as S, compileTailwindV4Source as T, extractRawCandidates as _, tailwindcssPatchCommands as a, extractSourceCandidatesWithPositions as b, MIGRATION_REPORT_KIND as c, getPatchStatusReport as d, runTailwindBuild as f, extractProjectCandidatesWithPositions as g, collectClassesFromTailwindV4 as h, classifyValidateError as i, loadPatchOptionsForWorkspace as j, replaceBareArbitraryValueSelectors 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, createTailwindV4CompiledSourceEntries as w, extractValidCandidates as x, extractSourceCandidates as y };
|
|
@@ -14,6 +14,7 @@ let node_url = require("node:url");
|
|
|
14
14
|
let node_fs = require("node:fs");
|
|
15
15
|
let postcss = require("postcss");
|
|
16
16
|
postcss = require_chunk.__toESM(postcss);
|
|
17
|
+
require("micromatch");
|
|
17
18
|
let _babel_types = require("@babel/types");
|
|
18
19
|
_babel_types = require_chunk.__toESM(_babel_types);
|
|
19
20
|
let _babel_generator = require("@babel/generator");
|
|
@@ -23,7 +24,7 @@ _babel_traverse = require_chunk.__toESM(_babel_traverse);
|
|
|
23
24
|
let _babel_parser = require("@babel/parser");
|
|
24
25
|
let tailwindcss_config = require("tailwindcss-config");
|
|
25
26
|
//#region package.json
|
|
26
|
-
var version = "9.
|
|
27
|
+
var version = "9.4.0";
|
|
27
28
|
//#endregion
|
|
28
29
|
//#region src/constants.ts
|
|
29
30
|
const pkgName = "tailwindcss-patch";
|
|
@@ -2042,6 +2043,94 @@ async function compileTailwindV4Source(source) {
|
|
|
2042
2043
|
throw new Error("Failed to compile Tailwind CSS v4 source.");
|
|
2043
2044
|
}
|
|
2044
2045
|
//#endregion
|
|
2046
|
+
//#region src/v4/source-scan.ts
|
|
2047
|
+
const TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN = "**/*";
|
|
2048
|
+
function createTailwindV4RootSources(root, fallbackBase) {
|
|
2049
|
+
if (root === "none") return [];
|
|
2050
|
+
if (root === null) return [{
|
|
2051
|
+
base: fallbackBase,
|
|
2052
|
+
pattern: TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN,
|
|
2053
|
+
negated: false
|
|
2054
|
+
}];
|
|
2055
|
+
return [{
|
|
2056
|
+
...root,
|
|
2057
|
+
negated: false
|
|
2058
|
+
}];
|
|
2059
|
+
}
|
|
2060
|
+
function createTailwindV4CompiledSourceEntries(root, sources, fallbackBase) {
|
|
2061
|
+
return [...createTailwindV4RootSources(root, fallbackBase), ...sources];
|
|
2062
|
+
}
|
|
2063
|
+
function expandBracePattern(pattern) {
|
|
2064
|
+
const index = pattern.indexOf("{");
|
|
2065
|
+
if (index === -1) return [pattern];
|
|
2066
|
+
const rest = pattern.slice(index);
|
|
2067
|
+
let depth = 0;
|
|
2068
|
+
let endIndex = -1;
|
|
2069
|
+
for (let i = 0; i < rest.length; i++) {
|
|
2070
|
+
const char = rest[i];
|
|
2071
|
+
if (char === "\\") {
|
|
2072
|
+
i += 1;
|
|
2073
|
+
continue;
|
|
2074
|
+
}
|
|
2075
|
+
if (char === "{") {
|
|
2076
|
+
depth += 1;
|
|
2077
|
+
continue;
|
|
2078
|
+
}
|
|
2079
|
+
if (char === "}") {
|
|
2080
|
+
depth -= 1;
|
|
2081
|
+
if (depth === 0) {
|
|
2082
|
+
endIndex = i;
|
|
2083
|
+
break;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
if (endIndex === -1) return [pattern];
|
|
2088
|
+
const prefix = pattern.slice(0, index);
|
|
2089
|
+
const inner = rest.slice(1, endIndex);
|
|
2090
|
+
const suffix = rest.slice(endIndex + 1);
|
|
2091
|
+
const parts = [];
|
|
2092
|
+
const stack = [];
|
|
2093
|
+
let lastPos = 0;
|
|
2094
|
+
for (let i = 0; i < inner.length; i++) {
|
|
2095
|
+
const char = inner[i];
|
|
2096
|
+
if (char === "\\") {
|
|
2097
|
+
i += 1;
|
|
2098
|
+
continue;
|
|
2099
|
+
}
|
|
2100
|
+
if (char === "{") {
|
|
2101
|
+
stack.push("}");
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
if (char === "}" && stack[stack.length - 1] === "}") {
|
|
2105
|
+
stack.pop();
|
|
2106
|
+
continue;
|
|
2107
|
+
}
|
|
2108
|
+
if (char === "," && stack.length === 0) {
|
|
2109
|
+
parts.push(inner.slice(lastPos, i));
|
|
2110
|
+
lastPos = i + 1;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
parts.push(inner.slice(lastPos));
|
|
2114
|
+
return parts.flatMap((part) => expandBracePattern(`${prefix}${part}${suffix}`));
|
|
2115
|
+
}
|
|
2116
|
+
function expandTailwindV4SourceEntryBraces(sources) {
|
|
2117
|
+
return sources.flatMap((source) => {
|
|
2118
|
+
const base = pathe.default.resolve(source.base);
|
|
2119
|
+
return expandBracePattern(source.pattern).map((pattern) => ({
|
|
2120
|
+
base,
|
|
2121
|
+
pattern,
|
|
2122
|
+
negated: source.negated
|
|
2123
|
+
}));
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
function normalizeTailwindV4ScannerSources(sources, cwd, ignoredSources = []) {
|
|
2127
|
+
return expandTailwindV4SourceEntryBraces([...sources?.length ? sources : [{
|
|
2128
|
+
base: cwd,
|
|
2129
|
+
pattern: TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN,
|
|
2130
|
+
negated: false
|
|
2131
|
+
}], ...ignoredSources]);
|
|
2132
|
+
}
|
|
2133
|
+
//#endregion
|
|
2045
2134
|
//#region src/extraction/candidate-extractor.ts
|
|
2046
2135
|
let oxideImportPromise;
|
|
2047
2136
|
const designSystemCandidateCache = /* @__PURE__ */ new Map();
|
|
@@ -2366,78 +2455,11 @@ function toRelativeFile(cwd, filename) {
|
|
|
2366
2455
|
const relative = pathe.default.relative(cwd, filename);
|
|
2367
2456
|
return relative === "" ? pathe.default.basename(filename) : relative;
|
|
2368
2457
|
}
|
|
2369
|
-
function expandBracePattern(pattern) {
|
|
2370
|
-
const index = pattern.indexOf("{");
|
|
2371
|
-
if (index === -1) return [pattern];
|
|
2372
|
-
const rest = pattern.slice(index);
|
|
2373
|
-
let depth = 0;
|
|
2374
|
-
let endIndex = -1;
|
|
2375
|
-
for (let i = 0; i < rest.length; i++) {
|
|
2376
|
-
const char = rest[i];
|
|
2377
|
-
if (char === "\\") {
|
|
2378
|
-
i += 1;
|
|
2379
|
-
continue;
|
|
2380
|
-
}
|
|
2381
|
-
if (char === "{") {
|
|
2382
|
-
depth += 1;
|
|
2383
|
-
continue;
|
|
2384
|
-
}
|
|
2385
|
-
if (char === "}") {
|
|
2386
|
-
depth -= 1;
|
|
2387
|
-
if (depth === 0) {
|
|
2388
|
-
endIndex = i;
|
|
2389
|
-
break;
|
|
2390
|
-
}
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
if (endIndex === -1) return [pattern];
|
|
2394
|
-
const prefix = pattern.slice(0, index);
|
|
2395
|
-
const inner = rest.slice(1, endIndex);
|
|
2396
|
-
const suffix = rest.slice(endIndex + 1);
|
|
2397
|
-
const parts = [];
|
|
2398
|
-
const stack = [];
|
|
2399
|
-
let lastPos = 0;
|
|
2400
|
-
for (let i = 0; i < inner.length; i++) {
|
|
2401
|
-
const char = inner[i];
|
|
2402
|
-
if (char === "\\") {
|
|
2403
|
-
i += 1;
|
|
2404
|
-
continue;
|
|
2405
|
-
}
|
|
2406
|
-
if (char === "{") {
|
|
2407
|
-
stack.push("}");
|
|
2408
|
-
continue;
|
|
2409
|
-
}
|
|
2410
|
-
if (char === "}" && stack[stack.length - 1] === "}") {
|
|
2411
|
-
stack.pop();
|
|
2412
|
-
continue;
|
|
2413
|
-
}
|
|
2414
|
-
if (char === "," && stack.length === 0) {
|
|
2415
|
-
parts.push(inner.slice(lastPos, i));
|
|
2416
|
-
lastPos = i + 1;
|
|
2417
|
-
}
|
|
2418
|
-
}
|
|
2419
|
-
parts.push(inner.slice(lastPos));
|
|
2420
|
-
return parts.flatMap((part) => expandBracePattern(`${prefix}${part}${suffix}`));
|
|
2421
|
-
}
|
|
2422
|
-
function normalizeScannerSources(sources, cwd, ignoredSources = []) {
|
|
2423
|
-
return [...sources?.length ? sources : [{
|
|
2424
|
-
base: cwd,
|
|
2425
|
-
pattern: "**/*",
|
|
2426
|
-
negated: false
|
|
2427
|
-
}], ...ignoredSources].flatMap((source) => {
|
|
2428
|
-
const base = source.base ?? cwd;
|
|
2429
|
-
return expandBracePattern(source.pattern).map((pattern) => ({
|
|
2430
|
-
base,
|
|
2431
|
-
pattern,
|
|
2432
|
-
negated: source.negated
|
|
2433
|
-
}));
|
|
2434
|
-
});
|
|
2435
|
-
}
|
|
2436
2458
|
async function resolveScannerSources(options) {
|
|
2437
2459
|
const cwd = options?.cwd ? pathe.default.resolve(options.cwd) : node_process.default.cwd();
|
|
2438
2460
|
if (options?.sources?.length || options?.css === void 0) return {
|
|
2439
2461
|
cwd,
|
|
2440
|
-
sources:
|
|
2462
|
+
sources: normalizeTailwindV4ScannerSources(options?.sources, cwd, options?.ignoredSources)
|
|
2441
2463
|
};
|
|
2442
2464
|
const base = options.base ? pathe.default.resolve(options.base) : cwd;
|
|
2443
2465
|
const { compiled } = await compileTailwindV4Source({
|
|
@@ -2449,18 +2471,7 @@ async function resolveScannerSources(options) {
|
|
|
2449
2471
|
});
|
|
2450
2472
|
return {
|
|
2451
2473
|
cwd,
|
|
2452
|
-
sources:
|
|
2453
|
-
if (compiled.root === "none") return [];
|
|
2454
|
-
if (compiled.root === null) return [{
|
|
2455
|
-
base,
|
|
2456
|
-
pattern: "**/*",
|
|
2457
|
-
negated: false
|
|
2458
|
-
}];
|
|
2459
|
-
return [{
|
|
2460
|
-
...compiled.root,
|
|
2461
|
-
negated: false
|
|
2462
|
-
}];
|
|
2463
|
-
})(), ...compiled.sources], cwd, options.ignoredSources)
|
|
2474
|
+
sources: normalizeTailwindV4ScannerSources(createTailwindV4CompiledSourceEntries(compiled.root, compiled.sources, base), cwd, options.ignoredSources)
|
|
2464
2475
|
};
|
|
2465
2476
|
}
|
|
2466
2477
|
async function resolveProjectSourceFiles(options) {
|
|
@@ -4281,6 +4292,12 @@ Object.defineProperty(exports, "compileTailwindV4Source", {
|
|
|
4281
4292
|
return compileTailwindV4Source;
|
|
4282
4293
|
}
|
|
4283
4294
|
});
|
|
4295
|
+
Object.defineProperty(exports, "createTailwindV4CompiledSourceEntries", {
|
|
4296
|
+
enumerable: true,
|
|
4297
|
+
get: function() {
|
|
4298
|
+
return createTailwindV4CompiledSourceEntries;
|
|
4299
|
+
}
|
|
4300
|
+
});
|
|
4284
4301
|
Object.defineProperty(exports, "extractProjectCandidatesWithPositions", {
|
|
4285
4302
|
enumerable: true,
|
|
4286
4303
|
get: function() {
|
|
@@ -204,6 +204,10 @@ interface TailwindV4GenerateOptions {
|
|
|
204
204
|
*/
|
|
205
205
|
scanSources?: boolean | TailwindV4SourcePattern[];
|
|
206
206
|
}
|
|
207
|
+
type TailwindV4CompiledSourceRoot = null | 'none' | {
|
|
208
|
+
base: string;
|
|
209
|
+
pattern: string;
|
|
210
|
+
};
|
|
207
211
|
interface TailwindV4SourcePattern {
|
|
208
212
|
base: string;
|
|
209
213
|
pattern: string;
|
|
@@ -215,10 +219,7 @@ interface TailwindV4GenerateResult {
|
|
|
215
219
|
rawCandidates: Set<string>;
|
|
216
220
|
dependencies: string[];
|
|
217
221
|
sources: TailwindV4SourcePattern[];
|
|
218
|
-
root:
|
|
219
|
-
base: string;
|
|
220
|
-
pattern: string;
|
|
221
|
-
};
|
|
222
|
+
root: TailwindV4CompiledSourceRoot;
|
|
222
223
|
}
|
|
223
224
|
interface TailwindV4DesignSystem {
|
|
224
225
|
parseCandidate: (candidate: string) => unknown[];
|