Skip to content

Commit 7454e2a

Browse files
committed
build(deps): upgrade to TypeScript 4
1 parent 91700fb commit 7454e2a

File tree

9 files changed

+60
-36
lines changed

9 files changed

+60
-36
lines changed

package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,21 @@
4343
},
4444
"devDependencies": {
4545
"@ls-lint/ls-lint": "^1.8.0",
46-
"@microsoft/api-extractor": "^7.3.9",
46+
"@microsoft/api-extractor": "^7.9.7",
4747
"@rollup/plugin-commonjs": "^13.0.0",
4848
"@rollup/plugin-json": "^4.0.0",
4949
"@rollup/plugin-node-resolve": "^8.0.0",
5050
"@rollup/plugin-replace": "^2.2.1",
5151
"@types/jest": "^26.0.0",
5252
"@types/node": "13.11.1",
5353
"@types/puppeteer": "^2.0.0",
54-
"@typescript-eslint/parser": "^3.2.0",
54+
"@typescript-eslint/parser": "^3.9.1",
5555
"brotli": "^1.3.2",
5656
"chalk": "^4.1.0",
5757
"conventional-changelog-cli": "^2.0.31",
5858
"csstype": "^2.6.8",
5959
"enquirer": "^2.3.2",
60-
"eslint": "^7.2.0",
60+
"eslint": "^7.7.0",
6161
"execa": "^4.0.2",
6262
"fs-extra": "^9.0.1",
6363
"jest": "^26.0.1",
@@ -70,11 +70,11 @@
7070
"rollup-plugin-node-builtins": "^2.1.2",
7171
"rollup-plugin-node-globals": "^1.4.0",
7272
"rollup-plugin-terser": "^6.1.0",
73-
"rollup-plugin-typescript2": "^0.27.1",
73+
"rollup-plugin-typescript2": "^0.27.2",
7474
"semver": "^7.3.2",
7575
"serve": "^11.3.0",
76-
"ts-jest": "^26.1.0",
77-
"typescript": "^3.9.3",
76+
"ts-jest": "^26.2.0",
77+
"typescript": "^4.0.2",
7878
"yorkie": "^2.0.0"
7979
}
8080
}

packages/compiler-sfc/src/parse.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function parse(
176176
`its syntax will be ambiguous outside of the component.`
177177
)
178178
)
179-
delete descriptor.scriptSetup
179+
descriptor.scriptSetup = null
180180
}
181181
if (descriptor.script && descriptor.script.src) {
182182
errors.push(
@@ -185,7 +185,7 @@ export function parse(
185185
`also present because they must be processed together.`
186186
)
187187
)
188-
delete descriptor.script
188+
descriptor.script = null
189189
}
190190
}
191191

packages/reactivity/__tests__/effect.spec.ts

