Development Workflow
Best practices for developing, debugging, and running Nooh projects locally.
Developing with Nooh is designed to feel as fast and seamless as standard Node.js or Bun development.
Setup & TypeScript Paths
Ensure your tsconfig.json includes the generated .nooh directory in its include and paths configuration:
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"paths": {
"@/*": ["./src/*"],
"@router/*": ["./.nooh/router/*"]
}
},
"include": ["src/**/*.ts", ".nooh/**/*.ts"]
}
Running Your Application
With Node.js and TSX
{
"scripts": {
"dev": "nooh dev -- pnpm exec tsx --watch src/index.ts",
"build": "nooh build"
}
}
With Bun
{
"scripts": {
"dev": "nooh dev -- bun --watch src/index.ts",
"build": "nooh build"
}
}
With Cloudflare Workers (Wrangler)
{
"scripts": {
"dev": "nooh dev -- wrangler dev",
"build": "nooh build"
}
}
Compiler Diagnostics
When an issue is detected during compilation, the CLI presents color-coded diagnostics directly in your console:
- File & Line location: Direct link to the offending file.
- Diagnostic Code: E.g.,
NOOH021(Circular Dependency) orNOOH001(Invalid route syntax). - Actionable Message: Suggestions on how to resolve the issue.
[nooh] ✖ Error in src/routes/users/[id].get.ts:
NOOH001: Invalid route parameter syntax '[id]'.