Skip to content

Commit

Permalink
chore: use module-builder stub mode for more accurate types (#12)
Browse files Browse the repository at this point in the history
* chore: use module-builder stub mode for more accurate types

* chore: update types for module-builder stub

---------

Co-authored-by: Johann Schopplich <mail@johannschopplich.com>
  • Loading branch information
danielroe and johannschopplich committed Dec 5, 2023
1 parent d813b91 commit 34bc3ce
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion .nuxtrc

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"dist"
],
"scripts": {
"prepack": "nuxt-module-build",
"prepack": "nuxt-module-build build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test:types": "tsc --noEmit",
Expand Down
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default defineNuxtModule<ModuleOptions>({

// Add module options to public runtime config
nuxt.options.runtimeConfig.public.plausible = defu(
nuxt.options.runtimeConfig.public.plausible,
nuxt.options.runtimeConfig.public.plausible as ModuleOptions,
options,
)

Expand Down
3 changes: 2 additions & 1 deletion src/runtime/plugin.client.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Plausible from 'plausible-tracker'
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
import type { ModuleOptions } from '../module'

export default defineNuxtPlugin(() => {
const { plausible: options } = useRuntimeConfig().public
const options = useRuntimeConfig().public.plausible as ModuleOptions

const plausible = Plausible({
...options,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "./playground/.nuxt/tsconfig.json"
"extends": "./.nuxt/tsconfig.json"
}

0 comments on commit 34bc3ce

Please sign in to comment.