Skip to content

Commit

Permalink
fix!: bump Nuxt support to RC.9, update autoImports:sources hook (#…
Browse files Browse the repository at this point in the history
…2166)

* fix: update deprecated `autoImports:sources` Nuxt hook

* Update package.json

* Update pnpm-lock.yaml
  • Loading branch information
DamianGlowala committed Sep 5, 2022
1 parent de5a9c3 commit db7ffa6
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 307 deletions.
2 changes: 1 addition & 1 deletion packages/core/ssr-handlers.ts
Expand Up @@ -13,7 +13,7 @@ export interface StorageLike {
}

/**
* @expiremental The API is not finalized yet. It might not follow semver.
* @experimental The API is not finalized yet. It might not follow semver.
*/
export interface SSRHandlersMap {
getDefaultStorage: () => StorageLike | undefined
Expand Down
8 changes: 4 additions & 4 deletions packages/nuxt/index.ts
Expand Up @@ -36,7 +36,7 @@ export interface VueUseNuxtOptions {
autoImports?: boolean

/**
* @expiremental
* @experimental
* @default false
*/
ssrHandlers?: boolean
Expand Down Expand Up @@ -72,7 +72,7 @@ export default defineNuxtModule<VueUseNuxtOptions>({
config.optimizeDeps.exclude.push(...fullPackages)
})

// add pacages to transpile target for alias resolution
// add packages to transpile target for alias resolution
nuxt.options.build = nuxt.options.build || {}
nuxt.options.build.transpile = nuxt.options.build.transpile || []
nuxt.options.build.transpile.push(...fullPackages)
Expand All @@ -85,8 +85,8 @@ export default defineNuxtModule<VueUseNuxtOptions>({
}

if (options.autoImports) {
// auto Import
nuxt.hook('autoImports:sources', (sources: any[]) => {
// auto import
nuxt.hook('imports:sources', (sources: any[]) => {
if (sources.find(i => fullPackages.includes(i.from)))
return

Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/package.json
Expand Up @@ -34,14 +34,14 @@
"module": "./index.mjs",
"types": "./index.d.ts",
"dependencies": {
"@nuxt/kit": "^3.0.0-rc.6",
"@nuxt/kit": "^3.0.0-rc.9",
"@vueuse/core": "workspace:*",
"@vueuse/metadata": "workspace:*",
"local-pkg": "^0.4.2",
"vue-demi": "*"
},
"devDependencies": {
"@nuxt/schema": "^3.0.0-rc.6",
"@nuxt/schema": "^3.0.0-rc.9",
"unimport": "^0.6.1"
}
}

0 comments on commit db7ffa6

Please sign in to comment.