@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.
Files changed (67) hide show
  1. package/dist/api/index.d.cts +2 -2
  2. package/dist/api/index.d.mts +2 -2
  3. package/dist/api/index.d.ts +2 -2
  4. package/dist/client/index.cjs +6 -2
  5. package/dist/client/index.d.cts +2 -1
  6. package/dist/client/index.d.mts +2 -1
  7. package/dist/client/index.d.ts +2 -1
  8. package/dist/client/index.mjs +6 -2
  9. package/dist/index.d.cts +1 -1
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/packages/better-stack/src/plugins/route-docs/client/components/loading/docs-skeleton.cjs +43 -0
  13. package/dist/packages/better-stack/src/plugins/route-docs/client/components/loading/docs-skeleton.mjs +41 -0
  14. package/dist/packages/better-stack/src/plugins/route-docs/client/components/pages/docs-page.cjs +794 -0
  15. package/dist/packages/better-stack/src/plugins/route-docs/client/components/pages/docs-page.mjs +788 -0
  16. package/dist/packages/better-stack/src/plugins/route-docs/client/plugin.cjs +111 -0
  17. package/dist/packages/better-stack/src/plugins/route-docs/client/plugin.mjs +106 -0
  18. package/dist/packages/better-stack/src/plugins/route-docs/generator.cjs +244 -0
  19. package/dist/packages/better-stack/src/plugins/route-docs/generator.mjs +227 -0
  20. package/dist/packages/ui/src/components/sheet.cjs +25 -0
  21. package/dist/packages/ui/src/components/sheet.mjs +24 -1
  22. package/dist/plugins/api/index.d.cts +2 -2
  23. package/dist/plugins/api/index.d.mts +2 -2
  24. package/dist/plugins/api/index.d.ts +2 -2
  25. package/dist/plugins/blog/api/index.d.cts +1 -1
  26. package/dist/plugins/blog/api/index.d.mts +1 -1
  27. package/dist/plugins/blog/api/index.d.ts +1 -1
  28. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  29. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  30. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  31. package/dist/plugins/blog/client/index.d.cts +1 -1
  32. package/dist/plugins/blog/client/index.d.mts +1 -1
  33. package/dist/plugins/blog/client/index.d.ts +1 -1
  34. package/dist/plugins/blog/query-keys.d.cts +2 -2
  35. package/dist/plugins/blog/query-keys.d.mts +2 -2
  36. package/dist/plugins/blog/query-keys.d.ts +2 -2
  37. package/dist/plugins/client/index.d.cts +2 -2
  38. package/dist/plugins/client/index.d.mts +2 -2
  39. package/dist/plugins/client/index.d.ts +2 -2
  40. package/dist/plugins/open-api/api/index.d.cts +1 -1
  41. package/dist/plugins/open-api/api/index.d.mts +1 -1
  42. package/dist/plugins/open-api/api/index.d.ts +1 -1
  43. package/dist/plugins/route-docs/client/index.cjs +10 -0
  44. package/dist/plugins/route-docs/client/index.d.cts +126 -0
  45. package/dist/plugins/route-docs/client/index.d.mts +126 -0
  46. package/dist/plugins/route-docs/client/index.d.ts +126 -0
  47. package/dist/plugins/route-docs/client/index.mjs +1 -0
  48. package/dist/plugins/route-docs/client.css +3 -0
  49. package/dist/plugins/route-docs/style.css +19 -0
  50. package/dist/shared/{stack.CSce37mX.d.cts → stack.u9iYV6vt.d.cts} +14 -2
  51. package/dist/shared/{stack.CSce37mX.d.mts → stack.u9iYV6vt.d.mts} +14 -2
  52. package/dist/shared/{stack.CSce37mX.d.ts → stack.u9iYV6vt.d.ts} +14 -2
  53. package/package.json +15 -1
  54. package/src/client/index.ts +11 -4
  55. package/src/plugins/route-docs/client/components/loading/docs-skeleton.tsx +82 -0
  56. package/src/plugins/route-docs/client/components/loading/index.tsx +1 -0
  57. package/src/plugins/route-docs/client/components/pages/docs-page.tsx +1240 -0
  58. package/src/plugins/route-docs/client/index.ts +7 -0
  59. package/src/plugins/route-docs/client/plugin.tsx +187 -0
  60. package/src/plugins/route-docs/client.css +3 -0
  61. package/src/plugins/route-docs/generator.ts +385 -0
  62. package/src/plugins/route-docs/index.ts +12 -0
  63. package/src/plugins/route-docs/style.css +19 -0
  64. package/src/types.ts +19 -1
  65. package/dist/shared/{stack.CcI4sYJP.d.mts → stack.DLhzx1-D.d.cts} +1 -1
  66. package/dist/shared/{stack.CcI4sYJP.d.ts → stack.DLhzx1-D.d.mts} +1 -1
  67. package/dist/shared/{stack.CcI4sYJP.d.cts → stack.DLhzx1-D.d.ts} +1 -1
