@warlock.js/core 5.18.0 → 5.19.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/esm/generations/add-command.action.mjs +9 -2
  3. package/esm/generations/add-command.action.mjs.map +1 -1
  4. package/esm/generations/pnpm-build-approvals.mjs +29 -0
  5. package/esm/generations/pnpm-build-approvals.mjs.map +1 -0
  6. package/esm/http/response.d.mts +3 -3
  7. package/esm/http/response.d.mts.map +1 -1
  8. package/esm/index.d.mts +2 -2
  9. package/esm/router/index.d.mts +1 -1
  10. package/esm/router/router.d.mts +8 -1
  11. package/esm/router/router.d.mts.map +1 -1
  12. package/esm/router/router.mjs +13 -0
  13. package/esm/router/router.mjs.map +1 -1
  14. package/esm/router/types.d.mts +7 -1
  15. package/esm/router/types.d.mts.map +1 -1
  16. package/llms-full.txt +54 -41
  17. package/llms.txt +41 -41
  18. package/package.json +11 -11
  19. package/skills/add-connector/SKILL.md +1 -1
  20. package/skills/benchmark-code/SKILL.md +1 -1
  21. package/skills/build-restful/SKILL.md +1 -1
  22. package/skills/build-url/SKILL.md +1 -1
  23. package/skills/configure-app/SKILL.md +1 -1
  24. package/skills/create-controller/SKILL.md +1 -1
  25. package/skills/create-module/SKILL.md +1 -1
  26. package/skills/define-resource/SKILL.md +1 -1
  27. package/skills/encrypt-data/SKILL.md +1 -1
  28. package/skills/hash-password/SKILL.md +1 -1
  29. package/skills/health-checks/SKILL.md +1 -1
  30. package/skills/lower-stage3-decorators/SKILL.md +1 -1
  31. package/skills/process-image/SKILL.md +1 -1
  32. package/skills/register-route/SKILL.md +14 -1
  33. package/skills/request-memo/SKILL.md +1 -1
  34. package/skills/request-tracing/SKILL.md +1 -1
  35. package/skills/resolve-path/SKILL.md +1 -1
  36. package/skills/retry-operation/SKILL.md +1 -1
  37. package/skills/run-app/SKILL.md +1 -1
  38. package/skills/send-mail/SKILL.md +1 -1
  39. package/skills/send-response/SKILL.md +1 -1
  40. package/skills/store-file/SKILL.md +1 -1
  41. package/skills/test-http/SKILL.md +1 -1
  42. package/skills/test-service/SKILL.md +1 -1
  43. package/skills/update-packages/SKILL.md +1 -1
  44. package/skills/upload-file/SKILL.md +1 -1
  45. package/skills/use-app-context/SKILL.md +1 -1
  46. package/skills/use-localization/SKILL.md +1 -1
  47. package/skills/use-middleware/SKILL.md +1 -1
  48. package/skills/use-model-transformers/SKILL.md +1 -1
  49. package/skills/use-repository/SKILL.md +1 -1
  50. package/skills/use-request-locals/SKILL.md +1 -1
  51. package/skills/validate-input/SKILL.md +1 -1
  52. package/skills/warlock-conventions/SKILL.md +1 -1
  53. package/skills/warlock-doctor/SKILL.md +1 -1
  54. package/skills/warlock-routes/SKILL.md +1 -1
  55. package/skills/wire-socket/SKILL.md +1 -1
  56. package/skills/write-cli-command/SKILL.md +1 -1
  57. package/skills/write-middleware/SKILL.md +1 -1
  58. package/skills/write-seeder/SKILL.md +1 -1
  59. package/skills/write-use-case/SKILL.md +1 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: use-middleware
