"@sucrase/jest-plugin": "^2.1.0",
"@types/jest": "^26.0.23",
"@types/node": "^15.0.2",
- "@vue/devtools-api": "^6.0.0-beta.9",
"@vue/server-renderer": "^3.0.11",
"@vue/test-utils": "^2.0.0-rc.6",
"brotli": "^1.3.2",
"vue": "^3.0.11",
"yorkie": "^2.0.0"
},
+ "dependencies": {
+ "@vue/devtools-api": "^6.0.0-beta.10"
+ },
"gitHooks": {
"pre-commit": "lint-staged",
"commit-msg": "node scripts/verifyCommit.js"
hasTSChecked = true
const external = ['vue', '@vue/composition-api']
+ if (!isGlobalBuild) {
+ external.push('@vue/devtools-api')
+ }
const nodePlugins = [resolve(), commonjs()]
const pinia: Pinia = {
install(app: App) {
pinia._a = localApp = app
- // pinia._a = app
app.provide(piniaSymbol, pinia)
app.config.globalProperties.$pinia = pinia
- // TODO: write test
- // only set the app on client for devtools
- if (__BROWSER__ && IS_CLIENT) {
+ if (IS_CLIENT) {
// this allows calling useStore() outside of a component setup after
// installing pinia's plugin
setActivePinia(pinia)
state,
}
- if (IS_CLIENT && __BROWSER__ && __DEV__) {
+ // pinia devtools rely on dev only features so they cannot be forced unless
+ // the dev build of Vue is used
+ if (__DEV__ && IS_CLIENT) {
pinia.use(devtoolsPlugin)
}
// created.
Object.defineProperty(store, '$state', descriptor)
- if (IS_CLIENT && __BROWSER__ && __DEV__) {
+ // add getters for devtools
+ if (__DEV__ && IS_CLIENT) {
store._getters = Object.keys(getters)
}
}
// save stores in instances to access them devtools
- if (
- __DEV__ &&
- __BROWSER__ &&
- IS_CLIENT &&
- currentInstance &&
- currentInstance.proxy
- ) {
+ if (__DEV__ && IS_CLIENT && currentInstance && currentInstance.proxy) {
const vm = currentInstance.proxy
const cache = '_pStores' in vm ? vm._pStores! : (vm._pStores = {})
// @ts-expect-error: still can't cast Store with generics to Store
"@vue/compiler-dom" "3.0.11"
"@vue/shared" "3.0.11"
-"@vue/devtools-api@^6.0.0-beta.9":
+"@vue/devtools-api@^6.0.0-beta.10":
version "6.0.0-beta.10"
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.10.tgz#f39da7618cee292e39c7274227c34163e30eb3ca"
integrity sha512-nktQYRnIFrh4DdXiCBjHnsHOMZXDIVcP9qlm/DMfxmjJMtpMGrSZCOKP8j7kDhObNHyqlicwoGLd+a4hf4x9ww==