Skip to content

Commit b1db66a

Browse files
committed
chore(deps): upgrade to TypeScript 5.6
1 parent e596378 commit b1db66a

File tree

18 files changed

+155
-106
lines changed

18 files changed

+155
-106
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"dev": "node scripts/dev.js",
88
"build": "node scripts/build.js",
9-
"build-dts": "tsc -p tsconfig.build-browser.json && tsc -p tsconfig.build-node.json && rollup -c rollup.dts.config.js",
9+
"build-dts": "tsc -p tsconfig.build.json --noCheck && rollup -c rollup.dts.config.js",
1010
"clean": "rimraf --glob packages/*/dist temp .eslintcache",
1111
"size": "run-s \"size-*\" && tsx scripts/usage-size.ts",
1212
"size-global": "node scripts/build.js vue runtime-dom -f global -p --size",
@@ -105,7 +105,7 @@
105105
"todomvc-app-css": "^2.4.3",
106106
"tslib": "^2.7.0",
107107
"tsx": "^4.19.0",
108-
"typescript": "~5.5.4",
108+
"typescript": "~5.6.2",
109109
"typescript-eslint": "^8.4.0",
110110
"vite": "catalog:",
111111
"vitest": "^2.0.5"

packages-private/tsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"isolatedDeclarations": false
5+
},
6+
"include": ["."]
7+
}

