@warlock.js/core 5.3.2 → 5.5.0
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 +24 -0
- package/esm/cli/cli-commands.utils.mjs +27 -9
- package/esm/cli/cli-commands.utils.mjs.map +1 -1
- package/esm/dev-server/shortcuts.mjs +27 -6
- package/esm/dev-server/shortcuts.mjs.map +1 -1
- package/esm/generations/features/react-email.feature.mjs +3 -9
- package/esm/generations/features/react-email.feature.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +85 -0
- package/esm/generations/features/shared/patch-tsconfig-include.mjs.map +1 -0
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +153 -0
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -0
- package/esm/generations/features/shared/resolve-contact-scaffold.mjs +45 -0
- package/esm/generations/features/shared/resolve-contact-scaffold.mjs.map +1 -0
- package/esm/generations/features/web.feature.mjs +18 -93
- package/esm/generations/features/web.feature.mjs.map +1 -1
- package/esm/generations/stubs.mjs +59 -19
- package/esm/generations/stubs.mjs.map +1 -1
- package/llms-full.txt +60 -60
- package/llms.txt +3 -3
- package/package.json +12 -12
- package/skills/create-controller/SKILL.md +1 -1
- package/skills/create-module/SKILL.md +11 -11
- package/skills/hash-password/SKILL.md +4 -4
- package/skills/run-app/SKILL.md +16 -16
- package/skills/send-mail/SKILL.md +2 -2
- package/skills/use-model-transformers/SKILL.md +2 -2
- package/skills/use-repository/SKILL.md +1 -1
- package/skills/validate-input/SKILL.md +1 -1
- package/skills/warlock-doctor/SKILL.md +3 -3
- package/skills/warlock-routes/SKILL.md +10 -10
- package/skills/write-cli-command/SKILL.md +1 -1
- package/skills/write-seeder/SKILL.md +8 -8
package/llms.txt
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
- [build-url](@warlock.js/core/build-url/SKILL.md): HTTP URL helpers — `url`, `publicUrl`, `assetsUrl`, `uploadsUrl`, anchored at `app.baseUrl`. Use to render `src` / `href` / API URLs in resources and responses. `setBaseUrl` is wired by the HTTP connector from `config.get("app.baseUrl")`. Triggers: `url`, `publicUrl`, `assetsUrl`, `uploadsUrl`, `setBaseUrl`, `BASE_URL`; "render an avatar src URL", "absolute download link", "embed asset URL in email", "URL helpers vs path helpers"; typical import `import { url, publicUrl, uploadsUrl } from "@warlock.js/core"`. Skip: filesystem paths — `@warlock.js/core/resolve-path/SKILL.md`; signed CDN URLs — `@warlock.js/core/store-file/SKILL.md`; resource output — `@warlock.js/core/define-resource/SKILL.md`; competing patterns: hand-rolled `${baseUrl}/...` template strings.
|
|
13
13
|
- [configure-app](@warlock.js/core/configure-app/SKILL.md): Configure a Warlock app — the two layers (`warlock.config.ts` for framework-level wiring, `src/config/*.ts` for subsystems), `.env` + `env()`, and the `config()` getter for runtime reads. Triggers: `defineConfig`, `config.get`, `config.key`, `env`, `ConfigRegistry`, `HttpConfigurations`, `AppConfigurations`; "add a new config file", "warlock.config.ts vs src/config", "read env values", "runtime config lookup"; typical import `import { defineConfig, config, env } from "@warlock.js/core"`. Skip: cache driver registration — `@warlock.js/cache/cache-basics/SKILL.md`; mail config — `@warlock.js/core/send-mail/SKILL.md`; storage config — `@warlock.js/core/store-file/SKILL.md`; competing libs `dotenv` direct, `convict`, `node-config`.
|
|
14
14
|
- [create-controller](@warlock.js/core/create-controller/SKILL.md): Author HTTP controllers in @warlock.js/core — RequestHandler signature, validated input via seal schemas, response helpers, attaching metadata. Controllers are thin functions; business logic moves to services or use-cases. Triggers: `RequestHandler`, `Request<TSchema>`, `GuardedRequestHandler`, `request.validated`, `request.input`, `controller.validation`, `response.success`, `response.successCreate`; "write a controller", "attach a schema to a handler", "thin controller pattern", "guarded request type"; typical import `import { type RequestHandler } from "@warlock.js/core"`. Skip: response helper menu — `@warlock.js/core/send-response/SKILL.md`; schema authoring — `@warlock.js/core/validate-input/SKILL.md`; URL wiring — `@warlock.js/core/register-route/SKILL.md`; competing patterns: `express` middleware functions, `@nestjs/common` `@Controller`/`@Get` decorators.
|
|
15
|
-
- [create-module](@warlock.js/core/create-module/SKILL.md): Scaffold a new feature module under `src/app/<name>/` via `warlock generate.module` and the follow-up generators for controllers, models, repositories, resources, and validation schemas. Triggers: `warlock generate.module`, `generate.controller`, `generate.service`, `generate.model`, `generate.repository`, `generate.resource`, `generate.migration`, `--minimal`, `gen.m`; "scaffold a new module", "create CRUD bootstrap", "add a controller to a module", "generate a model"; typical CLI `
|
|
15
|
+
- [create-module](@warlock.js/core/create-module/SKILL.md): Scaffold a new feature module under `src/app/<name>/` via `warlock generate.module` and the follow-up generators for controllers, models, repositories, resources, and validation schemas. Triggers: `warlock generate.module`, `generate.controller`, `generate.service`, `generate.model`, `generate.repository`, `generate.resource`, `generate.migration`, `--minimal`, `gen.m`; "scaffold a new module", "create CRUD bootstrap", "add a controller to a module", "generate a model"; typical CLI `npx warlock generate.module <name>`. Skip: framework-wide layout rules — `@warlock.js/core/warlock-conventions/SKILL.md`; routes file shape — `@warlock.js/core/register-route/SKILL.md`; controller shape — `@warlock.js/core/create-controller/SKILL.md`; competing tooling: `@nestjs/cli`, `hygen`, hand-rolled folder layouts.
|
|
16
16
|
- [define-resource](@warlock.js/core/define-resource/SKILL.md): Map model fields to wire-shape via `defineResource()` or `Resource` subclasses. Output-only — never put business logic, hydration, or reconciliation in a resource. Triggers: `defineResource`, `Resource`, `RegisterResource`, `toJSON`, `"self"`, `"localized"`, `"uploadsUrl"`; "shape an API response", "nest related resources", "rename a field on output", "self-referential tree resource"; typical import `import { defineResource } from "@warlock.js/core"`. Skip: localized columns — `@warlock.js/core/use-localization/SKILL.md`; URL casting — `@warlock.js/core/build-url/SKILL.md`; controller side — `@warlock.js/core/create-controller/SKILL.md`; competing libs `@nestjs/swagger` `@ApiProperty`, `class-transformer`, hand-rolled DTO mappers.
|
|
17
17
|
- [encrypt-data](@warlock.js/core/encrypt-data/SKILL.md): Reversible AES-256-GCM `encrypt` / `decrypt` for secrets you need to read back; one-way HMAC-SHA256 `hmacHash` for deterministic fingerprints (lookup/dedup of encrypted columns). Keys come from `src/config/encryption.ts`. Triggers: `encrypt`, `decrypt`, `hmacHash`, `EncryptionConfigurations`, `APP_ENCRYPTION_KEY`, `APP_HMAC_KEY`; "store an API key reversibly", "fingerprint an encrypted column for lookup", "AES-256-GCM secret", "HMAC-SHA256 dedup key"; typical import `import { encrypt, decrypt, hmacHash } from "@warlock.js/core"`. Skip: password hashing — `@warlock.js/core/hash-password/SKILL.md`; config wiring — `@warlock.js/core/configure-app/SKILL.md`; competing libs Node `crypto` direct, `crypto-js`, `libsodium-wrappers`.
|
|
18
18
|
- [hash-password](@warlock.js/core/hash-password/SKILL.md): One-way bcrypt password hashing — `hashPassword` / `verifyPassword`, plus the declarative `useHashedPassword()` schema transformer that auto-hashes a model's password field on save. Salt rounds come from `src/config/encryption.ts`. Triggers: `hashPassword`, `verifyPassword`, `useHashedPassword`, `password.salt`, `bcryptjs`; "hash a user password", "verify login credentials", "auto-hash on save", "rotate a password"; typical import `import { hashPassword, verifyPassword } from "@warlock.js/core"`. Skip: reversible secrets — `@warlock.js/core/encrypt-data/SKILL.md`; the other transformers — `@warlock.js/core/use-model-transformers/SKILL.md`; config wiring — `@warlock.js/core/configure-app/SKILL.md`; competing libs `bcrypt` native, `argon2`, `scrypt`.
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
- [use-request-locals](@warlock.js/core/use-request-locals/SKILL.md): Carry typed, server-only data through one HTTP request with `request.locals`, usually written by middleware and read by downstream middleware or controllers. Augment `RequestLocals` in the module that owns each key; v5 no longer permits arbitrary `request.foo` properties. Triggers: `request.locals`, `RequestLocals`, `request.post`, `request.organization`, `Property does not exist on type Request`, `Request index signature`; "attach data to a request", "share middleware data with a controller", "type request locals", "migrate dynamic request properties"; typical type augmentation `declare module "@warlock.js/core" { interface RequestLocals { ... } }`. Skip: computed-on-demand single-flight values and removed `fromRequest` — `@warlock.js/core/request-memo/SKILL.md`; middleware mechanics — `@warlock.js/core/write-middleware/SKILL.md`; authenticated user typing — augment `RequestUser`, not `RequestLocals`; competing patterns: `(request as any).foo`, `request.set()`, module-global mutable state.
|
|
40
40
|
- [validate-input](@warlock.js/core/validate-input/SKILL.md): Author seal schemas, attach them to controllers via `controller.validation = { schema }`, infer types via `Infer<typeof schema>`, and layer DB-aware (`unique`/`exists`) and file validators on top. Triggers: `v.object`, `v.string`, `v.email`, `Infer`, `controller.validation`, `.unique`, `.exists`, `uniqueExceptCurrentId`, `request.validated`; "validate a request body", "attach a schema to a controller", "DB-aware unique rule", "infer schema types"; typical import `import { v, type Infer } from "@warlock.js/seal"`. Skip: schema authoring foundations — `@warlock.js/seal/seal-basics/SKILL.md`; controller wiring — `@warlock.js/core/create-controller/SKILL.md`; file rules deep-dive — `@warlock.js/core/upload-file/SKILL.md`; competing libs `zod`, `joi`, `yup`, `class-validator`.
|
|
41
41
|
- [warlock-conventions](@warlock.js/core/warlock-conventions/SKILL.md): Framework-wide invariants for projects built on @warlock.js/core — module layout, canonical imports, layered flow, file naming, and the non-negotiable rules every other warlock skill assumes. Triggers: `src/app/<module>`, `routes.ts`, `main.ts`, `Request<TSchema>`, `RequestHandler`, `GuardedRequestHandler`, `app/<module>/...`; "where do files go in this project", "canonical Warlock imports", "module layout rules", "controller-service-repository layering"; typical import `import { router, type RequestHandler } from "@warlock.js/core"`. Skip: scaffold a new module — `@warlock.js/core/create-module/SKILL.md`; route shape — `@warlock.js/core/register-route/SKILL.md`; controller shape — `@warlock.js/core/create-controller/SKILL.md`; competing patterns: `express` ad-hoc layouts, `@nestjs/common` decorator-driven structure.
|
|
42
|
-
- [warlock-doctor](@warlock.js/core/warlock-doctor/SKILL.md): Run `warlock doctor` — a read-only diagnostics command that checks routes / config / connectors / optional-peers / health endpoints / release hygiene and prints a pass/warn/fail report, exiting non-zero on any failure. Add your own probe with the `DoctorCheck` contract and `runChecks` / `formatReportLines`. Triggers: `warlock doctor`, `doctorCommand`, `DoctorCheck`, `CheckResult`, `CheckStatus`, `DoctorReport`, `runChecks`, `formatReportLines`, `printReport`, `defaultDoctorChecks`; "diagnose my app", "preflight / preflight check", "is the app healthy", "why are there 0 routes", "pre-release sanity check", "CI smoke check"; run as `
|
|
43
|
-
- [warlock-routes](@warlock.js/core/warlock-routes/SKILL.md): Run `warlock routes` — a read-only command that lists the registered HTTP routes as a verb-colored table (method / path / name / action / middleware-count / source), a sibling of `warlock doctor`. Filter with `--method` / `--path` / `--name`, or emit normalized rows as JSON with `--json`. Also covers `warlock routes:diff`, which compares live page routes against the last `warlock build`'s route snapshot and exits non-zero on drift. Triggers: `warlock routes`, `routesCommand`, `warlock routes:diff`, `routesDiffCommand`, "list my routes", "show all routes", "route table", "what endpoints does my app expose", "dump routes as JSON", "which routes have middleware", "route map for CI", "did my page routes drift from the last build"; run as `
|
|
42
|
+
- [warlock-doctor](@warlock.js/core/warlock-doctor/SKILL.md): Run `warlock doctor` — a read-only diagnostics command that checks routes / config / connectors / optional-peers / health endpoints / release hygiene and prints a pass/warn/fail report, exiting non-zero on any failure. Add your own probe with the `DoctorCheck` contract and `runChecks` / `formatReportLines`. Triggers: `warlock doctor`, `doctorCommand`, `DoctorCheck`, `CheckResult`, `CheckStatus`, `DoctorReport`, `runChecks`, `formatReportLines`, `printReport`, `defaultDoctorChecks`; "diagnose my app", "preflight / preflight check", "is the app healthy", "why are there 0 routes", "pre-release sanity check", "CI smoke check"; run as `npx warlock doctor`. Skip: the live `/health` + `/ready` HTTP probes — `@warlock.js/core/health-checks/SKILL.md`; authoring a general CLI command — `@warlock.js/core/write-cli-command/SKILL.md`; releasing the package — `releasing-warlock-monorepo`; competing tools `npm doctor`, `nest info`, hand-rolled preflight scripts.
|
|
43
|
+
- [warlock-routes](@warlock.js/core/warlock-routes/SKILL.md): Run `warlock routes` — a read-only command that lists the registered HTTP routes as a verb-colored table (method / path / name / action / middleware-count / source), a sibling of `warlock doctor`. Filter with `--method` / `--path` / `--name`, or emit normalized rows as JSON with `--json`. Also covers `warlock routes:diff`, which compares live page routes against the last `warlock build`'s route snapshot and exits non-zero on drift. Triggers: `warlock routes`, `routesCommand`, `warlock routes:diff`, `routesDiffCommand`, "list my routes", "show all routes", "route table", "what endpoints does my app expose", "dump routes as JSON", "which routes have middleware", "route map for CI", "did my page routes drift from the last build"; run as `npx warlock routes` / `npx warlock routes:diff`. Skip: read-only health/preflight checks — `@warlock.js/core/warlock-doctor/SKILL.md`; defining/naming/grouping routes — `@warlock.js/core/register-route/SKILL.md`; authoring a general CLI command — `@warlock.js/core/write-cli-command/SKILL.md`; competing tools `nest`/`express` route listers, `php artisan route:list`.
|
|
44
44
|
- [wire-socket](@warlock.js/core/wire-socket/SKILL.md): Configure Socket.IO via `src/config/socket.ts`, reach the live server through `getSocketServer()` (or `app.socket` post-bootstrap), register `connection` handlers once the late-phase socket connector has booted, emit from controllers/services, use rooms and namespaces. Triggers: `app.socket`, `getSocketServer`, `SocketOptions`, `socket.io` `Server`, `socket.join`, `socket.to`, `io.of`, `io.use`; "add realtime chat", "emit socket events from a service", "use rooms and namespaces", "per-socket JWT auth". Skip: connector lifecycle — `@warlock.js/core/add-connector/SKILL.md`; app context accessors — `@warlock.js/core/use-app-context/SKILL.md`; competing libs `ws`, `socket.io` direct without Warlock connector, `uWebSockets.js`.
|
|
45
45
|
- [write-cli-command](@warlock.js/core/write-cli-command/SKILL.md): Author a custom `warlock <my-cmd>` command via the `command()` factory — name, description, action, options, preload, then register in `warlock.config.ts > cli.commands` or drop in `src/app/<module>/commands/`. Also covers built-in `warlock add` feature scaffolding, including the Web starter and `index.register.ts`. Triggers: `command`, `CLICommand`, `CLICommandPreload`, `CLICommandOption`, `preload`, `preAction`, `persistent`, `colors`, `warlock add`, `index.register.ts`; "write a custom warlock command", "one-off maintenance task", "ship a CLI from a package", "framework built-in commands"; typical import `import { command } from "@warlock.js/core"`. Skip: framework dev/build/start — `@warlock.js/core/run-app/SKILL.md`; warlock.config.ts wiring — `@warlock.js/core/configure-app/SKILL.md`; competing libs `commander`, `yargs`, `oclif`.
|
|
46
46
|
- [write-middleware](@warlock.js/core/write-middleware/SKILL.md): Author HTTP middleware for @warlock.js/core — the `({ request, response })` signature, short-circuit by returning a response, enrich the request with extra fields, register per-route, per-group, or app-wide. Triggers: `Middleware`, `MiddlewareResponse`, `router.group`, `guarded`, `request.detectIp`, `authMiddleware`; "write a custom middleware", "short-circuit a request", "enrich the request with extra fields", "per-route vs per-group middleware"; typical import `import type { Middleware } from "@warlock.js/core"`. Skip: built-in middleware catalog — `@warlock.js/core/use-middleware/SKILL.md`; route attachment — `@warlock.js/core/register-route/SKILL.md`; response helpers — `@warlock.js/core/send-response/SKILL.md`; competing patterns: `express` `(req, res, next)` middleware, Fastify `preHandler` hooks.
|
package/package.json
CHANGED
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"@mongez/slug": "^1.0.7",
|
|
26
26
|
"@mongez/supportive-is": "^2.1.4",
|
|
27
27
|
"@mongez/time-wizard": "^1.0.6",
|
|
28
|
-
"@warlock.js/auth": "5.
|
|
29
|
-
"@warlock.js/cache": "5.
|
|
30
|
-
"@warlock.js/cascade": "5.
|
|
31
|
-
"@warlock.js/context": "5.
|
|
32
|
-
"@warlock.js/logger": "5.
|
|
33
|
-
"@warlock.js/seal": "5.
|
|
34
|
-
"@warlock.js/fs": "5.
|
|
28
|
+
"@warlock.js/auth": "5.5.0",
|
|
29
|
+
"@warlock.js/cache": "5.5.0",
|
|
30
|
+
"@warlock.js/cascade": "5.5.0",
|
|
31
|
+
"@warlock.js/context": "5.5.0",
|
|
32
|
+
"@warlock.js/logger": "5.5.0",
|
|
33
|
+
"@warlock.js/seal": "5.5.0",
|
|
34
|
+
"@warlock.js/fs": "5.5.0",
|
|
35
35
|
"chokidar": "^5.0.0",
|
|
36
36
|
"dayjs": "^1.11.19",
|
|
37
37
|
"es-module-lexer": "^2.0.0",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"react": "^19.2.3",
|
|
58
58
|
"react-dom": "^19.2.3",
|
|
59
59
|
"@react-email/render": "^2.0.5",
|
|
60
|
-
"@warlock.js/herald": "5.
|
|
61
|
-
"@warlock.js/ai": "5.
|
|
62
|
-
"@warlock.js/access": "5.
|
|
63
|
-
"@warlock.js/notifications": "5.
|
|
60
|
+
"@warlock.js/herald": "5.5.0",
|
|
61
|
+
"@warlock.js/ai": "5.5.0",
|
|
62
|
+
"@warlock.js/access": "5.5.0",
|
|
63
|
+
"@warlock.js/notifications": "5.5.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"sharp": {
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
],
|
|
124
124
|
"author": "hassanzohdy",
|
|
125
125
|
"license": "MIT",
|
|
126
|
-
"version": "5.
|
|
126
|
+
"version": "5.5.0",
|
|
127
127
|
"type": "module",
|
|
128
128
|
"main": "./esm/index.mjs",
|
|
129
129
|
"module": "./esm/index.mjs",
|
|
@@ -25,7 +25,7 @@ That's the full contract. The `RequestHandler` annotation carries both parameter
|
|
|
25
25
|
- File: `src/app/<module>/controllers/<action>.controller.ts`.
|
|
26
26
|
- Export name matches the action in camelCase + `Controller` suffix: `listProductsController`, `createProductController`, `getProductController`.
|
|
27
27
|
|
|
28
|
-
Scaffold with: `
|
|
28
|
+
Scaffold with: `npx warlock generate.controller <module>/<action>` (add `--with-validation` to get the schema generated alongside).
|
|
29
29
|
|
|
30
30
|
## Reading input
|
|
31
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-module
|
|
3
|
-
description: 'Scaffold a new feature module under `src/app/<name>/` via `warlock generate.module` and the follow-up generators for controllers, models, repositories, resources, and validation schemas. Triggers: `warlock generate.module`, `generate.controller`, `generate.service`, `generate.model`, `generate.repository`, `generate.resource`, `generate.migration`, `--minimal`, `gen.m`; "scaffold a new module", "create CRUD bootstrap", "add a controller to a module", "generate a model"; typical CLI `
|
|
3
|
+
description: 'Scaffold a new feature module under `src/app/<name>/` via `warlock generate.module` and the follow-up generators for controllers, models, repositories, resources, and validation schemas. Triggers: `warlock generate.module`, `generate.controller`, `generate.service`, `generate.model`, `generate.repository`, `generate.resource`, `generate.migration`, `--minimal`, `gen.m`; "scaffold a new module", "create CRUD bootstrap", "add a controller to a module", "generate a model"; typical CLI `npx warlock generate.module <name>`. Skip: framework-wide layout rules — `@warlock.js/core/warlock-conventions/SKILL.md`; routes file shape — `@warlock.js/core/register-route/SKILL.md`; controller shape — `@warlock.js/core/create-controller/SKILL.md`; competing tooling: `@nestjs/cli`, `hygen`, hand-rolled folder layouts.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Warlock — create a module
|
|
@@ -10,8 +10,8 @@ A module is a self-contained feature folder under `src/app/<name>/`. The CLI sca
|
|
|
10
10
|
## The shape
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
npx warlock generate.module products # full CRUD bootstrap (default — controllers, model, services, repository, resource, schemas, routes, seed)
|
|
14
|
+
npx warlock generate.module products --minimal # bare bones (routes.ts + main.ts + utils/locales.ts + empty subfolders)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Full CRUD is the default — opt down to a bare skeleton with `--minimal` (`-m`) when you want to build the module piece by piece. `--force` (`-f`) overwrites existing files. The plural form is auto-derived: `generate.module product` and `generate.module products` produce the same `src/app/products/` folder.
|
|
@@ -117,9 +117,9 @@ Inside the same module, plain relative imports (`./`, `../`).
|
|
|
117
117
|
### Full CRUD bootstrap
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
|
|
120
|
+
npx warlock generate.module products
|
|
121
121
|
# edit schemas + model fields, then
|
|
122
|
-
|
|
122
|
+
npx warlock migrate
|
|
123
123
|
```
|
|
124
124
|
|
|
125
125
|
The CRUD scaffold's `routes.ts` already chains the five controllers behind `guarded(...)`:
|
|
@@ -147,11 +147,11 @@ guarded(() => {
|
|
|
147
147
|
### Skeleton module, add pieces piecemeal
|
|
148
148
|
|
|
149
149
|
```bash
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
npx warlock generate.module orders --minimal
|
|
151
|
+
npx warlock generate.model orders/order --with-resource
|
|
152
|
+
npx warlock generate.repository orders/order
|
|
153
|
+
npx warlock generate.controller orders/place-order --with-validation
|
|
154
|
+
npx warlock generate.controller orders/list-orders
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
Then wire URLs by editing `src/app/orders/routes.ts` and the schema rules in `src/app/orders/schema/`.
|
|
@@ -172,7 +172,7 @@ await warmupProductCache();
|
|
|
172
172
|
- **There's no standalone `generate.validation` command.** Validation is no longer scaffolded on its own — each controller carries its own schema (imported from `schema/` and bound via `controller.validation`). Generate the controller with `--with-validation` to get the paired schema file, or hand-write the `schema/*.schema.ts`.
|
|
173
173
|
- **No `requests/` folder.** Controllers import the schema's exported type + value directly from `schema/*.schema.ts`; there is no `*.request.ts` alias.
|
|
174
174
|
- **Subfolder is `seeds/` (plural), not `seed/`.** The seed file is `<module>.seed.ts`.
|
|
175
|
-
- **`generate.module` does not run the migration.** It only creates the migration file. Run `
|
|
175
|
+
- **`generate.module` does not run the migration.** It only creates the migration file. Run `npx warlock migrate` separately to apply it.
|
|
176
176
|
- **`models/<entity>/` is its own folder, not a flat file.** The generator puts `product.model.ts` inside `models/product/` so migrations can sit beside the model in `models/product/migrations/`.
|
|
177
177
|
- **Don't import `routes.ts`, `main.ts`, or anything in `events/`.** They're auto-loaded; double-loading errors out at boot.
|
|
178
178
|
- **`utils/locales.ts` is mandatory for translation keys.** Skip it and `t("products.notFound")` silently falls back to the key itself.
|
|
@@ -148,7 +148,7 @@ The "same error for missing user vs wrong password" pattern is deliberate — it
|
|
|
148
148
|
`hashPassword` / `verifyPassword` need `bcryptjs`. Install it directly:
|
|
149
149
|
|
|
150
150
|
```bash
|
|
151
|
-
|
|
151
|
+
npm install bcryptjs
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
If you skip the install, the first call throws with the framework's install hint:
|
|
@@ -157,14 +157,14 @@ If you skip the install, the first call throws with the framework's install hint
|
|
|
157
157
|
Password encryption requires the bcryptjs package.
|
|
158
158
|
Install it with:
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
npm install bcryptjs
|
|
161
161
|
|
|
162
162
|
Or with your preferred package manager:
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
npm install bcryptjs
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
There is no `warlock add` feature for password hashing — `bcryptjs` is a plain dependency, so install it directly with `
|
|
167
|
+
There is no `warlock add` feature for password hashing — `bcryptjs` is a plain dependency, so install it directly with `npm install bcryptjs`.
|
|
168
168
|
|
|
169
169
|
## Gotchas
|
|
170
170
|
|
package/skills/run-app/SKILL.md
CHANGED
|
@@ -11,13 +11,13 @@ Three commands move the app through its lifecycle: `dev` while you're editing, `
|
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
13
|
# Local development
|
|
14
|
-
|
|
14
|
+
npx warlock dev
|
|
15
15
|
|
|
16
16
|
# Production build
|
|
17
|
-
|
|
17
|
+
npx warlock build
|
|
18
18
|
|
|
19
19
|
# Run the built bundle
|
|
20
|
-
|
|
20
|
+
npx warlock start
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
`dev` and `start` are **persistent** (long-running, no auto-exit). `build` is one-shot — it exits when the bundle is written.
|
|
@@ -234,9 +234,9 @@ The three cases that reach it are: never built; a build that failed before promo
|
|
|
234
234
|
### Behavior
|
|
235
235
|
|
|
236
236
|
```bash
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
237
|
+
npx warlock start # → spawns node --enable-source-maps dist/app.js
|
|
238
|
+
npx warlock start --inspect # → spawns node --enable-source-maps --inspect dist/app.js
|
|
239
|
+
npx warlock start --max-old-space-size=4096 # → spawns node --enable-source-maps --max-old-space-size=4096 dist/app.js
|
|
240
240
|
```
|
|
241
241
|
|
|
242
242
|
Everything you pass after `start` is forwarded to the spawned Node process. Use this to attach a debugger (`--inspect`), tune memory (`--max-old-space-size`), or pass any other Node flag without editing the command.
|
|
@@ -288,7 +288,7 @@ The started banner prints **only** when the running application reports a comple
|
|
|
288
288
|
|
|
289
289
|
```bash
|
|
290
290
|
# a CI gate can be this blunt, and it is now correct
|
|
291
|
-
|
|
291
|
+
npx warlock start | grep -q "production server started"
|
|
292
292
|
```
|
|
293
293
|
|
|
294
294
|
### Reading a failed start (5.2)
|
|
@@ -371,17 +371,17 @@ If you need conditional behavior, branch on `Application.environment` (the ortho
|
|
|
371
371
|
}
|
|
372
372
|
```
|
|
373
373
|
|
|
374
|
-
Now `
|
|
374
|
+
Now `npm run dev` / `npm run build` / `npm run start`. Standard Node hosting providers (Render, Fly, Railway, Heroku) recognize this layout.
|
|
375
375
|
|
|
376
376
|
### Production Dockerfile
|
|
377
377
|
|
|
378
378
|
```dockerfile
|
|
379
379
|
FROM node:20-alpine AS build
|
|
380
380
|
WORKDIR /app
|
|
381
|
-
COPY package.json
|
|
382
|
-
RUN
|
|
381
|
+
COPY package.json package-lock.json ./
|
|
382
|
+
RUN npm ci
|
|
383
383
|
COPY . .
|
|
384
|
-
RUN
|
|
384
|
+
RUN npx warlock build
|
|
385
385
|
|
|
386
386
|
FROM node:20-alpine
|
|
387
387
|
WORKDIR /app
|
|
@@ -390,7 +390,7 @@ COPY --from=build /app/node_modules ./node_modules
|
|
|
390
390
|
COPY --from=build /app/package.json ./
|
|
391
391
|
COPY --from=build /app/warlock.config.ts ./
|
|
392
392
|
ENV NODE_ENV=production
|
|
393
|
-
CMD ["
|
|
393
|
+
CMD ["npx", "warlock", "start"]
|
|
394
394
|
```
|
|
395
395
|
|
|
396
396
|
Two-stage build trims `devDependencies` out of the runtime image. Keep `warlock.config.ts` in the runtime stage — `start` reads it to resolve the bundle path.
|
|
@@ -425,7 +425,7 @@ That is deliberate: `build` and `start` do **not** force `production`. Forcing i
|
|
|
425
425
|
### Skip type-gen on machines without write access
|
|
426
426
|
|
|
427
427
|
```bash
|
|
428
|
-
|
|
428
|
+
npx warlock dev --skip-typings
|
|
429
429
|
```
|
|
430
430
|
|
|
431
431
|
Or persist it:
|
|
@@ -443,20 +443,20 @@ Useful in a containerized dev environment where `.warlock/typings.d.ts` is read-
|
|
|
443
443
|
### Memory-tune the production process
|
|
444
444
|
|
|
445
445
|
```bash
|
|
446
|
-
|
|
446
|
+
npx warlock start --max-old-space-size=4096
|
|
447
447
|
```
|
|
448
448
|
|
|
449
449
|
Or via `NODE_OPTIONS` in the deployment env if you don't want to change the start invocation:
|
|
450
450
|
|
|
451
451
|
```bash
|
|
452
|
-
NODE_OPTIONS=--max-old-space-size=4096
|
|
452
|
+
NODE_OPTIONS=--max-old-space-size=4096 npx warlock start
|
|
453
453
|
```
|
|
454
454
|
|
|
455
455
|
## Gotchas
|
|
456
456
|
|
|
457
457
|
- **`warlock dev` is persistent — `Ctrl+C` to stop.** The framework's `persistent: true` flag keeps the process alive after `action` returns. Same for `start`.
|
|
458
458
|
- **`--fresh` only deletes the manifest, not the transpile cache.** If you're chasing a stale-compile bug, `rm -rf .warlock/` clears everything. The manifest restoring is what `--fresh` solves.
|
|
459
|
-
- **`warlock build` does NOT run migrations.** Production bundles ship the migration files but don't apply them. Run `
|
|
459
|
+
- **`warlock build` does NOT run migrations.** Production bundles ship the migration files but don't apply them. Run `npx warlock migrate` against the production DB separately.
|
|
460
460
|
- **`warlock start` requires a build it can vouch for.** Since 5.2 it refuses any `outdir` without the `.warlock-build.json` success marker — a hand-assembled `dist/`, or one left behind by a build that failed, is rejected by that reason instead of being spawned and crashing halfway through boot. Run `warlock build` first.
|
|
461
461
|
- **Do not add `.warlock-build.json` to `.gitignore`-driven artifact pruning.** Stripping it from a `dist/` you ship makes `warlock start` refuse the artifact on the target host. Copy `outdir` whole.
|
|
462
462
|
- **`outdir` is the directory, `outFile` is the filename within it.** A common mistake is putting the full path in one and leaving the other default — you end up with `<full-path>/app.js` or `dist/<full-path>`. They concatenate.
|
|
@@ -85,7 +85,7 @@ const config: MailConfigurations = {
|
|
|
85
85
|
};
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
Requires `@aws-sdk/client-sesv2` installed (`
|
|
88
|
+
Requires `@aws-sdk/client-sesv2` installed (`npm install @aws-sdk/client-sesv2`).
|
|
89
89
|
|
|
90
90
|
## Mail modes
|
|
91
91
|
|
|
@@ -361,7 +361,7 @@ await Mail.to(user.email)
|
|
|
361
361
|
|
|
362
362
|
- **`.send()` validates** — `to`, `subject`, and at least one of `text`/`html`/`component` are required. Missing any throws synchronously.
|
|
363
363
|
- **`@react-email/render` is optional.** Without it you get the basic fallback (inline styles, no MSO conditionals). Install it for production-quality HTML.
|
|
364
|
-
- **`nodemailer` is loaded lazily** at import time. If you see `nodemailer is not installed` errors, run `warlock add mail` (or `
|
|
364
|
+
- **`nodemailer` is loaded lazily** at import time. If you see `nodemailer is not installed` errors, run `warlock add mail` (or `npm install nodemailer`).
|
|
365
365
|
- **`secure: true` requires port 465.** For port 587 use `secure: false` and `tls: true` (STARTTLS).
|
|
366
366
|
- **Test mode is process-global.** Set it in `beforeAll`/`beforeEach`; reset with `setMailMode("production")` (or rely on test runner isolation).
|
|
367
367
|
- **Per-mail handlers don't replace global ones** — both fire. Avoid double-counting metrics.
|
|
@@ -60,7 +60,7 @@ What it does at save time:
|
|
|
60
60
|
| Existing row, password unchanged | Pass through (no re-hashing — stored hash preserved). |
|
|
61
61
|
| Empty / undefined value | Pass through untouched. |
|
|
62
62
|
|
|
63
|
-
Calls `authService.hashPassword(String(value))` under the hood — same bcryptjs path as the standalone `hashPassword()` helper. See [`hash-password/SKILL.md`](../hash-password/SKILL.md) for full bcrypt setup (salt rounds, `
|
|
63
|
+
Calls `authService.hashPassword(String(value))` under the hood — same bcryptjs path as the standalone `hashPassword()` helper. See [`hash-password/SKILL.md`](../hash-password/SKILL.md) for full bcrypt setup (salt rounds, `npm install bcryptjs`).
|
|
64
64
|
|
|
65
65
|
### Why declarative wins
|
|
66
66
|
|
|
@@ -214,7 +214,7 @@ Rule of thumb: transformers are for **pure, deterministic** transforms of the ro
|
|
|
214
214
|
|
|
215
215
|
## See also
|
|
216
216
|
|
|
217
|
-
- [`hash-password/SKILL.md`](../hash-password/SKILL.md) — the bcrypt setup that `useHashedPassword` calls under the hood; salt rounds, `
|
|
217
|
+
- [`hash-password/SKILL.md`](../hash-password/SKILL.md) — the bcrypt setup that `useHashedPassword` calls under the hood; salt rounds, `npm install bcryptjs`.
|
|
218
218
|
- [`use-repository/SKILL.md`](../use-repository/SKILL.md) — where `create` / `save` calls happen that trigger the transformers.
|
|
219
219
|
- [`define-resource/SKILL.md`](../define-resource/SKILL.md) — filtering transformed fields (`password`) out of API responses.
|
|
220
220
|
- [`warlock-conventions/SKILL.md`](../warlock-conventions/SKILL.md) — schema files live in `src/app/<module>/models/<entity>/<entity>.model.ts`.
|
|
@@ -53,7 +53,7 @@ Five lines do the heavy lifting:
|
|
|
53
53
|
4. **`defaultOptions`** — applied to every call (`orderBy`, default `limit`, etc.).
|
|
54
54
|
5. **`new FaqsRepository()`** singleton — import this everywhere; never instantiate again.
|
|
55
55
|
|
|
56
|
-
The class is intentionally private — only the singleton escapes the module. Scaffold with `
|
|
56
|
+
The class is intentionally private — only the singleton escapes the module. Scaffold with `npx warlock generate.repository <module>/<entity>`.
|
|
57
57
|
|
|
58
58
|
## The `filterBy` rules
|
|
59
59
|
|
|
@@ -47,7 +47,7 @@ Two pieces, always:
|
|
|
47
47
|
|
|
48
48
|
No separate `*.request.ts` alias file. `RequestHandler<Request<TSchema>>` types `request.validated()` directly off the schema's inferred type.
|
|
49
49
|
|
|
50
|
-
Scaffold with `
|
|
50
|
+
Scaffold with `npx warlock generate.controller <module>/<action> --with-validation`. If the scaffolder emits a `requests/<action>.request.ts` file, delete it — the inline pattern is the convention.
|
|
51
51
|
|
|
52
52
|
## The `v.*` factory surface
|
|
53
53
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: warlock-doctor
|
|
3
|
-
description: 'Run `warlock doctor` — a read-only diagnostics command that checks routes / config / connectors / optional-peers / health endpoints / release hygiene and prints a pass/warn/fail report, exiting non-zero on any failure. Add your own probe with the `DoctorCheck` contract and `runChecks` / `formatReportLines`. Triggers: `warlock doctor`, `doctorCommand`, `DoctorCheck`, `CheckResult`, `CheckStatus`, `DoctorReport`, `runChecks`, `formatReportLines`, `printReport`, `defaultDoctorChecks`; "diagnose my app", "preflight / preflight check", "is the app healthy", "why are there 0 routes", "pre-release sanity check", "CI smoke check"; run as `
|
|
3
|
+
description: 'Run `warlock doctor` — a read-only diagnostics command that checks routes / config / connectors / optional-peers / health endpoints / release hygiene and prints a pass/warn/fail report, exiting non-zero on any failure. Add your own probe with the `DoctorCheck` contract and `runChecks` / `formatReportLines`. Triggers: `warlock doctor`, `doctorCommand`, `DoctorCheck`, `CheckResult`, `CheckStatus`, `DoctorReport`, `runChecks`, `formatReportLines`, `printReport`, `defaultDoctorChecks`; "diagnose my app", "preflight / preflight check", "is the app healthy", "why are there 0 routes", "pre-release sanity check", "CI smoke check"; run as `npx warlock doctor`. Skip: the live `/health` + `/ready` HTTP probes — `@warlock.js/core/health-checks/SKILL.md`; authoring a general CLI command — `@warlock.js/core/write-cli-command/SKILL.md`; releasing the package — `releasing-warlock-monorepo`; competing tools `npm doctor`, `nest info`, hand-rolled preflight scripts.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Warlock — `warlock doctor`
|
|
@@ -8,7 +8,7 @@ description: 'Run `warlock doctor` — a read-only diagnostics command that chec
|
|
|
8
8
|
`warlock doctor` is a read-only preflight. It boots the app far enough to introspect it — loads every config file and bootstrap code so routes and connectors register — but **starts no connectors**, so it never opens a database, cache, or socket connection. It then runs a set of checks and prints a grouped pass / warn / fail report.
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
|
|
11
|
+
npx warlock doctor
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
```
|
|
@@ -111,7 +111,7 @@ if (report.hasFailures) process.exit(report.exitCode);
|
|
|
111
111
|
### CI / pre-release gate
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
|
|
114
|
+
npx warlock doctor || exit 1 # non-zero exit fails the job
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
A red `release-hygiene` line catches the classic "bumped `package.json` but forgot the CHANGELOG heading" mistake before a publish.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: warlock-routes
|
|
3
|
-
description: 'Run `warlock routes` — a read-only command that lists the registered HTTP routes as a verb-colored table (method / path / name / action / middleware-count / source), a sibling of `warlock doctor`. Filter with `--method` / `--path` / `--name`, or emit normalized rows as JSON with `--json`. Also covers `warlock routes:diff`, which compares live page routes against the last `warlock build`''s route snapshot and exits non-zero on drift. Triggers: `warlock routes`, `routesCommand`, `warlock routes:diff`, `routesDiffCommand`, "list my routes", "show all routes", "route table", "what endpoints does my app expose", "dump routes as JSON", "which routes have middleware", "route map for CI", "did my page routes drift from the last build"; run as `
|
|
3
|
+
description: 'Run `warlock routes` — a read-only command that lists the registered HTTP routes as a verb-colored table (method / path / name / action / middleware-count / source), a sibling of `warlock doctor`. Filter with `--method` / `--path` / `--name`, or emit normalized rows as JSON with `--json`. Also covers `warlock routes:diff`, which compares live page routes against the last `warlock build`''s route snapshot and exits non-zero on drift. Triggers: `warlock routes`, `routesCommand`, `warlock routes:diff`, `routesDiffCommand`, "list my routes", "show all routes", "route table", "what endpoints does my app expose", "dump routes as JSON", "which routes have middleware", "route map for CI", "did my page routes drift from the last build"; run as `npx warlock routes` / `npx warlock routes:diff`. Skip: read-only health/preflight checks — `@warlock.js/core/warlock-doctor/SKILL.md`; defining/naming/grouping routes — `@warlock.js/core/register-route/SKILL.md`; authoring a general CLI command — `@warlock.js/core/write-cli-command/SKILL.md`; competing tools `nest`/`express` route listers, `php artisan route:list`.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Warlock — `warlock routes`
|
|
@@ -8,7 +8,7 @@ description: 'Run `warlock routes` — a read-only command that lists the regist
|
|
|
8
8
|
`warlock routes` lists every registered HTTP route as a table. It's the read-only sibling of [`warlock doctor`](../warlock-doctor/SKILL.md): it boots the app far enough to register route modules — but **starts no connectors**, so it never opens a database, cache, or socket connection.
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
|
|
11
|
+
npx warlock routes
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
```
|
|
@@ -39,10 +39,10 @@ The `METHOD` column is verb-colored (GET green, POST blue, PUT/PATCH yellow, DEL
|
|
|
39
39
|
Optional, case-insensitive, AND-combined:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
npx warlock routes --method GET # -m exact HTTP method
|
|
43
|
+
npx warlock routes --path /users # -p path substring
|
|
44
|
+
npx warlock routes --name users # -n route-name substring
|
|
45
|
+
npx warlock routes -m POST -p /users
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## JSON output
|
|
@@ -50,7 +50,7 @@ pnpm warlock routes -m POST -p /users
|
|
|
50
50
|
`--json` (`-j`) emits the normalized rows instead of the table — for `jq`, a CI diff, or a generated API map. Filters apply before serialization.
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
|
|
53
|
+
npx warlock routes --json
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
```json
|
|
@@ -64,7 +64,7 @@ pnpm warlock routes --json
|
|
|
64
64
|
### Audit which routes are guarded
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
|
|
67
|
+
npx warlock routes --json | jq '[.[] | select(.middleware == 0)]'
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
Surfaces public routes (no middleware) — a quick check that auth-protected paths actually carry a guard.
|
|
@@ -72,7 +72,7 @@ Surfaces public routes (no middleware) — a quick check that auth-protected pat
|
|
|
72
72
|
### Confirm a route registered
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
|
-
|
|
75
|
+
npx warlock routes --name users.create
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
An empty result means the route isn't registered — re-run `warlock dev` and read the boot error (the route-module loader is fail-loud, so a throwing route file aborts boot rather than being silently dropped).
|
|
@@ -82,7 +82,7 @@ An empty result means the route isn't registered — re-run `warlock dev` and re
|
|
|
82
82
|
Compares the **live dev-server page routes** (`router.list().filter(r => r.isPage)`) against a **snapshot written by the last successful `warlock build`** (`page-routes.manifest.json` in `resolveBuildConfig().outdir`, e.g. `dist/page-routes.manifest.json`). Boots the same diagnostic way as `warlock routes` — route modules registered, no connectors started — then diffs.
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
|
|
85
|
+
npx warlock routes:diff
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
```
|
|
@@ -39,7 +39,7 @@ export default command({
|
|
|
39
39
|
});
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
Run it: `
|
|
42
|
+
Run it: `npx warlock users.promote --email=hasan@example.com` (or `npx warlock up -e hasan@example.com`).
|
|
43
43
|
|
|
44
44
|
## `CLICommandOptions` — the factory input
|
|
45
45
|
|
|
@@ -36,12 +36,12 @@ export default seeder({
|
|
|
36
36
|
Run them:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
npx warlock seed # discover + run all
|
|
40
|
+
npx warlock seed --list # show registry, don't run
|
|
41
|
+
npx warlock seed --path=src/app/roles/seeds/default-roles.seed.ts # one file
|
|
42
|
+
npx warlock seed --fresh # truncate every table first, then run all
|
|
43
|
+
npx warlock seed --drop # undo every tracked record, reset the log
|
|
44
|
+
npx warlock seed --drop=default-roles # undo just one seeder's records
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
`--fresh` truncates **every** table in the DB (`datasource.driver.truncateTable(table, { cascade: true })`), including the `seeds` tracking table. After `--fresh`, `once: true` seeds will run again.
|
|
@@ -179,8 +179,8 @@ Every record you `track()` is written to a `seed_records` table (created on firs
|
|
|
179
179
|
`warlock seed --drop` reads those refs and undoes the seed:
|
|
180
180
|
|
|
181
181
|
```bash
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
npx warlock seed --drop # undo every tracked record across all seeders
|
|
183
|
+
npx warlock seed --drop=default-roles # undo just one seeder's records
|
|
184
184
|
```
|
|
185
185
|
|
|
186
186
|
What it does, inside a single transaction:
|