Skip to content

Commit 1c0c8f0

Browse files
committed
feat!: require TypeScript 6 and respect default tsconfig values
BREAKING CHANGE: TypeScript 6.0 or higher is now required.
1 parent cb2e829 commit 1c0c8f0

7 files changed

Lines changed: 25 additions & 17 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@ts-macro/tsc": "^0.3.6",
5757
"@typescript/native-preview": ">=7.0.0-dev.20260325.1",
5858
"rolldown": "^1.0.0-rc.12",
59-
"typescript": "^5.0.0 || ^6.0.0",
59+
"typescript": "^6.0.0",
6060
"vue-tsc": "~3.2.0"
6161
},
6262
"peerDependenciesMeta": {
@@ -81,7 +81,7 @@
8181
"ast-kit": "^3.0.0-beta.1",
8282
"birpc": "^4.0.0",
8383
"dts-resolver": "^2.1.3",
84-
"get-tsconfig": "^4.14.0",
84+
"get-tsconfig": "^5.0.0-beta.4",
8585
"obug": "^2.1.1",
8686
"picomatch": "^4.0.4"
8787
},

pnpm-lock.yaml

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

src/internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export * from './filename.ts'
2-
export { parseTsconfig } from 'get-tsconfig'
2+
export { readTsconfig } from 'get-tsconfig'

src/options.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import path from 'node:path'
22
import process from 'node:process'
33
import {
44
getTsconfig,
5-
parseTsconfig,
6-
type TsConfigJson,
7-
type TsConfigJsonResolved,
5+
readTsconfig,
6+
type TsconfigJson,
7+
type TsconfigJsonResolved,
88
} from 'get-tsconfig'
99
import type { IsolatedDeclarationsOptions } from 'rolldown/experimental'
1010

@@ -59,14 +59,14 @@ export interface GeneralOptions {
5959
*
6060
* @see https://www.typescriptlang.org/tsconfig
6161
*/
62-
tsconfigRaw?: Omit<TsConfigJson, 'compilerOptions'>
62+
tsconfigRaw?: Omit<TsconfigJson, 'compilerOptions'>
6363

6464
/**
6565
* Override the `compilerOptions` specified in `tsconfig.json`.
6666
*
6767
* @see https://www.typescriptlang.org/tsconfig/#compilerOptions
6868
*/
69-
compilerOptions?: TsConfigJson.CompilerOptions
69+
compilerOptions?: TsconfigJson.CompilerOptions
7070

7171
/**
7272
* If `true`, the plugin will generate declaration maps (`.d.ts.map`) for `.d.ts` files.
@@ -242,7 +242,7 @@ export type OptionsResolved = Overwrite<
242242
entry?: string[]
243243
tsconfig?: string
244244
oxc: IsolatedDeclarationsOptions | false
245-
tsconfigRaw: TsConfigJson
245+
tsconfigRaw: TsconfigJson
246246
tsgo: Omit<TsgoOptions, 'enabled'> | false
247247
}
248248
>
@@ -282,14 +282,14 @@ export function resolveOptions({
282282
tsgo = false
283283
}
284284

285-
let resolvedTsconfig: TsConfigJsonResolved | undefined
285+
let resolvedTsconfig: TsconfigJsonResolved | undefined
286286
if (tsconfig === true || tsconfig == null) {
287287
const { config, path } = getTsconfig(cwd) || {}
288288
tsconfig = path
289289
resolvedTsconfig = config
290290
} else if (typeof tsconfig === 'string') {
291291
tsconfig = path.resolve(cwd || process.cwd(), tsconfig)
292-
resolvedTsconfig = parseTsconfig(tsconfig)
292+
resolvedTsconfig = readTsconfig(tsconfig).config
293293
} else {
294294
tsconfig = undefined
295295
}

src/tsc/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { TscContext } from './context.ts'
2-
import type { TsConfigJson } from 'get-tsconfig'
2+
import type { TsconfigJson } from 'get-tsconfig'
33
import type { SourceMapInput } from 'rolldown'
44
import type ts from 'typescript'
55

@@ -10,7 +10,7 @@ export interface TscModule {
1010

1111
export interface TscOptions {
1212
tsconfig?: string
13-
tsconfigRaw: TsConfigJson
13+
tsconfigRaw: TsconfigJson
1414
cwd: string
1515
build: boolean
1616
incremental: boolean

tests/fixtures/resolve-dep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export { TsConfigResult } from 'get-tsconfig'
1+
export { TsconfigResult } from 'get-tsconfig'
22
export { build } from 'rolldown'

tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test('resolve dependencies', async () => {
3434
],
3535
{ external: ['rolldown'] },
3636
)
37-
expect(snapshot).contain('type TsConfigResult')
37+
expect(snapshot).contain('type TsconfigResult')
3838
expect(snapshot).not.contain('node_modules/rolldown')
3939
})
4040

0 commit comments

Comments
 (0)