Skip to content

Commit 34c4840

Browse files
authored
feat: add detector for pinia (#59)
1 parent 5f397f6 commit 34c4840

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ To support a new UI library, please look at [detectors/uis.json](detectors/uis.j
6363
- [Inertia.js](https://inertiajs.com)
6464
- [vee-validate](https://vee-validate.logaretm.com)
6565
- [Vue Composition API](https://github.com/vuejs/composition-api)
66+
- [Pinia](https://github.com/posva/pinia)
6667

6768
To support a new Vue plugin, please look at [detectors/plugins.json](detectors/plugins.json).
6869

detectors/plugins.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,18 @@
137137
"detectors": {
138138
"js": "window.Vue?.$plausible || window.$nuxt?.$plausible || Boolean([...document.querySelectorAll('*')].find((el) => Boolean(el.__vue__?.$plausible)))"
139139
}
140+
},
141+
"pinia": {
142+
"metas": {
143+
"slug": "pinia",
144+
"name": "Pinia",
145+
"imgPath": "/plugins/pinia.svg",
146+
"url": "https://pinia.esm.dev"
147+
},
148+
"detectors": {
149+
"js": [
150+
"[...document.querySelectorAll('*')].filter((el) => el.__vue__?.$pinia || el.__vue_app__?.config?.globalProperties?.$pinia).length"
151+
]
152+
}
140153
}
141154
}

icons/plugins/pinia.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)