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 +19 -22
- package/package.json +1 -1
- package/src/index.js +22 -13
- package/src/moduleGenerator.js +631 -342
- package/src/postSetup.js +4 -4
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.
|
|
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
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
21
|
-
- **Prisma:**
|
|
22
|
-
- **TypeORM:**
|
|
23
|
-
- **Mongoose:**
|
|
24
|
-
- **Drizzle:**
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
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
|
-
- **
|
|
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
package/src/index.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Module exports for CLI source files
|
|
3
|
-
* @module src
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
};
|