docs-util: created docblock-generator tool (#6096)

This commit is contained in:
Shahed Nasser
2024-01-24 11:13:40 +01:00
committed by GitHub
parent d68089b2aa
commit f29948a6a8
37 changed files with 2684 additions and 115 deletions
@@ -0,0 +1,33 @@
#!/usr/bin/env node
import "dotenv/config"
import { Command } from "commander"
import run from "./commands/run.js"
import runGitChanges from "./commands/run-git-changes.js"
import runGitCommit from "./commands/run-git-commit.js"
const program = new Command()
program.name("docblock-generator").description("Generate TSDoc doc-blocks")
program
.command("run")
.description("Generate TSDoc doc-blocks for specified files.")
.argument("<files...>", "One or more TypeScript file or directory paths.")
.option(
"--dry-run",
"Whether to run the command without writing the changes."
)
.action(run)
program
.command("run:changes")
.description("Generate TSDoc doc-blocks for changed files in git.")
.action(runGitChanges)
program
.command("run:commit")
.description("Generate TSDoc doc-blocks for changed files in a commit.")
.argument("<commitSha>", "The SHA of a commit.")
.action(runGitCommit)
program.parse()