Skip to content

Commit ff8785f

Browse files
committed
chore: fix type
1 parent 845c89e commit ff8785f

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

packages/tailwindcss-patch/src/core/patches/exportContext/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export function monkeyPatchForExposingContextV3(twDir: string, opt: InternalPatc
3636
result.plugin = code
3737
}
3838

39-
opt.custom && typeof opt.custom === 'function' && opt.custom(twDir, result)
4039
return result
4140
}
4241

@@ -69,6 +68,5 @@ export function monkeyPatchForExposingContextV2(twDir: string, opt: InternalPatc
6968
result.plugin = code
7069
}
7170

72-
opt.custom && typeof opt.custom === 'function' && opt.custom(twDir, result)
7371
return result
7472
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import { monkeyPatchForExposingContextV2, monkeyPatchForExposingContextV3, monke
55

66
import type { InternalPatchOptions } from '@/types'
77

8-
export function internalPatch(pkgJsonPath: string | undefined, options: InternalPatchOptions): any | undefined {
8+
export function internalPatch(pkgJsonPath: string | undefined, options: InternalPatchOptions) {
99
if (pkgJsonPath) {
1010
// eslint-disable-next-line ts/no-var-requires, ts/no-require-imports
1111
const pkgJson = require(pkgJsonPath) as PackageJson
1212
const twDir = path.dirname(pkgJsonPath)
13+
options.version = pkgJson.version
1314
if (gte(pkgJson.version!, '3.0.0')) {
1415
options.version = pkgJson.version
1516

@@ -29,7 +30,6 @@ export function internalPatch(pkgJsonPath: string | undefined, options: Internal
2930
}
3031
}
3132
else if (gte(pkgJson.version!, '2.0.0')) {
32-
options.version = pkgJson.version
3333
if (options.applyPatches?.exportContext) {
3434
return monkeyPatchForExposingContextV2(twDir, options)
3535
}

packages/tailwindcss-patch/src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export interface PackageInfo {
1111
}
1212

1313
export interface CacheOptions {
14-
// enable?: boolean
1514
dir?: string
1615
cwd?: string
1716
file?: string
1817
strategy?: CacheStrategy
1918
}
2019

21-
export type InternalCacheOptions = CacheOptions & { enable?: boolean }
20+
export interface InternalCacheOptions extends CacheOptions {
21+
enable?: boolean
22+
}
2223

2324
export interface PatchOptions {
2425
overwrite?: boolean
2526
paths?: string[]
2627
basedir?: string
27-
custom?: (dir: string, ctx: Record<string, any>) => void
2828
applyPatches?: {
2929
exportContext?: boolean
3030
extendLengthUnits?: boolean

packages/tailwindcss-patch/test/postcss.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import postcss from 'postcss'
33
import type { Config } from 'tailwindcss'
44
import { appRoot } from './utils'
55
import { processTailwindcss } from '@/core/postcss'
6-
import { TailwindcssPatcher } from '@/core/tw-patcher'
6+
import { TailwindcssPatcher } from '@/core/patcher'
77

88
describe('postcss', () => {
99
it('getCss 0.common', async () => {

0 commit comments

Comments
 (0)