- Core TypeScript sources live in
src/;src/grok-cli.tsroutes CLI flags into the generator logic insrc/grok.tsandsrc/terminal.ts. scripts/contains the build and test automation, andscripts/build.jsinvokes esbuild to bundle the CLI.- Compiled artifacts land in
bin/. Test declaration fixtures sit undertest/*.d.tswith golden outputs intest/output/for quick diffing. - Bundling tweaks live in
config/rollup.config.js.
npm run buildbundles the CLI intobin/grok-cli.js; run before linking or packing.npm run distperforms a production-lean build for release candidates.npm run grok -- <input.d.ts> --outDir <dir>executes the local CLI against a fixture for manual checks.npm run testre-generates documentation from every fixture; follow withgit diff test/outputto spot regressions.npm run cleanremovesbin/and stale outputs.npm run coverageruns the same harness, ready for CI coverage wiring.
- TypeScript files use two-space indentation, CommonJS
requirewhere interoperability is needed, and descriptive suffixes (e.g.,*-cli.tsfor entrypoints). - Prettier formatting derives from
@cortex-js/prettier-config; runnpm run prettierprior to opening a PR. - ESLint governs the
src/*.tssurface. Usenpm run lintand address autofixable issues before pushing.
- Tests rely on deterministic output: add
test/<feature>-test.d.tsfixtures and capture generated docs undertest/output/<feature>/. - Keep fixture names kebab-cased and mirror directories from the CLI invocation.
- When behavior changes intentionally, update the matching output and reference the delta in your PR description.
- Follow Conventional Commits (
chore: deps,doc: update readmeare in history); keep subjects under 60 characters and in the imperative mood. - Each PR should include a short summary, linked issue when relevant, and a note on validation. Attach snippets or screenshots of affected documentation when the output shifts.
- Target Node.js 16+;
scripts/build.shinstalls dependencies on demand, but prefer explicitnpm installduring local setup. - esbuild drives the bundle, so re-run
npm run buildafter touching dependency topology or CLI entry files. Adjust externals inscripts/build.jsif the bundling strategy changes.