@eriknaslund/skiss 0.3.0 → 0.5.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/LICENSE +1 -1
- package/README.md +8 -2
- package/dist/cli.js +412 -58
- package/dist/index.d.ts +15 -7
- package/dist/index.js +299 -52
- package/package.json +6 -3
- package/dist/cli.js.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ interface FieldNode {
|
|
|
55
55
|
}
|
|
56
56
|
interface ClassNode {
|
|
57
57
|
name: Name;
|
|
58
|
+
/**
|
|
59
|
+
* The class after `<` (SPEC §3.10), set by `parse` whenever one is written.
|
|
60
|
+
* `resolve` clears it on the class whose `<` closes a circle, as it clears
|
|
61
|
+
* `identifier` on a second `*`, so no generator has to know about circles.
|
|
62
|
+
*/
|
|
63
|
+
parent?: Name;
|
|
58
64
|
system?: Name;
|
|
59
65
|
similarTo?: Name;
|
|
60
66
|
description?: string;
|
|
@@ -65,10 +71,11 @@ interface ClassNode {
|
|
|
65
71
|
type Severity = 'error' | 'warning';
|
|
66
72
|
/**
|
|
67
73
|
* Codes from the tables in docs/ARCHITECTURE.md. `parse` adds the `E_` codes,
|
|
68
|
-
* `resolve` the `W_` codes
|
|
74
|
+
* `resolve` the `W_` codes and `E_INHERITANCE_CYCLE`, the one error no single
|
|
75
|
+
* line can see (SPEC §7), and `importLinkML` the one code of its own,
|
|
69
76
|
* `E_NOT_YAML`, for a text no schema can be read out of.
|
|
70
77
|
*/
|
|
71
|
-
type DiagnosticCode = 'E_UNPARSABLE' | 'E_FIELD_WITHOUT_CLASS' | 'E_MISSING_TYPE' | 'E_UNCLOSED_MANY' | 'E_BAD_NAME' | 'W_UNKNOWN_TYPE' | 'W_UNDECLARED_CLASS' | 'W_UNDECLARED_FIELD' | 'W_DUPLICATE_CLASS' | 'W_DUPLICATE_FIELD' | 'W_MULTIPLE_IDENTIFIERS' | 'E_NOT_YAML';
|
|
78
|
+
type DiagnosticCode = 'E_UNPARSABLE' | 'E_FIELD_WITHOUT_CLASS' | 'E_MISSING_TYPE' | 'E_UNCLOSED_MANY' | 'E_BAD_NAME' | 'E_INHERITANCE_CYCLE' | 'W_UNKNOWN_TYPE' | 'W_UNDECLARED_CLASS' | 'W_UNDECLARED_FIELD' | 'W_DUPLICATE_CLASS' | 'W_DUPLICATE_FIELD' | 'W_DUPLICATE_ENUM_VALUE' | 'W_MULTIPLE_IDENTIFIERS' | 'W_REDUNDANT_OVERRIDE' | 'E_NOT_YAML';
|
|
72
79
|
interface Diagnostic {
|
|
73
80
|
severity: Severity;
|
|
74
81
|
code: DiagnosticCode;
|
|
@@ -106,9 +113,10 @@ interface LinkMLAttribute {
|
|
|
106
113
|
identifier?: boolean;
|
|
107
114
|
annotations?: LinkMLAnnotations;
|
|
108
115
|
}
|
|
109
|
-
/** One entry under `classes`. Key order is SPEC §5.
|
|
116
|
+
/** One entry under `classes`. Key order is SPEC §5.1, Inheritance. */
|
|
110
117
|
interface LinkMLClass {
|
|
111
118
|
description?: string;
|
|
119
|
+
is_a?: string;
|
|
112
120
|
annotations?: LinkMLAnnotations;
|
|
113
121
|
close_mappings?: string[];
|
|
114
122
|
attributes?: Record<string, LinkMLAttribute>;
|
|
@@ -175,9 +183,9 @@ declare function formatDiagnostic(d: Diagnostic, file?: string): string;
|
|
|
175
183
|
/**
|
|
176
184
|
* One thing the projection could not carry. `kind` is the LinkML key, or one
|
|
177
185
|
* of the projection's own kinds: `renamed`, `narrowed`, `inlined`,
|
|
178
|
-
* `enum_detail`, `annotation`, `schema`. `element`
|
|
179
|
-
* the sketch names it — `Class`, `Class.field` — or,
|
|
180
|
-
* name, which the sketch does not keep.
|
|
186
|
+
* `enum_detail`, `annotation`, `reworded`, `schema`, `unreadable`. `element`
|
|
187
|
+
* names what carried it as the sketch names it — `Class`, `Class.field` — or,
|
|
188
|
+
* for an enum, its LinkML name, which the sketch does not keep.
|
|
181
189
|
*/
|
|
182
190
|
interface Dropped {
|
|
183
191
|
kind: string;
|
|
@@ -215,6 +223,6 @@ interface ResolvedDocument extends Document {
|
|
|
215
223
|
}
|
|
216
224
|
declare function resolve(doc: Document): ResolvedDocument;
|
|
217
225
|
|
|
218
|
-
declare const VERSION = "0.
|
|
226
|
+
declare const VERSION = "0.5.0";
|
|
219
227
|
|
|
220
228
|
export { type ClassNode, type CompileOptions, type CompileResult, type Diagnostic, type DiagnosticCode, type Document, type Dropped, type FieldNode, type FromLinkMLResult, type ImportResult, type JoinRef, type LinkMLAnnotations, type LinkMLAttribute, type LinkMLClass, type LinkMLCompileOptions, type LinkMLEnum, type LinkMLOptions, type LinkMLSchema, type MermaidCompileOptions, type MermaidOptions, type Name, type Primitive, type ResolvedDocument, type SerializeFormat, type Severity, type TypeRef, VERSION, compile, formatDiagnostic, formatDropped, fromLinkML, importLinkML, parse, resolve, serialize, toLinkML, toMermaid, toSkiss };
|