speedrun-cli 2.7.10 → 2.7.15
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 +38 -0
- package/README.md +128 -491
- package/package.json +1 -1
- package/src/fieldManager.js +338 -191
- package/src/moduleGenerator.js +72 -15
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,44 @@ 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.14] - 2026-08-22
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **FK fields now included in `Create*Dto` and response DTO** — When relations (Many-to-One / One-to-Many) are defined during `speedrun-cli g [module]`, the foreign key fields (e.g., `userId`, `categoryId`) are now generated in `create-[module].dto.ts` with `@IsUUID()` / `@IsOptional()` validators and `@ApiPropertyOptional({ format: 'uuid' })` Swagger docs. They also appear in the response DTO.
|
|
12
|
+
- **`IsUUID` added to class-validator imports when relations exist** — The validator import set now includes `IsUUID` whenever at least one relation FK field is generated, preventing `TS2304: Cannot find name 'IsUUID'`.
|
|
13
|
+
- **`Type` (class-transformer) no longer bleeds into class-validator import** — The `allValDecorators` collector now filters to `Is*` prefixed names only, preventing duplicate/wrong imports like `import { Type } from 'class-validator'` in both `generateModule` and `regenerateModuleComponents`.
|
|
14
|
+
- **TypeORM `update()` uses object criteria form** — Changed `this.repo.update(primaryKey, dto)` to `this.repo.update({ primaryKey } as any, dto)` so TypeORM correctly resolves the WHERE clause by column object rather than treating the PK name string as the row ID.
|
|
15
|
+
- **`parseExistingFields` reads `create-[module].dto.ts` and uses validator decorators for type inference** — Previously read the response DTO and guessed ORM types from TypeScript types, causing `number` → `'Number'` corruption. Now reads the create DTO (which has `@IsInt()`, `@IsDate()`, etc.) and maps them precisely to ORM-native types (`Int`, `DateTime`, `timestamp`, etc.) per detected ORM.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## [2.7.13] - 2026-08-22
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **`regenerateModuleComponents` – Primary Key now detected from existing DTO** — Previously hardcoded `primaryKey = 'id'`, which would overwrite custom PKs (`food_id`, `foodId`, etc.) when using `speedrun-cli field`. Now reads the PK from the module's response DTO via `detectModulePrimaryKey()`.
|
|
23
|
+
- **`syncPrismaSchema` – `forceUpdate` flag added** — Calling `speedrun-cli field` → Save no longer silently skips Prisma schema updates when the model already exists. The existing model block is now replaced in-place.
|
|
24
|
+
- **`fieldManager` – `kebabName` now uses `toKebabCase()`** — Multi-word module names like `OrderItems` are correctly normalised to `order-items` instead of `orderitems`.
|
|
25
|
+
- **`fieldManager` – `parseExistingFields` ignores custom PK/FK fields** — Fields ending with `_id` or `Id` are now excluded from the editable field list so custom primary keys and foreign keys are never accidentally modified.
|
|
26
|
+
- **`fieldManager` – `save` action correctly exits loop** — After saving, `managing` is now set to `false` so the prompt loop terminates instead of continuing.
|
|
27
|
+
- **`moduleGenerator` – `require('./utils')` result now assigned** — `detectPackageManager` and `getRunPrefix` from `utils` are now explicitly imported rather than silently discarded.
|
|
28
|
+
- **`moduleGenerator` – `toKebabCase` and `detectModulePrimaryKey` now exported** — Both utilities are exported so `fieldManager` and other consumers can import them directly.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## [2.7.12] - 2026-08-22
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- **Database Migration & Seed Actions in Field Manager (`speedrun-cli field`)** — Added interactive prompt options `⚡ Run database migration / schema sync` and `🌱 Seed database table` directly to the `? What do you want to do?` menu in `speedrun-cli field` / `speedrun-cli f`. Also offers an optional prompt to immediately run migrations and seeds right after saving updated fields.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## [2.7.11] - 2026-08-22
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- **Dynamic ORM Field Types in Interactive Field Manager (`speedrun-cli field`)** — Updated `src/fieldManager.js` to dynamically detect the project ORM (`detectOrm`) and populate field type choices using `getOrmFieldChoices(orm)` instead of hardcoded default choices.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
8
46
|
## [2.7.10] - 2026-08-22
|
|
9
47
|
|
|
10
48
|
### Added
|