Skip to content

Commit b97ebe0

Browse files
Merge branch 'main' into fix/type-only-import-detection
2 parents 61a3384 + 8fd342c commit b97ebe0

9 files changed

Lines changed: 401 additions & 292 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Issue Close Require
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
close-issues:
10+
if: github.repository == 'rolldown/tsdown'
11+
runs-on: ubuntu-latest
12+
permissions:
13+
issues: write # for actions-cool/issues-helper to update issues
14+
pull-requests: write # for actions-cool/issues-helper to update PRs
15+
steps:
16+
- name: needs reproduction
17+
uses: actions-cool/issues-helper@71b62d7da76e59ff7b193904feb6e77d4dbb2777 # v3.7.6
18+
with:
19+
actions: close-issues
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
labels: needs reproduction
22+
inactive-day: 7
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Lock Closed Issues
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
permissions:
9+
issues: write
10+
11+
jobs:
12+
action:
13+
if: github.repository == 'rolldown/tsdown'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions-cool/issues-helper@71b62d7da76e59ff7b193904feb6e77d4dbb2777 # v3.7.6
17+
with:
18+
actions: lock-issues
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
issue-state: closed
21+
inactive-day: 14

package.json

Lines changed: 4 additions & 3 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.20250601.1",
5858
"rolldown": "^1.0.0-rc.3",
59-
"typescript": "^5.0.0",
59+
"typescript": "^5.0.0 || ^6.0.0-beta",
6060
"vue-tsc": "~3.2.0"
6161
},
6262
"peerDependenciesMeta": {
@@ -104,10 +104,11 @@
104104
"rollup-plugin-dts": "^6.3.0",
105105
"tinyglobby": "^0.2.15",
106106
"tsdown": "^0.20.1",
107-
"typescript": "^5.9.3",
107+
"typescript": "6.0.0-beta",
108108
"vitest": "^4.0.18",
109109
"vue": "^3.5.27",
110-
"vue-tsc": "^3.2.4"
110+
"vue-tsc": "^3.2.4",
111+
"zod": "^4.3.6"
111112
},
112113
"resolutions": {
113114
"rolldown": "^1.0.0-rc.3"

pnpm-lock.yaml

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

src/fake-js.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,8 @@ export function createFakeJsPlugin({
723723
start: transformedDep.start,
724724
end: transformedDep.end,
725725
}
726+
} else if (isInfer(transformedDep)) {
727+
transformedDep.name = '__Infer'
726728
}
727729

728730
if (originalDep.replace) {
@@ -1352,6 +1354,9 @@ function isThisExpression(node: t.Node): boolean {
13521354
)
13531355
}
13541356

1357+
function isInfer(node: t.Node): node is t.Identifier {
1358+
return isIdentifierOf(node, 'infer')
1359+
}
13551360
function TSEntityNameToRuntime(
13561361
node: t.TSEntityName,
13571362
): t.MemberExpression | t.Identifier | t.ThisExpression {
@@ -1393,7 +1398,7 @@ function isHelperImport(node: t.Node) {
13931398
* patch `.d.ts` suffix in import source to `.js`
13941399
*/
13951400
function patchImportExport(
1396-
node: t.Node,
1401+
node: t.Statement,
13971402
typeOnlyIds: string[],
13981403
cjsDefault: boolean,
13991404
): t.Statement | false | undefined {
@@ -1407,6 +1412,14 @@ function patchImportExport(
14071412
return false
14081413
}
14091414

1415+
if (node.type === 'ImportDeclaration' && node.specifiers.length) {
1416+
for (const specifier of node.specifiers) {
1417+
if (isInfer(specifier.local)) {
1418+
specifier.local.name = '__Infer'
1419+
}
1420+
}
1421+
}
1422+
14101423
if (
14111424
isTypeOf(node, [
14121425
'ImportDeclaration',

src/tsc/volar.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import type Ts from 'typescript'
55

66
const debug = createDebug('rolldown-plugin-dts:volar')
77

8-
export function loadVueLanguageTools() {
8+
export function loadVueLanguageTools(): {
9+
volarTs: typeof import('@volar/typescript')
10+
vue: typeof import('@vue/language-core')
11+
} {
912
debug('loading vue language tools')
1013
try {
1114
const vueTscPath = require.resolve('vue-tsc')

0 commit comments

Comments
 (0)