@openpkg-ts/extract 0.13.0 → 0.14.1

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/bin/tspec.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  extract
4
- } from "../shared/chunk-ksf9k654.js";
4
+ } from "../shared/chunk-khwn5myc.js";
5
5
 
6
6
  // src/cli/spec.ts
7
7
  import * as fs from "node:fs";
@@ -9,7 +9,7 @@ import * as path from "node:path";
9
9
  import { normalize, validateSpec } from "@openpkg-ts/spec";
10
10
  import { Command } from "commander";
11
11
  function createProgram() {
12
- const program = new Command("tspec").description("Extract TypeScript package API to OpenPkg spec").argument("[entry]", "Entry point file").option("-o, --output <file>", "Output file", "openpkg.json").option("--max-depth <n>", "Max type depth", "20").option("--skip-resolve", "Skip external type resolution").option("--runtime", "Enable Standard Schema runtime extraction").action(async (entry, options) => {
12
+ const program = new Command("tspec").description("Extract TypeScript package API to OpenPkg spec").argument("[entry]", "Entry point file").option("-o, --output <file>", "Output file", "openpkg.json").option("--max-depth <n>", "Max type depth (default: 4)").option("--skip-resolve", "Skip external type resolution").option("--runtime", "Enable Standard Schema runtime extraction").action(async (entry, options) => {
13
13
  const entryFile = entry || findEntryPoint(process.cwd());
14
14
  if (!entryFile) {
15
15
  console.error("No entry point found. Please specify an entry file.");
@@ -18,7 +18,7 @@ function createProgram() {
18
18
  console.log(`Extracting from: ${entryFile}`);
19
19
  const result = await extract({
20
20
  entryFile: path.resolve(entryFile),
21
- maxTypeDepth: parseInt(options.maxDepth),
21
+ ...options.maxDepth ? { maxTypeDepth: parseInt(options.maxDepth) } : {},
22
22
  resolveExternalTypes: !options.skipResolve,
23
23
  schemaExtraction: options.runtime ? "hybrid" : "static"
24
24
  });