@openpkg-ts/spec 0.9.0 → 0.11.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 +67 -3
- package/dist/index.js +229 -12
- package/package.json +1 -1
- package/schemas/v0.3.0/openpkg.schema.json +161 -12
package/dist/index.d.ts
CHANGED
|
@@ -95,7 +95,6 @@ type SpecSchemaRef = {
|
|
|
95
95
|
};
|
|
96
96
|
type SpecSchemaFallback = {
|
|
97
97
|
type: string;
|
|
98
|
-
tsType?: string;
|
|
99
98
|
};
|
|
100
99
|
type SpecSchemaGeneric = Record<string, unknown>;
|
|
101
100
|
type SpecSchema = string | SpecSchemaPrimitive | SpecSchemaComposite | SpecSchemaCombinator | SpecSchemaRef | SpecSchemaFallback | SpecSchemaGeneric;
|
|
@@ -170,7 +169,6 @@ type SpecSignatureParameter = {
|
|
|
170
169
|
type SpecSignatureReturn = {
|
|
171
170
|
schema: SpecSchema;
|
|
172
171
|
description?: string;
|
|
173
|
-
tsType?: string;
|
|
174
172
|
};
|
|
175
173
|
type SpecSignature = {
|
|
176
174
|
parameters?: SpecSignatureParameter[];
|
|
@@ -303,6 +301,15 @@ type SpecGenerationInfo = {
|
|
|
303
301
|
resolvedExternalTypes: boolean;
|
|
304
302
|
/** Maximum type depth used for nested type resolution */
|
|
305
303
|
maxTypeDepth?: number;
|
|
304
|
+
/** Schema extraction method and metadata */
|
|
305
|
+
schemaExtraction?: {
|
|
306
|
+
/** How schemas were extracted */
|
|
307
|
+
method: "standard-json-schema" | "static-ast" | "hybrid";
|
|
308
|
+
/** Number of schemas extracted via Standard Schema runtime */
|
|
309
|
+
runtimeCount?: number;
|
|
310
|
+
/** Vendors detected (e.g., ['zod', 'valibot']) */
|
|
311
|
+
vendors?: string[];
|
|
312
|
+
};
|
|
306
313
|
};
|
|
307
314
|
/** Environment information during generation */
|
|
308
315
|
environment: {
|
|
@@ -392,6 +399,63 @@ declare function diffSpec(oldSpec: SpecWithDocs, newSpec: SpecWithDocs): SpecDif
|
|
|
392
399
|
* @returns Categorized breaking changes sorted by severity (high first)
|
|
393
400
|
*/
|
|
394
401
|
declare function categorizeBreakingChanges(breaking: string[], oldSpec: SpecWithDocs, newSpec: SpecWithDocs, memberChanges?: MemberChangeInfo[]): CategorizedBreaking[];
|
|
402
|
+
/**
|
|
403
|
+
* Semver version bump type.
|
|
404
|
+
*/
|
|
405
|
+
type SemverBump = "major" | "minor" | "patch" | "none";
|
|
406
|
+
/**
|
|
407
|
+
* Semver recommendation result.
|
|
408
|
+
*/
|
|
409
|
+
interface SemverRecommendation {
|
|
410
|
+
/** Recommended version bump */
|
|
411
|
+
bump: SemverBump;
|
|
412
|
+
/** Reason for the recommendation */
|
|
413
|
+
reason: string;
|
|
414
|
+
/** Count of breaking changes */
|
|
415
|
+
breakingCount: number;
|
|
416
|
+
/** Count of non-breaking additions */
|
|
417
|
+
additionCount: number;
|
|
418
|
+
/** Whether only docs changed */
|
|
419
|
+
docsOnlyChanges: boolean;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Recommend a semver version bump based on spec diff.
|
|
423
|
+
*
|
|
424
|
+
* - MAJOR: Any breaking changes (removals or signature changes)
|
|
425
|
+
* - MINOR: New exports/types added (non-breaking)
|
|
426
|
+
* - PATCH: Documentation-only changes
|
|
427
|
+
* - NONE: No changes
|
|
428
|
+
*
|
|
429
|
+
* @param diff - The spec diff result
|
|
430
|
+
* @returns Semver recommendation with reason
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* ```typescript
|
|
434
|
+
* import { diffSpec, recommendSemverBump } from '@openpkg-ts/spec';
|
|
435
|
+
*
|
|
436
|
+
* const diff = diffSpec(oldSpec, newSpec);
|
|
437
|
+
* const recommendation = recommendSemverBump(diff);
|
|
438
|
+
*
|
|
439
|
+
* console.log(`Recommended: ${recommendation.bump}`);
|
|
440
|
+
* console.log(`Reason: ${recommendation.reason}`);
|
|
441
|
+
* ```
|
|
442
|
+
*/
|
|
443
|
+
declare function recommendSemverBump(diff: SpecDiff): SemverRecommendation;
|
|
444
|
+
/**
|
|
445
|
+
* Calculate the next version number based on current version and recommended bump.
|
|
446
|
+
*
|
|
447
|
+
* @param currentVersion - Current version string (e.g., "1.2.3")
|
|
448
|
+
* @param bump - Recommended bump type
|
|
449
|
+
* @returns Next version string
|
|
450
|
+
*
|
|
451
|
+
* @example
|
|
452
|
+
* ```typescript
|
|
453
|
+
* calculateNextVersion('1.2.3', 'major'); // '2.0.0'
|
|
454
|
+
* calculateNextVersion('1.2.3', 'minor'); // '1.3.0'
|
|
455
|
+
* calculateNextVersion('1.2.3', 'patch'); // '1.2.4'
|
|
456
|
+
* ```
|
|
457
|
+
*/
|
|
458
|
+
declare function calculateNextVersion(currentVersion: string, bump: SemverBump): string;
|
|
395
459
|
declare function normalize(spec: OpenPkg): OpenPkg;
|
|
396
460
|
/** Supported schema versions */
|
|
397
461
|
type SchemaVersion = "0.1.0" | "0.2.0" | "0.3.0" | "latest";
|
|
@@ -429,4 +493,4 @@ declare function assertSpec(spec: unknown, version?: SchemaVersion): asserts spe
|
|
|
429
493
|
* @returns Array of validation errors (empty if valid)
|
|
430
494
|
*/
|
|
431
495
|
declare function getValidationErrors(spec: unknown, version?: SchemaVersion): SpecError[];
|
|
432
|
-
export { validateSpec, normalize, getValidationErrors, diffSpec, dereference, categorizeBreakingChanges, assertSpec, SpecVisibility, SpecTypeParameter, SpecTypeKind, SpecTypeAliasKind, SpecType, SpecThrows, SpecTag, SpecSource, SpecSignatureReturn, SpecSignatureParameter, SpecSignature, SpecSchemaRef, SpecSchemaPrimitive, SpecSchemaGeneric, SpecSchemaFallback, SpecSchemaComposite, SpecSchemaCombinator, SpecSchema, SpecRelationType, SpecRelation, SpecMember, SpecMappedType, SpecGenerationInfo, SpecExtension, SpecExportKind, SpecExport, SpecExampleLanguage, SpecExample, SpecDocsMetadata, SpecDocDrift, SpecDiff, SpecDecorator, SpecConditionalType, SCHEMA_VERSION, SCHEMA_URL, OpenPkgVersion, OpenPkgMeta, OpenPkg, MemberChangeInfo, JSON_SCHEMA_DRAFT, GenerationIssueSeverity, GenerationIssue, EntryPointDetectionMethod, DriftType, DriftCategory, DRIFT_CATEGORY_LABELS, DRIFT_CATEGORY_DESCRIPTIONS, DRIFT_CATEGORIES, CategorizedBreaking, BreakingSeverity };
|
|
496
|
+
export { validateSpec, recommendSemverBump, normalize, getValidationErrors, diffSpec, dereference, categorizeBreakingChanges, calculateNextVersion, assertSpec, SpecVisibility, SpecTypeParameter, SpecTypeKind, SpecTypeAliasKind, SpecType, SpecThrows, SpecTag, SpecSource, SpecSignatureReturn, SpecSignatureParameter, SpecSignature, SpecSchemaRef, SpecSchemaPrimitive, SpecSchemaGeneric, SpecSchemaFallback, SpecSchemaComposite, SpecSchemaCombinator, SpecSchema, SpecRelationType, SpecRelation, SpecMember, SpecMappedType, SpecGenerationInfo, SpecExtension, SpecExportKind, SpecExport, SpecExampleLanguage, SpecExample, SpecDocsMetadata, SpecDocDrift, SpecDiff, SpecDecorator, SpecConditionalType, SemverRecommendation, SemverBump, SCHEMA_VERSION, SCHEMA_URL, OpenPkgVersion, OpenPkgMeta, OpenPkg, MemberChangeInfo, JSON_SCHEMA_DRAFT, GenerationIssueSeverity, GenerationIssue, EntryPointDetectionMethod, DriftType, DriftCategory, DRIFT_CATEGORY_LABELS, DRIFT_CATEGORY_DESCRIPTIONS, DRIFT_CATEGORIES, CategorizedBreaking, BreakingSeverity };
|
package/dist/index.js
CHANGED
|
@@ -282,6 +282,72 @@ function categorizeBreakingChanges(breaking, oldSpec, newSpec, memberChanges) {
|
|
|
282
282
|
const severityOrder = { high: 0, medium: 1, low: 2 };
|
|
283
283
|
return categorized.sort((a, b) => severityOrder[a.severity] - severityOrder[b.severity]);
|
|
284
284
|
}
|
|
285
|
+
function recommendSemverBump(diff) {
|
|
286
|
+
const breakingCount = diff.breaking.length;
|
|
287
|
+
const additionCount = diff.nonBreaking.length;
|
|
288
|
+
const docsOnlyCount = diff.docsOnly.length;
|
|
289
|
+
if (breakingCount > 0) {
|
|
290
|
+
return {
|
|
291
|
+
bump: "major",
|
|
292
|
+
reason: `${breakingCount} breaking change${breakingCount === 1 ? "" : "s"} detected`,
|
|
293
|
+
breakingCount,
|
|
294
|
+
additionCount,
|
|
295
|
+
docsOnlyChanges: false
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
if (additionCount > 0) {
|
|
299
|
+
return {
|
|
300
|
+
bump: "minor",
|
|
301
|
+
reason: `${additionCount} new export${additionCount === 1 ? "" : "s"} added`,
|
|
302
|
+
breakingCount: 0,
|
|
303
|
+
additionCount,
|
|
304
|
+
docsOnlyChanges: false
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
if (docsOnlyCount > 0) {
|
|
308
|
+
return {
|
|
309
|
+
bump: "patch",
|
|
310
|
+
reason: `${docsOnlyCount} documentation-only change${docsOnlyCount === 1 ? "" : "s"}`,
|
|
311
|
+
breakingCount: 0,
|
|
312
|
+
additionCount: 0,
|
|
313
|
+
docsOnlyChanges: true
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
return {
|
|
317
|
+
bump: "none",
|
|
318
|
+
reason: "No changes detected",
|
|
319
|
+
breakingCount: 0,
|
|
320
|
+
additionCount: 0,
|
|
321
|
+
docsOnlyChanges: false
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function calculateNextVersion(currentVersion, bump) {
|
|
325
|
+
if (bump === "none") {
|
|
326
|
+
return currentVersion;
|
|
327
|
+
}
|
|
328
|
+
const normalized = currentVersion.replace(/^v/, "");
|
|
329
|
+
const match = normalized.match(/^(\d+)\.(\d+)\.(\d+)/);
|
|
330
|
+
if (!match) {
|
|
331
|
+
return currentVersion;
|
|
332
|
+
}
|
|
333
|
+
let [, major, minor, patch] = match.map(Number);
|
|
334
|
+
switch (bump) {
|
|
335
|
+
case "major":
|
|
336
|
+
major++;
|
|
337
|
+
minor = 0;
|
|
338
|
+
patch = 0;
|
|
339
|
+
break;
|
|
340
|
+
case "minor":
|
|
341
|
+
minor++;
|
|
342
|
+
patch = 0;
|
|
343
|
+
break;
|
|
344
|
+
case "patch":
|
|
345
|
+
patch++;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
const prefix = currentVersion.startsWith("v") ? "v" : "";
|
|
349
|
+
return `${prefix}${major}.${minor}.${patch}`;
|
|
350
|
+
}
|
|
285
351
|
// src/normalize.ts
|
|
286
352
|
var DEFAULT_ECOSYSTEM = "js/ts";
|
|
287
353
|
var arrayFieldsByExport = ["signatures", "members", "examples", "tags"];
|
|
@@ -1141,9 +1207,17 @@ var openpkg_schema_default3 = {
|
|
|
1141
1207
|
$ref: "#/$defs/typeDef"
|
|
1142
1208
|
}
|
|
1143
1209
|
},
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
description: "
|
|
1210
|
+
examples: {
|
|
1211
|
+
type: "array",
|
|
1212
|
+
description: "Package-level usage examples",
|
|
1213
|
+
items: {
|
|
1214
|
+
$ref: "#/$defs/example"
|
|
1215
|
+
}
|
|
1216
|
+
},
|
|
1217
|
+
extensions: {
|
|
1218
|
+
type: "object",
|
|
1219
|
+
description: "Custom extension data",
|
|
1220
|
+
additionalProperties: true
|
|
1147
1221
|
},
|
|
1148
1222
|
generation: {
|
|
1149
1223
|
$ref: "#/$defs/generationInfo",
|
|
@@ -1213,7 +1287,12 @@ var openpkg_schema_default3 = {
|
|
|
1213
1287
|
analysis: {
|
|
1214
1288
|
type: "object",
|
|
1215
1289
|
description: "Details about the analysis process",
|
|
1216
|
-
required: [
|
|
1290
|
+
required: [
|
|
1291
|
+
"entryPoint",
|
|
1292
|
+
"entryPointSource",
|
|
1293
|
+
"isDeclarationOnly",
|
|
1294
|
+
"resolvedExternalTypes"
|
|
1295
|
+
],
|
|
1217
1296
|
properties: {
|
|
1218
1297
|
entryPoint: {
|
|
1219
1298
|
type: "string",
|
|
@@ -1233,6 +1312,27 @@ var openpkg_schema_default3 = {
|
|
|
1233
1312
|
maxTypeDepth: {
|
|
1234
1313
|
type: "integer",
|
|
1235
1314
|
description: "Maximum type depth used for nested type resolution"
|
|
1315
|
+
},
|
|
1316
|
+
schemaExtraction: {
|
|
1317
|
+
type: "object",
|
|
1318
|
+
description: "Schema extraction method and metadata",
|
|
1319
|
+
properties: {
|
|
1320
|
+
method: {
|
|
1321
|
+
type: "string",
|
|
1322
|
+
description: "How schemas were extracted",
|
|
1323
|
+
enum: ["standard-json-schema", "static-ast", "hybrid"]
|
|
1324
|
+
},
|
|
1325
|
+
runtimeCount: {
|
|
1326
|
+
type: "integer",
|
|
1327
|
+
description: "Number of schemas extracted via Standard Schema runtime"
|
|
1328
|
+
},
|
|
1329
|
+
vendors: {
|
|
1330
|
+
type: "array",
|
|
1331
|
+
description: "Vendors detected (e.g., ['zod', 'valibot'])",
|
|
1332
|
+
items: { type: "string" }
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
additionalProperties: false
|
|
1236
1336
|
}
|
|
1237
1337
|
},
|
|
1238
1338
|
additionalProperties: false
|
|
@@ -1387,7 +1487,9 @@ var openpkg_schema_default3 = {
|
|
|
1387
1487
|
"interface",
|
|
1388
1488
|
"type",
|
|
1389
1489
|
"enum",
|
|
1490
|
+
"module",
|
|
1390
1491
|
"namespace",
|
|
1492
|
+
"reference",
|
|
1391
1493
|
"external"
|
|
1392
1494
|
]
|
|
1393
1495
|
},
|
|
@@ -1416,7 +1518,7 @@ var openpkg_schema_default3 = {
|
|
|
1416
1518
|
members: {
|
|
1417
1519
|
type: "array",
|
|
1418
1520
|
description: "Class/interface/enum members",
|
|
1419
|
-
items: {
|
|
1521
|
+
items: { $ref: "#/$defs/member" }
|
|
1420
1522
|
},
|
|
1421
1523
|
extends: {
|
|
1422
1524
|
type: "string",
|
|
@@ -1437,6 +1539,24 @@ var openpkg_schema_default3 = {
|
|
|
1437
1539
|
source: {
|
|
1438
1540
|
$ref: "#/$defs/sourceLocation"
|
|
1439
1541
|
},
|
|
1542
|
+
deprecated: {
|
|
1543
|
+
type: "boolean",
|
|
1544
|
+
description: "Whether this export is deprecated"
|
|
1545
|
+
},
|
|
1546
|
+
flags: {
|
|
1547
|
+
type: "object",
|
|
1548
|
+
description: "Export flags (readonly, abstract, etc.)",
|
|
1549
|
+
additionalProperties: true
|
|
1550
|
+
},
|
|
1551
|
+
schema: {
|
|
1552
|
+
$ref: "#/$defs/schema",
|
|
1553
|
+
description: "Inline schema for the export"
|
|
1554
|
+
},
|
|
1555
|
+
typeParameters: {
|
|
1556
|
+
type: "array",
|
|
1557
|
+
description: "Generic type parameters",
|
|
1558
|
+
items: { $ref: "#/$defs/typeParameter" }
|
|
1559
|
+
},
|
|
1440
1560
|
docs: {
|
|
1441
1561
|
$ref: "#/$defs/docsMetadata",
|
|
1442
1562
|
description: "Documentation coverage metadata for this export"
|
|
@@ -1526,7 +1646,7 @@ var openpkg_schema_default3 = {
|
|
|
1526
1646
|
members: {
|
|
1527
1647
|
type: "array",
|
|
1528
1648
|
description: "Members for classes/interfaces/enums",
|
|
1529
|
-
items: {
|
|
1649
|
+
items: { $ref: "#/$defs/member" }
|
|
1530
1650
|
},
|
|
1531
1651
|
extends: {
|
|
1532
1652
|
type: "string",
|
|
@@ -1547,6 +1667,10 @@ var openpkg_schema_default3 = {
|
|
|
1547
1667
|
source: {
|
|
1548
1668
|
$ref: "#/$defs/sourceLocation"
|
|
1549
1669
|
},
|
|
1670
|
+
rawComments: {
|
|
1671
|
+
type: "string",
|
|
1672
|
+
description: "Raw JSDoc/TSDoc comment text"
|
|
1673
|
+
},
|
|
1550
1674
|
typeAliasKind: {
|
|
1551
1675
|
$ref: "#/$defs/typeAliasKind",
|
|
1552
1676
|
description: "Kind of type alias"
|
|
@@ -1667,7 +1791,7 @@ var openpkg_schema_default3 = {
|
|
|
1667
1791
|
},
|
|
1668
1792
|
parameter: {
|
|
1669
1793
|
type: "object",
|
|
1670
|
-
required: ["name"
|
|
1794
|
+
required: ["name"],
|
|
1671
1795
|
properties: {
|
|
1672
1796
|
name: {
|
|
1673
1797
|
type: "string",
|
|
@@ -1710,25 +1834,55 @@ var openpkg_schema_default3 = {
|
|
|
1710
1834
|
}
|
|
1711
1835
|
}
|
|
1712
1836
|
},
|
|
1837
|
+
schemaType: {
|
|
1838
|
+
type: "string",
|
|
1839
|
+
description: "Explicit type enum aligned with TypeScript type system",
|
|
1840
|
+
enum: [
|
|
1841
|
+
"string",
|
|
1842
|
+
"number",
|
|
1843
|
+
"boolean",
|
|
1844
|
+
"integer",
|
|
1845
|
+
"null",
|
|
1846
|
+
"undefined",
|
|
1847
|
+
"any",
|
|
1848
|
+
"unknown",
|
|
1849
|
+
"never",
|
|
1850
|
+
"void",
|
|
1851
|
+
"array",
|
|
1852
|
+
"tuple",
|
|
1853
|
+
"object",
|
|
1854
|
+
"function"
|
|
1855
|
+
]
|
|
1856
|
+
},
|
|
1713
1857
|
schema: {
|
|
1714
|
-
description: "Flexible JSON Schema for type representation",
|
|
1858
|
+
description: "Flexible JSON Schema for type representation (supports Standard JSON Schema output)",
|
|
1715
1859
|
oneOf: [
|
|
1716
1860
|
{ type: "string" },
|
|
1717
1861
|
{ type: "boolean" },
|
|
1718
1862
|
{
|
|
1719
1863
|
type: "object",
|
|
1720
1864
|
properties: {
|
|
1865
|
+
$schema: { type: "string", description: "JSON Schema draft URI" },
|
|
1721
1866
|
type: { type: "string" },
|
|
1722
1867
|
format: { type: "string" },
|
|
1723
1868
|
enum: { type: "array" },
|
|
1869
|
+
const: { description: "Constant value" },
|
|
1724
1870
|
items: { $ref: "#/$defs/schema" },
|
|
1871
|
+
prefixedItems: {
|
|
1872
|
+
type: "array",
|
|
1873
|
+
items: { $ref: "#/$defs/schema" },
|
|
1874
|
+
description: "Tuple element schemas (draft-2020-12)"
|
|
1875
|
+
},
|
|
1725
1876
|
properties: {
|
|
1726
1877
|
type: "object",
|
|
1727
1878
|
additionalProperties: { $ref: "#/$defs/schema" }
|
|
1728
1879
|
},
|
|
1729
1880
|
required: { type: "array", items: { type: "string" } },
|
|
1730
1881
|
additionalProperties: {
|
|
1731
|
-
oneOf: [
|
|
1882
|
+
oneOf: [
|
|
1883
|
+
{ type: "boolean" },
|
|
1884
|
+
{ type: "object", additionalProperties: true }
|
|
1885
|
+
]
|
|
1732
1886
|
},
|
|
1733
1887
|
anyOf: { type: "array", items: { $ref: "#/$defs/schema" } },
|
|
1734
1888
|
allOf: { type: "array", items: { $ref: "#/$defs/schema" } },
|
|
@@ -1738,18 +1892,25 @@ var openpkg_schema_default3 = {
|
|
|
1738
1892
|
type: "object",
|
|
1739
1893
|
properties: { propertyName: { type: "string" } }
|
|
1740
1894
|
},
|
|
1741
|
-
tsType: { type: "string" },
|
|
1742
1895
|
description: { type: "string" },
|
|
1896
|
+
default: { description: "Default value for the schema" },
|
|
1897
|
+
minimum: { type: "number", description: "Minimum value for numbers" },
|
|
1898
|
+
maximum: { type: "number", description: "Maximum value for numbers" },
|
|
1899
|
+
exclusiveMinimum: { type: "number" },
|
|
1900
|
+
exclusiveMaximum: { type: "number" },
|
|
1901
|
+
minLength: { type: "integer", description: "Minimum string length" },
|
|
1902
|
+
maxLength: { type: "integer", description: "Maximum string length" },
|
|
1903
|
+
pattern: { type: "string", description: "Regex pattern for strings" },
|
|
1743
1904
|
minItems: { type: "integer" },
|
|
1744
1905
|
maxItems: { type: "integer" },
|
|
1745
|
-
|
|
1906
|
+
uniqueItems: { type: "boolean" },
|
|
1907
|
+
signatures: { type: "array", items: { $ref: "#/$defs/signature" } }
|
|
1746
1908
|
}
|
|
1747
1909
|
}
|
|
1748
1910
|
]
|
|
1749
1911
|
},
|
|
1750
1912
|
sourceLocation: {
|
|
1751
1913
|
type: "object",
|
|
1752
|
-
required: ["file", "line"],
|
|
1753
1914
|
properties: {
|
|
1754
1915
|
file: {
|
|
1755
1916
|
type: "string",
|
|
@@ -1759,6 +1920,10 @@ var openpkg_schema_default3 = {
|
|
|
1759
1920
|
type: "integer",
|
|
1760
1921
|
description: "Line number in source file",
|
|
1761
1922
|
minimum: 1
|
|
1923
|
+
},
|
|
1924
|
+
url: {
|
|
1925
|
+
type: "string",
|
|
1926
|
+
description: "URL to source (e.g., GitHub permalink)"
|
|
1762
1927
|
}
|
|
1763
1928
|
}
|
|
1764
1929
|
},
|
|
@@ -1901,6 +2066,56 @@ var openpkg_schema_default3 = {
|
|
|
1901
2066
|
}
|
|
1902
2067
|
]
|
|
1903
2068
|
},
|
|
2069
|
+
visibility: {
|
|
2070
|
+
type: "string",
|
|
2071
|
+
description: "Visibility modifier for class members",
|
|
2072
|
+
enum: ["public", "protected", "private"]
|
|
2073
|
+
},
|
|
2074
|
+
member: {
|
|
2075
|
+
type: "object",
|
|
2076
|
+
description: "Class/interface/enum member definition",
|
|
2077
|
+
properties: {
|
|
2078
|
+
id: {
|
|
2079
|
+
type: "string",
|
|
2080
|
+
description: "Unique identifier for the member"
|
|
2081
|
+
},
|
|
2082
|
+
name: {
|
|
2083
|
+
type: "string",
|
|
2084
|
+
description: "Member name"
|
|
2085
|
+
},
|
|
2086
|
+
kind: {
|
|
2087
|
+
type: "string",
|
|
2088
|
+
description: "Kind of member (e.g., 'property', 'method', 'constructor')"
|
|
2089
|
+
},
|
|
2090
|
+
description: {
|
|
2091
|
+
type: "string",
|
|
2092
|
+
description: "JSDoc/TSDoc description"
|
|
2093
|
+
},
|
|
2094
|
+
visibility: {
|
|
2095
|
+
$ref: "#/$defs/visibility"
|
|
2096
|
+
},
|
|
2097
|
+
tags: {
|
|
2098
|
+
type: "array",
|
|
2099
|
+
items: { $ref: "#/$defs/tag" }
|
|
2100
|
+
},
|
|
2101
|
+
flags: {
|
|
2102
|
+
type: "object",
|
|
2103
|
+
description: "Member flags (static, readonly, abstract, etc.)",
|
|
2104
|
+
additionalProperties: true
|
|
2105
|
+
},
|
|
2106
|
+
schema: {
|
|
2107
|
+
$ref: "#/$defs/schema"
|
|
2108
|
+
},
|
|
2109
|
+
signatures: {
|
|
2110
|
+
type: "array",
|
|
2111
|
+
items: { $ref: "#/$defs/signature" }
|
|
2112
|
+
},
|
|
2113
|
+
decorators: {
|
|
2114
|
+
type: "array",
|
|
2115
|
+
items: { $ref: "#/$defs/decorator" }
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
},
|
|
1904
2119
|
relationType: {
|
|
1905
2120
|
type: "string",
|
|
1906
2121
|
description: "Type of relationship between exports",
|
|
@@ -1988,11 +2203,13 @@ function getValidationErrors(spec, version = "latest") {
|
|
|
1988
2203
|
}
|
|
1989
2204
|
export {
|
|
1990
2205
|
validateSpec,
|
|
2206
|
+
recommendSemverBump,
|
|
1991
2207
|
normalize,
|
|
1992
2208
|
getValidationErrors,
|
|
1993
2209
|
diffSpec,
|
|
1994
2210
|
dereference,
|
|
1995
2211
|
categorizeBreakingChanges,
|
|
2212
|
+
calculateNextVersion,
|
|
1996
2213
|
assertSpec,
|
|
1997
2214
|
SCHEMA_VERSION,
|
|
1998
2215
|
SCHEMA_URL,
|
package/package.json
CHANGED
|
@@ -62,9 +62,17 @@
|
|
|
62
62
|
"$ref": "#/$defs/typeDef"
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"description": "
|
|
65
|
+
"examples": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"description": "Package-level usage examples",
|
|
68
|
+
"items": {
|
|
69
|
+
"$ref": "#/$defs/example"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"extensions": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"description": "Custom extension data",
|
|
75
|
+
"additionalProperties": true
|
|
68
76
|
},
|
|
69
77
|
"generation": {
|
|
70
78
|
"$ref": "#/$defs/generationInfo",
|
|
@@ -134,7 +142,12 @@
|
|
|
134
142
|
"analysis": {
|
|
135
143
|
"type": "object",
|
|
136
144
|
"description": "Details about the analysis process",
|
|
137
|
-
"required": [
|
|
145
|
+
"required": [
|
|
146
|
+
"entryPoint",
|
|
147
|
+
"entryPointSource",
|
|
148
|
+
"isDeclarationOnly",
|
|
149
|
+
"resolvedExternalTypes"
|
|
150
|
+
],
|
|
138
151
|
"properties": {
|
|
139
152
|
"entryPoint": {
|
|
140
153
|
"type": "string",
|
|
@@ -154,6 +167,27 @@
|
|
|
154
167
|
"maxTypeDepth": {
|
|
155
168
|
"type": "integer",
|
|
156
169
|
"description": "Maximum type depth used for nested type resolution"
|
|
170
|
+
},
|
|
171
|
+
"schemaExtraction": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"description": "Schema extraction method and metadata",
|
|
174
|
+
"properties": {
|
|
175
|
+
"method": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"description": "How schemas were extracted",
|
|
178
|
+
"enum": ["standard-json-schema", "static-ast", "hybrid"]
|
|
179
|
+
},
|
|
180
|
+
"runtimeCount": {
|
|
181
|
+
"type": "integer",
|
|
182
|
+
"description": "Number of schemas extracted via Standard Schema runtime"
|
|
183
|
+
},
|
|
184
|
+
"vendors": {
|
|
185
|
+
"type": "array",
|
|
186
|
+
"description": "Vendors detected (e.g., ['zod', 'valibot'])",
|
|
187
|
+
"items": { "type": "string" }
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"additionalProperties": false
|
|
157
191
|
}
|
|
158
192
|
},
|
|
159
193
|
"additionalProperties": false
|
|
@@ -308,7 +342,9 @@
|
|
|
308
342
|
"interface",
|
|
309
343
|
"type",
|
|
310
344
|
"enum",
|
|
345
|
+
"module",
|
|
311
346
|
"namespace",
|
|
347
|
+
"reference",
|
|
312
348
|
"external"
|
|
313
349
|
]
|
|
314
350
|
},
|
|
@@ -337,7 +373,7 @@
|
|
|
337
373
|
"members": {
|
|
338
374
|
"type": "array",
|
|
339
375
|
"description": "Class/interface/enum members",
|
|
340
|
-
"items": { "
|
|
376
|
+
"items": { "$ref": "#/$defs/member" }
|
|
341
377
|
},
|
|
342
378
|
"extends": {
|
|
343
379
|
"type": "string",
|
|
@@ -358,6 +394,24 @@
|
|
|
358
394
|
"source": {
|
|
359
395
|
"$ref": "#/$defs/sourceLocation"
|
|
360
396
|
},
|
|
397
|
+
"deprecated": {
|
|
398
|
+
"type": "boolean",
|
|
399
|
+
"description": "Whether this export is deprecated"
|
|
400
|
+
},
|
|
401
|
+
"flags": {
|
|
402
|
+
"type": "object",
|
|
403
|
+
"description": "Export flags (readonly, abstract, etc.)",
|
|
404
|
+
"additionalProperties": true
|
|
405
|
+
},
|
|
406
|
+
"schema": {
|
|
407
|
+
"$ref": "#/$defs/schema",
|
|
408
|
+
"description": "Inline schema for the export"
|
|
409
|
+
},
|
|
410
|
+
"typeParameters": {
|
|
411
|
+
"type": "array",
|
|
412
|
+
"description": "Generic type parameters",
|
|
413
|
+
"items": { "$ref": "#/$defs/typeParameter" }
|
|
414
|
+
},
|
|
361
415
|
"docs": {
|
|
362
416
|
"$ref": "#/$defs/docsMetadata",
|
|
363
417
|
"description": "Documentation coverage metadata for this export"
|
|
@@ -447,7 +501,7 @@
|
|
|
447
501
|
"members": {
|
|
448
502
|
"type": "array",
|
|
449
503
|
"description": "Members for classes/interfaces/enums",
|
|
450
|
-
"items": { "
|
|
504
|
+
"items": { "$ref": "#/$defs/member" }
|
|
451
505
|
},
|
|
452
506
|
"extends": {
|
|
453
507
|
"type": "string",
|
|
@@ -468,6 +522,10 @@
|
|
|
468
522
|
"source": {
|
|
469
523
|
"$ref": "#/$defs/sourceLocation"
|
|
470
524
|
},
|
|
525
|
+
"rawComments": {
|
|
526
|
+
"type": "string",
|
|
527
|
+
"description": "Raw JSDoc/TSDoc comment text"
|
|
528
|
+
},
|
|
471
529
|
"typeAliasKind": {
|
|
472
530
|
"$ref": "#/$defs/typeAliasKind",
|
|
473
531
|
"description": "Kind of type alias"
|
|
@@ -588,7 +646,7 @@
|
|
|
588
646
|
},
|
|
589
647
|
"parameter": {
|
|
590
648
|
"type": "object",
|
|
591
|
-
"required": ["name"
|
|
649
|
+
"required": ["name"],
|
|
592
650
|
"properties": {
|
|
593
651
|
"name": {
|
|
594
652
|
"type": "string",
|
|
@@ -631,25 +689,55 @@
|
|
|
631
689
|
}
|
|
632
690
|
}
|
|
633
691
|
},
|
|
692
|
+
"schemaType": {
|
|
693
|
+
"type": "string",
|
|
694
|
+
"description": "Explicit type enum aligned with TypeScript type system",
|
|
695
|
+
"enum": [
|
|
696
|
+
"string",
|
|
697
|
+
"number",
|
|
698
|
+
"boolean",
|
|
699
|
+
"integer",
|
|
700
|
+
"null",
|
|
701
|
+
"undefined",
|
|
702
|
+
"any",
|
|
703
|
+
"unknown",
|
|
704
|
+
"never",
|
|
705
|
+
"void",
|
|
706
|
+
"array",
|
|
707
|
+
"tuple",
|
|
708
|
+
"object",
|
|
709
|
+
"function"
|
|
710
|
+
]
|
|
711
|
+
},
|
|
634
712
|
"schema": {
|
|
635
|
-
"description": "Flexible JSON Schema for type representation",
|
|
713
|
+
"description": "Flexible JSON Schema for type representation (supports Standard JSON Schema output)",
|
|
636
714
|
"oneOf": [
|
|
637
715
|
{ "type": "string" },
|
|
638
716
|
{ "type": "boolean" },
|
|
639
717
|
{
|
|
640
718
|
"type": "object",
|
|
641
719
|
"properties": {
|
|
720
|
+
"$schema": { "type": "string", "description": "JSON Schema draft URI" },
|
|
642
721
|
"type": { "type": "string" },
|
|
643
722
|
"format": { "type": "string" },
|
|
644
723
|
"enum": { "type": "array" },
|
|
724
|
+
"const": { "description": "Constant value" },
|
|
645
725
|
"items": { "$ref": "#/$defs/schema" },
|
|
726
|
+
"prefixedItems": {
|
|
727
|
+
"type": "array",
|
|
728
|
+
"items": { "$ref": "#/$defs/schema" },
|
|
729
|
+
"description": "Tuple element schemas (draft-2020-12)"
|
|
730
|
+
},
|
|
646
731
|
"properties": {
|
|
647
732
|
"type": "object",
|
|
648
733
|
"additionalProperties": { "$ref": "#/$defs/schema" }
|
|
649
734
|
},
|
|
650
735
|
"required": { "type": "array", "items": { "type": "string" } },
|
|
651
736
|
"additionalProperties": {
|
|
652
|
-
"oneOf": [
|
|
737
|
+
"oneOf": [
|
|
738
|
+
{ "type": "boolean" },
|
|
739
|
+
{ "type": "object", "additionalProperties": true }
|
|
740
|
+
]
|
|
653
741
|
},
|
|
654
742
|
"anyOf": { "type": "array", "items": { "$ref": "#/$defs/schema" } },
|
|
655
743
|
"allOf": { "type": "array", "items": { "$ref": "#/$defs/schema" } },
|
|
@@ -659,18 +747,25 @@
|
|
|
659
747
|
"type": "object",
|
|
660
748
|
"properties": { "propertyName": { "type": "string" } }
|
|
661
749
|
},
|
|
662
|
-
"tsType": { "type": "string" },
|
|
663
750
|
"description": { "type": "string" },
|
|
751
|
+
"default": { "description": "Default value for the schema" },
|
|
752
|
+
"minimum": { "type": "number", "description": "Minimum value for numbers" },
|
|
753
|
+
"maximum": { "type": "number", "description": "Maximum value for numbers" },
|
|
754
|
+
"exclusiveMinimum": { "type": "number" },
|
|
755
|
+
"exclusiveMaximum": { "type": "number" },
|
|
756
|
+
"minLength": { "type": "integer", "description": "Minimum string length" },
|
|
757
|
+
"maxLength": { "type": "integer", "description": "Maximum string length" },
|
|
758
|
+
"pattern": { "type": "string", "description": "Regex pattern for strings" },
|
|
664
759
|
"minItems": { "type": "integer" },
|
|
665
760
|
"maxItems": { "type": "integer" },
|
|
666
|
-
"
|
|
761
|
+
"uniqueItems": { "type": "boolean" },
|
|
762
|
+
"signatures": { "type": "array", "items": { "$ref": "#/$defs/signature" } }
|
|
667
763
|
}
|
|
668
764
|
}
|
|
669
765
|
]
|
|
670
766
|
},
|
|
671
767
|
"sourceLocation": {
|
|
672
768
|
"type": "object",
|
|
673
|
-
"required": ["file", "line"],
|
|
674
769
|
"properties": {
|
|
675
770
|
"file": {
|
|
676
771
|
"type": "string",
|
|
@@ -680,6 +775,10 @@
|
|
|
680
775
|
"type": "integer",
|
|
681
776
|
"description": "Line number in source file",
|
|
682
777
|
"minimum": 1
|
|
778
|
+
},
|
|
779
|
+
"url": {
|
|
780
|
+
"type": "string",
|
|
781
|
+
"description": "URL to source (e.g., GitHub permalink)"
|
|
683
782
|
}
|
|
684
783
|
}
|
|
685
784
|
},
|
|
@@ -822,6 +921,56 @@
|
|
|
822
921
|
}
|
|
823
922
|
]
|
|
824
923
|
},
|
|
924
|
+
"visibility": {
|
|
925
|
+
"type": "string",
|
|
926
|
+
"description": "Visibility modifier for class members",
|
|
927
|
+
"enum": ["public", "protected", "private"]
|
|
928
|
+
},
|
|
929
|
+
"member": {
|
|
930
|
+
"type": "object",
|
|
931
|
+
"description": "Class/interface/enum member definition",
|
|
932
|
+
"properties": {
|
|
933
|
+
"id": {
|
|
934
|
+
"type": "string",
|
|
935
|
+
"description": "Unique identifier for the member"
|
|
936
|
+
},
|
|
937
|
+
"name": {
|
|
938
|
+
"type": "string",
|
|
939
|
+
"description": "Member name"
|
|
940
|
+
},
|
|
941
|
+
"kind": {
|
|
942
|
+
"type": "string",
|
|
943
|
+
"description": "Kind of member (e.g., 'property', 'method', 'constructor')"
|
|
944
|
+
},
|
|
945
|
+
"description": {
|
|
946
|
+
"type": "string",
|
|
947
|
+
"description": "JSDoc/TSDoc description"
|
|
948
|
+
},
|
|
949
|
+
"visibility": {
|
|
950
|
+
"$ref": "#/$defs/visibility"
|
|
951
|
+
},
|
|
952
|
+
"tags": {
|
|
953
|
+
"type": "array",
|
|
954
|
+
"items": { "$ref": "#/$defs/tag" }
|
|
955
|
+
},
|
|
956
|
+
"flags": {
|
|
957
|
+
"type": "object",
|
|
958
|
+
"description": "Member flags (static, readonly, abstract, etc.)",
|
|
959
|
+
"additionalProperties": true
|
|
960
|
+
},
|
|
961
|
+
"schema": {
|
|
962
|
+
"$ref": "#/$defs/schema"
|
|
963
|
+
},
|
|
964
|
+
"signatures": {
|
|
965
|
+
"type": "array",
|
|
966
|
+
"items": { "$ref": "#/$defs/signature" }
|
|
967
|
+
},
|
|
968
|
+
"decorators": {
|
|
969
|
+
"type": "array",
|
|
970
|
+
"items": { "$ref": "#/$defs/decorator" }
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
},
|
|
825
974
|
"relationType": {
|
|
826
975
|
"type": "string",
|
|
827
976
|
"description": "Type of relationship between exports",
|