nuxt-custom-fetch 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "nuxt-custom-fetch",
3
3
  "configKey": "customFetch",
4
- "version": "2.3.0",
4
+ "version": "2.3.1",
5
5
  "builder": {
6
- "@nuxt/module-builder": "0.8.4",
6
+ "@nuxt/module-builder": "1.0.0",
7
7
  "unbuild": "unknown"
8
8
  }
9
9
  }
@@ -69,9 +69,15 @@ export class CustomFetch {
69
69
  Object.assign(config, this.baseConfig(config));
70
70
  const generateOptionSegmentsWithConfig = generateOptionSegments(config);
71
71
  if (this.showLogs && import.meta.client) {
72
- console.warn("[Custom Fetch] `Request:`", url, " `Query:`", serialize(generateOptionSegmentsWithConfig), " `Body:`", serialize(config.body));
72
+ let bodyLogs;
73
+ try {
74
+ bodyLogs = serialize(config.body);
75
+ } catch (error) {
76
+ console.warn("[Custom Fetch] couldn't serialize `Body:`", error);
77
+ }
78
+ console.warn("[Custom Fetch] `Request:`", url, " `Query:`", serialize(generateOptionSegmentsWithConfig), " `Body:`", bodyLogs);
73
79
  }
74
- const { onRequest, onRequestError, onResponse, onResponseError, offline, handler, useHandler, immutableKey, ...restAjaxConfig } = config;
80
+ const { onRequest, onRequestError, onResponse, onResponseError, offline, handler, useHandler, showLogs, immutableKey, ...restAjaxConfig } = config;
75
81
  if (import.meta.client && navigator && !navigator.onLine) {
76
82
  if (offline) {
77
83
  offline();
package/dist/types.d.mts CHANGED
@@ -1 +1 @@
1
- export { type ModuleOptions, default } from './module.js'
1
+ export { type ModuleOptions, default } from './module.mjs'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-custom-fetch",
3
3
  "type": "module",
4
- "version": "2.3.0",
4
+ "version": "2.3.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -9,12 +9,11 @@
9
9
  },
10
10
  "exports": {
11
11
  ".": {
12
- "import": "./dist/module.mjs",
13
- "require": "./dist/module.cjs"
12
+ "import": "./dist/module.mjs"
14
13
  }
15
14
  },
16
- "main": "./dist/module.cjs",
17
- "types": "./dist/types.d.ts",
15
+ "main": "./dist/module.mjs",
16
+ "types": "./dist/types.d.mts",
18
17
  "files": [
19
18
  "dist"
20
19
  ],
@@ -36,25 +35,25 @@
36
35
  }
37
36
  },
38
37
  "dependencies": {
39
- "@nuxt/kit": "^3.16.1",
38
+ "@nuxt/kit": "^3.16.2",
40
39
  "ohash": "^2.0.11"
41
40
  },
42
41
  "devDependencies": {
43
- "@antfu/eslint-config": "^4.10.1",
42
+ "@antfu/eslint-config": "^4.11.0",
44
43
  "@commitlint/cli": "^19.8.0",
45
44
  "@commitlint/config-conventional": "^19.8.0",
46
- "@nuxt/module-builder": "^0.8.4",
47
- "@nuxt/schema": "^3.16.1",
48
- "@types/node": "^22.13.10",
45
+ "@nuxt/module-builder": "^1.0.0",
46
+ "@nuxt/schema": "^3.16.2",
47
+ "@types/node": "^22.14.0",
49
48
  "changelogen": "^0.6.1",
50
49
  "commitizen": "^4.3.1",
51
50
  "cz-git": "^1.11.1",
52
- "eslint": "^9.22.0",
51
+ "eslint": "^9.24.0",
53
52
  "husky": "^9.1.7",
54
53
  "lint-staged": "^15.5.0",
55
54
  "nitro": "npm:nitropack",
56
- "nuxt": "^3.16.1",
57
- "typescript": "5.8.2"
55
+ "nuxt": "^3.16.2",
56
+ "typescript": "5.8.3"
58
57
  },
59
58
  "husky": {
60
59
  "hooks": {
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
package/dist/module.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
-
3
- interface ModuleOptions {
4
- }
5
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
-
7
- export { type ModuleOptions, _default as default };
package/dist/types.d.ts DELETED
@@ -1 +0,0 @@
1
- export { type ModuleOptions, default } from './module'