Add compile-time type checking to TypeScript template dev scripts#2767
Add compile-time type checking to TypeScript template dev scripts#2767heyitsaamir wants to merge 3 commits intomainfrom
Conversation
tsx was causing issues, switch to nodemon + ts-node for the dev script across all 5 TypeScript templates (echo, ai, graph, mcp, mcpclient). Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the TypeScript app templates’ developer experience by replacing tsx watch with a nodemon + ts-node based dev loop, and adjusting template dependencies accordingly.
Changes:
- Replaced
devscript fromtsx watch ...tonodemon ... --exec "ts-node ..."across 5 TS templates. - Removed
tsxdevDependency and addednodemon+ts-nodedevDependencies in those templates.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/templates/typescript/echo/package.json.hbs | Switches dev script to nodemon+ts-node; updates devDependencies. |
| packages/cli/templates/typescript/ai/package.json.hbs | Switches dev script to nodemon+ts-node; updates devDependencies. |
| packages/cli/templates/typescript/graph/package.json.hbs | Switches dev script to nodemon+ts-node; updates devDependencies. |
| packages/cli/templates/typescript/mcp/package.json.hbs | Switches dev script to nodemon+ts-node; updates devDependencies (also contains an invalid multi-line script string). |
| packages/cli/templates/typescript/mcpclient/package.json.hbs | Switches dev script to nodemon+ts-node; updates devDependencies. |
Use concurrently to run tsx watch + tsc --noEmit --watch in parallel, giving fast hot reload and type errors in the same terminal. Adds dev:run and dev:check scripts for running them individually. Co-Authored-By: Claude <noreply@anthropic.com>
| "inspect": "npx cross-env SERVER_PORT=9000 npx @modelcontextprotocol/inspector -e NODE_NO_WARNINGS=1 -e PORT=3978 node | ||
| -r dotenv/config ." |
There was a problem hiding this comment.
[CRITICAL] scripts.inspect string contains a literal newline (between node and -r ...), which makes the generated package.json invalid JSON and will break npm install/npm run inspect. Put the command on a single line (or otherwise avoid unescaped newlines inside JSON strings).
| "inspect": "npx cross-env SERVER_PORT=9000 npx @modelcontextprotocol/inspector -e NODE_NO_WARNINGS=1 -e PORT=3978 node | |
| -r dotenv/config ." | |
| "inspect": "npx cross-env SERVER_PORT=9000 npx @modelcontextprotocol/inspector -e NODE_NO_WARNINGS=1 -e PORT=3978 node -r dotenv/config ." |
Put the inspect command on a single line to avoid invalid JSON in the generated package.json. Co-Authored-By: Claude <noreply@anthropic.com>
| "start": "node .", | ||
| "dev": "tsx watch -r dotenv/config src/index.ts" | ||
| "dev": "concurrently \"tsx watch -r dotenv/config src/index.ts\" \"tsc --noEmit --watch\"", | ||
| "dev:run": "tsx watch -r dotenv/config src/index.ts", |
There was a problem hiding this comment.
why not using the --env-file flag?
the -r dotnev/config seems obscure and dated in 2026
Summary
concurrentlyto runtsx watchandtsc --noEmit --watchin parallel duringnpm run devdev:runanddev:checkscripts for running them individuallyTest plan
npm run devtscreports it in the terminal