3
- description: 'Attach built-in HTTP middleware to routes via the `middleware` namespace from `@warlock.js/core` — rateLimit, concurrencyLimit, maxBodySize, idempotency, maintenance, ipFilter, cache. Plus `X-Request-Id` correlation, wired automatically. Triggers: `middleware.rateLimit`, `middleware.concurrencyLimit`, `middleware.maxBodySize`, `middleware.idempotency`, `middleware.maintenance`, `middleware.ipFilter`, `middleware.cache`, `X-Request-Id`, `Idempotency-Key`; "add rate limiting", "dedupe writes by idempotency key", "cap concurrent requests", "block IPs", "cache a GET response"; typical import `import { middleware } from "@warlock.js/core"`. Skip: author custom middleware — `@warlock.js/core/write-middleware/SKILL.md`; cache singleton — `@warlock.js/cache/cache-basics/SKILL.md`; competing libs `@fastify/rate-limit` direct, `express-rate-limit`, `helmet`.'
3
+ description: "Warlock — use built-in middleware in @warlock.js/core; use when you need to use middleware."
4
4
  ---
5
5
 
6
6
  # Warlock — use built-in middleware
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: use-model-transformers
3
- description: 'Three schema-side helpers — `useHashedPassword()` (bcrypt on save) attaches via `.addTransformer(...)`; `useComputedSlug(field?, scope?)` (auto-slug from another field) and `useComputedModel(callback)` (arbitrary computed-on-save value) attach via `v.computed(...)`. Triggers: `useHashedPassword`, `useComputedSlug`, `useComputedModel`, `.addTransformer`, `v.computed`, `ComputedCallback`; "auto-hash a password field", "auto-slug from title on save", "derive a value at write time", "declarative model transformers"; typical import `import { useHashedPassword, useComputedSlug } from "@warlock.js/core"`. Skip: bcrypt setup details — `@warlock.js/core/hash-password/SKILL.md`; repository writes — `@warlock.js/core/use-repository/SKILL.md`; output filtering — `@warlock.js/core/define-resource/SKILL.md`; competing patterns: manual `await hashPassword(input)` in services, ORM lifecycle hooks.'
3
+ description: "Warlock — declare model transformers in @warlock.js/core; use when you need to use model transformers."
4
4
  ---
5
5
 
6
6
  # Warlock — declare model transformers
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: use-repository
3
- description: 'Subclass `RepositoryManager` for data access — declare `source`, `filterBy`, `defaultOptions`, then call `list()`/`listCached()`/`find()`/`create()`/`update()`/`delete()`, the active/cached/cursor variants, and the `filterBy`-aware aggregates `sum()`/`avg()`/`min()`/`max()`/`groupBy()`/`aggregate()`. Triggers: `RepositoryManager`, `FilterRules`, `RepositoryOptions`, `.list`, `.listCached`, `.find`, `.findCached`, `.create`, `.update`, `.delete`, `.sum`, `.avg`, `.min`, `.max`, `.groupBy`, `.aggregate`, `simpleSelectColumns`; "create a repository", "filter rules for a list endpoint", "cursor vs page pagination", "cached vs uncached read", "sum/avg/group-by with filters"; typical import `import { RepositoryManager } from "@warlock.js/core"`. Skip: cache singleton — `@warlock.js/cache/cache-basics/SKILL.md`; use-case pipelines — `@warlock.js/core/write-use-case/SKILL.md`; wire mapping — `@warlock.js/core/define-resource/SKILL.md`; competing libs `typeorm` Repository, `prisma.client.<model>`, `@nestjs/typeorm`.'
3
+ description: "Warlock — use a repository in @warlock.js/core; use when you need to use repository."
4
4
  ---
5
5
 
6
6
  # Warlock — use a repository
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: use-request-locals
3
- description: '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.'
3
+ description: "Warlock — use typed request locals in @warlock.js/core; use when you need to use request locals."
4
4
  ---
5
5
 
6
6
  # Warlock — use typed request locals
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: validate-input
3
- description: '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`.'
3
+ description: "Warlock — validate a request in @warlock.js/core; use when you need to validate input."
4
4
  ---
5
5
 