@@ -1,5 +1,5 @@
1
- import { e as PrefixedPluginRoutes, f as BackendLibConfig, g as BackendLib } from '../shared/stack.CSce37mX.cjs';
2
- export { B as BackendPlugin, a as BetterStackContext } from '../shared/stack.CSce37mX.cjs';
1
+ import { g as PrefixedPluginRoutes, h as BackendLibConfig, i as BackendLib } from '../shared/stack.u9iYV6vt.cjs';
2
+ export { B as BackendPlugin, a as BetterStackContext } from '../shared/stack.u9iYV6vt.cjs';
3
3
  export { toNodeHandler } from 'better-call/node';
4
4
  import '@btst/yar';
5
5
  import '@btst/db';
@@ -1,5 +1,5 @@
1
- import { e as PrefixedPluginRoutes, f as BackendLibConfig, g as BackendLib } from '../shared/stack.CSce37mX.mjs';
2
- export { B as BackendPlugin, a as BetterStackContext } from '../shared/stack.CSce37mX.mjs';
1
+ import { g as PrefixedPluginRoutes, h as BackendLibConfig, i as BackendLib } from '../shared/stack.u9iYV6vt.mjs';
2
+ export { B as BackendPlugin, a as BetterStackContext } from '../shared/stack.u9iYV6vt.mjs';
3
3
  export { toNodeHandler } from 'better-call/node';
4
4
  import '@btst/yar';
5
5
  import '@btst/db';
@@ -1,5 +1,5 @@
1
- import { e as PrefixedPluginRoutes, f as BackendLibConfig, g as BackendLib } from '../shared/stack.CSce37mX.js';
2
- export { B as BackendPlugin, a as BetterStackContext } from '../shared/stack.CSce37mX.js';
1
+ import { g as PrefixedPluginRoutes, h as BackendLibConfig, i as BackendLib } from '../shared/stack.u9iYV6vt.js';
2
+ export { B as BackendPlugin, a as BetterStackContext } from '../shared/stack.u9iYV6vt.js';
3
3
  export { toNodeHandler } from 'better-call/node';
4
4
  import '@btst/yar';
5
5
  import '@btst/db';
@@ -6,10 +6,14 @@ const metaUtils = require('../packages/better-stack/src/client/meta-utils.cjs');
6
6
  const pathUtils = require('../packages/better-stack/src/client/path-utils.cjs');
7
7
 
