@warlock.js/core 5.34.2 → 5.34.3
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 +18 -0
- package/esm/e2e/browser.d.mts.map +1 -1
- package/esm/e2e/browser.mjs +3 -1
- package/esm/e2e/browser.mjs.map +1 -1
- package/esm/e2e/types.d.mts +6 -0
- package/esm/e2e/types.d.mts.map +1 -1
- package/esm/e2e/types.mjs.map +1 -1
- package/esm/http/error-response.d.mts +12 -0
- package/esm/http/error-response.d.mts.map +1 -0
- package/esm/http/error-response.mjs +41 -0
- package/esm/http/error-response.mjs.map +1 -0
- package/esm/http/index.d.mts +3 -2
- package/esm/http/response.d.mts +2 -0
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +2 -0
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +2 -0
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/types.d.mts +7 -0
- package/esm/http/types.d.mts.map +1 -1
- package/esm/index.d.mts +3 -2
- package/esm/upgrade/codemods/toolchain-templates.mjs +3 -1
- package/esm/upgrade/codemods/toolchain-templates.mjs.map +1 -1
- package/llms-full.txt +120 -61
- package/llms.txt +56 -56
- package/package.json +13 -13
- package/skills/configure-app/SKILL.md +27 -0
- package/skills/generate-openapi/SKILL.md +1 -1
- package/skills/index.md +1 -1
- package/skills/send-response/SKILL.md +27 -0
- package/skills/test-browser/SKILL.md +1 -0
- package/skills/upgrade-from-5-29/SKILL.md +4 -0
- package/skills/warlock-trace/SKILL.md +2 -2
- package/skills/write-cli-command/SKILL.md +2 -2
package/llms-full.txt
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
## Package orientation
|
|
8
8
|
|
|
9
9
|
---
|
|
10
|
-
description:
|
|
10
|
+
description: 'Warlock application runtime: `router`, `Request`, `Response`, `config`, `env`, `sendMail` and `defineConfig`. Use for "add an API route", controllers, middleware, CLI commands, config, uploads, mail, sockets, OpenAPI, testing or upgrades. Not this package → @warlock.js/web for React SSR pages; @warlock.js/cascade for database queries; @warlock.js/seal for standalone schemas; @warlock.js/auth for login.'
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# @warlock.js/core
|
|
@@ -45,7 +45,7 @@ When the framework is wrong or missing a capability, follow the `report-framewor
|
|
|
45
45
|
- Prefer typed model getters over scattered `.get<T>("field")` casts.
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
## add-connector `@warlock.js/core/add-connector/SKILL.md`
|
|
48
|
+
## add-connector `@warlock.js/core/skills/add-connector/SKILL.md`
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
name: add-connector
|
|
@@ -277,7 +277,7 @@ See the [Registering a connector](#registering-a-connector) section above for th
|
|
|
277
277
|
- The `warlock-conventions` topic — module layout, canonical imports.
|
|
278
278
|
|
|
279
279
|
|
|
280
|
-
## benchmark-code `@warlock.js/core/benchmark-code/SKILL.md`
|
|
280
|
+
## benchmark-code `@warlock.js/core/skills/benchmark-code/SKILL.md`
|
|
281
281
|
|
|
282
282
|
---
|
|
283
283
|
name: benchmark-code
|
|
@@ -543,7 +543,7 @@ The `latency` is the _total_ time including retries — useful for the SLO you a
|
|
|
543
543
|
- The `configure-app` topic — wiring `src/config/benchmark.ts`.
|
|
544
544
|
|
|
545
545
|
|
|
546
|
-
## build-restful `@warlock.js/core/build-restful/SKILL.md`
|
|
546
|
+
## build-restful `@warlock.js/core/skills/build-restful/SKILL.md`
|
|
547
547
|
|
|
548
548
|
---
|
|
549
549
|
name: build-restful
|
|
@@ -815,7 +815,7 @@ router.restfulResource("/orders", new OrdersRestful());
|
|
|
815
815
|
- The `warlock-conventions` topic — controller/service/repository layering rules.
|
|
816
816
|
|
|
817
817
|
|
|
818
|
-
## build-url `@warlock.js/core/build-url/SKILL.md`
|
|
818
|
+
## build-url `@warlock.js/core/skills/build-url/SKILL.md`
|
|
819
819
|
|
|
820
820
|
---
|
|
821
821
|
name: build-url
|
|
@@ -999,7 +999,7 @@ Don't call `setBaseUrl` per request — it's process-global and races every othe
|
|
|
999
999
|
- The `configure-app` topic — `src/config/app.ts` and the `baseUrl` env wiring.
|
|
1000
1000
|
|
|
1001
1001
|
|
|
1002
|
-
## configure-app `@warlock.js/core/configure-app/SKILL.md`
|
|
1002
|
+
## configure-app `@warlock.js/core/skills/configure-app/SKILL.md`
|
|
1003
1003
|
|
|
1004
1004
|
---
|
|
1005
1005
|
name: configure-app
|
|
@@ -1425,8 +1425,35 @@ Keep the domain error class in an app module imported by both the service and
|
|
|
1425
1425
|
this config. Return `undefined` for errors you do not recognize; a mapped 5xx
|
|
1426
1426
|
is opaque unless the mapper explicitly chooses a public message.
|
|
1427
1427
|
|
|
1428
|
+
## Format every JSON error response
|
|
1428
1429
|
|
|
1429
|
-
|
|
1430
|
+
`http.errorMapper` classifies thrown non-`HttpError` errors as `{ status, message?, payload? }`. It does not see existing `HttpError` subclasses, returned validation errors, helper responses, unmatched routes, or global rate-limit failures.
|
|
1431
|
+
|
|
1432
|
+
Use `http.errorResponse` when the application needs one JSON error envelope across those paths:
|
|
1433
|
+
|
|
1434
|
+
```ts title="src/config/http.ts"
|
|
1435
|
+
import type { HttpConfigurations } from "@warlock.js/core";
|
|
1436
|
+
|
|
1437
|
+
export default {
|
|
1438
|
+
errorMapper: () => ({ status: 500 }),
|
|
1439
|
+
errorResponse({ status, requestId }) {
|
|
1440
|
+
return {
|
|
1441
|
+
error: {
|
|
1442
|
+
code: status >= 500 ? "serverError" : `http${status}`,
|
|
1443
|
+
message: status >= 500 ? "Internal server error." : "Request failed.",
|
|
1444
|
+
},
|
|
1445
|
+
requestId,
|
|
1446
|
+
};
|
|
1447
|
+
},
|
|
1448
|
+
} satisfies HttpConfigurations;
|
|
1449
|
+
```
|
|
1450
|
+
|
|
1451
|
+
The synchronous formatter receives `HttpErrorResponseContext`: `{ status: number, body: unknown, requestId: string }`. Narrow `body` before reading fields; it is the parsed, serialized JSON body. Return a JSON-serializable object or `undefined` to keep the original. The formatter changes only the body, preserving the HTTP status and headers except for recalculated content length, a `private, no-store` cache policy, and the correlation header. If it throws or cannot serialize its result, core logs the formatter error and retains the original body.
|
|
1452
|
+
|
|
1453
|
+
The hook covers status 400–599 with `application/json` or an `application/*+json` content type, including Fastify parsing errors, unmatched-route 404s, validation 422s, rate-limit 429s, and 500s. Warlock responses use the ID already stamped from `request.id`. Before Warlock creates a Request, the formatter receives Fastify's `request.id` and echoes that same value under `http.requestId.header` (default `X-Request-Id`). Setting `http.requestId.enabled: false` suppresses that header; without a stamped Warlock ID, the formatter falls back to Fastify's request ID even for routed responses. Keep request-ID headers enabled when the body must correlate with Warlock request logs. HTML pages, files, raw text, streams, and errors after headers have been sent are not reformatted. With no formatter configured, existing response shapes are unchanged.
|
|
1454
|
+
|
|
1455
|
+
|
|
1456
|
+
## create-controller `@warlock.js/core/skills/create-controller/SKILL.md`
|
|
1430
1457
|
|
|
1431
1458
|
---
|
|
1432
1459
|
name: create-controller
|
|
@@ -1725,7 +1752,7 @@ export const remoteCatalogController: RequestHandler = async ({ request, respons
|
|
|
1725
1752
|
```
|
|
1726
1753
|
|
|
1727
1754
|
|
|
1728
|
-
## create-module `@warlock.js/core/create-module/SKILL.md`
|
|
1755
|
+
## create-module `@warlock.js/core/skills/create-module/SKILL.md`
|
|
1729
1756
|
|
|
1730
1757
|
---
|
|
1731
1758
|
name: create-module
|
|
@@ -1926,7 +1953,7 @@ After editing generated code, run `npm run format` and `npm run lint:check`.
|
|
|
1926
1953
|
Formatting retains unused imports; the linter reports them.
|
|
1927
1954
|
|
|
1928
1955
|
|
|
1929
|
-
## define-resource `@warlock.js/core/define-resource/SKILL.md`
|
|
1956
|
+
## define-resource `@warlock.js/core/skills/define-resource/SKILL.md`
|
|
1930
1957
|
|
|
1931
1958
|
---
|
|
1932
1959
|
name: define-resource
|
|
@@ -2333,7 +2360,7 @@ export const CommentResource = defineResource({
|
|
|
2333
2360
|
- The `create-controller` topic — calling `new XResource(record).toJSON()` from a controller.
|
|
2334
2361
|
|
|
2335
2362
|
|
|
2336
|
-
## encrypt-data `@warlock.js/core/encrypt-data/SKILL.md`
|
|
2363
|
+
## encrypt-data `@warlock.js/core/skills/encrypt-data/SKILL.md`
|
|
2337
2364
|
|
|
2338
2365
|
---
|
|
2339
2366
|
name: encrypt-data
|
|
@@ -2547,11 +2574,11 @@ Password hashing (`hashPassword`) needs `bcryptjs`, which is its own install —
|
|
|
2547
2574
|
- The `warlock-conventions` topic — service layering, where the encryption boundary should sit.
|
|
2548
2575
|
|
|
2549
2576
|
|
|
2550
|
-
## generate-openapi `@warlock.js/core/generate-openapi/SKILL.md`
|
|
2577
|
+
## generate-openapi `@warlock.js/core/skills/generate-openapi/SKILL.md`
|
|
2551
2578
|
|
|
2552
2579
|
---
|
|
2553
2580
|
name: generate-openapi
|
|
2554
|
-
description: 'Generate an OpenAPI 3.1 document from the registered routes with `warlock generate.openapi` (default `storage/openapi/openapi.json`), write a Postman collection from it with `warlock generate.postman` (default `storage/postman/collection.json`), and read it live in the dev-only API docs page at `/__warlock/docs`. Documents paths, path/query parameters, request bodies from Seal validation, responses from `handler.responseSchema`, 401/422 and bearer/cookie security from `authMiddleware()`. Triggers: `generate.openapi`, `openApiGeneratorCommand`, `buildOpenApiDocument`, `getDevelopmentOpenApiDocument`, `generate.postman`, `openApiToPostmanCollection`, `getDevelopmentPostmanCollection`, `responseSchema`, `--include-pages`, `/__warlock/docs`; "OpenAPI", "Swagger", "API docs", "import my API into Postman or Insomnia", "document my routes". Skip: declaring response types on a handler — the `create-controller` topic; the devtools dashboard — the `
|
|
2581
|
+
description: 'Generate an OpenAPI 3.1 document from the registered routes with `warlock generate.openapi` (default `storage/openapi/openapi.json`), write a Postman collection from it with `warlock generate.postman` (default `storage/postman/collection.json`), and read it live in the dev-only API docs page at `/__warlock/docs`. Documents paths, path/query parameters, request bodies from Seal validation, responses from `handler.responseSchema`, 401/422 and bearer/cookie security from `authMiddleware()`. Triggers: `generate.openapi`, `openApiGeneratorCommand`, `buildOpenApiDocument`, `getDevelopmentOpenApiDocument`, `generate.postman`, `openApiToPostmanCollection`, `getDevelopmentPostmanCollection`, `responseSchema`, `--include-pages`, `/__warlock/docs`; "OpenAPI", "Swagger", "API docs", "import my API into Postman or Insomnia", "document my routes". Skip: declaring response types on a handler — the `create-controller` topic; the devtools dashboard — the `warlock-js-devtools` skill; listing routes — the `warlock-routes` topic.'
|
|
2555
2582
|
---
|
|
2556
2583
|
|
|
2557
2584
|
# Warlock — generate an OpenAPI document
|
|
@@ -2725,7 +2752,7 @@ const { document, warnings } = buildOpenApiDocument(router.list(), {
|
|
|
2725
2752
|
- The `warlock-routes` topic — list the routes the document is built from.
|
|
2726
2753
|
|
|
2727
2754
|
|
|
2728
|
-
## hash-password `@warlock.js/core/hash-password/SKILL.md`
|
|
2755
|
+
## hash-password `@warlock.js/core/skills/hash-password/SKILL.md`
|
|
2729
2756
|
|
|
2730
2757
|
---
|
|
2731
2758
|
name: hash-password
|
|
@@ -2912,7 +2939,7 @@ There is no `warlock add` feature for password hashing — `bcryptjs` is a plain
|
|
|
2912
2939
|
- The `warlock-conventions` topic — service layering, where the password boundary should sit.
|
|
2913
2940
|
|
|
2914
2941
|
|
|
2915
|
-
## health-checks `@warlock.js/core/health-checks/SKILL.md`
|
|
2942
|
+
## health-checks `@warlock.js/core/skills/health-checks/SKILL.md`
|
|
2916
2943
|
|
|
2917
2944
|
---
|
|
2918
2945
|
name: health-checks
|
|
@@ -3054,7 +3081,7 @@ For an even smoother handoff, give the load balancer time to observe the 503 bef
|
|
|
3054
3081
|
- The `use-middleware` topic — maintenance mode and other built-in middleware.
|
|
3055
3082
|
|
|
3056
3083
|
|
|
3057
|
-
## lower-stage3-decorators `@warlock.js/core/lower-stage3-decorators/SKILL.md`
|
|
3084
|
+
## lower-stage3-decorators `@warlock.js/core/skills/lower-stage3-decorators/SKILL.md`
|
|
3058
3085
|
|
|
3059
3086
|
---
|
|
3060
3087
|
name: lower-stage3-decorators
|
|
@@ -3114,7 +3141,7 @@ It's the **same esbuild transform the production `tsx`/build path uses**, so a f
|
|
|
3114
3141
|
- The `write-migration` topic of the `warlock-js-cascade` skill — the decorated models this plugin lets you load.
|
|
3115
3142
|
|
|
3116
3143
|
|
|
3117
|
-
## make-endpoint `@warlock.js/core/make-endpoint/SKILL.md`
|
|
3144
|
+
## make-endpoint `@warlock.js/core/skills/make-endpoint/SKILL.md`
|
|
3118
3145
|
|
|
3119
3146
|
---
|
|
3120
3147
|
name: make-endpoint
|
|
@@ -3228,7 +3255,7 @@ Every `generate.*` command, `make`, and `add` take both. `--dry-run` writes (and
|
|
|
3228
3255
|
- The `generate-openapi` topic — what `responseSchema` documents.
|
|
3229
3256
|
|
|
3230
3257
|
|
|
3231
|
-
## model-factories `@warlock.js/core/model-factories/SKILL.md`
|
|
3258
|
+
## model-factories `@warlock.js/core/skills/model-factories/SKILL.md`
|
|
3232
3259
|
|
|
3233
3260
|
---
|
|
3234
3261
|
name: model-factories
|
|
@@ -3324,7 +3351,7 @@ it("lists users", async () => {
|
|
|
3324
3351
|
- The `write-seeder` topic — seeding a development database.
|
|
3325
3352
|
|
|
3326
3353
|
|
|
3327
|
-
## process-image `@warlock.js/core/process-image/SKILL.md`
|
|
3354
|
+
## process-image `@warlock.js/core/skills/process-image/SKILL.md`
|
|
3328
3355
|
|
|
3329
3356
|
---
|
|
3330
3357
|
name: process-image
|
|
@@ -3501,7 +3528,7 @@ See the `upload-file` topic for the multipart entry point and the `store-file` t
|
|
|
3501
3528
|
- The `warlock-conventions` topic — where image-processing services live.
|
|
3502
3529
|
|
|
3503
3530
|
|
|
3504
|
-
## register-route `@warlock.js/core/register-route/SKILL.md`
|
|
3531
|
+
## register-route `@warlock.js/core/skills/register-route/SKILL.md`
|
|
3505
3532
|
|
|
3506
3533
|
---
|
|
3507
3534
|
name: register-route
|
|
@@ -3786,7 +3813,7 @@ router.get("/webhooks/status", webhookStatusController, { rateLimit: false });
|
|
|
3786
3813
|
- The `warlock-conventions` topic — module layout, the `guarded` convention, path aliases.
|
|
3787
3814
|
|
|
3788
3815
|
|
|
3789
|
-
## report-framework-issue `@warlock.js/core/report-framework-issue/SKILL.md`
|
|
3816
|
+
## report-framework-issue `@warlock.js/core/skills/report-framework-issue/SKILL.md`
|
|
3790
3817
|
|
|
3791
3818
|
---
|
|
3792
3819
|
name: report-framework-issue
|
|
@@ -3949,7 +3976,7 @@ GitHub CLI flags: [list](https://cli.github.com/manual/gh_issue_list),
|
|
|
3949
3976
|
[authentication](https://cli.github.com/manual/gh_auth_status).
|
|
3950
3977
|
|
|
3951
3978
|
|
|
3952
|
-
## request-memo `@warlock.js/core/request-memo/SKILL.md`
|
|
3979
|
+
## request-memo `@warlock.js/core/skills/request-memo/SKILL.md`
|
|
3953
3980
|
|
|
3954
3981
|
---
|
|
3955
3982
|
name: request-memo
|
|
@@ -4095,7 +4122,7 @@ Reusing one key for different result types is a caller bug: TypeScript cannot co
|
|
|
4095
4122
|
- The `create-controller` topic — consuming request-scoped values from controllers.
|
|
4096
4123
|
|
|
4097
4124
|
|
|
4098
|
-
## request-tracing `@warlock.js/core/request-tracing/SKILL.md`
|
|
4125
|
+
## request-tracing `@warlock.js/core/skills/request-tracing/SKILL.md`
|
|
4099
4126
|
|
|
4100
4127
|
---
|
|
4101
4128
|
name: request-tracing
|
|
@@ -4333,7 +4360,7 @@ export default httpConfig;
|
|
|
4333
4360
|
- The `logger-basics` topic of the `warlock-js-logger` skill — structured logging; tracing hooks are the place to bridge phase timing into your log channel.
|
|
4334
4361
|
|
|
4335
4362
|
|
|
4336
|
-
## resolve-path `@warlock.js/core/resolve-path/SKILL.md`
|
|
4363
|
+
## resolve-path `@warlock.js/core/skills/resolve-path/SKILL.md`
|
|
4337
4364
|
|
|
4338
4365
|
---
|
|
4339
4366
|
name: resolve-path
|
|
@@ -4508,7 +4535,7 @@ If you find yourself reaching for `path.join(process.cwd(), ...)` — that's a s
|
|
|
4508
4535
|
- The `upload-file` topic — the `UploadedFile` shape that pairs with `uploadsPath`.
|
|
4509
4536
|
|
|
4510
4537
|
|
|
4511
|
-
## retry-operation `@warlock.js/core/retry-operation/SKILL.md`
|
|
4538
|
+
## retry-operation `@warlock.js/core/skills/retry-operation/SKILL.md`
|
|
4512
4539
|
|
|
4513
4540
|
---
|
|
4514
4541
|
name: retry-operation
|
|
@@ -4630,7 +4657,7 @@ const result = await measure("publish-event", () =>
|
|
|
4630
4657
|
- The `write-use-case` topic — the use-case `retry` option.
|
|
4631
4658
|
|
|
4632
4659
|
|
|
4633
|
-
## run-app `@warlock.js/core/run-app/SKILL.md`
|
|
4660
|
+
## run-app `@warlock.js/core/skills/run-app/SKILL.md`
|
|
4634
4661
|
|
|
4635
4662
|
---
|
|
4636
4663
|
name: run-app
|
|
@@ -5350,7 +5377,7 @@ directly. Regression tests cover both paths without inherited loader hooks,
|
|
|
5350
5377
|
including configured declaration roots, source updates and deleted declarations.
|
|
5351
5378
|
|
|
5352
5379
|
|
|
5353
|
-
## send-mail `@warlock.js/core/send-mail/SKILL.md`
|
|
5380
|
+
## send-mail `@warlock.js/core/skills/send-mail/SKILL.md`
|
|
5354
5381
|
|
|
5355
5382
|
---
|
|
5356
5383
|
name: send-mail
|
|
@@ -5756,7 +5783,7 @@ await Mail.to(user.email)
|
|
|
5756
5783
|
- The `warlock-conventions` topic — where mail-sending services live.
|
|
5757
5784
|
|
|
5758
5785
|
|
|
5759
|
-
## send-response `@warlock.js/core/send-response/SKILL.md`
|
|
5786
|
+
## send-response `@warlock.js/core/skills/send-response/SKILL.md`
|
|
5760
5787
|
|
|
5761
5788
|
---
|
|
5762
5789
|
name: send-response
|
|
@@ -6242,8 +6269,35 @@ export function requireProduct<T>(product: T | null | undefined): T {
|
|
|
6242
6269
|
}
|
|
6243
6270
|
```
|
|
6244
6271
|
|
|
6272
|
+
## Format every JSON error response
|
|
6273
|
+
|
|
6274
|
+
`http.errorMapper` classifies thrown non-`HttpError` errors as `{ status, message?, payload? }`. It does not see existing `HttpError` subclasses, returned validation errors, helper responses, unmatched routes, or global rate-limit failures.
|
|
6245
6275
|
|
|
6246
|
-
|
|
6276
|
+
Use `http.errorResponse` when the application needs one JSON error envelope across those paths:
|
|
6277
|
+
|
|
6278
|
+
```ts title="src/config/http.ts"
|
|
6279
|
+
import type { HttpConfigurations } from "@warlock.js/core";
|
|
6280
|
+
|
|
6281
|
+
export default {
|
|
6282
|
+
errorMapper: () => ({ status: 500 }),
|
|
6283
|
+
errorResponse({ status, requestId }) {
|
|
6284
|
+
return {
|
|
6285
|
+
error: {
|
|
6286
|
+
code: status >= 500 ? "serverError" : `http${status}`,
|
|
6287
|
+
message: status >= 500 ? "Internal server error." : "Request failed.",
|
|
6288
|
+
},
|
|
6289
|
+
requestId,
|
|
6290
|
+
};
|
|
6291
|
+
},
|
|
6292
|
+
} satisfies HttpConfigurations;
|
|
6293
|
+
```
|
|
6294
|
+
|
|
6295
|
+
The synchronous formatter receives `HttpErrorResponseContext`: `{ status: number, body: unknown, requestId: string }`. Narrow `body` before reading fields; it is the parsed, serialized JSON body. Return a JSON-serializable object or `undefined` to keep the original. The formatter changes only the body, preserving the HTTP status and headers except for recalculated content length, a `private, no-store` cache policy, and the correlation header. If it throws or cannot serialize its result, core logs the formatter error and retains the original body.
|
|
6296
|
+
|
|
6297
|
+
The hook covers status 400–599 with `application/json` or an `application/*+json` content type, including Fastify parsing errors, unmatched-route 404s, validation 422s, rate-limit 429s, and 500s. Warlock responses use the ID already stamped from `request.id`. Before Warlock creates a Request, the formatter receives Fastify's `request.id` and echoes that same value under `http.requestId.header` (default `X-Request-Id`). Setting `http.requestId.enabled: false` suppresses that header; without a stamped Warlock ID, the formatter falls back to Fastify's request ID even for routed responses. Keep request-ID headers enabled when the body must correlate with Warlock request logs. HTML pages, files, raw text, streams, and errors after headers have been sent are not reformatted. With no formatter configured, existing response shapes are unchanged.
|
|
6298
|
+
|
|
6299
|
+
|
|
6300
|
+
## store-file `@warlock.js/core/skills/store-file/SKILL.md`
|
|
6247
6301
|
|
|
6248
6302
|
---
|
|
6249
6303
|
name: store-file
|
|
@@ -6691,7 +6745,7 @@ Client `PUT`s the bytes straight to R2 — your server never sees them.
|
|
|
6691
6745
|
- The `send-response` topic — `response.sendFile(absPath)` for serving local files.
|
|
6692
6746
|
|
|
6693
6747
|
|
|
6694
|
-
## store-secrets `@warlock.js/core/store-secrets/SKILL.md`
|
|
6748
|
+
## store-secrets `@warlock.js/core/skills/store-secrets/SKILL.md`
|
|
6695
6749
|
|
|
6696
6750
|
---
|
|
6697
6751
|
name: store-secrets
|
|
@@ -6855,7 +6909,7 @@ The normal test harness still installs `secretsFake`; explicit `backend`
|
|
|
6855
6909
|
instances and that fake continue to bypass configured backend selection.
|
|
6856
6910
|
|
|
6857
6911
|
|
|
6858
|
-
## test-browser `@warlock.js/core/test-browser/SKILL.md`
|
|
6912
|
+
## test-browser `@warlock.js/core/skills/test-browser/SKILL.md`
|
|
6859
6913
|
|
|
6860
6914
|
---
|
|
6861
6915
|
name: test-browser
|
|
@@ -6962,6 +7016,7 @@ port-file handshake above when the app supports binding `0` itself.
|
|
|
6962
7016
|
document. Selector helpers do not enter frames or closed shadow roots.
|
|
6963
7017
|
|
|
6964
7018
|
Use `--browser /path/to/chrome` or `WARLOCK_E2E_BROWSER` if discovery fails.
|
|
7019
|
+
Set `browser.startupTimeoutMs` (default 30 seconds) when the browser is slow to start, for example on shared CI runners.
|
|
6965
7020
|
`browser: { args: ["--no-sandbox"] }` is an explicit option for controlled root
|
|
6966
7021
|
containers; it is not a default. On Windows, command arrays should invoke JS tools
|
|
6967
7022
|
through `process.execPath`, avoiding `.cmd` executables that require a shell.
|
|
@@ -6978,7 +7033,7 @@ if ownership verification fails and reports the failure in evidence. Do not add
|
|
|
6978
7033
|
process-name or port-based kills to a spec.
|
|
6979
7034
|
|
|
6980
7035
|
|
|
6981
|
-
## test-fakes `@warlock.js/core/test-fakes/SKILL.md`
|
|
7036
|
+
## test-fakes `@warlock.js/core/skills/test-fakes/SKILL.md`
|
|
6982
7037
|
|
|
6983
7038
|
---
|
|
6984
7039
|
name: test-fakes
|
|
@@ -7107,7 +7162,7 @@ An unknown fake name or a non-boolean value fails setup with the list of known f
|
|
|
7107
7162
|
- The `model-factories` topic — deterministic fixtures.
|
|
7108
7163
|
|
|
7109
7164
|
|
|
7110
|
-
## test-http `@warlock.js/core/test-http/SKILL.md`
|
|
7165
|
+
## test-http `@warlock.js/core/skills/test-http/SKILL.md`
|
|
7111
7166
|
|
|
7112
7167
|
---
|
|
7113
7168
|
name: test-http
|
|
@@ -7571,7 +7626,7 @@ This is fine for normal test flow. It bites when you're inside a transaction the
|
|
|
7571
7626
|
- The `write-cli-command` topic — `warlock add test` scaffolds both global + worker setup files.
|
|
7572
7627
|
|
|
7573
7628
|
|
|
7574
|
-
## test-service `@warlock.js/core/test-service/SKILL.md`
|
|
7629
|
+
## test-service `@warlock.js/core/skills/test-service/SKILL.md`
|
|
7575
7630
|
|
|
7576
7631
|
---
|
|
7577
7632
|
name: test-service
|
|
@@ -8021,7 +8076,7 @@ setupTest({ importModule: (file) => import(file) });
|
|
|
8021
8076
|
The generated `src/test-setup.ts` already does this. Without it, `setupTest()` under Vitest warns once.
|
|
8022
8077
|
|
|
8023
8078
|
|
|
8024
|
-
## update-packages `@warlock.js/core/update-packages/SKILL.md`
|
|
8079
|
+
## update-packages `@warlock.js/core/skills/update-packages/SKILL.md`
|
|
8025
8080
|
|
|
8026
8081
|
---
|
|
8027
8082
|
name: update-packages
|
|
@@ -8169,7 +8224,7 @@ Two small zero-dependency utilities back the tooling and are exported from `@war
|
|
|
8169
8224
|
- The `configure-app` topic — `warlock.config.ts` shape and `defineConfig`.
|
|
8170
8225
|
|
|
8171
8226
|
|
|
8172
|
-
## upgrade-from-5-29 `@warlock.js/core/upgrade-from-5-29/SKILL.md`
|
|
8227
|
+
## upgrade-from-5-29 `@warlock.js/core/skills/upgrade-from-5-29/SKILL.md`
|
|
8173
8228
|
|
|
8174
8229
|
---
|
|
8175
8230
|
name: upgrade-from-5-29
|
|
@@ -8649,6 +8704,10 @@ It replaces standard scripts/dependencies, pins TypeScript 7.0.2, updates genera
|
|
|
8649
8704
|
editor settings, removes `healthCheckers.eslint` and selects Oxlint. A generated
|
|
8650
8705
|
`.prettierignore` becomes `.oxfmtignore`; Oxfmt scripts read it explicitly.
|
|
8651
8706
|
|
|
8707
|
+
Generated migration configs enable `typescript/no-explicit-any`, `curly`, and
|
|
8708
|
+
`no-console` as errors, matching new apps. Fix those diagnostics before running
|
|
8709
|
+
`npm run lint:check` and `npx warlock check` again.
|
|
8710
|
+
|
|
8652
8711
|
The `oxc-toolchain` codemod also updates generated VS Code settings and literal
|
|
8653
8712
|
ESLint/Oxlint health-check switches. Custom editor settings, checker arrays,
|
|
8654
8713
|
computed options and nonstandard scripts require review. Oxc diagnostics keep
|
|
@@ -8705,7 +8764,7 @@ marker determines the installer: `package-lock.json` plus `pnpm-workspace.yaml`
|
|
|
8705
8764
|
without `pnpm-lock.yaml` now produces `npm install`.
|
|
8706
8765
|
|
|
8707
8766
|
|
|
8708
|
-
## upload-file `@warlock.js/core/upload-file/SKILL.md`
|
|
8767
|
+
## upload-file `@warlock.js/core/skills/upload-file/SKILL.md`
|
|
8709
8768
|
|
|
8710
8769
|
---
|
|
8711
8770
|
name: upload-file
|
|
@@ -9018,7 +9077,7 @@ The reverse direction — sending a stored file back via `response.sendFile(...)
|
|
|
9018
9077
|
- The `warlock-conventions` topic — storage configuration and driver selection.
|
|
9019
9078
|
|
|
9020
9079
|
|
|
9021
|
-
## use-app-context `@warlock.js/core/use-app-context/SKILL.md`
|
|
9080
|
+
## use-app-context `@warlock.js/core/skills/use-app-context/SKILL.md`
|
|
9022
9081
|
|
|
9023
9082
|
---
|
|
9024
9083
|
name: use-app-context
|
|
@@ -9329,7 +9388,7 @@ cors: {
|
|
|
9329
9388
|
- The `warlock-conventions` topic — module layout, where paths point to.
|
|
9330
9389
|
|
|
9331
9390
|
|
|
9332
|
-
## use-localization `@warlock.js/core/use-localization/SKILL.md`
|
|
9391
|
+
## use-localization `@warlock.js/core/skills/use-localization/SKILL.md`
|
|
9333
9392
|
|
|
9334
9393
|
---
|
|
9335
9394
|
name: use-localization
|
|
@@ -9671,7 +9730,7 @@ This produces `account.title` and `account.actions.save`. Keep every leaf comple
|
|
|
9671
9730
|
When a route-locales snapshot applies, `t()` (through the request binding) and `request.transFrom(locale, key, placeholders?)` resolve through it; without one, they retain the existing global-registry behavior. The underlying `transFromKeywords(locale, keywords, key, placeholders?, converter?)` is supplied by `@mongez/localization` 3.5.0. Error pages rebind to their own snapshot, while framework fallback uses the app/root snapshot. Development HMR add/edit/delete publishes a new snapshot, and the snapshot revision keeps page-cache entries from reusing old JSON. Generated `.warlock` typings contain the flattened route keys; do not maintain a second handwritten key union.
|
|
9672
9731
|
|
|
9673
9732
|
|
|
9674
|
-
## use-middleware `@warlock.js/core/use-middleware/SKILL.md`
|
|
9733
|
+
## use-middleware `@warlock.js/core/skills/use-middleware/SKILL.md`
|
|
9675
9734
|
|
|
9676
9735
|
---
|
|
9677
9736
|
name: use-middleware
|
|
@@ -9969,7 +10028,7 @@ router.post("/private/preview", ({ response }) => response.success({ ready: true
|
|
|
9969
10028
|
```
|
|
9970
10029
|
|
|
9971
10030
|
|
|
9972
|
-
## use-model-transformers `@warlock.js/core/use-model-transformers/SKILL.md`
|
|
10031
|
+
## use-model-transformers `@warlock.js/core/skills/use-model-transformers/SKILL.md`
|
|
9973
10032
|
|
|
9974
10033
|
---
|
|
9975
10034
|
name: use-model-transformers
|
|
@@ -10202,7 +10261,7 @@ Rule of thumb: transformers are for **pure, deterministic** transforms of the ro
|
|
|
10202
10261
|
- The `warlock-conventions` topic — schema files live in `src/app/<module>/models/<entity>/<entity>.model.ts`.
|
|
10203
10262
|
|
|
10204
10263
|
|
|
10205
|
-
## use-repository `@warlock.js/core/use-repository/SKILL.md`
|
|
10264
|
+
## use-repository `@warlock.js/core/skills/use-repository/SKILL.md`
|
|
10206
10265
|
|
|
10207
10266
|
---
|
|
10208
10267
|
name: use-repository
|
|
@@ -10636,7 +10695,7 @@ The third arg is a context object — `{ allValues, dateFormat, ... }` — for f
|
|
|
10636
10695
|
- The `warlock-conventions` topic — controller → service → repository → model layering.
|
|
10637
10696
|
|
|
10638
10697
|
|
|
10639
|
-
## use-request-locals `@warlock.js/core/use-request-locals/SKILL.md`
|
|
10698
|
+
## use-request-locals `@warlock.js/core/skills/use-request-locals/SKILL.md`
|
|
10640
10699
|
|
|
10641
10700
|
---
|
|
10642
10701
|
name: use-request-locals
|
|
@@ -10807,7 +10866,7 @@ Writing `request.locals.organization` does not affect `request.all()`, `request.
|
|
|
10807
10866
|
- The `create-controller` topic — reading locals in downstream controllers.
|
|
10808
10867
|
|
|
10809
10868
|
|
|
10810
|
-
## validate-input `@warlock.js/core/validate-input/SKILL.md`
|
|
10869
|
+
## validate-input `@warlock.js/core/skills/validate-input/SKILL.md`
|
|
10811
10870
|
|
|
10812
10871
|
---
|
|
10813
10872
|
name: validate-input
|
|
@@ -11165,7 +11224,7 @@ updateProductController.validation = {
|
|
|
11165
11224
|
- The `warlock-conventions` topic — `Request<Schema>` type-alias convention.
|
|
11166
11225
|
|
|
11167
11226
|
|
|
11168
|
-
## warlock-agents-md `@warlock.js/core/warlock-agents-md/SKILL.md`
|
|
11227
|
+
## warlock-agents-md `@warlock.js/core/skills/warlock-agents-md/SKILL.md`
|
|
11169
11228
|
|
|
11170
11229
|
---
|
|
11171
11230
|
name: warlock-agents-md
|
|
@@ -11265,7 +11324,7 @@ refresher.dispose();
|
|
|
11265
11324
|
- The `warlock-conventions` topic — the conventions listed in the section.
|
|
11266
11325
|
|
|
11267
11326
|
|
|
11268
|
-
## warlock-board `@warlock.js/core/warlock-board/SKILL.md`
|
|
11327
|
+
## warlock-board `@warlock.js/core/skills/warlock-board/SKILL.md`
|
|
11269
11328
|
|
|
11270
11329
|
---
|
|
11271
11330
|
name: warlock-board
|
|
@@ -11392,7 +11451,7 @@ const { messages } = await watchBoard({ agent: "implementer", timeoutMs: 30 * 60
|
|
|
11392
11451
|
- The `warlock-inspect` topic — the app's facts as JSON before you change it.
|
|
11393
11452
|
|
|
11394
11453
|
|
|
11395
|
-
## warlock-check `@warlock.js/core/warlock-check/SKILL.md`
|
|
11454
|
+
## warlock-check `@warlock.js/core/skills/warlock-check/SKILL.md`
|
|
11396
11455
|
|
|
11397
11456
|
---
|
|
11398
11457
|
name: warlock-check
|
|
@@ -11533,7 +11592,7 @@ Migrate lint and format tooling with
|
|
|
11533
11592
|
and work through the manual-review list. Use `--lint=oxc` for new apps.
|
|
11534
11593
|
|
|
11535
11594
|
|
|
11536
|
-
## warlock-conventions `@warlock.js/core/warlock-conventions/SKILL.md`
|
|
11595
|
+
## warlock-conventions `@warlock.js/core/skills/warlock-conventions/SKILL.md`
|
|
11537
11596
|
|
|
11538
11597
|
---
|
|
11539
11598
|
name: warlock-conventions
|
|
@@ -11789,7 +11848,7 @@ The comment covers the codes it names on its own line and the next; with no code
|
|
|
11789
11848
|
- The `send-response` topic — the full Response helper surface.
|
|
11790
11849
|
|
|
11791
11850
|
|
|
11792
|
-
## warlock-doctor `@warlock.js/core/warlock-doctor/SKILL.md`
|
|
11851
|
+
## warlock-doctor `@warlock.js/core/skills/warlock-doctor/SKILL.md`
|
|
11793
11852
|
|
|
11794
11853
|
---
|
|
11795
11854
|
name: warlock-doctor
|
|
@@ -11972,7 +12031,7 @@ formatting. Oxlint/Oxfmt are the only supported tools in 5.34.0. Use the
|
|
|
11972
12031
|
Migrate with `npx warlock upgrade --from 5.32 --to 5.33.0` (preview with `--dry-run`).
|
|
11973
12032
|
|
|
11974
12033
|
|
|
11975
|
-
## warlock-inspect `@warlock.js/core/warlock-inspect/SKILL.md`
|
|
12034
|
+
## warlock-inspect `@warlock.js/core/skills/warlock-inspect/SKILL.md`
|
|
11976
12035
|
|
|
11977
12036
|
---
|
|
11978
12037
|
name: warlock-inspect
|
|
@@ -12110,7 +12169,7 @@ const valid = new Ajv2020({ strict: false }).validate(INSPECT_REPORT_JSON_SCHEMA
|
|
|
12110
12169
|
- The `generate-openapi` topic — the same route schemas as an OpenAPI document.
|
|
12111
12170
|
|
|
12112
12171
|
|
|
12113
|
-
## warlock-mcp `@warlock.js/core/warlock-mcp/SKILL.md`
|
|
12172
|
+
## warlock-mcp `@warlock.js/core/skills/warlock-mcp/SKILL.md`
|
|
12114
12173
|
|
|
12115
12174
|
---
|
|
12116
12175
|
name: warlock-mcp
|
|
@@ -12234,7 +12293,7 @@ await server.close();
|
|
|
12234
12293
|
- The `expose-as-mcp-server` topic of @warlock.js/ai-tools — the transport underneath.
|
|
12235
12294
|
|
|
12236
12295
|
|
|
12237
|
-
## warlock-routes `@warlock.js/core/warlock-routes/SKILL.md`
|
|
12296
|
+
## warlock-routes `@warlock.js/core/skills/warlock-routes/SKILL.md`
|
|
12238
12297
|
|
|
12239
12298
|
---
|
|
12240
12299
|
name: warlock-routes
|
|
@@ -12374,11 +12433,11 @@ and exits non-zero.
|
|
|
12374
12433
|
- The `write-cli-command` topic — the command + `preload` shape `routesCommand` is built from.
|
|
12375
12434
|
|
|
12376
12435
|
|
|
12377
|
-
## warlock-trace `@warlock.js/core/warlock-trace/SKILL.md`
|
|
12436
|
+
## warlock-trace `@warlock.js/core/skills/warlock-trace/SKILL.md`
|
|
12378
12437
|
|
|
12379
12438
|
---
|
|
12380
12439
|
name: warlock-trace
|
|
12381
|
-
description: 'Verify runtime behaviour without a browser: `warlock trace <method> <url> [--body json|@file] [--header k:v] [--json]` sends one request to the running `warlock dev` server and prints what devtools recorded for it — middleware chain with timings, validation result and errors, handler time, queries with N+1 flags, logs, cache operations, captured mails, the response and timings — as a versioned report (`schemaVersion: 1`); `traceRequest()` returns the same object. Triggers: `warlock trace`, `traceRequest`, `TraceReport`, `buildTraceReport`, `x-request-id`, `.warlock/dev-server.json`, `WL8008`, `WL8009`, `WL5004`, `--id-header`; "did validation pass for this request", "which queries does this endpoint run", "is there an N+1 on this route", "what middleware runs on this route", "check the endpoint after my change", "request timeline as JSON". Skip: the devtools dashboard in a browser — the `devtools
|
|
12440
|
+
description: 'Verify runtime behaviour without a browser: `warlock trace <method> <url> [--body json|@file] [--header k:v] [--json]` sends one request to the running `warlock dev` server and prints what devtools recorded for it — middleware chain with timings, validation result and errors, handler time, queries with N+1 flags, logs, cache operations, captured mails, the response and timings — as a versioned report (`schemaVersion: 1`); `traceRequest()` returns the same object. Triggers: `warlock trace`, `traceRequest`, `TraceReport`, `buildTraceReport`, `x-request-id`, `.warlock/dev-server.json`, `WL8008`, `WL8009`, `WL5004`, `--id-header`; "did validation pass for this request", "which queries does this endpoint run", "is there an N+1 on this route", "what middleware runs on this route", "check the endpoint after my change", "request timeline as JSON". Skip: the devtools dashboard in a browser — the `warlock-js-devtools` skill; static route facts (guard, rate limit, schemas) — the `warlock-inspect` topic; typecheck/lint/tests — the `warlock-check` topic.'
|
|
12382
12441
|
---
|
|
12383
12442
|
|
|
12384
12443
|
# Warlock — `warlock trace`
|
|
@@ -12456,10 +12515,10 @@ Devtools is checked before anything is sent. With `--json` a failure prints `{ "
|
|
|
12456
12515
|
|
|
12457
12516
|
- The `warlock-inspect` topic — the static facts of a route (guard, rate limit, schemas).
|
|
12458
12517
|
- The `warlock-check` topic — typecheck, lint, tests and conventions in one run.
|
|
12459
|
-
- The `devtools
|
|
12518
|
+
- The `warlock-js-devtools` skill — the dashboard behind the timeline.
|
|
12460
12519
|
|
|
12461
12520
|
|
|
12462
|
-
## wire-socket `@warlock.js/core/wire-socket/SKILL.md`
|
|
12521
|
+
## wire-socket `@warlock.js/core/skills/wire-socket/SKILL.md`
|
|
12463
12522
|
|
|
12464
12523
|
---
|
|
12465
12524
|
name: wire-socket
|
|
@@ -12770,7 +12829,7 @@ CLI commands, scheduled jobs, queue workers — anything running outside an HTTP
|
|
|
12770
12829
|
- The `warlock-conventions` topic — where socket-related code lives (a setup function for handler registration, `services/` for emit sites).
|
|
12771
12830
|
|
|
12772
12831
|
|
|
12773
|
-
## write-cli-command `@warlock.js/core/write-cli-command/SKILL.md`
|
|
12832
|
+
## write-cli-command `@warlock.js/core/skills/write-cli-command/SKILL.md`
|
|
12774
12833
|
|
|
12775
12834
|
---
|
|
12776
12835
|
name: write-cli-command
|
|
@@ -13111,11 +13170,11 @@ Set a unique owner and registry per app instance, then import `processes` from
|
|
|
13111
13170
|
the generated module and await `processes.spawn({ kind: "worker", command,
|
|
13112
13171
|
args, labels })`. Consume output and await `handle.exited`. Use handle stops or
|
|
13113
13172
|
label filters; never stop processes by command or name. `spawnPty()` lazily
|
|
13114
|
-
loads separately installed optional peer `node-pty`. The `
|
|
13115
|
-
skill
|
|
13173
|
+
loads separately installed optional peer `node-pty`. The `warlock-js-process`
|
|
13174
|
+
skill contains complete working examples.
|
|
13116
13175
|
|
|
13117
13176
|
|
|
13118
|
-
## write-middleware `@warlock.js/core/write-middleware/SKILL.md`
|
|
13177
|
+
## write-middleware `@warlock.js/core/skills/write-middleware/SKILL.md`
|
|
13119
13178
|
|
|
13120
13179
|
---
|
|
13121
13180
|
name: write-middleware
|
|
@@ -13343,7 +13402,7 @@ export const optionalAuth: Middleware = async ({ request, response }) => {
|
|
|
13343
13402
|
- The `warlock-conventions` topic — the `guarded()` / `guardedAdmin()` / `publicRoutes()` convention.
|
|
13344
13403
|
|
|
13345
13404
|
|
|
13346
|
-
## write-seeder `@warlock.js/core/write-seeder/SKILL.md`
|
|
13405
|
+
## write-seeder `@warlock.js/core/skills/write-seeder/SKILL.md`
|
|
13347
13406
|
|
|
13348
13407
|
---
|
|
13349
13408
|
name: write-seeder
|
|
@@ -13738,7 +13797,7 @@ warlock seed --transaction # (default true) — pass --transaction=false to s
|
|
|
13738
13797
|
- The `warlock-conventions` topic — `seeds/` is the canonical folder name (singular `seed/` is incorrect).
|
|
13739
13798
|
|
|
13740
13799
|
|
|
13741
|
-
## write-use-case `@warlock.js/core/write-use-case/SKILL.md`
|
|
13800
|
+
## write-use-case `@warlock.js/core/skills/write-use-case/SKILL.md`
|
|
13742
13801
|
|
|
13743
13802
|
---
|
|
13744
13803
|
name: write-use-case
|