johannschopplich / nuxt-gtag

🔸 Google Analytics & Ads integration made easy
https://developers.google.com/tag-platform/gtagjs
MIT License
302 stars 9 forks source link

fix: expose plugin types #83

Closed matejhladnik closed 4 months ago

matejhladnik commented 4 months ago

🔗 Linked issue

📚 Description

Ensure that plugin types are exposed, as this was broken with the https://github.com/johannschopplich/nuxt-gtag/commit/2ec0f085cfd1e0acceb89bdcff0668a8a8524f88 change.

Since this plugin doesn't provide any object, I didn't extend the NuxtApp interface. I followed this codebase.

If you want, I can also update the dependencies and increase the version, in the same way @junemolison did in his MR: #82.

EDIT: Another solution would be to simply type the plugin:

import type { Plugin } from 'nuxt/app'

export default defineNuxtPlugin({
  parallel: true,
  setup() {},
}) as Plugin
netlify[bot] commented 4 months ago

Deploy Preview for nuxt-gtag ready!

Name Link
Latest commit 5fdafd6fa89f47e781f8fbc9ae9d28b76344da3a
Latest deploy log https://app.netlify.com/sites/nuxt-gtag/deploys/668fc1d83f516d0008115b2d
Deploy Preview https://deploy-preview-83--nuxt-gtag.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

johannschopplich commented 4 months ago

Thanks a lot for the PR and the explanation! 🙏 I wasn't aware of this type issue when importing from #imports. I prefer the solution from #82.