Skip to content

Commit b9fb8ea

Browse files
enhance: Support Nuxt v4
1 parent be829b4 commit b9fb8ea

File tree

9 files changed

+5564
-3838
lines changed

9 files changed

+5564
-3838
lines changed

.eslintignore

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

.eslintrc

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

eslint.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @ts-check
2+
import { createConfigForNuxt } from '@nuxt/eslint-config';
3+
import eslintConfigPrettier from 'eslint-config-prettier';
4+
5+
export default createConfigForNuxt({})
6+
.override('nuxt/vue/rules', {
7+
rules: {
8+
'vue/html-self-closing': 'off',
9+
},
10+
})
11+
.prepend(eslintConfigPrettier);
12+

package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,30 @@
2828
"require": "./dist/module.cjs"
2929
}
3030
},
31-
"main": "./dist/module.cjs",
32-
"types": "./dist/types.d.ts",
3331
"files": [
3432
"dist"
3533
],
3634
"scripts": {
3735
"dev": "nuxi dev playground",
3836
"dev:build": "nuxi build playground",
3937
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
38+
"build": "nuxt-module-build && nuxi build playground",
4039
"lint": "eslint .",
4140
"prepublishOnly": "nuxi prepare playground && yarn lint && nuxt-module-build"
4241
},
4342
"dependencies": {
44-
"@nuxt/kit": "^3.5.3",
43+
"@nuxt/kit": "^4.0.0",
4544
"defu": "^6.1.2",
46-
"microcms-js-sdk": "^2.5.0"
45+
"microcms-js-sdk": "^3.2.0"
4746
},
4847
"devDependencies": {
49-
"@nuxt/eslint-config": "^0.1.1",
50-
"@nuxt/module-builder": "^0.4.0",
51-
"@nuxt/schema": "^3.5.3",
48+
"@nuxt/eslint-config": "^1.6.0",
49+
"@nuxt/module-builder": "^1.0.1",
50+
"@nuxt/schema": "^4.0.0",
5251
"@nuxt/test-utils": "^3.5.3",
53-
"@types/node": "^18.11.9",
54-
"eslint": "^8.42.0",
55-
"eslint-config-prettier": "^8.8.0",
56-
"nuxt": "^3.5.3"
52+
"@types/node": "^24.0.14",
53+
"eslint": "^9.31.0",
54+
"eslint-config-prettier": "^10.1.5",
55+
"nuxt": "^4.0.0"
5756
}
5857
}

playground/nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export default defineNuxtConfig({
2+
compatibilityDate: '2025-07-18',
23
modules: [
34
[
45
'../src/module',

src/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default defineNuxtModule<ModuleOptions>({
1414
name: 'nuxt-microcms-module',
1515
configKey: 'microCMS',
1616
compatibility: {
17-
nuxt: '^3.0.0',
17+
nuxt: '^3.0.0 || ^4.0.0',
1818
},
1919
},
2020
setup(options, nuxt) {

src/runtime/composables/useMicroCMSGet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {
1+
import type {
22
MicroCMSListResponse,
33
MicroCMSListContent,
44
MicroCMSObjectContent,
@@ -31,12 +31,12 @@ type MicroCMSGetObjectArgs = {
3131
queries?: MicroCMSQueries;
3232
};
3333

34-
type FetchOptions<T extends unknown> = Omit<
34+
type FetchOptions<T = void> = Omit<
3535
Parameters<typeof useFetch<T, FetchError, string, 'get'>>,
3636
'baseURL' | 'query' | 'method'
3737
>[1];
3838

39-
const method = 'GET';
39+
const method = 'get';
4040

4141
const useMicroCMSGet = <T>(
4242
{ url, queries }: MicroCMSGetArgs,

0 commit comments

Comments
 (0)