@openpkg-ts/spec 0.49.0 → 0.50.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/dist/index.d.ts +27 -1
- package/dist/index.js +48 -4
- package/package.json +1 -1
- package/schemas/v0.4.0/openpkg.schema.json +37 -3
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,18 @@ type SpecTagParam = {
|
|
|
11
11
|
/** Whether param is marked optional with [brackets] */
|
|
12
12
|
optional?: boolean;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* An inline TSDoc tag (`{@link Foo}`, `{@label Transport}`) found in a text field.
|
|
16
|
+
*
|
|
17
|
+
* Additive and side-car: the tag is left in place in the text it came from, so
|
|
18
|
+
* `{@link}` still reads naturally in prose and existing consumers are unaffected.
|
|
19
|
+
*/
|
|
20
|
+
type SpecInlineTag = {
|
|
21
|
+
/** Tag name without the `@` (e.g., "link", "label") */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Tag content as written, trimmed (e.g., "sendBatch", "Transport") */
|
|
24
|
+
text: string;
|
|
25
|
+
};
|
|
14
26
|
type SpecTag = {
|
|
15
27
|
/** Tag name (e.g., "param", "returns", "example") */
|
|
16
28
|
name: string;
|
|
@@ -18,6 +30,8 @@ type SpecTag = {
|
|
|
18
30
|
text: string;
|
|
19
31
|
/** Structured data for @param tags */
|
|
20
32
|
param?: SpecTagParam;
|
|
33
|
+
/** Inline TSDoc tags found in `text` */
|
|
34
|
+
inlineTags?: SpecInlineTag[];
|
|
21
35
|
};
|
|
22
36
|
type SpecTypeAliasKind = "alias" | "conditional" | "mapped" | "template-literal" | "infer";
|
|
23
37
|
type SpecConditionalType = {
|
|
@@ -121,6 +135,8 @@ type SpecExample = {
|
|
|
121
135
|
title?: string;
|
|
122
136
|
description?: string;
|
|
123
137
|
language?: SpecExampleLanguage;
|
|
138
|
+
/** Inline TSDoc tags found in this example's text */
|
|
139
|
+
inlineTags?: SpecInlineTag[];
|
|
124
140
|
};
|
|
125
141
|
type SpecExtension = Record<string, unknown>;
|
|
126
142
|
/** Presentation metadata for an export/type (moved from inline fields) */
|
|
@@ -152,6 +168,8 @@ type SpecSignatureParameter = {
|
|
|
152
168
|
default?: unknown;
|
|
153
169
|
rest?: boolean;
|
|
154
170
|
decorators?: SpecDecorator[];
|
|
171
|
+
/** Inline TSDoc tags found in `description` */
|
|
172
|
+
inlineTags?: SpecInlineTag[];
|
|
155
173
|
};
|
|
156
174
|
type SpecSignatureReturn = {
|
|
157
175
|
schema: SpecSchema;
|
|
@@ -169,6 +187,8 @@ type SpecSignature = {
|
|
|
169
187
|
throws?: SpecThrows[];
|
|
170
188
|
/** Name of the base class this signature was inherited from (e.g. a subclass constructor declared only on its base) */
|
|
171
189
|
inheritedFrom?: string;
|
|
190
|
+
/** Inline TSDoc tags found in `description` */
|
|
191
|
+
inlineTags?: SpecInlineTag[];
|
|
172
192
|
};
|
|
173
193
|
/**
|
|
174
194
|
* Type predicate information for type guard functions.
|
|
@@ -257,6 +277,8 @@ type SpecMember = {
|
|
|
257
277
|
decorators?: SpecDecorator[];
|
|
258
278
|
deprecated?: boolean;
|
|
259
279
|
deprecationReason?: string;
|
|
280
|
+
/** Inline TSDoc tags found in `description` */
|
|
281
|
+
inlineTags?: SpecInlineTag[];
|
|
260
282
|
};
|
|
261
283
|
type SpecInheritedMember = SpecMember & {
|
|
262
284
|
/** Name of the class this member was inherited from */
|
|
@@ -286,6 +308,8 @@ type SpecExport = {
|
|
|
286
308
|
conditionalType?: SpecConditionalType;
|
|
287
309
|
mappedType?: SpecMappedType;
|
|
288
310
|
decorators?: SpecDecorator[];
|
|
311
|
+
/** Inline TSDoc tags found in `description` */
|
|
312
|
+
inlineTags?: SpecInlineTag[];
|
|
289
313
|
};
|
|
290
314
|
type SpecType = {
|
|
291
315
|
id: string;
|
|
@@ -306,6 +330,8 @@ type SpecType = {
|
|
|
306
330
|
mappedType?: SpecMappedType;
|
|
307
331
|
/** Whether this type is from an external package (node_modules) */
|
|
308
332
|
external?: boolean;
|
|
333
|
+
/** Inline TSDoc tags found in `description` */
|
|
334
|
+
inlineTags?: SpecInlineTag[];
|
|
309
335
|
};
|
|
310
336
|
type OpenPkgMeta = {
|
|
311
337
|
name: string;
|
|
@@ -639,4 +665,4 @@ declare function assertSpec(spec: unknown, version?: SchemaVersion): asserts spe
|
|
|
639
665
|
* @returns Array of validation errors (empty if valid)
|
|
640
666
|
*/
|
|
641
667
|
declare function getValidationErrors(spec: unknown, version?: SchemaVersion): SpecError[];
|
|
642
|
-
export { validateSpec, resolveRef, recommendSemverBump, normalize, isVoidSchema, isTupleSchema, isStringSchema, isRefSchema, isOneOfSchema, isObjectSchema, isNumberSchema, isNullSchema, isNeverSchema, isIntegerSchema, isFunctionSchema, isBooleanSchema, isArraySchema, isAnySchema, isAnyOfSchema, isAllOfSchema, getValidationErrors, getSchemaType, getAvailableVersions, flattenAnyOf, diffSpec, dereference, categorizeBreakingChanges, calculateNextVersion, assertSpec, SpecVisibility, SpecTypePredicate, SpecTypeParameter, SpecTypeKind, SpecTypeAliasKind, SpecType, SpecThrows, SpecTagParam, SpecTag, SpecSource, SpecSkippedExport, SpecSignatureReturn, SpecSignatureParameter, SpecSignature, SpecSchemaRef, SpecSchemaPrimitive, SpecSchemaGeneric, SpecSchemaFallback, SpecSchemaComposite, SpecSchemaCombinator, SpecSchema, SpecPresentationMeta, SpecMember, SpecMappedType, SpecInheritedMember, SpecGenerationMeta, SpecGenerationInfo, SpecExtractionMode, SpecExtractionLimitation, SpecExtensions, SpecExtension, SpecExportKind, SpecExport, SpecExampleLanguage, SpecExample, SpecError, SpecDiff, SpecDecorator, SpecConditionalType, SemverRecommendation, SemverBump, SchemaVersion, SCHEMA_VERSION, SCHEMA_URL_MIRROR, SCHEMA_URL, OpenPkgVersion, OpenPkgMeta, OpenPkg, MemberChangeInfo, LATEST_VERSION, KIND_SLUGS, KIND_LABELS, JSON_SCHEMA_DRAFT, JSONSchemaExtensions, GenerationIssueSeverity, GenerationIssue, EntryPointDetectionMethod, DisplayKind, DiffOptions, DISPLAY_KIND_ORDER, CategorizedBreaking, BreakingSeverity };
|
|
668
|
+
export { validateSpec, resolveRef, recommendSemverBump, normalize, isVoidSchema, isTupleSchema, isStringSchema, isRefSchema, isOneOfSchema, isObjectSchema, isNumberSchema, isNullSchema, isNeverSchema, isIntegerSchema, isFunctionSchema, isBooleanSchema, isArraySchema, isAnySchema, isAnyOfSchema, isAllOfSchema, getValidationErrors, getSchemaType, getAvailableVersions, flattenAnyOf, diffSpec, dereference, categorizeBreakingChanges, calculateNextVersion, assertSpec, SpecVisibility, SpecTypePredicate, SpecTypeParameter, SpecTypeKind, SpecTypeAliasKind, SpecType, SpecThrows, SpecTagParam, SpecTag, SpecSource, SpecSkippedExport, SpecSignatureReturn, SpecSignatureParameter, SpecSignature, SpecSchemaRef, SpecSchemaPrimitive, SpecSchemaGeneric, SpecSchemaFallback, SpecSchemaComposite, SpecSchemaCombinator, SpecSchema, SpecPresentationMeta, SpecMember, SpecMappedType, SpecInlineTag, SpecInheritedMember, SpecGenerationMeta, SpecGenerationInfo, SpecExtractionMode, SpecExtractionLimitation, SpecExtensions, SpecExtension, SpecExportKind, SpecExport, SpecExampleLanguage, SpecExample, SpecError, SpecDiff, SpecDecorator, SpecConditionalType, SemverRecommendation, SemverBump, SchemaVersion, SCHEMA_VERSION, SCHEMA_URL_MIRROR, SCHEMA_URL, OpenPkgVersion, OpenPkgMeta, OpenPkg, MemberChangeInfo, LATEST_VERSION, KIND_SLUGS, KIND_LABELS, JSON_SCHEMA_DRAFT, JSONSchemaExtensions, GenerationIssueSeverity, GenerationIssue, EntryPointDetectionMethod, DisplayKind, DiffOptions, DISPLAY_KIND_ORDER, CategorizedBreaking, BreakingSeverity };
|
package/dist/index.js
CHANGED
|
@@ -167,7 +167,14 @@ function toMap(items) {
|
|
|
167
167
|
}
|
|
168
168
|
return map;
|
|
169
169
|
}
|
|
170
|
-
var DOC_KEYS = new Set([
|
|
170
|
+
var DOC_KEYS = new Set([
|
|
171
|
+
"description",
|
|
172
|
+
"examples",
|
|
173
|
+
"tags",
|
|
174
|
+
"inlineTags",
|
|
175
|
+
"rawComments",
|
|
176
|
+
"source"
|
|
177
|
+
]);
|
|
171
178
|
function isDocOnlyChange(a, b) {
|
|
172
179
|
const structuralA = normalizeForComparison(removeDocFields(a));
|
|
173
180
|
const structuralB = normalizeForComparison(removeDocFields(b));
|
|
@@ -463,6 +470,9 @@ function normalizeTag(tag) {
|
|
|
463
470
|
if (tag.param) {
|
|
464
471
|
result.param = tag.param;
|
|
465
472
|
}
|
|
473
|
+
if (tag.inlineTags && tag.inlineTags.length > 0) {
|
|
474
|
+
result.inlineTags = tag.inlineTags;
|
|
475
|
+
}
|
|
466
476
|
return result;
|
|
467
477
|
}
|
|
468
478
|
function normalizeMember(member) {
|
|
@@ -2389,6 +2399,10 @@ var openpkg_schema_default4 = {
|
|
|
2389
2399
|
decorators: {
|
|
2390
2400
|
type: "array",
|
|
2391
2401
|
items: { $ref: "#/$defs/decorator" }
|
|
2402
|
+
},
|
|
2403
|
+
inlineTags: {
|
|
2404
|
+
type: "array",
|
|
2405
|
+
items: { $ref: "#/$defs/inlineTag" }
|
|
2392
2406
|
}
|
|
2393
2407
|
}
|
|
2394
2408
|
},
|
|
@@ -2424,6 +2438,10 @@ var openpkg_schema_default4 = {
|
|
|
2424
2438
|
conditionalType: { $ref: "#/$defs/conditionalType" },
|
|
2425
2439
|
mappedType: { $ref: "#/$defs/mappedType" },
|
|
2426
2440
|
external: { type: "boolean" },
|
|
2441
|
+
inlineTags: {
|
|
2442
|
+
type: "array",
|
|
2443
|
+
items: { $ref: "#/$defs/inlineTag" }
|
|
2444
|
+
},
|
|
2427
2445
|
typeParameters: {
|
|
2428
2446
|
type: "array",
|
|
2429
2447
|
items: { $ref: "#/$defs/typeParameter" }
|
|
@@ -2436,7 +2454,20 @@ var openpkg_schema_default4 = {
|
|
|
2436
2454
|
properties: {
|
|
2437
2455
|
name: { type: "string" },
|
|
2438
2456
|
text: { type: "string" },
|
|
2439
|
-
param: { $ref: "#/$defs/tagParam" }
|
|
2457
|
+
param: { $ref: "#/$defs/tagParam" },
|
|
2458
|
+
inlineTags: {
|
|
2459
|
+
type: "array",
|
|
2460
|
+
items: { $ref: "#/$defs/inlineTag" }
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
additionalProperties: false
|
|
2464
|
+
},
|
|
2465
|
+
inlineTag: {
|
|
2466
|
+
type: "object",
|
|
2467
|
+
required: ["name", "text"],
|
|
2468
|
+
properties: {
|
|
2469
|
+
name: { type: "string" },
|
|
2470
|
+
text: { type: "string" }
|
|
2440
2471
|
},
|
|
2441
2472
|
additionalProperties: false
|
|
2442
2473
|
},
|
|
@@ -2478,6 +2509,10 @@ var openpkg_schema_default4 = {
|
|
|
2478
2509
|
throws: {
|
|
2479
2510
|
type: "array",
|
|
2480
2511
|
items: { $ref: "#/$defs/throwsInfo" }
|
|
2512
|
+
},
|
|
2513
|
+
inlineTags: {
|
|
2514
|
+
type: "array",
|
|
2515
|
+
items: { $ref: "#/$defs/inlineTag" }
|
|
2481
2516
|
}
|
|
2482
2517
|
}
|
|
2483
2518
|
},
|
|
@@ -2503,6 +2538,10 @@ var openpkg_schema_default4 = {
|
|
|
2503
2538
|
decorators: {
|
|
2504
2539
|
type: "array",
|
|
2505
2540
|
items: { $ref: "#/$defs/decorator" }
|
|
2541
|
+
},
|
|
2542
|
+
inlineTags: {
|
|
2543
|
+
type: "array",
|
|
2544
|
+
items: { $ref: "#/$defs/inlineTag" }
|
|
2506
2545
|
}
|
|
2507
2546
|
}
|
|
2508
2547
|
},
|
|
@@ -2683,7 +2722,11 @@ var openpkg_schema_default4 = {
|
|
|
2683
2722
|
code: { type: "string" },
|
|
2684
2723
|
title: { type: "string" },
|
|
2685
2724
|
description: { type: "string" },
|
|
2686
|
-
language: { $ref: "#/$defs/exampleLanguage" }
|
|
2725
|
+
language: { $ref: "#/$defs/exampleLanguage" },
|
|
2726
|
+
inlineTags: {
|
|
2727
|
+
type: "array",
|
|
2728
|
+
items: { $ref: "#/$defs/inlineTag" }
|
|
2729
|
+
}
|
|
2687
2730
|
},
|
|
2688
2731
|
additionalProperties: false
|
|
2689
2732
|
}
|
|
@@ -2705,7 +2748,8 @@ var openpkg_schema_default4 = {
|
|
|
2705
2748
|
flags: { type: "object", additionalProperties: true },
|
|
2706
2749
|
schema: { $ref: "#/$defs/schema" },
|
|
2707
2750
|
signatures: { type: "array", items: { $ref: "#/$defs/signature" } },
|
|
2708
|
-
decorators: { type: "array", items: { $ref: "#/$defs/decorator" } }
|
|
2751
|
+
decorators: { type: "array", items: { $ref: "#/$defs/decorator" } },
|
|
2752
|
+
inlineTags: { type: "array", items: { $ref: "#/$defs/inlineTag" } }
|
|
2709
2753
|
}
|
|
2710
2754
|
}
|
|
2711
2755
|
}
|
package/package.json
CHANGED
|
@@ -144,6 +144,10 @@
|
|
|
144
144
|
"decorators": {
|
|
145
145
|
"type": "array",
|
|
146
146
|
"items": { "$ref": "#/$defs/decorator" }
|
|
147
|
+
},
|
|
148
|
+
"inlineTags": {
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": { "$ref": "#/$defs/inlineTag" }
|
|
147
151
|
}
|
|
148
152
|
}
|
|
149
153
|
},
|
|
@@ -179,6 +183,10 @@
|
|
|
179
183
|
"conditionalType": { "$ref": "#/$defs/conditionalType" },
|
|
180
184
|
"mappedType": { "$ref": "#/$defs/mappedType" },
|
|
181
185
|
"external": { "type": "boolean" },
|
|
186
|
+
"inlineTags": {
|
|
187
|
+
"type": "array",
|
|
188
|
+
"items": { "$ref": "#/$defs/inlineTag" }
|
|
189
|
+
},
|
|
182
190
|
"typeParameters": {
|
|
183
191
|
"type": "array",
|
|
184
192
|
"items": { "$ref": "#/$defs/typeParameter" }
|
|
@@ -191,7 +199,20 @@
|
|
|
191
199
|
"properties": {
|
|
192
200
|
"name": { "type": "string" },
|
|
193
201
|
"text": { "type": "string" },
|
|
194
|
-
"param": { "$ref": "#/$defs/tagParam" }
|
|
202
|
+
"param": { "$ref": "#/$defs/tagParam" },
|
|
203
|
+
"inlineTags": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"items": { "$ref": "#/$defs/inlineTag" }
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"additionalProperties": false
|
|
209
|
+
},
|
|
210
|
+
"inlineTag": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"required": ["name", "text"],
|
|
213
|
+
"properties": {
|
|
214
|
+
"name": { "type": "string" },
|
|
215
|
+
"text": { "type": "string" }
|
|
195
216
|
},
|
|
196
217
|
"additionalProperties": false
|
|
197
218
|
},
|
|
@@ -233,6 +254,10 @@
|
|
|
233
254
|
"throws": {
|
|
234
255
|
"type": "array",
|
|
235
256
|
"items": { "$ref": "#/$defs/throwsInfo" }
|
|
257
|
+
},
|
|
258
|
+
"inlineTags": {
|
|
259
|
+
"type": "array",
|
|
260
|
+
"items": { "$ref": "#/$defs/inlineTag" }
|
|
236
261
|
}
|
|
237
262
|
}
|
|
238
263
|
},
|
|
@@ -258,6 +283,10 @@
|
|
|
258
283
|
"decorators": {
|
|
259
284
|
"type": "array",
|
|
260
285
|
"items": { "$ref": "#/$defs/decorator" }
|
|
286
|
+
},
|
|
287
|
+
"inlineTags": {
|
|
288
|
+
"type": "array",
|
|
289
|
+
"items": { "$ref": "#/$defs/inlineTag" }
|
|
261
290
|
}
|
|
262
291
|
}
|
|
263
292
|
},
|
|
@@ -438,7 +467,11 @@
|
|
|
438
467
|
"code": { "type": "string" },
|
|
439
468
|
"title": { "type": "string" },
|
|
440
469
|
"description": { "type": "string" },
|
|
441
|
-
"language": { "$ref": "#/$defs/exampleLanguage" }
|
|
470
|
+
"language": { "$ref": "#/$defs/exampleLanguage" },
|
|
471
|
+
"inlineTags": {
|
|
472
|
+
"type": "array",
|
|
473
|
+
"items": { "$ref": "#/$defs/inlineTag" }
|
|
474
|
+
}
|
|
442
475
|
},
|
|
443
476
|
"additionalProperties": false
|
|
444
477
|
}
|
|
@@ -460,7 +493,8 @@
|
|
|
460
493
|
"flags": { "type": "object", "additionalProperties": true },
|
|
461
494
|
"schema": { "$ref": "#/$defs/schema" },
|
|
462
495
|
"signatures": { "type": "array", "items": { "$ref": "#/$defs/signature" } },
|
|
463
|
-
"decorators": { "type": "array", "items": { "$ref": "#/$defs/decorator" } }
|
|
496
|
+
"decorators": { "type": "array", "items": { "$ref": "#/$defs/decorator" } },
|
|
497
|
+
"inlineTags": { "type": "array", "items": { "$ref": "#/$defs/inlineTag" } }
|
|
464
498
|
}
|
|
465
499
|
}
|
|
466
500
|
}
|