@openpkg-ts/sdk 0.52.1 → 0.53.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/README.md CHANGED
@@ -87,7 +87,6 @@ Generate full OpenPkg spec (all exports + types).
87
87
  const { spec, diagnostics, verification } = await extractSpec({
88
88
  entryFile: './src/index.ts',
89
89
  maxTypeDepth: 4,
90
- resolveExternalTypes: true,
91
90
  only: ['use*'], // filter by pattern
92
91
  ignore: ['*Internal'], // exclude by pattern
93
92
  followExternal: ['@ai-sdk/*'], // or true, or 'auto' with decisions: 'jev'
@@ -160,20 +159,6 @@ filterSpec(spec, {
160
159
  });
161
160
  ```
162
161
 
163
- ### analyzeSpec
164
-
165
- Analyze spec for quality issues.
166
-
167
- ```typescript
168
- import { analyzeSpec } from '@openpkg-ts/sdk';
169
-
170
- const diagnostics = analyzeSpec(spec);
171
-
172
- console.log(`Missing descriptions: ${diagnostics.missingDescriptions.length}`);
173
- console.log(`Deprecated without reason: ${diagnostics.deprecatedNoReason.length}`);
174
- console.log(`Missing param docs: ${diagnostics.missingParamDocs.length}`);
175
- ```
176
-
177
162
  ## Documentation Generation
178
163
 
179
164
  ### createDocs / loadSpec
@@ -293,7 +278,6 @@ import type {
293
278
  SimplifiedSpec,
294
279
  FilterCriteria,
295
280
  FilterResult,
296
- SpecDiagnostics,
297
281
  DiffOptions,
298
282
  QueryBuilder,
299
283
  } from '@openpkg-ts/sdk';
package/dist/browser.d.ts CHANGED
@@ -1,38 +1,3 @@
1
- import { OpenPkg, SpecExport } from "@openpkg-ts/spec";
2
- interface DiagnosticItem {
3
- exportId: string;
4
- exportName: string;
5
- issue: string;
6
- /** Member name if issue is on a member */
7
- member?: string;
8
- /** Parameter name if issue is on a parameter */
9
- param?: string;
10
- }
11
- interface SpecDiagnostics {
12
- /** Exports/members without descriptions */
13
- missingDescriptions: DiagnosticItem[];
14
- /** Exports marked @deprecated but no reason provided */
15
- deprecatedNoReason: DiagnosticItem[];
16
- /** Function params without descriptions in JSDoc */
17
- missingParamDocs: DiagnosticItem[];
18
- }
19
- /**
20
- * Check if has @deprecated tag.
21
- */
22
- declare function hasDeprecatedTag(exp: SpecExport): boolean;
23
- /**
24
- * Get deprecation message from @deprecated tag.
25
- * Returns undefined if no reason provided.
26
- */
27
- declare function getDeprecationMessage(exp: SpecExport): string | undefined;
28
- /**
29
- * Find params without descriptions in JSDoc.
30
- */
31
- declare function findMissingParamDocs(exp: SpecExport): string[];
32
- /**
33
- * Analyze a spec for quality issues.
34
- */
35
- declare function analyzeSpec(spec: OpenPkg): SpecDiagnostics;
36
1
  import { SpecMember } from "@openpkg-ts/spec";
37
2
  /**
38
3
  * Extract badge strings from a member's visibility and flags.
@@ -43,7 +8,7 @@ declare function getMemberBadges(member: SpecMember): string[];
43
8
  * Format badges array into a display string (space-separated).
44
9
  */
45
10
  declare function formatBadges(badges: string[]): string;
46
- import { OpenPkg as OpenPkg7, SpecExport as SpecExport3, SpecExportKind as SpecExportKind4, SpecType } from "@openpkg-ts/spec";
11
+ import { OpenPkg as OpenPkg6, SpecExport as SpecExport2, SpecExportKind as SpecExportKind4, SpecType } from "@openpkg-ts/spec";
47
12
  interface HTMLOptions {
48
13
  /** Page title override */
49
14
  title?: string;
@@ -215,7 +180,7 @@ interface DocusaurusSidebarItem {
215
180
  href?: string;
216
181
  }
217
182
  type DocusaurusSidebar = DocusaurusSidebarItem[];
218
- import { OpenPkg as OpenPkg6, SpecExportKind as SpecExportKind3 } from "@openpkg-ts/spec";
183
+ import { OpenPkg as OpenPkg5, SpecExportKind as SpecExportKind3 } from "@openpkg-ts/spec";
219
184
  interface SearchOptions {
220
185
  /** Base URL for search result links */
221
186
  baseUrl?: string;
@@ -308,7 +273,7 @@ interface SearchIndex {
308
273
  * // { records: [...], version: '1.0.0', packageName: 'my-lib' }
309
274
  * ```
310
275
  */
311
- declare function toSearchIndex2(spec: OpenPkg6, options?: SearchOptions): SearchIndex;
276
+ declare function toSearchIndex2(spec: OpenPkg5, options?: SearchOptions): SearchIndex;
312
277
  /**
313
278
  * Generate Pagefind-compatible records.
314
279
  *
@@ -324,7 +289,7 @@ declare function toSearchIndex2(spec: OpenPkg6, options?: SearchOptions): Search
324
289
  * })
325
290
  * ```
326
291
  */
327
- declare function toPagefindRecords2(spec: OpenPkg6, options?: SearchOptions): PagefindRecord[];
292
+ declare function toPagefindRecords2(spec: OpenPkg5, options?: SearchOptions): PagefindRecord[];
328
293
  /**
329
294
  * Generate Algolia-compatible records.
330
295
  *
@@ -338,7 +303,7 @@ declare function toPagefindRecords2(spec: OpenPkg6, options?: SearchOptions): Pa
338
303
  * // Upload to Algolia index
339
304
  * ```
340
305
  */
341
- declare function toAlgoliaRecords2(spec: OpenPkg6, options?: SearchOptions): AlgoliaRecord[];
306
+ declare function toAlgoliaRecords2(spec: OpenPkg5, options?: SearchOptions): AlgoliaRecord[];
342
307
  /**
343
308
  * Serialize search index to JSON string.
344
309
  *
@@ -352,36 +317,36 @@ declare function toAlgoliaRecords2(spec: OpenPkg6, options?: SearchOptions): Alg
352
317
  * fs.writeFileSync('search-index.json', json)
353
318
  * ```
354
319
  */
355
- declare function toSearchIndexJSON(spec: OpenPkg6, options?: SearchOptions & {
320
+ declare function toSearchIndexJSON(spec: OpenPkg5, options?: SearchOptions & {
356
321
  pretty?: boolean;
357
322
  }): string;
358
323
  interface LoadOptions {
359
324
  /** Path to openpkg.json file or the spec object directly */
360
- input: string | OpenPkg7;
325
+ input: string | OpenPkg6;
361
326
  }
362
327
  interface DocsInstance {
363
328
  /** The parsed OpenPkg spec */
364
- spec: OpenPkg7;
329
+ spec: OpenPkg6;
365
330
  /** Get an by its ID */
366
- getExport(id: string): SpecExport3 | undefined;
331
+ getExport(id: string): SpecExport2 | undefined;
367
332
  /** Get a type definition by its ID */
368
333
  getType(id: string): SpecType | undefined;
369
334
  /** Get all exports of a specific kind */
370
- getExportsByKind(kind: SpecExportKind4): SpecExport3[];
335
+ getExportsByKind(kind: SpecExportKind4): SpecExport2[];
371
336
  /** Get all exports */
372
- getAllExports(): SpecExport3[];
337
+ getAllExports(): SpecExport2[];
373
338
  /** Get all type definitions */
374
339
  getAllTypes(): SpecType[];
375
340
  /** Get exports by JSDoc tag (e.g., '@beta', '@internal') */
376
- getExportsByTag(tagName: string): SpecExport3[];
341
+ getExportsByTag(tagName: string): SpecExport2[];
377
342
  /** Search exports by name or description */
378
- search(query: string): SpecExport3[];
343
+ search(query: string): SpecExport2[];
379
344
  /** Get exports belonging to a specific module/namespace */
380
- getModule(moduleName: string): SpecExport3[];
345
+ getModule(moduleName: string): SpecExport2[];
381
346
  /** Get deprecated exports */
382
- getDeprecated(): SpecExport3[];
347
+ getDeprecated(): SpecExport2[];
383
348
  /** Get exports grouped by kind */
384
- groupByKind(): Record<SpecExportKind4, SpecExport3[]>;
349
+ groupByKind(): Record<SpecExportKind4, SpecExport2[]>;
385
350
  /** Render spec or single to an MDX string */
386
351
  toMarkdown(options?: ExportMarkdownOptions): string;
387
352
  /** Render spec or single to an HTML string */
@@ -397,7 +362,7 @@ interface DocsInstance {
397
362
  /** Generate Algolia-compatible record objects */
398
363
  toAlgoliaRecords(options?: SearchOptions): AlgoliaRecord[];
399
364
  }
400
- import { OpenPkg as OpenPkg8, SpecExport as SpecExport4, SpecMember as SpecMember2, SpecSchema, SpecSignature, SpecType as SpecType2, SpecTypeParameter } from "@openpkg-ts/spec";
365
+ import { OpenPkg as OpenPkg7, SpecExport as SpecExport3, SpecMember as SpecMember2, SpecSchema, SpecSignature, SpecType as SpecType2, SpecTypeParameter } from "@openpkg-ts/spec";
401
366
  interface FormatSchemaOptions {
402
367
  /** Include package attribution for external types */
403
368
  includePackage?: boolean;
@@ -482,7 +447,7 @@ declare function formatReturnType(sig?: SpecSignature): string;
482
447
  * // 'class Logger extends EventEmitter'
483
448
  * ```
484
449
  */
485
- declare function buildSignatureString(exp: SpecExport4, sigIndex?: number): string;
450
+ declare function buildSignatureString(exp: SpecExport3, sigIndex?: number): string;
486
451
  /**
487
452
  * Resolve a type reference to its definition.
488
453
  *
@@ -496,7 +461,7 @@ declare function buildSignatureString(exp: SpecExport4, sigIndex?: number): stri
496
461
  * // { id: 'User', name: 'User', kind: 'interface', ... }
497
462
  * ```
498
463
  */
499
- declare function resolveTypeRef(ref: string, spec: OpenPkg8): SpecType2 | undefined;
464
+ declare function resolveTypeRef(ref: string, spec: OpenPkg7): SpecType2 | undefined;
500
465
  /**
501
466
  * Check if a member is a method (has signatures).
502
467
  *
@@ -611,8 +576,8 @@ declare function formatConditionalType(condType: SpecConditionalType): string;
611
576
  * ```
612
577
  */
613
578
  declare function formatMappedType(mappedType: SpecMappedType): string;
614
- import { OpenPkg as OpenPkg9, SpecExport as SpecExport5, SpecExportKind as SpecExportKind6 } from "@openpkg-ts/spec";
615
- type Predicate = (exp: SpecExport5) => boolean;
579
+ import { OpenPkg as OpenPkg8, SpecExport as SpecExport4, SpecExportKind as SpecExportKind6 } from "@openpkg-ts/spec";
580
+ type Predicate = (exp: SpecExport4) => boolean;
616
581
  /**
617
582
  * Chainable query builder for filtering OpenPkg exports.
618
583
  * Filters are lazy - predicates only run on execution methods (find, first, count, etc).
@@ -620,7 +585,7 @@ type Predicate = (exp: SpecExport5) => boolean;
620
585
  declare class QueryBuilder {
621
586
  private spec;
622
587
  private predicates;
623
- constructor(spec: OpenPkg9);
588
+ constructor(spec: OpenPkg8);
624
589
  /**
625
590
  * Filter by kind(s)
626
591
  */
@@ -658,11 +623,11 @@ declare class QueryBuilder {
658
623
  /**
659
624
  * Execute query and return matching exports
660
625
  */
661
- find(): SpecExport5[];
626
+ find(): SpecExport4[];
662
627
  /**
663
628
  * Execute query and return first match (or undefined)
664
629
  */
665
- first(): SpecExport5 | undefined;
630
+ first(): SpecExport4 | undefined;
666
631
  /**
667
632
  * Execute query and return count of matches
668
633
  */
@@ -674,13 +639,13 @@ declare class QueryBuilder {
674
639
  /**
675
640
  * Execute query and return a new filtered OpenPkg spec
676
641
  */
677
- toSpec(): OpenPkg9;
642
+ toSpec(): OpenPkg8;
678
643
  }
679
644
  /**
680
645
  * Create a query builder for the given spec
681
646
  */
682
- declare function query(spec: OpenPkg9): QueryBuilder;
683
- import { OpenPkg as OpenPkg10, SpecExample, SpecExport as SpecExport6, SpecSchema as SpecSchema2, SpecSignatureParameter } from "@openpkg-ts/spec";
647
+ declare function query(spec: OpenPkg8): QueryBuilder;
648
+ import { OpenPkg as OpenPkg9, SpecExample, SpecExport as SpecExport5, SpecSchema as SpecSchema2, SpecSignatureParameter } from "@openpkg-ts/spec";
684
649
  interface CodeExample {
685
650
  /** Unique identifier */
686
651
  id: string;
@@ -722,5 +687,5 @@ declare function specParamToAPIParam(param: SpecSignatureParameter): {
722
687
  /** Convert spec examples to CodeExample[] (Shape B: id/label/code/language) */
723
688
  declare function specExamplesToCodeExamples(examples: (string | SpecExample)[] | undefined, defaultLang?: string): CodeExample[];
724
689
  declare function getLanguagesFromExamples(examples: (string | SpecExample)[] | undefined): Language[];
725
- declare function buildImportStatement(exp: SpecExport6, spec: OpenPkg10): string;
726
- export { toSearchIndexJSON, toSearchIndex2 as toSearchIndex, toPagefindRecords2 as toPagefindRecords, toAlgoliaRecords2 as toAlgoliaRecords, specSchemaToAPISchema, specParamToAPIParam, specExamplesToCodeExamples, sortByName, resolveTypeRef, query, isProperty, isMethod, hasDeprecatedTag, groupByVisibility, getProperties, getMethods, getMemberBadges, getLanguagesFromExamples, getLanguageLabel, getLangForHighlight, getDeprecationMessage, formatTypeParameters, formatSchema, formatReturnType, formatParameters, formatMappedType, formatConditionalType, formatBadges, findMissingParamDocs, buildSignatureString, buildImportStatement, analyzeSpec, SpecMappedType, SpecDiagnostics, SpecConditionalType, SearchRecord, SearchOptions, SearchIndex, QueryBuilder, PagefindRecord, LoadOptions, Language, FormatSchemaOptions, DocsInstance, DiagnosticItem, CodeExample, AlgoliaRecord, APIParameterSchema };
690
+ declare function buildImportStatement(exp: SpecExport5, spec: OpenPkg9): string;
691
+ export { toSearchIndexJSON, toSearchIndex2 as toSearchIndex, toPagefindRecords2 as toPagefindRecords, toAlgoliaRecords2 as toAlgoliaRecords, specSchemaToAPISchema, specParamToAPIParam, specExamplesToCodeExamples, sortByName, resolveTypeRef, query, isProperty, isMethod, groupByVisibility, getProperties, getMethods, getMemberBadges, getLanguagesFromExamples, getLanguageLabel, getLangForHighlight, formatTypeParameters, formatSchema, formatReturnType, formatParameters, formatMappedType, formatConditionalType, formatBadges, buildSignatureString, buildImportStatement, SpecMappedType, SpecConditionalType, SearchRecord, SearchOptions, SearchIndex, QueryBuilder, PagefindRecord, LoadOptions, Language, FormatSchemaOptions, DocsInstance, CodeExample, AlgoliaRecord, APIParameterSchema };
package/dist/browser.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import {
2
2
  QueryBuilder,
3
- analyzeSpec,
4
3
  buildSignatureString,
5
- findMissingParamDocs,
6
4
  formatBadges,
7
5
  formatConditionalType,
8
6
  formatMappedType,
@@ -10,12 +8,10 @@ import {
10
8
  formatReturnType,
11
9
  formatSchema,
12
10
  formatTypeParameters,
13
- getDeprecationMessage,
14
11
  getMemberBadges,
15
12
  getMethods,
16
13
  getProperties,
17
14
  groupByVisibility,
18
- hasDeprecatedTag,
19
15
  isMethod,
20
16
  isProperty,
21
17
  query,
@@ -25,7 +21,7 @@ import {
25
21
  toPagefindRecords,
26
22
  toSearchIndex,
27
23
  toSearchIndexJSON
28
- } from "./shared/chunk-zrx9s0n4.js";
24
+ } from "./shared/chunk-7287tqkx.js";
29
25
  // src/core/spec-converters.ts
30
26
  function getLangForHighlight(lang) {
31
27
  const langMap = {
@@ -145,7 +141,6 @@ export {
145
141
  query,
146
142
  isProperty,
147
143
  isMethod,
148
- hasDeprecatedTag,
149
144
  groupByVisibility,
150
145
  getProperties,
151
146
  getMethods,
@@ -153,7 +148,6 @@ export {
153
148
  getLanguagesFromExamples,
154
149
  getLanguageLabel,
155
150
  getLangForHighlight,
156
- getDeprecationMessage,
157
151
  formatTypeParameters,
158
152
  formatSchema,
159
153
  formatReturnType,
@@ -161,9 +155,7 @@ export {
161
155
  formatMappedType,
162
156
  formatConditionalType,
163
157
  formatBadges,
164
- findMissingParamDocs,
165
158
  buildSignatureString,
166
159
  buildImportStatement,
167
- analyzeSpec,
168
160
  QueryBuilder
169
161
  };