@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.
@@ -11,6 +11,7 @@
11
11
  */
12
12
 
13
13
  import type { ClientPlugin } from "../../types";
14
+ import type { Route } from "@btst/yar";
14
15
 
15
16
  export type {
16
17
  ClientPlugin,
@@ -25,21 +26,10 @@ export { createRoute, createRouter } from "@btst/yar";
25
26
 
26
27
  export { createClient } from "better-call/client";
27
28
 
28
- /**
29
- * Helper type to extract plugin structure without leaking internal type references
30
- * This ensures types are portable across package boundaries
31
- */
32
- type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> =
33
- ClientPlugin<
34
- TPlugin extends ClientPlugin<infer TOverrides, any> ? TOverrides : never,
35
- TPlugin extends ClientPlugin<any, infer TRoutes> ? TRoutes : never
36
- >;
37
-
38
29
  /**
39
30
  * Helper to define a client plugin with full type inference
40
31
  *
41
32
  * Automatically infers route keys, hook names, and their types without needing casts.
42
- * Returns a portable type that doesn't leak internal pnpm path references.
43
33
  *
44
34
  * @example
45
35
  * ```ts
@@ -54,8 +44,8 @@ type PortableClientPlugin<TPlugin extends ClientPlugin<any, any>> =
54
44
  *
55
45
  * @template TPlugin - The exact plugin definition (auto-inferred)
56
46
  */
57
- export function defineClientPlugin<TPlugin extends ClientPlugin<any, any>>(
58
- plugin: TPlugin,
59
- ): PortableClientPlugin<TPlugin> {
60
- return plugin as PortableClientPlugin<TPlugin>;
47
+ export function defineClientPlugin<
48
+ TPlugin extends ClientPlugin<any, Record<string, Route>>,
49
+ >(plugin: TPlugin): TPlugin {
50
+ return plugin;
61
51
  }
@@ -36,14 +36,14 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
38
  slug: z.ZodOptional<z.ZodString>;
39
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
39
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
40
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
41
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
43
42
  title: z.ZodString;
44
43
  content: z.ZodString;
45
44
  excerpt: z.ZodString;
46
45
  image: z.ZodOptional<z.ZodString>;
46
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
47
47
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
48
  name: z.ZodString;
49
49
  }, z.core.$strip>, z.ZodObject<{
@@ -36,14 +36,14 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
38
  slug: z.ZodOptional<z.ZodString>;
39
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
39
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
40
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
41
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
43
42
  title: z.ZodString;
44
43
  content: z.ZodString;
45
44
  excerpt: z.ZodString;
46
45
  image: z.ZodOptional<z.ZodString>;
46
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
47
47
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
48
  name: z.ZodString;
49
49
  }, z.core.$strip>, z.ZodObject<{
@@ -36,14 +36,14 @@ interface SerializedTag extends Omit<Tag, "createdAt" | "updatedAt"> {
36
36
 
37
37
  declare const createPostSchema: z.ZodObject<{
38
38
  slug: z.ZodOptional<z.ZodString>;
39
- published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
41
39
  publishedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
40
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
42
41
  updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
43
42
  title: z.ZodString;
44
43
  content: z.ZodString;
45
44
  excerpt: z.ZodString;
46
45
  image: z.ZodOptional<z.ZodString>;
46
+ published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
47
47
  tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
48
48
  name: z.ZodString;
49
49
  }, z.core.$strip>, z.ZodObject<{