Skip to content
VisualTextPublic

About

Generic developer utility scripts for the VisualText org (TypeScript, run via npm).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

@visualtext/dev-tools

Generic developer utility scripts for the VisualText org. Written in TypeScript and run directly through tsx — no build step required.

Setup

Anyone can now clone and use it:

git clone https://github.com/VisualText/dev-tools.git
cd dev-tools
npm install
npm run analyzers

Available scripts

Run any of these with npm run <name>. Arguments after -- are passed through to the script.

Script What it does
npm run clean Remove build/cache artifacts (dist, coverage, …)
npm run loc Count lines of code by file extension
npm run tree Print a directory tree, skipping noisy folders
npm run fresh Wipe node_modules + lockfile and reinstall
npm run reclone Delete a sibling VisualText repo and clone it fresh (+submodules)
npm run analyzers Index NLP++ analyzer folders into a markdown report
npm run format Format src with Prettier
npm run lint Lint src with ESLint
npm run typecheck Type-check the project with tsc --noEmit
npm run check Run typecheck + lint + format check together

Examples

npm run clean -- --dry          # preview what clean would delete
npm run clean -- dist .turbo    # delete only the named targets
npm run loc -- src --top 5      # lines of code in ./src, top 5 extensions
npm run tree -- . --depth 2     # directory tree, 2 levels deep
npm run fresh -- --dry          # preview a fresh reinstall
npm run reclone -- nlp-engine        # delete ../nlp-engine and clone it fresh
npm run reclone -- nlp-engine --dry  # preview the delete + clone, do nothing
npm run reclone -- nlp-engine --yes  # skip the delete confirmation prompt
npm run analyzers                    # index analyzers under c:\git into analyzers.md
npm run analyzers -- --root c:\git --out report.md
npm run analyzers -- --json          # also emit analyzers.json

An NLP++ analyzer is any folder containing input/, spec/, kb/, and tmp/ subfolders. analyzers scans recursively (skipping node_modules, .git, etc.) and reports, per analyzer: files in input/, .nlp files in spec/, and files in kb/user/. The report groups analyzers by top-level repo with per-repo subtotals, flags duplicate names, and ends with grand totals. --json writes a machine-readable sibling file.

reclone clones into dev-tools's parent directory (e.g. c:\git\<repo>), not the current working directory. It refuses to reclone dev-tools itself and prompts before deleting unless --yes is given.

Adding a new script

  1. Create src/scripts/<name>.ts. Shared helpers live in src/lib/ (log.ts for colored output, fs.ts for filesystem walking, paths.ts for resolving dev-tools's root and parent directory).
  2. Add an entry to the "scripts" block in package.json:
    "<name>": "tsx src/scripts/<name>.ts"
  3. Document it in the table above.

Each script reads its arguments from process.argv.slice(2) and should exit non-zero on failure.

License

MIT

About

Generic developer utility scripts for the VisualText org (TypeScript, run via npm).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages