speedrun-cli 2.7.8 → 2.7.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,32 +5,29 @@ All notable changes to create-nestjs-auth will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [2.7.1] - 2026-08-22
9
-
10
- ### Fixed
11
- - **Strict Input Validation for CLI Confirm Prompts** — Implemented `StrictConfirmPrompt` across all CLI interactive prompts. Previously, typing invalid characters (e.g. `'t'`) on boolean confirm prompts would silently default to `'no'`. Now, only valid inputs (`'y'`, `'n'`, `'yes'`, `'no'`, or pressing Enter for default) are accepted, and typing invalid characters displays `>> Invalid input. Please enter 'y' or 'n'.` and re-prompts the user.
12
-
13
- ---
14
-
15
- ## [2.7.0] - 2026-08-22
8
+ ## [2.7.10] - 2026-08-22
16
9
 
17
10
  ### Added
18
- - **Scaffolding Cleanup** — Static `src/modules/products` directory has been completely removed from all initial project templates (`templates/base-crud*`). Scaffolding now creates zero CRUD modules by default.
19
- - **Interactive Field Builder Loop** — When generating a module (via guided setup or `speedrun-cli g [module_name]`), users can interactively define custom fields (`fieldName`, `fieldType`: `String`/`Number`/`Boolean`/`Date`, `isOptional`).
20
- - **Dynamic ORM Schema Synchronization** — Automatically syncs definitions to the project's detected ORM:
21
- - **Prisma:** Appends `model` with appropriate data types (`String`, `Float`/`Int`, `Boolean`, `DateTime`) and optional modifiers (`?`) to `prisma/schema.prisma`.
22
- - **TypeORM:** Generates `@Entity()` class in `src/modules/[kebab]/entities/[singular].entity.ts`.
23
- - **Mongoose:** Generates `@Schema()` class in `src/modules/[kebab]/schemas/[singular].schema.ts`.
24
- - **Drizzle:** Generates `pgTable` definition in `src/modules/[kebab]/schema/[kebab].schema.ts`.
25
- - **Auto-Generated Starter Seed Template** — Creates starter seed snippet populated with dummy data based on defined fields in `prisma/seeds/[kebab].seed.ts` (Prisma) or `src/database/seeds/[kebab].seed.ts` (TypeORM/Mongoose/Drizzle).
26
- - **Dynamic Post-Setup Summary Log** — Displays clear post-install next steps dynamically tailored for each ORM (migration & seed commands).
11
+ - **Auto-Scaffold Missing Base Architecture (`ensureBaseArchitecture`)** — When generating modules via `speedrun-cli g [module]`, `src/common/base` is automatically scaffolded if missing from target project, resolving TS2307 & TS4112 compilation errors.
12
+ - **Custom Primary Key Selection** — Prompt to choose primary key format (`id`, `<singular_snake>_id`, `<singular_camel>Id`, or `Custom...`), applied dynamically across ORM schemas, DTOs, response decorators, and `@Param()` controller annotations.
13
+ - **ORM-Native Field Types** — Customized field type choices in the interactive builder according to detected ORM:
14
+ - **Prisma:** `[String, Int, Float, Decimal, Boolean, DateTime, Json]`
15
+ - **TypeORM:** `[varchar, text, int, float, decimal, boolean, timestamp, json]`
16
+ - **Mongoose:** `[String, Number, Boolean, Date, Array, Object]`
17
+ - **Drizzle:** `[varchar, text, integer, numeric, boolean, timestamp, json]`
18
+ - **Specific Field Editing Sub-menu** — Interactive sub-menu allows modifying specific field properties (Field Name, Field Type, Optional Status, or All) instead of forcing full re-entry.
19
+ - **Advanced Relationship Builder** — Interactively add relations (`Many-to-One`, `One-to-Many`) pointing to target modules and foreign keys, automatically injecting attributes into Prisma, TypeORM, Mongoose, and Drizzle schemas.
20
+ - **Auth & Roles Guard Protection Prompt** — Optional step to protect write operations (`POST`, `PUT`, `DELETE`) with `@UseGuards()` and role-based decorators (`ADMIN`, `USER`, `MANAGER`).
21
+ - **Optional `status` Field Prompt** — Added interactive prompt `Include default 'status' field (e.g. ACTIVE)? (Y/n)` during module generation to include or omit status field.
22
+
23
+ ### Fixed
24
+ - **Runtime Error `TypeError: manageFields is not a function` Fixed** — Exported `fieldManager` in `src/index.js` entry point so `manageFields` is properly destructured in `bin/cli.js` when executing `speedrun-cli field [module]`.
25
+ - **Module Field Regeneration** — Exported `regenerateModuleComponents` in `src/moduleGenerator.js` to enable automatic DTO and ORM schema updates when field definitions are edited via `speedrun-cli field`.
26
+ - **Automated Migration Flow for CRUD Modules & JWT Setup** — Reordered post-setup steps in `handlePostSetup` so CRUD module generation occurs *before* database migrations/seeding. Any generated CRUD modules and schema updates are now automatically included when running `prisma migrate dev` / `schema:sync` / `db:push` and seeding during CLI setup.
27
+ - **Strict Input Validation for CLI Confirm Prompts** — Enforced strict `y`/`n` input validation across all CLI interactive prompts.
27
28
 
28
29
  ### Changed
29
- - **Interactive Setup Prompt Sequence** updated:
30
- 1. `Enable Base CRUD Architecture?` (Default: `Yes`)
31
- 2. `Do you want to generate your first CRUD module now?` (Default: `Yes`)
32
- 3. Shared Module Generator execution for module name, CRUD mode, and custom field loop.
33
- - **Controller Service Constructor Visibility** fixed to `protected readonly service: [Name]Service` so generated controllers safely extend `BaseController`.
30
+ - **Standardized Import Statements** — Controller & Service templates now fetch `BaseController`, `BaseService`, `IBaseRepository`, `ApiResponseDto`, `ApiResponseSchema`, `PaginatedResponseDto`, `PaginatedResponseSchema`, `PaginationQueryDto` cleanly from the single barrel export `../../common/base`.
34
31
 
35
32
  ---
36
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speedrun-cli",
3
- "version": "2.7.8",
3
+ "version": "2.7.10",
4
4
  "description": "CLI tool to scaffold a production-ready NestJS authentication system with JWT, refresh tokens, and RBAC",
5
5
  "keywords": [
6
6
  "nestjs",
package/src/index.js CHANGED
@@ -1,13 +1,22 @@
1
- /**
2
- * Module exports for CLI source files
3
- * @module src
4
- */
5
-
6
- module.exports = {
7
- ...require('./constants'),
8
- ...require('./utils'),
9
- ...require('./prompts'),
10
- ...require('./generator'),
11
- ...require('./postSetup'),
12
- ...require('./moduleGenerator'),
13
- };
1
+ /**
2
+ * Module exports for CLI source files
3
+ * @module src
4
+ */
5
+
6
+ const constants = require('./constants');
7
+ const utils = require('./utils');
8
+ const prompts = require('./prompts');
9
+ const generator = require('./generator');
10
+ const postSetup = require('./postSetup');
11
+ const moduleGenerator = require('./moduleGenerator');
12
+ const fieldManager = require('./fieldManager');
13
+
14
+ module.exports = {
15
+ ...constants,
16
+ ...utils,
17
+ ...prompts,
18
+ ...generator,
19
+ ...postSetup,
20
+ ...moduleGenerator,
21
+ ...fieldManager,
22
+ };