+7
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ describe('reactivity/effect', () => {
6666
effect(() => (dummy = obj.prop))
6767

6868
expect(dummy).toBe('value')
69+
// @ts-ignore
6970
delete obj.prop
7071
expect(dummy).toBe(undefined)
7172
})
@@ -76,6 +77,7 @@ describe('reactivity/effect', () => {
7677
effect(() => (dummy = 'prop' in obj))
7778

7879
expect(dummy).toBe(true)
80+
// @ts-ignore
7981
delete obj.prop
8082
expect(dummy).toBe(false)
8183
obj.prop = 12
@@ -90,6 +92,7 @@ describe('reactivity/effect', () => {
9092
effect(() => (dummy = counter.num))
9193

9294
expect(dummy).toBe(0)
95+
// @ts-ignore
9396
delete counter.num
9497
expect(dummy).toBe(2)
9598
parentCounter.num = 4
@@ -106,8 +109,10 @@ describe('reactivity/effect', () => {
106109
effect(() => (dummy = 'num' in counter))
107110

108111
expect(dummy).toBe(true)
112+
// @ts-ignore
109113
delete counter.num
110114
expect(dummy).toBe(true)
115+
// @ts-ignore
111116
delete parentCounter.num
112117
expect(dummy).toBe(false)
113118
counter.num = 3
@@ -219,6 +224,7 @@ describe('reactivity/effect', () => {
219224
expect(hasDummy).toBe(true)
220225
obj[key] = 'newValue'
221226
expect(dummy).toBe('newValue')
227+
// @ts-ignore
222228
delete obj[key]
223229
expect(dummy).toBe(undefined)
224230
expect(hasDummy).toBe(false)
@@ -648,6 +654,7 @@ describe('reactivity/effect', () => {
648654
newValue: 2
649655
})
650656

657+
// @ts-ignore
651658
delete obj.foo
652659
expect(dummy).toBeUndefined()
653660
expect(onTrigger).toHaveBeenCalledTimes(2)

packages/reactivity/__tests__/readonly.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,21 @@ describe('reactivity/readonly', () => {
6868
`Set operation on key "Symbol(qux)" failed: target is readonly.`
6969
).toHaveBeenWarnedLast()
7070

71+
// @ts-ignore
7172
delete wrapped.foo
7273
expect(wrapped.foo).toBe(1)
7374
expect(
7475
`Delete operation on key "foo" failed: target is readonly.`
7576
).toHaveBeenWarnedLast()
7677

78+
// @ts-ignore
7779
delete wrapped.bar.baz
7880
expect(wrapped.bar.baz).toBe(2)
7981
expect(
8082
`Delete operation on key "baz" failed: target is readonly.`
8183
).toHaveBeenWarnedLast()
8284

85+
// @ts-ignore
8386
delete wrapped[qux]
8487
expect(wrapped[qux]).toBe(3)
8588
expect(

packages/runtime-core/__tests__/apiLifecycle.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ describe('api: lifecycle hooks', () => {
356356
newValue: 2
357357
})
358358

359+
// @ts-ignore
359360
delete obj.bar
360361
await nextTick()
361362
expect(onTrigger).toHaveBeenCalledTimes(2)

packages/runtime-core/__tests__/apiWatch.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ describe('api: watch', () => {
707707
newValue: 2
708708
})
709709

710+
// @ts-ignore
710711
delete obj.foo
711712
await nextTick()
712713
expect(dummy).toBeUndefined()

packages/runtime-core/src/apiCreateApp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export function createAppAPI<HostElement>(
258258
},
259259

260260
provide(key, value) {
261-
if (__DEV__ && key in context.provides) {
261+
if (__DEV__ && (key as string | symbol) in context.provides) {
262262
warn(
263263
`App already provides property with key "${String(key)}". ` +
264264
`It will be overwritten with the new value.`

packages/runtime-core/src/apiInject.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function inject(
3737
const instance = currentInstance || currentRenderingInstance
3838
if (instance) {
3939
const provides = instance.provides
40-
if (key in provides) {
40+
if ((key as string | symbol) in provides) {
4141
// TS doesn't allow symbol as index type
4242
return provides[key as string]
4343
} else if (arguments.length > 1) {

yarn.lock

+38-26
Original file line numberDiff line numberDiff line change
@@ -570,23 +570,23 @@
570570
resolved "https://registry.yarnpkg.com/@ls-lint/ls-lint/-/ls-lint-1.9.2.tgz#689f1f4c06072823a726802ba167340efcefe19c"
571571
integrity sha512-sugEjWjSSy9OHF6t1ZBLZCAROj52cZthB9dIePmzZzzMwmWwy3qAEMSdJheHeS1FOwDZI7Ipm1H/bWgzJNnSAw==
572572

573-
"@microsoft/[email protected].15":
574-
version "7.8.15"
575-
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.8.15.tgz#a9ade86180157aead2e63e5edb439c4d8f158049"
576-
integrity sha512-z81RLrvZdCxPMDBH6JVtZAMMrxDsDGz4mW7GM6OGxPlooTtSVtPH9RNhZFbA6zp7/4ANgBlqURl8zIsxvFeppA==
573+
"@microsoft/[email protected].16":
574+
version "7.8.16"
575+
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.8.16.tgz#0d4eb2ca65a62db2c2e0db3ee1ba04af74afef55"
576+
integrity sha512-zaYRgFLjz3bzpvco36+DDnk30+vx6keqvJMa36oftG2vu3aDr4g0VBH/7O5ItXLps1H6xdinLJDvet5/VZdwPQ==
577577
dependencies:
578578
"@microsoft/tsdoc" "0.12.19"
579-
"@rushstack/node-core-library" "3.27.0"
579+
"@rushstack/node-core-library" "3.28.0"
580580

581-
"@microsoft/api-extractor@^7.3.9":
582-
version "7.9.5"
583-
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.9.5.tgz#38a17e81466763c60714e2e6b8160d49fa209fa8"
584-
integrity sha512-vqatQEp62zi+kjWzAbQZHR1/BHuM9EdLvH6yJX+TRrgY3qONJmZ4cMP6hc5QdqkW8V8fDR8B559nQOxmRQfXHg==
581+
"@microsoft/api-extractor@^7.9.7":
582+
version "7.9.7"
583+
resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.9.7.tgz#6be23719c47903959bc2b54853bfbb75c2509e12"
584+
integrity sha512-EFkJh7RdS/wZ+LahoOiK/SIMRar+p4sRyNqIc+n4iNfL0cQP4N2saFJwM2GSfImabk+q+Ug9jX2O5EWwia9QiA==
585585
dependencies:
586-
"@microsoft/api-extractor-model" "7.8.15"
586+
"@microsoft/api-extractor-model" "7.8.16"
587587
"@microsoft/tsdoc" "0.12.19"
588-
"@rushstack/node-core-library" "3.27.0"
589-
"@rushstack/ts-command-line" "4.4.8"
588+
"@rushstack/node-core-library" "3.28.0"
589+
"@rushstack/ts-command-line" "4.6.0"
590590
colors "~1.2.1"
591591
lodash "~4.17.15"
592592
resolve "~1.17.0"
@@ -649,27 +649,29 @@
649649
estree-walker "^1.0.1"
650650
picomatch "^2.2.2"
651651

652-
"@rushstack/node-core-library@3.27.0":
653-
version "3.27.0"
654-
resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.27.0.tgz#474446d29dcb5166946af2cd9ec86d58e1444b58"
655-
integrity sha512-6fS7wqcxL4XGVFkhECMCqsqXouPRDWKMgNpyrmXJRS0PPumRMW+9m2knVK/kgTrMwcnbGysqxX/77PiFErw8wg==
652+
"@rushstack/node-core-library@3.28.0":
653+
version "3.28.0"
654+
resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.28.0.tgz#e52b4171cb2a62fc347b3ca18a408f53281f6ae0"
655+
integrity sha512-9I9kSbZCwjx6y5F6HejTE529xDYIlGM8mu691XtyLl4OzX+1EZ4xxOXkWVVxirolk6SilDu5UqSeFuVgmb5dwA==
656656
dependencies:
657657
"@types/node" "10.17.13"
658658
colors "~1.2.1"
659659
fs-extra "~7.0.1"
660+
import-lazy "~4.0.0"
660661
jju "~1.4.0"
661662
semver "~7.3.0"
662663
timsort "~0.3.0"
663664
z-schema "~3.18.3"
664665

665-
"@rushstack/ts-command-line@4.4.8":
666-
version "4.4.8"
667-
resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.4.8.tgz#46559932c7e9a70ea071c3ce376a2e7ad0d2e9b1"
668-
integrity sha512-giyVXuyI2BAID0BINp8TbxcTf5MEao+UPadAMfCuuS64mSE1E76S8wzhjqEy3WaTSpgyRDi7dMlEegNnD/97Gw==
666+
"@rushstack/ts-command-line@4.6.0":
667+
version "4.6.0"
668+
resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.6.0.tgz#3bbbcecf90a8bd27516c9be84485c2d11c26b23d"
669+
integrity sha512-myW3frGcErzdCul2Bde5tI2036zwBDAmDMaNs44p0KzFAnefmb2W8M16pmyj216k54UbV/J+eh3sZFCo6+xrlg==
669670
dependencies:
670671
"@types/argparse" "1.0.38"
671672
argparse "~1.0.9"
672673
colors "~1.2.1"
674+
string-argv "~0.3.1"
673675

674676
"@sinonjs/commons@^1.7.0":
675677
version "1.7.1"
@@ -903,7 +905,7 @@
903905
eslint-scope "^5.0.0"
904906
eslint-utils "^2.0.0"
905907

906-
"@typescript-eslint/parser@^3.2.0":
908+
"@typescript-eslint/parser@^3.9.1":
907909
version "3.9.1"
908910
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.9.1.tgz#ab7983abaea0ae138ff5671c7c7739d8a191b181"
909911
integrity sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg==
@@ -2588,7 +2590,7 @@ eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0:
25882590
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
25892591
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
25902592

2591-
eslint@^7.2.0:
2593+
eslint@^7.7.0:
25922594
version "7.7.0"
25932595
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.7.0.tgz#18beba51411927c4b64da0a8ceadefe4030d6073"
25942596
integrity sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==
@@ -3396,6 +3398,11 @@ import-fresh@^3.0.0, import-fresh@^3.1.0:
33963398
parent-module "^1.0.0"
33973399
resolve-from "^4.0.0"
33983400

3401+
import-lazy@~4.0.0:
3402+
version "4.0.0"
3403+
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153"
3404+
integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==
3405+
33993406
import-local@^3.0.2:
34003407
version "3.0.2"
34013408
resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6"
@@ -6247,7 +6254,7 @@ rollup-plugin-terser@^6.1.0:
62476254
serialize-javascript "^3.0.0"
62486255
terser "^4.7.0"
62496256

6250-
rollup-plugin-typescript2@^0.27.1:
6257+
rollup-plugin-typescript2@^0.27.2:
62516258
version "0.27.2"
62526259
resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.2.tgz#871a7f5d2a774f9cef50d25da868eec72acc2ed8"
62536260
integrity sha512-zarMH2F8oT/NO6p20gl/jkts+WxyzOlhOIUwUU/EDx5e6ewdDPS/flwLj5XFuijUCr64bZwqKuRVwCPdXXYefQ==
@@ -6684,7 +6691,7 @@ stealthy-require@^1.1.1:
66846691
resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b"
66856692
integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=
66866693

6687-
6694+
[email protected], string-argv@~0.3.1:
66886695
version "0.3.1"
66896696
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da"
66906697
integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==
@@ -7098,7 +7105,7 @@ trim-right@^1.0.1:
70987105
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
70997106
integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=
71007107

7101-
ts-jest@^26.1.0:
7108+
ts-jest@^26.2.0:
71027109
version "26.2.0"
71037110
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.2.0.tgz#7ec22faceb05ee1467fdb5265d1b33c27441f163"
71047111
integrity sha512-9+y2qwzXdAImgLSYLXAb/Rhq9+K4rbt0417b8ai987V60g2uoNWBBmMkYgutI7D8Zhu+IbCSHbBtrHxB9d7xyA==
@@ -7200,7 +7207,12 @@ typedarray@^0.0.6:
72007207
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
72017208
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
72027209

7203-
typescript@^3.9.3, typescript@~3.9.5:
7210+
typescript@^4.0.2:
7211+
version "4.0.2"
7212+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2"
7213+
integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==
7214+
7215+
typescript@~3.9.5:
72047216
version "3.9.7"
72057217
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
72067218
integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==

0 commit comments

Comments
 (0)