Skip to content

Commit 3401d52

Browse files
committed
chore: update to nuxt3 rc
1 parent 69664e8 commit 3401d52

10 files changed

Lines changed: 688 additions & 858 deletions

File tree

docs/pages/en/1.getting-started/1.quick-start.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ v1 of this module works with Nuxt 3 and Nuxt Bridge. If you are looking for the
3131
2. **Enable the module in your Nuxt configuration**
3232

3333
```js{}[nuxt.config.js]
34-
import { defineNuxtConfig } from 'nuxt3'
34+
import { defineNuxtConfig } from 'nuxt'
3535
3636
export default defineNuxtConfig({
3737
modules: ['@nuxtjs/sanity']
@@ -43,7 +43,7 @@ v1 of this module works with Nuxt 3 and Nuxt Bridge. If you are looking for the
4343
This module will look for a `sanity.json` file in your project root directory. You can copy this over from your CMS - and you're fully configured! Alternatively, you can pass in an object in your Nuxt config with key details.
4444

4545
```js{}[nuxt.config.js]
46-
import { defineNuxtConfig } from 'nuxt3'
46+
import { defineNuxtConfig } from 'nuxt'
4747
4848
export default defineNuxtConfig({
4949
modules: ['@nuxtjs/sanity'],

docs/pages/en/1.getting-started/2.configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ By default, `@nuxtjs/sanity` will look for a `sanity.json` file in your project
1717
If you need to provide additional configuration, you can pass in an object in your Nuxt config with key details:
1818

1919
```js{}[nuxt.config.js]
20-
import { defineNuxtConfig } from 'nuxt3'
20+
import { defineNuxtConfig } from 'nuxt'
2121
2222
export default defineNuxtConfig({
2323
modules: ['@nuxtjs/sanity'],
@@ -35,7 +35,7 @@ It is also possible to pass options to this module through [runtime configuratio
3535
For example:
3636

3737
```js{}[nuxt.config.js]
38-
import { defineNuxtConfig } from 'nuxt3'
38+
import { defineNuxtConfig } from 'nuxt'
3939
4040
export default defineNuxtConfig({
4141
modules: ['@nuxtjs/sanity'],
@@ -134,7 +134,7 @@ The options that can be provided are:
134134
So, for example:
135135

136136
```js{}[nuxt.config.js]
137-
import { defineNuxtConfig } from 'nuxt3'
137+
import { defineNuxtConfig } from 'nuxt'
138138
139139
export default defineNuxtConfig({
140140
modules: ['@nuxtjs/sanity'],

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"test:unit": "vitest test/unit/*.test.*"
4444
},
4545
"dependencies": {
46-
"@nuxt/kit": "npm:@nuxt/kit-edge@latest",
46+
"@nuxt/kit": "^3.0.0-rc.1",
4747
"@portabletext/types": "^1.0.3",
4848
"chalk": "^5.0.1",
4949
"defu": "^6.0.0",
@@ -54,6 +54,7 @@
5454
},
5555
"devDependencies": {
5656
"@nuxt/module-builder": "^0.1.7",
57+
"@nuxt/schema": "^3.0.0-rc.1",
5758
"@nuxt/test-utils": "npm:@nuxt/test-utils-edge@latest",
5859
"@nuxtjs/eslint-config-typescript": "^9.0.0",
5960
"@release-it/conventional-changelog": "^4.3.0",
@@ -66,7 +67,7 @@
6667
"husky": "^7.0.4",
6768
"lint-staged": "^12.3.8",
6869
"nuxi": "^0.10.1",
69-
"nuxt3": "latest",
70+
"nuxt": "npm:nuxt3@latest",
7071
"release-it": "^14.14.2",
7172
"vitest": "^0.9.3"
7273
},

playground/nuxt.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineNuxtConfig } from 'nuxt3'
1+
import { defineNuxtConfig } from 'nuxt'
22
import sanityModule from '../src/module'
33

44
export default defineNuxtConfig({

src/runtime/composables.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { defu } from 'defu'
22
import { objectHash } from 'ohash'
33

4-
import { useNuxtApp, useRuntimeConfig, AsyncDataOptions, useAsyncData, useLazyAsyncData } from '#app'
54
import type { SanityClient, SanityConfiguration } from './client'
6-
7-
import { createSanityClient } from '#imports'
5+
import { useNuxtApp, useRuntimeConfig, AsyncDataOptions, useAsyncData, useLazyAsyncData, createSanityClient } from '#imports'
86

97
export interface SanityHelper {
108
client: SanityClient

src/runtime/plugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { defineNuxtPlugin } from '#app'
21
import type { SanityHelper } from './composables'
3-
import { useSanity } from '#imports'
2+
import { defineNuxtPlugin, useSanity } from '#imports'
43

54
export default defineNuxtPlugin((nuxtApp) => {
65
nuxtApp.provide('sanity', useSanity())

test/stubs/app.mjs

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/stubs/imports.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
export const isVue2 = false
22
export { createClient as createSanityClient } from '../../src/runtime/client'
3+
export const useNuxtApp = () => ({})
4+
export const useRuntimeConfig = () => ({
5+
sanity: {
6+
projectId: 'test-project',
7+
},
8+
})

vite.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { defineConfig } from 'vite'
44
export default defineConfig({
55
resolve: {
66
alias: {
7-
'#app': fileURLToPath(new URL('./test/stubs/app.mjs', import.meta.url)),
87
'#imports': fileURLToPath(new URL('./test/stubs/imports.mjs', import.meta.url)),
98
},
109
},

0 commit comments

Comments
 (0)