nuxt-outfit 1.9.1 → 2.0.0

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.
@@ -9,6 +9,15 @@ declare const _default: _nuxt_schema.NuxtModule<{
9
9
  };
10
10
  serverUrl: null;
11
11
  httpInstance: null;
12
- }>;
12
+ }, {
13
+ echo: {
14
+ broadcaster: string;
15
+ autoConnect: boolean;
16
+ transports: string[];
17
+ host: null;
18
+ };
19
+ serverUrl: null;
20
+ httpInstance: null;
21
+ }, false>;
13
22
 
14
23
  export { _default as default };
package/dist/module.json CHANGED
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "name": "@nuxt/outfit",
3
3
  "configKey": "outfit",
4
- "version": "1.9.1"
4
+ "version": "2.0.0",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.2",
7
+ "unbuild": "3.6.1"
8
+ }
5
9
  }
package/dist/module.mjs CHANGED
@@ -13,7 +13,7 @@ const includeDeps = (nuxt, deps) => {
13
13
  }
14
14
  nuxt.options.vite.optimizeDeps.include.push(...deps);
15
15
  };
16
- const module = defineNuxtModule({
16
+ const module$1 = defineNuxtModule({
17
17
  meta: {
18
18
  name: "@nuxt/outfit",
19
19
  configKey: "outfit"
@@ -47,4 +47,4 @@ const module = defineNuxtModule({
47
47
  }
48
48
  });
49
49
 
50
- export { module as default };
50
+ export { module$1 as default };
@@ -1,9 +1,9 @@
1
1
  export declare const useDataFetch: (name: any, path: any, options?: {}) => Promise<{
2
- pending: any;
3
- refresh: any;
4
- data: any;
2
+ pending: import("vue").Ref<boolean, boolean>;
3
+ refresh: (opts?: import("#app/composables/asyncData").AsyncDataExecuteOptions) => Promise<void>;
4
+ data: import("vue").Ref<unknown, unknown>;
5
5
  filters: any;
6
- currentPage: import("vue").WritableComputedRef<any>;
6
+ currentPage: import("vue").WritableComputedRef<number, number>;
7
7
  changePage: (page: any) => Promise<void>;
8
8
  changePerPage: (count: any) => Promise<void>;
9
9
  filter: () => Promise<void>;
@@ -25,11 +25,15 @@ export const useDataFetch = async (name, path, options = {}) => {
25
25
  return result;
26
26
  }, {});
27
27
  });
28
- const validQuery = computed(() => ({ ...other, ...preparedFilters.value }));
29
- const { data, refresh, pending } = await useAsyncData(name, () => http(path, {
30
- query: validQuery.value,
31
- ...options?.fetch ?? {}
28
+ const validQuery = computed(() => ({
29
+ ...options?.params ?? {},
30
+ ...other,
31
+ ...preparedFilters.value
32
32
  }));
33
+ const { data, refresh, pending } = await useAsyncData(
34
+ name,
35
+ (_nuxtApp, { signal }) => http(path, { params: validQuery.value }, signal)
36
+ );
33
37
  const make = async () => {
34
38
  await refresh();
35
39
  if (options?.isSilent !== true) {
@@ -1,4 +1,4 @@
1
1
  export declare const useFile: () => {
2
- createArrayBufferFromBase64: (base64: any) => ArrayBufferLike;
2
+ createArrayBufferFromBase64: (base64: any) => ArrayBuffer;
3
3
  createFileFromBase64: (base64: any, name: any) => File;
4
4
  };
@@ -1,9 +1,9 @@
1
1
  export declare const useForm: (opts?: {}) => {
2
2
  fields: any;
3
- errors: import("vue").Ref<{}>;
3
+ errors: import("vue").Ref<{}, {}>;
4
4
  repeatArray: (property: any) => void;
5
5
  removeArray: (property: any, index: any) => void;
6
- isPending: import("vue").Ref<boolean>;
6
+ isPending: import("vue").Ref<boolean, boolean>;
7
7
  handleSubmit: (event?: null, params?: null) => Promise<void>;
8
8
  clearError: (field: any) => void;
9
9
  reset: (values?: null) => void;
@@ -11,7 +11,7 @@ export const useGoodResponse = () => {
11
11
  return parse(split(cookies)).map((cookie) => serialize(cookie.name, cookie.value, cookie));
12
12
  };
13
13
  const setCookieFromResponse = ({ status, headers }) => {
14
- if (isGoodResponse(status) && !process.client) {
14
+ if (isGoodResponse(status) && !import.meta.client) {
15
15
  setResponseHeaders(event, { "Set-Cookie": parseCookie(headers.get("set-cookie")) });
16
16
  }
17
17
  };
@@ -2,8 +2,8 @@ import { useRoute } from "#imports";
2
2
  export const useQuery = () => {
3
3
  const { query } = useRoute();
4
4
  const convertValue = (value) => {
5
- if (!isNaN(value)) {
6
- return parseFloat(value);
5
+ if (!Number.isNaN(value)) {
6
+ return Number.parseFloat(value);
7
7
  } else if (value === "true" || value === "false") {
8
8
  return value === "true";
9
9
  } else if (value.includes(",")) {
@@ -1,5 +1,9 @@
1
1
  export declare const useSpaHeaders: (additionalHeaders?: {}) => {
2
- headers: any;
2
+ headers: {
3
+ cookie?: string | undefined;
4
+ host?: string | undefined;
5
+ referer?: string | undefined;
6
+ };
3
7
  } | {
4
8
  headers: {};
5
9
  onRequest({ options }: {
@@ -1,6 +1,6 @@
1
1
  import { useRuntimeConfig, useRequestEvent, useRequestHeaders, useEcho } from "#imports";
2
2
  export const useSpaHeaders = (additionalHeaders = {}) => {
3
- if (process.client) {
3
+ if (import.meta.client) {
4
4
  const { getSocketId } = useEcho();
5
5
  return {
6
6
  headers: additionalHeaders,
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
2
  export default _default;
@@ -0,0 +1,7 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
2
+
3
+ import type { default as Module } from './module.mjs'
4
+
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
+
7
+ export { default } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-outfit",
3
- "version": "1.9.1",
3
+ "version": "2.0.0",
4
4
  "description": "Outfit - Connection Laravel and Nuxt",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,28 +15,38 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/types.d.ts",
19
- "import": "./dist/module.mjs",
20
- "require": "./dist/module.cjs"
18
+ "types": "./dist/types.d.mts",
19
+ "import": "./dist/module.mjs"
20
+ }
21
+ },
22
+ "main": "./dist/module.mjs",
23
+ "typesVersions": {
24
+ "*": {
25
+ ".": [
26
+ "./dist/types.d.mts"
27
+ ]
21
28
  }
22
29
  },
23
- "main": "./dist/module.cjs",
24
- "types": "./dist/types.d.ts",
25
30
  "files": [
26
31
  "dist"
27
32
  ],
33
+ "workspaces": [
34
+ "playground"
35
+ ],
28
36
  "scripts": {
29
- "prepack": "nuxt-module-build",
30
- "dev": "nuxi dev playground",
31
- "dev:build": "nuxi build playground",
32
- "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
37
+ "prepack": "nuxt-module-build build",
38
+ "dev": "npm run dev:prepare && nuxt dev playground",
39
+ "dev:build": "nuxt build playground",
40
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
33
41
  "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
34
42
  "lint": "eslint .",
43
+ "lint-fix": "eslint . --fix",
35
44
  "test": "vitest run",
36
- "test:watch": "vitest watch"
45
+ "test:watch": "vitest watch",
46
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
37
47
  },
38
48
  "dependencies": {
39
- "@nuxt/kit": "^3.2.2",
49
+ "@nuxt/kit": "^4.4.2",
40
50
  "cookie": "^1.0.2",
41
51
  "flat": "^6.0.1",
42
52
  "klona": "^2.0.6",
@@ -47,14 +57,17 @@
47
57
  "yup": "^1.0.0"
48
58
  },
49
59
  "devDependencies": {
50
- "@nuxt/eslint-config": "^0.1.1",
51
- "@nuxt/module-builder": "^0.2.1",
52
- "@nuxt/schema": "^3.2.2",
53
- "@nuxt/test-utils": "^3.2.2",
54
- "changelogen": "^0.4.1",
55
- "eslint": "^8.34.0",
56
- "nuxt": "^3.2.2",
57
- "vitest": "^0.28.5"
60
+ "@nuxt/devtools": "^3.2.4",
61
+ "@nuxt/eslint-config": "^1.15.2",
62
+ "@nuxt/module-builder": "^1.0.2",
63
+ "@nuxt/schema": "^4.4.2",
64
+ "@nuxt/test-utils": "^4.0.0",
65
+ "changelogen": "^0.6.2",
66
+ "eslint": "^10.1.0",
67
+ "nuxt": "^4.4.2",
68
+ "typescript": "~6.0.2",
69
+ "vitest": "^4.1.1",
70
+ "vue-tsc": "^3.2.6"
58
71
  },
59
72
  "keywords": [
60
73
  "outfit",
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/types.d.ts DELETED
@@ -1,6 +0,0 @@
1
-
2
- import { } from './module'
3
-
4
-
5
-
6
- export { default } from './module'