Skip to content

Commit b6b84f4

Browse files
committed
chore: bump version
1 parent 3db4448 commit b6b84f4

File tree

8 files changed

+88
-77
lines changed

8 files changed

+88
-77
lines changed

.changeset/full-pears-beg.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"tailwindcss-patch": patch
3+
"@tailwindcss-mangle/config": patch
4+
"@tailwindcss-mangle/core": patch
5+
"@tailwindcss-mangle/shared": patch
6+
"unplugin-tailwindcss-mangle": patch
7+
---
8+
9+
chore(patch): add TailwindcssPatcher extract option
10+
11+
chore(deps): upgrade

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "4.0.0",
55
"private": true,
6-
"packageManager": "pnpm@10.5.2",
6+
"packageManager": "pnpm@10.13.1",
77
"engines": {
88
"node": ">=18.0.0"
99
},
@@ -38,7 +38,7 @@
3838
"@commitlint/config-conventional": "^19.8.1",
3939
"@commitlint/prompt-cli": "^19.8.1",
4040
"@commitlint/types": "^19.8.1",
41-
"@icebreakers/eslint-config": "^1.2.4",
41+
"@icebreakers/eslint-config": "^1.2.5",
4242
"@icebreakers/monorepo": "^1.0.7",
4343
"@icebreakers/stylelint-config": "^1.1.1",
4444
"@rollup/pluginutils": "^5.2.0",
@@ -50,7 +50,6 @@
5050
"@types/babel__traverse": "^7.20.7",
5151
"@types/fs-extra": "^11.0.4",
5252
"@types/get-value": "^3.0.5",
53-
"@types/git-url-parse": "^16.0.2",
5453
"@types/html-minifier-terser": "^7.0.2",
5554
"@types/klaw": "^3.0.7",
5655
"@types/lint-staged": "^13.3.0",
@@ -100,7 +99,7 @@
10099
"rimraf": "^6.0.1",
101100
"rollup": "^4.45.1",
102101
"set-value": "^4.1.0",
103-
"tailwindcss": "^3.4.17",
102+
"tailwindcss": "catalog:tailwindcss3",
104103
"tailwindcss-patch": "workspace:*",
105104
"tailwindcss2": "npm:@tailwindcss/postcss7-compat@^2.2.17",
106105
"tslib": "^2.8.1",

packages/tailwindcss-patch/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
"@tailwindcss/oxide": "^4.1.11",
9393
"@tailwindcss/postcss": "^4.1.11",
9494
"@tailwindcss/vite": "^4.1.11",
95-
"tailwindcss": "^4.1.1",
96-
"tailwindcss-3": "npm:tailwindcss@^3",
97-
"tailwindcss-4": "npm:tailwindcss@^4.1.1"
95+
"tailwindcss": "catalog:tailwindcss4",
96+
"tailwindcss-3": "catalog:tailwindcss3",
97+
"tailwindcss-4": "catalog:tailwindcss4"
9898
}
9999
}

packages/tailwindcss-patch/src/core/patcher.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { PackageInfo } from 'local-pkg'
22
import type { InternalCacheOptions, InternalPatchOptions, TailwindcssClassCache, TailwindcssPatcherOptions, TailwindcssRuntimeContext } from '../types'
33
import { createRequire } from 'node:module'
44
import process from 'node:process'
5+
import { defu } from '@tailwindcss-mangle/shared'
56
import fs from 'fs-extra'
67
import { getPackageInfoSync } from 'local-pkg'
78
import path from 'pathe'
@@ -13,6 +14,10 @@ import { extractValidCandidates } from './candidates'
1314
import { processTailwindcss } from './postcss'
1415
import { internalPatch } from './runtime'
1516

17+
export interface PatchExtractOptions {
18+
write?: boolean
19+
}
20+
1621
const require = createRequire(import.meta.url)
1722
export class TailwindcssPatcher {
1823
public rawOptions: TailwindcssPatcherOptions
@@ -226,27 +231,31 @@ export class TailwindcssPatcher {
226231
return set
227232
}
228233

229-
async extract() {
234+
async extract(options?: PatchExtractOptions) {
235+
const { write } = defu<PatchExtractOptions, PatchExtractOptions[]>(options, { write: true })
230236
const { output, tailwindcss } = this.patchOptions
231237
if (output && tailwindcss) {
232238
const { filename, loose } = output
233-
239+
// tailwindcss v2 + v3
234240
if (this.majorVersion === 3 || this.majorVersion === 2) {
235241
await processTailwindcss({
236242
...tailwindcss,
237243
majorVersion: this.majorVersion,
238244
})
239245
}
240246

241-
const set = await this.getClassSet()
247+
const classSet = await this.getClassSet()
242248
if (filename) {
243-
const classList = [...set]
244-
await fs.outputJSON(filename, classList, {
245-
spaces: loose ? 2 : undefined,
246-
})
249+
const classList = [...classSet]
250+
if (write) {
251+
await fs.outputJSON(filename, classList, {
252+
spaces: loose ? 2 : undefined,
253+
})
254+
}
247255
return {
248256
filename,
249257
classList,
258+
classSet,
250259
}
251260
}
252261
}

pnpm-lock.yaml

Lines changed: 46 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)