@eqtylab/docs 0.3.1 → 0.3.2
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/runtime/chrome/GlobalSearch.module.css +26 -0
- package/dist/runtime/chrome/GlobalSearch.tsx +422 -0
- package/dist/runtime/chrome/Header.astro +105 -0
- package/dist/runtime/chrome/LinkIcon.astro +35 -0
- package/dist/runtime/chrome/NavDrawer.astro +60 -0
- package/dist/runtime/chrome/NavTree.astro +112 -0
- package/dist/runtime/chrome/NotFoundBody.tsx +12 -0
- package/dist/runtime/chrome/PageFooter.astro +80 -0
- package/dist/runtime/chrome/Prose.astro +169 -0
- package/dist/runtime/chrome/Sidebar.astro +21 -0
- package/dist/runtime/chrome/TableOfContents.astro +86 -0
- package/dist/runtime/chrome/ThemeToggle.tsx +85 -0
- package/dist/runtime/chrome/TocElbow.astro +30 -0
- package/dist/runtime/chrome/TocList.astro +43 -0
- package/dist/runtime/components/AlertBridge.astro +16 -0
- package/dist/runtime/components/CodeFence.astro +38 -0
- package/dist/runtime/components/CodeFenceBridge.astro +20 -0
- package/dist/runtime/components/Link.astro +21 -0
- package/dist/runtime/components/TabItem.astro +16 -0
- package/dist/runtime/components/TableBridge.astro +18 -0
- package/dist/runtime/components/Tabs.astro +121 -0
- package/dist/runtime/components/TabsBridge.tsx +41 -0
- package/dist/runtime/components/index.ts +4 -0
- package/dist/runtime/layouts/DocsPage.astro +50 -0
- package/dist/runtime/layouts/DocsShell.astro +92 -0
- package/dist/runtime/lib/mdx-components.ts +49 -0
- package/dist/runtime/lib/nav-data.ts +74 -0
- package/dist/runtime/lib/summary.ts +57 -0
- package/dist/runtime/lib/theme.ts +84 -0
- package/dist/runtime/routes/docs-md.ts +33 -0
- package/dist/runtime/routes/docs.astro +92 -0
- package/dist/runtime/routes/llms-txt.ts +38 -0
- package/dist/runtime/routes/not-found.astro +16 -0
- package/dist/runtime/scripts/eq-copy.ts +27 -0
- package/dist/runtime/scripts/eq-highlight.ts +24 -0
- package/dist/runtime/scripts/eq-nav-drawer.ts +31 -0
- package/dist/runtime/scripts/eq-nav-group.ts +52 -0
- package/dist/runtime/scripts/eq-tabs.ts +114 -0
- package/dist/runtime/scripts/eq-toc.ts +166 -0
- package/dist/runtime/styles/chrome.css +30 -0
- package/dist/runtime/styles/prose.css +102 -0
- package/dist/runtime/styles/theme.css +2 -0
- package/dist/runtime/styles/utilities.css +38 -0
- package/package.json +1 -1
- package/dist/chunk-ATIOPYKE.js +0 -102
- package/dist/chunk-ATIOPYKE.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* Shared geometry and the variants the chrome needs; component styling is inline
|
|
2
|
+
* Tailwind in the markup. */
|
|
3
|
+
@reference './theme.css';
|
|
4
|
+
|
|
5
|
+
/* The mirror of Equality's own `dark` variant. Needed because the logo and the header
|
|
6
|
+
* link marks ship white, so light is the theme that has to invert them. */
|
|
7
|
+
@custom-variant light (&:where(html[data-equality-theme=light], html[data-equality-theme=light] *));
|
|
8
|
+
|
|
9
|
+
/* Equality's hover fires on `:focus` rather than `:focus-visible`, so a mouse click
|
|
10
|
+
* leaves a control filled as if it were the current page. This undoes it for pointer
|
|
11
|
+
* focus only, leaving the keyboard ring intact. */
|
|
12
|
+
@custom-variant pointer-focus (&:focus:not(:focus-visible));
|
|
13
|
+
|
|
14
|
+
:root {
|
|
15
|
+
--eq-docs-header-height: 4.3125rem;
|
|
16
|
+
--eq-docs-sidebar-width: 18rem;
|
|
17
|
+
--eq-docs-toc-width: 15rem;
|
|
18
|
+
--eq-docs-content-max: 48rem;
|
|
19
|
+
/* eqtylab.io's display-text fade, on tokens so light gets the inverse for free.
|
|
20
|
+
* Used by the header label and the page title. */
|
|
21
|
+
--eq-docs-display-gradient: linear-gradient(
|
|
22
|
+
135deg,
|
|
23
|
+
var(--color-text-primary),
|
|
24
|
+
var(--color-background) 175%
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body {
|
|
29
|
+
@apply bg-background text-text-primary;
|
|
30
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Docs typography.
|
|
3
|
+
*
|
|
4
|
+
* Only what the page itself wrote is styled, marked `data-eq-md` by `rehypeProseScope`.
|
|
5
|
+
* Drop that guard and every component's children get typeset as body copy.
|
|
6
|
+
*
|
|
7
|
+
* Both guards sit inside :where(), so a consumer can override without !important.
|
|
8
|
+
*/
|
|
9
|
+
@reference './theme.css';
|
|
10
|
+
|
|
11
|
+
.eq-prose {
|
|
12
|
+
& > :first-child {
|
|
13
|
+
@apply mt-0;
|
|
14
|
+
}
|
|
15
|
+
& > :last-child {
|
|
16
|
+
@apply mb-0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
& :where([data-eq-md]):not(:where([data-eq-chrome], [data-eq-chrome] *)) {
|
|
20
|
+
&:is(h1, h2, h3, h4, h5, h6) {
|
|
21
|
+
@apply scroll-mt-24;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:is(h1) {
|
|
25
|
+
@apply mb-3 mt-12 text-4xl font-bold;
|
|
26
|
+
& > code {
|
|
27
|
+
@apply text-3xl;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
&:is(h2) {
|
|
31
|
+
@apply mb-3 mt-12 text-2xl font-semibold;
|
|
32
|
+
& > code {
|
|
33
|
+
@apply text-xl;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
&:is(h3) {
|
|
37
|
+
@apply mb-3 mt-8 text-xl font-medium;
|
|
38
|
+
& > code {
|
|
39
|
+
@apply text-lg;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
&:is(h4) {
|
|
43
|
+
@apply mb-3 mt-6 text-lg font-medium;
|
|
44
|
+
& > code {
|
|
45
|
+
@apply text-base;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
&:is(h5) {
|
|
49
|
+
@apply mb-3 mt-6 text-base font-medium;
|
|
50
|
+
& > code {
|
|
51
|
+
@apply text-sm;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
&:is(h6) {
|
|
55
|
+
@apply mb-3 mt-6 text-sm font-medium;
|
|
56
|
+
& > code {
|
|
57
|
+
@apply text-xs;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* 16px, which has to stay wider than the 28px line height inside a paragraph,
|
|
62
|
+
* or consecutive blocks read as one. */
|
|
63
|
+
&:is(p) {
|
|
64
|
+
@apply text-text-secondary mb-4 text-base/7 font-normal;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:is(p, li) &:is(b, strong) {
|
|
68
|
+
@apply text-text-primary font-medium;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:is(ul, ol) {
|
|
72
|
+
@apply text-text-secondary mb-4 pl-4;
|
|
73
|
+
|
|
74
|
+
/* Never `space-y-*` here: it unbalances against the `:not(:where(...))` above
|
|
75
|
+
* and compiles to a rule the browser throws away, leaving items unspaced. */
|
|
76
|
+
& > li + li {
|
|
77
|
+
@apply mt-2;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
&:is(ul) {
|
|
81
|
+
@apply list-disc;
|
|
82
|
+
}
|
|
83
|
+
&:is(ol) {
|
|
84
|
+
@apply list-decimal;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:is(a) {
|
|
88
|
+
@apply text-text-primary hover:text-lilac-400 font-medium underline underline-offset-4 transition-all;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Inline code, but never the contents of a highlighted block. */
|
|
92
|
+
:not(pre) > &:is(code) {
|
|
93
|
+
@apply dark:bg-background-overlay bg-greyscale-200 text-text-secondary rounded-sm p-1 text-sm;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* No table rules: markdown tables render through Equality's Table. */
|
|
97
|
+
|
|
98
|
+
&:is(hr) {
|
|
99
|
+
@apply border-border mb-4;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Class recipes shared by more than one piece of chrome. Real utilities, so the markup
|
|
3
|
+
* stays inline everywhere else and the recipe still has one definition.
|
|
4
|
+
*/
|
|
5
|
+
@reference './theme.css';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The header bar's control geometry, shared so the links and the theme toggle cannot
|
|
9
|
+
* drift apart. `display` is deliberately absent: the links are flex rows and the theme
|
|
10
|
+
* toggle is a one-cell grid, and a display utility in here would collide with theirs.
|
|
11
|
+
*/
|
|
12
|
+
@utility eq-nav-control {
|
|
13
|
+
@apply text-text-secondary hover:text-text-primary hover:bg-background;
|
|
14
|
+
@apply h-10 items-center gap-1.5 rounded-md px-3;
|
|
15
|
+
@apply text-sm font-medium no-underline transition-colors;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* eqtylab.io's display-text fade, used by the header label and the page title.
|
|
20
|
+
*
|
|
21
|
+
* Callers add their own `forced-colors:text-*`: the header label inherits, the page
|
|
22
|
+
* title names a token, so the solid colour cannot live in here.
|
|
23
|
+
*/
|
|
24
|
+
@utility eq-display-gradient {
|
|
25
|
+
@apply bg-[image:var(--eq-docs-display-gradient)] bg-clip-text text-transparent;
|
|
26
|
+
/* Clipping the gradient to the text crops descenders without this. */
|
|
27
|
+
@apply py-[0.05em];
|
|
28
|
+
-webkit-background-clip: text;
|
|
29
|
+
-webkit-text-fill-color: transparent;
|
|
30
|
+
|
|
31
|
+
/* Windows High Contrast and similar modes drop the gradient but keep the transparent
|
|
32
|
+
* fill, so the text would vanish. This puts the paint back; the caller supplies the
|
|
33
|
+
* colour. */
|
|
34
|
+
@media (forced-colors: active) {
|
|
35
|
+
background-image: none;
|
|
36
|
+
-webkit-text-fill-color: currentColor;
|
|
37
|
+
}
|
|
38
|
+
}
|
package/package.json
CHANGED
package/dist/chunk-ATIOPYKE.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { z } from 'astro/zod';
|
|
2
|
-
|
|
3
|
-
// src/config.ts
|
|
4
|
-
var headerLink = z.object({
|
|
5
|
-
label: z.string(),
|
|
6
|
-
href: z.string(),
|
|
7
|
-
/**
|
|
8
|
-
* A Lucide name like `BookOpen`, or a path to an SVG in `public/` like
|
|
9
|
-
* `/github.svg`. An SVG must be white: light mode inverts it.
|
|
10
|
-
*/
|
|
11
|
-
icon: z.string().optional(),
|
|
12
|
-
external: z.boolean().optional()
|
|
13
|
-
});
|
|
14
|
-
var docsConfigSchema = z.object({
|
|
15
|
-
/** Site name, shown in the header and used as the `<title>` suffix. */
|
|
16
|
-
title: z.string(),
|
|
17
|
-
description: z.string().optional(),
|
|
18
|
-
/** Path to a favicon, relative to `public/`. Base is applied automatically. */
|
|
19
|
-
favicon: z.string().default("/favicon.svg"),
|
|
20
|
-
/**
|
|
21
|
-
* The header mark. Without one the header falls back to `title` as text. Either
|
|
22
|
-
* way a constant "Docs" label follows it, and `title` heads the sidebar.
|
|
23
|
-
*/
|
|
24
|
-
logo: z.object({
|
|
25
|
-
src: z.string(),
|
|
26
|
-
/** Name the company: the brand link reads as this plus "Docs". */
|
|
27
|
-
alt: z.string().default("")
|
|
28
|
-
}).optional(),
|
|
29
|
-
/** Content directory, relative to `src/`. */
|
|
30
|
-
contentDir: z.string().default("content/docs"),
|
|
31
|
-
/** Mount docs under a sub-path, e.g. 'docs' for /docs/*. Empty means the site root. */
|
|
32
|
-
pathPrefix: z.string().default(""),
|
|
33
|
-
sidebar: z.object({
|
|
34
|
-
/** Default collapse state for groups with no explicit `collapsed`. */
|
|
35
|
-
collapsed: z.boolean().default(false),
|
|
36
|
-
/** Default append order for children absent from a group's `order`. */
|
|
37
|
-
sort: z.enum(["alpha", "filename", "manual"]).default("alpha"),
|
|
38
|
-
/** Extra top-level nodes, appended after folder-derived ones. */
|
|
39
|
-
extra: z.array(z.any()).default([])
|
|
40
|
-
}).prefault({}),
|
|
41
|
-
header: z.object({
|
|
42
|
-
links: z.array(headerLink).default([]),
|
|
43
|
-
showThemeToggle: z.boolean().default(true)
|
|
44
|
-
}).prefault({}),
|
|
45
|
-
footer: z.object({
|
|
46
|
-
/** Base URL for "Edit this page"; the content path is appended. */
|
|
47
|
-
editUrl: z.string().optional(),
|
|
48
|
-
showPrevNext: z.boolean().default(true),
|
|
49
|
-
text: z.string().optional()
|
|
50
|
-
}).prefault({}),
|
|
51
|
-
tableOfContents: z.union([
|
|
52
|
-
z.object({
|
|
53
|
-
minLevel: z.number().int().min(1).max(6).default(2),
|
|
54
|
-
maxLevel: z.number().int().min(1).max(6).default(3)
|
|
55
|
-
}),
|
|
56
|
-
z.literal(false)
|
|
57
|
-
]).prefault({}),
|
|
58
|
-
code: z.object({
|
|
59
|
-
/** 'codeblock' renders fences through Equality's CodeBlock; 'shiki' uses Astro's Shiki. */
|
|
60
|
-
highlighter: z.enum(["codeblock", "shiki"]).default("codeblock"),
|
|
61
|
-
/** Shiki themes; only consulted when `highlighter` is 'shiki'. */
|
|
62
|
-
themes: z.object({ light: z.string(), dark: z.string() }).default({ light: "github-light", dark: "github-dark" }),
|
|
63
|
-
wrap: z.boolean().default(false),
|
|
64
|
-
langs: z.array(z.string()).default([])
|
|
65
|
-
}).prefault({}),
|
|
66
|
-
search: z.object({
|
|
67
|
-
/** 'pagefind' indexes the built HTML. Dev serves that index, so it needs one build. */
|
|
68
|
-
provider: z.enum(["pagefind", "none"]).default("pagefind")
|
|
69
|
-
}).prefault({}),
|
|
70
|
-
routing: z.object({
|
|
71
|
-
/** Inject the catch-all docs route. Disable to own routing entirely. */
|
|
72
|
-
injectPages: z.boolean().default(true),
|
|
73
|
-
/** Emit a `.md` twin per page plus `/llms.txt`. */
|
|
74
|
-
markdownTwins: z.boolean().default(true),
|
|
75
|
-
notFound: z.boolean().default(true)
|
|
76
|
-
}).prefault({}),
|
|
77
|
-
theme: z.object({
|
|
78
|
-
/** 'global' puts tokens on <html>; 'scoped' wraps in a ThemeProvider. */
|
|
79
|
-
mode: z.enum(["global", "scoped"]).default("global"),
|
|
80
|
-
/** Persist the reader's choice to localStorage. */
|
|
81
|
-
persist: z.boolean().default(true)
|
|
82
|
-
}).prefault({}),
|
|
83
|
-
/** Install @astrojs/mdx, @astrojs/react and Tailwind when absent. */
|
|
84
|
-
autoIntegrations: z.boolean().default(true),
|
|
85
|
-
/** Versioning. Left permissive here; the versioning workstream owns the shape. */
|
|
86
|
-
versions: z.any().optional(),
|
|
87
|
-
/** Generated-section plugins (OpenAPI reference, changelogs, ...). */
|
|
88
|
-
plugins: z.array(z.any()).default([])
|
|
89
|
-
});
|
|
90
|
-
function resolveConfig(user) {
|
|
91
|
-
const result = docsConfigSchema.safeParse(user);
|
|
92
|
-
if (!result.success) {
|
|
93
|
-
const issues = result.error.issues.map((i) => ` - ${i.path.join(".") || "(root)"}: ${i.message}`).join("\n");
|
|
94
|
-
throw new Error(`[@eqtylab/docs] Invalid configuration:
|
|
95
|
-
${issues}`);
|
|
96
|
-
}
|
|
97
|
-
return result.data;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export { docsConfigSchema, resolveConfig };
|
|
101
|
-
//# sourceMappingURL=chunk-ATIOPYKE.js.map
|
|
102
|
-
//# sourceMappingURL=chunk-ATIOPYKE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":[],"mappings":";;;AAGA,IAAM,UAAA,GAAa,EAAE,MAAA,CAAO;AAAA,EAC1B,KAAA,EAAO,EAAE,MAAA,EAAO;AAAA,EAChB,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKf,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,EAC1B,QAAA,EAAU,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AACxB,CAAC,CAAA;AAEM,IAAM,gBAAA,GAAmB,EAAE,MAAA,CA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C9C,EAAA,IAAI,CAAC,OAAO,OAAA,EAAS;AACnB,IAAA,MAAM,MAAA,GAAS,OAAO,KAAA,CAAM,MAAA,CACzB,IAAI,CAAC,CAAA,KAAM,OAAO,CAAA,CAAE,IAAA,CAAK,KAAK,GAAG,CAAA,IAAK,QAAQ,CAAA,EAAA,EAAK,CAAA,CAAE,OAAO,CAAA,CAAE,CAAA,CAC9D,KAAK,IAAI,CAAA;AACZ,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA;AAAA,EAA2C,MAAM,CAAA,CAAE,CAAA;AAAA,EACrE;AACA,EAAA,OAAO,MAAA,CAAO,IAAA;AAChB","file":"chunk-ATIOPYKE.js","sourcesContent":["/** Integration options: the whole consumer-facing configuration surface. */\nimport { z } from 'astro/zod';\n\nconst headerLink = z.object({\n label: z.string(),\n href: z.string(),\n /**\n * A Lucide name like `BookOpen`, or a path to an SVG in `public/` like\n * `/github.svg`. An SVG must be white: light mode inverts it.\n */\n icon: z.string().optional(),\n external: z.boolean().optional(),\n});\n\nexport const docsConfigSchema = z.object({\n /** Site name, shown in the header and used as the `<title>` suffix. */\n title: z.string(),\n description: z.string().optional(),\n /** Path to a favicon, relative to `public/`. Base is applied automatically. */\n favicon: z.string().default('/favicon.svg'),\n\n /**\n * The header mark. Without one the header falls back to `title` as text. Either\n * way a constant \"Docs\" label follows it, and `title` heads the sidebar.\n */\n logo: z\n .object({\n src: z.string(),\n /** Name the company: the brand link reads as this plus \"Docs\". */\n alt: z.string().default(''),\n })\n .optional(),\n\n /** Content directory, relative to `src/`. */\n contentDir: z.string().default('content/docs'),\n\n /** Mount docs under a sub-path, e.g. 'docs' for /docs/*. Empty means the site root. */\n pathPrefix: z.string().default(''),\n\n sidebar: z\n .object({\n /** Default collapse state for groups with no explicit `collapsed`. */\n collapsed: z.boolean().default(false),\n /** Default append order for children absent from a group's `order`. */\n sort: z.enum(['alpha', 'filename', 'manual']).default('alpha'),\n /** Extra top-level nodes, appended after folder-derived ones. */\n extra: z.array(z.any()).default([]),\n })\n .prefault({}),\n\n header: z\n .object({\n links: z.array(headerLink).default([]),\n showThemeToggle: z.boolean().default(true),\n })\n .prefault({}),\n\n footer: z\n .object({\n /** Base URL for \"Edit this page\"; the content path is appended. */\n editUrl: z.string().optional(),\n showPrevNext: z.boolean().default(true),\n text: z.string().optional(),\n })\n .prefault({}),\n\n tableOfContents: z\n .union([\n z.object({\n minLevel: z.number().int().min(1).max(6).default(2),\n maxLevel: z.number().int().min(1).max(6).default(3),\n }),\n z.literal(false),\n ])\n .prefault({}),\n\n code: z\n .object({\n /** 'codeblock' renders fences through Equality's CodeBlock; 'shiki' uses Astro's Shiki. */\n highlighter: z.enum(['codeblock', 'shiki']).default('codeblock'),\n /** Shiki themes; only consulted when `highlighter` is 'shiki'. */\n themes: z\n .object({ light: z.string(), dark: z.string() })\n .default({ light: 'github-light', dark: 'github-dark' }),\n wrap: z.boolean().default(false),\n langs: z.array(z.string()).default([]),\n })\n .prefault({}),\n\n search: z\n .object({\n /** 'pagefind' indexes the built HTML. Dev serves that index, so it needs one build. */\n provider: z.enum(['pagefind', 'none']).default('pagefind'),\n })\n .prefault({}),\n\n routing: z\n .object({\n /** Inject the catch-all docs route. Disable to own routing entirely. */\n injectPages: z.boolean().default(true),\n /** Emit a `.md` twin per page plus `/llms.txt`. */\n markdownTwins: z.boolean().default(true),\n notFound: z.boolean().default(true),\n })\n .prefault({}),\n\n theme: z\n .object({\n /** 'global' puts tokens on <html>; 'scoped' wraps in a ThemeProvider. */\n mode: z.enum(['global', 'scoped']).default('global'),\n /** Persist the reader's choice to localStorage. */\n persist: z.boolean().default(true),\n })\n .prefault({}),\n\n /** Install @astrojs/mdx, @astrojs/react and Tailwind when absent. */\n autoIntegrations: z.boolean().default(true),\n\n /** Versioning. Left permissive here; the versioning workstream owns the shape. */\n versions: z.any().optional(),\n\n /** Generated-section plugins (OpenAPI reference, changelogs, ...). */\n plugins: z.array(z.any()).default([]),\n});\n\nexport type DocsUserConfig = z.input<typeof docsConfigSchema>;\nexport type DocsConfig = z.output<typeof docsConfigSchema>;\n\nexport function resolveConfig(user: DocsUserConfig): DocsConfig {\n const result = docsConfigSchema.safeParse(user);\n if (!result.success) {\n const issues = result.error.issues\n .map((i) => ` - ${i.path.join('.') || '(root)'}: ${i.message}`)\n .join('\\n');\n throw new Error(`[@eqtylab/docs] Invalid configuration:\\n${issues}`);\n }\n return result.data;\n}\n"]}
|