8
8
  function createStackClient(config) {
9
- const { plugins } = config;
9
+ const { plugins, basePath } = config;
10
10
  const allRoutes = {};
11
+ const clientStackContext = {
12
+ plugins,
13
+ basePath
14
+ };
11
15
  for (const [pluginKey, plugin] of Object.entries(plugins)) {
12
- const pluginRoutes = plugin.routes();
16
+ const pluginRoutes = plugin.routes(clientStackContext);
13
17
  Object.assign(allRoutes, pluginRoutes);
14
18
  }
15
19
  const router = yar.createRouter(allRoutes);
@@ -1,4 +1,5 @@
1
- import { S as Sitemap, C as ClientPlugin, b as PluginRoutes, c as ClientLibConfig, d as ClientLib } from '../shared/stack.CSce37mX.cjs';
1
+ import { c as Sitemap, C as ClientPlugin, d as PluginRoutes, e as ClientLibConfig, f as ClientLib } from '../shared/stack.u9iYV6vt.cjs';
2
+ export { b as ClientStackContext } from '../shared/stack.u9iYV6vt.cjs';
2
3
  import '@btst/yar';
3
4
  import '@btst/db';
4
5
  import 'better-call';
@@ -1,4 +1,5 @@
1
- import { S as Sitemap, C as ClientPlugin, b as PluginRoutes, c as ClientLibConfig, d as ClientLib } from '../shared/stack.CSce37mX.mjs';
1
+ import { c as Sitemap, C as ClientPlugin, d as PluginRoutes, e as ClientLibConfig, f as ClientLib } from '../shared/stack.u9iYV6vt.mjs';
2
+ export { b as ClientStackContext } from '../shared/stack.u9iYV6vt.mjs';
2
3
  import '@btst/yar';
3
4
  import '@btst/db';
4
5
  import 'better-call';
@@ -1,4 +1,5 @@
1
- import { S as Sitemap, C as ClientPlugin, b as PluginRoutes, c as ClientLibConfig, d as ClientLib } from '../shared/stack.CSce37mX.js';
1
+ import { c as Sitemap, C as ClientPlugin, d as PluginRoutes, e as ClientLibConfig, f as ClientLib } from '../shared/stack.u9iYV6vt.js';
2
+ export { b as ClientStackContext } from '../shared/stack.u9iYV6vt.js';
2
3
  import '@btst/yar';
3
4
  import '@btst/db';
4
5
  import 'better-call';
@@ -4,10 +4,14 @@ export { metaElementsToObject } from '../packages/better-stack/src/client/meta-u
4
4
  export { normalizePath } from '../packages/better-stack/src/client/path-utils.mjs';
5
5
 
6
6
  function createStackClient(config) {
7
- const { plugins } = config;
7
+ const { plugins, basePath } = config;
8
8
  const allRoutes = {};
9
+ const clientStackContext = {
10
+ plugins,
11
+ basePath
12
+ };
9
13
  for (const [pluginKey, plugin] of Object.entries(plugins)) {
10
- const pluginRoutes = plugin.routes();
14
+ const pluginRoutes = plugin.routes(clientStackContext);
11
15
  Object.assign(allRoutes, pluginRoutes);
12
16
  }
13
17
  const router = createRouter(allRoutes);
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { betterStack } from './api/index.cjs';
2
2
  export { toNodeHandler } from 'better-call/node';
3
- export { g as BackendLib, f as BackendLibConfig, B as BackendPlugin, a as BetterStackContext } from './shared/stack.CSce37mX.cjs';
3
+ export { i as BackendLib, h as BackendLibConfig, B as BackendPlugin, a as BetterStackContext } from './shared/stack.u9iYV6vt.cjs';
4
4
  import '@btst/yar';
5
5
  import '@btst/db';
6
6
  import 'better-call';
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { betterStack } from './api/index.mjs';
2
2
  export { toNodeHandler } from 'better-call/node';
3
- export { g as BackendLib, f as BackendLibConfig, B as BackendPlugin, a as BetterStackContext } from './shared/stack.CSce37mX.mjs';
3
+ export { i as BackendLib, h as BackendLibConfig, B as BackendPlugin, a as BetterStackContext } from './shared/stack.u9iYV6vt.mjs';
4
4
  import '@btst/yar';
5
5
  import '@btst/db';
6
6
  import 'better-call';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { betterStack } from './api/index.js';
2
2
  export { toNodeHandler } from 'better-call/node';
3
- export { g as BackendLib, f as BackendLibConfig, B as BackendPlugin, a as BetterStackContext } from './shared/stack.CSce37mX.js';
3
+ export { i as BackendLib, h as BackendLibConfig, B as BackendPlugin, a as BetterStackContext } from './shared/stack.u9iYV6vt.js';
4
4
  import '@btst/yar';
5
5
  import '@btst/db';
6
6
  import 'better-call';
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ const jsxRuntime = require('react/jsx-runtime');
5
+ const skeleton = require('../../../../../../../ui/src/components/skeleton.cjs');
6
+ const scrollArea = require('../../../../../../../ui/src/components/scroll-area.cjs');
7
+ const card = require('../../../../../../../ui/src/components/card.cjs');
8
+
9
+ function DocsPageSkeleton() {
10
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-screen bg-background", children: [
11
+ /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "hidden md:block w-72 border-r bg-card shrink-0", children: [
12
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b", children: /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-16" }) }),
13
+ /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea, { className: "h-[calc(100vh-57px)]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
14
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 w-full" }),
15
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-2 space-y-1", children: [1, 2, 3].map((j) => /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-7 w-full" }, j)) })
16
+ ] }, i)) }) })
17
+ ] }),
18
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:hidden fixed top-0 left-0 right-0 z-40 bg-card border-b", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-4", children: [
19
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-24" }),
20
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 w-20" })
21
+ ] }) }),
22
+ /* @__PURE__ */ jsxRuntime.jsx("main", { className: "flex-1 overflow-auto pt-16 md:pt-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-4xl mx-auto p-4 sm:p-6 lg:p-8 space-y-4 sm:space-y-6", children: [
23
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
24
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 sm:h-9 w-48 sm:w-64" }),
25
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 sm:h-5 w-72 sm:w-96" })
26
+ ] }),
27
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-px bg-border" }),
28
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
29
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-6 w-24" }),
30
+ /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-6 w-20" })
31
+ ] }),
32
+ /* @__PURE__ */ jsxRuntime.jsxs(card.Card, { children: [
33
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 sm:p-6", children: /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-6 w-32 mb-4" }) }),
34
+ /* @__PURE__ */ jsxRuntime.jsxs(card.CardContent, { className: "pt-0 space-y-4", children: [
35
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden md:block space-y-2", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-12 w-full" }, i)) }),
36
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:hidden space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-28 w-full rounded-lg" }, i)) })
37
+ ] })
38
+ ] })
39
+ ] }) })
40
+ ] });
41
+ }
42
+
43
+ exports.DocsPageSkeleton = DocsPageSkeleton;
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { Skeleton } from '../../../../../../../ui/src/components/skeleton.mjs';
4
+ import { ScrollArea } from '../../../../../../../ui/src/components/scroll-area.mjs';
5
+ import { Card, CardContent } from '../../../../../../../ui/src/components/card.mjs';
6
+
7
+ function DocsPageSkeleton() {
8
+ return /* @__PURE__ */ jsxs("div", { className: "flex min-h-screen bg-background", children: [
9
+ /* @__PURE__ */ jsxs("aside", { className: "hidden md:block w-72 border-r bg-card shrink-0", children: [
10
+ /* @__PURE__ */ jsx("div", { className: "p-4 border-b", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16" }) }),
11
+ /* @__PURE__ */ jsx(ScrollArea, { className: "h-[calc(100vh-57px)]", children: /* @__PURE__ */ jsx("div", { className: "p-3 space-y-4", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
12
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-full" }),
13
+ /* @__PURE__ */ jsx("div", { className: "ml-2 space-y-1", children: [1, 2, 3].map((j) => /* @__PURE__ */ jsx(Skeleton, { className: "h-7 w-full" }, j)) })
14
+ ] }, i)) }) })
15
+ ] }),
16
+ /* @__PURE__ */ jsx("div", { className: "md:hidden fixed top-0 left-0 right-0 z-40 bg-card border-b", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4", children: [
17
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }),
18
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-20" })
19
+ ] }) }),
20
+ /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto pt-16 md:pt-0", children: /* @__PURE__ */ jsxs("div", { className: "max-w-4xl mx-auto p-4 sm:p-6 lg:p-8 space-y-4 sm:space-y-6", children: [
21
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
22
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 sm:h-9 w-48 sm:w-64" }),
23
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 sm:h-5 w-72 sm:w-96" })
24
+ ] }),
25
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-border" }),
26
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
27
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-24" }),
28
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-20" })
29
+ ] }),
30
+ /* @__PURE__ */ jsxs(Card, { children: [
31
+ /* @__PURE__ */ jsx("div", { className: "p-4 sm:p-6", children: /* @__PURE__ */ jsx(Skeleton, { className: "h-6 w-32 mb-4" }) }),
32
+ /* @__PURE__ */ jsxs(CardContent, { className: "pt-0 space-y-4", children: [
33
+ /* @__PURE__ */ jsx("div", { className: "hidden md:block space-y-2", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }, i)) }),
34
+ /* @__PURE__ */ jsx("div", { className: "md:hidden space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx(Skeleton, { className: "h-28 w-full rounded-lg" }, i)) })
35
+ ] })
36
+ ] })
37
+ ] }) })
38
+ ] });
39
+ }
40
+
41
+ export { DocsPageSkeleton };