6
6
  # Warlock — validate a request
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: warlock-conventions
3
- description: '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.'
3
+ description: "Warlock — framework-wide conventions in @warlock.js/core; use when you need to warlock conventions."
4
4
  ---
5
5
 
6
6
  # Warlock — framework-wide conventions
@@ -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 `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.'
3
+ description: "Warlock — warlock doctor in @warlock.js/core; use when you need to warlock doctor."
4
4
  ---
5
5
 
6
6
  # Warlock — `warlock doctor`
@@ -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 `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`.'
3
+ description: "Warlock — warlock routes in @warlock.js/core; use when you need to warlock routes."
4
4
  ---
5
5
 
6
6
  # Warlock — `warlock routes`
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wire-socket
3
- description: '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`.'
3
+ description: "Warlock — wire a Socket.IO server in @warlock.js/core; use when you need to wire socket."
4
4
  ---
5
5
 
6
6
  # Warlock — wire a Socket.IO server
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-cli-command
3
- description: '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`, `warlock add bull-board`, `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`.'
3
+ description: "Warlock — write a CLI command in @warlock.js/core; use when you need to write cli command."
4
4
  ---
5
5
 
6
6
  # Warlock — write a CLI command
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-middleware
3
- description: '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.'
3
+ description: "Warlock — write a middleware in @warlock.js/core; use when you need to write middleware."
4
4
  ---
5
5
 
6
6
  # Warlock — write a middleware
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-seeder
3
- description: 'Author a seed file under `src/app/<module>/seeds/<name>.ts` using the `seeder()` factory — `name`, `dependsOn`, `once`, `order`, `batchSize`, `run({ track, now, batchSize })`. Auto-discovered by `warlock seed`; tracked in a `seeds` table; per-record refs in `seed_records` so `warlock seed --drop` can undo a seed. Triggers: `seeder`, `Seeder`, `SeedResult`, `SeedContext`, `SeedClock`, `track`, `now`, `batchSize`, `SeedersManager`, `warlock seed`, `--fresh`, `--drop`, `--list`, `--path`; "seed default roles", "undo a seed", "one-time data migration", "auto-discovered seeds", "order seeds by dependency", "deterministic seed timestamps", "inject a seed clock"; typical import `import { seeder } from "@warlock.js/core"`. Skip: module folder layout — `@warlock.js/core/create-module/SKILL.md`; repository CRUD — `@warlock.js/core/use-repository/SKILL.md`; CLI flags — `@warlock.js/core/write-cli-command/SKILL.md`; competing patterns: hand-rolled `node scripts/seed.js`, `typeorm-seeding`.'
3
+ description: "Warlock — write a seeder in @warlock.js/core; use when you need to write seeder."
4
4
  ---
5
5
 
6
6
  # Warlock — write a seeder
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: write-use-case
3
- description: 'Author `useCase()` pipelines for business logic — guards, schema, before/after middleware, retry, benchmark, broadcast, lifecycle callbacks; transport-agnostic and observable by default. Input is inferred from the `schema`. Triggers: `useCase`, `UseCaseContext`, `UseCaseResult`, `retry`, `benchmark`, `broadcast`, `description`, `globalUseCasesEvents`, `UseCaseBroadcastChannel`; "encapsulate a business operation", "share logic between HTTP and CLI", "add guards and lifecycle hooks", "broadcast a use case result", "transport-agnostic pipeline"; typical import `import { useCase } from "@warlock.js/core"`. Skip: thin handler shape — `@warlock.js/core/create-controller/SKILL.md`; schema details — `@warlock.js/core/validate-input/SKILL.md`; the standalone retry util — `@warlock.js/core/retry-operation/SKILL.md`; competing libs `@nestjs/cqrs`, `inversify`, hand-rolled service classes.'
3
+ description: "Warlock — write a use case in @warlock.js/core; use when you need to write use case."
4
4
  ---
5
5
 
6
6
  # Warlock — write a use case