@btst/stack 1.7.0 → 1.8.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.
- package/dist/api/index.d.cts +2 -2
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.d.ts +2 -2
- package/dist/client/index.cjs +6 -2
- package/dist/client/index.d.cts +2 -1
- package/dist/client/index.d.mts +2 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.mjs +6 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/loading/docs-skeleton.cjs +43 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/loading/docs-skeleton.mjs +41 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/pages/docs-page.cjs +794 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/components/pages/docs-page.mjs +788 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/plugin.cjs +111 -0
- package/dist/packages/better-stack/src/plugins/route-docs/client/plugin.mjs +106 -0
- package/dist/packages/better-stack/src/plugins/route-docs/generator.cjs +244 -0
- package/dist/packages/better-stack/src/plugins/route-docs/generator.mjs +227 -0
- package/dist/packages/ui/src/components/sheet.cjs +25 -0
- package/dist/packages/ui/src/components/sheet.mjs +24 -1
- package/dist/plugins/api/index.d.cts +2 -2
- package/dist/plugins/api/index.d.mts +2 -2
- package/dist/plugins/api/index.d.ts +2 -2
- package/dist/plugins/blog/api/index.d.cts +1 -1
- package/dist/plugins/blog/api/index.d.mts +1 -1
- package/dist/plugins/blog/api/index.d.ts +1 -1
- package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
- package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
- package/dist/plugins/blog/client/index.d.cts +1 -1
- package/dist/plugins/blog/client/index.d.mts +1 -1
- package/dist/plugins/blog/client/index.d.ts +1 -1
- package/dist/plugins/blog/query-keys.d.cts +2 -2
- package/dist/plugins/blog/query-keys.d.mts +2 -2
- package/dist/plugins/blog/query-keys.d.ts +2 -2
- package/dist/plugins/client/index.d.cts +2 -2
- package/dist/plugins/client/index.d.mts +2 -2
- package/dist/plugins/client/index.d.ts +2 -2
- package/dist/plugins/open-api/api/index.d.cts +1 -1
- package/dist/plugins/open-api/api/index.d.mts +1 -1
- package/dist/plugins/open-api/api/index.d.ts +1 -1
- package/dist/plugins/route-docs/client/index.cjs +10 -0
- package/dist/plugins/route-docs/client/index.d.cts +126 -0
- package/dist/plugins/route-docs/client/index.d.mts +126 -0
- package/dist/plugins/route-docs/client/index.d.ts +126 -0
- package/dist/plugins/route-docs/client/index.mjs +1 -0
- package/dist/plugins/route-docs/client.css +3 -0
- package/dist/plugins/route-docs/style.css +19 -0
- package/dist/shared/{stack.CSce37mX.d.cts → stack.u9iYV6vt.d.cts} +14 -2
- package/dist/shared/{stack.CSce37mX.d.mts → stack.u9iYV6vt.d.mts} +14 -2
- package/dist/shared/{stack.CSce37mX.d.ts → stack.u9iYV6vt.d.ts} +14 -2
- package/package.json +15 -1
- package/src/client/index.ts +11 -4
- package/src/plugins/route-docs/client/components/loading/docs-skeleton.tsx +82 -0
- package/src/plugins/route-docs/client/components/loading/index.tsx +1 -0
- package/src/plugins/route-docs/client/components/pages/docs-page.tsx +1240 -0
- package/src/plugins/route-docs/client/index.ts +7 -0
- package/src/plugins/route-docs/client/plugin.tsx +187 -0
- package/src/plugins/route-docs/client.css +3 -0
- package/src/plugins/route-docs/generator.ts +385 -0
- package/src/plugins/route-docs/index.ts +12 -0
- package/src/plugins/route-docs/style.css +19 -0
- package/src/types.ts +19 -1
- package/dist/shared/{stack.CcI4sYJP.d.mts → stack.DLhzx1-D.d.cts} +1 -1
- package/dist/shared/{stack.CcI4sYJP.d.ts → stack.DLhzx1-D.d.mts} +1 -1
- package/dist/shared/{stack.CcI4sYJP.d.cts → stack.DLhzx1-D.d.ts} +1 -1
|
@@ -81,7 +81,32 @@ function SheetContent({
|
|
|
81
81
|
)
|
|
82
82
|
] });
|
|
83
83
|
}
|
|
84
|
+
function SheetHeader({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "sheet-header",
|
|
89
|
+
className: utils.cn("flex flex-col gap-1.5 p-4", className),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function SheetTitle({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
99
|
+
DialogPrimitive__namespace.Title,
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "sheet-title",
|
|
102
|
+
className: utils.cn("text-foreground font-semibold", className),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
84
107
|
|
|
85
108
|
exports.Sheet = Sheet;
|
|
86
109
|
exports.SheetContent = SheetContent;
|
|
110
|
+
exports.SheetHeader = SheetHeader;
|
|
111
|
+
exports.SheetTitle = SheetTitle;
|
|
87
112
|
exports.SheetTrigger = SheetTrigger;
|
|
@@ -65,5 +65,28 @@ function SheetContent({
|
|
|
65
65
|
)
|
|
66
66
|
] });
|
|
67
67
|
}
|
|
68
|
+
function SheetHeader({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "sheet-header",
|
|
73
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function SheetTitle({
|
|
79
|
+
className,
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
DialogPrimitive.Title,
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "sheet-title",
|
|
86
|
+
className: cn("text-foreground font-semibold", className),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
68
91
|
|
|
69
|
-
export { Sheet, SheetContent, SheetTrigger };
|
|
92
|
+
export { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BackendPlugin } from '../../shared/stack.
|
|
2
|
-
export { C as ClientPlugin } from '../../shared/stack.
|
|
1
|
+
import { B as BackendPlugin } from '../../shared/stack.u9iYV6vt.cjs';
|
|
2
|
+
export { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.cjs';
|
|
3
3
|
import { Endpoint } from 'better-call';
|
|
4
4
|
export { Endpoint, Router, createEndpoint, createRouter } from 'better-call';
|
|
5
5
|
export { Adapter, DatabaseDefinition, DbPlugin, createDbPlugin } from '@btst/db';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BackendPlugin } from '../../shared/stack.
|
|
2
|
-
export { C as ClientPlugin } from '../../shared/stack.
|
|
1
|
+
import { B as BackendPlugin } from '../../shared/stack.u9iYV6vt.mjs';
|
|
2
|
+
export { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.mjs';
|
|
3
3
|
import { Endpoint } from 'better-call';
|
|
4
4
|
export { Endpoint, Router, createEndpoint, createRouter } from 'better-call';
|
|
5
5
|
export { Adapter, DatabaseDefinition, DbPlugin, createDbPlugin } from '@btst/db';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BackendPlugin } from '../../shared/stack.
|
|
2
|
-
export { C as ClientPlugin } from '../../shared/stack.
|
|
1
|
+
import { B as BackendPlugin } from '../../shared/stack.u9iYV6vt.js';
|
|
2
|
+
export { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.js';
|
|
3
3
|
import { Endpoint } from 'better-call';
|
|
4
4
|
export { Endpoint, Router, createEndpoint, createRouter } from 'better-call';
|
|
5
5
|
export { Adapter, DatabaseDefinition, DbPlugin, createDbPlugin } from '@btst/db';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.DLhzx1-D.cjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.DLhzx1-D.mjs';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -2,6 +2,6 @@ export { B as BlogApiContext, c as BlogApiRouter, a as BlogBackendHooks, N as Ne
|
|
|
2
2
|
import '@btst/stack/plugins/api';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../../shared/stack.
|
|
5
|
+
import '../../../shared/stack.DLhzx1-D.js';
|
|
6
6
|
import '@tanstack/react-query';
|
|
7
7
|
import '@btst/stack/plugins/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
published: boolean;
|
|
132
131
|
title: string;
|
|
132
|
+
published: boolean;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.mjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
published: boolean;
|
|
132
131
|
title: string;
|
|
132
|
+
published: boolean;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.
|
|
2
|
+
import { S as SerializedPost, c as createPostSchema, u as updatePostSchema, a as SerializedTag } from '../../../../shared/stack.DLhzx1-D.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -128,8 +128,8 @@ declare function useSuspenseTags(): {
|
|
|
128
128
|
};
|
|
129
129
|
/** Create a new post */
|
|
130
130
|
declare function useCreatePost(): _tanstack_react_query.UseMutationResult<SerializedPost | null, Error, {
|
|
131
|
-
published: boolean;
|
|
132
131
|
title: string;
|
|
132
|
+
published: boolean;
|
|
133
133
|
content: string;
|
|
134
134
|
excerpt: string;
|
|
135
135
|
tags: ({
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.cjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.cjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.mjs';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.mjs';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import * as react from 'react';
|
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import * as _btst_yar from '@btst/yar';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
|
-
import { P as Post, S as SerializedPost } from '../../../shared/stack.
|
|
6
|
+
import { P as Post, S as SerializedPost } from '../../../shared/stack.DLhzx1-D.js';
|
|
7
7
|
export { UsePostsOptions, UsePostsResult } from './hooks/index.js';
|
|
8
8
|
import 'zod';
|
|
9
9
|
|
|
@@ -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.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.cjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
+
title: z.ZodString;
|
|
147
148
|
slug: z.ZodOptional<z.ZodString>;
|
|
148
149
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
149
150
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
-
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -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.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.mjs';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
+
title: z.ZodString;
|
|
147
148
|
slug: z.ZodOptional<z.ZodString>;
|
|
148
149
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
149
150
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
-
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -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.
|
|
4
|
+
import { c as createPostSchema, u as updatePostSchema, P as Post, T as Tag, S as SerializedPost, a as SerializedTag } from '../../shared/stack.DLhzx1-D.js';
|
|
5
5
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
6
|
import { createApiClient } from '@btst/stack/plugins/client';
|
|
7
7
|
|
|
@@ -144,10 +144,10 @@ declare const blogBackendPlugin: (hooks?: BlogBackendHooks) => _btst_stack_plugi
|
|
|
144
144
|
readonly createPost: better_call.StrictEndpoint<"/posts", {
|
|
145
145
|
method: "POST";
|
|
146
146
|
body: z.ZodObject<{
|
|
147
|
+
title: z.ZodString;
|
|
147
148
|
slug: z.ZodOptional<z.ZodString>;
|
|
148
149
|
published: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
149
150
|
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
150
|
-
title: z.ZodString;
|
|
151
151
|
content: z.ZodString;
|
|
152
152
|
excerpt: z.ZodString;
|
|
153
153
|
image: z.ZodOptional<z.ZodString>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientPlugin } from '../../shared/stack.
|
|
2
|
-
export { P as PluginOverrides } from '../../shared/stack.
|
|
1
|
+
import { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.cjs';
|
|
2
|
+
export { P as PluginOverrides } from '../../shared/stack.u9iYV6vt.cjs';
|
|
3
3
|
import { Route } from '@btst/yar';
|
|
4
4
|
export { Route, createRoute, createRouter } from '@btst/yar';
|
|
5
5
|
import { createClient } from 'better-call/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientPlugin } from '../../shared/stack.
|
|
2
|
-
export { P as PluginOverrides } from '../../shared/stack.
|
|
1
|
+
import { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.mjs';
|
|
2
|
+
export { P as PluginOverrides } from '../../shared/stack.u9iYV6vt.mjs';
|
|
3
3
|
import { Route } from '@btst/yar';
|
|
4
4
|
export { Route, createRoute, createRouter } from '@btst/yar';
|
|
5
5
|
import { createClient } from 'better-call/client';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientPlugin } from '../../shared/stack.
|
|
2
|
-
export { P as PluginOverrides } from '../../shared/stack.
|
|
1
|
+
import { C as ClientPlugin } from '../../shared/stack.u9iYV6vt.js';
|
|
2
|
+
export { P as PluginOverrides } from '../../shared/stack.u9iYV6vt.js';
|
|
3
3
|
import { Route } from '@btst/yar';
|
|
4
4
|
export { Route, createRoute, createRouter } from '@btst/yar';
|
|
5
5
|
import { createClient } from 'better-call/client';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { a as BetterStackContext } from '../../../shared/stack.
|
|
3
|
+
import { a as BetterStackContext } from '../../../shared/stack.u9iYV6vt.cjs';
|
|
4
4
|
import '@btst/yar';
|
|
5
5
|
import '@btst/db';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { a as BetterStackContext } from '../../../shared/stack.
|
|
3
|
+
import { a as BetterStackContext } from '../../../shared/stack.u9iYV6vt.mjs';
|
|
4
4
|
import '@btst/yar';
|
|
5
5
|
import '@btst/db';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _btst_stack_plugins_api from '@btst/stack/plugins/api';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { a as BetterStackContext } from '../../../shared/stack.
|
|
3
|
+
import { a as BetterStackContext } from '../../../shared/stack.u9iYV6vt.js';
|
|
4
4
|
import '@btst/yar';
|
|
5
5
|
import '@btst/db';
|
|
6
6
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const plugin = require('../../../packages/better-stack/src/plugins/route-docs/client/plugin.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.ROUTE_DOCS_QUERY_KEY = plugin.ROUTE_DOCS_QUERY_KEY;
|
|
8
|
+
exports.generateSchema = plugin.generateSchema;
|
|
9
|
+
exports.getStoredContext = plugin.getStoredContext;
|
|
10
|
+
exports.routeDocsClientPlugin = plugin.routeDocsClientPlugin;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import * as _btst_yar from '@btst/yar';
|
|
4
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
5
|
+
import { S as SitemapEntry, b as ClientStackContext } from '../../../shared/stack.u9iYV6vt.cjs';
|
|
6
|
+
import '@btst/db';
|
|
7
|
+
import 'better-call';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents a documented route parameter
|
|
11
|
+
*/
|
|
12
|
+
interface RouteParameter {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
description?: string;
|
|
17
|
+
schema?: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Sitemap entry with plugin source
|
|
21
|
+
*/
|
|
22
|
+
interface PluginSitemapEntry extends SitemapEntry {
|
|
23
|
+
pluginKey: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents a documented route
|
|
27
|
+
*/
|
|
28
|
+
interface DocumentedRoute {
|
|
29
|
+
/** Route key from the plugin */
|
|
30
|
+
key: string;
|
|
31
|
+
/** The route path pattern (e.g., "/users/:id") */
|
|
32
|
+
path: string;
|
|
33
|
+
/** Path parameters extracted from the path */
|
|
34
|
+
pathParams: RouteParameter[];
|
|
35
|
+
/** Query parameters from the route's query schema */
|
|
36
|
+
queryParams: RouteParameter[];
|
|
37
|
+
/** Route metadata */
|
|
38
|
+
meta?: {
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
tags?: string[];
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Represents a plugin's documented routes
|
|
47
|
+
*/
|
|
48
|
+
interface DocumentedPlugin {
|
|
49
|
+
/** Plugin key */
|
|
50
|
+
key: string;
|
|
51
|
+
/** Plugin name */
|
|
52
|
+
name: string;
|
|
53
|
+
/** Routes from this plugin */
|
|
54
|
+
routes: DocumentedRoute[];
|
|
55
|
+
/** Sitemap entries from this plugin */
|
|
56
|
+
sitemapEntries: PluginSitemapEntry[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The complete route documentation schema
|
|
60
|
+
*/
|
|
61
|
+
interface RouteDocsSchema {
|
|
62
|
+
/** All documented plugins */
|
|
63
|
+
plugins: DocumentedPlugin[];
|
|
64
|
+
/** Generation timestamp */
|
|
65
|
+
generatedAt: string;
|
|
66
|
+
/** All sitemap entries aggregated */
|
|
67
|
+
allSitemapEntries: PluginSitemapEntry[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Query key for route docs schema
|
|
72
|
+
*/
|
|
73
|
+
declare const ROUTE_DOCS_QUERY_KEY: readonly ["route-docs", "schema"];
|
|
74
|
+
/**
|
|
75
|
+
* Get the stored client stack context
|
|
76
|
+
* Used by the docs page component to generate schema on client-side navigation
|
|
77
|
+
*/
|
|
78
|
+
declare function getStoredContext(): ClientStackContext | null;
|
|
79
|
+
/**
|
|
80
|
+
* Generate the route docs schema from the stored context
|
|
81
|
+
* This can be called from both server and client
|
|
82
|
+
*/
|
|
83
|
+
declare function generateSchema(): Promise<RouteDocsSchema>;
|
|
84
|
+
/**
|
|
85
|
+
* Configuration for Route Docs client plugin
|
|
86
|
+
*/
|
|
87
|
+
interface RouteDocsClientConfig {
|
|
88
|
+
/** React Query client for SSR prefetching */
|
|
89
|
+
queryClient: QueryClient;
|
|
90
|
+
/** Title for the documentation page */
|
|
91
|
+
title?: string;
|
|
92
|
+
/** Description for the documentation page */
|
|
93
|
+
description?: string;
|
|
94
|
+
/** Site base path for constructing URLs (e.g., "/pages") */
|
|
95
|
+
siteBasePath: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Route Docs client plugin
|
|
99
|
+
* Provides a route that displays documentation for all client routes
|
|
100
|
+
*/
|
|
101
|
+
declare const routeDocsClientPlugin: (config: RouteDocsClientConfig) => _btst_stack_plugins_client.ClientPlugin<Record<string, never>, {
|
|
102
|
+
docs: {
|
|
103
|
+
(inputCtx_0?: _btst_yar.InputContext<"/route-docs", _btst_yar.RouteOptions> | undefined): {
|
|
104
|
+
PageComponent?: react.ComponentType<unknown> | undefined;
|
|
105
|
+
LoadingComponent?: react.ComponentType<unknown> | undefined;
|
|
106
|
+
ErrorComponent?: react.ComponentType<unknown> | undefined;
|
|
107
|
+
loader?: (() => Promise<void>) | undefined;
|
|
108
|
+
meta?: (() => ({
|
|
109
|
+
title: string;
|
|
110
|
+
name?: undefined;
|
|
111
|
+
content?: undefined;
|
|
112
|
+
} | {
|
|
113
|
+
name: string;
|
|
114
|
+
content: string;
|
|
115
|
+
title?: undefined;
|
|
116
|
+
})[]) | undefined;
|
|
117
|
+
extra?: (() => any) | undefined;
|
|
118
|
+
};
|
|
119
|
+
options: _btst_yar.RouteOptions | undefined;
|
|
120
|
+
path: "/route-docs";
|
|
121
|
+
meta: _btst_yar.RouteMeta | undefined;
|
|
122
|
+
};
|
|
123
|
+
}>;
|
|
124
|
+
|
|
125
|
+
export { ROUTE_DOCS_QUERY_KEY, generateSchema, getStoredContext, routeDocsClientPlugin };
|
|
126
|
+
export type { RouteDocsClientConfig };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as _btst_stack_plugins_client from '@btst/stack/plugins/client';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import * as _btst_yar from '@btst/yar';
|
|
4
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
5
|
+
import { S as SitemapEntry, b as ClientStackContext } from '../../../shared/stack.u9iYV6vt.mjs';
|
|
6
|
+
import '@btst/db';
|
|
7
|
+
import 'better-call';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Represents a documented route parameter
|
|
11
|
+
*/
|
|
12
|
+
interface RouteParameter {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
description?: string;
|
|
17
|
+
schema?: Record<string, any>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Sitemap entry with plugin source
|
|
21
|
+
*/
|
|
22
|
+
interface PluginSitemapEntry extends SitemapEntry {
|
|
23
|
+
pluginKey: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Represents a documented route
|
|
27
|
+
*/
|
|
28
|
+
interface DocumentedRoute {
|
|
29
|
+
/** Route key from the plugin */
|
|
30
|
+
key: string;
|
|
31
|
+
/** The route path pattern (e.g., "/users/:id") */
|
|
32
|
+
path: string;
|
|
33
|
+
/** Path parameters extracted from the path */
|
|
34
|
+
pathParams: RouteParameter[];
|
|
35
|
+
/** Query parameters from the route's query schema */
|
|
36
|
+
queryParams: RouteParameter[];
|
|
37
|
+
/** Route metadata */
|
|
38
|
+
meta?: {
|
|
39
|
+
title?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
tags?: string[];
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Represents a plugin's documented routes
|
|
47
|
+
*/
|
|
48
|
+
interface DocumentedPlugin {
|
|
49
|
+
/** Plugin key */
|
|
50
|
+
key: string;
|
|
51
|
+
/** Plugin name */
|
|
52
|
+
name: string;
|
|
53
|
+
/** Routes from this plugin */
|
|
54
|
+
routes: DocumentedRoute[];
|
|
55
|
+
/** Sitemap entries from this plugin */
|
|
56
|
+
sitemapEntries: PluginSitemapEntry[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The complete route documentation schema
|
|
60
|
+
*/
|
|
61
|
+
interface RouteDocsSchema {
|
|
62
|
+
/** All documented plugins */
|
|
63
|
+
plugins: DocumentedPlugin[];
|
|
64
|
+
/** Generation timestamp */
|
|
65
|
+
generatedAt: string;
|
|
66
|
+
/** All sitemap entries aggregated */
|
|
67
|
+
allSitemapEntries: PluginSitemapEntry[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Query key for route docs schema
|
|
72
|
+
*/
|
|
73
|
+
declare const ROUTE_DOCS_QUERY_KEY: readonly ["route-docs", "schema"];
|
|
74
|
+
/**
|
|
75
|
+
* Get the stored client stack context
|
|
76
|
+
* Used by the docs page component to generate schema on client-side navigation
|
|
77
|
+
*/
|
|
78
|
+
declare function getStoredContext(): ClientStackContext | null;
|
|
79
|
+
/**
|
|
80
|
+
* Generate the route docs schema from the stored context
|
|
81
|
+
* This can be called from both server and client
|
|
82
|
+
*/
|
|
83
|
+
declare function generateSchema(): Promise<RouteDocsSchema>;
|
|
84
|
+
/**
|
|
85
|
+
* Configuration for Route Docs client plugin
|
|
86
|
+
*/
|
|
87
|
+
interface RouteDocsClientConfig {
|
|
88
|
+
/** React Query client for SSR prefetching */
|
|
89
|
+
queryClient: QueryClient;
|
|
90
|
+
/** Title for the documentation page */
|
|
91
|
+
title?: string;
|
|
92
|
+
/** Description for the documentation page */
|
|
93
|
+
description?: string;
|
|
94
|
+
/** Site base path for constructing URLs (e.g., "/pages") */
|
|
95
|
+
siteBasePath: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Route Docs client plugin
|
|
99
|
+
* Provides a route that displays documentation for all client routes
|
|
100
|
+
*/
|
|
101
|
+
declare const routeDocsClientPlugin: (config: RouteDocsClientConfig) => _btst_stack_plugins_client.ClientPlugin<Record<string, never>, {
|
|
102
|
+
docs: {
|
|
103
|
+
(inputCtx_0?: _btst_yar.InputContext<"/route-docs", _btst_yar.RouteOptions> | undefined): {
|
|
104
|
+
PageComponent?: react.ComponentType<unknown> | undefined;
|
|
105
|
+
LoadingComponent?: react.ComponentType<unknown> | undefined;
|
|
106
|
+
ErrorComponent?: react.ComponentType<unknown> | undefined;
|
|
107
|
+
loader?: (() => Promise<void>) | undefined;
|
|
108
|
+
meta?: (() => ({
|
|
109
|
+
title: string;
|
|
110
|
+
name?: undefined;
|
|
111
|
+
content?: undefined;
|
|
112
|
+
} | {
|
|
113
|
+
name: string;
|
|
114
|
+
content: string;
|
|
115
|
+
title?: undefined;
|
|
116
|
+
})[]) | undefined;
|
|
117
|
+
extra?: (() => any) | undefined;
|
|
118
|
+
};
|
|
119
|
+
options: _btst_yar.RouteOptions | undefined;
|
|
120
|
+
path: "/route-docs";
|
|
121
|
+
meta: _btst_yar.RouteMeta | undefined;
|
|
122
|
+
};
|
|
123
|
+
}>;
|
|
124
|
+
|
|
125
|
+
export { ROUTE_DOCS_QUERY_KEY, generateSchema, getStoredContext, routeDocsClientPlugin };
|
|
126
|
+
export type { RouteDocsClientConfig };
|