@yeoli/nest-flex-schematics
v0.2.0
Published
Selectable NestJS boilerplate generator using Nest schematics
Maintainers
Readme
Nest Flex Schematics
An interactive Nest schematics package for generating a selectable NestJS boilerplate. KR: 선택형 NestJS 보일러플레이트를 생성하는 인터랙티브 Nest schematics 패키지입니다.
Quick Start
cd nest-flex-schematics
npm install
npm run build
npx @yeoli/nest-flex-schematics initIf you use pnpm: KR: pnpm을 사용하는 경우:
cd nest-flex-schematics
pnpm install
pnpm run build
pnpm dlx @yeoli/nest-flex-schematics initFor the interactive question flow, see docs/CLI_FLOW.md.
KR: 인터랙티브 질문 흐름은 docs/CLI_FLOW.md를 참고하세요.
In CI/automation, prefer generate --no-interactive.
KR: CI/자동화 환경에서는 generate --no-interactive 사용을 권장합니다.
Generate a Boilerplate
The easiest way is interactive mode: KR: 가장 쉬운 방법은 interactive 모드입니다.
npx @yeoli/nest-flex-schematics initTo provide all options manually, use this command: KR: 모든 옵션을 직접 지정하려면 아래 명령을 사용하세요.
npx schematics ./tools/schematics/collection.json:nest-boilerplate \
--no-interactive \
--name my-nest-app \
--package-manager npm \
--version-mode preset \
--preset node20-nest11 \
--runtime fastify \
--api-style rest \
--database postgres \
--orm prisma \
--auth jwt \
--validation class-validator \
--swagger \
--test-preset unit \
--no-dockerOption Values
Only these values are allowed. KR: 아래 값만 사용할 수 있습니다.
--package-manager:npm,pnpm--version-mode:preset,custom--preset:node20-nest11,node22-nest11,node20-nest10--runtime:express,fastify--api-style:rest,graphql,both--graphql-approach:code-first,schema-first(for graphql/both)--graphql-driver:apollo,mercurius(for graphql/both)--database:postgres,mysql,mongodb--orm:prisma,typeorm,mongoose--auth:none,jwt--validation:class-validator,zod--test-preset:unit,unit-e2e--swagger/--no-swagger--docker/--no-docker
Allowed and Disallowed Combinations
DB + ORM
Allowed: KR: 허용 조합:
postgres + prismapostgres + typeormmysql + prismamysql + typeormmongodb + mongoose
Disallowed: KR: 금지 조합:
mongodb + prismamongodb + typeormpostgres/mysql + mongoose
GraphQL Driver Rules
apollo: supports bothexpressandfastifymercurius: supports onlyfastifymercuriusrequiresnest >= 11
KR:
apollo:express,fastify모두 지원mercurius:fastify에서만 지원mercurius는nest >= 11에서만 지원
Runtime Constraint
fastify + swaggeris not supported fornest < 11
KR:
nest < 11에서는fastify + swagger조합을 지원하지 않습니다.
Conditional Option Rules
- With
--api-style rest,--graphql-approachand--graphql-driverare ignored. - With
--api-style graphqlorboth, set both GraphQL options explicitly. - With
--version-mode custom, you can set--node-versionand--nest-version.
KR:
--api-style rest에서는--graphql-approach,--graphql-driver가 무시됩니다.--api-style graphql또는both에서는 GraphQL 옵션을 함께 지정하는 것을 권장합니다.--version-mode custom에서는--node-version,--nest-version을 추가로 지정할 수 있습니다.
Invalid Examples (Fail Fast)
These combinations are blocked during generation. KR: 아래 조합은 생성 단계에서 에러로 차단됩니다.
# 1) mongodb + prisma
npx schematics ./tools/schematics/collection.json:nest-boilerplate \
--no-interactive --name invalid-db --package-manager npm \
--version-mode preset --preset node20-nest11 --runtime fastify \
--api-style rest --database mongodb --orm prisma --auth none \
--validation class-validator --no-swagger --test-preset unit --no-docker
# 2) express + mercurius
npx schematics ./tools/schematics/collection.json:nest-boilerplate \
--no-interactive --name invalid-driver --package-manager npm \
--version-mode preset --preset node22-nest11 --runtime express \
--api-style graphql --graphql-approach code-first --graphql-driver mercurius \
--database postgres --orm typeorm --auth none --validation class-validator \
--no-swagger --test-preset unit --no-dockerCustom Mode Example
Use custom mode when you want to set versions directly instead of presets. KR: 공식 프리셋 대신 버전을 직접 지정하려면 custom 모드를 사용하세요.
npx schematics ./tools/schematics/collection.json:nest-boilerplate \
--no-interactive \
--name my-custom-app \
--package-manager pnpm \
--version-mode custom \
--node-version 20 \
--nest-version 11 \
--runtime express \
--api-style both \
--graphql-approach code-first \
--graphql-driver apollo \
--database mysql \
--orm typeorm \
--auth jwt \
--validation class-validator \
--swagger \
--test-preset unit-e2e \
--dockerNotes: KR: 참고:
custommode is aCustom (Best-Effort)support tier.- DB/ORM and GraphQL validation rules still apply in custom mode.
Run Generated Project
cd my-nest-app
cp .env.example .env
npm install
npm run build
npm run start:devIf you use pnpm: KR: pnpm을 사용하는 경우:
cd my-nest-app
cp .env.example .env
pnpm install
pnpm run build
pnpm run start:devDefault URLs: KR: 기본 확인 URL:
- Health:
http://localhost:3000/v1/health - Swagger (REST + swagger):
http://localhost:3000/docs
Official Presets
node20-nest11(recommended)node22-nest11node20-nest10(legacy)
Support policy: KR: 지원 정책:
version-mode=preset: Official Supportversion-mode=custom: Custom (Best-Effort)
Release Rules
- Version policy: SemVer (
0.xmay include breaking changes in minor) - Changelog format: keep Added/Changed/Fixed/Deprecated in
CHANGELOG.md - Detailed release flow:
docs/RELEASE_POLICY.md
KR:
- 버전 정책: SemVer (
0.x구간에서는 minor에 breaking change 포함 가능) - 변경 이력 형식:
CHANGELOG.md에서 Added/Changed/Fixed/Deprecated 유지 - 상세 릴리스 절차:
docs/RELEASE_POLICY.md
Recommended pre-publish order: KR: 배포 직전 권장 순서:
npm ci
npm run build
npm pack --dry-run
npm publish --access public