tailwindcss-patch 9.4.0 → 9.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-D5D3Yj69.mjs +655 -0
- package/dist/cli-DsXcyl2O.js +671 -0
- package/dist/cli.js +4 -4
- package/dist/cli.mjs +3 -3
- package/dist/commands/cli-runtime.d.mts +1 -1
- package/dist/commands/cli-runtime.d.ts +1 -1
- package/dist/commands/cli-runtime.js +4 -661
- package/dist/commands/cli-runtime.mjs +2 -654
- package/dist/index.d.mts +39 -3
- package/dist/index.d.ts +39 -3
- package/dist/index.js +320 -8
- package/dist/index.mjs +283 -3
- package/dist/{validate-D9fDrE9I.js → validate-5eUbRAzl.js} +468 -19
- package/dist/{validate-Ci0W2Fuu.mjs → validate-CInDiiYy.mjs} +331 -21
- package/dist/{validate-DFiRmBtJ.d.ts → validate-CYB-90BG.d.ts} +22 -5
- package/dist/{validate-CDegYLlg.d.mts → validate-D6MO6lZo.d.mts} +22 -5
- package/package.json +1 -1
- package/src/extraction/candidate-extractor.ts +76 -12
- package/src/extraction/split-candidate-tokens.ts +3 -0
- package/src/index.bundle.ts +1 -112
- package/src/index.ts +1 -100
- package/src/public-api.ts +111 -0
- package/src/v4/bare-arbitrary-values.ts +127 -2
- package/src/v4/engine.ts +5 -2
- package/src/v4/index.ts +14 -5
- package/src/v4/node-adapter.ts +1 -1
- package/src/v4/source-scan.ts +1 -1
- package/dist/index.bundle-CGaLDIgy.js +0 -259
- package/dist/index.bundle-D6yHhQ-W.mjs +0 -221
- package/src/cli.bundle.ts +0 -20
|
@@ -5,11 +5,12 @@ import type {
|
|
|
5
5
|
TailwindTokenLocation,
|
|
6
6
|
TailwindTokenReport,
|
|
7
7
|
} from '../types'
|
|
8
|
+
import type { BareArbitraryValueOptions } from '../v4/bare-arbitrary-values'
|
|
8
9
|
import { promises as fs } from 'node:fs'
|
|
9
10
|
import process from 'node:process'
|
|
10
11
|
import path from 'pathe'
|
|
11
12
|
import {
|
|
12
|
-
|
|
13
|
+
extractBareArbitraryValueSourceCandidatesWithPositions,
|
|
13
14
|
resolveBareArbitraryValueCandidate,
|
|
14
15
|
} from '../v4/bare-arbitrary-values'
|
|
15
16
|
import { extractTailwindV4InlineSourceCandidates, resolveValidTailwindV4Candidates } from '../v4/candidates'
|
|
@@ -59,6 +60,10 @@ export interface ExtractValidCandidatesOption {
|
|
|
59
60
|
bareArbitraryValues?: boolean | BareArbitraryValueOptions
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
export interface ExtractCandidateOptions {
|
|
64
|
+
bareArbitraryValues?: boolean | BareArbitraryValueOptions
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
export interface ExtractSourceCandidate {
|
|
63
68
|
rawCandidate: string
|
|
64
69
|
start: number
|
|
@@ -75,7 +80,7 @@ const HTML_ATTRIBUTE_NAME_CANDIDATE_RE = /^(?:class|className|hover-class|hoverC
|
|
|
75
80
|
const CSS_DIRECTIVE_CANDIDATE_RE = /^@(?:apply|tailwind|source|config|plugin|theme|utility|custom-variant|variant)$/
|
|
76
81
|
const CSS_APPLY_IMPORTANT = '!important'
|
|
77
82
|
const CSS_APPLY_RE = /@apply\s+([^;{}]+)/g
|
|
78
|
-
const JS_LIKE_SOURCE_EXTENSION_RE = /^
|
|
83
|
+
const JS_LIKE_SOURCE_EXTENSION_RE = /^[cm]?[jt]sx?$/
|
|
79
84
|
const MIXED_TEMPLATE_SOURCE_EXTENSION_RE = /^(?:vue|uvue|nvue|svelte|mpx)$/
|
|
80
85
|
const CSS_LIKE_SOURCE_EXTENSION_RE = /^(?:css|wxss|acss|jxss|ttss|qss|tyss|scss|sass|less|styl|stylus)$/
|
|
81
86
|
const SFC_SCRIPT_BLOCK_RE = /<script\b[^>]*>([\s\S]*?)<\/script>/gi
|
|
@@ -102,7 +107,7 @@ function isInsideHtmlTagText(content: string, candidate: ExtractSourceCandidate)
|
|
|
102
107
|
return false
|
|
103
108
|
}
|
|
104
109
|
const nextOpen = content.indexOf('<', candidate.end)
|
|
105
|
-
return nextOpen !== -1 && (nextOpen < content.indexOf('>', candidate.end) || content.
|
|
110
|
+
return nextOpen !== -1 && (nextOpen < content.indexOf('>', candidate.end) || !content.includes('>', candidate.end))
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
function isCssDirectiveCandidate(candidate: string) {
|
|
@@ -223,7 +228,36 @@ function createLocalCandidate(candidate: ExtractSourceCandidateWithContext): Ext
|
|
|
223
228
|
}
|
|
224
229
|
}
|
|
225
230
|
|
|
226
|
-
|
|
231
|
+
function dedupeCandidatesWithPositions(candidates: ExtractSourceCandidate[]) {
|
|
232
|
+
const seen = new Set<string>()
|
|
233
|
+
return candidates.filter((candidate) => {
|
|
234
|
+
const key = `${candidate.start}:${candidate.end}:${candidate.rawCandidate}`
|
|
235
|
+
if (seen.has(key)) {
|
|
236
|
+
return false
|
|
237
|
+
}
|
|
238
|
+
seen.add(key)
|
|
239
|
+
return true
|
|
240
|
+
})
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function createBareArbitraryValueCandidateContexts(
|
|
244
|
+
content: string,
|
|
245
|
+
extension: string,
|
|
246
|
+
offset: number,
|
|
247
|
+
options?: ExtractCandidateOptions,
|
|
248
|
+
): ExtractSourceCandidateWithContext[] {
|
|
249
|
+
return extractBareArbitraryValueSourceCandidatesWithPositions(content, options?.bareArbitraryValues)
|
|
250
|
+
.map(candidate => ({
|
|
251
|
+
content,
|
|
252
|
+
extension,
|
|
253
|
+
localStart: candidate.start,
|
|
254
|
+
rawCandidate: candidate.rawCandidate,
|
|
255
|
+
start: candidate.start + offset,
|
|
256
|
+
end: candidate.end + offset,
|
|
257
|
+
}))
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async function extractCssApplyCandidates(content: string, extension: string, options?: ExtractCandidateOptions) {
|
|
227
261
|
const candidates: ExtractSourceCandidateWithContext[] = []
|
|
228
262
|
CSS_APPLY_RE.lastIndex = 0
|
|
229
263
|
let match = CSS_APPLY_RE.exec(content)
|
|
@@ -239,12 +273,13 @@ async function extractCssApplyCandidates(content: string, extension: string) {
|
|
|
239
273
|
start: candidate.start + applyParamsStart,
|
|
240
274
|
end: candidate.end + applyParamsStart,
|
|
241
275
|
})))
|
|
276
|
+
candidates.push(...createBareArbitraryValueCandidateContexts(applyParams, 'html', applyParamsStart, options))
|
|
242
277
|
match = CSS_APPLY_RE.exec(content)
|
|
243
278
|
}
|
|
244
279
|
return candidates
|
|
245
280
|
}
|
|
246
281
|
|
|
247
|
-
async function extractMixedSourceScriptCandidates(content: string) {
|
|
282
|
+
async function extractMixedSourceScriptCandidates(content: string, options?: ExtractCandidateOptions) {
|
|
248
283
|
const candidates: ExtractSourceCandidateWithContext[] = []
|
|
249
284
|
SFC_SCRIPT_BLOCK_RE.lastIndex = 0
|
|
250
285
|
let match = SFC_SCRIPT_BLOCK_RE.exec(content)
|
|
@@ -260,6 +295,7 @@ async function extractMixedSourceScriptCandidates(content: string) {
|
|
|
260
295
|
start: candidate.start + scriptStart,
|
|
261
296
|
end: candidate.end + scriptStart,
|
|
262
297
|
})))
|
|
298
|
+
candidates.push(...createBareArbitraryValueCandidateContexts(scriptContent, 'js', scriptStart, options))
|
|
263
299
|
match = SFC_SCRIPT_BLOCK_RE.exec(content)
|
|
264
300
|
}
|
|
265
301
|
return candidates
|
|
@@ -278,26 +314,30 @@ function createCandidateCacheKey(
|
|
|
278
314
|
export async function extractRawCandidatesWithPositions(
|
|
279
315
|
content: string,
|
|
280
316
|
extension: string = 'html',
|
|
317
|
+
options?: ExtractCandidateOptions,
|
|
281
318
|
): Promise<ExtractSourceCandidate[]> {
|
|
282
319
|
const { Scanner } = await getOxideModule()
|
|
283
320
|
const scanner = new Scanner({})
|
|
284
321
|
const result = scanner.getCandidatesWithPositions({ content, extension })
|
|
285
322
|
|
|
286
|
-
|
|
323
|
+
const candidates = result.map(({ candidate, position }) => ({
|
|
287
324
|
rawCandidate: candidate,
|
|
288
325
|
start: position,
|
|
289
326
|
end: position + candidate.length,
|
|
290
327
|
}))
|
|
328
|
+
candidates.push(...extractBareArbitraryValueSourceCandidatesWithPositions(content, options?.bareArbitraryValues))
|
|
329
|
+
return dedupeCandidatesWithPositions(candidates)
|
|
291
330
|
}
|
|
292
331
|
|
|
293
332
|
export async function extractSourceCandidatesWithPositions(
|
|
294
333
|
content: string,
|
|
295
334
|
extension: string = 'html',
|
|
335
|
+
options?: ExtractCandidateOptions,
|
|
296
336
|
): Promise<ExtractSourceCandidate[]> {
|
|
297
337
|
const normalizedExtension = extension.replace(/^\./, '')
|
|
298
338
|
const candidates: ExtractSourceCandidateWithContext[] = CSS_LIKE_SOURCE_EXTENSION_RE.test(normalizedExtension)
|
|
299
|
-
? await extractCssApplyCandidates(content, normalizedExtension)
|
|
300
|
-
: (await extractRawCandidatesWithPositions(content, normalizedExtension))
|
|
339
|
+
? await extractCssApplyCandidates(content, normalizedExtension, options)
|
|
340
|
+
: (await extractRawCandidatesWithPositions(content, normalizedExtension, options))
|
|
301
341
|
.map(candidate => ({
|
|
302
342
|
...candidate,
|
|
303
343
|
content,
|
|
@@ -305,7 +345,7 @@ export async function extractSourceCandidatesWithPositions(
|
|
|
305
345
|
localStart: candidate.start,
|
|
306
346
|
}))
|
|
307
347
|
if (MIXED_TEMPLATE_SOURCE_EXTENSION_RE.test(normalizedExtension)) {
|
|
308
|
-
candidates.push(...await extractMixedSourceScriptCandidates(content))
|
|
348
|
+
candidates.push(...await extractMixedSourceScriptCandidates(content, options))
|
|
309
349
|
}
|
|
310
350
|
const seen = new Set<string>()
|
|
311
351
|
return candidates.filter((candidate) => {
|
|
@@ -324,18 +364,37 @@ export async function extractSourceCandidatesWithPositions(
|
|
|
324
364
|
export async function extractSourceCandidates(
|
|
325
365
|
content: string,
|
|
326
366
|
extension: string = 'html',
|
|
367
|
+
options?: ExtractCandidateOptions,
|
|
327
368
|
): Promise<string[]> {
|
|
328
|
-
const candidates = await extractSourceCandidatesWithPositions(content, extension)
|
|
369
|
+
const candidates = await extractSourceCandidatesWithPositions(content, extension, options)
|
|
329
370
|
return [...new Set(candidates.map(candidate => candidate.rawCandidate))]
|
|
330
371
|
}
|
|
331
372
|
|
|
332
373
|
export async function extractRawCandidates(
|
|
333
374
|
sources?: SourceEntry[],
|
|
375
|
+
options?: ExtractCandidateOptions,
|
|
334
376
|
): Promise<string[]> {
|
|
335
377
|
const { Scanner } = await getOxideModule()
|
|
336
378
|
const scanner = new Scanner(sources === undefined ? {} : { sources })
|
|
337
379
|
|
|
338
|
-
|
|
380
|
+
const candidates = new Set(scanner.scan())
|
|
381
|
+
if (options?.bareArbitraryValues !== undefined && options.bareArbitraryValues !== false) {
|
|
382
|
+
await Promise.all((scanner.files ?? []).map(async (file) => {
|
|
383
|
+
try {
|
|
384
|
+
const content = await fs.readFile(file, 'utf8')
|
|
385
|
+
const extension = toExtension(file)
|
|
386
|
+
for (const candidate of extractBareArbitraryValueSourceCandidatesWithPositions(content, options.bareArbitraryValues)) {
|
|
387
|
+
if (shouldKeepSourceCandidate(content, extension, candidate)) {
|
|
388
|
+
candidates.add(candidate.rawCandidate)
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
catch {
|
|
393
|
+
// 文件可能在扫描和读取之间被移除,保持与 Tailwind 原扫描结果一致。
|
|
394
|
+
}
|
|
395
|
+
}))
|
|
396
|
+
}
|
|
397
|
+
return [...candidates]
|
|
339
398
|
}
|
|
340
399
|
|
|
341
400
|
export async function extractValidCandidates(options?: ExtractValidCandidatesOption) {
|
|
@@ -370,7 +429,12 @@ export async function extractValidCandidates(options?: ExtractValidCandidatesOpt
|
|
|
370
429
|
const candidateCache = designSystemCandidateCache.get(candidateCacheKey) ?? new Map<string, boolean>()
|
|
371
430
|
designSystemCandidateCache.set(candidateCacheKey, candidateCache)
|
|
372
431
|
|
|
373
|
-
const candidates = await extractRawCandidates(
|
|
432
|
+
const candidates = await extractRawCandidates(
|
|
433
|
+
sources,
|
|
434
|
+
providedOptions.bareArbitraryValues === undefined
|
|
435
|
+
? undefined
|
|
436
|
+
: { bareArbitraryValues: providedOptions.bareArbitraryValues },
|
|
437
|
+
)
|
|
374
438
|
const inlineSources = extractTailwindV4InlineSourceCandidates(css)
|
|
375
439
|
for (const candidate of inlineSources.included) {
|
|
376
440
|
candidates.push(candidate)
|
package/src/index.bundle.ts
CHANGED
|
@@ -1,48 +1,7 @@
|
|
|
1
|
-
import type { TailwindcssMangleConfig } from '@tailwindcss-mangle/config'
|
|
2
1
|
import type { CAC } from 'cac'
|
|
3
2
|
import type { TailwindcssPatchCliMountOptions, TailwindcssPatchCliOptions } from './commands/types'
|
|
4
3
|
|
|
5
4
|
import { createRequire } from 'node:module'
|
|
6
|
-
import { TailwindcssPatcher } from './api/tailwindcss-patcher'
|
|
7
|
-
import { CacheStore } from './cache/store'
|
|
8
|
-
import {
|
|
9
|
-
migrateConfigFiles,
|
|
10
|
-
MIGRATION_REPORT_KIND,
|
|
11
|
-
MIGRATION_REPORT_SCHEMA_VERSION,
|
|
12
|
-
restoreConfigFiles,
|
|
13
|
-
} from './commands/migrate-config'
|
|
14
|
-
import { tailwindcssPatchCommands } from './commands/types'
|
|
15
|
-
import {
|
|
16
|
-
VALIDATE_EXIT_CODES,
|
|
17
|
-
VALIDATE_FAILURE_REASONS,
|
|
18
|
-
ValidateCommandError,
|
|
19
|
-
} from './commands/validate'
|
|
20
|
-
import { normalizeOptions } from './config'
|
|
21
|
-
import {
|
|
22
|
-
extractProjectCandidatesWithPositions,
|
|
23
|
-
extractRawCandidates,
|
|
24
|
-
extractRawCandidatesWithPositions,
|
|
25
|
-
extractSourceCandidates,
|
|
26
|
-
extractSourceCandidatesWithPositions,
|
|
27
|
-
extractValidCandidates,
|
|
28
|
-
groupTokensByFile,
|
|
29
|
-
resolveProjectSourceFiles,
|
|
30
|
-
} from './extraction/candidate-extractor'
|
|
31
|
-
import {
|
|
32
|
-
collectClassesFromContexts,
|
|
33
|
-
collectClassesFromTailwindV4,
|
|
34
|
-
getPatchStatusReport,
|
|
35
|
-
loadRuntimeContexts,
|
|
36
|
-
runTailwindBuild,
|
|
37
|
-
} from './install'
|
|
38
|
-
import logger from './logger'
|
|
39
|
-
import {
|
|
40
|
-
createTailwindV4Engine,
|
|
41
|
-
loadTailwindV4DesignSystem,
|
|
42
|
-
resolveTailwindV4Source,
|
|
43
|
-
resolveTailwindV4SourceFromPatchOptions,
|
|
44
|
-
resolveValidTailwindV4Candidates,
|
|
45
|
-
} from './v4'
|
|
46
5
|
|
|
47
6
|
const require = createRequire(import.meta.url)
|
|
48
7
|
|
|
@@ -52,73 +11,7 @@ function loadCliModule(): CliModule {
|
|
|
52
11
|
return require('./commands/cli-runtime.js') as CliModule
|
|
53
12
|
}
|
|
54
13
|
|
|
55
|
-
export
|
|
56
|
-
CacheStore,
|
|
57
|
-
collectClassesFromContexts,
|
|
58
|
-
collectClassesFromTailwindV4,
|
|
59
|
-
createTailwindV4Engine,
|
|
60
|
-
extractProjectCandidatesWithPositions,
|
|
61
|
-
extractRawCandidates,
|
|
62
|
-
extractRawCandidatesWithPositions,
|
|
63
|
-
extractSourceCandidates,
|
|
64
|
-
extractSourceCandidatesWithPositions,
|
|
65
|
-
extractValidCandidates,
|
|
66
|
-
getPatchStatusReport,
|
|
67
|
-
groupTokensByFile,
|
|
68
|
-
loadRuntimeContexts,
|
|
69
|
-
loadTailwindV4DesignSystem,
|
|
70
|
-
logger,
|
|
71
|
-
migrateConfigFiles,
|
|
72
|
-
MIGRATION_REPORT_KIND,
|
|
73
|
-
MIGRATION_REPORT_SCHEMA_VERSION,
|
|
74
|
-
normalizeOptions,
|
|
75
|
-
resolveTailwindV4Source,
|
|
76
|
-
resolveTailwindV4SourceFromPatchOptions,
|
|
77
|
-
resolveProjectSourceFiles,
|
|
78
|
-
resolveValidTailwindV4Candidates,
|
|
79
|
-
restoreConfigFiles,
|
|
80
|
-
runTailwindBuild,
|
|
81
|
-
tailwindcssPatchCommands,
|
|
82
|
-
TailwindcssPatcher,
|
|
83
|
-
VALIDATE_EXIT_CODES,
|
|
84
|
-
VALIDATE_FAILURE_REASONS,
|
|
85
|
-
ValidateCommandError,
|
|
86
|
-
}
|
|
87
|
-
export type {
|
|
88
|
-
ConfigFileMigrationEntry,
|
|
89
|
-
ConfigFileMigrationReport,
|
|
90
|
-
MigrateConfigFilesOptions,
|
|
91
|
-
RestoreConfigFilesOptions,
|
|
92
|
-
RestoreConfigFilesResult,
|
|
93
|
-
} from './commands/migrate-config'
|
|
94
|
-
export type {
|
|
95
|
-
TailwindcssPatchCliMountOptions,
|
|
96
|
-
TailwindcssPatchCliOptions,
|
|
97
|
-
TailwindcssPatchCommand,
|
|
98
|
-
TailwindcssPatchCommandContext,
|
|
99
|
-
TailwindcssPatchCommandHandler,
|
|
100
|
-
TailwindcssPatchCommandHandlerMap,
|
|
101
|
-
TailwindcssPatchCommandOptionDefinition,
|
|
102
|
-
TailwindcssPatchCommandOptions,
|
|
103
|
-
} from './commands/types'
|
|
104
|
-
export type {
|
|
105
|
-
ValidateFailureReason,
|
|
106
|
-
ValidateFailureSummary,
|
|
107
|
-
ValidateJsonFailurePayload,
|
|
108
|
-
ValidateJsonSuccessPayload,
|
|
109
|
-
} from './commands/validate'
|
|
110
|
-
export type { TailwindCssPatchOptions } from './config'
|
|
111
|
-
export * from './types'
|
|
112
|
-
export type {
|
|
113
|
-
TailwindV4CandidateSource,
|
|
114
|
-
TailwindV4CssSource,
|
|
115
|
-
TailwindV4DesignSystem,
|
|
116
|
-
TailwindV4Engine,
|
|
117
|
-
TailwindV4GenerateOptions,
|
|
118
|
-
TailwindV4GenerateResult,
|
|
119
|
-
TailwindV4ResolvedSource,
|
|
120
|
-
TailwindV4SourceOptions,
|
|
121
|
-
} from './v4'
|
|
14
|
+
export * from './public-api'
|
|
122
15
|
|
|
123
16
|
export function mountTailwindcssPatchCommands(cli: CAC, options: TailwindcssPatchCliMountOptions = {}) {
|
|
124
17
|
return loadCliModule().mountTailwindcssPatchCommands(cli, options)
|
|
@@ -127,7 +20,3 @@ export function mountTailwindcssPatchCommands(cli: CAC, options: TailwindcssPatc
|
|
|
127
20
|
export function createTailwindcssPatchCli(options: TailwindcssPatchCliOptions = {}) {
|
|
128
21
|
return loadCliModule().createTailwindcssPatchCli(options)
|
|
129
22
|
}
|
|
130
|
-
|
|
131
|
-
export function defineConfig<T extends TailwindcssMangleConfig>(config: T): T {
|
|
132
|
-
return config
|
|
133
|
-
}
|
package/src/index.ts
CHANGED
|
@@ -1,104 +1,5 @@
|
|
|
1
|
-
import type { TailwindcssMangleConfig } from '@tailwindcss-mangle/config'
|
|
2
|
-
|
|
3
|
-
export { TailwindcssPatcher } from './api/tailwindcss-patcher'
|
|
4
|
-
export { CacheStore } from './cache/store'
|
|
5
1
|
export {
|
|
6
2
|
createTailwindcssPatchCli,
|
|
7
3
|
mountTailwindcssPatchCommands,
|
|
8
|
-
type TailwindcssPatchCliMountOptions,
|
|
9
|
-
type TailwindcssPatchCliOptions,
|
|
10
|
-
type TailwindcssPatchCommand,
|
|
11
|
-
type TailwindcssPatchCommandContext,
|
|
12
|
-
type TailwindcssPatchCommandHandler,
|
|
13
|
-
type TailwindcssPatchCommandHandlerMap,
|
|
14
|
-
type TailwindcssPatchCommandOptionDefinition,
|
|
15
|
-
type TailwindcssPatchCommandOptions,
|
|
16
|
-
tailwindcssPatchCommands,
|
|
17
|
-
VALIDATE_EXIT_CODES,
|
|
18
|
-
VALIDATE_FAILURE_REASONS,
|
|
19
|
-
ValidateCommandError,
|
|
20
|
-
type ValidateFailureReason,
|
|
21
|
-
type ValidateFailureSummary,
|
|
22
|
-
type ValidateJsonFailurePayload,
|
|
23
|
-
type ValidateJsonSuccessPayload,
|
|
24
4
|
} from './commands/cli'
|
|
25
|
-
export
|
|
26
|
-
type ConfigFileMigrationEntry,
|
|
27
|
-
type ConfigFileMigrationReport,
|
|
28
|
-
migrateConfigFiles,
|
|
29
|
-
type MigrateConfigFilesOptions,
|
|
30
|
-
MIGRATION_REPORT_KIND,
|
|
31
|
-
MIGRATION_REPORT_SCHEMA_VERSION,
|
|
32
|
-
restoreConfigFiles,
|
|
33
|
-
type RestoreConfigFilesOptions,
|
|
34
|
-
type RestoreConfigFilesResult,
|
|
35
|
-
} from './commands/migrate-config'
|
|
36
|
-
export { normalizeOptions } from './config'
|
|
37
|
-
export type { TailwindCssPatchOptions } from './config'
|
|
38
|
-
export {
|
|
39
|
-
extractProjectCandidatesWithPositions,
|
|
40
|
-
extractRawCandidates,
|
|
41
|
-
extractRawCandidatesWithPositions,
|
|
42
|
-
extractSourceCandidates,
|
|
43
|
-
extractSourceCandidatesWithPositions,
|
|
44
|
-
extractValidCandidates,
|
|
45
|
-
groupTokensByFile,
|
|
46
|
-
resolveProjectSourceFiles,
|
|
47
|
-
type ExtractSourceCandidate,
|
|
48
|
-
} from './extraction/candidate-extractor'
|
|
49
|
-
export {
|
|
50
|
-
isValidCandidateToken,
|
|
51
|
-
splitCandidateTokens,
|
|
52
|
-
validateCandidateTokenRE,
|
|
53
|
-
} from './extraction/split-candidate-tokens'
|
|
54
|
-
export {
|
|
55
|
-
collectClassesFromContexts,
|
|
56
|
-
collectClassesFromTailwindV4,
|
|
57
|
-
getPatchStatusReport,
|
|
58
|
-
loadRuntimeContexts,
|
|
59
|
-
runTailwindBuild,
|
|
60
|
-
} from './install'
|
|
61
|
-
export { default as logger } from './logger'
|
|
62
|
-
export * from './types'
|
|
63
|
-
export {
|
|
64
|
-
createTailwindV4CompiledSourceEntries,
|
|
65
|
-
createTailwindV4Engine,
|
|
66
|
-
createTailwindV4DefaultIgnoreSources,
|
|
67
|
-
createTailwindV4RootSources,
|
|
68
|
-
createTailwindV4SourceEntryMatcher,
|
|
69
|
-
createTailwindV4SourceExclusionMatcher,
|
|
70
|
-
expandTailwindV4SourceEntries,
|
|
71
|
-
expandTailwindV4SourceEntryBraces,
|
|
72
|
-
isFileExcludedByTailwindV4SourceEntries,
|
|
73
|
-
isFileMatchedByTailwindV4SourceEntries,
|
|
74
|
-
loadTailwindV4DesignSystem,
|
|
75
|
-
mergeTailwindV4SourceEntries,
|
|
76
|
-
normalizeTailwindV4ScannerSources,
|
|
77
|
-
normalizeTailwindV4SourceEntries,
|
|
78
|
-
resolveSourceScanPath,
|
|
79
|
-
resolveTailwindV4Source,
|
|
80
|
-
resolveTailwindV4SourceBaseCandidates,
|
|
81
|
-
resolveTailwindV4SourceEntry,
|
|
82
|
-
resolveTailwindV4SourceFromPatchOptions,
|
|
83
|
-
resolveValidTailwindV4Candidates,
|
|
84
|
-
TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN,
|
|
85
|
-
TAILWIND_V4_IGNORED_CONTENT_DIRS,
|
|
86
|
-
TAILWIND_V4_IGNORED_EXTENSIONS,
|
|
87
|
-
TAILWIND_V4_IGNORED_FILES,
|
|
88
|
-
} from './v4'
|
|
89
|
-
export type {
|
|
90
|
-
TailwindV4CandidateSource,
|
|
91
|
-
TailwindV4CompiledSourceRoot,
|
|
92
|
-
TailwindV4CssSource,
|
|
93
|
-
TailwindV4DesignSystem,
|
|
94
|
-
TailwindV4Engine,
|
|
95
|
-
TailwindV4GenerateOptions,
|
|
96
|
-
TailwindV4GenerateResult,
|
|
97
|
-
TailwindV4ResolvedSource,
|
|
98
|
-
TailwindV4SourceOptions,
|
|
99
|
-
TailwindV4SourcePattern,
|
|
100
|
-
} from './v4'
|
|
101
|
-
|
|
102
|
-
export function defineConfig<T extends TailwindcssMangleConfig>(config: T): T {
|
|
103
|
-
return config
|
|
104
|
-
}
|
|
5
|
+
export * from './public-api'
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { TailwindcssMangleConfig } from '@tailwindcss-mangle/config'
|
|
2
|
+
|
|
3
|
+
export { TailwindcssPatcher } from './api/tailwindcss-patcher'
|
|
4
|
+
export { CacheStore } from './cache/store'
|
|
5
|
+
export {
|
|
6
|
+
type ConfigFileMigrationEntry,
|
|
7
|
+
type ConfigFileMigrationReport,
|
|
8
|
+
migrateConfigFiles,
|
|
9
|
+
type MigrateConfigFilesOptions,
|
|
10
|
+
MIGRATION_REPORT_KIND,
|
|
11
|
+
MIGRATION_REPORT_SCHEMA_VERSION,
|
|
12
|
+
restoreConfigFiles,
|
|
13
|
+
type RestoreConfigFilesOptions,
|
|
14
|
+
type RestoreConfigFilesResult,
|
|
15
|
+
} from './commands/migrate-config'
|
|
16
|
+
export {
|
|
17
|
+
type TailwindcssPatchCliMountOptions,
|
|
18
|
+
type TailwindcssPatchCliOptions,
|
|
19
|
+
type TailwindcssPatchCommand,
|
|
20
|
+
type TailwindcssPatchCommandContext,
|
|
21
|
+
type TailwindcssPatchCommandHandler,
|
|
22
|
+
type TailwindcssPatchCommandHandlerMap,
|
|
23
|
+
type TailwindcssPatchCommandOptionDefinition,
|
|
24
|
+
type TailwindcssPatchCommandOptions,
|
|
25
|
+
tailwindcssPatchCommands,
|
|
26
|
+
} from './commands/types'
|
|
27
|
+
export {
|
|
28
|
+
VALIDATE_EXIT_CODES,
|
|
29
|
+
VALIDATE_FAILURE_REASONS,
|
|
30
|
+
ValidateCommandError,
|
|
31
|
+
type ValidateFailureReason,
|
|
32
|
+
type ValidateFailureSummary,
|
|
33
|
+
type ValidateJsonFailurePayload,
|
|
34
|
+
type ValidateJsonSuccessPayload,
|
|
35
|
+
} from './commands/validate'
|
|
36
|
+
export { normalizeOptions } from './config'
|
|
37
|
+
export type { TailwindCssPatchOptions } from './config'
|
|
38
|
+
export {
|
|
39
|
+
extractProjectCandidatesWithPositions,
|
|
40
|
+
extractRawCandidates,
|
|
41
|
+
extractRawCandidatesWithPositions,
|
|
42
|
+
type ExtractSourceCandidate,
|
|
43
|
+
extractSourceCandidates,
|
|
44
|
+
extractSourceCandidatesWithPositions,
|
|
45
|
+
extractValidCandidates,
|
|
46
|
+
groupTokensByFile,
|
|
47
|
+
resolveProjectSourceFiles,
|
|
48
|
+
} from './extraction/candidate-extractor'
|
|
49
|
+
export {
|
|
50
|
+
isValidCandidateToken,
|
|
51
|
+
splitCandidateTokens,
|
|
52
|
+
validateCandidateTokenRE,
|
|
53
|
+
} from './extraction/split-candidate-tokens'
|
|
54
|
+
export {
|
|
55
|
+
collectClassesFromContexts,
|
|
56
|
+
collectClassesFromTailwindV4,
|
|
57
|
+
getPatchStatusReport,
|
|
58
|
+
loadRuntimeContexts,
|
|
59
|
+
runTailwindBuild,
|
|
60
|
+
} from './install'
|
|
61
|
+
export { default as logger } from './logger'
|
|
62
|
+
export * from './types'
|
|
63
|
+
export {
|
|
64
|
+
canonicalizeBareArbitraryValueCandidates,
|
|
65
|
+
createTailwindV4CompiledSourceEntries,
|
|
66
|
+
createTailwindV4DefaultIgnoreSources,
|
|
67
|
+
createTailwindV4Engine,
|
|
68
|
+
createTailwindV4RootSources,
|
|
69
|
+
createTailwindV4SourceEntryMatcher,
|
|
70
|
+
createTailwindV4SourceExclusionMatcher,
|
|
71
|
+
escapeCssClassName,
|
|
72
|
+
expandTailwindV4SourceEntries,
|
|
73
|
+
expandTailwindV4SourceEntryBraces,
|
|
74
|
+
extractBareArbitraryValueSourceCandidates,
|
|
75
|
+
extractBareArbitraryValueSourceCandidatesWithPositions,
|
|
76
|
+
isFileExcludedByTailwindV4SourceEntries,
|
|
77
|
+
isFileMatchedByTailwindV4SourceEntries,
|
|
78
|
+
isBareArbitraryValuesEnabled,
|
|
79
|
+
loadTailwindV4DesignSystem,
|
|
80
|
+
mergeTailwindV4SourceEntries,
|
|
81
|
+
normalizeTailwindV4ScannerSources,
|
|
82
|
+
normalizeTailwindV4SourceEntries,
|
|
83
|
+
resolveSourceScanPath,
|
|
84
|
+
replaceBareArbitraryValueSelectors,
|
|
85
|
+
resolveBareArbitraryValueCandidate,
|
|
86
|
+
resolveTailwindV4Source,
|
|
87
|
+
resolveTailwindV4SourceBaseCandidates,
|
|
88
|
+
resolveTailwindV4SourceEntry,
|
|
89
|
+
resolveTailwindV4SourceFromPatchOptions,
|
|
90
|
+
resolveValidTailwindV4Candidates,
|
|
91
|
+
TAILWIND_V4_AUTO_SOURCE_SCAN_PATTERN,
|
|
92
|
+
TAILWIND_V4_IGNORED_CONTENT_DIRS,
|
|
93
|
+
TAILWIND_V4_IGNORED_EXTENSIONS,
|
|
94
|
+
TAILWIND_V4_IGNORED_FILES,
|
|
95
|
+
} from './v4'
|
|
96
|
+
export type {
|
|
97
|
+
TailwindV4CandidateSource,
|
|
98
|
+
TailwindV4CompiledSourceRoot,
|
|
99
|
+
TailwindV4CssSource,
|
|
100
|
+
TailwindV4DesignSystem,
|
|
101
|
+
TailwindV4Engine,
|
|
102
|
+
TailwindV4GenerateOptions,
|
|
103
|
+
TailwindV4GenerateResult,
|
|
104
|
+
TailwindV4ResolvedSource,
|
|
105
|
+
TailwindV4SourceOptions,
|
|
106
|
+
TailwindV4SourcePattern,
|
|
107
|
+
} from './v4'
|
|
108
|
+
|
|
109
|
+
export function defineConfig<T extends TailwindcssMangleConfig>(config: T): T {
|
|
110
|
+
return config
|
|
111
|
+
}
|