@schema-engine/registry 0.5.1 → 0.6.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/README.md +98 -14
- package/dist/bind-registry.d.ts +68 -0
- package/dist/bind-registry.js +1 -0
- package/dist/bind-registry.js.map +7 -0
- package/dist/chunk-24SNVXNP.js +2 -0
- package/dist/chunk-24SNVXNP.js.map +7 -0
- package/dist/chunk-55J6XMHW.js +0 -0
- package/dist/chunk-55J6XMHW.js.map +7 -0
- package/dist/chunk-DE7GQKZP.js +3 -0
- package/dist/chunk-DE7GQKZP.js.map +7 -0
- package/dist/chunk-FMWSZRDV.js +1 -0
- package/dist/chunk-FMWSZRDV.js.map +7 -0
- package/dist/chunk-GX6PAJLU.js +1 -0
- package/dist/chunk-GX6PAJLU.js.map +7 -0
- package/dist/chunk-IYIWS4LW.js +1 -0
- package/dist/chunk-IYIWS4LW.js.map +7 -0
- package/dist/chunk-LG33VSKX.js +1 -0
- package/dist/chunk-LG33VSKX.js.map +7 -0
- package/dist/chunk-NSLF54GM.js +1 -0
- package/dist/chunk-NSLF54GM.js.map +7 -0
- package/dist/chunk-O5CRFISG.js +1 -0
- package/dist/chunk-O5CRFISG.js.map +7 -0
- package/dist/chunk-P3DDHPDA.js +1 -0
- package/dist/chunk-P3DDHPDA.js.map +7 -0
- package/dist/chunk-QHVQ4S4D.js +1 -0
- package/dist/chunk-QHVQ4S4D.js.map +7 -0
- package/dist/chunk-RVS7JY2Y.js +1 -0
- package/dist/chunk-RVS7JY2Y.js.map +7 -0
- package/dist/chunk-UH3CEF45.js +1 -0
- package/dist/chunk-UH3CEF45.js.map +7 -0
- package/dist/chunk-XG4EZ5VP.js +1 -0
- package/dist/chunk-XG4EZ5VP.js.map +7 -0
- package/dist/create-registry.d.ts +83 -7
- package/dist/create-registry.js +1 -1
- package/dist/create-registry.js.map +4 -4
- package/dist/export-tree-schema.d.ts +100 -0
- package/dist/export-tree-schema.js +1 -0
- package/dist/export-tree-schema.js.map +7 -0
- package/dist/format-issue-path.d.ts +12 -0
- package/dist/format-issue-path.js +1 -0
- package/dist/format-issue-path.js.map +7 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/json-schema/embedder.d.ts +119 -0
- package/dist/json-schema/embedder.js +1 -0
- package/dist/json-schema/embedder.js.map +7 -0
- package/dist/json-schema/index.d.ts +5 -0
- package/dist/json-schema/index.js +1 -0
- package/dist/json-schema/index.js.map +7 -0
- package/dist/json-schema/slot.d.ts +46 -0
- package/dist/json-schema/slot.js +1 -0
- package/dist/json-schema/slot.js.map +7 -0
- package/dist/json-schema/standard.d.ts +44 -0
- package/dist/json-schema/standard.js +1 -0
- package/dist/json-schema/standard.js.map +7 -0
- package/dist/parse-node.d.ts +131 -0
- package/dist/parse-node.js +1 -0
- package/dist/parse-node.js.map +7 -0
- package/dist/parse-tree.d.ts +131 -0
- package/dist/parse-tree.js +1 -0
- package/dist/parse-tree.js.map +7 -0
- package/dist/registry-error.d.ts +80 -0
- package/dist/registry-error.js +1 -0
- package/dist/registry-error.js.map +7 -0
- package/dist/standard-schema.d.ts +19 -0
- package/dist/standard-schema.js +1 -1
- package/dist/standard-schema.js.map +4 -4
- package/dist/tree-types.d.ts +152 -0
- package/dist/tree-types.js +0 -0
- package/dist/tree-types.js.map +7 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.js +1 -0
- package/dist/yaml/index.js +1 -4
- package/dist/yaml/index.js.map +4 -4
- package/dist/yaml/parse.js +1 -2
- package/dist/yaml/parse.js.map +4 -4
- package/dist/yaml/stringify.js +1 -3
- package/dist/yaml/stringify.js.map +4 -4
- package/package.json +13 -9
- package/skill/SKILL.md +34 -33
- package/skill/reference/registry.md +120 -7
- package/dist/base-registry.d.ts +0 -73
- package/dist/base-registry.js +0 -1
- package/dist/base-registry.js.map +0 -7
|
@@ -9,6 +9,15 @@ export type StandardSchemaSafeParseResult<T> = {
|
|
|
9
9
|
issues: StandardSchemaIssue[];
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Whether `schema` is a Standard Schema: an object or function with a `~standard.validate` function.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* It looks at the shape only and never runs the schema. {@link assertStandardSchema} throws where this returns `false`, and
|
|
17
|
+
* {@link createRegistry} reports a registration for which it is `false` as `'invalid-schema'`. A domain package that checks
|
|
18
|
+
* schemas of its own, such as the slot schemas of a recipe, uses it to throw a {@link RegistryError} with its own details.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isStandardSchema(schema: unknown): schema is StandardSchemaV1;
|
|
12
21
|
/**
|
|
13
22
|
* Validate `value` with a Standard Schema without throwing.
|
|
14
23
|
*
|
|
@@ -21,3 +30,13 @@ export type StandardSchemaSafeParseResult<T> = {
|
|
|
21
30
|
* action parsing) need an immediate result.
|
|
22
31
|
*/
|
|
23
32
|
export declare function safeParseStandardSchema<TInput, TOutput>(schema: StandardSchemaV1<TInput, TOutput>, value: TInput): StandardSchemaSafeParseResult<TOutput>;
|
|
33
|
+
/**
|
|
34
|
+
* A Standard Schema that validates with a function, for a check that is not a schema library's.
|
|
35
|
+
*
|
|
36
|
+
* @param validate - Returns `{ value }` for an input that passes, or `{ issues }` for one that does not
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* The schema reports `schema-engine` as its vendor and is synchronous, as {@link safeParseStandardSchema} requires.
|
|
40
|
+
* `TInput` only types what the schema accepts, so an authoring type can be inferred from it; `validate` still receives `unknown`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function standardSchema<TOutput, TInput = unknown>(validate: (value: unknown) => StandardSchemaV1.Result<TOutput>): StandardSchemaV1<TInput, TOutput>;
|
package/dist/standard-schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{a,b,c}from"./chunk-P3DDHPDA.js";export{a as isStandardSchema,b as safeParseStandardSchema,c as standardSchema};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
|
+
import type { BaseRegistration, ChildPath } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* What the tree types need of a registration: its `$type`, its schema and where its children are.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* `$type` is required, unlike for {@link safeParseNode}, because `accepts` names `$type`s and the data of a child is
|
|
8
|
+
* found by one.
|
|
9
|
+
*/
|
|
10
|
+
export type TreeRegistration = Pick<BaseRegistration, '$type' | 'schema' | 'childPaths'>;
|
|
11
|
+
type Output<TRegistration extends Pick<BaseRegistration, 'schema'>> = StandardSchemaV1.InferOutput<TRegistration['schema']>;
|
|
12
|
+
/**
|
|
13
|
+
* The keys an object type declares, without the keys an index signature (a loose schema) only allows.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* A parent schema has to declare every key of a child path, so its exported JSON Schema shows the whole node. A loose
|
|
17
|
+
* object type allows any key through its index signature, which does not count as declaring one.
|
|
18
|
+
*/
|
|
19
|
+
export type DeclaredKeys<T> = T extends object ? keyof {
|
|
20
|
+
[K in keyof T as string extends K ? never : number extends K ? never : symbol extends K ? never : K]: 0;
|
|
21
|
+
} : never;
|
|
22
|
+
/**
|
|
23
|
+
* Whether every key of a child path is declared, walking through optional objects.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* A widened `keys` (`string[]`, from a registration that was not written with literals) is not checked.
|
|
27
|
+
*/
|
|
28
|
+
type PathDeclared<T, TKeys> = TKeys extends readonly [] ? true : TKeys extends readonly [infer THead extends string, ...infer TRest] ? THead extends DeclaredKeys<NonNullable<T>> ? PathDeclared<NonNullable<T>[THead & keyof NonNullable<T>], TRest> : false : true;
|
|
29
|
+
/** The child paths a registration declares that its schema output does not declare, as `{ $type, keys }`. */
|
|
30
|
+
type UndeclaredChildPaths<T> = T extends {
|
|
31
|
+
$type: infer TType;
|
|
32
|
+
schema: infer TSchema extends StandardSchemaV1;
|
|
33
|
+
readonly childPaths: readonly (infer TPath)[];
|
|
34
|
+
} ? unknown extends StandardSchemaV1.InferOutput<TSchema> ? never : TPath extends {
|
|
35
|
+
readonly keys: infer TKeys;
|
|
36
|
+
} ? PathDeclared<StandardSchemaV1.InferOutput<TSchema>, TKeys> extends true ? never : {
|
|
37
|
+
$type: TType;
|
|
38
|
+
keys: TKeys;
|
|
39
|
+
} : never : never;
|
|
40
|
+
/** The type a schema output has at `TKeys`, or `unknown` when the keys are widened or name nothing it declares. */
|
|
41
|
+
type SlotAt<T, TKeys> = TKeys extends readonly [infer THead extends string, ...infer TRest] ? THead extends keyof NonNullable<T> ? TRest extends readonly [] ? NonNullable<T>[THead] : SlotAt<NonNullable<T>[THead], TRest> : unknown : unknown;
|
|
42
|
+
/** Whether a slot type may hold a list: an array (optional or nullable), or a type that says nothing. */
|
|
43
|
+
type HoldsList<TSlot> = unknown extends TSlot ? true : [NonNullable<TSlot>] extends [never] ? true : [NonNullable<TSlot>] extends [readonly unknown[]] ? true : false;
|
|
44
|
+
/** The child paths that set `list` over a slot the schema output types as no array, as `{ $type, keys }`. */
|
|
45
|
+
type ListPathsNotArrays<T> = T extends {
|
|
46
|
+
readonly childPaths: readonly (infer TPath)[];
|
|
47
|
+
} ? TPath extends {
|
|
48
|
+
readonly keys: infer TKeys;
|
|
49
|
+
readonly list: true;
|
|
50
|
+
} ? T extends {
|
|
51
|
+
$type: infer TType;
|
|
52
|
+
schema: infer TSchema extends StandardSchemaV1;
|
|
53
|
+
} ? HoldsList<SlotAt<StandardSchemaV1.InferOutput<TSchema>, TKeys>> extends true ? never : {
|
|
54
|
+
$type: TType;
|
|
55
|
+
keys: TKeys;
|
|
56
|
+
} : never : never : never;
|
|
57
|
+
/**
|
|
58
|
+
* The properties of a child path entry other than `keys`, `accepts` and `list`, as `{ $type, property }`.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* `createRegistry` infers its registrations with a `const` type parameter, which keeps a property the constraint does
|
|
62
|
+
* not know (`accept` for `accepts`) instead of rejecting it as an excess property.
|
|
63
|
+
*/
|
|
64
|
+
type UnknownChildPathProperties<T> = T extends {
|
|
65
|
+
$type: infer TType;
|
|
66
|
+
readonly childPaths: readonly (infer TPath)[];
|
|
67
|
+
} ? TPath extends unknown ? [Exclude<keyof TPath, keyof ChildPath>] extends [never] ? never : {
|
|
68
|
+
$type: TType;
|
|
69
|
+
property: Exclude<keyof TPath, keyof ChildPath>;
|
|
70
|
+
} : never : never;
|
|
71
|
+
/**
|
|
72
|
+
* What `createRegistry` intersects with its `registrations` parameter, so a child path the schema does not declare is
|
|
73
|
+
* an error that names it: `Property 'childPathNotInSchema' is missing`, with the `$type` and the keys. A child path
|
|
74
|
+
* entry with a property other than `keys`, `accepts` and `list` is `childPathUnknownProperty`, with the `$type` and the
|
|
75
|
+
* property. A child path that sets `list` over a slot the schema types as no array (an object, a string) is
|
|
76
|
+
* `listPathNotAnArray`, with the `$type` and the keys, since the walk and the export would refuse every value there.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* `unknown` when every path is declared and well formed, which is the identity of an intersection. A schema whose
|
|
80
|
+
* output type cannot be read (`unknown`, a plain `StandardSchemaV1`) is not checked here; `safeParseTree` checks it at
|
|
81
|
+
* runtime.
|
|
82
|
+
*/
|
|
83
|
+
export type CheckChildPaths<T> = ([UndeclaredChildPaths<T>] extends [never] ? unknown : {
|
|
84
|
+
readonly childPathNotInSchema: UndeclaredChildPaths<T>;
|
|
85
|
+
}) & ([UnknownChildPathProperties<T>] extends [never] ? unknown : {
|
|
86
|
+
readonly childPathUnknownProperty: UnknownChildPathProperties<T>;
|
|
87
|
+
}) & ([ListPathsNotArrays<T>] extends [never] ? unknown : {
|
|
88
|
+
readonly listPathNotAnArray: ListPathsNotArrays<T>;
|
|
89
|
+
});
|
|
90
|
+
type AcceptedNames<T extends TreeRegistration> = T extends {
|
|
91
|
+
readonly childPaths: readonly (infer TPath)[];
|
|
92
|
+
} ? TPath extends {
|
|
93
|
+
readonly accepts: readonly (infer TName)[];
|
|
94
|
+
} ? TName : never : never;
|
|
95
|
+
/** The registrations whose schema output, when it can be read, declares no `$type`. */
|
|
96
|
+
type WithoutType<T extends TreeRegistration> = T extends unknown ? unknown extends Output<T> ? never : '$type' extends DeclaredKeys<Output<T>> ? never : T['$type'] : never;
|
|
97
|
+
/**
|
|
98
|
+
* What `safeParseTree` intersects with its lookup: an `accepts` name the lookup lacks is `acceptsUnknownType`, and a
|
|
99
|
+
* registration whose output declares no `$type` is `schemaOutputWithoutType`.
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* The check is here, not in `createRegistry`, because a registry is not always the whole vocabulary of a document (a
|
|
103
|
+
* layout names components of another registry), while the lookup handed to `safeParseTree` is whole. Widened
|
|
104
|
+
* declarations skip it.
|
|
105
|
+
*/
|
|
106
|
+
export type CheckLookup<T extends TreeRegistration> = ([Exclude<AcceptedNames<T>, T['$type']>] extends [never] ? unknown : {
|
|
107
|
+
readonly acceptsUnknownType: Exclude<AcceptedNames<T>, T['$type']>;
|
|
108
|
+
}) & ([WithoutType<T>] extends [never] ? unknown : {
|
|
109
|
+
readonly schemaOutputWithoutType: WithoutType<T>;
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* The registrations of a union that may answer one of the names `TName`: every one whose `$type` overlaps them.
|
|
113
|
+
*
|
|
114
|
+
* @remarks
|
|
115
|
+
* A literal `$type` overlaps when it is one of the names, a union of literals when any member is, and a widened
|
|
116
|
+
* `$type` (`string`, as `BaseRegistration` has) or a missing one always does, since it may hold any name at run time.
|
|
117
|
+
*/
|
|
118
|
+
export type AcceptedOf<TAll extends TreeRegistration, TName> = TAll extends {
|
|
119
|
+
$type: infer TType;
|
|
120
|
+
} ? string extends TType ? TAll : [Extract<TType, TName>] extends [never] ? never : TAll : TAll;
|
|
121
|
+
/** The registrations a child path accepts: those {@link AcceptedOf} its `accepts`, or all without one. */
|
|
122
|
+
export type Accepted<TAll extends TreeRegistration, TPath> = TPath extends {
|
|
123
|
+
readonly accepts: readonly (infer TName)[];
|
|
124
|
+
} ? AcceptedOf<TAll, TName> : TAll;
|
|
125
|
+
/**
|
|
126
|
+
* The value at a child path once its children are parsed. A list stays a list, an absent slot stays absent, and `null`
|
|
127
|
+
* is not a slot value (it is an issue at runtime).
|
|
128
|
+
*/
|
|
129
|
+
type Replace<TValue, TChild, TList> = unknown extends TValue ? (TList extends true ? TChild[] : TChild | TChild[]) | undefined : TValue extends undefined ? TValue : TValue extends null ? never : TValue extends readonly unknown[] ? TChild[] : TChild;
|
|
130
|
+
type SetAt<T, TKeys, TPath, TAll extends TreeRegistration> = TKeys extends readonly [
|
|
131
|
+
infer THead extends string,
|
|
132
|
+
...infer TRest
|
|
133
|
+
] ? T extends object ? {
|
|
134
|
+
[P in keyof T]: P extends THead ? TRest extends readonly [] ? Replace<T[P], NodeData<TAll, Accepted<TAll, TPath>>, TPath extends {
|
|
135
|
+
readonly list: true;
|
|
136
|
+
} ? true : false> : SetAt<T[P], TRest, TPath, TAll> : T[P];
|
|
137
|
+
} : T : T;
|
|
138
|
+
type WithChildren<T, TPaths, TAll extends TreeRegistration> = TPaths extends readonly [infer THead, ...infer TRest] ? THead extends ChildPath ? WithChildren<SetAt<T, THead['keys'], THead, TAll>, TRest, TAll> : T : T;
|
|
139
|
+
/**
|
|
140
|
+
* The data of a node once its children are parsed: the schema output of the registration with each child path replaced
|
|
141
|
+
* by the data of what the document holds there.
|
|
142
|
+
*
|
|
143
|
+
* @remarks
|
|
144
|
+
* Optional stays optional, an array slot is an array and an object slot an object. A slot typed `unknown` becomes
|
|
145
|
+
* `child | child[] | undefined`, and `child[] | undefined` for a path that sets `list`. The child type is computed inside the mapped property, so a registration that accepts
|
|
146
|
+
* itself does not recurse eagerly. `child` is the union of the registrations the path accepts, or of the whole lookup
|
|
147
|
+
* without `accepts`. A registry typed as plain `BaseRegistration` has no concrete schema to read, so its data is
|
|
148
|
+
* `unknown`. A `childPaths` that lost its literal keys (a registration declared apart without `as const`) leaves the
|
|
149
|
+
* schema output unchanged.
|
|
150
|
+
*/
|
|
151
|
+
export type NodeData<TAll extends TreeRegistration, TRegistration extends TreeRegistration = TAll> = TRegistration extends unknown ? WithChildren<Output<TRegistration>, TRegistration['childPaths'], TAll> : never;
|
|
152
|
+
export {};
|
|
File without changes
|
package/dist/types.d.ts
CHANGED
|
@@ -27,6 +27,35 @@ declare const __brand: unique symbol;
|
|
|
27
27
|
export type Brand<T, TBrand> = T & {
|
|
28
28
|
readonly [__brand]?: TBrand;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* One place where a node holds child nodes, as a registration declares it in `childPaths`.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Plain data, so a registration stays serializable. `keys` is relative to the node and holds no indexes, which is why
|
|
35
|
+
* it is not called `path`: a `path` in this package is an absolute document path with indexes. The value there is one
|
|
36
|
+
* node or an array of nodes, unless `list` says the slot holds a list. `accepts` is a closed list of `$type`s, the only way to restrict a slot: it reads no
|
|
37
|
+
* role, tag or category, and `metadata` decides nothing. Adding a leaf to `[...defaults, custom]` means overriding each
|
|
38
|
+
* container that should take it. Without `accepts`, the slot puts no limit on the `$type`, so any `$type` the lookup
|
|
39
|
+
* answers is accepted. The parent's schema keeps the slot opaque (`z.array(z.unknown())`, `z.unknown()`). A tool that
|
|
40
|
+
* reads child paths does not decide what a slot takes: it checks a document with `safeParseTree`, or validates it
|
|
41
|
+
* against the JSON Schema that `exportTreeSchema` writes.
|
|
42
|
+
*/
|
|
43
|
+
export interface ChildPath {
|
|
44
|
+
/** The keys from the node to the slot, for example `['engine', 'controls']` for `node.engine.controls`. */
|
|
45
|
+
readonly keys: readonly string[];
|
|
46
|
+
/** The `$type`s allowed at the slot, at least one when present. Absent: `accepts` puts no limit on the `$type`. */
|
|
47
|
+
readonly accepts?: readonly string[];
|
|
48
|
+
/**
|
|
49
|
+
* The slot holds a list of nodes, never one node. Absent: it holds a node or a list.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* With `list`, a value that is not an array is the issue `registry/not-a-list` at the path, the exported JSON Schema
|
|
53
|
+
* writes an open slot as an array, and the types read the slot as an array of the children. A missing value is still
|
|
54
|
+
* no children. A registration whose schema declares the slot as an array sets it, so the document, the export and the
|
|
55
|
+
* types agree.
|
|
56
|
+
*/
|
|
57
|
+
readonly list?: true;
|
|
58
|
+
}
|
|
30
59
|
/**
|
|
31
60
|
* Base registration interface - common fields for all registration types.
|
|
32
61
|
*
|
|
@@ -41,6 +70,18 @@ export interface BaseRegistration<_TConfig = unknown, TMeta extends Registration
|
|
|
41
70
|
schema: StandardSchemaV1;
|
|
42
71
|
/** Registration metadata (display name, description, and type-specific fields) */
|
|
43
72
|
metadata: TMeta;
|
|
73
|
+
/**
|
|
74
|
+
* Where a node of this `$type` holds child nodes, and which `$type`s each place accepts.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* `[{ keys: ['blocks'], accepts: ['block'] }, { keys: ['engine', 'controls'] }]` says a node has children at
|
|
78
|
+
* `node.blocks` and at `node.engine.controls`. A path is read from the node as authored, so the issues
|
|
79
|
+
* {@link safeParseTree} reports point at the document. A missing value is no children, and the schema decides
|
|
80
|
+
* whether it may be missing. An array holds nodes only; what is not a node is reached by its keys, which is why a
|
|
81
|
+
* path is a list of keys. `createRegistry` checks each path when it builds the registry, and at the type level that
|
|
82
|
+
* the schema declares every key of it.
|
|
83
|
+
*/
|
|
84
|
+
readonly childPaths?: readonly ChildPath[];
|
|
44
85
|
}
|
|
45
86
|
/**
|
|
46
87
|
* Component registration interface.
|
package/dist/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-55J6XMHW.js";
|
package/dist/yaml/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`):"Invalid YAML document"),this.name="YamlDocumentError",this.issues=n}};function T(e){let n="";for(let t of e)typeof t=="number"?n+=`[${t}]`:n+=n?`.${String(t)}`:String(t);return n}function M(e){let n=e.filename?`${e.filename}:${e.line}:${e.column}`:`line ${e.line}, column ${e.column}`,t=T(e.path);return t?`${n} ${t}: ${e.message}`:`${n} ${e.message}`}function E(e){return typeof e=="object"?e.key:e}function A(e,n){for(let t=n.length;t>0;t--){let s=e.getIn(n.slice(0,t),!0);if(I(s)&&s.range)return s}return e.contents?.range?e.contents:null}var h=100;function v(e){return e.replace(/ at line \d+, column \d+:?[\s\S]*$/,"")}function x(e,n){return e!==void 0&&n!==void 0&&e.line===n.line&&e.col===n.col}function S(e){let n="tag:yaml.org,2002:";return e.startsWith(n)?`!!${e.slice(n.length)}`:e}function _(e){switch(e.code){case"MULTIPLE_DOCS":return"A file holds one document; remove the extra `---`.";case"MULTILINE_IMPLICIT_KEY":return"Bad indentation or a missing colon: line this up with the keys above it, or put the whole key on one line.";case"TAG_RESOLVE_FAILED":{let n=/Unresolved tag: (\S+)/.exec(e.message)?.[1];return`Tags are not supported: remove ${n?`${S(n)} `:""}and write the value plainly. Quote a string that looks like another type.`}default:return v(e.message)}}function $(e){let[n,t]=e.linePos??[];return(e.code==="MULTILINE_IMPLICIT_KEY"?t:n)??n??{line:1,col:1}}function k(e){let n=e.errors.filter(t=>t.code==="MULTILINE_IMPLICIT_KEY");return[...e.errors,...e.warnings].filter(t=>t.code!=="BLOCK_AS_IMPLICIT_KEY"||!n.some(s=>x(s.linePos?.[0],t.linePos?.[0]))).map(t=>({message:_(t),position:$(t)}))}function w(e){return e instanceof Error&&/alias count/i.test(e.message)?`The document has more than ${h} alias expansions (*name) in all. Write the repeated value out, or use fewer or smaller anchors.`:e instanceof Error?e.message:"The document could not be read"}function Y(e,n,t){let s=new P,l=e.charCodeAt(0)===65279?e.slice(1):e,i=L(l,{lineCounter:s,version:"1.2",schema:"core",resolveKnownTags:!1,merge:!0,stringKeys:!0}),r=(o,a,c,m)=>{let d={message:o,path:a,line:c,column:m};return t?.filename!==void 0&&(d.filename=t.filename),d},u=k(i);if(u.length>0)return{success:!1,issues:u.map(({message:o,position:a})=>r(o,[],a.line,a.col))};let y;try{y=i.toJS({maxAliasCount:h})}catch(o){return{success:!1,issues:[r(w(o),[],1,1)]}}let g=n(y);return g.success?{success:!0,data:g.data}:{success:!1,issues:g.issues.map(o=>{let a=(o.path??[]).map(E),c=A(i,a),m=c?.range?s.linePos(c.range[0]):{line:1,col:1};return r(o.message,a,m.line,m.col)})}}function O(e,n,t){let s=Y(e,n,t);if(!s.success)throw new f(s.issues);return s.data}import{Document as K,isPair as U,isScalar as p,visit as C}from"yaml";var D=3,b=48;function N(e){if(e.items.length===0||e.items.length>D)return!1;let n=0;for(let t of e.items){if(!p(t.key)||!p(t.value))return!1;let s=String(t.value.value);if(s.includes(`
|
|
3
|
-
`))return!1;n+=String(t.key.value).length+s.length+4}return n<=b}function W(e,n){let t=n?.schemaUrl;if(t!==void 0&&/[\r\n]/.test(t))throw new TypeError("schemaUrl must be a single line");let s=new K(e,{version:"1.2",aliasDuplicateObjects:!1});C(s,{Pair(i,r){p(r.key)&&r.key.value==="<<"&&(r.key.type="QUOTE_DOUBLE")},Map(i,r,u){U(u.at(-1))&&N(r)&&(r.flow=!0)}});let l=s.toString({lineWidth:0});return t===void 0?l:`# yaml-language-server: $schema=${t}
|
|
4
|
-
${l}`}export{f as YamlDocumentError,O as parseYaml,Y as safeParseYaml,W as stringifyYaml};
|
|
1
|
+
import{a as r,b as a,c as e}from"../chunk-24SNVXNP.js";import{a as s}from"../chunk-DE7GQKZP.js";export{r as YamlDocumentError,e as parseYaml,a as safeParseYaml,s as stringifyYaml};
|
package/dist/yaml/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": ["import { LineCounter, isNode, parseDocument } from 'yaml';\nimport type { Document, Node, YAMLError, YAMLWarning } from 'yaml';\n\n/** One segment of a Standard Schema issue path: a key, or `{ key }` as Standard Schema allows. */\ntype PathSegment = PropertyKey | { readonly key: PropertyKey };\n\n/**\n * A validator for the parsed value, in the shape of Standard Schema issues. It must be synchronous.\n *\n * @remarks\n * `engine.safeValidateForm` from `@schema-engine/forms` fits as it is. For a Standard Schema\n * (`zod`, `valibot`, ...), wrap its `~standard.validate` and return `{ success: true, data }` or\n * `{ success: false, issues }`.\n */\nexport type YamlValidate<T> = (\n\tvalue: unknown,\n) =>\n\t| { success: true; data: T }\n\t| { success: false; issues: ReadonlyArray<{ message: string; path?: ReadonlyArray<PathSegment> }> };\n\n/**\n * A problem found in a YAML document, placed in its source text.\n *\n * @remarks\n * `line` and `column` count from 1. For a validation issue they point at the start of the value the\n * `path` names; when the path names a key the document does not have, they point at the nearest\n * ancestor that exists. A syntax error has an empty `path` and the position the parser reports.\n */\nexport type YamlIssue = {\n\tmessage: string;\n\tpath: PropertyKey[];\n\tline: number;\n\tcolumn: number;\n\tfilename?: string;\n};\n\n/** What {@link safeParseYaml} returns: the validated data, or every issue found. */\nexport type YamlParseResult<T> = { success: true; data: T } | { success: false; issues: YamlIssue[] };\n\nexport type YamlParseOptions = {\n\t/** Name of the file the text came from; it prefixes error messages and is set on each issue. */\n\tfilename?: string;\n};\n\n/**\n * Thrown by {@link parseYaml} when the text is not valid YAML or its value does not validate.\n *\n * @remarks\n * `message` lists the issues one per line as `<file>:<line>:<column> <path>: <message>`, so a log\n * reads without parsing `issues`.\n */\nexport class YamlDocumentError extends Error {\n\treadonly issues: YamlIssue[];\n\n\tconstructor(issues: YamlIssue[]) {\n\t\tsuper(issues.length > 0 ? issues.map(formatIssue).join('\\n') : 'Invalid YAML document');\n\t\tthis.name = 'YamlDocumentError';\n\t\tthis.issues = issues;\n\t}\n}\n\n/** A path as it reads in an error message: `steps[0].elements[2].grid.width`. */\nfunction formatPath(path: PropertyKey[]): string {\n\tlet text = '';\n\tfor (const key of path) {\n\t\tif (typeof key === 'number') {\n\t\t\ttext += `[${key}]`;\n\t\t} else {\n\t\t\ttext += text ? `.${String(key)}` : String(key);\n\t\t}\n\t}\n\treturn text;\n}\n\nfunction formatIssue(issue: YamlIssue): string {\n\tconst location = issue.filename\n\t\t? `${issue.filename}:${issue.line}:${issue.column}`\n\t\t: `line ${issue.line}, column ${issue.column}`;\n\tconst path = formatPath(issue.path);\n\treturn path ? `${location} ${path}: ${issue.message}` : `${location} ${issue.message}`;\n}\n\nfunction toKey(segment: PathSegment): PropertyKey {\n\treturn typeof segment === 'object' ? segment.key : segment;\n}\n\n/**\n * The source node a path names, or the nearest ancestor that exists when the document lacks the\n * last keys of the path.\n */\nfunction nodeForPath(doc: Document.Parsed, path: PropertyKey[]): Node | null {\n\tfor (let length = path.length; length > 0; length--) {\n\t\tconst node = doc.getIn(path.slice(0, length), true);\n\t\tif (isNode(node) && node.range) {\n\t\t\treturn node;\n\t\t}\n\t}\n\treturn doc.contents?.range ? doc.contents : null;\n}\n\n/** The most alias expansions `toJS` allows before it gives up, which guards against alias bombs. */\nconst MAX_ALIAS_COUNT = 100;\n\n/** The parser's message without the ` at line N, column N:` suffix and the code frame it appends. */\nfunction syntaxMessage(message: string): string {\n\treturn message.replace(/ at line \\d+, column \\d+:?[\\s\\S]*$/, '');\n}\n\ntype Position = { line: number; col: number };\n\nfunction samePosition(a: Position | undefined, b: Position | undefined): boolean {\n\treturn a !== undefined && b !== undefined && a.line === b.line && a.col === b.col;\n}\n\n/** `tag:yaml.org,2002:float` as it is written in a document, `!!float`. */\nfunction shortTag(tag: string): string {\n\tconst prefix = 'tag:yaml.org,2002:';\n\treturn tag.startsWith(prefix) ? `!!${tag.slice(prefix.length)}` : tag;\n}\n\n/**\n * The message an author can act on. The parser's own text often advises changing a `yaml` API call,\n * which the author of a document cannot do.\n */\nfunction friendlyMessage(problem: YAMLError | YAMLWarning): string {\n\tswitch (problem.code) {\n\t\tcase 'MULTIPLE_DOCS':\n\t\t\treturn 'A file holds one document; remove the extra `---`.';\n\t\tcase 'MULTILINE_IMPLICIT_KEY':\n\t\t\treturn 'Bad indentation or a missing colon: line this up with the keys above it, or put the whole key on one line.';\n\t\tcase 'TAG_RESOLVE_FAILED': {\n\t\t\tconst tag = /Unresolved tag: (\\S+)/.exec(problem.message)?.[1];\n\t\t\tconst name = tag ? `${shortTag(tag)} ` : '';\n\t\t\treturn `Tags are not supported: remove ${name}and write the value plainly. Quote a string that looks like another type.`;\n\t\t}\n\t\tdefault:\n\t\t\treturn syntaxMessage(problem.message);\n\t}\n}\n\n/**\n * Where a parser problem is reported. A `MULTILINE_IMPLICIT_KEY` starts on the line above the\n * over-indented line that ends it, so it is reported at its end.\n */\nfunction positionOf(problem: YAMLError | YAMLWarning): Position {\n\tconst [start, end] = problem.linePos ?? [];\n\treturn (problem.code === 'MULTILINE_IMPLICIT_KEY' ? end : start) ?? start ?? { line: 1, col: 1 };\n}\n\n/**\n * Every parser error and warning. An over-indented line makes the parser report two errors from the\n * same place; the `BLOCK_AS_IMPLICIT_KEY` one is dropped.\n */\nfunction parserProblems(doc: Document.Parsed): Array<{ message: string; position: Position }> {\n\tconst multiline = doc.errors.filter((error) => error.code === 'MULTILINE_IMPLICIT_KEY');\n\treturn [...doc.errors, ...doc.warnings]\n\t\t.filter(\n\t\t\t(problem) =>\n\t\t\t\tproblem.code !== 'BLOCK_AS_IMPLICIT_KEY' ||\n\t\t\t\t!multiline.some((other) => samePosition(other.linePos?.[0], problem.linePos?.[0])),\n\t\t)\n\t\t.map((problem) => ({ message: friendlyMessage(problem), position: positionOf(problem) }));\n}\n\n/** The text of an error `toJS` throws, with the alias limit said in terms an author can use. */\nfunction conversionMessage(error: unknown): string {\n\tif (error instanceof Error && /alias count/i.test(error.message)) {\n\t\treturn `The document has more than ${MAX_ALIAS_COUNT} alias expansions (*name) in all. Write the repeated value out, or use fewer or smaller anchors.`;\n\t}\n\treturn error instanceof Error ? error.message : 'The document could not be read';\n}\n\n/**\n * Parse YAML text and validate the value, returning the issues instead of throwing.\n *\n * @param text A single YAML document, read as YAML 1.2 with the core schema: only `true`, `false`,\n * `null` and numbers are special, so `no`, `on` and `yes` stay strings. A leading byte order mark is\n * ignored.\n * @param validate Called with the parsed value, only when the text is valid YAML.\n * @returns `{ success: true, data }` with what `validate` returned, or `{ success: false, issues }`\n * with each syntax error or validation issue and its line and column.\n *\n * @remarks\n * An unquoted `1.10` is the number `1.1` in every YAML version; quote it (`\"1.10\"`) to keep a string.\n * Multiple documents in one text are a syntax error. Tags (`!!binary`, `!!set`, `!custom`) are\n * reported as issues, so what `validate` receives is always JSON-shaped. Mapping keys are read as\n * strings: `1: a` is `{ '1': 'a' }`.\n *\n * Anchors, aliases and merge keys (`<<: *defaults`) work within the text. A text with more than 100\n * alias expansions is reported as an issue at line 1, not thrown. An issue inside a merged value\n * points at the map that merges it, because the merged keys have no place of their own. A merge\n * source that is not a map (`<<: 5`) is reported at line 1, column 1.\n */\nexport function safeParseYaml<T>(\n\ttext: string,\n\tvalidate: YamlValidate<T>,\n\toptions?: YamlParseOptions,\n): YamlParseResult<T> {\n\tconst lineCounter = new LineCounter();\n\tconst source = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;\n\tconst doc = parseDocument(source, {\n\t\tlineCounter,\n\t\tversion: '1.2',\n\t\tschema: 'core',\n\t\tresolveKnownTags: false,\n\t\tmerge: true,\n\t\tstringKeys: true,\n\t});\n\n\tconst issue = (message: string, path: PropertyKey[], line: number, column: number): YamlIssue => {\n\t\tconst found: YamlIssue = { message, path, line, column };\n\t\tif (options?.filename !== undefined) {\n\t\t\tfound.filename = options.filename;\n\t\t}\n\t\treturn found;\n\t};\n\n\tconst problems = parserProblems(doc);\n\tif (problems.length > 0) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tissues: problems.map(({ message, position }) => issue(message, [], position.line, position.col)),\n\t\t};\n\t}\n\n\tlet value: unknown;\n\ttry {\n\t\tvalue = doc.toJS({ maxAliasCount: MAX_ALIAS_COUNT });\n\t} catch (error) {\n\t\treturn { success: false, issues: [issue(conversionMessage(error), [], 1, 1)] };\n\t}\n\n\tconst result = validate(value);\n\tif (result.success) {\n\t\treturn { success: true, data: result.data };\n\t}\n\treturn {\n\t\tsuccess: false,\n\t\tissues: result.issues.map((found) => {\n\t\t\tconst path = (found.path ?? []).map(toKey);\n\t\t\tconst node = nodeForPath(doc, path);\n\t\t\tconst start = node?.range ? lineCounter.linePos(node.range[0]) : { line: 1, col: 1 };\n\t\t\treturn issue(found.message, path, start.line, start.col);\n\t\t}),\n\t};\n}\n\n/**\n * Parse YAML text and validate the value, throwing when either fails.\n *\n * @throws {YamlDocumentError} With each syntax error or validation issue and its line and column.\n * {@link safeParseYaml} returns them instead.\n */\nexport function parseYaml<T>(text: string, validate: YamlValidate<T>, options?: YamlParseOptions): T {\n\tconst result = safeParseYaml(text, validate, options);\n\tif (!result.success) {\n\t\tthrow new YamlDocumentError(result.issues);\n\t}\n\treturn result.data;\n}\n", "import { Document, isPair, isScalar, visit } from 'yaml';\nimport type { YAMLMap } from 'yaml';\n\n/**\n * Limits for a map written in flow style: scalar entries only, at most this many, and about this\n * many characters.\n *\n * @remarks\n * `grid: { width: half }` reads better inline; an element with many keys does not.\n */\nconst MAX_FLOW_ENTRIES = 3;\nconst MAX_FLOW_LENGTH = 48;\n\nexport type StringifyYamlOptions = {\n\t/** Adds a `# yaml-language-server: $schema=<url>` header, which editors read to offer completion. */\n\tschemaUrl?: string;\n};\n\nfunction isShortLeafMap(map: YAMLMap): boolean {\n\tif (map.items.length === 0 || map.items.length > MAX_FLOW_ENTRIES) {\n\t\treturn false;\n\t}\n\tlet length = 0;\n\tfor (const pair of map.items) {\n\t\tif (!isScalar(pair.key) || !isScalar(pair.value)) {\n\t\t\treturn false;\n\t\t}\n\t\tconst value = String(pair.value.value);\n\t\tif (value.includes('\\n')) {\n\t\t\treturn false;\n\t\t}\n\t\tlength += String(pair.key.value).length + value.length + 4;\n\t}\n\treturn length <= MAX_FLOW_LENGTH;\n}\n\n/**\n * Write a value as YAML text.\n *\n * @remarks\n * An object that appears twice is written out twice, not as an anchor and an alias. A short map of\n * scalars under a key is written in flow style (`grid: { width: half }`); every other collection,\n * including a sequence item, is written in block style. Lines are not folded.\n * Strings that would read as another type are quoted, so `\"1.10\"` stays a string when parsed back,\n * and so is a key named `<<`, which `parseYaml` would otherwise read as a merge key.\n * `no` and `on` are not quoted, because YAML 1.2 reads them as strings; a YAML 1.1 reader would not.\n */\nexport function stringifyYaml(value: unknown, options?: StringifyYamlOptions): string {\n\tconst schemaUrl = options?.schemaUrl;\n\tif (schemaUrl !== undefined && /[\\r\\n]/.test(schemaUrl)) {\n\t\tthrow new TypeError('schemaUrl must be a single line');\n\t}\n\tconst doc = new Document(value, { version: '1.2', aliasDuplicateObjects: false });\n\tvisit(doc, {\n\t\tPair(_key, pair) {\n\t\t\tif (isScalar(pair.key) && pair.key.value === '<<') {\n\t\t\t\tpair.key.type = 'QUOTE_DOUBLE';\n\t\t\t}\n\t\t},\n\t\tMap(_key, map, path) {\n\t\t\tif (isPair(path.at(-1)) && isShortLeafMap(map)) {\n\t\t\t\tmap.flow = true;\n\t\t\t}\n\t\t},\n\t});\n\tconst text = doc.toString({ lineWidth: 0 });\n\treturn schemaUrl === undefined ? text : `# yaml-language-server: $schema=${schemaUrl}\\n${text}`;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/yaml/parse.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`):"Invalid YAML document"),this.name="YamlDocumentError",this.issues=n}};function Y(e){let n="";for(let t of e)typeof t=="number"?n+=`[${t}]`:n+=n?`.${String(t)}`:String(t);return n}function T(e){let n=e.filename?`${e.filename}:${e.line}:${e.column}`:`line ${e.line}, column ${e.column}`,t=Y(e.path);return t?`${n} ${t}: ${e.message}`:`${n} ${e.message}`}function L(e){return typeof e=="object"?e.key:e}function A(e,n){for(let t=n.length;t>0;t--){let s=e.getIn(n.slice(0,t),!0);if(P(s)&&s.range)return s}return e.contents?.range?e.contents:null}var p=100;function M(e){return e.replace(/ at line \d+, column \d+:?[\s\S]*$/,"")}function E(e,n){return e!==void 0&&n!==void 0&&e.line===n.line&&e.col===n.col}function $(e){let n="tag:yaml.org,2002:";return e.startsWith(n)?`!!${e.slice(n.length)}`:e}function K(e){switch(e.code){case"MULTIPLE_DOCS":return"A file holds one document; remove the extra `---`.";case"MULTILINE_IMPLICIT_KEY":return"Bad indentation or a missing colon: line this up with the keys above it, or put the whole key on one line.";case"TAG_RESOLVE_FAILED":{let n=/Unresolved tag: (\S+)/.exec(e.message)?.[1];return`Tags are not supported: remove ${n?`${$(n)} `:""}and write the value plainly. Quote a string that looks like another type.`}default:return M(e.message)}}function x(e){let[n,t]=e.linePos??[];return(e.code==="MULTILINE_IMPLICIT_KEY"?t:n)??n??{line:1,col:1}}function _(e){let n=e.errors.filter(t=>t.code==="MULTILINE_IMPLICIT_KEY");return[...e.errors,...e.warnings].filter(t=>t.code!=="BLOCK_AS_IMPLICIT_KEY"||!n.some(s=>E(s.linePos?.[0],t.linePos?.[0]))).map(t=>({message:K(t),position:x(t)}))}function w(e){return e instanceof Error&&/alias count/i.test(e.message)?`The document has more than ${p} alias expansions (*name) in all. Write the repeated value out, or use fewer or smaller anchors.`:e instanceof Error?e.message:"The document could not be read"}function v(e,n,t){let s=new h,y=e.charCodeAt(0)===65279?e.slice(1):e,l=I(y,{lineCounter:s,version:"1.2",schema:"core",resolveKnownTags:!1,merge:!0,stringKeys:!0}),u=(r,o,a,i)=>{let d={message:r,path:o,line:a,column:i};return t?.filename!==void 0&&(d.filename=t.filename),d},f=_(l);if(f.length>0)return{success:!1,issues:f.map(({message:r,position:o})=>u(r,[],o.line,o.col))};let g;try{g=l.toJS({maxAliasCount:p})}catch(r){return{success:!1,issues:[u(w(r),[],1,1)]}}let c=n(g);return c.success?{success:!0,data:c.data}:{success:!1,issues:c.issues.map(r=>{let o=(r.path??[]).map(L),a=A(l,o),i=a?.range?s.linePos(a.range[0]):{line:1,col:1};return u(r.message,o,i.line,i.col)})}}function C(e,n,t){let s=v(e,n,t);if(!s.success)throw new m(s.issues);return s.data}export{m as YamlDocumentError,C as parseYaml,v as safeParseYaml};
|
|
1
|
+
import{a,b,c}from"../chunk-24SNVXNP.js";export{a as YamlDocumentError,c as parseYaml,b as safeParseYaml};
|
package/dist/yaml/parse.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": ["import { LineCounter, isNode, parseDocument } from 'yaml';\nimport type { Document, Node, YAMLError, YAMLWarning } from 'yaml';\n\n/** One segment of a Standard Schema issue path: a key, or `{ key }` as Standard Schema allows. */\ntype PathSegment = PropertyKey | { readonly key: PropertyKey };\n\n/**\n * A validator for the parsed value, in the shape of Standard Schema issues. It must be synchronous.\n *\n * @remarks\n * `engine.safeValidateForm` from `@schema-engine/forms` fits as it is. For a Standard Schema\n * (`zod`, `valibot`, ...), wrap its `~standard.validate` and return `{ success: true, data }` or\n * `{ success: false, issues }`.\n */\nexport type YamlValidate<T> = (\n\tvalue: unknown,\n) =>\n\t| { success: true; data: T }\n\t| { success: false; issues: ReadonlyArray<{ message: string; path?: ReadonlyArray<PathSegment> }> };\n\n/**\n * A problem found in a YAML document, placed in its source text.\n *\n * @remarks\n * `line` and `column` count from 1. For a validation issue they point at the start of the value the\n * `path` names; when the path names a key the document does not have, they point at the nearest\n * ancestor that exists. A syntax error has an empty `path` and the position the parser reports.\n */\nexport type YamlIssue = {\n\tmessage: string;\n\tpath: PropertyKey[];\n\tline: number;\n\tcolumn: number;\n\tfilename?: string;\n};\n\n/** What {@link safeParseYaml} returns: the validated data, or every issue found. */\nexport type YamlParseResult<T> = { success: true; data: T } | { success: false; issues: YamlIssue[] };\n\nexport type YamlParseOptions = {\n\t/** Name of the file the text came from; it prefixes error messages and is set on each issue. */\n\tfilename?: string;\n};\n\n/**\n * Thrown by {@link parseYaml} when the text is not valid YAML or its value does not validate.\n *\n * @remarks\n * `message` lists the issues one per line as `<file>:<line>:<column> <path>: <message>`, so a log\n * reads without parsing `issues`.\n */\nexport class YamlDocumentError extends Error {\n\treadonly issues: YamlIssue[];\n\n\tconstructor(issues: YamlIssue[]) {\n\t\tsuper(issues.length > 0 ? issues.map(formatIssue).join('\\n') : 'Invalid YAML document');\n\t\tthis.name = 'YamlDocumentError';\n\t\tthis.issues = issues;\n\t}\n}\n\n/** A path as it reads in an error message: `steps[0].elements[2].grid.width`. */\nfunction formatPath(path: PropertyKey[]): string {\n\tlet text = '';\n\tfor (const key of path) {\n\t\tif (typeof key === 'number') {\n\t\t\ttext += `[${key}]`;\n\t\t} else {\n\t\t\ttext += text ? `.${String(key)}` : String(key);\n\t\t}\n\t}\n\treturn text;\n}\n\nfunction formatIssue(issue: YamlIssue): string {\n\tconst location = issue.filename\n\t\t? `${issue.filename}:${issue.line}:${issue.column}`\n\t\t: `line ${issue.line}, column ${issue.column}`;\n\tconst path = formatPath(issue.path);\n\treturn path ? `${location} ${path}: ${issue.message}` : `${location} ${issue.message}`;\n}\n\nfunction toKey(segment: PathSegment): PropertyKey {\n\treturn typeof segment === 'object' ? segment.key : segment;\n}\n\n/**\n * The source node a path names, or the nearest ancestor that exists when the document lacks the\n * last keys of the path.\n */\nfunction nodeForPath(doc: Document.Parsed, path: PropertyKey[]): Node | null {\n\tfor (let length = path.length; length > 0; length--) {\n\t\tconst node = doc.getIn(path.slice(0, length), true);\n\t\tif (isNode(node) && node.range) {\n\t\t\treturn node;\n\t\t}\n\t}\n\treturn doc.contents?.range ? doc.contents : null;\n}\n\n/** The most alias expansions `toJS` allows before it gives up, which guards against alias bombs. */\nconst MAX_ALIAS_COUNT = 100;\n\n/** The parser's message without the ` at line N, column N:` suffix and the code frame it appends. */\nfunction syntaxMessage(message: string): string {\n\treturn message.replace(/ at line \\d+, column \\d+:?[\\s\\S]*$/, '');\n}\n\ntype Position = { line: number; col: number };\n\nfunction samePosition(a: Position | undefined, b: Position | undefined): boolean {\n\treturn a !== undefined && b !== undefined && a.line === b.line && a.col === b.col;\n}\n\n/** `tag:yaml.org,2002:float` as it is written in a document, `!!float`. */\nfunction shortTag(tag: string): string {\n\tconst prefix = 'tag:yaml.org,2002:';\n\treturn tag.startsWith(prefix) ? `!!${tag.slice(prefix.length)}` : tag;\n}\n\n/**\n * The message an author can act on. The parser's own text often advises changing a `yaml` API call,\n * which the author of a document cannot do.\n */\nfunction friendlyMessage(problem: YAMLError | YAMLWarning): string {\n\tswitch (problem.code) {\n\t\tcase 'MULTIPLE_DOCS':\n\t\t\treturn 'A file holds one document; remove the extra `---`.';\n\t\tcase 'MULTILINE_IMPLICIT_KEY':\n\t\t\treturn 'Bad indentation or a missing colon: line this up with the keys above it, or put the whole key on one line.';\n\t\tcase 'TAG_RESOLVE_FAILED': {\n\t\t\tconst tag = /Unresolved tag: (\\S+)/.exec(problem.message)?.[1];\n\t\t\tconst name = tag ? `${shortTag(tag)} ` : '';\n\t\t\treturn `Tags are not supported: remove ${name}and write the value plainly. Quote a string that looks like another type.`;\n\t\t}\n\t\tdefault:\n\t\t\treturn syntaxMessage(problem.message);\n\t}\n}\n\n/**\n * Where a parser problem is reported. A `MULTILINE_IMPLICIT_KEY` starts on the line above the\n * over-indented line that ends it, so it is reported at its end.\n */\nfunction positionOf(problem: YAMLError | YAMLWarning): Position {\n\tconst [start, end] = problem.linePos ?? [];\n\treturn (problem.code === 'MULTILINE_IMPLICIT_KEY' ? end : start) ?? start ?? { line: 1, col: 1 };\n}\n\n/**\n * Every parser error and warning. An over-indented line makes the parser report two errors from the\n * same place; the `BLOCK_AS_IMPLICIT_KEY` one is dropped.\n */\nfunction parserProblems(doc: Document.Parsed): Array<{ message: string; position: Position }> {\n\tconst multiline = doc.errors.filter((error) => error.code === 'MULTILINE_IMPLICIT_KEY');\n\treturn [...doc.errors, ...doc.warnings]\n\t\t.filter(\n\t\t\t(problem) =>\n\t\t\t\tproblem.code !== 'BLOCK_AS_IMPLICIT_KEY' ||\n\t\t\t\t!multiline.some((other) => samePosition(other.linePos?.[0], problem.linePos?.[0])),\n\t\t)\n\t\t.map((problem) => ({ message: friendlyMessage(problem), position: positionOf(problem) }));\n}\n\n/** The text of an error `toJS` throws, with the alias limit said in terms an author can use. */\nfunction conversionMessage(error: unknown): string {\n\tif (error instanceof Error && /alias count/i.test(error.message)) {\n\t\treturn `The document has more than ${MAX_ALIAS_COUNT} alias expansions (*name) in all. Write the repeated value out, or use fewer or smaller anchors.`;\n\t}\n\treturn error instanceof Error ? error.message : 'The document could not be read';\n}\n\n/**\n * Parse YAML text and validate the value, returning the issues instead of throwing.\n *\n * @param text A single YAML document, read as YAML 1.2 with the core schema: only `true`, `false`,\n * `null` and numbers are special, so `no`, `on` and `yes` stay strings. A leading byte order mark is\n * ignored.\n * @param validate Called with the parsed value, only when the text is valid YAML.\n * @returns `{ success: true, data }` with what `validate` returned, or `{ success: false, issues }`\n * with each syntax error or validation issue and its line and column.\n *\n * @remarks\n * An unquoted `1.10` is the number `1.1` in every YAML version; quote it (`\"1.10\"`) to keep a string.\n * Multiple documents in one text are a syntax error. Tags (`!!binary`, `!!set`, `!custom`) are\n * reported as issues, so what `validate` receives is always JSON-shaped. Mapping keys are read as\n * strings: `1: a` is `{ '1': 'a' }`.\n *\n * Anchors, aliases and merge keys (`<<: *defaults`) work within the text. A text with more than 100\n * alias expansions is reported as an issue at line 1, not thrown. An issue inside a merged value\n * points at the map that merges it, because the merged keys have no place of their own. A merge\n * source that is not a map (`<<: 5`) is reported at line 1, column 1.\n */\nexport function safeParseYaml<T>(\n\ttext: string,\n\tvalidate: YamlValidate<T>,\n\toptions?: YamlParseOptions,\n): YamlParseResult<T> {\n\tconst lineCounter = new LineCounter();\n\tconst source = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;\n\tconst doc = parseDocument(source, {\n\t\tlineCounter,\n\t\tversion: '1.2',\n\t\tschema: 'core',\n\t\tresolveKnownTags: false,\n\t\tmerge: true,\n\t\tstringKeys: true,\n\t});\n\n\tconst issue = (message: string, path: PropertyKey[], line: number, column: number): YamlIssue => {\n\t\tconst found: YamlIssue = { message, path, line, column };\n\t\tif (options?.filename !== undefined) {\n\t\t\tfound.filename = options.filename;\n\t\t}\n\t\treturn found;\n\t};\n\n\tconst problems = parserProblems(doc);\n\tif (problems.length > 0) {\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tissues: problems.map(({ message, position }) => issue(message, [], position.line, position.col)),\n\t\t};\n\t}\n\n\tlet value: unknown;\n\ttry {\n\t\tvalue = doc.toJS({ maxAliasCount: MAX_ALIAS_COUNT });\n\t} catch (error) {\n\t\treturn { success: false, issues: [issue(conversionMessage(error), [], 1, 1)] };\n\t}\n\n\tconst result = validate(value);\n\tif (result.success) {\n\t\treturn { success: true, data: result.data };\n\t}\n\treturn {\n\t\tsuccess: false,\n\t\tissues: result.issues.map((found) => {\n\t\t\tconst path = (found.path ?? []).map(toKey);\n\t\t\tconst node = nodeForPath(doc, path);\n\t\t\tconst start = node?.range ? lineCounter.linePos(node.range[0]) : { line: 1, col: 1 };\n\t\t\treturn issue(found.message, path, start.line, start.col);\n\t\t}),\n\t};\n}\n\n/**\n * Parse YAML text and validate the value, throwing when either fails.\n *\n * @throws {YamlDocumentError} With each syntax error or validation issue and its line and column.\n * {@link safeParseYaml} returns them instead.\n */\nexport function parseYaml<T>(text: string, validate: YamlValidate<T>, options?: YamlParseOptions): T {\n\tconst result = safeParseYaml(text, validate, options);\n\tif (!result.success) {\n\t\tthrow new YamlDocumentError(result.issues);\n\t}\n\treturn result.data;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/yaml/stringify.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`))return!1;r+=String(e.key.value).length+i.length+4}return r<=m}function p(n,r){let e=r?.schemaUrl;if(e!==void 0&&/[\r\n]/.test(e))throw new TypeError("schemaUrl must be a single line");let i=new f(n,{version:"1.2",aliasDuplicateObjects:!1});c(i,{Pair(a,t){s(t.key)&&t.key.value==="<<"&&(t.key.type="QUOTE_DOUBLE")},Map(a,t,o){u(o.at(-1))&&y(t)&&(t.flow=!0)}});let l=i.toString({lineWidth:0});return e===void 0?l:`# yaml-language-server: $schema=${e}
|
|
3
|
-
${l}`}export{p as stringifyYaml};
|
|
1
|
+
import{a}from"../chunk-DE7GQKZP.js";export{a as stringifyYaml};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schema-engine/registry",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"description": "The registration contract and registries of Schema Engine: documents name registrations by $type, and each registration validates its own configuration",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"schema-engine",
|
|
@@ -17,9 +17,6 @@
|
|
|
17
17
|
"url": "git+https://github.com/schema-engine/schema-engine.git",
|
|
18
18
|
"directory": "packages/registry"
|
|
19
19
|
},
|
|
20
|
-
"engines": {
|
|
21
|
-
"node": "^24.22.0 || >=26.0.0"
|
|
22
|
-
},
|
|
23
20
|
"homepage": "https://schema-engine.com/docs/registry/overview",
|
|
24
21
|
"publishConfig": {
|
|
25
22
|
"access": "public"
|
|
@@ -33,9 +30,16 @@
|
|
|
33
30
|
"types": "./dist/index.d.ts",
|
|
34
31
|
"import": "./dist/index.js"
|
|
35
32
|
},
|
|
33
|
+
"./json-schema": {
|
|
34
|
+
"types": "./dist/json-schema/index.d.ts",
|
|
35
|
+
"import": "./dist/json-schema/index.js"
|
|
36
|
+
},
|
|
36
37
|
"./yaml": {
|
|
37
38
|
"types": "./dist/yaml/index.d.ts",
|
|
38
39
|
"import": "./dist/yaml/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./package.json": {
|
|
42
|
+
"import": "./package.json"
|
|
39
43
|
}
|
|
40
44
|
},
|
|
41
45
|
"files": [
|
|
@@ -43,16 +47,16 @@
|
|
|
43
47
|
"/skill"
|
|
44
48
|
],
|
|
45
49
|
"dependencies": {
|
|
46
|
-
"@ecopages/logger": "^0.2.3",
|
|
47
50
|
"@standard-schema/spec": "^1.1.0"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
53
|
+
"ajv": "^8.20.0",
|
|
54
|
+
"ajv-draft-04": "^1.0.0",
|
|
50
55
|
"esbuild": "^0.27.0",
|
|
51
|
-
"tsc-alias": "^1.8.16",
|
|
52
56
|
"typescript": "^5.9.3",
|
|
53
57
|
"vitest": "^5.1.1",
|
|
54
58
|
"yaml": "2.9.1",
|
|
55
|
-
"zod": "^4.0
|
|
59
|
+
"zod": "^4.5.0",
|
|
56
60
|
"@schema-engine/scripts": "0.0.0"
|
|
57
61
|
},
|
|
58
62
|
"peerDependencies": {
|
|
@@ -66,10 +70,10 @@
|
|
|
66
70
|
"scripts": {
|
|
67
71
|
"build:lib": "pnpm clean && pnpm build:files && pnpm build:types",
|
|
68
72
|
"build:files": "node ./build.ts",
|
|
69
|
-
"build:types": "tsc -p tsconfig.build.json
|
|
73
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
70
74
|
"watch:lib": "node ./build.ts --watch",
|
|
71
75
|
"clean": "rm -rf ./dist",
|
|
72
76
|
"test:all": "vitest run",
|
|
73
|
-
"check-types": "tsc --noEmit"
|
|
77
|
+
"check-types": "tsc --noEmit && node test/type-cost/check.ts"
|
|
74
78
|
}
|
|
75
79
|
}
|
package/skill/SKILL.md
CHANGED
|
@@ -19,7 +19,7 @@ This file is the router. It defines the concepts once; the references assume the
|
|
|
19
19
|
## Core concepts
|
|
20
20
|
|
|
21
21
|
- **registration**: `{ $type, schema, metadata, ... }`, where `$type` is the stable key, `schema` is any Standard Schema that describes its config, and `metadata` names it. Elements, recipes, actions, validation rules and appearance axes are all registrations.
|
|
22
|
-
- **registry**: a read-only registry, `createRegistry(kind, registrations)` from `@schema-engine/registry`, built once from a list. The last registration of a `$type` wins without a warning, which is how you replace a built-in.
|
|
22
|
+
- **registry**: a read-only registry, `createRegistry(kind, registrations)` from `@schema-engine/registry`, built once from a list, or `createMutableRegistry(kind)` for registrations that arrive at runtime; both are read the same way. The last registration of a `$type` wins without a warning, which is how you replace a built-in; pass `{ duplicates: 'error' }` to make a repeat a build error instead.
|
|
23
23
|
- **document**: serializable data whose every node names a registration by `$type`. It is checked against the registrations at the boundary, so what is rendered or run has passed its schema.
|
|
24
24
|
- **action**: a registration with `execute` that runs on a trigger. Actions run as a sequence, an inner array is a parallel group, and a failure that sets `shouldContinue: false` stops what follows and cancels the group's siblings through their `signal`.
|
|
25
25
|
|
|
@@ -27,21 +27,21 @@ This file is the router. It defines the concepts once; the references assume the
|
|
|
27
27
|
|
|
28
28
|
- **config**: a form is plain data, a `FormConfig` of steps holding elements, each with a `$type`, a `name`, `rules` and `constraints`. `engine.defineForm()` (typed, in TypeScript) or `engine.validateForm(unknown)` (portable JSON) checks it against the engine's registrations and returns a frozen `NormalizedFormConfig` that the engine owns.
|
|
29
29
|
- **container**: the form's state, a `FormStateContainer` from `@schema-engine/forms/state-container`. It owns the nested values, errors, warnings, touched and dirty marks, field-array row ids and the validation in flight. Paths are dotted (`contacts.1.email`) and `FORM_ROOT` is the form itself. Every change is a command (`setValue`, `blur`, `reportNative`, `validate`, `submit`, `reset`, `fieldArray`), and every read is a pure selector over an immutable snapshot.
|
|
30
|
-
- **runtime**: `createFormRuntime` is the lifecycle every renderer shares. It builds the container and owns the submission, the wizard steps and their navigation, `form_mount` and `form_change`, and every action dispatch. A renderer supplies only what an element can do, such as focus.
|
|
30
|
+
- **runtime**: for renderer authors, `createFormRuntime` is the lifecycle every renderer shares, and a renderer creates one for each form it draws. It builds the container and owns the submission, the wizard steps and their navigation, `form_mount` and `form_change`, and every action dispatch. A renderer supplies only what an element can do, such as focus. An app does not create one: it gives the engine and a config to a renderer.
|
|
31
31
|
- **issues and the formatter**: the engine reports what is wrong as an issue (`type`, `source`, `ruleId`, `params`, `message`) and never makes up text. `formatIssue`, a function of the application, turns an issue into the words shown, and falls back to the issue's own `message`.
|
|
32
32
|
|
|
33
33
|
Outcomes use one vocabulary: a check or a submission ends `passed`, `invalid` or `overtaken`. `overtaken` means an edit or a reset outran the check, so there is no verdict and nothing to show.
|
|
34
34
|
|
|
35
35
|
## Packages
|
|
36
36
|
|
|
37
|
-
| Package | Role
|
|
38
|
-
| ------------------------------ |
|
|
39
|
-
| `@schema-engine/registry` | The registration contract and
|
|
40
|
-
| `@schema-engine/actions` | Actions: `parseActions`, and a dispatcher that runs a sequence with parallel groups, cancellation and results
|
|
41
|
-
| `@schema-engine/layout` | Domain-neutral grid, appearance axes, layout themes and the recipe protocol
|
|
42
|
-
| `@schema-engine/forms` | The forms engine: config, validation, constraints, the container, the runtime
|
|
43
|
-
| `@schema-engine/forms-react` | React renderer: `FormRenderer` and the hooks. You write the widgets; ready-made ones come from the optional shadcn registry
|
|
44
|
-
| `@schema-engine/forms-radiant` | Radiant renderer: `se-form-instance`, `FormController`, widgets and recipes in the package
|
|
37
|
+
| Package | Role |
|
|
38
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
39
|
+
| `@schema-engine/registry` | The registration contract and the registries every package builds on, `safeParseTree` and `exportTreeSchema` for a whole document, and `/yaml` for documents authored as YAML. Ships this router |
|
|
40
|
+
| `@schema-engine/actions` | Actions: `parseActions`, and a dispatcher that runs a sequence with parallel groups, cancellation and results |
|
|
41
|
+
| `@schema-engine/layout` | Domain-neutral grid, appearance axes, layout themes and the recipe protocol |
|
|
42
|
+
| `@schema-engine/forms` | The forms engine: config, validation, constraints, the container, the runtime |
|
|
43
|
+
| `@schema-engine/forms-react` | React renderer: `FormRenderer` and the hooks. You write the widgets; ready-made ones come from the optional shadcn registry |
|
|
44
|
+
| `@schema-engine/forms-radiant` | Radiant renderer: `se-form-instance`, `FormController`, widgets and recipes in the package |
|
|
45
45
|
|
|
46
46
|
A symbol has one import path. `@schema-engine/forms` has these entries: `.` (the engine, the runtime and the types), `/state-container` (the container and its selectors), `/csrf`, `/server-errors`, `/recipes`, `/recipes/built-in`, `/browser` (browser-side actions such as auto-save), `/testing` (conformance suites; they need vitest) and `/agent-tool` (experimental).
|
|
47
47
|
|
|
@@ -49,31 +49,32 @@ A symbol has one import path. `@schema-engine/forms` has these entries: `.` (the
|
|
|
49
49
|
|
|
50
50
|
Each package ships this router as its own `skill/SKILL.md` and its references in its `skill/reference/` folder, so a reference is `node_modules/@schema-engine/<package>/skill/reference/<file>`, and any installed package has the router. Read the rows of the packages the project depends on and skip the others: a package that is not installed has no file. The deployed site serves the latest version of the router and of every reference at `/skill/`, with the references flat at `/skill/reference/<file>`.
|
|
51
51
|
|
|
52
|
-
| To do
|
|
53
|
-
|
|
|
54
|
-
| Register something, build a registry, or read a YAML document
|
|
55
|
-
| Parse, dispatch or cancel actions outside a form
|
|
56
|
-
| Build a grid, an appearance axis or a layout theme
|
|
57
|
-
| Create an engine, author a config, use the container
|
|
58
|
-
| Add a rule, explain a validation result, or translate messages
|
|
59
|
-
| Handle submit, server errors, CSRF or wizard steps
|
|
60
|
-
| Run code on a form event, or define a form action
|
|
61
|
-
| Render a form in React, or use its hooks
|
|
62
|
-
| Write or change a React field widget, and test it
|
|
63
|
-
| Render a form in Radiant, or reach the container from an element
|
|
64
|
-
| Write or change a Radiant field widget, and test it
|
|
52
|
+
| To do | Package | Reference |
|
|
53
|
+
| ---------------------------------------------------------------- | ------------------------------ | ------------------------------------ |
|
|
54
|
+
| Register something, build a registry, or read a YAML document | `@schema-engine/registry` | `reference/registry.md` |
|
|
55
|
+
| Parse, dispatch or cancel actions outside a form | `@schema-engine/actions` | `reference/actions.md` |
|
|
56
|
+
| Build a grid, an appearance axis or a layout theme | `@schema-engine/layout` | `reference/layout.md` |
|
|
57
|
+
| Create an engine, author a config, or use the container directly | `@schema-engine/forms` | `reference/forms.md` |
|
|
58
|
+
| Add a rule, explain a validation result, or translate messages | `@schema-engine/forms` | `reference/forms-validation.md` |
|
|
59
|
+
| Handle submit, server errors, CSRF or wizard steps | `@schema-engine/forms` | `reference/forms-submission.md` |
|
|
60
|
+
| Run code on a form event, or define a form action | `@schema-engine/forms` | `reference/forms-actions.md` |
|
|
61
|
+
| Render a form in React, or use its hooks | `@schema-engine/forms-react` | `reference/forms-react.md` |
|
|
62
|
+
| Write or change a React field widget, and test it | `@schema-engine/forms-react` | `reference/forms-react-widgets.md` |
|
|
63
|
+
| Render a form in Radiant, or reach the container from an element | `@schema-engine/forms-radiant` | `reference/forms-radiant.md` |
|
|
64
|
+
| Write or change a Radiant field widget, and test it | `@schema-engine/forms-radiant` | `reference/forms-radiant-widgets.md` |
|
|
65
65
|
|
|
66
66
|
## Documentation map
|
|
67
67
|
|
|
68
68
|
The full documentation is at `/docs` on the deployed site. The LLM-exported corpus is `/llms.txt` (index) and `/docs-llm/<section>/<slug>.md` (page bodies).
|
|
69
69
|
|
|
70
|
-
| Section | Path prefix
|
|
71
|
-
| ------------------------------ |
|
|
72
|
-
| Schema Engine | `/docs/schema-engine/introduction`
|
|
73
|
-
| `@schema-engine/registry` | `/docs/registry/overview`
|
|
74
|
-
| `@schema-engine/actions` | `/docs/actions/overview`
|
|
75
|
-
| `@schema-engine/forms` | `/docs/forms/overview`
|
|
76
|
-
| `@schema-engine/forms-react` | `/docs/forms-react/overview`
|
|
77
|
-
| `@schema-engine/forms-radiant` | `/docs/forms-radiant/overview`
|
|
78
|
-
| `@schema-engine/layout` | `/docs/layout/overview`
|
|
79
|
-
| Examples | `/docs/examples/overview`
|
|
70
|
+
| Section | Path prefix |
|
|
71
|
+
| ------------------------------ | ----------------------------------------- |
|
|
72
|
+
| Schema Engine | `/docs/schema-engine/introduction` |
|
|
73
|
+
| `@schema-engine/registry` | `/docs/registry/overview` |
|
|
74
|
+
| `@schema-engine/actions` | `/docs/actions/overview` |
|
|
75
|
+
| `@schema-engine/forms` | `/docs/forms/overview` |
|
|
76
|
+
| `@schema-engine/forms-react` | `/docs/forms-react/overview` |
|
|
77
|
+
| `@schema-engine/forms-radiant` | `/docs/forms-radiant/overview` |
|
|
78
|
+
| `@schema-engine/layout` | `/docs/layout/overview` |
|
|
79
|
+
| Examples | `/docs/examples/overview` |
|
|
80
|
+
| Renderer authors | `/docs/renderer-authors/write-a-renderer` |
|