Repository navigation
feat: CLI flags, feature generator, validation, OpenAPI docs, Docker and Drizzle - #20
Merged
Be1newinner merged 1 commit intoOct 26, 2026
Conversation
…and Drizzle
- CLI: --db, --pm, --install/--no-install, --git/--no-git flags (any flag
skips its prompt; --yes fills in the rest); default package manager is
the one that launched the CLI
- Templates now ship inside the npm package instead of being downloaded
from main; databases are overlay folders copied over the base template
- Template: validate({ body, query, params }) middleware returning every
failing field; DTO types derived from Zod schemas
- Template: OpenAPI 3 docs generated from the same schemas, Swagger UI at
/docs (off by default in production, API_DOCS_ENABLED overrides)
- Template: npm run gen:feature -- <name> scaffolds a CRUD module, its
docs and tests, and mounts the router
- Template: multi-stage Dockerfile (non-root, healthcheck) adapted to the
chosen package manager, docker-compose.yml matched to the database
- New database option: PostgreSQL + Drizzle
- Template: split app.ts from index.ts, add Vitest + Supertest tests
- Fix malformed JSON / oversized bodies returning 500 instead of 400/413
- Commit lockfiles (no longer gitignored); pre-approve build scripts for
pnpm 10/11; pin mongo:8.2 (mongo:8 fails on Linux kernel 6.19+)
- CI: template checks on Node 20/22/24, then scaffold, test and
docker-build every database variant
- Require Node >=20; drop unused ora/yauzl dependencies
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015pLhuJbdhCyvDro7o6h1wp
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Six features:
--db,--pm,--install/--no-install,--git/--no-git. Any flag skips its prompt, and--yesfills in the rest. The default package manager is the one that launched the CLI.npm run gen:feature -- ordercreates schema, model, service, controller, route and test files, and mounts the router at/api/v1/orders.validate({ body, query, params })middleware: returns a 400 listing every failing field. DTO types are derived from the Zod schemas./docs, raw spec at/docs/openapi.json. Off by default in production;API_DOCS_ENABLEDoverrides.docker-compose.ymlmatched to the database.Changes these needed:
main. Each database is an overlay folder (packages/overlays/*) copied over the base template, which replaces the regex marker patching.src/app.tsis split fromindex.tsand the template now has 17 real tests (npm testused to fail with "No test files found").bcrypt,esbuild, Prisma). pnpm 11 otherwise fails the install.mongo:8.2is pinned:mongo:8refuses to start on Linux kernel 6.19+.ora/yauzldependencies are dropped.Test plan
Verified locally:
docker compose upfor the Prisma, Drizzle and Mongoose variants reports"db":"connected"on/health; the no-database image is healthy and runs asnodeBefore publishing
The published v3.0.0 CLI downloads the template from
main. After this merges, projects it creates won't get the database wiring (otherwise they still work). Publish a new version right after merging; 4.0.0 is suggested because the template layout changed. The version isn't bumped in this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_015pLhuJbdhCyvDro7o6h1wp