Skip to content

Commit

Permalink
fix(types): use declare module vue
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Feb 5, 2024
1 parent 73328ce commit 8a6ce86
Show file tree
Hide file tree
Showing 9 changed files with 1,016 additions and 634 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@types/lodash.kebabcase": "^4.1.9",
"@types/node": "^20.10.4",
"@vitest/coverage-v8": "^0.34.6",
"@vue/compiler-sfc": "^3.3.11",
"@vue/server-renderer": "^3.3.11",
"@vue/compiler-sfc": "^3.4.15",
"@vue/server-renderer": "^3.4.15",
"chalk": "^5.3.0",
"conventional-changelog-cli": "^2.2.2",
"enquirer": "^2.4.1",
Expand All @@ -54,11 +54,11 @@
"rollup-plugin-typescript2": "^0.36.0",
"semver": "^7.5.4",
"simple-git-hooks": "^2.9.0",
"typedoc": "^0.25.3",
"typedoc": "^0.25.7",
"typedoc-plugin-markdown": "^3.17.0",
"typescript": "^5.2.2",
"typescript": "^5.3.3",
"vitest": "^0.34.6",
"vue": "^3.3.11"
"vue": "^3.4.15"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged",
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
},
"dependencies": {
"@chenfengyuan/vue-countdown": "^2.1.2",
"@vueuse/core": "^10.7.0",
"@vueuse/core": "^10.7.2",
"pinia": "workspace:^2.0.18",
"vitepress": "1.0.0-rc.36",
"vitepress": "1.0.0-rc.41",
"vitepress-translation-helper": "^0.1.3"
}
}
4 changes: 2 additions & 2 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"@nuxt/schema": "^3.9.0",
"@nuxt/test-utils": "^3.9.0",
"nuxt": "^3.9.0",
"typescript": "^5.2.2",
"vue-tsc": "^1.8.25"
"typescript": "^5.3.3",
"vue-tsc": "^1.8.27"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/online-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"file-saver": "^2.0.5",
"jszip": "^3.10.1",
"pinia": "workspace:*",
"vue": "^3.3.11"
"vue": "^3.4.15"
}
}
2 changes: 1 addition & 1 deletion packages/pinia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
},
"dependencies": {
"@vue/devtools-api": "^6.5.1",
"vue-demi": ">=0.14.6"
"vue-demi": ">=0.14.7"
},
"peerDependencies": {
"@vue/composition-api": "^1.4.0",
Expand Down
11 changes: 9 additions & 2 deletions packages/pinia/src/globalExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ declare module 'vue/types/options' {
}
}

// TODO: figure out why it cannot be 'vue'
/**
* NOTE: Used to be `@vue/runtime-core` but it break types from time to time. Then, in Vue docs, we started recommending
* to use `vue` instead of `@vue/runtime-core` but that broke others' types so we reverted it. Now, local types do not
* work if we use `@vue/runtime-core` so we are using `vue` again.
*/
// @ts-ignore: works on Vue 3, fails in Vue 2
declare module '@vue/runtime-core' {
declare module 'vue' {
export interface ComponentCustomProperties {
/**
* Access to the application's Pinia
Expand All @@ -52,3 +56,6 @@ declare module '@vue/runtime-core' {
_pStores?: Record<string, StoreGeneric>
}
}

// normally this is only needed in .d.ts files
export {}
2 changes: 1 addition & 1 deletion packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"vite": "^4.5.1"
},
"dependencies": {
"@vueuse/core": "^10.7.0",
"@vueuse/core": "^10.7.2",
"mande": "^2.0.8",
"pinia": "workspace:^2.0.18",
"swrv": "^1.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l @pinia/testing -r 1"
},
"dependencies": {
"vue-demi": ">=0.14.6"
"vue-demi": ">=0.14.7"
},
"devDependencies": {
"pinia": "workspace:^2.0.18",
Expand Down

0 comments on commit 8a6ce86

Please sign in to comment.