tatethurston / nextjs-routes

Type safe routing for Next.js
MIT License
566 stars 23 forks source link

🔧 CLI: specify path to nextjs application (CI / Monorepo) #180

Open splacentino opened 10 months ago

splacentino commented 10 months ago

In order to generate types for a specific project from root of a monorepo during CI, a subfolder should be specified.

E.g. package.json:

"codegen:routes:frontend": "nextjs-routes apps/frontend",
"codegen:routes:frontoffice": "nextjs-routes apps/frontoffice"

Arguments could be handled in a better way (commander, arguments validation, ...) but this currently works.

tatethurston commented 10 months ago

@splacentino any particular reason you’re using the cli instead of next build? Using next build will handle this case already.

splacentino commented 10 months ago

@splacentino any particular reason you’re using the cli instead of next build? Using next build will handle this case already.

Some checks (linting, ..) do not require build step.

Also I have a separated script for multiples codegen w/ different CLI.