Skip to content

Commit 8a6ce86

Browse files
committed
fix(types): use declare module vue
1 parent 73328ce commit 8a6ce86

File tree

9 files changed

+1016
-634
lines changed

9 files changed

+1016
-634
lines changed

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"@types/lodash.kebabcase": "^4.1.9",
3636
"@types/node": "^20.10.4",
3737
"@vitest/coverage-v8": "^0.34.6",
38-
"@vue/compiler-sfc": "^3.3.11",
39-
"@vue/server-renderer": "^3.3.11",
38+
"@vue/compiler-sfc": "^3.4.15",
39+
"@vue/server-renderer": "^3.4.15",
4040
"chalk": "^5.3.0",
4141
"conventional-changelog-cli": "^2.2.2",
4242
"enquirer": "^2.4.1",
@@ -54,11 +54,11 @@
5454
"rollup-plugin-typescript2": "^0.36.0",
5555
"semver": "^7.5.4",
5656
"simple-git-hooks": "^2.9.0",
57-
"typedoc": "^0.25.3",
57+
"typedoc": "^0.25.7",
5858
"typedoc-plugin-markdown": "^3.17.0",
59-
"typescript": "^5.2.2",
59+
"typescript": "^5.3.3",
6060
"vitest": "^0.34.6",
61-
"vue": "^3.3.11"
61+
"vue": "^3.4.15"
6262
},
6363
"simple-git-hooks": {
6464
"pre-commit": "pnpm lint-staged",

packages/docs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
},
1515
"dependencies": {
1616
"@chenfengyuan/vue-countdown": "^2.1.2",
17-
"@vueuse/core": "^10.7.0",
17+
"@vueuse/core": "^10.7.2",
1818
"pinia": "workspace:^2.0.18",
19-
"vitepress": "1.0.0-rc.36",
19+
"vitepress": "1.0.0-rc.41",
2020
"vitepress-translation-helper": "^0.1.3"
2121
}
2222
}

packages/nuxt/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
"@nuxt/schema": "^3.9.0",
5555
"@nuxt/test-utils": "^3.9.0",
5656
"nuxt": "^3.9.0",
57-
"typescript": "^5.2.2",
58-
"vue-tsc": "^1.8.25"
57+
"typescript": "^5.3.3",
58+
"vue-tsc": "^1.8.27"
5959
},
6060
"publishConfig": {
6161
"access": "public"

packages/online-playground/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
"file-saver": "^2.0.5",
1919
"jszip": "^3.10.1",
2020
"pinia": "workspace:*",
21-
"vue": "^3.3.11"
21+
"vue": "^3.4.15"
2222
}
2323
}

packages/pinia/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
"dependencies": {
7676
"@vue/devtools-api": "^6.5.1",
77-
"vue-demi": ">=0.14.6"
77+
"vue-demi": ">=0.14.7"
7878
},
7979
"peerDependencies": {
8080
"@vue/composition-api": "^1.4.0",

packages/pinia/src/globalExtensions.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ declare module 'vue/types/options' {
3434
}
3535
}
3636

37-
// TODO: figure out why it cannot be 'vue'
37+
/**
38+
* NOTE: Used to be `@vue/runtime-core` but it break types from time to time. Then, in Vue docs, we started recommending
39+
* to use `vue` instead of `@vue/runtime-core` but that broke others' types so we reverted it. Now, local types do not
40+
* work if we use `@vue/runtime-core` so we are using `vue` again.
41+
*/
3842
// @ts-ignore: works on Vue 3, fails in Vue 2
39-
declare module '@vue/runtime-core' {
43+
declare module 'vue' {
4044
export interface ComponentCustomProperties {
4145
/**
4246
* Access to the application's Pinia
@@ -52,3 +56,6 @@ declare module '@vue/runtime-core' {
5256
_pStores?: Record<string, StoreGeneric>
5357
}
5458
}
59+
60+
// normally this is only needed in .d.ts files
61+
export {}

packages/playground/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"vite": "^4.5.1"
1313
},
1414
"dependencies": {
15-
"@vueuse/core": "^10.7.0",
15+
"@vueuse/core": "^10.7.2",
1616
"mande": "^2.0.8",
1717
"pinia": "workspace:^2.0.18",
1818
"swrv": "^1.0.4",

packages/testing/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l @pinia/testing -r 1"
4545
},
4646
"dependencies": {
47-
"vue-demi": ">=0.14.6"
47+
"vue-demi": ">=0.14.7"
4848
},
4949
"devDependencies": {
5050
"pinia": "workspace:^2.0.18",

0 commit comments

Comments
 (0)