@doccov/sdk 0.25.4 → 0.25.7
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/analysis/index.d.ts +42 -42
- package/dist/analysis/index.js +1 -1
- package/dist/index.d.ts +148 -172
- package/dist/index.js +397 -3533
- package/dist/shared/{chunk-e9mvnrys.js → chunk-03yx6qfs.js} +1 -16
- package/package.json +2 -2
package/dist/analysis/index.d.ts
CHANGED
|
@@ -240,48 +240,6 @@ declare function hasNonAssertionComments(code: string): boolean;
|
|
|
240
240
|
* Detect assertion failures by comparing stdout to expected values.
|
|
241
241
|
*/
|
|
242
242
|
declare function detectExampleAssertionFailures(entry: SpecExport2, runtimeResults: Map<number, ExampleRunResult>): SpecDocDrift[];
|
|
243
|
-
import { DocCovDrift, DocCovSpec as DocCovSpec2, ExportAnalysis, MissingDocRule } from "@doccov/spec";
|
|
244
|
-
import { SpecExport as SpecExport7 } from "@openpkg-ts/spec";
|
|
245
|
-
/**
|
|
246
|
-
* Get the full analysis data for an export.
|
|
247
|
-
*
|
|
248
|
-
* @param exp - The to look up
|
|
249
|
-
* @param doccov - The DocCov spec containing analysis data
|
|
250
|
-
* @returns Export analysis or undefined if not found
|
|
251
|
-
*/
|
|
252
|
-
declare function getExportAnalysis(exp: SpecExport7, doccov: DocCovSpec2): ExportAnalysis | undefined;
|
|
253
|
-
/**
|
|
254
|
-
* Get the coverage score for an export.
|
|
255
|
-
*
|
|
256
|
-
* @param exp - The to look up
|
|
257
|
-
* @param doccov - The DocCov spec containing analysis data
|
|
258
|
-
* @returns Coverage score (0-100) or 100 if not found
|
|
259
|
-
*/
|
|
260
|
-
declare function getExportScore(exp: SpecExport7, doccov: DocCovSpec2): number;
|
|
261
|
-
/**
|
|
262
|
-
* Get drift issues for an export.
|
|
263
|
-
*
|
|
264
|
-
* @param exp - The to look up
|
|
265
|
-
* @param doccov - The DocCov spec containing analysis data
|
|
266
|
-
* @returns Array of drift issues or empty array if none
|
|
267
|
-
*/
|
|
268
|
-
declare function getExportDrift(exp: SpecExport7, doccov: DocCovSpec2): DocCovDrift[];
|
|
269
|
-
/**
|
|
270
|
-
* Get missing documentation rules for an export.
|
|
271
|
-
*
|
|
272
|
-
* @param exp - The to look up
|
|
273
|
-
* @param doccov - The DocCov spec containing analysis data
|
|
274
|
-
* @returns Array of missing rule IDs or empty array if none
|
|
275
|
-
*/
|
|
276
|
-
declare function getExportMissing(exp: SpecExport7, doccov: DocCovSpec2): MissingDocRule[];
|
|
277
|
-
/**
|
|
278
|
-
* Check if an has complete documentation.
|
|
279
|
-
*
|
|
280
|
-
* @param exp - The to check
|
|
281
|
-
* @param doccov - The DocCov spec containing analysis data
|
|
282
|
-
* @returns True if has 100% coverage and no drift
|
|
283
|
-
*/
|
|
284
|
-
declare function isExportFullyDocumented(exp: SpecExport7, doccov: DocCovSpec2): boolean;
|
|
285
243
|
import { OpenPkg as OpenPkg2 } from "@openpkg-ts/spec";
|
|
286
244
|
/** Directory for storing history snapshots */
|
|
287
245
|
declare const HISTORY_DIR = ".doccov/history";
|
|
@@ -465,6 +423,48 @@ declare function getExtendedTrend(spec: OpenPkg2, cwd: string, options?: {
|
|
|
465
423
|
branch?: string;
|
|
466
424
|
tier?: RetentionTier;
|
|
467
425
|
}): ExtendedTrendAnalysis;
|
|
426
|
+
import { DocCovDrift, DocCovSpec as DocCovSpec2, ExportAnalysis, MissingDocRule } from "@doccov/spec";
|
|
427
|
+
import { SpecExport as SpecExport7 } from "@openpkg-ts/spec";
|
|
428
|
+
/**
|
|
429
|
+
* Get the full analysis data for an export.
|
|
430
|
+
*
|
|
431
|
+
* @param exp - The to look up
|
|
432
|
+
* @param doccov - The DocCov spec containing analysis data
|
|
433
|
+
* @returns Export analysis or undefined if not found
|
|
434
|
+
*/
|
|
435
|
+
declare function getExportAnalysis(exp: SpecExport7, doccov: DocCovSpec2): ExportAnalysis | undefined;
|
|
436
|
+
/**
|
|
437
|
+
* Get the coverage score for an export.
|
|
438
|
+
*
|
|
439
|
+
* @param exp - The to look up
|
|
440
|
+
* @param doccov - The DocCov spec containing analysis data
|
|
441
|
+
* @returns Coverage score (0-100) or 100 if not found
|
|
442
|
+
*/
|
|
443
|
+
declare function getExportScore(exp: SpecExport7, doccov: DocCovSpec2): number;
|
|
444
|
+
/**
|
|
445
|
+
* Get drift issues for an export.
|
|
446
|
+
*
|
|
447
|
+
* @param exp - The to look up
|
|
448
|
+
* @param doccov - The DocCov spec containing analysis data
|
|
449
|
+
* @returns Array of drift issues or empty array if none
|
|
450
|
+
*/
|
|
451
|
+
declare function getExportDrift(exp: SpecExport7, doccov: DocCovSpec2): DocCovDrift[];
|
|
452
|
+
/**
|
|
453
|
+
* Get missing documentation rules for an export.
|
|
454
|
+
*
|
|
455
|
+
* @param exp - The to look up
|
|
456
|
+
* @param doccov - The DocCov spec containing analysis data
|
|
457
|
+
* @returns Array of missing rule IDs or empty array if none
|
|
458
|
+
*/
|
|
459
|
+
declare function getExportMissing(exp: SpecExport7, doccov: DocCovSpec2): MissingDocRule[];
|
|
460
|
+
/**
|
|
461
|
+
* Check if an has complete documentation.
|
|
462
|
+
*
|
|
463
|
+
* @param exp - The to check
|
|
464
|
+
* @param doccov - The DocCov spec containing analysis data
|
|
465
|
+
* @returns True if has 100% coverage and no drift
|
|
466
|
+
*/
|
|
467
|
+
declare function isExportFullyDocumented(exp: SpecExport7, doccov: DocCovSpec2): boolean;
|
|
468
468
|
import { DocCovSpec as DocCovSpec3 } from "@doccov/spec";
|
|
469
469
|
import { OpenPkg as OpenPkg3 } from "@openpkg-ts/spec";
|
|
470
470
|
/**
|
package/dist/analysis/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -569,144 +569,6 @@ declare function saveReport(report: DocCovReport, reportPath?: string): void;
|
|
|
569
569
|
* ```
|
|
570
570
|
*/
|
|
571
571
|
declare function renderApiSurface(spec: OpenPkg2): string;
|
|
572
|
-
import { EntryPointDetectionMethod } from "@openpkg-ts/spec";
|
|
573
|
-
/**
|
|
574
|
-
* Configuration types for DocCov.
|
|
575
|
-
* These types are shared between CLI and API.
|
|
576
|
-
*/
|
|
577
|
-
/**
|
|
578
|
-
* Documentation configuration options.
|
|
579
|
-
*/
|
|
580
|
-
interface DocsConfig {
|
|
581
|
-
/** Glob patterns for markdown docs to include */
|
|
582
|
-
include?: string[];
|
|
583
|
-
/** Glob patterns for markdown docs to exclude */
|
|
584
|
-
exclude?: string[];
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* Example validation modes.
|
|
588
|
-
*/
|
|
589
|
-
type ExampleValidationMode = "presence" | "typecheck" | "run";
|
|
590
|
-
/**
|
|
591
|
-
* Schema extraction modes for validation libraries (Zod, Valibot, TypeBox, ArkType).
|
|
592
|
-
*
|
|
593
|
-
* - 'static': TypeScript Compiler API only (no runtime, always safe)
|
|
594
|
-
* - 'runtime': Standard Schema runtime extraction (requires built package)
|
|
595
|
-
* - 'hybrid': Try runtime first, fall back to static
|
|
596
|
-
*/
|
|
597
|
-
type SchemaExtractionMode = "static" | "runtime" | "hybrid";
|
|
598
|
-
/**
|
|
599
|
-
* Check command configuration options.
|
|
600
|
-
*/
|
|
601
|
-
interface CheckConfig {
|
|
602
|
-
/**
|
|
603
|
-
* Example validation modes to run.
|
|
604
|
-
* Can be a single mode, array of modes, or comma-separated string.
|
|
605
|
-
* - 'presence': Check that @example blocks exist on exports
|
|
606
|
-
* - 'typecheck': Compile examples with TypeScript
|
|
607
|
-
* - 'run': Execute examples and validate assertions
|
|
608
|
-
*/
|
|
609
|
-
examples?: ExampleValidationMode | ExampleValidationMode[] | string;
|
|
610
|
-
/** Minimum coverage percentage required (0-100) */
|
|
611
|
-
minCoverage?: number;
|
|
612
|
-
/** Maximum drift percentage allowed (0-100) */
|
|
613
|
-
maxDrift?: number;
|
|
614
|
-
}
|
|
615
|
-
/**
|
|
616
|
-
* Normalized DocCov configuration.
|
|
617
|
-
* This is the parsed/normalized form used by commands.
|
|
618
|
-
*/
|
|
619
|
-
interface DocCovConfig {
|
|
620
|
-
/** Export include patterns */
|
|
621
|
-
include?: string[];
|
|
622
|
-
/** Export exclude patterns */
|
|
623
|
-
exclude?: string[];
|
|
624
|
-
/** Plugins (future) */
|
|
625
|
-
plugins?: unknown[];
|
|
626
|
-
/** Documentation configuration */
|
|
627
|
-
docs?: DocsConfig;
|
|
628
|
-
/** Check command configuration */
|
|
629
|
-
check?: CheckConfig;
|
|
630
|
-
/**
|
|
631
|
-
* Schema extraction mode for validation libraries.
|
|
632
|
-
*
|
|
633
|
-
* - 'static' (default): Safe, uses TypeScript Compiler API
|
|
634
|
-
* - 'runtime': Uses Standard Schema (requires built package)
|
|
635
|
-
* - 'hybrid': Tries runtime first, falls back to static
|
|
636
|
-
*
|
|
637
|
-
* Runtime extraction provides richer JSON Schema output (formats, patterns)
|
|
638
|
-
* but requires the package to be built first.
|
|
639
|
-
*/
|
|
640
|
-
schemaExtraction?: SchemaExtractionMode;
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* Define a DocCov configuration.
|
|
644
|
-
* Helper function for type-safe configuration in doccov.config.ts.
|
|
645
|
-
*
|
|
646
|
-
* @param config - Configuration object
|
|
647
|
-
* @returns The configuration object (for type inference)
|
|
648
|
-
*
|
|
649
|
-
* @example
|
|
650
|
-
* ```typescript
|
|
651
|
-
* // doccov.config.ts
|
|
652
|
-
* import { defineConfig } from '@doccov/sdk';
|
|
653
|
-
*
|
|
654
|
-
* defineConfig({
|
|
655
|
-
* include: ['MyClass', 'myFunction'],
|
|
656
|
-
* exclude: ['internal*'],
|
|
657
|
-
* check: {
|
|
658
|
-
* minCoverage: 80,
|
|
659
|
-
* },
|
|
660
|
-
* });
|
|
661
|
-
* ```
|
|
662
|
-
*/
|
|
663
|
-
declare function defineConfig(config: DocCovConfig): DocCovConfig;
|
|
664
|
-
interface DocCovOptions {
|
|
665
|
-
includePrivate?: boolean;
|
|
666
|
-
followImports?: boolean;
|
|
667
|
-
maxDepth?: number;
|
|
668
|
-
resolveExternalTypes?: boolean;
|
|
669
|
-
/** Enable spec caching (default: true) */
|
|
670
|
-
useCache?: boolean;
|
|
671
|
-
/** Working directory for cache operations (default: process.cwd()) */
|
|
672
|
-
cwd?: string;
|
|
673
|
-
/**
|
|
674
|
-
* Schema extraction mode for validation libraries (Zod, Valibot, etc.)
|
|
675
|
-
*
|
|
676
|
-
* - 'static' (default): TypeScript Compiler API only (no runtime)
|
|
677
|
-
* - 'runtime': Standard Schema runtime extraction (requires built package)
|
|
678
|
-
* - 'hybrid': Try runtime first, fall back to static
|
|
679
|
-
*/
|
|
680
|
-
schemaExtraction?: SchemaExtractionMode;
|
|
681
|
-
}
|
|
682
|
-
/**
|
|
683
|
-
* Pre-detected Standard Schema for a variable export.
|
|
684
|
-
*/
|
|
685
|
-
interface DetectedSchemaEntry {
|
|
686
|
-
schema: Record<string, unknown>;
|
|
687
|
-
vendor: string;
|
|
688
|
-
}
|
|
689
|
-
/**
|
|
690
|
-
* Input for generation metadata that comes from the caller (CLI, API, etc.)
|
|
691
|
-
*/
|
|
692
|
-
interface GenerationInput {
|
|
693
|
-
/** Entry point file path (relative to package root) */
|
|
694
|
-
entryPoint: string;
|
|
695
|
-
/** How the entry point was detected */
|
|
696
|
-
entryPointSource: EntryPointDetectionMethod;
|
|
697
|
-
/** Whether this is a declaration-only analysis (.d.ts file) */
|
|
698
|
-
isDeclarationOnly?: boolean;
|
|
699
|
-
/** Generator tool name */
|
|
700
|
-
generatorName: string;
|
|
701
|
-
/** Generator tool version */
|
|
702
|
-
generatorVersion: string;
|
|
703
|
-
/** Detected package manager */
|
|
704
|
-
packageManager?: string;
|
|
705
|
-
/** Whether this is a monorepo */
|
|
706
|
-
isMonorepo?: boolean;
|
|
707
|
-
/** Target package name (for monorepos) */
|
|
708
|
-
targetPackage?: string;
|
|
709
|
-
}
|
|
710
572
|
/**
|
|
711
573
|
* Compute a hash of file contents.
|
|
712
574
|
* Uses truncated SHA-256 for balance of speed and collision resistance.
|
|
@@ -860,7 +722,116 @@ interface FilterOptions {
|
|
|
860
722
|
/** Filter by visibility/release stage (e.g., ['public', 'beta']) */
|
|
861
723
|
visibility?: ReleaseTag[];
|
|
862
724
|
}
|
|
863
|
-
|
|
725
|
+
/**
|
|
726
|
+
* Configuration types for DocCov.
|
|
727
|
+
* These types are shared between CLI and API.
|
|
728
|
+
*/
|
|
729
|
+
/**
|
|
730
|
+
* Documentation configuration options.
|
|
731
|
+
*/
|
|
732
|
+
interface DocsConfig {
|
|
733
|
+
/** Glob patterns for markdown docs to include */
|
|
734
|
+
include?: string[];
|
|
735
|
+
/** Glob patterns for markdown docs to exclude */
|
|
736
|
+
exclude?: string[];
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Example validation modes.
|
|
740
|
+
*/
|
|
741
|
+
type ExampleValidationMode = "presence" | "typecheck" | "run";
|
|
742
|
+
/**
|
|
743
|
+
* Schema extraction modes for validation libraries (Zod, Valibot, TypeBox, ArkType).
|
|
744
|
+
*
|
|
745
|
+
* - 'static': TypeScript Compiler API only (no runtime, always safe)
|
|
746
|
+
* - 'runtime': Standard Schema runtime extraction (requires built package)
|
|
747
|
+
* - 'hybrid': Try runtime first, fall back to static
|
|
748
|
+
*/
|
|
749
|
+
type SchemaExtractionMode = "static" | "runtime" | "hybrid";
|
|
750
|
+
/**
|
|
751
|
+
* Check command configuration options.
|
|
752
|
+
*/
|
|
753
|
+
interface CheckConfig {
|
|
754
|
+
/**
|
|
755
|
+
* Example validation modes to run.
|
|
756
|
+
* Can be a single mode, array of modes, or comma-separated string.
|
|
757
|
+
* - 'presence': Check that @example blocks exist on exports
|
|
758
|
+
* - 'typecheck': Compile examples with TypeScript
|
|
759
|
+
* - 'run': Execute examples and validate assertions
|
|
760
|
+
*/
|
|
761
|
+
examples?: ExampleValidationMode | ExampleValidationMode[] | string;
|
|
762
|
+
/** Minimum coverage percentage required (0-100) */
|
|
763
|
+
minCoverage?: number;
|
|
764
|
+
/** Maximum drift percentage allowed (0-100) */
|
|
765
|
+
maxDrift?: number;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Normalized DocCov configuration.
|
|
769
|
+
* This is the parsed/normalized form used by commands.
|
|
770
|
+
*/
|
|
771
|
+
interface DocCovConfig {
|
|
772
|
+
/** Export include patterns */
|
|
773
|
+
include?: string[];
|
|
774
|
+
/** Export exclude patterns */
|
|
775
|
+
exclude?: string[];
|
|
776
|
+
/** Plugins (future) */
|
|
777
|
+
plugins?: unknown[];
|
|
778
|
+
/** Documentation configuration */
|
|
779
|
+
docs?: DocsConfig;
|
|
780
|
+
/** Check command configuration */
|
|
781
|
+
check?: CheckConfig;
|
|
782
|
+
/**
|
|
783
|
+
* Schema extraction mode for validation libraries.
|
|
784
|
+
*
|
|
785
|
+
* - 'static' (default): Safe, uses TypeScript Compiler API
|
|
786
|
+
* - 'runtime': Uses Standard Schema (requires built package)
|
|
787
|
+
* - 'hybrid': Tries runtime first, falls back to static
|
|
788
|
+
*
|
|
789
|
+
* Runtime extraction provides richer JSON Schema output (formats, patterns)
|
|
790
|
+
* but requires the package to be built first.
|
|
791
|
+
*/
|
|
792
|
+
schemaExtraction?: SchemaExtractionMode;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Define a DocCov configuration.
|
|
796
|
+
* Helper function for type-safe configuration in doccov.config.ts.
|
|
797
|
+
*
|
|
798
|
+
* @param config - Configuration object
|
|
799
|
+
* @returns The configuration object (for type inference)
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```typescript
|
|
803
|
+
* // doccov.config.ts
|
|
804
|
+
* import { defineConfig } from '@doccov/sdk';
|
|
805
|
+
*
|
|
806
|
+
* defineConfig({
|
|
807
|
+
* include: ['MyClass', 'myFunction'],
|
|
808
|
+
* exclude: ['internal*'],
|
|
809
|
+
* check: {
|
|
810
|
+
* minCoverage: 80,
|
|
811
|
+
* },
|
|
812
|
+
* });
|
|
813
|
+
* ```
|
|
814
|
+
*/
|
|
815
|
+
declare function defineConfig(config: DocCovConfig): DocCovConfig;
|
|
816
|
+
interface DocCovOptions {
|
|
817
|
+
includePrivate?: boolean;
|
|
818
|
+
followImports?: boolean;
|
|
819
|
+
maxDepth?: number;
|
|
820
|
+
resolveExternalTypes?: boolean;
|
|
821
|
+
/** Enable spec caching (default: true) */
|
|
822
|
+
useCache?: boolean;
|
|
823
|
+
/** Working directory for cache operations (default: process.cwd()) */
|
|
824
|
+
cwd?: string;
|
|
825
|
+
/**
|
|
826
|
+
* Schema extraction mode for validation libraries (Zod, Valibot, etc.)
|
|
827
|
+
*
|
|
828
|
+
* - 'static' (default): TypeScript Compiler API only (no runtime)
|
|
829
|
+
* - 'runtime': Standard Schema runtime extraction (requires built package)
|
|
830
|
+
* - 'hybrid': Try runtime first, fall back to static
|
|
831
|
+
*/
|
|
832
|
+
schemaExtraction?: SchemaExtractionMode;
|
|
833
|
+
}
|
|
834
|
+
interface Diagnostic {
|
|
864
835
|
message: string;
|
|
865
836
|
severity: "error" | "warning" | "info";
|
|
866
837
|
suggestion?: string;
|
|
@@ -872,7 +843,7 @@ interface Diagnostic2 {
|
|
|
872
843
|
}
|
|
873
844
|
interface AnalysisResult {
|
|
874
845
|
spec: OpenPkgSpec;
|
|
875
|
-
diagnostics:
|
|
846
|
+
diagnostics: Diagnostic[];
|
|
876
847
|
metadata: AnalysisMetadata;
|
|
877
848
|
/** True if result came from cache (no fresh analysis) */
|
|
878
849
|
fromCache?: boolean;
|
|
@@ -890,8 +861,6 @@ interface AnalysisMetadata {
|
|
|
890
861
|
}
|
|
891
862
|
interface AnalyzeOptions {
|
|
892
863
|
filters?: FilterOptions;
|
|
893
|
-
/** Generation metadata input (entry point info, tool version, etc.) */
|
|
894
|
-
generationInput?: GenerationInput;
|
|
895
864
|
}
|
|
896
865
|
declare class DocCov {
|
|
897
866
|
private readonly options;
|
|
@@ -1403,7 +1372,7 @@ interface ExampleValidationResult {
|
|
|
1403
1372
|
*/
|
|
1404
1373
|
declare function validateExamples(exports: SpecExport8[], options: ExampleValidationOptions): Promise<ExampleValidationResult>;
|
|
1405
1374
|
import { SpecExport as SpecExport9 } from "@openpkg-ts/spec";
|
|
1406
|
-
import * as
|
|
1375
|
+
import * as TS from "typescript";
|
|
1407
1376
|
/**
|
|
1408
1377
|
* Represents a single parameter in a JSDoc patch
|
|
1409
1378
|
*/
|
|
@@ -1484,7 +1453,7 @@ declare function serializeJSDoc(patch: JSDocPatch, indent?: string): string;
|
|
|
1484
1453
|
/**
|
|
1485
1454
|
* Find the JSDoc location for a declaration in a source file
|
|
1486
1455
|
*/
|
|
1487
|
-
declare function findJSDocLocation(sourceFile:
|
|
1456
|
+
declare function findJSDocLocation(sourceFile: TS.SourceFile, symbolName: string, approximateLine?: number): {
|
|
1488
1457
|
startLine: number;
|
|
1489
1458
|
endLine: number;
|
|
1490
1459
|
declarationLine: number;
|
|
@@ -1499,7 +1468,7 @@ declare function applyEdits(edits: JSDocEdit[]): Promise<ApplyEditsResult>;
|
|
|
1499
1468
|
/**
|
|
1500
1469
|
* Create a TypeScript source file from a file path
|
|
1501
1470
|
*/
|
|
1502
|
-
declare function createSourceFile(filePath: string):
|
|
1471
|
+
declare function createSourceFile(filePath: string): TS.SourceFile;
|
|
1503
1472
|
/**
|
|
1504
1473
|
* Types of fixes that can be generated
|
|
1505
1474
|
*/
|
|
@@ -1697,6 +1666,19 @@ declare function getDocumentedExports(markdownFiles: MarkdownDocFile[], exportNa
|
|
|
1697
1666
|
* Get all exports that lack documentation
|
|
1698
1667
|
*/
|
|
1699
1668
|
declare function getUndocumentedExports(markdownFiles: MarkdownDocFile[], exportNames: string[]): string[];
|
|
1669
|
+
/**
|
|
1670
|
+
* Extract import statements from code (legacy interface).
|
|
1671
|
+
* @deprecated Use extractImportsAST for more detailed info.
|
|
1672
|
+
*/
|
|
1673
|
+
declare function extractImports(code: string): Array<{
|
|
1674
|
+
name: string;
|
|
1675
|
+
from: string;
|
|
1676
|
+
}>;
|
|
1677
|
+
/**
|
|
1678
|
+
* Extract function calls from code (legacy interface).
|
|
1679
|
+
* @deprecated Use extractCallsAST for more detailed info.
|
|
1680
|
+
*/
|
|
1681
|
+
declare function extractFunctionCalls(code: string): string[];
|
|
1700
1682
|
import { CategorizedBreaking, OpenPkg as OpenPkg5, SpecDiff as SpecDiff2 } from "@openpkg-ts/spec";
|
|
1701
1683
|
/**
|
|
1702
1684
|
* Extended spec diff result with docs impact
|
|
@@ -1758,19 +1740,6 @@ declare function getDocsImpactSummary(diff: SpecDiffWithDocs): {
|
|
|
1758
1740
|
totalIssues: number;
|
|
1759
1741
|
memberChangesCount: number;
|
|
1760
1742
|
};
|
|
1761
|
-
/**
|
|
1762
|
-
* Extract import statements from code (legacy interface).
|
|
1763
|
-
* @deprecated Use extractImportsAST for more detailed info.
|
|
1764
|
-
*/
|
|
1765
|
-
declare function extractImports(code: string): Array<{
|
|
1766
|
-
name: string;
|
|
1767
|
-
from: string;
|
|
1768
|
-
}>;
|
|
1769
|
-
/**
|
|
1770
|
-
* Extract function calls from code (legacy interface).
|
|
1771
|
-
* @deprecated Use extractCallsAST for more detailed info.
|
|
1772
|
-
*/
|
|
1773
|
-
declare function extractFunctionCalls(code: string): string[];
|
|
1774
1743
|
/** Options for parsing markdown files */
|
|
1775
1744
|
interface ParseOptions {
|
|
1776
1745
|
/** Custom set of executable language tags */
|
|
@@ -1807,6 +1776,13 @@ declare function typecheckExample(example: string, packagePath: string, options?
|
|
|
1807
1776
|
* Type-check multiple examples
|
|
1808
1777
|
*/
|
|
1809
1778
|
declare function typecheckExamples(examples: string[], packagePath: string, options?: TypecheckOptions): TypecheckResult;
|
|
1779
|
+
/**
|
|
1780
|
+
* Pre-detected Standard Schema for a variable export.
|
|
1781
|
+
*/
|
|
1782
|
+
interface DetectedSchemaEntry {
|
|
1783
|
+
schema: Record<string, unknown>;
|
|
1784
|
+
vendor: string;
|
|
1785
|
+
}
|
|
1810
1786
|
import { OpenPkg as OpenPkg6 } from "@openpkg-ts/spec";
|
|
1811
1787
|
/** Directory for storing history snapshots */
|
|
1812
1788
|
declare const HISTORY_DIR = ".doccov/history";
|
|
@@ -1990,7 +1966,7 @@ interface SchemaDetectionResult {
|
|
|
1990
1966
|
noCompiledJsWarning?: boolean;
|
|
1991
1967
|
}
|
|
1992
1968
|
declare function detectRuntimeSchemas(context: SchemaDetectionContext): Promise<SchemaDetectionResult>;
|
|
1993
|
-
import * as
|
|
1969
|
+
import * as TS2 from "typescript";
|
|
1994
1970
|
/**
|
|
1995
1971
|
* A schema adapter can detect and extract output types from a specific
|
|
1996
1972
|
* schema validation library.
|
|
@@ -2004,17 +1980,17 @@ interface SchemaAdapter {
|
|
|
2004
1980
|
* Check if a type matches this adapter's schema library.
|
|
2005
1981
|
* Should be fast - called for every export.
|
|
2006
1982
|
*/
|
|
2007
|
-
matches(type:
|
|
1983
|
+
matches(type: TS2.Type, checker: TS2.TypeChecker): boolean;
|
|
2008
1984
|
/**
|
|
2009
1985
|
* Extract the output type from a schema type.
|
|
2010
1986
|
* Returns null if extraction fails.
|
|
2011
1987
|
*/
|
|
2012
|
-
extractOutputType(type:
|
|
1988
|
+
extractOutputType(type: TS2.Type, checker: TS2.TypeChecker): TS2.Type | null;
|
|
2013
1989
|
/**
|
|
2014
1990
|
* Extract the input type from a schema type (optional).
|
|
2015
1991
|
* Useful for transforms where input differs from output.
|
|
2016
1992
|
*/
|
|
2017
|
-
extractInputType?(type:
|
|
1993
|
+
extractInputType?(type: TS2.Type, checker: TS2.TypeChecker): TS2.Type | null;
|
|
2018
1994
|
}
|
|
2019
1995
|
/**
|
|
2020
1996
|
* Result of schema type extraction
|
|
@@ -2023,32 +1999,32 @@ interface SchemaExtractionResult {
|
|
|
2023
1999
|
/** The adapter that matched */
|
|
2024
2000
|
adapter: SchemaAdapter;
|
|
2025
2001
|
/** The extracted output type */
|
|
2026
|
-
outputType:
|
|
2002
|
+
outputType: TS2.Type;
|
|
2027
2003
|
/** The extracted input type (if different from output) */
|
|
2028
|
-
inputType?:
|
|
2004
|
+
inputType?: TS2.Type;
|
|
2029
2005
|
}
|
|
2030
|
-
import * as
|
|
2006
|
+
import * as TS3 from "typescript";
|
|
2031
2007
|
/**
|
|
2032
2008
|
* Find an adapter that matches the given type.
|
|
2033
2009
|
* Returns null if no adapter matches.
|
|
2034
2010
|
*/
|
|
2035
|
-
declare function findAdapter(type:
|
|
2011
|
+
declare function findAdapter(type: TS3.Type, checker: TS3.TypeChecker): SchemaAdapter | null;
|
|
2036
2012
|
/**
|
|
2037
2013
|
* Check if a type is from a recognized schema library.
|
|
2038
2014
|
*/
|
|
2039
|
-
declare function isSchemaType(type:
|
|
2015
|
+
declare function isSchemaType(type: TS3.Type, checker: TS3.TypeChecker): boolean;
|
|
2040
2016
|
/**
|
|
2041
2017
|
* Extract the output type from a schema type.
|
|
2042
2018
|
* Returns null if:
|
|
2043
2019
|
* - The type is not from a recognized schema library
|
|
2044
2020
|
* - The adapter fails to extract the output type
|
|
2045
2021
|
*/
|
|
2046
|
-
declare function extractSchemaOutputType(type:
|
|
2022
|
+
declare function extractSchemaOutputType(type: TS3.Type, checker: TS3.TypeChecker): TS3.Type | null;
|
|
2047
2023
|
/**
|
|
2048
2024
|
* Full extraction with adapter info.
|
|
2049
2025
|
* Useful when you need to know which library was detected.
|
|
2050
2026
|
*/
|
|
2051
|
-
declare function extractSchemaType(type:
|
|
2027
|
+
declare function extractSchemaType(type: TS3.Type, checker: TS3.TypeChecker): SchemaExtractionResult | null;
|
|
2052
2028
|
/**
|
|
2053
2029
|
* Get all registered adapters.
|
|
2054
2030
|
* Useful for logging/debugging.
|
|
@@ -2539,7 +2515,7 @@ interface SpecSummary {
|
|
|
2539
2515
|
* ```
|
|
2540
2516
|
*/
|
|
2541
2517
|
declare function extractSpecSummary(openpkg: OpenPkg8, doccov: DocCovSpec4): SpecSummary;
|
|
2542
|
-
import { OpenPkg as
|
|
2518
|
+
import { OpenPkg as OpenPkg_pdwketyesh } from "@openpkg-ts/spec";
|
|
2543
2519
|
/**
|
|
2544
2520
|
* Build Plan types for AI-powered repository scanning.
|
|
2545
2521
|
*/
|
|
@@ -2636,7 +2612,7 @@ interface BuildPlanExecutionResult {
|
|
|
2636
2612
|
/** Whether all required steps succeeded */
|
|
2637
2613
|
success: boolean;
|
|
2638
2614
|
/** Generated OpenPkg spec (if successful) */
|
|
2639
|
-
spec?:
|
|
2615
|
+
spec?: OpenPkg_pdwketyesh;
|
|
2640
2616
|
/** Results for each step */
|
|
2641
2617
|
stepResults: BuildPlanStepResult[];
|
|
2642
2618
|
/** Total execution time in milliseconds */
|
|
@@ -2644,4 +2620,4 @@ interface BuildPlanExecutionResult {
|
|
|
2644
2620
|
/** Overall error message if failed */
|
|
2645
2621
|
error?: string;
|
|
2646
2622
|
}
|
|
2647
|
-
export { validateSpecCache, validateExamples, typecheckExamples, typecheckExample, shouldValidate, serializeJSDoc, saveSpecCache, saveSnapshot, saveReport, safeParseJson, runExamplesWithPackage, runExamples, runExample, resolveTarget, resolveCompiledPath, renderSparkline, renderApiSurface, readPackageJson, pruneHistory, pruneByTier, parseGitHubUrl2 as parseScanGitHubUrl, parseMarkdownFiles, parseMarkdownFile, parseListFlag, parseJSDocToPatch, parseGitHubUrl, parseExamplesFlag, parseAssertions, mergeFixes, mergeFilters, loadSpecCache, loadSnapshots, loadCachedReport, listWorkspacePackages, isStandardJSONSchema, isSchemaType, isFixableDrift, isExportFullyDocumented, isExecutableLang, installDependencies, hashString, hashFiles, hashFile, hasNonAssertionComments, hasDocsImpact, hasDocsForExport, groupDriftsByCategory, getUndocumentedExports, getTrend, getSupportedLibraries, getSpecCachePath, getRunCommand, getReportPath, getRegisteredAdapters, getPrimaryBuildScript, getInstallCommand, getExtendedTrend, getExportScore, getExportMissing, getExportDrift, getExportAnalysis, getDriftSummary, getDocumentedExports, getDocsImpactSummary, getDiffReportPath, generateReportFromDocCov, generateReport, generateFixesForExport, generateFix, formatPackageList, formatDriftSummaryLine, formatDelta, findRemovedReferences, findPackageByName, findJSDocLocation, findExportReferences, findDeprecatedReferences, findAdapter, fetchSpecFromGitHub, fetchSpec, fetchGitHubContext, extractStandardSchemasFromProject, extractStandardSchemas, extractSpecSummary, extractSchemaType, extractSchemaOutputType, extractPackageSpec, extractImports, extractFunctionCalls, ensureSpecCoverage, diffSpecWithDocs, diffHashes, detectRuntimeSchemas, detectPackageManager, detectMonorepo, detectExampleRuntimeErrors, detectExampleAssertionFailures, detectEntryPoint, detectBuildInfo, defineConfig, createSourceFile, createNodeCommandRunner, computeSnapshot, computeExportDrift, computeDrift, clearSpecCache, categorizeDrifts, categorizeDrift, calculateAggregateCoverage, buildRawUrl, buildExportRegistry, buildDocCovSpec, buildDisplayUrl, buildCloneUrl, blockReferencesExport, applyPatchToJSDoc, applyEdits, analyzeProject2 as analyzeProject, analyzeFile, analyzeDocsImpact, analyze, WorkspacePackage, WorkspaceConfig, VALIDATION_INFO, TypecheckValidationResult, TypecheckResult, TypecheckOptions, SummaryDriftIssue, StandardSchemaExtractionResult, StandardSchemaExtractionOutput, StandardJSONSchemaV1, SpecSummary, SpecDocDrift, SpecDiffWithDocs, SpecCacheConfig, SpecCache, SchemaExtractionResult, SchemaExtractionMode, SchemaDetectionResult, SchemaDetectionContext, SchemaAdapter, SandboxFileSystem, SPEC_CACHE_FILE, RuntimeDrift, RunValidationResult, RunExamplesWithPackageResult, RunExamplesWithPackageOptions, RunExampleOptions, RetentionTier, ResolvedTarget, ResolvedFilters, ResolveTargetOptions, ReleaseTag, RETENTION_DAYS, REPORT_VERSION, REPORT_EXTENSIONS, ProjectInfo, PresenceResult, ParsedGitHubUrl, PackageManagerInfo, PackageManager, PackageJson, PackageExports, OpenPkgSpec, NodeFileSystem, MonorepoType, MonorepoInfo, MemberChange, MarkdownDocFile, MarkdownCodeBlock, LLMAssertion, JSDocTag, JSDocReturn, JSDocPatch, JSDocParam, JSDocEdit, InstallResult, InstallOptions, HISTORY_DIR, GitHubRepoMetadata, GitHubProjectContext, FixType, FixSuggestion, FilterSource, FilterOptions, FileSystem, FetchGitHubContextOptions, ExtractStandardSchemasOptions, ExtendedTrendAnalysis, ExportReference, ExportDriftResult, ExportCoverageData, ExampleValidationTypeError, ExampleValidationResult, ExampleValidationOptions, ExampleValidationMode, ExampleValidation, ExampleTypeError, ExampleRunResult, EntryPointSource, EntryPointInfo, DriftType, DriftSummary, DriftResult, DriftReportSummary, DriftReport, DriftCategory, DocsImpactResult, DocsImpactReference, DocsImpact, DocsConfig, DocsChangeType, DocCovReport, DocCovOptions, DocCovConfig, DocCov, DiffWithDocsOptions,
|
|
2623
|
+
export { validateSpecCache, validateExamples, typecheckExamples, typecheckExample, shouldValidate, serializeJSDoc, saveSpecCache, saveSnapshot, saveReport, safeParseJson, runExamplesWithPackage, runExamples, runExample, resolveTarget, resolveCompiledPath, renderSparkline, renderApiSurface, readPackageJson, pruneHistory, pruneByTier, parseGitHubUrl2 as parseScanGitHubUrl, parseMarkdownFiles, parseMarkdownFile, parseListFlag, parseJSDocToPatch, parseGitHubUrl, parseExamplesFlag, parseAssertions, mergeFixes, mergeFilters, loadSpecCache, loadSnapshots, loadCachedReport, listWorkspacePackages, isStandardJSONSchema, isSchemaType, isFixableDrift, isExportFullyDocumented, isExecutableLang, installDependencies, hashString, hashFiles, hashFile, hasNonAssertionComments, hasDocsImpact, hasDocsForExport, groupDriftsByCategory, getUndocumentedExports, getTrend, getSupportedLibraries, getSpecCachePath, getRunCommand, getReportPath, getRegisteredAdapters, getPrimaryBuildScript, getInstallCommand, getExtendedTrend, getExportScore, getExportMissing, getExportDrift, getExportAnalysis, getDriftSummary, getDocumentedExports, getDocsImpactSummary, getDiffReportPath, generateReportFromDocCov, generateReport, generateFixesForExport, generateFix, formatPackageList, formatDriftSummaryLine, formatDelta, findRemovedReferences, findPackageByName, findJSDocLocation, findExportReferences, findDeprecatedReferences, findAdapter, fetchSpecFromGitHub, fetchSpec, fetchGitHubContext, extractStandardSchemasFromProject, extractStandardSchemas, extractSpecSummary, extractSchemaType, extractSchemaOutputType, extractPackageSpec, extractImports, extractFunctionCalls, ensureSpecCoverage, diffSpecWithDocs, diffHashes, detectRuntimeSchemas, detectPackageManager, detectMonorepo, detectExampleRuntimeErrors, detectExampleAssertionFailures, detectEntryPoint, detectBuildInfo, defineConfig, createSourceFile, createNodeCommandRunner, computeSnapshot, computeExportDrift, computeDrift, clearSpecCache, categorizeDrifts, categorizeDrift, calculateAggregateCoverage, buildRawUrl, buildExportRegistry, buildDocCovSpec, buildDisplayUrl, buildCloneUrl, blockReferencesExport, applyPatchToJSDoc, applyEdits, analyzeProject2 as analyzeProject, analyzeFile, analyzeDocsImpact, analyze, WorkspacePackage, WorkspaceConfig, VALIDATION_INFO, TypecheckValidationResult, TypecheckResult, TypecheckOptions, SummaryDriftIssue, StandardSchemaExtractionResult, StandardSchemaExtractionOutput, StandardJSONSchemaV1, SpecSummary, SpecDocDrift, SpecDiffWithDocs, SpecCacheConfig, SpecCache, SchemaExtractionResult, SchemaExtractionMode, SchemaDetectionResult, SchemaDetectionContext, SchemaAdapter, SandboxFileSystem, SPEC_CACHE_FILE, RuntimeDrift, RunValidationResult, RunExamplesWithPackageResult, RunExamplesWithPackageOptions, RunExampleOptions, RetentionTier, ResolvedTarget, ResolvedFilters, ResolveTargetOptions, ReleaseTag, RETENTION_DAYS, REPORT_VERSION, REPORT_EXTENSIONS, ProjectInfo, PresenceResult, ParsedGitHubUrl, PackageManagerInfo, PackageManager, PackageJson, PackageExports, OpenPkgSpec, NodeFileSystem, MonorepoType, MonorepoInfo, MemberChange, MarkdownDocFile, MarkdownCodeBlock, LLMAssertion, JSDocTag, JSDocReturn, JSDocPatch, JSDocParam, JSDocEdit, InstallResult, InstallOptions, HISTORY_DIR, GitHubRepoMetadata, GitHubProjectContext, FixType, FixSuggestion, FilterSource, FilterOptions, FileSystem, FetchGitHubContextOptions, ExtractStandardSchemasOptions, ExtendedTrendAnalysis, ExportReference, ExportDriftResult, ExportCoverageData, ExampleValidationTypeError, ExampleValidationResult, ExampleValidationOptions, ExampleValidationMode, ExampleValidation, ExampleTypeError, ExampleRunResult, EntryPointSource, EntryPointInfo, DriftType, DriftSummary, DriftResult, DriftReportSummary, DriftReport, DriftCategory, DocsImpactResult, DocsImpactReference, DocsImpact, DocsConfig, DocsChangeType, DocCovReport, DocCovOptions, DocCovConfig, DocCov, DiffWithDocsOptions, Diagnostic, DetectedSchemaEntry, DetectedPackageManager, DRIFT_CATEGORY_LABELS, DRIFT_CATEGORY_DESCRIPTIONS, DRIFT_CATEGORIES, DEFAULT_REPORT_PATH, DEFAULT_REPORT_DIR, CoverageTrend, CoverageSummary, CoverageSnapshot, CommandRunner, CommandResult, CheckConfig, CategorizedDrift, CacheValidationResult, CacheContext, CACHE_VERSION, BuildPlanTarget, BuildPlanStepResult, BuildPlanStep, BuildPlanExecutionResult, BuildPlanEnvironment, BuildPlan, BuildInfo, BuildHints, BuildDocCovOptions, ApplyEditsResult, AnalyzeProjectOptions, AnalyzeOptions, AnalysisResult, ALL_VALIDATIONS };
|