nimbus-docs 0.1.5 → 0.1.7
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/CHANGELOG.md +19 -0
- package/README.md +23 -0
- package/dist/cli/index.js +7 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/content.d.ts +142 -6
- package/dist/content.d.ts.map +1 -1
- package/dist/content.js.map +1 -1
- package/dist/{diagnostic-DZf0z79l.d.ts → diagnostic-C6OaBe_o.d.ts} +12 -2
- package/dist/diagnostic-C6OaBe_o.d.ts.map +1 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/react.d.ts +205 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +542 -0
- package/dist/react.js.map +1 -0
- package/dist/rules-DnAP-j89.js.map +1 -1
- package/dist/schemas.d.ts +147 -11
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +1 -2
- package/dist/schemas.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +30 -13
- package/dist/diagnostic-DZf0z79l.d.ts.map +0 -1
package/dist/schemas.d.ts
CHANGED
|
@@ -2,9 +2,13 @@ import { z } from "astro/zod";
|
|
|
2
2
|
import * as astro_content0 from "astro:content";
|
|
3
3
|
|
|
4
4
|
//#region src/schemas.d.ts
|
|
5
|
-
interface DocSchemaConfig {
|
|
6
|
-
/**
|
|
7
|
-
|
|
5
|
+
interface DocSchemaConfig<TFields extends Record<string, z.ZodTypeAny> = Record<string, never>> {
|
|
6
|
+
/**
|
|
7
|
+
* Additional frontmatter fields merged into the default schema.
|
|
8
|
+
* Generic-typed so the call-site shape is preserved through to
|
|
9
|
+
* `entry.data.<field>` access in consumer code.
|
|
10
|
+
*/
|
|
11
|
+
fields?: TFields;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* Build a customizable docs schema. Use this when composing schemas outside
|
|
@@ -14,9 +18,141 @@ interface DocSchemaConfig {
|
|
|
14
18
|
* For typed Astro `image()` fields or per-collection field narrowing, use
|
|
15
19
|
* the richer `defineSchema(ctx => ...)` factory instead.
|
|
16
20
|
*/
|
|
17
|
-
declare function defineDocSchema(config?: DocSchemaConfig): z.ZodObject<
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
declare function defineDocSchema<TFields extends Record<string, z.ZodTypeAny> = Record<string, never>>(config?: DocSchemaConfig<TFields>): z.ZodObject<(("prev" | "next" | "title" | "description" | "mode" | "sidebar" | "head" | "banner" | "draft" | "noindex" | "searchable" | "tableOfContents" | "lastUpdated" | "socialImage" | "previousSlug") & keyof TFields extends never ? {
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
description: z.ZodOptional<z.ZodString>;
|
|
24
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
25
|
+
doc: "doc";
|
|
26
|
+
custom: "custom";
|
|
27
|
+
}>>;
|
|
28
|
+
sidebar: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
29
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
label: z.ZodOptional<z.ZodString>;
|
|
31
|
+
badge: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
32
|
+
text: z.ZodString;
|
|
33
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
34
|
+
success: "success";
|
|
35
|
+
default: "default";
|
|
36
|
+
info: "info";
|
|
37
|
+
note: "note";
|
|
38
|
+
tip: "tip";
|
|
39
|
+
warning: "warning";
|
|
40
|
+
caution: "caution";
|
|
41
|
+
danger: "danger";
|
|
42
|
+
}>>;
|
|
43
|
+
}, z.core.$strip>]>>;
|
|
44
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
hideChildren: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
}, z.core.$strip>]>>;
|
|
47
|
+
head: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
48
|
+
tag: z.ZodEnum<{
|
|
49
|
+
meta: "meta";
|
|
50
|
+
link: "link";
|
|
51
|
+
script: "script";
|
|
52
|
+
style: "style";
|
|
53
|
+
}>;
|
|
54
|
+
attrs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
55
|
+
content: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>>>;
|
|
57
|
+
banner: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
content: z.ZodString;
|
|
59
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
note: "note";
|
|
61
|
+
tip: "tip";
|
|
62
|
+
caution: "caution";
|
|
63
|
+
danger: "danger";
|
|
64
|
+
}>>;
|
|
65
|
+
dismissible: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
id: z.ZodString;
|
|
67
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
draft: z.ZodDefault<z.ZodBoolean>;
|
|
71
|
+
noindex: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
searchable: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
tableOfContents: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
74
|
+
minHeadingLevel: z.ZodDefault<z.ZodNumber>;
|
|
75
|
+
maxHeadingLevel: z.ZodDefault<z.ZodNumber>;
|
|
76
|
+
}, z.core.$strip>]>>;
|
|
77
|
+
lastUpdated: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
78
|
+
socialImage: z.ZodOptional<z.ZodString>;
|
|
79
|
+
prev: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
80
|
+
link: z.ZodOptional<z.ZodString>;
|
|
81
|
+
label: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, z.core.$strip>, z.ZodLiteral<false>]>>;
|
|
83
|
+
next: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
84
|
+
link: z.ZodOptional<z.ZodString>;
|
|
85
|
+
label: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>, z.ZodLiteral<false>]>>;
|
|
87
|
+
previousSlug: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
88
|
+
} & { -readonly [P in keyof TFields]: TFields[P] } : ({
|
|
89
|
+
title: z.ZodString;
|
|
90
|
+
description: z.ZodOptional<z.ZodString>;
|
|
91
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
92
|
+
doc: "doc";
|
|
93
|
+
custom: "custom";
|
|
94
|
+
}>>;
|
|
95
|
+
sidebar: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
96
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
label: z.ZodOptional<z.ZodString>;
|
|
98
|
+
badge: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
99
|
+
text: z.ZodString;
|
|
100
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
101
|
+
success: "success";
|
|
102
|
+
default: "default";
|
|
103
|
+
info: "info";
|
|
104
|
+
note: "note";
|
|
105
|
+
tip: "tip";
|
|
106
|
+
warning: "warning";
|
|
107
|
+
caution: "caution";
|
|
108
|
+
danger: "danger";
|
|
109
|
+
}>>;
|
|
110
|
+
}, z.core.$strip>]>>;
|
|
111
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
hideChildren: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
}, z.core.$strip>]>>;
|
|
114
|
+
head: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
115
|
+
tag: z.ZodEnum<{
|
|
116
|
+
meta: "meta";
|
|
117
|
+
link: "link";
|
|
118
|
+
script: "script";
|
|
119
|
+
style: "style";
|
|
120
|
+
}>;
|
|
121
|
+
attrs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
122
|
+
content: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, z.core.$strip>>>;
|
|
124
|
+
banner: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
content: z.ZodString;
|
|
126
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
127
|
+
note: "note";
|
|
128
|
+
tip: "tip";
|
|
129
|
+
caution: "caution";
|
|
130
|
+
danger: "danger";
|
|
131
|
+
}>>;
|
|
132
|
+
dismissible: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
days: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
draft: z.ZodDefault<z.ZodBoolean>;
|
|
138
|
+
noindex: z.ZodDefault<z.ZodBoolean>;
|
|
139
|
+
searchable: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
tableOfContents: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
141
|
+
minHeadingLevel: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
maxHeadingLevel: z.ZodDefault<z.ZodNumber>;
|
|
143
|
+
}, z.core.$strip>]>>;
|
|
144
|
+
lastUpdated: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
145
|
+
socialImage: z.ZodOptional<z.ZodString>;
|
|
146
|
+
prev: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
147
|
+
link: z.ZodOptional<z.ZodString>;
|
|
148
|
+
label: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strip>, z.ZodLiteral<false>]>>;
|
|
150
|
+
next: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
151
|
+
link: z.ZodOptional<z.ZodString>;
|
|
152
|
+
label: z.ZodOptional<z.ZodString>;
|
|
153
|
+
}, z.core.$strip>, z.ZodLiteral<false>]>>;
|
|
154
|
+
previousSlug: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
155
|
+
} extends infer T_1 extends z.core.util.SomeObject ? { [K in keyof T_1 as K extends keyof TFields ? never : K]: T_1[K] } : never) & { [K_1 in keyof { -readonly [P in keyof TFields]: TFields[P] }]: { -readonly [P in keyof TFields]: TFields[P] }[K_1] }) extends infer T ? { [k in keyof T]: T[k] } : never, z.core.$strip>;
|
|
20
156
|
/**
|
|
21
157
|
* Factory options for `defineSchema`.
|
|
22
158
|
*
|
|
@@ -56,13 +192,13 @@ interface DefineSchemaOptions {
|
|
|
56
192
|
* }),
|
|
57
193
|
* };
|
|
58
194
|
*/
|
|
59
|
-
declare function defineSchema(factory: (ctx: astro_content0.SchemaContext) => DefineSchemaOptions): (ctx: astro_content0.SchemaContext) => z.ZodObject<Readonly<{
|
|
60
|
-
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
61
|
-
}>, z.core.$loose> | z.ZodIntersection<z.ZodObject<any, z.core.$strip>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
62
|
-
/** Default docs schema. Equivalent to `defineDocSchema()`. */
|
|
63
|
-
declare const docsSchema: z.ZodObject<Readonly<{
|
|
195
|
+
declare function defineSchema(factory: (ctx: astro_content0.SchemaContext) => DefineSchemaOptions): (ctx: astro_content0.SchemaContext) => z.ZodIntersection<z.ZodObject<any, z.core.$strip>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>> | z.ZodObject<Readonly<{
|
|
64
196
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
65
197
|
}>, z.core.$loose>;
|
|
198
|
+
/** Default docs schema. Equivalent to `defineDocSchema()`. */
|
|
199
|
+
declare const docsSchema: z.ZodObject<{
|
|
200
|
+
[x: string]: never;
|
|
201
|
+
}, z.core.$strip>;
|
|
66
202
|
/** Schema for partials (`<Render file="..." />` snippets). */
|
|
67
203
|
declare const partialsSchema: z.ZodDefault<z.ZodObject<{
|
|
68
204
|
params: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","names":[],"sources":["../src/schemas.ts"],"mappings":";;;;UAiBiB,eAAA;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","names":[],"sources":["../src/schemas.ts"],"mappings":";;;;UAiBiB,eAAA,iBACC,MAAA,SAAe,CAAA,CAAE,UAAA,IAAc,MAAA;EAAhB;;;;;EAO/B,MAAA,GAAS,OAAA;AAAA;AA2OX;;;;;;;;AAAA,iBAAgB,eAAA,iBACE,MAAA,SAAe,CAAA,CAAE,UAAA,IAAc,MAAA,gBAAA,CAC/C,MAAA,GAAQ,eAAA,CAAgB,OAAA,IAAa,CAAA,CAAA,SAAA,yMAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyBtB,mBAAA;EACf,MAAA,GAAS,CAAA,CAAE,UAAA;EACX,MAAA,GAAS,MAAA,SAAe,CAAA,CAAE,UAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BZ,YAAA,CACd,OAAA,GAAU,GAAA,EADgB,cAAA,CACa,aAAA,KAAkB,mBAAA,IAEjD,GAAA,EAFoE,cAAA,CAEvC,aAAA,KAAa,CAAA,CAAA,eAAA,CAAA,CAAA,CAAA,SAAA,MAAA,CAAA,CAAA,IAAA,CAAA,MAAA,GAAA,CAAA,CAAA,OAAA,mBAAA,CAAA,CAAA,IAAA,CAAA,iBAAA,uBAAA,CAAA,CAAA,SAAA,CAAA,QAAA;EAAA;;;cA8BvC,UAAA,EAAU,CAAA,CAAA,SAAA;EAAA;GAAoB,CAAA,CAAA,IAAA,CAAA,MAAA;;cAW9B,cAAA,EAAc,CAAA,CAAA,UAAA,CAAA,CAAA,CAAA,SAAA;;;;cAad,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAGjB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;cAU5B,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;KAQb,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;;cAG9B,gBAAA,EAAgB,CAAA,CAAA,SAAA"}
|
package/dist/schemas.js
CHANGED
|
@@ -140,8 +140,7 @@ function baseDocSchema() {
|
|
|
140
140
|
* the richer `defineSchema(ctx => ...)` factory instead.
|
|
141
141
|
*/
|
|
142
142
|
function defineDocSchema(config = {}) {
|
|
143
|
-
|
|
144
|
-
return withFrontmatterKeyCheck(config.fields ? base.extend(config.fields) : base);
|
|
143
|
+
return withFrontmatterKeyCheck(baseDocSchema().extend(config.fields ?? {}));
|
|
145
144
|
}
|
|
146
145
|
/**
|
|
147
146
|
* Build a typed docs schema with access to the Astro `SchemaContext`.
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","names":[],"sources":["../src/schemas.ts"],"sourcesContent":["/**\n * Content schemas for Nimbus.\n *\n * `docsSchema` is the default frontmatter contract for the `docs` collection.\n * `partialsSchema` is the contract for `<Render file=\"...\" />` partials.\n * `defineDocSchema(config)` returns a customizable schema for advanced users\n * composing schemas outside the `docsCollection()` factory.\n *\n * Error messages target content authors, not framework developers.\n * Astro 6 ships Zod v4 via `astro/zod`. The v4 API uses a single `error`\n * field on every schema constructor — NOT v3's `required_error` /\n * `invalid_type_error` / `errorMap`.\n */\n\nimport { z } from \"astro/zod\";\nimport { withStrictKeys } from \"./_internal/strict-keys.js\";\n\nexport interface DocSchemaConfig {\n /** Additional frontmatter fields merged into the default schema. */\n fields?: Record<string, z.ZodTypeAny>;\n}\n\n// ---------------------------------------------------------------------------\n// Building blocks\n// ---------------------------------------------------------------------------\n\nconst sidebarBadgeSchema = z.union([\n z.string(),\n z.object({\n text: z.string({ error: 'sidebar badge needs a \"text\" field' }),\n variant: z\n .enum(\n [\"default\", \"info\", \"note\", \"success\", \"tip\", \"warning\", \"caution\", \"danger\"],\n {\n error:\n '\"variant\" must be one of: default, info, note, success, tip, warning, caution, danger',\n },\n )\n .default(\"default\"),\n }),\n]);\n\nconst sidebarSchema = z.object({\n order: z.number({ error: '\"sidebar.order\" must be a number' }).optional(),\n label: z.string({ error: '\"sidebar.label\" must be a string' }).optional(),\n badge: sidebarBadgeSchema.optional(),\n hidden: z.boolean({ error: '\"sidebar.hidden\" must be true or false' }).optional(),\n hideChildren: z\n .boolean({ error: '\"sidebar.hideChildren\" must be true or false' })\n .optional(),\n});\n\nconst prevNextSchema = z\n .union([\n z.string(),\n z.object({ link: z.string().optional(), label: z.string().optional() }),\n z.literal(false),\n ])\n .optional();\n\nconst headElementSchema = z.object({\n tag: z.enum([\"meta\", \"link\", \"script\", \"style\"], {\n error: 'head element \"tag\" must be \"meta\", \"link\", \"script\", or \"style\"',\n }),\n attrs: z.record(z.string(), z.string()).default({}),\n content: z.string().optional(),\n});\n\n// Mirrors `BannerProps` in types.ts. Layouts consume this directly off\n// `entry.data.banner` and render the `<Banner>` component with it, so the\n// schema is framework-owned (not user-extensible territory).\nconst bannerSchema = z.object({\n content: z.string({ error: 'banner \"content\" must be a string' }),\n type: z\n .enum([\"note\", \"tip\", \"caution\", \"danger\"], {\n error: 'banner \"type\" must be one of: note, tip, caution, danger',\n })\n .optional(),\n dismissible: z\n .object({\n id: z.string({\n error: 'banner \"dismissible.id\" must be a string — a stable identifier you bump when banner content meaningfully changes',\n }),\n days: z.number({ error: 'banner \"dismissible.days\" must be a number' }).optional(),\n })\n .optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Removed/renamed frontmatter keys — surface migration errors loudly\n// ---------------------------------------------------------------------------\n\n/**\n * Frontmatter keys that used to exist but no longer do. When user content\n * still carries one of these, Zod's default `.strip()` behavior would\n * silently drop it — the page would build, but with subtly different\n * behavior (the old toggle just disappears). That's a confusing failure\n * mode for an authoring contract.\n *\n * `withUnknownKeyCheck` (below) consults this map. Hits get the friendly\n * migration message verbatim; everything else falls through to a generic\n * \"Unknown frontmatter key\" error so typos don't sneak past either.\n *\n * Entries removed in the v0 → v1 cleanup:\n *\n * - `template` → `mode`: same shape, but `\"splash\"` is now `\"custom\"`.\n * - `pagefind` → `searchable`: same boolean; default now derives from\n * `noindex` (a non-crawlable page is non-searchable by default).\n * - `llms`: removed. All published pages are listed in `/llms.txt`; the\n * escape hatch is `noindex: true`.\n * - `aiDeprioritize`: removed. The framework no longer emits an\n * agent-downrank signal.\n * - `hero`: removed. Compose the hero in MDX body with user-owned\n * components instead of a frontmatter contract.\n */\nconst REMOVED_FRONTMATTER_KEYS: Record<string, string> = {\n template:\n 'was renamed to \"mode\". Replace `template: \"doc\"` with `mode: \"doc\"`, and `template: \"splash\"` with `mode: \"custom\"`.',\n pagefind:\n 'was renamed to \"searchable\". Same boolean shape; the default now derives from `noindex` (a non-crawlable page is non-searchable unless you set `searchable: true` explicitly).',\n llms:\n \"was removed. Every published page is now listed in /llms.txt; use `noindex: true` to keep a page out of both search engines and the LLM index.\",\n aiDeprioritize:\n \"was removed. The framework no longer emits an agent-downrank signal. If you want a page hidden from agents, use `noindex: true`.\",\n hero:\n \"was removed. Compose your hero in the MDX body using user-owned components; there is no longer a `hero` frontmatter contract.\",\n};\n\n/**\n * Apply this AFTER any `.extend()` so user-added fields are recognized\n * as valid. Wraps the schema in `.passthrough().superRefine()` so removed\n * keys raise a guided migration error; other unknown keys raise a\n * generic error pointing at `defineSchema({ extend: ... })`.\n */\nfunction withFrontmatterKeyCheck<T extends z.ZodObject<z.ZodRawShape>>(schema: T) {\n return withStrictKeys(schema, {\n removedKeys: REMOVED_FRONTMATTER_KEYS,\n contextLabel: \"Frontmatter key\",\n unknownHint: (key) =>\n `If you meant to add a custom field, declare it in your collection's schema via \\`defineSchema({ extend: z.object({ ${key}: ... }) })\\`.`,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Base docs schema\n// ---------------------------------------------------------------------------\n\nfunction baseDocSchema() {\n return z.object({\n title: z.string({\n error: (iss) =>\n iss.input === undefined\n ? 'Missing required \"title\" in frontmatter. Every doc needs:\\n\\n ---\\n title: \"Your Page Title\"\\n ---'\n : `\"title\" must be a string, received ${typeof iss.input}`,\n }),\n description: z.string({ error: '\"description\" must be a string' }).optional(),\n mode: z\n .enum([\"doc\", \"custom\"], {\n error: '\"mode\" must be \"doc\" or \"custom\"',\n })\n .default(\"doc\"),\n sidebar: z.union([z.literal(false), sidebarSchema]).optional(),\n head: z.array(headElementSchema).default([]),\n banner: bannerSchema.optional(),\n draft: z.boolean({ error: '\"draft\" must be true or false' }).default(false),\n noindex: z.boolean({ error: '\"noindex\" must be true or false' }).default(false),\n /**\n * Whether this page is included in the site search index. When omitted,\n * derives from `noindex` (a page that's not crawlable is by default not\n * searchable). Set explicitly to override — e.g. `{ noindex: true,\n * searchable: true }` keeps the page out of search engines but findable\n * in the site's own search.\n */\n searchable: z\n .boolean({ error: '\"searchable\" must be true or false' })\n .optional(),\n tableOfContents: z\n .union([\n z.literal(false),\n z\n .object({\n minHeadingLevel: z\n .number({ error: '\"minHeadingLevel\" must be a number (1-6)' })\n .int()\n .min(1)\n .max(6)\n .default(2),\n maxHeadingLevel: z\n .number({ error: '\"maxHeadingLevel\" must be a number (1-6)' })\n .int()\n .min(1)\n .max(6)\n .default(3),\n })\n .refine((v) => v.minHeadingLevel <= v.maxHeadingLevel, {\n message: \"minHeadingLevel must be <= maxHeadingLevel\",\n }),\n ])\n .optional(),\n lastUpdated: z.coerce\n .date({ error: '\"lastUpdated\" must be a valid date (e.g. 2024-01-15)' })\n .optional(),\n /**\n * Explicit per-page social/OG image override (path or absolute URL).\n * When omitted, the page route is expected to fall back to a\n * programmatically-generated card or the site-wide `config.socialImage`.\n */\n socialImage: z\n .string({ error: '\"socialImage\" must be a string (path or URL)' })\n .optional(),\n prev: prevNextSchema,\n next: prevNextSchema,\n /**\n * Versioning rename escape hatch.\n *\n * When a page is renamed between versions (the URL slug changes), the\n * newer version's frontmatter declares the slug it had in an older\n * version. The framework uses this to link the pages as cross-version\n * alternates and to emit a `<link rel=\"canonical\">` to the current\n * version's URL.\n *\n * Example: `docs-v1/old-name.mdx` was renamed in v2 to `new-name.mdx`.\n * On the new page (`docs/new-name.mdx`, current version), set:\n *\n * previousSlug: old-name\n *\n * Now `/new-name` and `/v1/old-name` are linked as the same logical\n * page in `<head>` alternates, and the v1 page's canonical points to\n * `/new-name`.\n *\n * Accepts a single slug string (the page's id in the older version)\n * or an array of strings when the page has been renamed across more\n * than one version.\n */\n previousSlug: z\n .union([z.string(), z.array(z.string())], {\n error: '\"previousSlug\" must be a string or array of strings',\n })\n .optional(),\n });\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Build a customizable docs schema. Use this when composing schemas outside\n * the `docsCollection()` factory (e.g. multiple docs collections with\n * different shapes).\n *\n * For typed Astro `image()` fields or per-collection field narrowing, use\n * the richer `defineSchema(ctx => ...)` factory instead.\n */\nexport function defineDocSchema(config: DocSchemaConfig = {}) {\n const base = baseDocSchema();\n // Apply the unknown-key check AFTER extends so user-added fields are\n // recognized as valid. Order matters — `.passthrough().superRefine()`\n // returns a ZodEffects, which can't be further `.extend()`-ed.\n const merged = config.fields ? base.extend(config.fields) : base;\n return withFrontmatterKeyCheck(merged);\n}\n\n/**\n * Factory options for `defineSchema`.\n *\n * - `extend`: additional fields merged into the framework schema. Use\n * this for user-defined frontmatter (`author`, `tags`, `cover`).\n * - `narrow`: replaces framework fields with tighter types within this\n * collection. Use when a collection has stricter rules — e.g.\n * `{ mode: z.literal(\"doc\") }` says no landing pages in this collection.\n */\nexport interface DefineSchemaOptions {\n extend?: z.ZodTypeAny;\n narrow?: Record<string, z.ZodTypeAny>;\n}\n\n/**\n * Build a typed docs schema with access to the Astro `SchemaContext`.\n * Use this when you want typed image fields (`ctx.image()`), per-\n * collection narrowing of framework fields, or both. The simpler\n * `defineDocSchema({ fields })` factory is still available for the\n * common case of just adding fields.\n *\n * import { defineCollection } from \"astro:content\";\n * import { z } from \"astro/zod\";\n * import { defineSchema } from \"nimbus-docs/schemas\";\n *\n * export const collections = {\n * docs: defineCollection({\n * loader: ...,\n * schema: defineSchema((ctx) => ({\n * extend: z.object({\n * cover: ctx.image().optional(),\n * author: z.string().optional(),\n * }),\n * narrow: {\n * mode: z.literal(\"doc\"), // no landing pages here\n * },\n * })),\n * }),\n * };\n */\nexport function defineSchema(\n factory: (ctx: import(\"astro:content\").SchemaContext) => DefineSchemaOptions,\n) {\n return (ctx: import(\"astro:content\").SchemaContext) => {\n const { extend, narrow } = factory(ctx);\n let schema = baseDocSchema() as z.ZodObject<any>;\n\n // narrowing first (overrides framework fields)\n if (narrow) {\n schema = schema.extend(narrow);\n }\n\n // additive extension (new user fields). Prefer .merge for ZodObject\n // (preserves object-ness for downstream .extend); fall back to .and\n // for any other Zod type (intersection, union, etc.).\n if (extend) {\n if (extend instanceof z.ZodObject) {\n schema = schema.merge(extend);\n } else {\n // Intersection path — `.and()` returns ZodIntersection, on which\n // we can't run `withUnknownKeyCheck` (it operates on ZodObject's\n // `.shape`). Users on this path lose the removed-key migration\n // diagnostic; they own that trade-off by reaching for the\n // non-object extend.\n return schema.and(extend);\n }\n }\n\n return withFrontmatterKeyCheck(schema);\n };\n}\n\n/** Default docs schema. Equivalent to `defineDocSchema()`. */\nexport const docsSchema = defineDocSchema();\n\nconst partialsObjectSchema = z.object({\n /**\n * Declared parameters this partial accepts.\n * Suffix with `?` for optional params: `[\"name\", \"deprecated?\"]`\n */\n params: z.array(z.string()).optional(),\n});\n\n/** Schema for partials (`<Render file=\"...\" />` snippets). */\nexport const partialsSchema = partialsObjectSchema.default({});\n\n// ---------------------------------------------------------------------------\n// Lenient variants — used by `nimbus-docs lint` (`nimbus/frontmatter-shape`).\n//\n// The standalone lint CLI can't yet see a site's extended\n// `content.config.ts` schema, so it validates the *types* of the fields\n// the framework owns while tolerating user-added fields (passthrough).\n// Unknown-key detection is deferred to when the engine can load the real\n// per-collection schema.\n// ---------------------------------------------------------------------------\n\n/** Docs frontmatter, framework fields type-checked, extra keys allowed. */\nexport const lenientDocsSchema = baseDocSchema().passthrough();\n\n/** Partials frontmatter, framework fields type-checked, extra keys allowed. */\nexport const lenientPartialsSchema = partialsObjectSchema.passthrough();\n\n// ---------------------------------------------------------------------------\n// Components collection — used by sites documenting their own UI components.\n// Pair with `componentsCollection()` from `nimbus-docs/content`. Authoring\n// pattern: hero `<Showcase>` block + `<Example>` blocks in the MDX body, with\n// `props` declared in frontmatter for a generated prop table.\n// ---------------------------------------------------------------------------\n\n/** One row in a component's `props` frontmatter array. */\nconst componentPropSchema = z.object({\n name: z.string({ error: 'prop needs a \"name\"' }),\n type: z.string({ error: 'prop needs a \"type\"' }),\n defaultValue: z.string().optional(),\n required: z.boolean().default(false),\n description: z.string({ error: 'prop needs a \"description\"' }),\n});\n\nexport type ComponentProp = z.infer<typeof componentPropSchema>;\n\n/** Default schema for the components collection. */\nexport const componentsSchema = z.object({\n title: z.string({\n error: (iss) =>\n iss.input === undefined\n ? 'Missing \"title\" in frontmatter — display name used in the sidebar and page header.'\n : `\"title\" must be a string, received ${typeof iss.input}`,\n }),\n tagline: z.string({\n error: (iss) =>\n iss.input === undefined\n ? 'Missing \"tagline\" in frontmatter — one-sentence summary shown under the title.'\n : `\"tagline\" must be a string, received ${typeof iss.input}`,\n }),\n props: z.array(componentPropSchema).default([]),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,MAAM,qBAAqB,EAAE,MAAM,CACjC,EAAE,QAAQ,EACV,EAAE,OAAO;CACP,MAAM,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BAAuB,CAAC;CAChD,MAAM,EAAE,OAAO,EAAE,OAAO,yBAAuB,CAAC;CAChD,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,UAAU,EAAE,SAAS,CAAC,QAAQ,MAAM;CACpC,aAAa,EAAE,OAAO,EAAE,OAAO,gCAA8B,CAAC;CAC/D,CAAC;;AAKF,MAAa,mBAAmB,EAAE,OAAO;CACvC,OAAO,EAAE,OAAO,EACd,QAAQ,QACN,IAAI,UAAU,SACV,yFACA,sCAAsC,OAAO,IAAI,SACxD,CAAC;CACF,SAAS,EAAE,OAAO,EAChB,QAAQ,QACN,IAAI,UAAU,SACV,qFACA,wCAAwC,OAAO,IAAI,SAC1D,CAAC;CACF,OAAO,EAAE,MAAM,oBAAoB,CAAC,QAAQ,EAAE,CAAC;CAChD,CAAC"}
|
|
1
|
+
{"version":3,"file":"schemas.js","names":[],"sources":["../src/schemas.ts"],"sourcesContent":["/**\n * Content schemas for Nimbus.\n *\n * `docsSchema` is the default frontmatter contract for the `docs` collection.\n * `partialsSchema` is the contract for `<Render file=\"...\" />` partials.\n * `defineDocSchema(config)` returns a customizable schema for advanced users\n * composing schemas outside the `docsCollection()` factory.\n *\n * Error messages target content authors, not framework developers.\n * Astro 6 ships Zod v4 via `astro/zod`. The v4 API uses a single `error`\n * field on every schema constructor — NOT v3's `required_error` /\n * `invalid_type_error` / `errorMap`.\n */\n\nimport { z } from \"astro/zod\";\nimport { withStrictKeys } from \"./_internal/strict-keys.js\";\n\nexport interface DocSchemaConfig<\n TFields extends Record<string, z.ZodTypeAny> = Record<string, never>,\n> {\n /**\n * Additional frontmatter fields merged into the default schema.\n * Generic-typed so the call-site shape is preserved through to\n * `entry.data.<field>` access in consumer code.\n */\n fields?: TFields;\n}\n\n// ---------------------------------------------------------------------------\n// Building blocks\n// ---------------------------------------------------------------------------\n\nconst sidebarBadgeSchema = z.union([\n z.string(),\n z.object({\n text: z.string({ error: 'sidebar badge needs a \"text\" field' }),\n variant: z\n .enum(\n [\"default\", \"info\", \"note\", \"success\", \"tip\", \"warning\", \"caution\", \"danger\"],\n {\n error:\n '\"variant\" must be one of: default, info, note, success, tip, warning, caution, danger',\n },\n )\n .default(\"default\"),\n }),\n]);\n\nconst sidebarSchema = z.object({\n order: z.number({ error: '\"sidebar.order\" must be a number' }).optional(),\n label: z.string({ error: '\"sidebar.label\" must be a string' }).optional(),\n badge: sidebarBadgeSchema.optional(),\n hidden: z.boolean({ error: '\"sidebar.hidden\" must be true or false' }).optional(),\n hideChildren: z\n .boolean({ error: '\"sidebar.hideChildren\" must be true or false' })\n .optional(),\n});\n\nconst prevNextSchema = z\n .union([\n z.string(),\n z.object({ link: z.string().optional(), label: z.string().optional() }),\n z.literal(false),\n ])\n .optional();\n\nconst headElementSchema = z.object({\n tag: z.enum([\"meta\", \"link\", \"script\", \"style\"], {\n error: 'head element \"tag\" must be \"meta\", \"link\", \"script\", or \"style\"',\n }),\n attrs: z.record(z.string(), z.string()).default({}),\n content: z.string().optional(),\n});\n\n// Mirrors `BannerProps` in types.ts. Layouts consume this directly off\n// `entry.data.banner` and render the `<Banner>` component with it, so the\n// schema is framework-owned (not user-extensible territory).\nconst bannerSchema = z.object({\n content: z.string({ error: 'banner \"content\" must be a string' }),\n type: z\n .enum([\"note\", \"tip\", \"caution\", \"danger\"], {\n error: 'banner \"type\" must be one of: note, tip, caution, danger',\n })\n .optional(),\n dismissible: z\n .object({\n id: z.string({\n error: 'banner \"dismissible.id\" must be a string — a stable identifier you bump when banner content meaningfully changes',\n }),\n days: z.number({ error: 'banner \"dismissible.days\" must be a number' }).optional(),\n })\n .optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Removed/renamed frontmatter keys — surface migration errors loudly\n// ---------------------------------------------------------------------------\n\n/**\n * Frontmatter keys that used to exist but no longer do. When user content\n * still carries one of these, Zod's default `.strip()` behavior would\n * silently drop it — the page would build, but with subtly different\n * behavior (the old toggle just disappears). That's a confusing failure\n * mode for an authoring contract.\n *\n * `withUnknownKeyCheck` (below) consults this map. Hits get the friendly\n * migration message verbatim; everything else falls through to a generic\n * \"Unknown frontmatter key\" error so typos don't sneak past either.\n *\n * Entries removed in the v0 → v1 cleanup:\n *\n * - `template` → `mode`: same shape, but `\"splash\"` is now `\"custom\"`.\n * - `pagefind` → `searchable`: same boolean; default now derives from\n * `noindex` (a non-crawlable page is non-searchable by default).\n * - `llms`: removed. All published pages are listed in `/llms.txt`; the\n * escape hatch is `noindex: true`.\n * - `aiDeprioritize`: removed. The framework no longer emits an\n * agent-downrank signal.\n * - `hero`: removed. Compose the hero in MDX body with user-owned\n * components instead of a frontmatter contract.\n */\nconst REMOVED_FRONTMATTER_KEYS: Record<string, string> = {\n template:\n 'was renamed to \"mode\". Replace `template: \"doc\"` with `mode: \"doc\"`, and `template: \"splash\"` with `mode: \"custom\"`.',\n pagefind:\n 'was renamed to \"searchable\". Same boolean shape; the default now derives from `noindex` (a non-crawlable page is non-searchable unless you set `searchable: true` explicitly).',\n llms:\n \"was removed. Every published page is now listed in /llms.txt; use `noindex: true` to keep a page out of both search engines and the LLM index.\",\n aiDeprioritize:\n \"was removed. The framework no longer emits an agent-downrank signal. If you want a page hidden from agents, use `noindex: true`.\",\n hero:\n \"was removed. Compose your hero in the MDX body using user-owned components; there is no longer a `hero` frontmatter contract.\",\n};\n\n/**\n * Apply this AFTER any `.extend()` so user-added fields are recognized\n * as valid. Wraps the schema in `.passthrough().superRefine()` so removed\n * keys raise a guided migration error; other unknown keys raise a\n * generic error pointing at `defineSchema({ extend: ... })`.\n */\nfunction withFrontmatterKeyCheck<T extends z.ZodObject<z.ZodRawShape>>(schema: T) {\n return withStrictKeys(schema, {\n removedKeys: REMOVED_FRONTMATTER_KEYS,\n contextLabel: \"Frontmatter key\",\n unknownHint: (key) =>\n `If you meant to add a custom field, declare it in your collection's schema via \\`defineSchema({ extend: z.object({ ${key}: ... }) })\\`.`,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Base docs schema\n// ---------------------------------------------------------------------------\n\nfunction baseDocSchema() {\n return z.object({\n title: z.string({\n error: (iss) =>\n iss.input === undefined\n ? 'Missing required \"title\" in frontmatter. Every doc needs:\\n\\n ---\\n title: \"Your Page Title\"\\n ---'\n : `\"title\" must be a string, received ${typeof iss.input}`,\n }),\n description: z.string({ error: '\"description\" must be a string' }).optional(),\n mode: z\n .enum([\"doc\", \"custom\"], {\n error: '\"mode\" must be \"doc\" or \"custom\"',\n })\n .default(\"doc\"),\n sidebar: z.union([z.literal(false), sidebarSchema]).optional(),\n head: z.array(headElementSchema).default([]),\n banner: bannerSchema.optional(),\n draft: z.boolean({ error: '\"draft\" must be true or false' }).default(false),\n noindex: z.boolean({ error: '\"noindex\" must be true or false' }).default(false),\n /**\n * Whether this page is included in the site search index. When omitted,\n * derives from `noindex` (a page that's not crawlable is by default not\n * searchable). Set explicitly to override — e.g. `{ noindex: true,\n * searchable: true }` keeps the page out of search engines but findable\n * in the site's own search.\n */\n searchable: z\n .boolean({ error: '\"searchable\" must be true or false' })\n .optional(),\n tableOfContents: z\n .union([\n z.literal(false),\n z\n .object({\n minHeadingLevel: z\n .number({ error: '\"minHeadingLevel\" must be a number (1-6)' })\n .int()\n .min(1)\n .max(6)\n .default(2),\n maxHeadingLevel: z\n .number({ error: '\"maxHeadingLevel\" must be a number (1-6)' })\n .int()\n .min(1)\n .max(6)\n .default(3),\n })\n .refine((v) => v.minHeadingLevel <= v.maxHeadingLevel, {\n message: \"minHeadingLevel must be <= maxHeadingLevel\",\n }),\n ])\n .optional(),\n lastUpdated: z.coerce\n .date({ error: '\"lastUpdated\" must be a valid date (e.g. 2024-01-15)' })\n .optional(),\n /**\n * Explicit per-page social/OG image override (path or absolute URL).\n * When omitted, the page route is expected to fall back to a\n * programmatically-generated card or the site-wide `config.socialImage`.\n */\n socialImage: z\n .string({ error: '\"socialImage\" must be a string (path or URL)' })\n .optional(),\n prev: prevNextSchema,\n next: prevNextSchema,\n /**\n * Versioning rename escape hatch.\n *\n * When a page is renamed between versions (the URL slug changes), the\n * newer version's frontmatter declares the slug it had in an older\n * version. The framework uses this to link the pages as cross-version\n * alternates and to emit a `<link rel=\"canonical\">` to the current\n * version's URL.\n *\n * Example: `docs-v1/old-name.mdx` was renamed in v2 to `new-name.mdx`.\n * On the new page (`docs/new-name.mdx`, current version), set:\n *\n * previousSlug: old-name\n *\n * Now `/new-name` and `/v1/old-name` are linked as the same logical\n * page in `<head>` alternates, and the v1 page's canonical points to\n * `/new-name`.\n *\n * Accepts a single slug string (the page's id in the older version)\n * or an array of strings when the page has been renamed across more\n * than one version.\n */\n previousSlug: z\n .union([z.string(), z.array(z.string())], {\n error: '\"previousSlug\" must be a string or array of strings',\n })\n .optional(),\n });\n}\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Build a customizable docs schema. Use this when composing schemas outside\n * the `docsCollection()` factory (e.g. multiple docs collections with\n * different shapes).\n *\n * For typed Astro `image()` fields or per-collection field narrowing, use\n * the richer `defineSchema(ctx => ...)` factory instead.\n */\nexport function defineDocSchema<\n TFields extends Record<string, z.ZodTypeAny> = Record<string, never>,\n>(config: DocSchemaConfig<TFields> = {}) {\n const base = baseDocSchema();\n // Always extend (with `{}` when no fields) so the result type is\n // `ZodObject<baseShape & TFields>` rather than a union of branches.\n // A union widens the consumer view of `entry.data.X` to the intersection\n // of branch fields, which is \"no fields\" for the false branch and\n // re-erases everything we just preserved.\n const merged = base.extend((config.fields ?? {}) as TFields);\n // Cast back to the underlying ZodObject. Runtime wrap (`.passthrough()\n // .superRefine()`) stays — the unknown-key check still fires. But tsdown\n // collapses ZodEffects emissions to `ZodObject<Record<string, ZodType<unknown>>>`,\n // erasing every framework field type at every consumer's `entry.data.X`\n // access. The cast preserves the field shapes through .d.ts emission.\n return withFrontmatterKeyCheck(merged) as unknown as typeof merged;\n}\n\n/**\n * Factory options for `defineSchema`.\n *\n * - `extend`: additional fields merged into the framework schema. Use\n * this for user-defined frontmatter (`author`, `tags`, `cover`).\n * - `narrow`: replaces framework fields with tighter types within this\n * collection. Use when a collection has stricter rules — e.g.\n * `{ mode: z.literal(\"doc\") }` says no landing pages in this collection.\n */\nexport interface DefineSchemaOptions {\n extend?: z.ZodTypeAny;\n narrow?: Record<string, z.ZodTypeAny>;\n}\n\n/**\n * Build a typed docs schema with access to the Astro `SchemaContext`.\n * Use this when you want typed image fields (`ctx.image()`), per-\n * collection narrowing of framework fields, or both. The simpler\n * `defineDocSchema({ fields })` factory is still available for the\n * common case of just adding fields.\n *\n * import { defineCollection } from \"astro:content\";\n * import { z } from \"astro/zod\";\n * import { defineSchema } from \"nimbus-docs/schemas\";\n *\n * export const collections = {\n * docs: defineCollection({\n * loader: ...,\n * schema: defineSchema((ctx) => ({\n * extend: z.object({\n * cover: ctx.image().optional(),\n * author: z.string().optional(),\n * }),\n * narrow: {\n * mode: z.literal(\"doc\"), // no landing pages here\n * },\n * })),\n * }),\n * };\n */\nexport function defineSchema(\n factory: (ctx: import(\"astro:content\").SchemaContext) => DefineSchemaOptions,\n) {\n return (ctx: import(\"astro:content\").SchemaContext) => {\n const { extend, narrow } = factory(ctx);\n let schema = baseDocSchema() as z.ZodObject<any>;\n\n // narrowing first (overrides framework fields)\n if (narrow) {\n schema = schema.extend(narrow);\n }\n\n // additive extension (new user fields). Prefer .merge for ZodObject\n // (preserves object-ness for downstream .extend); fall back to .and\n // for any other Zod type (intersection, union, etc.).\n if (extend) {\n if (extend instanceof z.ZodObject) {\n schema = schema.merge(extend);\n } else {\n // Intersection path — `.and()` returns ZodIntersection, on which\n // we can't run `withUnknownKeyCheck` (it operates on ZodObject's\n // `.shape`). Users on this path lose the removed-key migration\n // diagnostic; they own that trade-off by reaching for the\n // non-object extend.\n return schema.and(extend);\n }\n }\n\n return withFrontmatterKeyCheck(schema);\n };\n}\n\n/** Default docs schema. Equivalent to `defineDocSchema()`. */\nexport const docsSchema = defineDocSchema();\n\nconst partialsObjectSchema = z.object({\n /**\n * Declared parameters this partial accepts.\n * Suffix with `?` for optional params: `[\"name\", \"deprecated?\"]`\n */\n params: z.array(z.string()).optional(),\n});\n\n/** Schema for partials (`<Render file=\"...\" />` snippets). */\nexport const partialsSchema = partialsObjectSchema.default({});\n\n// ---------------------------------------------------------------------------\n// Lenient variants — used by `nimbus-docs lint` (`nimbus/frontmatter-shape`).\n//\n// The standalone lint CLI can't yet see a site's extended\n// `content.config.ts` schema, so it validates the *types* of the fields\n// the framework owns while tolerating user-added fields (passthrough).\n// Unknown-key detection is deferred to when the engine can load the real\n// per-collection schema.\n// ---------------------------------------------------------------------------\n\n/** Docs frontmatter, framework fields type-checked, extra keys allowed. */\nexport const lenientDocsSchema = baseDocSchema().passthrough();\n\n/** Partials frontmatter, framework fields type-checked, extra keys allowed. */\nexport const lenientPartialsSchema = partialsObjectSchema.passthrough();\n\n// ---------------------------------------------------------------------------\n// Components collection — used by sites documenting their own UI components.\n// Pair with `componentsCollection()` from `nimbus-docs/content`. Authoring\n// pattern: hero `<Showcase>` block + `<Example>` blocks in the MDX body, with\n// `props` declared in frontmatter for a generated prop table.\n// ---------------------------------------------------------------------------\n\n/** One row in a component's `props` frontmatter array. */\nconst componentPropSchema = z.object({\n name: z.string({ error: 'prop needs a \"name\"' }),\n type: z.string({ error: 'prop needs a \"type\"' }),\n defaultValue: z.string().optional(),\n required: z.boolean().default(false),\n description: z.string({ error: 'prop needs a \"description\"' }),\n});\n\nexport type ComponentProp = z.infer<typeof componentPropSchema>;\n\n/** Default schema for the components collection. */\nexport const componentsSchema = z.object({\n title: z.string({\n error: (iss) =>\n iss.input === undefined\n ? 'Missing \"title\" in frontmatter — display name used in the sidebar and page header.'\n : `\"title\" must be a string, received ${typeof iss.input}`,\n }),\n tagline: z.string({\n error: (iss) =>\n iss.input === undefined\n ? 'Missing \"tagline\" in frontmatter — one-sentence summary shown under the title.'\n : `\"tagline\" must be a string, received ${typeof iss.input}`,\n }),\n props: z.array(componentPropSchema).default([]),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAM,q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AO;CACnC,MAAM,EAAE,OAAO,EAAE,OAAO,yBAAuB,CAAC;CAChD,MAAM,EAAE,OAAO,EAAE,OAAO,yBAAuB,CAAC;CAChD,cAAc,EAAE,QAAQ,CAAC,UAAU;CACnC,UAAU,EAAE,SAAS,CAAC,QAAQ,MAAM;CACpC,aAAa,EAAE,OAAO,EAAE,OAAO,gCAA8B,CAAC;CAC/D,CAAC;;AAKF,MAAa,mBAAmB,EAAE,OAAO;CACvC,OAAO,EAAE,OAAO,EACd,QAAQ,QACN,IAAI,UAAU,SACV,yFACA,sCAAsC,OAAO,IAAI,SACxD,CAAC;CACF,SAAS,EAAE,OAAO,EAChB,QAAQ,QACN,IAAI,UAAU,SACV,qFACA,wCAAwC,OAAO,IAAI,SAC1D,CAAC;CACF,OAAO,EAAE,MAAM,oBAAoB,CAAC,QAAQ,EAAE,CAAC;CAChD,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as Severity, i as RuleCode, n as Diagnostic, o as SeverityConfig, r as DiagnosticFix, t as AuthoringRuleCode } from "./diagnostic-C6OaBe_o.js";
|
|
2
2
|
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
/**
|
|
@@ -438,5 +438,5 @@ interface DocsPageProps extends BasePageProps {
|
|
|
438
438
|
prevNext: PrevNext;
|
|
439
439
|
}
|
|
440
440
|
//#endregion
|
|
441
|
-
export { BadgeVariant, BannerProps, BasePageProps, Breadcrumb, type Diagnostic, type DiagnosticFix, DocsPageProps, FeaturesConfig, HeadElement, NimbusConfig, PrevNext, PrevNextLink, PrevNextOverrides, ResolvedVersions, type RuleCode, SearchConfig, SearchProvider, SearchResult, type Severity, type SeverityConfig, SidebarBadge, SidebarConfig, SidebarConfigItem, SidebarExternalLinkItem, SidebarGroupItem, SidebarItem, SidebarLinkItem, SidebarSection, TOCItem, VersionAlternateRecord, VersionAlternatesTable, VersionPageRef, VersionStatus, VersionsConfig };
|
|
441
|
+
export { type AuthoringRuleCode, BadgeVariant, BannerProps, BasePageProps, Breadcrumb, type Diagnostic, type DiagnosticFix, DocsPageProps, FeaturesConfig, HeadElement, NimbusConfig, PrevNext, PrevNextLink, PrevNextOverrides, ResolvedVersions, type RuleCode, SearchConfig, SearchProvider, SearchResult, type Severity, type SeverityConfig, SidebarBadge, SidebarConfig, SidebarConfigItem, SidebarExternalLinkItem, SidebarGroupItem, SidebarItem, SidebarLinkItem, SidebarSection, TOCItem, VersionAlternateRecord, VersionAlternatesTable, VersionPageRef, VersionStatus, VersionsConfig };
|
|
442
442
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nimbus-docs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Docs, for humans and agents",
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"types": "./dist/client.d.ts",
|
|
47
47
|
"import": "./dist/client.js"
|
|
48
48
|
},
|
|
49
|
+
"./react": {
|
|
50
|
+
"types": "./dist/react.d.ts",
|
|
51
|
+
"import": "./dist/react.js"
|
|
52
|
+
},
|
|
49
53
|
"./lib/pkgm": {
|
|
50
54
|
"types": "./dist/lib/pkgm.d.ts",
|
|
51
55
|
"import": "./dist/lib/pkgm.js"
|
|
@@ -54,10 +58,21 @@
|
|
|
54
58
|
},
|
|
55
59
|
"files": [
|
|
56
60
|
"dist",
|
|
57
|
-
"src/components"
|
|
61
|
+
"src/components",
|
|
62
|
+
"CHANGELOG.md"
|
|
58
63
|
],
|
|
59
64
|
"peerDependencies": {
|
|
60
|
-
"astro": ">=6.4.0"
|
|
65
|
+
"astro": ">=6.4.0",
|
|
66
|
+
"react": ">=19.0.0",
|
|
67
|
+
"react-dom": ">=19.0.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"react": {
|
|
71
|
+
"optional": true
|
|
72
|
+
},
|
|
73
|
+
"react-dom": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
61
76
|
},
|
|
62
77
|
"dependencies": {
|
|
63
78
|
"@astrojs/markdown-satteri": "^0.2.1",
|
|
@@ -66,14 +81,10 @@
|
|
|
66
81
|
"@clack/prompts": "^0.9.1",
|
|
67
82
|
"@shikijs/transformers": "^4.1.0",
|
|
68
83
|
"@vercel/detect-agent": "^1.2.3",
|
|
69
|
-
"
|
|
70
|
-
"satteri": "^0.6.3",
|
|
71
|
-
"yaml": "^2.7.1"
|
|
72
|
-
},
|
|
73
|
-
"devDependencies": {
|
|
74
|
-
"@shikijs/types": "^4.1.0",
|
|
75
|
-
"astro": "^6.4.0",
|
|
84
|
+
"clsx": "^2.1.1",
|
|
76
85
|
"github-slugger": "^2.0.0",
|
|
86
|
+
"mri": "^1.2.0",
|
|
87
|
+
"tailwind-merge": "^3.5.0",
|
|
77
88
|
"remark-lint-emphasis-marker": "^4.0.1",
|
|
78
89
|
"remark-lint-fenced-code-flag": "^4.2.0",
|
|
79
90
|
"remark-lint-heading-increment": "^4.0.1",
|
|
@@ -82,11 +93,17 @@
|
|
|
82
93
|
"remark-lint-no-literal-urls": "^4.0.1",
|
|
83
94
|
"remark-lint-no-multiple-toplevel-headings": "^4.0.1",
|
|
84
95
|
"remark-lint-unordered-list-marker-style": "^4.0.1",
|
|
96
|
+
"satteri": "^0.6.3",
|
|
97
|
+
"unified": "^11.0.5",
|
|
98
|
+
"vfile": "^6.0.3",
|
|
99
|
+
"yaml": "^2.7.1"
|
|
100
|
+
},
|
|
101
|
+
"devDependencies": {
|
|
102
|
+
"@shikijs/types": "^4.1.0",
|
|
103
|
+
"astro": "^6.4.0",
|
|
85
104
|
"tsdown": "^0.20.3",
|
|
86
105
|
"tsx": "^4.22.3",
|
|
87
|
-
"typescript": "^5.8.3"
|
|
88
|
-
"unified": "^11.0.5",
|
|
89
|
-
"vfile": "^6.0.3"
|
|
106
|
+
"typescript": "^5.8.3"
|
|
90
107
|
},
|
|
91
108
|
"scripts": {
|
|
92
109
|
"build": "tsdown",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-DZf0z79l.d.ts","names":[],"sources":["../src/lint/diagnostic.ts"],"mappings":";;AAyBA;;;;;;;;;;;;;;;;;;;;;;;cAAa,UAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0BD,QAAA,gBAAwB,UAAA;;;KAIxB,QAAA;;KAGA,cAAA,GAAiB,QAAA;AAAA,UAEZ,aAAA;EAyBT;EAvBN,WAAA;EAuBmB;;;;EAlBnB,KAAA,EAAO,KAAA;IAAQ,KAAA;IAAyB,IAAA;EAAA;AAAA;AAAA,UAGzB,UAAA;EACf,IAAA,EAAM,QAAA;EACN,QAAA,EAAU,QAAA;;;EAGV,MAAA;EACA,OAAA;;EAEA,IAAA;;EAEA,IAAA;;EAEA,MAAA;EACA,OAAA;EACA,SAAA;EACA,GAAA,GAAM,aAAA;AAAA"}
|