@frontic/nuxt 0.6.2 → 0.8.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": "frontic",
3
3
  "configKey": "frontic",
4
- "version": "0.0.1",
4
+ "version": "0.7.0",
5
5
  "compatibility": {
6
- "nuxt": ">=3.17.0"
6
+ "nuxt": ">=4.0.0"
7
7
  },
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -28,9 +28,9 @@ const module$1 = defineNuxtModule({
28
28
  meta: {
29
29
  name: "frontic",
30
30
  configKey: "frontic",
31
- version: "0.0.1",
31
+ version: "0.7.0",
32
32
  compatibility: {
33
- nuxt: ">=3.17.0"
33
+ nuxt: ">=4.0.0"
34
34
  }
35
35
  },
36
36
  async setup(options, nuxt) {
@@ -50,12 +50,12 @@ export declare function useFronticSearch<TSearch extends keyof Listings, TFilter
50
50
  * Current search state including active filters, sorts, pagination, and available options.
51
51
  * Use this to build filter/sort UI components.
52
52
  */
53
- state: import("@vue/reactivity").Ref<SearchState<TFilters, TSorts>, SearchState<TFilters, TSorts>>;
53
+ state: import("vue").Ref<SearchState<TFilters, TSorts>, SearchState<TFilters, TSorts>>;
54
54
  /**
55
55
  * Reactive search term. Bind to an input field for live search.
56
56
  * Search triggers automatically when term length exceeds searchTermThreshold.
57
57
  */
58
- searchTerm: import("@vue/reactivity").Ref<string, string>;
58
+ searchTerm: import("vue").Ref<string, string>;
59
59
  /**
60
60
  * Load the next page of results.
61
61
  * Standard mode: replaces current page with the next one.
@@ -5,14 +5,20 @@ import type { FronticRequestOptions } from '../types/listing.js';
5
5
  * Extracts the `items` array type from a tree response.
6
6
  *
7
7
  * When the user has a generated client, `Responses[T]` resolves to the concrete
8
- * tree response shape (`{ items: TreeNode[] }`) and this gives back the typed
8
+ * tree response shape (`{ items?: TreeNode[] }`) and this gives back the typed
9
9
  * node array — so consumers get full IDE autocomplete on `node.$items`,
10
10
  * `node.key`, and the block fields. Falls back to `unknown[]` against the
11
11
  * ambient `Responses { [key: string]: unknown }` declaration.
12
+ *
13
+ * The generated `items` property is optional (the API may omit it), so the
14
+ * conditional matches `items?:` and strips `undefined` from the inferred type.
15
+ * The `unknown extends I` guard handles the ambient case where `TResponse` is
16
+ * `unknown` and `I` is inferred as `unknown`: without it, the branch would
17
+ * return bare `unknown` instead of the intended `unknown[]` array fallback.
12
18
  */
13
- type TreeItems<TResponse> = TResponse extends {
14
- items: infer I;
15
- } ? I : unknown[];
19
+ type TreeItems<TResponse> = [TResponse] extends [{
20
+ items?: infer I;
21
+ }] ? (unknown extends I ? unknown[] : Exclude<I, undefined>) : unknown[];
16
22
  export interface UseFronticTreeOptions extends FronticRequestOptions {
17
23
  /**
18
24
  * Optional starting node key. When provided, the response contains the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontic/nuxt",
3
- "version": "0.6.2",
3
+ "version": "0.8.1",
4
4
  "description": "Nuxt module for Frontic - data fetching composables with smart caching, page routing, and context management",
5
5
  "license": "MIT",
6
6
  "author": "Frontic",
@@ -55,27 +55,30 @@
55
55
  "clean": "rm -rf dist .nuxt"
56
56
  },
57
57
  "dependencies": {
58
- "@nuxt/kit": "^3.17.0",
59
- "@pinia/colada": "^1.0.0",
60
- "@pinia/colada-nuxt": "^0.3.2",
58
+ "@nuxt/kit": "^4.4.5",
59
+ "@pinia/colada": "^1.3.0",
60
+ "@pinia/colada-nuxt": "^1.0.1",
61
61
  "@pinia/nuxt": "^0.11.0",
62
- "@vueuse/core": "^12.0.0",
62
+ "@vueuse/core": "^14.3.0",
63
63
  "pinia": "^3.0.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@nuxt/module-builder": "^1.0.2",
67
- "@nuxt/schema": "^3.17.0",
68
- "@nuxt/test-utils": "^4.0.0",
69
- "@vitest/coverage-v8": "^2",
70
- "h3": "^1.15.0",
71
- "nitropack": "^2.13.1",
72
- "nuxt": "^3.17.0",
73
- "typescript": "5.6.3",
74
- "vitest": "^2.x",
75
- "vue": "^3.x",
76
- "vue-tsc": "2.1.6"
67
+ "@nuxt/schema": "^4.4.5",
68
+ "@nuxt/test-utils": "^4.0.3",
69
+ "@vitest/coverage-v8": "^4.1.6",
70
+ "h3": "^1.15.11",
71
+ "nitropack": "^2.13.4",
72
+ "nuxt": "^4.4.5",
73
+ "typescript": "^6.0.3",
74
+ "vitest": "^4.1.6",
75
+ "vue": "^3.5.34",
76
+ "vue-tsc": "^3.2.9"
77
77
  },
78
78
  "peerDependencies": {
79
- "nuxt": ">=3.17.0"
79
+ "nuxt": ">=4.0.0"
80
+ },
81
+ "engines": {
82
+ "node": ">=20.19.0"
80
83
  }
81
84
  }