@btst/stack 1.1.3 → 1.1.4

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.
@@ -1,9 +1,8 @@
1
- import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
2
1
  import * as react from 'react';
3
2
  import { ComponentType } from 'react';
4
3
  import * as _btst_yar from '@btst/yar';
5
4
  import { QueryClient } from '@tanstack/react-query';
6
- import { P as Post, S as SerializedPost } from '../../../shared/stack.CoPoHVfV.js';
5
+ import { P as Post, S as SerializedPost } from '../../../shared/stack.CbuN2zVV.js';
7
6
  export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
8
7
  import 'zod';
9
8
 
@@ -67,176 +66,190 @@ interface BlogClientHooks {
67
66
  *
68
67
  * @param config - Configuration including queryClient, baseURL, and optional hooks
69
68
  */
70
- declare const blogClientPlugin: (config: BlogClientConfig) => _btst_stack_plugins_client.ClientPlugin<unknown, {
71
- posts: {
72
- (inputCtx_0?: _btst_yar.InputContext<"/blog", _btst_yar.RouteOptions> | undefined): {
73
- PageComponent?: react.ComponentType<unknown> | undefined;
74
- LoadingComponent?: react.ComponentType<unknown> | undefined;
75
- ErrorComponent?: react.ComponentType<unknown> | undefined;
76
- loader?: (() => Promise<void>) | undefined;
77
- meta?: (() => ({
78
- title: string;
79
- name?: undefined;
80
- content?: undefined;
81
- property?: undefined;
82
- } | {
83
- name: string;
84
- content: string;
85
- title?: undefined;
86
- property?: undefined;
87
- } | {
88
- property: string;
89
- content: string;
90
- title?: undefined;
91
- name?: undefined;
92
- })[]) | undefined;
93
- extra?: (() => any) | undefined;
69
+ declare const blogClientPlugin: (config: BlogClientConfig) => {
70
+ name: string;
71
+ routes: () => {
72
+ posts: {
73
+ (inputCtx_0?: _btst_yar.InputContext<"/blog", _btst_yar.RouteOptions> | undefined): {
74
+ PageComponent?: react.ComponentType<unknown> | undefined;
75
+ LoadingComponent?: react.ComponentType<unknown> | undefined;
76
+ ErrorComponent?: react.ComponentType<unknown> | undefined;
77
+ loader?: (() => Promise<void>) | undefined;
78
+ meta?: (() => ({
79
+ title: string;
80
+ name?: undefined;
81
+ content?: undefined;
82
+ property?: undefined;
83
+ } | {
84
+ name: string;
85
+ content: string;
86
+ title?: undefined;
87
+ property?: undefined;
88
+ } | {
89
+ property: string;
90
+ content: string;
91
+ title?: undefined;
92
+ name?: undefined;
93
+ })[]) | undefined;
94
+ extra?: (() => any) | undefined;
95
+ };
96
+ options: _btst_yar.RouteOptions | undefined;
97
+ path: "/blog";
98
+ meta: _btst_yar.RouteMeta | undefined;
94
99
  };
95
- options: _btst_yar.RouteOptions | undefined;
96
- path: "/blog";
97
- meta: _btst_yar.RouteMeta | undefined;
98
- };
99
- drafts: {
100
- (inputCtx_0?: _btst_yar.InputContext<"/blog/drafts", _btst_yar.RouteOptions> | undefined): {
101
- PageComponent?: react.ComponentType<unknown> | undefined;
102
- LoadingComponent?: react.ComponentType<unknown> | undefined;
103
- ErrorComponent?: react.ComponentType<unknown> | undefined;
104
- loader?: (() => Promise<void>) | undefined;
105
- meta?: (() => ({
106
- title: string;
107
- name?: undefined;
108
- content?: undefined;
109
- property?: undefined;
110
- } | {
111
- name: string;
112
- content: string;
113
- title?: undefined;
114
- property?: undefined;
115
- } | {
116
- property: string;
117
- content: string;
118
- title?: undefined;
119
- name?: undefined;
120
- })[]) | undefined;
121
- extra?: (() => any) | undefined;
100
+ drafts: {
101
+ (inputCtx_0?: _btst_yar.InputContext<"/blog/drafts", _btst_yar.RouteOptions> | undefined): {
102
+ PageComponent?: react.ComponentType<unknown> | undefined;
103
+ LoadingComponent?: react.ComponentType<unknown> | undefined;
104
+ ErrorComponent?: react.ComponentType<unknown> | undefined;
105
+ loader?: (() => Promise<void>) | undefined;
106
+ meta?: (() => ({
107
+ title: string;
108
+ name?: undefined;
109
+ content?: undefined;
110
+ property?: undefined;
111
+ } | {
112
+ name: string;
113
+ content: string;
114
+ title?: undefined;
115
+ property?: undefined;
116
+ } | {
117
+ property: string;
118
+ content: string;
119
+ title?: undefined;
120
+ name?: undefined;
121
+ })[]) | undefined;
122
+ extra?: (() => any) | undefined;
123
+ };
124
+ options: _btst_yar.RouteOptions | undefined;
125
+ path: "/blog/drafts";
126
+ meta: _btst_yar.RouteMeta | undefined;
122
127
  };
123
- options: _btst_yar.RouteOptions | undefined;
124
- path: "/blog/drafts";
125
- meta: _btst_yar.RouteMeta | undefined;
126
- };
127
- newPost: {
128
- (inputCtx_0?: _btst_yar.InputContext<"/blog/new", _btst_yar.RouteOptions> | undefined): {
129
- PageComponent?: react.ComponentType<unknown> | undefined;
130
- LoadingComponent?: react.ComponentType<unknown> | undefined;
131
- ErrorComponent?: react.ComponentType<unknown> | undefined;
132
- loader?: (() => any) | undefined;
133
- meta?: (() => ({
134
- title: string;
135
- name?: undefined;
136
- content?: undefined;
137
- property?: undefined;
138
- } | {
139
- name: string;
140
- content: string;
141
- title?: undefined;
142
- property?: undefined;
143
- } | {
144
- property: string;
145
- content: string;
146
- title?: undefined;
147
- name?: undefined;
148
- })[]) | undefined;
149
- extra?: (() => any) | undefined;
128
+ newPost: {
129
+ (inputCtx_0?: _btst_yar.InputContext<"/blog/new", _btst_yar.RouteOptions> | undefined): {
130
+ PageComponent?: react.ComponentType<unknown> | undefined;
131
+ LoadingComponent?: react.ComponentType<unknown> | undefined;
132
+ ErrorComponent?: react.ComponentType<unknown> | undefined;
133
+ loader?: (() => any) | undefined;
134
+ meta?: (() => ({
135
+ title: string;
136
+ name?: undefined;
137
+ content?: undefined;
138
+ property?: undefined;
139
+ } | {
140
+ name: string;
141
+ content: string;
142
+ title?: undefined;
143
+ property?: undefined;
144
+ } | {
145
+ property: string;
146
+ content: string;
147
+ title?: undefined;
148
+ name?: undefined;
149
+ })[]) | undefined;
150
+ extra?: (() => any) | undefined;
151
+ };
152
+ options: _btst_yar.RouteOptions | undefined;
153
+ path: "/blog/new";
154
+ meta: _btst_yar.RouteMeta | undefined;
150
155
  };
151
- options: _btst_yar.RouteOptions | undefined;
152
- path: "/blog/new";
153
- meta: _btst_yar.RouteMeta | undefined;
154
- };
155
- editPost: {
156
- (inputCtx_0: _btst_yar.InputContext<"/blog/:slug/edit", _btst_yar.RouteOptions>): {
157
- PageComponent?: react.ComponentType<unknown> | undefined;
158
- LoadingComponent?: react.ComponentType<unknown> | undefined;
159
- ErrorComponent?: react.ComponentType<unknown> | undefined;
160
- loader?: (() => Promise<void>) | undefined;
161
- meta?: (() => ({
162
- title: string;
163
- name?: undefined;
164
- content?: undefined;
165
- property?: undefined;
166
- } | {
167
- name: string;
168
- content: string;
169
- title?: undefined;
170
- property?: undefined;
171
- } | {
172
- property: string;
173
- content: string;
174
- title?: undefined;
175
- name?: undefined;
176
- })[]) | undefined;
177
- extra?: (() => any) | undefined;
156
+ editPost: {
157
+ (inputCtx_0: _btst_yar.InputContext<"/blog/:slug/edit", _btst_yar.RouteOptions>): {
158
+ PageComponent?: react.ComponentType<unknown> | undefined;
159
+ LoadingComponent?: react.ComponentType<unknown> | undefined;
160
+ ErrorComponent?: react.ComponentType<unknown> | undefined;
161
+ loader?: (() => Promise<void>) | undefined;
162
+ meta?: (() => ({
163
+ title: string;
164
+ name?: undefined;
165
+ content?: undefined;
166
+ property?: undefined;
167
+ } | {
168
+ name: string;
169
+ content: string;
170
+ title?: undefined;
171
+ property?: undefined;
172
+ } | {
173
+ property: string;
174
+ content: string;
175
+ title?: undefined;
176
+ name?: undefined;
177
+ })[]) | undefined;
178
+ extra?: (() => any) | undefined;
179
+ };
180
+ options: _btst_yar.RouteOptions | undefined;
181
+ path: "/blog/:slug/edit";
182
+ meta: _btst_yar.RouteMeta | undefined;
178
183
  };
179
- options: _btst_yar.RouteOptions | undefined;
180
- path: "/blog/:slug/edit";
181
- meta: _btst_yar.RouteMeta | undefined;
182
- };
183
- tag: {
184
- (inputCtx_0: _btst_yar.InputContext<"/blog/tag/:tagSlug", _btst_yar.RouteOptions>): {
185
- PageComponent?: react.ComponentType<unknown> | undefined;
186
- LoadingComponent?: react.ComponentType<unknown> | undefined;
187
- ErrorComponent?: react.ComponentType<unknown> | undefined;
188
- loader?: (() => Promise<void>) | undefined;
189
- meta?: (() => ({
190
- title: string;
191
- name?: undefined;
192
- content?: undefined;
193
- property?: undefined;
194
- } | {
195
- name: string;
196
- content: string;
197
- title?: undefined;
198
- property?: undefined;
199
- } | {
200
- property: string;
201
- content: string;
202
- title?: undefined;
203
- name?: undefined;
204
- })[]) | undefined;
205
- extra?: (() => any) | undefined;
184
+ tag: {
185
+ (inputCtx_0: _btst_yar.InputContext<"/blog/tag/:tagSlug", _btst_yar.RouteOptions>): {
186
+ PageComponent?: react.ComponentType<unknown> | undefined;
187
+ LoadingComponent?: react.ComponentType<unknown> | undefined;
188
+ ErrorComponent?: react.ComponentType<unknown> | undefined;
189
+ loader?: (() => Promise<void>) | undefined;
190
+ meta?: (() => ({
191
+ title: string;
192
+ name?: undefined;
193
+ content?: undefined;
194
+ property?: undefined;
195
+ } | {
196
+ name: string;
197
+ content: string;
198
+ title?: undefined;
199
+ property?: undefined;
200
+ } | {
201
+ property: string;
202
+ content: string;
203
+ title?: undefined;
204
+ name?: undefined;
205
+ })[]) | undefined;
206
+ extra?: (() => any) | undefined;
207
+ };
208
+ options: _btst_yar.RouteOptions | undefined;
209
+ path: "/blog/tag/:tagSlug";
210
+ meta: _btst_yar.RouteMeta | undefined;
206
211
  };
207
- options: _btst_yar.RouteOptions | undefined;
208
- path: "/blog/tag/:tagSlug";
209
- meta: _btst_yar.RouteMeta | undefined;
210
- };
211
- post: {
212
- (inputCtx_0: _btst_yar.InputContext<"/blog/:slug", _btst_yar.RouteOptions>): {
213
- PageComponent?: react.ComponentType<unknown> | undefined;
214
- LoadingComponent?: react.ComponentType<unknown> | undefined;
215
- ErrorComponent?: react.ComponentType<unknown> | undefined;
216
- loader?: (() => Promise<void>) | undefined;
217
- meta?: (() => ({
218
- title: string;
219
- name?: undefined;
220
- content?: undefined;
221
- property?: undefined;
222
- } | {
223
- name: string;
224
- content: string | undefined;
225
- title?: undefined;
226
- property?: undefined;
227
- } | {
228
- property: string;
229
- content: string;
230
- title?: undefined;
231
- name?: undefined;
232
- })[]) | undefined;
233
- extra?: (() => any) | undefined;
212
+ post: {
213
+ (inputCtx_0: _btst_yar.InputContext<"/blog/:slug", _btst_yar.RouteOptions>): {
214
+ PageComponent?: react.ComponentType<unknown> | undefined;
215
+ LoadingComponent?: react.ComponentType<unknown> | undefined;
216
+ ErrorComponent?: react.ComponentType<unknown> | undefined;
217
+ loader?: (() => Promise<void>) | undefined;
218
+ meta?: (() => ({
219
+ title: string;
220
+ name?: undefined;
221
+ content?: undefined;
222
+ property?: undefined;
223
+ } | {
224
+ name: string;
225
+ content: string | undefined;
226
+ title?: undefined;
227
+ property?: undefined;
228
+ } | {
229
+ property: string;
230
+ content: string;
231
+ title?: undefined;
232
+ name?: undefined;
233
+ })[]) | undefined;
234
+ extra?: (() => any) | undefined;
235
+ };
236
+ options: _btst_yar.RouteOptions | undefined;
237
+ path: "/blog/:slug";
238
+ meta: _btst_yar.RouteMeta | undefined;
234
239
  };
235
- options: _btst_yar.RouteOptions | undefined;
236
- path: "/blog/:slug";
237
- meta: _btst_yar.RouteMeta | undefined;
238
240
  };
239
- }>;
241
+ sitemap: () => Promise<({
242
+ url: string;
243
+ lastModified: Date | undefined;
244
+ changeFrequency: "monthly";
245
+ priority: number;
246
+ } | {
247
+ url: string;
248
+ lastModified: Date | undefined;
249
+ changeFrequency: "daily";
250
+ priority: number;
251
+ })[]>;
252
+ };
240
253
 
241
254
  declare const BLOG_LOCALIZATION: {
242
255
  BLOG_FORMS_TITLE_LABEL: string;
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CoPoHVfV.cjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CbuN2zVV.cjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -134,11 +134,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
134
134
  content: string;
135
135
  excerpt: string;
136
136
  slug?: string | undefined;
137
- published?: boolean | undefined;
138
- createdAt?: unknown;
139
137
  publishedAt?: unknown;
138
+ createdAt?: unknown;
140
139
  updatedAt?: unknown;
141
140
  image?: string | undefined;
141
+ published?: boolean | undefined;
142
142
  tags?: ({
143
143
  name: string;
144
144
  } | {
@@ -173,14 +173,14 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
173
173
  method: "POST";
174
174
  body: z.ZodObject<{
175
175
  slug: z.ZodOptional<z.ZodString>;
176
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
177
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
178
176
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
177
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
179
178
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
180
179
  title: z.ZodString;
181
180
  content: z.ZodString;
182
181
  excerpt: z.ZodString;
183
182
  image: z.ZodOptional<z.ZodString>;
183
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
184
184
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
185
185
  name: z.ZodString;
186
186
  }, z.core.$strip>, z.ZodObject<{
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CoPoHVfV.mjs';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CbuN2zVV.mjs';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -134,11 +134,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
134
134
  content: string;
135
135
  excerpt: string;
136
136
  slug?: string | undefined;
137
- published?: boolean | undefined;
138
- createdAt?: unknown;
139
137
  publishedAt?: unknown;
138
+ createdAt?: unknown;
140
139
  updatedAt?: unknown;
141
140
  image?: string | undefined;
141
+ published?: boolean | undefined;
142
142
  tags?: ({
143
143
  name: string;
144
144
  } | {
@@ -173,14 +173,14 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
173
173
  method: "POST";
174
174
  body: z.ZodObject<{
175
175
  slug: z.ZodOptional<z.ZodString>;
176
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
177
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
178
176
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
177
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
179
178
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
180
179
  title: z.ZodString;
181
180
  content: z.ZodString;
182
181
  excerpt: z.ZodString;
183
182
  image: z.ZodOptional<z.ZodString>;
183
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
184
184
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
185
185
  name: z.ZodString;
186
186
  }, z.core.$strip>, z.ZodObject<{
@@ -1,7 +1,7 @@
1
1
  import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
2
2
  import * as better_call from 'better-call';
3
3
  import { z } from 'zod';
4
- import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CoPoHVfV.js';
4
+ import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.CbuN2zVV.js';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
6
6
  import { createApiClient } from '@btst/stack/plugins/client';
7
7
 
@@ -134,11 +134,11 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
134
134
  content: string;
135
135
  excerpt: string;
136
136
  slug?: string | undefined;
137
- published?: boolean | undefined;
138
- createdAt?: unknown;
139
137
  publishedAt?: unknown;
138
+ createdAt?: unknown;
140
139
  updatedAt?: unknown;
141
140
  image?: string | undefined;
141
+ published?: boolean | undefined;
142
142
  tags?: ({
143
143
  name: string;
144
144
  } | {
@@ -173,14 +173,14 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
173
173
  method: "POST";
174
174
  body: z.ZodObject<{
175
175
  slug: z.ZodOptional<z.ZodString>;
176
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
177
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
178
176
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
177
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
179
178
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
180
179
  title: z.ZodString;
181
180
  content: z.ZodString;
182
181
  excerpt: z.ZodString;
183
182
  image: z.ZodOptional<z.ZodString>;
183
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
184
184
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
185
185
  name: z.ZodString;
186
186
  }, z.core.$strip>, z.ZodObject<{
@@ -1,9 +1,10 @@
1
1
  import { C as ClientPlugin } from '../../shared/stack.ByOugz9d.cjs';
2
2
  export { P as PluginOverrides } from '../../shared/stack.ByOugz9d.cjs';
3
+ import { Route } from '@btst/yar';
4
+ export { Route, createRoute, createRouter } from '@btst/yar';
3
5
  import { createClient } from 'better-call/client';
4
6
  export { createClient } from 'better-call/client';
5
7
  import { Router, Endpoint } from 'better-call';
6
- export { Route, createRoute, createRouter } from '@btst/yar';
7
8
  import '@btst/db';
8
9
 
9
10
  interface CreateApiClientOptions {
@@ -31,16 +32,10 @@ declare function createApiClient<TRouter extends Router | Record<string, Endpoin
31
32
  * - Client: import type { ClientPlugin } from "@btst/stack/plugins/client"
32
33
  */
33
34
 
34
- /**
35
- * Helper type to extract plugin structure without leaking internal type references
36
- * This ensures types are portable across package boundaries
37
- */
38
- type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> = ClientPlugin<TPlugin extends ClientPlugin<infer TOverrides, any> ? TOverrides : never, TPlugin extends ClientPlugin<any, infer TRoutes> ? TRoutes : never>;
39
35
  /**
40
36
  * Helper to define a client plugin with full type inference
41
37
  *
42
38
  * Automatically infers route keys, hook names, and their types without needing casts.
43
- * Returns a portable type that doesn't leak internal pnpm path references.
44
39
  *
45
40
  * @example
46
41
  * ```ts
@@ -55,6 +50,6 @@ type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> = ClientPlugin
55
50
  *
56
51
  * @template TPlugin - The exact plugin definition (auto-inferred)
57
52
  */
58
- declare function defineClientPlugin<TPlugin extends ClientPlugin<any, any>>(plugin: TPlugin): PortableClientPlugin<TPlugin>;
53
+ declare function defineClientPlugin<TPlugin extends ClientPlugin<any, Record<string, Route>>>(plugin: TPlugin): TPlugin;
59
54
 
60
55
  export { ClientPlugin, createApiClient, defineClientPlugin };
@@ -1,9 +1,10 @@
1
1
  import { C as ClientPlugin } from '../../shared/stack.ByOugz9d.mjs';
2
2
  export { P as PluginOverrides } from '../../shared/stack.ByOugz9d.mjs';
3
+ import { Route } from '@btst/yar';
4
+ export { Route, createRoute, createRouter } from '@btst/yar';
3
5
  import { createClient } from 'better-call/client';
4
6
  export { createClient } from 'better-call/client';
5
7
  import { Router, Endpoint } from 'better-call';
6
- export { Route, createRoute, createRouter } from '@btst/yar';
7
8
  import '@btst/db';
8
9
 
9
10
  interface CreateApiClientOptions {
@@ -31,16 +32,10 @@ declare function createApiClient<TRouter extends Router | Record<string, Endpoin
31
32
  * - Client: import type { ClientPlugin } from "@btst/stack/plugins/client"
32
33
  */
33
34
 
34
- /**
35
- * Helper type to extract plugin structure without leaking internal type references
36
- * This ensures types are portable across package boundaries
37
- */
38
- type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> = ClientPlugin<TPlugin extends ClientPlugin<infer TOverrides, any> ? TOverrides : never, TPlugin extends ClientPlugin<any, infer TRoutes> ? TRoutes : never>;
39
35
  /**
40
36
  * Helper to define a client plugin with full type inference
41
37
  *
42
38
  * Automatically infers route keys, hook names, and their types without needing casts.
43
- * Returns a portable type that doesn't leak internal pnpm path references.
44
39
  *
45
40
  * @example
46
41
  * ```ts
@@ -55,6 +50,6 @@ type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> = ClientPlugin
55
50
  *
56
51
  * @template TPlugin - The exact plugin definition (auto-inferred)
57
52
  */
58
- declare function defineClientPlugin<TPlugin extends ClientPlugin<any, any>>(plugin: TPlugin): PortableClientPlugin<TPlugin>;
53
+ declare function defineClientPlugin<TPlugin extends ClientPlugin<any, Record<string, Route>>>(plugin: TPlugin): TPlugin;
59
54
 
60
55
  export { ClientPlugin, createApiClient, defineClientPlugin };
@@ -1,9 +1,10 @@
1
1
  import { C as ClientPlugin } from '../../shared/stack.ByOugz9d.js';
2
2
  export { P as PluginOverrides } from '../../shared/stack.ByOugz9d.js';
3
+ import { Route } from '@btst/yar';
4
+ export { Route, createRoute, createRouter } from '@btst/yar';
3
5
  import { createClient } from 'better-call/client';
4
6
  export { createClient } from 'better-call/client';
5
7
  import { Router, Endpoint } from 'better-call';
6
- export { Route, createRoute, createRouter } from '@btst/yar';
7
8
  import '@btst/db';
8
9
 
9
10
  interface CreateApiClientOptions {
@@ -31,16 +32,10 @@ declare function createApiClient<TRouter extends Router | Record<string, Endpoin
31
32
  * - Client: import type { ClientPlugin } from "@btst/stack/plugins/client"
32
33
  */
33
34
 
34
- /**
35
- * Helper type to extract plugin structure without leaking internal type references
36
- * This ensures types are portable across package boundaries
37
- */
38
- type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> = ClientPlugin<TPlugin extends ClientPlugin<infer TOverrides, any> ? TOverrides : never, TPlugin extends ClientPlugin<any, infer TRoutes> ? TRoutes : never>;
39
35
  /**
40
36
  * Helper to define a client plugin with full type inference
41
37
  *
42
38
  * Automatically infers route keys, hook names, and their types without needing casts.
43
- * Returns a portable type that doesn't leak internal pnpm path references.
44
39
  *
45
40
  * @example
46
41
  * ```ts
@@ -55,6 +50,6 @@ type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> = ClientPlugin
55
50
  *
56
51
  * @template TPlugin - The exact plugin definition (auto-inferred)
57
52
  */
58
- declare function defineClientPlugin<TPlugin extends ClientPlugin<any, any>>(plugin: TPlugin): PortableClientPlugin<TPlugin>;
53
+ declare function defineClientPlugin<TPlugin extends ClientPlugin<any, Record<string, Route>>>(plugin: TPlugin): TPlugin;
59
54
 
60
55
  export { ClientPlugin, createApiClient, defineClientPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btst/stack",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "A composable, plugin-based library for building full-stack applications.",
5
5
  "repository": {
6
6
  "type": "git",