@dogsbay/types 0.2.0-beta.12 → 0.2.0-beta.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/directives.d.ts +125 -0
- package/dist/directives.d.ts.map +1 -0
- package/dist/directives.js +27 -0
- package/dist/directives.js.map +1 -0
- package/dist/format.d.ts +220 -4
- package/dist/format.d.ts.map +1 -1
- package/dist/frontmatter-check.d.ts +43 -0
- package/dist/frontmatter-check.d.ts.map +1 -0
- package/dist/frontmatter-check.js +224 -0
- package/dist/frontmatter-check.js.map +1 -0
- package/dist/frontmatter-schema.d.ts +97 -0
- package/dist/frontmatter-schema.d.ts.map +1 -0
- package/dist/frontmatter-schema.js +244 -0
- package/dist/frontmatter-schema.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/meta.d.ts +26 -4
- package/dist/meta.d.ts.map +1 -1
- package/dist/meta.js +34 -6
- package/dist/meta.js.map +1 -1
- package/dist/plugin.d.ts +3 -3
- package/dist/tree.d.ts +62 -1
- package/dist/tree.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { isConditional, isInclude, isVarDef, isDirectiveRaw, isDirectiveBlock, isInlineDirective, PROFILING_ATTRS, profilingOf, } from "./directives.js";
|
|
1
2
|
export { treeToJson, chunkByHeadings, extractText } from "./json.js";
|
|
2
|
-
export { parseMeta } from "./meta.js";
|
|
3
|
+
export { STATUS_VALUES, parseMeta } from "./meta.js";
|
|
4
|
+
export { WELL_KNOWN_FIELDS, INERT_FIELDS, AGGREGATOR_OWNED, EMPTY_POLICY, typeOf, matchesType, nearMisses, isSafeAutoFix, frontmatterKeyLines, globMatches, contentRelativePath, requiredFieldsFor, } from "./frontmatter-schema.js";
|
|
5
|
+
export { checkFrontmatter, frontmatterPolicyFromConfig } from "./frontmatter-check.js";
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIrE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAarD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,WAAW,EACX,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/meta.d.ts
CHANGED
|
@@ -19,13 +19,19 @@ export interface PageMeta {
|
|
|
19
19
|
tags?: string[];
|
|
20
20
|
/**
|
|
21
21
|
* Broader grouping. Auto-derived from path when frontmatter
|
|
22
|
-
* doesn't supply a valid value
|
|
23
|
-
*
|
|
24
|
-
* `
|
|
22
|
+
* doesn't supply a valid value, emitted as **cumulative slash-
|
|
23
|
+
* paths** so each value uniquely identifies its position in the
|
|
24
|
+
* hierarchy (`content/guides/oauth/setup.md` →
|
|
25
|
+
* `["guides", "guides/oauth"]`). The bare top segment is
|
|
26
|
+
* preserved so simple queries like `category:guides` still match
|
|
27
|
+
* the whole subtree. Override with `category: foo` or
|
|
28
|
+
* `category: [foo, bar]` (explicit values pass through
|
|
29
|
+
* unchanged — no auto-prefix).
|
|
25
30
|
*
|
|
26
31
|
* No first-class "belongs nowhere" sentinel in v1: `category: []`
|
|
27
32
|
* falls through to slug-derived default. See
|
|
28
|
-
* plans/metadata-and-taxonomies.md
|
|
33
|
+
* plans/metadata-and-taxonomies.md and
|
|
34
|
+
* plans/hierarchical-facets.md.
|
|
29
35
|
*/
|
|
30
36
|
category?: string[];
|
|
31
37
|
/**
|
|
@@ -41,6 +47,16 @@ export interface PageMeta {
|
|
|
41
47
|
/** ISO date strings. Consumers parse to Date when needed. */
|
|
42
48
|
updated?: string;
|
|
43
49
|
created?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Post authors. Accepts a single string or a list in frontmatter;
|
|
52
|
+
* always normalized to a list here so consumers have one shape.
|
|
53
|
+
*
|
|
54
|
+
* Added for the blog capability (plans/blog-capability.md) — it was
|
|
55
|
+
* the only field a post needs that PageMeta did not already carry.
|
|
56
|
+
* Absent means "no byline", never "unknown author": the layout omits
|
|
57
|
+
* the row entirely rather than rendering a placeholder.
|
|
58
|
+
*/
|
|
59
|
+
author?: string[];
|
|
44
60
|
/** Sort hint for navigation/list pages. Lower weight first. */
|
|
45
61
|
weight?: number;
|
|
46
62
|
/**
|
|
@@ -77,6 +93,12 @@ export interface ParseMetaOptions {
|
|
|
77
93
|
*/
|
|
78
94
|
taxonomyNames?: readonly string[];
|
|
79
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Closed enum for status validation. Exported so the frontmatter CHECKER
|
|
98
|
+
* (packages/commands) reports exactly the values this parser drops, instead
|
|
99
|
+
* of restating the list a third time.
|
|
100
|
+
*/
|
|
101
|
+
export declare const STATUS_VALUES: readonly PageStatus[];
|
|
80
102
|
/**
|
|
81
103
|
* Parse and normalize frontmatter into `PageMeta`. Pure function;
|
|
82
104
|
* no I/O. Unknown frontmatter keys are not lifted — they stay in
|
package/dist/meta.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","s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ACH,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAK9C,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAChD,OAAO,GAAE,gBAAqB,GAC7B,QAAQ,CA2CV"}
|
package/dist/meta.js
CHANGED
|
@@ -8,8 +8,12 @@
|
|
|
8
8
|
*
|
|
9
9
|
* See plans/metadata-and-taxonomies.md for the design rationale.
|
|
10
10
|
*/
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Closed enum for status validation. Exported so the frontmatter CHECKER
|
|
13
|
+
* (packages/commands) reports exactly the values this parser drops, instead
|
|
14
|
+
* of restating the list a third time.
|
|
15
|
+
*/
|
|
16
|
+
export const STATUS_VALUES = [
|
|
13
17
|
"draft",
|
|
14
18
|
"preview",
|
|
15
19
|
"stable",
|
|
@@ -58,6 +62,9 @@ export function parseMeta(frontmatter, options = {}) {
|
|
|
58
62
|
const created = coerceIsoDate(fm.created);
|
|
59
63
|
if (created)
|
|
60
64
|
meta.created = created;
|
|
65
|
+
const author = coerceStringArray(fm.author);
|
|
66
|
+
if (author)
|
|
67
|
+
meta.author = author;
|
|
61
68
|
if (typeof fm.weight === "number" && Number.isFinite(fm.weight)) {
|
|
62
69
|
meta.weight = fm.weight;
|
|
63
70
|
}
|
|
@@ -71,13 +78,29 @@ export function parseMeta(frontmatter, options = {}) {
|
|
|
71
78
|
}
|
|
72
79
|
/**
|
|
73
80
|
* Auto-derive `category` from a slug. The leaf segment is treated
|
|
74
|
-
* as the page filename and dropped; remaining segments
|
|
75
|
-
*
|
|
81
|
+
* as the page filename and dropped; remaining segments emit as
|
|
82
|
+
* **cumulative slash-paths**, so each value uniquely identifies its
|
|
83
|
+
* position in the document hierarchy.
|
|
76
84
|
*
|
|
77
85
|
* - `"guides/auth"` → `["guides"]`
|
|
78
|
-
* - `"guides/oauth/setup"` → `["guides", "oauth"]`
|
|
86
|
+
* - `"guides/oauth/setup"` → `["guides", "guides/oauth"]`
|
|
87
|
+
* - `"installing/installing_aws/ipi/foo"` → `["installing", "installing/installing_aws", "installing/installing_aws/ipi"]`
|
|
79
88
|
* - `"intro"` → undefined (no parent path)
|
|
80
89
|
* - `""` / undefined → undefined
|
|
90
|
+
*
|
|
91
|
+
* Why cumulative instead of bare segments: a leaf name like `ipi`
|
|
92
|
+
* appears at multiple positions across a large corpus (under
|
|
93
|
+
* `installing/installing_aws/`, `installing/installing_azure/`, …).
|
|
94
|
+
* Bare segments would collide as Pagefind filter values, so the
|
|
95
|
+
* search dialog's hierarchical-facet tree can't distinguish
|
|
96
|
+
* positions and tree-click cascades leak across siblings. Cumulative
|
|
97
|
+
* paths disambiguate fully and also let the search dialog detect
|
|
98
|
+
* the slash-encoded shape automatically (no nav.json needed to build
|
|
99
|
+
* the tree). The containment semantic is preserved — every page
|
|
100
|
+
* under `installing/` still carries the bare-prefix `"installing"`
|
|
101
|
+
* value as its top-level entry, so existing filter queries like
|
|
102
|
+
* `category:installing` continue to match the whole subtree.
|
|
103
|
+
* See plans/hierarchical-facets.md ("Open follow-ups").
|
|
81
104
|
*/
|
|
82
105
|
function deriveCategoryFromSlug(slug) {
|
|
83
106
|
if (!slug)
|
|
@@ -85,7 +108,12 @@ function deriveCategoryFromSlug(slug) {
|
|
|
85
108
|
const parts = slug.split("/").filter((p) => p.length > 0);
|
|
86
109
|
if (parts.length < 2)
|
|
87
110
|
return undefined;
|
|
88
|
-
|
|
111
|
+
const parents = parts.slice(0, -1);
|
|
112
|
+
const out = [];
|
|
113
|
+
for (let i = 0; i < parents.length; i++) {
|
|
114
|
+
out.push(parents.slice(0, i + 1).join("/"));
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
89
117
|
}
|
|
90
118
|
function coerceStringArray(value) {
|
|
91
119
|
if (typeof value === "string") {
|
package/dist/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../src/meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAA0B;IAClD,OAAO;IACP,SAAS;IACT,QAAQ;IACR,YAAY;CACb,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,SAAS,CACvB,WAAgD,EAChD,UAA4B,EAAE;IAE9B,MAAM,EAAE,GAAG,WAAW,IAAI,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,MAAM,IAAI,GAAG,iBAAiB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,IAAI;QAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAE3B,MAAM,QAAQ,GACZ,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,sBAAsB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,IAAI,QAAQ;QAAE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAEvC,IAAI,OAAO,EAAE,CAAC,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,IAAI,OAAO,EAAE,CAAC,MAAM,KAAK,QAAQ,IAAK,aAAmC,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9F,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,MAAoB,CAAC;IACxC,CAAC;IAED,MAAM,QAAQ,GAAG,i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73,9 @@ export interface PluginVisibleConfig {
|
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Audit rule contract — re-stated here to avoid a circular dep
|
|
76
|
-
* between `@dogsbay/types` and `@dogsbay/
|
|
76
|
+
* between `@dogsbay/types` and `@dogsbay/site-check` (where the canonical
|
|
77
77
|
* audit module lives). The shape MUST stay in sync with
|
|
78
|
-
* `packages/
|
|
78
|
+
* `@dogsbay/site-check` (`packages/site-check/src/types.ts`) — adapted via a runtime
|
|
79
79
|
* pass-through in the loader.
|
|
80
80
|
*/
|
|
81
81
|
export interface PluginRule {
|
|
@@ -87,7 +87,7 @@ export interface PluginRule {
|
|
|
87
87
|
/**
|
|
88
88
|
* The audit runner narrows this on the rule's declared `stage`.
|
|
89
89
|
* Plugins import the concrete context types from
|
|
90
|
-
* `@dogsbay/
|
|
90
|
+
* `@dogsbay/site-check` if they need typed access.
|
|
91
91
|
*/
|
|
92
92
|
run(ctx: unknown): PluginIssue[];
|
|
93
93
|
}
|
package/dist/tree.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface TreeNode {
|
|
|
35
35
|
*
|
|
36
36
|
* Links use `children` because link text can contain formatted spans.
|
|
37
37
|
*/
|
|
38
|
-
export type InlineNode = InlineText | InlineLink | InlineImage | InlineCode | InlineHighlight | InlineFootnoteRef | InlineKbd | InlineIcon | InlineMath | InlineHtml | InlineBreak;
|
|
38
|
+
export type InlineNode = InlineText | InlineLink | InlineImage | InlineCode | InlineHighlight | InlineFootnoteRef | InlineKbd | InlineIcon | InlineBadge | InlineMath | InlineHtml | InlineBreak;
|
|
39
39
|
/** Text span with flat formatting annotations. */
|
|
40
40
|
export interface InlineText {
|
|
41
41
|
type: "text";
|
|
@@ -49,8 +49,32 @@ export interface InlineLink {
|
|
|
49
49
|
type: "link";
|
|
50
50
|
href: string;
|
|
51
51
|
title?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Attributes from a trailing `{...}` block, e.g.
|
|
54
|
+
* `[text](href){.class #id style="..."}`. `id`, `class`, and `style`
|
|
55
|
+
* are first-class; any other key passes through to the renderer.
|
|
56
|
+
*/
|
|
57
|
+
attrs?: InlineAttrs;
|
|
58
|
+
/**
|
|
59
|
+
* An inline `:button[label]{href="…" variant="…"}`: a link styled as a
|
|
60
|
+
* button. Renderers that do not know it render a plain link.
|
|
61
|
+
*/
|
|
62
|
+
button?: {
|
|
63
|
+
variant?: string;
|
|
64
|
+
};
|
|
52
65
|
children: InlineNode[];
|
|
53
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Attribute set for inline elements (links and images). Mirrors the
|
|
69
|
+
* shape of block-level attribute blocks but lives on the inline node
|
|
70
|
+
* so renderers can apply id/class/style to the emitted element.
|
|
71
|
+
*/
|
|
72
|
+
export interface InlineAttrs {
|
|
73
|
+
id?: string;
|
|
74
|
+
class?: string;
|
|
75
|
+
style?: string;
|
|
76
|
+
[key: string]: string | undefined;
|
|
77
|
+
}
|
|
54
78
|
/** Image (block or inline depending on context). */
|
|
55
79
|
export interface InlineImage {
|
|
56
80
|
type: "image";
|
|
@@ -59,11 +83,36 @@ export interface InlineImage {
|
|
|
59
83
|
title?: string;
|
|
60
84
|
width?: number;
|
|
61
85
|
height?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Attributes from a trailing `{...}` block, e.g.
|
|
88
|
+
* `{.class #id width="64"}`. `id`, `class`, and `style`
|
|
89
|
+
* are first-class; any other key passes through to the renderer.
|
|
90
|
+
* Mirrors `InlineLink.attrs`.
|
|
91
|
+
*/
|
|
92
|
+
attrs?: InlineAttrs;
|
|
62
93
|
}
|
|
63
94
|
/** Inline code span. */
|
|
64
95
|
export interface InlineCode {
|
|
65
96
|
type: "code";
|
|
66
97
|
text: string;
|
|
98
|
+
/**
|
|
99
|
+
* The span carries the `{minja}` build-processing opt-in
|
|
100
|
+
* (`` `x`{minja} `` — the inline twin of the `{minja}` fence marker;
|
|
101
|
+
* planted by the AsciiDoc engine on spans holding attribute refs).
|
|
102
|
+
* Parser and serializer round-trip it so a normalize pass or an
|
|
103
|
+
* editor save can't silently flip the span back to masked (#030).
|
|
104
|
+
*/
|
|
105
|
+
minja?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Formatting inherited from an enclosing strong/em/strike span
|
|
108
|
+
* (`**\`code\` text**`). Without these the parser dropped the wrapper
|
|
109
|
+
* on the code node and serializers re-emitted the caption as
|
|
110
|
+
* `\`LVMCluster\`** CR fields**` — bold broken, literal `**` visible
|
|
111
|
+
* (issue #045).
|
|
112
|
+
*/
|
|
113
|
+
bold?: boolean;
|
|
114
|
+
italic?: boolean;
|
|
115
|
+
strikethrough?: boolean;
|
|
67
116
|
}
|
|
68
117
|
/** Highlighted/marked text (==text== in Obsidian/pymdownx.mark). */
|
|
69
118
|
export interface InlineHighlight {
|
|
@@ -103,6 +152,18 @@ export interface InlineIcon {
|
|
|
103
152
|
/** Attributes from attr_list syntax { .class style="..." } */
|
|
104
153
|
attrs?: Record<string, string>;
|
|
105
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* `:badge[text]{variant="…"}`: a short status label (New, Beta,
|
|
157
|
+
* Deprecated). `variant` is the Badge component's: default, secondary,
|
|
158
|
+
* outline, success, warning, destructive…
|
|
159
|
+
*/
|
|
160
|
+
export interface InlineBadge {
|
|
161
|
+
type: "badge";
|
|
162
|
+
text: string;
|
|
163
|
+
variant?: string;
|
|
164
|
+
/** Other attributes from the `{…}` block. */
|
|
165
|
+
attrs?: InlineAttrs;
|
|
166
|
+
}
|
|
106
167
|
/** Raw HTML escape hatch for unsupported inline types. */
|
|
107
168
|
export interface InlineHtml {
|
|
108
169
|
type: "html-inline";
|
package/dist/tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,QAAQ;IACvB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IAEb,kDA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4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,kBAAkB;AAClB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,CAAC;CACf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/types",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.121",
|
|
4
4
|
"description": "Universal document tree model for Dogsbay format loaders and renderers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"types"
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"typescript": "^5.
|
|
26
|
-
"vitest": "^
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"vitest": "^4.1.10"
|
|
27
27
|
},
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"repository": {
|