packages/compiler-core/__tests__/testUtils.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import {
33
ElementTypes,
44
Namespaces,
55
NodeTypes,
6+
type Property,
7+
type SimpleExpressionNode,
68
type VNodeCall,
79
locStub,
810
} from '../src'
@@ -22,7 +24,10 @@ const bracketsRE = /^\[|\]$/g
2224
// e.g.
2325
// - createObjectMatcher({ 'foo': '[bar]' }) matches { foo: bar }
2426
// - createObjectMatcher({ '[foo]': 'bar' }) matches { [foo]: "bar" }
25-
export function createObjectMatcher(obj: Record<string, any>) {
27+
export function createObjectMatcher(obj: Record<string, any>): {
28+
type: NodeTypes
29+
properties: Partial<Property>[]
30+
} {
2631
return {
2732
type: NodeTypes.JS_OBJECT_EXPRESSION,
2833
properties: Object.keys(obj).map(key => ({
@@ -31,7 +36,7 @@ export function createObjectMatcher(obj: Record<string, any>) {
3136
type: NodeTypes.SIMPLE_EXPRESSION,
3237
content: key.replace(bracketsRE, ''),
3338
isStatic: !leadingBracketRE.test(key),
34-
},
39+
} as SimpleExpressionNode,
3540
value: isString(obj[key])
3641
? {
3742
type: NodeTypes.SIMPLE_EXPRESSION,
@@ -78,7 +83,7 @@ type Flags = PatchFlags | ShapeFlags
7883
export function genFlagText(
7984
flag: Flags | Flags[],
8085
names: { [k: number]: string } = PatchFlagNames,
81-
) {
86+
): string {
8287
if (isArray(flag)) {
8388
let f = 0
8489
flag.forEach(ff => {

packages/compiler-core/__tests__/transforms/vFor.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
type ForNode,
1414
type InterpolationNode,
1515
NodeTypes,
16+
type RootNode,
1617
type SimpleExpressionNode,
1718
} from '../../src/ast'
1819
import { ErrorCodes } from '../../src/errors'
@@ -24,7 +25,10 @@ import { createObjectMatcher } from '../testUtils'
2425
export function parseWithForTransform(
2526
template: string,
2627
options: CompilerOptions = {},
27-
) {
28+
): {
29+
root: RootNode
30+
node: ForNode & { codegenNode: ForCodegenNode }
31+
} {
2832
const ast = parse(template, options)
2933
transform(ast, {
3034
nodeTransforms: [

packages/compiler-sfc/__tests__/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
type SFCParseOptions,
3+
type SFCScriptBlock,
34
type SFCScriptCompileOptions,
45
compileScript,
56
parse,
@@ -12,7 +13,7 @@ export function compileSFCScript(
1213
src: string,
1314
options?: Partial<SFCScriptCompileOptions>,
1415
parseOptions?: SFCParseOptions,
15-
) {
16+
): SFCScriptBlock {
1617
const { descriptor, errors } = parse(src, parseOptions)
1718
if (errors.length) {
1819
console.warn(errors[0])
@@ -23,7 +24,7 @@ export function compileSFCScript(
2324
})
2425
}
2526

26-
export function assertCode(code: string) {
27+
export function assertCode(code: string): void {
2728
// parse the generated code to make sure it is valid
2829
try {
2930
babelParse(code, {

packages/runtime-core/src/components/KeepAlive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ const KeepAliveImpl: ComponentOptions = {
350350
keys.add(key)
351351
// prune oldest entry
352352
if (max && keys.size > parseInt(max as string, 10)) {
353-
pruneCacheEntry(keys.values().next().value)
353+
pruneCacheEntry(keys.values().next().value!)
354354
}
355355
}
356356
// avoid vnode being unmounted

packages/runtime-test/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const render = baseRender as RootRenderFunction<TestElement>
1717
export const createApp = baseCreateApp as CreateAppFunction<TestElement>
1818

1919
// convenience for one-off render validations
20-
export function renderToString(vnode: VNode) {
20+
export function renderToString(vnode: VNode): string {
2121
const root = nodeOps.createElement('div')
2222
render(vnode, root)
2323
return serializeInner(root)

packages/runtime-test/src/nodeOps.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export interface NodeOp {
5757
let nodeId: number = 0
5858
let recordedNodeOps: NodeOp[] = []
5959

60-
export function logNodeOp(op: NodeOp) {
60+
export function logNodeOp(op: NodeOp): void {
6161
recordedNodeOps.push(op)
6262
}
6363

64-
export function resetOps() {
64+
export function resetOps(): void {
6565
recordedNodeOps = []
6666
}
6767

@@ -128,7 +128,7 @@ function createComment(text: string): TestComment {
128128
return node
129129
}
130130

131-
function setText(node: TestText, text: string) {
131+
function setText(node: TestText, text: string): void {
132132
logNodeOp({
133133
type: NodeOpTypes.SET_TEXT,
134134
targetNode: node,
@@ -137,7 +137,11 @@ function setText(node: TestText, text: string) {
137137
node.text = text
138138
}
139139

140-
function insert(child: TestNode, parent: TestElement, ref?: TestNode | null) {
140+
function insert(
141+
child: TestNode,
142+
parent: TestElement,
143+
ref?: TestNode | null,
144+
): void {
141145
let refIndex
142146
if (ref) {
143147
refIndex = parent.children.indexOf(ref)
@@ -166,7 +170,7 @@ function insert(child: TestNode, parent: TestElement, ref?: TestNode | null) {
166170
}
167171
}
168172

169-
function remove(child: TestNode, logOp = true) {
173+
function remove(child: TestNode, logOp = true): void {
170174
const parent = child.parentNode
171175
if (parent) {
172176
if (logOp) {
@@ -188,7 +192,7 @@ function remove(child: TestNode, logOp = true) {
188192
}
189193
}
190194

191-
function setElementText(el: TestElement, text: string) {
195+
function setElementText(el: TestElement, text: string): void {
192196
logNodeOp({
193197
type: NodeOpTypes.SET_ELEMENT_TEXT,
194198
targetNode: el,
@@ -228,11 +232,23 @@ function querySelector(): never {
228232
throw new Error('querySelector not supported in test renderer.')
229233
}
230234

231-
function setScopeId(el: TestElement, id: string) {
235+
function setScopeId(el: TestElement, id: string): void {
232236
el.props[id] = ''
233237
}
234238

235-
export const nodeOps = {
239+
export const nodeOps: {
240+
insert: typeof insert
241+
remove: typeof remove
242+
createElement: typeof createElement
243+
createText: typeof createText
244+
createComment: typeof createComment
245+
setText: typeof setText
246+
setElementText: typeof setElementText
247+
parentNode: typeof parentNode
248+
nextSibling: typeof nextSibling
249+
querySelector: typeof querySelector
250+
setScopeId: typeof setScopeId
251+
} = {
236252
insert,
237253
remove,
238254
createElement,

packages/runtime-test/src/patchProp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function patchProp(
66
key: string,
77
prevValue: any,
88
nextValue: any,
9-
) {
9+
): void {
1010
logNodeOp({
1111
type: NodeOpTypes.PATCH,
1212
targetNode: el,

packages/runtime-test/src/serialize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function serializeInner(
2323
node: TestElement,
2424
indent: number = 0,
2525
depth: number = 0,
26-
) {
26+
): string {
2727
const newLine = indent ? `\n` : ``
2828
return node.children.length
2929
? newLine +

0 commit comments

Comments
 (0)