nimbus-docs 0.1.3 → 0.1.5
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/cli/index.js +611 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/client.js.map +1 -1
- package/dist/content.d.ts +5 -74
- package/dist/content.d.ts.map +1 -1
- package/dist/content.js +2 -2
- package/dist/content.js.map +1 -1
- package/dist/diagnostic-DZf0z79l.d.ts +123 -0
- package/dist/diagnostic-DZf0z79l.d.ts.map +1 -0
- package/dist/index.d.ts +1006 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +779 -174
- package/dist/index.js.map +1 -1
- package/dist/rules-DnAP-j89.js +5836 -0
- package/dist/rules-DnAP-j89.js.map +1 -0
- package/dist/schemas.d.ts +84 -105
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +114 -31
- package/dist/schemas.js.map +1 -1
- package/dist/strict-keys-BiXiT3pq.js +35 -0
- package/dist/strict-keys-BiXiT3pq.js.map +1 -0
- package/dist/types.d.ts +62 -21
- package/dist/types.d.ts.map +1 -1
- package/package.json +20 -4
- package/src/components/NimbusHead.astro +0 -4
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
//#region src/lint/diagnostic.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The diagnostic envelope — the single shape every Nimbus check flows
|
|
4
|
+
* through, from build validators to authoring rules to (eventually) Vale.
|
|
5
|
+
*
|
|
6
|
+
* Locked in Phase 0. Extending it later is a versioned schema bump, not a
|
|
7
|
+
* field tacked on in a minor — see the cross-phase invariants in the
|
|
8
|
+
* authoring-lints plan. Positions are the unist `Point` Sätteri's parser
|
|
9
|
+
* already emits (1-based line/column plus a character offset), so a
|
|
10
|
+
* diagnostic, a `--fix` edit range, and the pretty formatter's caret all
|
|
11
|
+
* read from the one AST the renderer built.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The stable rule-code registry. Every code Nimbus can emit lives here,
|
|
15
|
+
* tagged with the tier it belongs to:
|
|
16
|
+
*
|
|
17
|
+
* - `build` — a build validator. Always on, fails `astro build`, no
|
|
18
|
+
* severity knob. Cannot appear in the `rules` config.
|
|
19
|
+
* - `authoring`— an authoring rule. Defaults to `error`, configurable to
|
|
20
|
+
* `warn` / `off`, surfaced by `nimbus-docs lint`.
|
|
21
|
+
*
|
|
22
|
+
* Codes are registered here even before their rule is implemented so the
|
|
23
|
+
* namespace is stable and `RuleCode` stays exhaustive: importing or
|
|
24
|
+
* configuring an unknown code is a typecheck failure, not a silent no-op.
|
|
25
|
+
*/
|
|
26
|
+
declare const RULE_CODES: {
|
|
27
|
+
readonly "nimbus/mdx-syntax": {
|
|
28
|
+
readonly kind: "build";
|
|
29
|
+
};
|
|
30
|
+
readonly "nimbus/component-pascalcase": {
|
|
31
|
+
readonly kind: "build";
|
|
32
|
+
};
|
|
33
|
+
readonly "nimbus/partial-exists": {
|
|
34
|
+
readonly kind: "build";
|
|
35
|
+
};
|
|
36
|
+
readonly "nimbus/duplicate-slug": {
|
|
37
|
+
readonly kind: "build";
|
|
38
|
+
};
|
|
39
|
+
readonly "nimbus/frontmatter-shape": {
|
|
40
|
+
readonly kind: "authoring";
|
|
41
|
+
};
|
|
42
|
+
readonly "nimbus/description-required": {
|
|
43
|
+
readonly kind: "authoring";
|
|
44
|
+
};
|
|
45
|
+
readonly "nimbus/internal-link": {
|
|
46
|
+
readonly kind: "authoring";
|
|
47
|
+
};
|
|
48
|
+
readonly "nimbus/orphan-page": {
|
|
49
|
+
readonly kind: "authoring";
|
|
50
|
+
};
|
|
51
|
+
readonly "nimbus/sidebar-entry": {
|
|
52
|
+
readonly kind: "authoring";
|
|
53
|
+
};
|
|
54
|
+
readonly "nimbus/single-h1": {
|
|
55
|
+
readonly kind: "authoring";
|
|
56
|
+
};
|
|
57
|
+
readonly "nimbus/heading-hierarchy": {
|
|
58
|
+
readonly kind: "authoring";
|
|
59
|
+
};
|
|
60
|
+
readonly "nimbus/code-block-lang": {
|
|
61
|
+
readonly kind: "authoring";
|
|
62
|
+
};
|
|
63
|
+
readonly "nimbus/code-block-prompt-prefix": {
|
|
64
|
+
readonly kind: "authoring";
|
|
65
|
+
};
|
|
66
|
+
readonly "nimbus/no-self-host-url": {
|
|
67
|
+
readonly kind: "authoring";
|
|
68
|
+
};
|
|
69
|
+
readonly "nimbus/heading-punctuation": {
|
|
70
|
+
readonly kind: "authoring";
|
|
71
|
+
};
|
|
72
|
+
readonly "nimbus/duplicate-heading-text": {
|
|
73
|
+
readonly kind: "authoring";
|
|
74
|
+
};
|
|
75
|
+
readonly "nimbus/list-marker-style": {
|
|
76
|
+
readonly kind: "authoring";
|
|
77
|
+
};
|
|
78
|
+
readonly "nimbus/emphasis-style": {
|
|
79
|
+
readonly kind: "authoring";
|
|
80
|
+
};
|
|
81
|
+
readonly "nimbus/bare-url": {
|
|
82
|
+
readonly kind: "authoring";
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
/** Every rule code Nimbus knows about. */
|
|
86
|
+
type RuleCode = keyof typeof RULE_CODES;
|
|
87
|
+
/** Resolved severity — a rule that resolved to `off` never runs, so it
|
|
88
|
+
* never reaches a `Diagnostic`. */
|
|
89
|
+
type Severity = "error" | "warn";
|
|
90
|
+
/** Severity as a user configures it. `off` disables the rule entirely. */
|
|
91
|
+
type SeverityConfig = Severity | "off";
|
|
92
|
+
interface DiagnosticFix {
|
|
93
|
+
/** Human/agent-readable description of what the fix does. */
|
|
94
|
+
description: string;
|
|
95
|
+
/**
|
|
96
|
+
* Edits to apply, as `[start, end]` character offsets into the source
|
|
97
|
+
* (unist offsets — the same the AST reports), with replacement text.
|
|
98
|
+
*/
|
|
99
|
+
edits: Array<{
|
|
100
|
+
range: [number, number];
|
|
101
|
+
text: string;
|
|
102
|
+
}>;
|
|
103
|
+
}
|
|
104
|
+
interface Diagnostic {
|
|
105
|
+
code: RuleCode;
|
|
106
|
+
severity: Severity;
|
|
107
|
+
/** Which tool produced this. Reserved so Phase 4 can merge Vale into the
|
|
108
|
+
* same envelope without a breaking change. */
|
|
109
|
+
source: "docs-compiler" | "vale";
|
|
110
|
+
message: string;
|
|
111
|
+
/** Path relative to the project root. */
|
|
112
|
+
file: string;
|
|
113
|
+
/** 1-based, from the Sätteri AST. */
|
|
114
|
+
line: number;
|
|
115
|
+
/** 1-based, from the Sätteri AST. */
|
|
116
|
+
column: number;
|
|
117
|
+
endLine?: number;
|
|
118
|
+
endColumn?: number;
|
|
119
|
+
fix?: DiagnosticFix;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { SeverityConfig as a, Severity as i, DiagnosticFix as n, RuleCode as r, Diagnostic as t };
|
|
123
|
+
//# sourceMappingURL=diagnostic-DZf0z79l.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|