@warlock.js/core 5.30.0 → 5.31.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 +142 -36
- package/README.md +28 -23
- package/bin/source-load-hook.mjs +63 -0
- package/bin/warlock.js +102 -42
- package/esm/cli/commands/add.command.mjs +4 -2
- package/esm/cli/commands/add.command.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +69 -0
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -0
- package/esm/cli/commands/agents-md.command.mjs +38 -0
- package/esm/cli/commands/agents-md.command.mjs.map +1 -0
- package/esm/cli/commands/board/board-command.action.mjs +279 -0
- package/esm/cli/commands/board/board-command.action.mjs.map +1 -0
- package/esm/cli/commands/board.command.mjs +78 -0
- package/esm/cli/commands/board.command.mjs.map +1 -0
- package/esm/cli/commands/build.command.mjs +6 -1
- package/esm/cli/commands/build.command.mjs.map +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +57 -0
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -0
- package/esm/cli/commands/check/child-typecheck.mjs +66 -0
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -0
- package/esm/cli/commands/check/format-problems.mjs +43 -0
- package/esm/cli/commands/check/format-problems.mjs.map +1 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs +61 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs.map +1 -0
- package/esm/cli/commands/check.command.mjs +50 -0
- package/esm/cli/commands/check.command.mjs.map +1 -0
- package/esm/cli/commands/dev-server.command.mjs +9 -1
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs +8 -3
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +76 -0
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/connectors.check.mjs +2 -0
- package/esm/cli/commands/doctor/checks/connectors.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/health.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/health.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs +4 -0
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/routes.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/routes.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +14 -6
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/doctor/format-report.mjs +30 -2
- package/esm/cli/commands/doctor/format-report.mjs.map +1 -1
- package/esm/cli/commands/doctor.command.mjs +4 -0
- package/esm/cli/commands/doctor.command.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +64 -0
- package/esm/cli/commands/explain/explain-command.action.mjs.map +1 -0
- package/esm/cli/commands/explain.command.mjs +23 -0
- package/esm/cli/commands/explain.command.mjs.map +1 -0
- package/esm/cli/commands/generate/generate.command.mjs +124 -124
- package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +311 -0
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/migration.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +341 -0
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -0
- package/esm/cli/commands/generate/templates/stubs.mjs +19 -6
- package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +137 -0
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/prompt.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/writer.mjs +38 -13
- package/esm/cli/commands/generate/utils/writer.mjs.map +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +72 -0
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -0
- package/esm/cli/commands/inspect.command.mjs +39 -0
- package/esm/cli/commands/inspect.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +103 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -0
- package/esm/cli/commands/mcp.command.mjs +76 -0
- package/esm/cli/commands/mcp.command.mjs.map +1 -0
- package/esm/cli/commands/openapi-generator.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.command.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.action.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.command.mjs.map +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +1 -1
- package/esm/cli/commands/test.command.mjs +131 -0
- package/esm/cli/commands/test.command.mjs.map +1 -0
- package/esm/cli/commands/trace/trace-command.action.mjs +145 -0
- package/esm/cli/commands/trace/trace-command.action.mjs.map +1 -0
- package/esm/cli/commands/trace.command.mjs +60 -0
- package/esm/cli/commands/trace.command.mjs.map +1 -0
- package/esm/cli/commands/typecheck.command.mjs +40 -0
- package/esm/cli/commands/typecheck.command.mjs.map +1 -0
- package/esm/cli/commands/upgrade.command.mjs +46 -0
- package/esm/cli/commands/upgrade.command.mjs.map +1 -0
- package/esm/cli/flush-and-exit.mjs +34 -0
- package/esm/cli/flush-and-exit.mjs.map +1 -0
- package/esm/cli/framework-cli-commands.mjs +23 -1
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +1 -0
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +34 -13
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-schema.d.mts +67 -0
- package/esm/config/config-schema.d.mts.map +1 -0
- package/esm/config/config-schema.mjs +77 -0
- package/esm/config/config-schema.mjs.map +1 -0
- package/esm/config/index.d.mts +6 -0
- package/esm/config/index.mjs +1 -0
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs +2 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +26 -2
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +3 -2
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/single-server-warnings.mjs.map +1 -1
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/container/index.d.mts.map +1 -1
- package/esm/container/index.mjs.map +1 -1
- package/esm/database/migrate-action.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.d.mts +0 -28
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +4 -0
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.mjs +2 -0
- package/esm/database/seeds/seeder.errors.mjs.map +1 -1
- package/esm/dev-server/boot-precondition-error.mjs +1 -0
- package/esm/dev-server/boot-precondition-error.mjs.map +1 -1
- package/esm/dev-server/create-worker.mjs +15 -9
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dev-agent-tooling.mjs +135 -0
- package/esm/dev-server/dev-agent-tooling.mjs.map +1 -0
- package/esm/dev-server/dev-logger.mjs.map +1 -1
- package/esm/dev-server/development-server.mjs +8 -0
- package/esm/dev-server/development-server.mjs.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs +4 -5
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/files-watcher.mjs +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +2 -3
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs +33 -0
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs.map +1 -0
- package/esm/dev-server/health-checker/default-health-checkers.mjs +31 -0
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +9 -3
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +15 -4
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +302 -0
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs +42 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs.map +1 -0
- package/esm/dev-server/loader/loader-port-acks.mjs +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -1
- package/esm/dev-server/loader/register-loader.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +1 -1
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +1 -0
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/parse-imports.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/route-types-publisher.mjs +1 -1
- package/esm/dev-server/start-development-server.mjs.map +1 -1
- package/esm/dev-server/translation-keys-sources.mjs +1 -1
- package/esm/dev-server/translation-keys-sources.mjs.map +1 -1
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +3 -3
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/errors/container-key-missing-error.mjs +1 -0
- package/esm/errors/container-key-missing-error.mjs.map +1 -1
- package/esm/errors/error-codes.d.mts +653 -0
- package/esm/errors/error-codes.d.mts.map +1 -0
- package/esm/errors/error-codes.mjs +634 -0
- package/esm/errors/error-codes.mjs.map +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs.map +1 -1
- package/esm/errors/index.d.mts +3 -1
- package/esm/errors/index.mjs +3 -1
- package/esm/errors/unknown-locale-error.mjs +1 -0
- package/esm/errors/unknown-locale-error.mjs.map +1 -1
- package/esm/errors/warlock-error.d.mts +23 -0
- package/esm/errors/warlock-error.d.mts.map +1 -0
- package/esm/errors/warlock-error.mjs +22 -0
- package/esm/errors/warlock-error.mjs.map +1 -0
- package/esm/generations/add-command.action.mjs +19 -3
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/access.feature.mjs +1 -1
- package/esm/generations/features/access.feature.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +1 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/mysql.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +5 -2
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/queue.feature.mjs +1 -1
- package/esm/generations/features/queue.feature.mjs.map +1 -1
- package/esm/generations/features/react-email.feature.mjs +1 -1
- package/esm/generations/features/react-email.feature.mjs.map +1 -1
- package/esm/generations/features/shadcn.feature.mjs +1 -1
- package/esm/generations/features/shadcn.feature.mjs.map +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs.map +1 -1
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs.map +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -1
- package/esm/generations/features/sitemap.feature.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/features/tailwind.feature.mjs +1 -1
- package/esm/generations/features/tailwind.feature.mjs.map +1 -1
- package/esm/generations/features/test.feature.mjs +11 -6
- package/esm/generations/features/test.feature.mjs.map +1 -1
- package/esm/generations/features/web.feature.mjs +1 -1
- package/esm/generations/features/web.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +73 -0
- package/esm/generations/generation-fs.mjs.map +1 -0
- package/esm/generations/generation-run.mjs +185 -0
- package/esm/generations/generation-run.mjs.map +1 -0
- package/esm/generations/stubs.mjs +155 -13
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +10 -0
- package/esm/http/bounded-stream-queue.d.mts.map +1 -0
- package/esm/http/bounded-stream-queue.mjs +97 -0
- package/esm/http/bounded-stream-queue.mjs.map +1 -0
- package/esm/http/build-rate-limit-options.d.mts +13 -0
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +86 -0
- package/esm/http/conditional-request.d.mts.map +1 -0
- package/esm/http/conditional-request.mjs +121 -0
- package/esm/http/conditional-request.mjs.map +1 -0
- package/esm/http/csp.d.mts +2 -0
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +1 -0
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +24 -84
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/errors/errors.d.mts +2 -0
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/errors/errors.mjs +1 -0
- package/esm/http/errors/errors.mjs.map +1 -1
- package/esm/http/escape-header-value.d.mts +18 -0
- package/esm/http/escape-header-value.d.mts.map +1 -0
- package/esm/http/escape-header-value.mjs +27 -0
- package/esm/http/escape-header-value.mjs.map +1 -0
- package/esm/http/flush-pending-cookies.mjs.map +1 -1
- package/esm/http/index.d.mts +5 -2
- package/esm/http/index.mjs +4 -1
- package/esm/http/lazy-static.mjs +194 -0
- package/esm/http/lazy-static.mjs.map +1 -0
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +7 -4
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +2 -1
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +12 -5
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +83 -4
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +2 -2
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +5 -4
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +11 -1
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +164 -76
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +51 -0
- package/esm/http/safe-redirect.d.mts.map +1 -0
- package/esm/http/safe-redirect.mjs +80 -0
- package/esm/http/safe-redirect.mjs.map +1 -0
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server.d.mts +3 -1
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +14 -4
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-transport.mjs +4 -2
- package/esm/http/stream-transport.mjs.map +1 -1
- package/esm/http/types.d.mts +44 -11
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variant.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +10 -7
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +61 -24
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +78 -0
- package/esm/http/uploads/image-variant-cache-entries.mjs.map +1 -0
- package/esm/http/uploads/image-variant-cache.mjs +72 -30
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +2 -0
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +3 -1
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.mjs +3 -2
- package/esm/http/uploads/image-variants-config-error.mjs.map +1 -1
- package/esm/http/uploads/load-variant-source.mjs +1 -1
- package/esm/http/uploads/load-variant-source.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +7 -2
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/purge-image-variants.mjs +16 -16
- package/esm/http/uploads/purge-image-variants.mjs.map +1 -1
- package/esm/http/uploads/remote-variant-source.mjs +115 -0
- package/esm/http/uploads/remote-variant-source.mjs.map +1 -0
- package/esm/http/uploads/resolve-image-variant.d.mts +3 -4
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.mjs +10 -18
- package/esm/http/uploads/resolve-image-variant.mjs.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +5 -3
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-remote-image-variant.mjs +89 -0
- package/esm/http/uploads/resolve-remote-image-variant.mjs.map +1 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs +193 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -0
- package/esm/http/uploads/uploaded-file.controller.d.mts +5 -3
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +16 -8
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +1 -1
- package/esm/http/uploads-types.d.mts +6 -2
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/index.d.mts +17 -6
- package/esm/index.mjs +14 -3
- package/esm/localization/parse-locale-dictionary.d.mts +2 -0
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +1 -0
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/mail/config.d.mts +12 -1
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/config.mjs +16 -1
- package/esm/mail/config.mjs.map +1 -1
- package/esm/mail/index.d.mts +1 -1
- package/esm/mail/index.mjs +1 -1
- package/esm/net/index.d.mts +2 -0
- package/esm/net/index.mjs +3 -0
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/build-openapi-document.mjs +8 -5
- package/esm/openapi/build-openapi-document.mjs.map +1 -1
- package/esm/openapi/error-responses.mjs +28 -2
- package/esm/openapi/error-responses.mjs.map +1 -1
- package/esm/openapi/postman/build-request-body.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs.map +1 -1
- package/esm/openapi/postman/build-saved-responses.mjs.map +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/example-from-schema.mjs.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.mjs.map +1 -1
- package/esm/openapi/postman/schema-refs.mjs.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs.map +1 -1
- package/esm/openapi/request-schemas.mjs.map +1 -1
- package/esm/openapi/response-schemas.mjs.map +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -0
- package/esm/openapi/schema-registry.mjs.map +1 -1
- package/esm/openapi/security.mjs.map +1 -1
- package/esm/openapi/types.d.mts +3 -2
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +1 -0
- package/esm/production/assert-generated-imports.mjs.map +1 -1
- package/esm/production/production-builder.mjs +12 -4
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/resolve-build-config.mjs +1 -0
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/route-registration-snapshot.mjs.map +1 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/restful.d.mts +5 -5
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/restful/restful.mjs.map +1 -1
- package/esm/router/build-route-rate-limit.mjs.map +1 -1
- package/esm/router/dev-dispatch.mjs +31 -12
- package/esm/router/dev-dispatch.mjs.map +1 -1
- package/esm/router/index.d.mts +4 -2
- package/esm/router/index.mjs +2 -0
- package/esm/router/log-request-lifecycle.mjs.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.mjs.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +47 -0
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -0
- package/esm/router/resolve-route-validation.mjs +19 -0
- package/esm/router/resolve-route-validation.mjs.map +1 -0
- package/esm/router/route-guard-names.mjs +30 -0
- package/esm/router/route-guard-names.mjs.map +1 -0
- package/esm/router/route-name-taken-error.d.mts +14 -0
- package/esm/router/route-name-taken-error.d.mts.map +1 -0
- package/esm/router/route-name-taken-error.mjs +18 -0
- package/esm/router/route-name-taken-error.mjs.map +1 -0
- package/esm/router/router.d.mts +32 -13
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +71 -38
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +137 -17
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +40 -0
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -0
- package/esm/router/unguarded-route-diagnostics.mjs +95 -0
- package/esm/router/unguarded-route-diagnostics.mjs.map +1 -0
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/local-disk-roots.mjs +24 -0
- package/esm/storage/local-disk-roots.mjs.map +1 -0
- package/esm/storage/storage.d.mts +14 -0
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/storage.mjs +22 -0
- package/esm/storage/storage.mjs.map +1 -1
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +2 -0
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.mjs +1 -0
- package/esm/storage/utils/storage-not-initialized-error.mjs.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +32 -0
- package/esm/tests/authenticated-test-client.d.mts.map +1 -0
- package/esm/tests/authenticated-test-client.mjs +40 -0
- package/esm/tests/authenticated-test-client.mjs.map +1 -0
- package/esm/tests/factories.d.mts +59 -0
- package/esm/tests/factories.d.mts.map +1 -0
- package/esm/tests/factories.mjs +105 -0
- package/esm/tests/factories.mjs.map +1 -0
- package/esm/tests/fakes/cache-fake.d.mts +29 -0
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -0
- package/esm/tests/fakes/cache-fake.mjs +79 -0
- package/esm/tests/fakes/cache-fake.mjs.map +1 -0
- package/esm/tests/fakes/clock-fake.d.mts +32 -0
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -0
- package/esm/tests/fakes/clock-fake.mjs +69 -0
- package/esm/tests/fakes/clock-fake.mjs.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts +13 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.mjs +20 -0
- package/esm/tests/fakes/fake-assertion-error.mjs.map +1 -0
- package/esm/tests/fakes/ids-fake.d.mts +22 -0
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -0
- package/esm/tests/fakes/ids-fake.mjs +57 -0
- package/esm/tests/fakes/ids-fake.mjs.map +1 -0
- package/esm/tests/fakes/index.d.mts +8 -0
- package/esm/tests/fakes/index.mjs +10 -0
- package/esm/tests/fakes/mail-fake.d.mts +41 -0
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -0
- package/esm/tests/fakes/mail-fake.mjs +111 -0
- package/esm/tests/fakes/mail-fake.mjs.map +1 -0
- package/esm/tests/fakes/queue-fake.d.mts +48 -0
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -0
- package/esm/tests/fakes/queue-fake.mjs +134 -0
- package/esm/tests/fakes/queue-fake.mjs.map +1 -0
- package/esm/tests/fakes/storage-fake.d.mts +31 -0
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -0
- package/esm/tests/fakes/storage-fake.mjs +122 -0
- package/esm/tests/fakes/storage-fake.mjs.map +1 -0
- package/esm/tests/fakes/test-fakes.d.mts +39 -0
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -0
- package/esm/tests/fakes/test-fakes.mjs +90 -0
- package/esm/tests/fakes/test-fakes.mjs.map +1 -0
- package/esm/tests/index.d.mts +14 -2
- package/esm/tests/index.mjs +15 -2
- package/esm/tests/snapshot-response.d.mts +34 -0
- package/esm/tests/snapshot-response.d.mts.map +1 -0
- package/esm/tests/snapshot-response.mjs +42 -0
- package/esm/tests/snapshot-response.mjs.map +1 -0
- package/esm/tests/start-http-development-server.d.mts +22 -0
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +36 -3
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-helpers.d.mts +20 -1
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-helpers.mjs +40 -27
- package/esm/tests/test-helpers.mjs.map +1 -1
- package/esm/tests/test-http-server.d.mts +62 -0
- package/esm/tests/test-http-server.d.mts.map +1 -0
- package/esm/tests/test-http-server.mjs +119 -0
- package/esm/tests/test-http-server.mjs.map +1 -0
- package/esm/tests/vitest-setup.d.mts +11 -0
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +12 -4
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +27 -0
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs +59 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +36 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs +72 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs.map +1 -0
- package/esm/tooling/agents-md/index.mjs +7 -0
- package/esm/tooling/agents-md/installed-skills.d.mts +30 -0
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -0
- package/esm/tooling/agents-md/installed-skills.mjs +74 -0
- package/esm/tooling/agents-md/installed-skills.mjs.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts +33 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.mjs +195 -0
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts +33 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.mjs +49 -0
- package/esm/tooling/agents-md/write-agents-md.mjs.map +1 -0
- package/esm/tooling/board/board-message.d.mts +31 -0
- package/esm/tooling/board/board-message.d.mts.map +1 -0
- package/esm/tooling/board/board-message.mjs +86 -0
- package/esm/tooling/board/board-message.mjs.map +1 -0
- package/esm/tooling/board/board.d.mts +109 -0
- package/esm/tooling/board/board.d.mts.map +1 -0
- package/esm/tooling/board/board.mjs +406 -0
- package/esm/tooling/board/board.mjs.map +1 -0
- package/esm/tooling/board/board.types.d.mts +72 -0
- package/esm/tooling/board/board.types.d.mts.map +1 -0
- package/esm/tooling/board/board.types.mjs +54 -0
- package/esm/tooling/board/board.types.mjs.map +1 -0
- package/esm/tooling/check/changed-files.d.mts +33 -0
- package/esm/tooling/check/changed-files.d.mts.map +1 -0
- package/esm/tooling/check/changed-files.mjs +73 -0
- package/esm/tooling/check/changed-files.mjs.map +1 -0
- package/esm/tooling/check/check-report.types.d.mts +62 -0
- package/esm/tooling/check/check-report.types.d.mts.map +1 -0
- package/esm/tooling/check/check-report.types.mjs +37 -0
- package/esm/tooling/check/check-report.types.mjs.map +1 -0
- package/esm/tooling/check/code-style-conventions.mjs +106 -0
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -0
- package/esm/tooling/check/conventions-step.d.mts +34 -0
- package/esm/tooling/check/conventions-step.d.mts.map +1 -0
- package/esm/tooling/check/conventions-step.mjs +184 -0
- package/esm/tooling/check/conventions-step.mjs.map +1 -0
- package/esm/tooling/check/environment-step.d.mts +18 -0
- package/esm/tooling/check/environment-step.d.mts.map +1 -0
- package/esm/tooling/check/environment-step.mjs +78 -0
- package/esm/tooling/check/environment-step.mjs.map +1 -0
- package/esm/tooling/check/index.d.mts +8 -0
- package/esm/tooling/check/index.mjs +10 -0
- package/esm/tooling/check/lint-step.d.mts +19 -0
- package/esm/tooling/check/lint-step.d.mts.map +1 -0
- package/esm/tooling/check/lint-step.mjs +111 -0
- package/esm/tooling/check/lint-step.mjs.map +1 -0
- package/esm/tooling/check/request-input.mjs +132 -0
- package/esm/tooling/check/request-input.mjs.map +1 -0
- package/esm/tooling/check/run-check.d.mts +35 -0
- package/esm/tooling/check/run-check.d.mts.map +1 -0
- package/esm/tooling/check/run-check.mjs +192 -0
- package/esm/tooling/check/run-check.mjs.map +1 -0
- package/esm/tooling/check/run-tests.d.mts +48 -0
- package/esm/tooling/check/run-tests.d.mts.map +1 -0
- package/esm/tooling/check/run-tests.mjs +93 -0
- package/esm/tooling/check/run-tests.mjs.map +1 -0
- package/esm/tooling/check/security-conventions.mjs +648 -0
- package/esm/tooling/check/security-conventions.mjs.map +1 -0
- package/esm/tooling/check/source-ast.mjs +195 -0
- package/esm/tooling/check/source-ast.mjs.map +1 -0
- package/esm/tooling/check/source-files.mjs +27 -0
- package/esm/tooling/check/source-files.mjs.map +1 -0
- package/esm/tooling/check/tests-step.d.mts +34 -0
- package/esm/tooling/check/tests-step.d.mts.map +1 -0
- package/esm/tooling/check/tests-step.mjs +177 -0
- package/esm/tooling/check/tests-step.mjs.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts +39 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.mjs +67 -0
- package/esm/tooling/dev-state/dev-server-state.mjs.map +1 -0
- package/esm/tooling/devtools/devtools-client.d.mts +91 -0
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -0
- package/esm/tooling/devtools/devtools-client.mjs +155 -0
- package/esm/tooling/devtools/devtools-client.mjs.map +1 -0
- package/esm/tooling/generate/generation.d.mts +78 -0
- package/esm/tooling/generate/generation.d.mts.map +1 -0
- package/esm/tooling/generate/generation.mjs +123 -0
- package/esm/tooling/generate/generation.mjs.map +1 -0
- package/esm/tooling/generate/generator-spec.d.mts +57 -0
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -0
- package/esm/tooling/generate/generator-spec.mjs +102 -0
- package/esm/tooling/generate/generator-spec.mjs.map +1 -0
- package/esm/tooling/generate/index.mjs +6 -0
- package/esm/tooling/generate/project-files.mjs +121 -0
- package/esm/tooling/generate/project-files.mjs.map +1 -0
- package/esm/tooling/generate/run-cli.d.mts +40 -0
- package/esm/tooling/generate/run-cli.d.mts.map +1 -0
- package/esm/tooling/generate/run-cli.mjs +93 -0
- package/esm/tooling/generate/run-cli.mjs.map +1 -0
- package/esm/tooling/generate/unified-diff.d.mts +37 -0
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -0
- package/esm/tooling/generate/unified-diff.mjs +161 -0
- package/esm/tooling/generate/unified-diff.mjs.map +1 -0
- package/esm/tooling/index.d.mts +41 -0
- package/esm/tooling/index.mjs +45 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +23 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs +63 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs.map +1 -0
- package/esm/tooling/inspect/collect-config.mjs +77 -0
- package/esm/tooling/inspect/collect-config.mjs.map +1 -0
- package/esm/tooling/inspect/collect-models.d.mts +9 -0
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-models.mjs +154 -0
- package/esm/tooling/inspect/collect-models.mjs.map +1 -0
- package/esm/tooling/inspect/collect-packages.d.mts +10 -0
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-packages.mjs +157 -0
- package/esm/tooling/inspect/collect-packages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-pages.mjs +108 -0
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-routes.mjs +168 -0
- package/esm/tooling/inspect/collect-routes.mjs.map +1 -0
- package/esm/tooling/inspect/event-recorder.d.mts +37 -0
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -0
- package/esm/tooling/inspect/event-recorder.mjs +91 -0
- package/esm/tooling/inspect/event-recorder.mjs.map +1 -0
- package/esm/tooling/inspect/index.d.mts +7 -0
- package/esm/tooling/inspect/index.mjs +7 -0
- package/esm/tooling/inspect/inspect-app.d.mts +53 -0
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-app.mjs +92 -0
- package/esm/tooling/inspect/inspect-app.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts +15 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs +463 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts +196 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.mjs +33 -0
- package/esm/tooling/inspect/inspect-report.types.mjs.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts +26 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.mjs +75 -0
- package/esm/tooling/mcp/create-mcp-context.mjs.map +1 -0
- package/esm/tooling/mcp/db-schema.d.mts +49 -0
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -0
- package/esm/tooling/mcp/db-schema.mjs +56 -0
- package/esm/tooling/mcp/db-schema.mjs.map +1 -0
- package/esm/tooling/mcp/docs-search.d.mts +72 -0
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -0
- package/esm/tooling/mcp/docs-search.mjs +178 -0
- package/esm/tooling/mcp/docs-search.mjs.map +1 -0
- package/esm/tooling/mcp/index.mjs +9 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts +62 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/load-ai-tools.mjs +44 -0
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -0
- package/esm/tooling/mcp/mcp-tools.d.mts +60 -0
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/mcp-tools.mjs +513 -0
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts +56 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.mjs +126 -0
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -0
- package/esm/tooling/mcp/tool-input.d.mts +75 -0
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -0
- package/esm/tooling/mcp/tool-input.mjs +72 -0
- package/esm/tooling/mcp/tool-input.mjs.map +1 -0
- package/esm/tooling/problem.d.mts +45 -0
- package/esm/tooling/problem.d.mts.map +1 -0
- package/esm/tooling/problem.mjs +28 -0
- package/esm/tooling/problem.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +71 -0
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -0
- package/esm/tooling/trace/trace-report.types.mjs +7 -0
- package/esm/tooling/trace/trace-report.types.mjs.map +1 -0
- package/esm/tooling/trace/trace-request.d.mts +83 -0
- package/esm/tooling/trace/trace-request.d.mts.map +1 -0
- package/esm/tooling/trace/trace-request.mjs +241 -0
- package/esm/tooling/trace/trace-request.mjs.map +1 -0
- package/esm/tooling/typecheck/index.d.mts +1 -0
- package/esm/tooling/typecheck/index.mjs +3 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts +59 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -0
- package/esm/tooling/typecheck/run-typecheck.mjs +153 -0
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -0
- package/esm/upgrade/codemods/head-viewport.mjs +46 -0
- package/esm/upgrade/codemods/head-viewport.mjs.map +1 -0
- package/esm/upgrade/codemods/helpers.mjs +81 -0
- package/esm/upgrade/codemods/helpers.mjs.map +1 -0
- package/esm/upgrade/codemods/index.mjs +34 -0
- package/esm/upgrade/codemods/index.mjs.map +1 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs +57 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -0
- package/esm/upgrade/codemods/package-json.mjs +122 -0
- package/esm/upgrade/codemods/package-json.mjs.map +1 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs +82 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -0
- package/esm/upgrade/codemods/review-sites.mjs +262 -0
- package/esm/upgrade/codemods/review-sites.mjs.map +1 -0
- package/esm/upgrade/diff.mjs +119 -0
- package/esm/upgrade/diff.mjs.map +1 -0
- package/esm/upgrade/format-upgrade-report.mjs +32 -0
- package/esm/upgrade/format-upgrade-report.mjs.map +1 -0
- package/esm/upgrade/load-ts-morph.mjs +48 -0
- package/esm/upgrade/load-ts-morph.mjs.map +1 -0
- package/esm/upgrade/notes.mjs +16 -0
- package/esm/upgrade/notes.mjs.map +1 -0
- package/esm/upgrade/run-upgrade.mjs +246 -0
- package/esm/upgrade/run-upgrade.mjs.map +1 -0
- package/esm/upgrade/upgrade-command.action.mjs +37 -0
- package/esm/upgrade/upgrade-command.action.mjs.map +1 -0
- package/esm/upgrade/version.mjs +39 -0
- package/esm/upgrade/version.mjs.map +1 -0
- package/esm/use-cases/use-cases-registry.mjs.map +1 -1
- package/esm/utils/clock.d.mts +33 -0
- package/esm/utils/clock.d.mts.map +1 -0
- package/esm/utils/clock.mjs +27 -0
- package/esm/utils/clock.mjs.map +1 -0
- package/esm/utils/framework-vesion.mjs +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/ids.d.mts +32 -0
- package/esm/utils/ids.d.mts.map +1 -0
- package/esm/utils/ids.mjs +33 -0
- package/esm/utils/ids.mjs.map +1 -0
- package/esm/utils/index.d.mts +3 -0
- package/esm/utils/index.mjs +3 -0
- package/esm/utils/runtime.d.mts +59 -0
- package/esm/utils/runtime.d.mts.map +1 -0
- package/esm/utils/runtime.mjs +85 -0
- package/esm/utils/runtime.mjs.map +1 -0
- package/esm/validation/index.d.mts +1 -1
- package/esm/validation/types.d.mts +57 -2
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +19 -2
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +15 -0
- package/esm/validation/validation-failure-status.mjs.map +1 -0
- package/esm/validation/validators/file-validator.d.mts +0 -16
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/warlock-config/bundle-config.mjs +1 -1
- package/esm/warlock-config/types.d.mts +27 -3
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/llms-full.txt +3166 -736
- package/llms.txt +16 -6
- package/package.json +43 -13
- package/schemas/inspect-report.schema.json +554 -0
- package/skills/README.md +9 -0
- package/skills/add-connector/SKILL.md +26 -38
- package/skills/benchmark-code/SKILL.md +30 -24
- package/skills/build-restful/SKILL.md +14 -14
- package/skills/build-url/SKILL.md +18 -18
- package/skills/configure-app/SKILL.md +107 -14
- package/skills/create-controller/SKILL.md +25 -12
- package/skills/create-module/SKILL.md +3 -3
- package/skills/define-resource/SKILL.md +32 -29
- package/skills/encrypt-data/SKILL.md +21 -19
- package/skills/generate-openapi/SKILL.md +50 -24
- package/skills/hash-password/SKILL.md +2 -2
- package/skills/health-checks/SKILL.md +24 -7
- package/skills/index.md +9 -4
- package/skills/lower-stage3-decorators/SKILL.md +4 -4
- package/skills/make-endpoint/SKILL.md +110 -0
- package/skills/model-factories/SKILL.md +92 -0
- package/skills/process-image/SKILL.md +32 -30
- package/skills/register-route/SKILL.md +109 -10
- package/skills/request-memo/SKILL.md +1 -1
- package/skills/request-tracing/SKILL.md +4 -1
- package/skills/resolve-path/SKILL.md +45 -44
- package/skills/retry-operation/SKILL.md +20 -11
- package/skills/run-app/SKILL.md +106 -22
- package/skills/send-response/SKILL.md +179 -14
- package/skills/store-file/SKILL.md +93 -53
- package/skills/test-fakes/SKILL.md +123 -0
- package/skills/test-http/SKILL.md +125 -21
- package/skills/test-service/SKILL.md +41 -1
- package/skills/update-packages/SKILL.md +29 -18
- package/skills/upgrade-from-5-29/SKILL.md +413 -0
- package/skills/upload-file/SKILL.md +31 -33
- package/skills/use-app-context/SKILL.md +38 -31
- package/skills/use-middleware/SKILL.md +45 -25
- package/skills/use-model-transformers/SKILL.md +37 -28
- package/skills/use-repository/SKILL.md +2 -2
- package/skills/validate-input/SKILL.md +72 -28
- package/skills/warlock-agents-md/SKILL.md +96 -0
- package/skills/warlock-board/SKILL.md +123 -0
- package/skills/warlock-check/SKILL.md +132 -0
- package/skills/warlock-conventions/SKILL.md +115 -0
- package/skills/warlock-doctor/SKILL.md +55 -22
- package/skills/warlock-inspect/SKILL.md +134 -0
- package/skills/warlock-mcp/SKILL.md +120 -0
- package/skills/warlock-routes/SKILL.md +18 -11
- package/skills/warlock-trace/SKILL.md +81 -0
- package/skills/wire-socket/SKILL.md +8 -8
- package/skills/write-seeder/SKILL.md +46 -32
- package/skills/write-use-case/SKILL.md +40 -27
- package/esm/http/uploads/matches-if-none-match.mjs +0 -13
- package/esm/http/uploads/matches-if-none-match.mjs.map +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: model-factories
|
|
3
|
+
description: 'Deterministic model factories for tests and seeders — `defineFactory(Model, (seed) => attributes)` with `make()`, `makeMany(n)`, `create()`, `create(n)`, `createMany(n)`, named states via `.state()` / `.with()`, and a faker-free seed (`seed.text`, `seed.email`, `seed.uuid`, `seed.date`, `seed.number`, `seed.pick`). Triggers: `defineFactory`, `Factory`, `FactorySeed`, `resetFactorySequences`, `userFactory`; "test fixtures", "create test users", "factory states", "deterministic test data", "build a request body for a test". Typical import `import { defineFactory } from "@warlock.js/core/tests"`. Skip: seeding a real database for development — the `write-seeder` topic; fakes — the `test-fakes` topic.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Warlock — model factories
|
|
7
|
+
|
|
8
|
+
A factory turns a sequence number into attributes. The n-th record a factory builds is the same on every run — no faker, no randomness — so snapshots and assertions stay stable.
|
|
9
|
+
|
|
10
|
+
## Define one per model
|
|
11
|
+
|
|
12
|
+
```ts title="src/app/users/tests/user.factory.ts"
|
|
13
|
+
import { Model } from "@warlock.js/cascade";
|
|
14
|
+
import { defineFactory } from "@warlock.js/core/tests";
|
|
15
|
+
|
|
16
|
+
// Your model; in an app this is `import { User } from "app/users/models/user"`.
|
|
17
|
+
type UserSchema = { name: string; email: string; password: string; emailVerifiedAt?: Date };
|
|
18
|
+
|
|
19
|
+
export class User extends Model<UserSchema> {
|
|
20
|
+
public static table = "users";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const userFactory = defineFactory(User, (seed) => ({
|
|
24
|
+
name: seed.text("User"), // "User 1", "User 2", ...
|
|
25
|
+
email: seed.email(), // "user1@example.test", ...
|
|
26
|
+
password: "test-password",
|
|
27
|
+
}))
|
|
28
|
+
.state("unverified", () => ({ emailVerifiedAt: undefined }))
|
|
29
|
+
.state("named", (seed) => ({ name: `Named ${seed.sequence}` }));
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Attributes are typed by the model's schema (`Partial` of it, as `Model.create()` takes). Keep factories next to the module's tests.
|
|
33
|
+
|
|
34
|
+
## Use it
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
// with: import { expectJson, testPost } from "@warlock.js/core/tests";
|
|
38
|
+
// import { userFactory } from "./user.factory";
|
|
39
|
+
it("registers a user from a factory-built body", async () => {
|
|
40
|
+
const body = userFactory.make({ email: "ada@example.test" }); // attributes only, no database
|
|
41
|
+
|
|
42
|
+
const response = await testPost("/auth/register", body);
|
|
43
|
+
|
|
44
|
+
expect((await expectJson<{ user: { email: string } }>(response, 201)).user.email).toBe(
|
|
45
|
+
"ada@example.test",
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("lists users", async () => {
|
|
50
|
+
await userFactory.create(3); // three saved users, in order
|
|
51
|
+
await userFactory.with("unverified", "named").create();
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Call | Returns | Database |
|
|
56
|
+
| --------------------------- | ------------------ | -------- |
|
|
57
|
+
| `make(overrides?)` | attributes | no |
|
|
58
|
+
| `makeMany(n, overrides?)` | attributes[] | no |
|
|
59
|
+
| `create(overrides?)` | `Promise<Model>` | yes |
|
|
60
|
+
| `create(n, overrides?)` | `Promise<Model[]>` | yes |
|
|
61
|
+
| `createMany(n, overrides?)` | `Promise<Model[]>` | yes |
|
|
62
|
+
| `with(...states)` | a derived factory | — |
|
|
63
|
+
| `state(name, fn)` | the same factory | — |
|
|
64
|
+
| `resetSequence()` | — | — |
|
|
65
|
+
|
|
66
|
+
`create()` goes through the model's own `create()`, so casts, defaults, hooks and events run exactly as in the app. Overrides are a partial or a function of the seed: `make((seed) => ({ name: `Custom ${seed.sequence}` }))`. States apply in order on top of the definition, then the overrides. A derived factory shares the base sequence.
|
|
67
|
+
|
|
68
|
+
## The seed
|
|
69
|
+
|
|
70
|
+
| Member | Value |
|
|
71
|
+
| -------------------- | ------------------------------------------------------ |
|
|
72
|
+
| `sequence` | 1 for the first record the factory builds, then 2, ... |
|
|
73
|
+
| `index` | position within the current `makeMany` / `createMany` |
|
|
74
|
+
| `text(prefix?)` | `"<prefix> <sequence>"` |
|
|
75
|
+
| `email(prefix?)` | `"<prefix><sequence>@example.test"` (default `user`) |
|
|
76
|
+
| `uuid()` | `00000000-0000-4000-8000-<sequence, 12 digits>` |
|
|
77
|
+
| `date(offsetDays?)` | 2026-01-01T00:00:00Z plus `offsetDays` days |
|
|
78
|
+
| `number(min?, max?)` | an integer in `[min, max]`, cycling with the sequence |
|
|
79
|
+
| `pick(values)` | one of `values`, cycling with the sequence |
|
|
80
|
+
|
|
81
|
+
`resetFactorySequences()` restarts every factory — call it in `beforeEach` when a test asserts exact values.
|
|
82
|
+
|
|
83
|
+
## Gotchas
|
|
84
|
+
|
|
85
|
+
- **Unique columns.** `seed.email()` is unique per factory sequence, not across test files; a database shared between files needs cleanup or `resetFactorySequences()` plus truncation, otherwise a second file collides on `user1@example.test`.
|
|
86
|
+
- **`make()` never touches the database.** It returns attributes, not a model instance — use it for request bodies and pure-logic tests.
|
|
87
|
+
- **An unknown state throws** and lists the defined ones.
|
|
88
|
+
|
|
89
|
+
## See also
|
|
90
|
+
|
|
91
|
+
- The `test-fakes` topic — fakes for mail, queue, cache, storage, clock and ids.
|
|
92
|
+
- The `write-seeder` topic — seeding a development database.
|
|
@@ -37,16 +37,16 @@ Adds `sharp` to your dependencies. Skip it and the first `new Image(...)` throws
|
|
|
37
37
|
## Constructors
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
|
-
new Image("./avatar.jpg")
|
|
41
|
-
new Image(buffer)
|
|
42
|
-
new Image(uint8Array)
|
|
43
|
-
new Image(arrayBuffer)
|
|
44
|
-
new Image(existingSharpInstance)
|
|
40
|
+
new Image("./avatar.jpg"); // path
|
|
41
|
+
new Image(buffer); // Buffer
|
|
42
|
+
new Image(uint8Array); // Uint8Array
|
|
43
|
+
new Image(arrayBuffer); // ArrayBuffer
|
|
44
|
+
new Image(existingSharpInstance); // wrap a sharp.Sharp you already built
|
|
45
45
|
|
|
46
46
|
// Or via static factories:
|
|
47
47
|
Image.fromFile("./avatar.jpg");
|
|
48
48
|
Image.fromBuffer(buffer);
|
|
49
|
-
await Image.fromUrl("https://example.com/photo.jpg");
|
|
49
|
+
await Image.fromUrl("https://example.com/photo.jpg"); // @mongez/http under the hood
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
`Image.fromUrl(...)` is the only async factory — it fetches the URL via `@mongez/http` (`responseType: "arrayBuffer"`), then wraps the bytes. The rest are synchronous.
|
|
@@ -55,25 +55,25 @@ await Image.fromUrl("https://example.com/photo.jpg"); // @mongez/http under th
|
|
|
55
55
|
|
|
56
56
|
Every method returns `this` so calls chain. Transforms are descriptors; nothing runs until the output method.
|
|
57
57
|
|
|
58
|
-
| Method
|
|
59
|
-
|
|
|
60
|
-
| `.resize({ width?, height?, fit?, ... })`
|
|
61
|
-
| `.crop({ left, top, width, height })`
|
|
62
|
-
| `.rotate(deg)`
|
|
63
|
-
| `.flip()`
|
|
64
|
-
| `.flop()`
|
|
65
|
-
| `.blur(sigma)`
|
|
66
|
-
| `.sharpen(options?)`
|
|
67
|
-
| `.grayscale()` / `.blackAndWhite()`
|
|
68
|
-
| `.tint(color)`
|
|
69
|
-
| `.negate(options?)`
|
|
70
|
-
| `.opacity(value)`
|
|
71
|
-
| `.trim(options?)`
|
|
72
|
-
| `.watermark(image, options?)`
|
|
73
|
-
| `.watermarks([{ image, options }, ...])`
|
|
74
|
-
| `.format(format)`
|
|
75
|
-
| `.quality(1–100)`
|
|
76
|
-
| `.apply(options)`
|
|
58
|
+
| Method | Effect |
|
|
59
|
+
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
60
|
+
| `.resize({ width?, height?, fit?, ... })` | sharp resize — accepts the full `sharp.ResizeOptions` shape |
|
|
61
|
+
| `.crop({ left, top, width, height })` | extract a region |
|
|
62
|
+
| `.rotate(deg)` | clockwise rotation |
|
|
63
|
+
| `.flip()` | mirror vertically (top↔bottom) |
|
|
64
|
+
| `.flop()` | mirror horizontally (left↔right) |
|
|
65
|
+
| `.blur(sigma)` | gaussian blur (sigma is required, must be ≥ 0.3 — throws otherwise) |
|
|
66
|
+
| `.sharpen(options?)` | sharp's sharpen |
|
|
67
|
+
| `.grayscale()` / `.blackAndWhite()` | grayscale (aliases) |
|
|
68
|
+
| `.tint(color)` | color tint |
|
|
69
|
+
| `.negate(options?)` | invert colors |
|
|
70
|
+
| `.opacity(value)` | 0–100, applied via composite |
|
|
71
|
+
| `.trim(options?)` | trim borders |
|
|
72
|
+
| `.watermark(image, options?)` | overlay one watermark — two positional args (`image` accepts the same inputs as the constructor, plus another `Image`; `options` is `sharp.OverlayOptions`) |
|
|
73
|
+
| `.watermarks([{ image, options }, ...])` | overlay many — one `WatermarkConfig` object (`{ image, options }`) per entry |
|
|
74
|
+
| `.format(format)` | output format — `"jpeg"`, `"png"`, `"webp"`, `"avif"`, `"tiff"`, `"heif"`, ... |
|
|
75
|
+
| `.quality(1–100)` | lossy formats only (`jpeg` / `webp` / `avif` / `tiff` / `heif`); ignored otherwise |
|
|
76
|
+
| `.apply(options)` | apply many transforms in one call, in a fixed canonical order |
|
|
77
77
|
|
|
78
78
|
`apply(options)` accepts an `ImageTransformOptions` object — every transform above as a key. Useful when transforms come from config or a request payload.
|
|
79
79
|
|
|
@@ -82,10 +82,10 @@ Every method returns `this` so calls chain. Transforms are descriptors; nothing
|
|
|
82
82
|
Each of these fires the pipeline exactly once and returns the result. Subsequent calls run the pipeline again (operations aren't memoised).
|
|
83
83
|
|
|
84
84
|
```ts
|
|
85
|
-
await image.save("./output.webp");
|
|
86
|
-
const buffer = await image.toBuffer();
|
|
87
|
-
const base64 = await image.toBase64();
|
|
88
|
-
const dataUrl = await image.toDataUrl();
|
|
85
|
+
await image.save("./output.webp"); // write to disk; returns the absolute path
|
|
86
|
+
const buffer = await image.toBuffer(); // → Buffer
|
|
87
|
+
const base64 = await image.toBase64(); // → "iVBORw0KGgo..."
|
|
88
|
+
const dataUrl = await image.toDataUrl(); // → "data:image/webp;base64,..."
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
## Common patterns
|
|
@@ -93,7 +93,9 @@ const dataUrl = await image.toDataUrl(); // → "data:image/webp;base64,..."
|
|
|
93
93
|
### Resize an uploaded avatar to two sizes
|
|
94
94
|
|
|
95
95
|
```ts
|
|
96
|
-
import { Image } from "@warlock.js/core";
|
|
96
|
+
import { Image, type UploadedFile } from "@warlock.js/core";
|
|
97
|
+
|
|
98
|
+
declare const uploadedAvatar: UploadedFile; // e.g. request.validated().avatar
|
|
97
99
|
|
|
98
100
|
const buffer = await uploadedAvatar.buffer();
|
|
99
101
|
|
|
@@ -90,9 +90,9 @@ Projects with `@warlock.js/auth` usually define a `guarded(...)` helper in `src/
|
|
|
90
90
|
import { guarded } from "app/shared/utils/router";
|
|
91
91
|
|
|
92
92
|
router.prefix("/products", () => {
|
|
93
|
-
router.get("/", listProductsController);
|
|
93
|
+
router.get("/", listProductsController); // public
|
|
94
94
|
guarded(() => {
|
|
95
|
-
router.post("/", createProductController);
|
|
95
|
+
router.post("/", createProductController); // requires logged-in user
|
|
96
96
|
router.delete("/:id", removeProductController);
|
|
97
97
|
});
|
|
98
98
|
});
|
|
@@ -100,17 +100,27 @@ router.prefix("/products", () => {
|
|
|
100
100
|
|
|
101
101
|
If `guarded` doesn't exist in your project yet, see the shared utility convention in the `warlock-conventions` topic.
|
|
102
102
|
|
|
103
|
+
### A mutating route with no guard — say so with `public: true`
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
// src/app/contact/routes.ts
|
|
107
|
+
router.post("/api/contact", contactController, { public: true });
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`public: true` changes nothing at runtime; it records that the missing guard is deliberate, so reviewers, `warlock check` and route tooling can tell a decision from an omission. `warlock make endpoint --public` writes it (the `make-endpoint` topic).
|
|
111
|
+
|
|
103
112
|
## RESTful resource chain
|
|
104
113
|
|
|
105
114
|
For a standard CRUD resource, `router.route(path)` returns a builder with five named slots:
|
|
106
115
|
|
|
107
116
|
```ts
|
|
108
|
-
router
|
|
109
|
-
.
|
|
110
|
-
.
|
|
111
|
-
.
|
|
112
|
-
.
|
|
113
|
-
.
|
|
117
|
+
router
|
|
118
|
+
.route("/products")
|
|
119
|
+
.list(listProductsController) // GET /products
|
|
120
|
+
.show(getProductController) // GET /products/:id
|
|
121
|
+
.create(createProductController) // POST /products
|
|
122
|
+
.update(updateProductController) // PUT /products/:id
|
|
123
|
+
.destroy(removeProductController); // DELETE /products/:id
|
|
114
124
|
```
|
|
115
125
|
|
|
116
126
|
Each method returns the builder so you can chain. Methods you don't call don't register. Pair with `guarded`/`group` the same way as plain routes.
|
|
@@ -143,8 +153,8 @@ guarded(() => {
|
|
|
143
153
|
|
|
144
154
|
```ts
|
|
145
155
|
router.prefix("/auth", () => {
|
|
146
|
-
router.post("/login", loginController);
|
|
147
|
-
router.post("/register", registerController);
|
|
156
|
+
router.post("/login", loginController, { public: true });
|
|
157
|
+
router.post("/register", registerController, { public: true });
|
|
148
158
|
guarded(() => {
|
|
149
159
|
router.post("/logout", logoutController);
|
|
150
160
|
router.get("/me", meController);
|
|
@@ -152,6 +162,41 @@ router.prefix("/auth", () => {
|
|
|
152
162
|
});
|
|
153
163
|
```
|
|
154
164
|
|
|
165
|
+
### Mutating routes: guard them or say `public: true`
|
|
166
|
+
|
|
167
|
+
Every POST/PUT/PATCH/DELETE route either runs auth middleware (on the route, its
|
|
168
|
+
builder, or an enclosing group such as `guarded()`) or is marked `public: true`.
|
|
169
|
+
`warlock dev` warns once per route about mutating routes with neither, and
|
|
170
|
+
`warlock check` reports the same from source as `WL9006` before the app runs.
|
|
171
|
+
The check reads source, not runtime markers: a guard counts when its name
|
|
172
|
+
contains `auth` or `guard`, or when it is a constant initialised with
|
|
173
|
+
`markAuthGuard()` in the same file. A differently-named guard imported from
|
|
174
|
+
another file needs a `// warlock-check-ignore WL9006` comment on its route.
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import { markAuthGuard, router, type Middleware, type RequestHandler } from "@warlock.js/core";
|
|
178
|
+
|
|
179
|
+
const stripeWebhookController: RequestHandler = async ({ response }) =>
|
|
180
|
+
response.success({ received: true });
|
|
181
|
+
const importController: RequestHandler = async ({ response }) => response.success({ queued: true });
|
|
182
|
+
|
|
183
|
+
// Open on purpose: a webhook signed by the provider.
|
|
184
|
+
router.group({ prefix: "/webhooks", public: true }, () => {
|
|
185
|
+
router.post("/stripe", stripeWebhookController);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// A hand-written guard whose name has no "auth"/"guard" in it.
|
|
189
|
+
const requireApiKey: Middleware = markAuthGuard(async ({ request, response }) => {
|
|
190
|
+
if (request.headers["x-api-key"] !== process.env.API_KEY) return response.unauthorized();
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
router.post("/imports", importController, { middleware: [requireApiKey] });
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
`public` changes nothing at runtime. `authMiddleware()` marks itself (its
|
|
197
|
+
`{ optional: true }` form does not count). Silence the warning app-wide with
|
|
198
|
+
`http.warnUnguardedRoutes: false`; page routes are never reported.
|
|
199
|
+
|
|
155
200
|
### Multiple paths on one handler
|
|
156
201
|
|
|
157
202
|
```ts
|
|
@@ -168,6 +213,60 @@ router.post("/accounts/credentials", accountsController.store, {
|
|
|
168
213
|
|
|
169
214
|
Request log entries otherwise include the body as received (before validation), so rejected fields would be logged too.
|
|
170
215
|
|
|
216
|
+
## Static directories and public files
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
router.directory({ root: Application.publicPath, prefix: "/assets/" });
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Static routes are queued at scan time after HTTP plugin hooks. `@fastify/static` itself loads only on
|
|
223
|
+
the first static file request, even with an existing public folder; concurrent
|
|
224
|
+
first requests share initialization. The upstream sender retains ranges, caching,
|
|
225
|
+
listings, precompressed files, `allowedPath` and `setHeaders` behavior. The
|
|
226
|
+
`setHeaders` callback receives the real Fastify reply.
|
|
227
|
+
|
|
228
|
+
`wildcard: false` still enumerates exact file routes at boot, so files added later
|
|
229
|
+
follow the application's ordinary fallback until restart. The directory globber
|
|
230
|
+
loads at boot only for this option; the upstream sender enumerates those roots
|
|
231
|
+
again on the first request, which can be noticeable for large directories. The public folder uses
|
|
232
|
+
`storage.publicRoot` (default `public/`) and `storage.publicPrefix` (default
|
|
233
|
+
`/public/`); `false` disables it and missing folders add no routes. Its
|
|
234
|
+
`reply.sendFile`/`reply.download` decorators are lazy too. `router.directory`
|
|
235
|
+
keeps `decorateReply: false` for additional mounts. Initialization failures reach
|
|
236
|
+
the application's normal error handler.
|
|
237
|
+
|
|
238
|
+
Global rate limits apply to application routes and web page routes in
|
|
239
|
+
production and development. Defaults are 60 requests/minute per IP in one shared
|
|
240
|
+
bucket across routes and pages. Behind a reverse proxy, configure trusted
|
|
241
|
+
`http.trustProxy` addresses or a suitable `http.rateLimit.keyGenerator`, and
|
|
242
|
+
review `max` before upgrading. `http.rateLimit.global: false` disables blanket
|
|
243
|
+
quotas while retaining explicit route limits. Built-in health/readiness probes
|
|
244
|
+
are exempt unless `http.health.rateLimit: true` opts them into the global policy.
|
|
245
|
+
|
|
246
|
+
Static files are exempt from the global limiter by default: the public folder,
|
|
247
|
+
every `router.directory()` mount and `router.file()` / `cachedFile()` / `files()` /
|
|
248
|
+
`cachedFiles()` routes (and the web build's assets). `http.rateLimit.staticFiles:
|
|
249
|
+
true` counts them all; a mount can decide for itself:
|
|
250
|
+
|
|
251
|
+
```ts
|
|
252
|
+
import { rootPath, router } from "@warlock.js/core";
|
|
253
|
+
|
|
254
|
+
router.directory({ root: rootPath("storage/exports"), prefix: "/exports/" }, { rateLimit: true });
|
|
255
|
+
router.directory(
|
|
256
|
+
{ root: rootPath("storage/reports"), prefix: "/reports/" },
|
|
257
|
+
{ rateLimit: { max: 20, timeWindow: 60_000 } },
|
|
258
|
+
);
|
|
259
|
+
router.file("/price-list.pdf", rootPath("storage/price-list.pdf"), 300, { rateLimit: true });
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Exempt one application route with `rateLimit: false` (or
|
|
263
|
+
`serverOptions: { config: { rateLimit: false } }`); development's wildcard
|
|
264
|
+
dispatcher honours both exactly as production does:
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
router.get("/webhooks/status", webhookStatusController, { rateLimit: false });
|
|
268
|
+
```
|
|
269
|
+
|
|
171
270
|
## Gotchas
|
|
172
271
|
|
|
173
272
|
- **Never import `routes.ts`.** The framework auto-loads it. Importing causes a double-registration error.
|
|
@@ -12,7 +12,7 @@ description: 'Memoize async work for one HTTP request with `requestMemo<T>(key,
|
|
|
12
12
|
From `core/src/http/context/request-memo.ts`:
|
|
13
13
|
|
|
14
14
|
```ts
|
|
15
|
-
export function requestMemo<T>(key: string, fn: () => Promise<T>): Promise<T
|
|
15
|
+
export function requestMemo<T>(key: string, fn: () => Promise<T>): Promise<T>;
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Import it from the package root:
|
|
@@ -181,11 +181,12 @@ own extra guard — the check is already there.
|
|
|
181
181
|
|
|
182
182
|
```ts
|
|
183
183
|
// src/config/http.ts
|
|
184
|
+
import { env, type HttpConfigurations } from "@warlock.js/core";
|
|
184
185
|
import { log } from "@warlock.js/logger";
|
|
185
186
|
|
|
186
187
|
const SLOW_MS = 200;
|
|
187
188
|
|
|
188
|
-
|
|
189
|
+
const httpConfig: HttpConfigurations = {
|
|
189
190
|
tracing: {
|
|
190
191
|
enabled: env("TRACING_ENABLED") === "true",
|
|
191
192
|
hooks: [
|
|
@@ -206,6 +207,8 @@ export default {
|
|
|
206
207
|
],
|
|
207
208
|
},
|
|
208
209
|
};
|
|
210
|
+
|
|
211
|
+
export default httpConfig;
|
|
209
212
|
```
|
|
210
213
|
|
|
211
214
|
## Gotchas
|
|
@@ -12,30 +12,30 @@ Twelve helpers, all anchored at `process.cwd()`, all in `@warlock.js/core`. They
|
|
|
12
12
|
```ts
|
|
13
13
|
import { appPath, configPath, uploadsPath, storagePath } from "@warlock.js/core";
|
|
14
14
|
|
|
15
|
-
appPath("orders/routes.ts");
|
|
16
|
-
configPath("http.ts");
|
|
17
|
-
uploadsPath("avatars/42.png");
|
|
18
|
-
storagePath("backups/2026-01.tar.gz");
|
|
15
|
+
appPath("orders/routes.ts"); // → <cwd>/src/app/orders/routes.ts
|
|
16
|
+
configPath("http.ts"); // → <cwd>/src/config/http.ts
|
|
17
|
+
uploadsPath("avatars/42.png"); // → <cwd>/storage/uploads/avatars/42.png
|
|
18
|
+
storagePath("backups/2026-01.tar.gz"); // → <cwd>/storage/backups/2026-01.tar.gz
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Every helper takes any number of path segments and joins them. No-argument calls return the base directory itself.
|
|
22
22
|
|
|
23
23
|
## Full inventory
|
|
24
24
|
|
|
25
|
-
| Helper
|
|
26
|
-
|
|
|
27
|
-
| `rootPath(...p)`
|
|
28
|
-
| `srcPath(...p)`
|
|
29
|
-
| `appPath(p?)`
|
|
30
|
-
| `configPath(...p)`
|
|
31
|
-
| `publicPath(p?)`
|
|
32
|
-
| `storagePath(p?)`
|
|
33
|
-
| `uploadsPath(p?)`
|
|
34
|
-
| `cachePath(p?)`
|
|
35
|
-
| `logsPath(p?)`
|
|
36
|
-
| `tempPath(p?)`
|
|
25
|
+
| Helper | Resolves to | Notes |
|
|
26
|
+
| ------------------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| `rootPath(...p)` | `<cwd>/<...p>` | Also `Application.rootPath`. Base of every other helper. |
|
|
28
|
+
| `srcPath(...p)` | `<cwd>/src/<...p>` | Also `Application.srcPath`. |
|
|
29
|
+
| `appPath(p?)` | `<cwd>/src/app/<p>` | Also `Application.appPath`. Module roots live here. |
|
|
30
|
+
| `configPath(...p)` | `<cwd>/src/config/<...p>` | `src/config/*.ts` subsystem configs. |
|
|
31
|
+
| `publicPath(p?)` | `<cwd>/public/<p>` | Also `Application.publicPath`. Static assets served as-is. |
|
|
32
|
+
| `storagePath(p?)` | `<cwd>/storage/<p>` | Also `Application.storagePath`. Root for framework-managed files. |
|
|
33
|
+
| `uploadsPath(p?)` | `<cwd>/storage/uploads/<p>` _(default)_ | Also `Application.uploadsPath`. Honors `config.uploads.root` override (string or function). |
|
|
34
|
+
| `cachePath(p?)` | `<cwd>/storage/cache/<p>` | Persistent cache files. |
|
|
35
|
+
| `logsPath(p?)` | `<cwd>/storage/logs/<p>` | Application logs. |
|
|
36
|
+
| `tempPath(p?)` | `<cwd>/storage/tmp/<p>` | Throw-away scratch. |
|
|
37
37
|
| `warlockPath(...p)` | `<cwd>/.warlock/<...p>` | Framework internals (manifest, transpile cache, typings). **Never write app files here** — the framework deletes the folder freely. |
|
|
38
|
-
| `sanitizePath(p)`
|
|
38
|
+
| `sanitizePath(p)` | Strips `<>:"/\|?*` from `p` | Cleans user-supplied filename fragments before joining. |
|
|
39
39
|
|
|
40
40
|
## The aggregate — `paths`
|
|
41
41
|
|
|
@@ -44,15 +44,15 @@ For builders or maintenance scripts that shuttle several locations in close prox
|
|
|
44
44
|
```ts
|
|
45
45
|
import { paths } from "@warlock.js/core";
|
|
46
46
|
|
|
47
|
-
paths.root("dist", "app.js");
|
|
48
|
-
paths.app("orders/routes.ts");
|
|
49
|
-
paths.uploads("avatars/42.png");
|
|
50
|
-
paths.config("mail.ts");
|
|
51
|
-
paths.cache("queries.bin");
|
|
52
|
-
paths.logs("errors.log");
|
|
53
|
-
paths.temp("tmp-export.csv");
|
|
54
|
-
paths.warlock("manifest.json");
|
|
55
|
-
paths.sanitize("../etc/passwd");
|
|
47
|
+
paths.root("dist", "app.js"); // → <cwd>/dist/app.js
|
|
48
|
+
paths.app("orders/routes.ts"); // → <cwd>/src/app/orders/routes.ts
|
|
49
|
+
paths.uploads("avatars/42.png"); // → <cwd>/storage/uploads/avatars/42.png
|
|
50
|
+
paths.config("mail.ts"); // → <cwd>/src/config/mail.ts
|
|
51
|
+
paths.cache("queries.bin"); // → <cwd>/storage/cache/queries.bin
|
|
52
|
+
paths.logs("errors.log"); // → <cwd>/storage/logs/errors.log
|
|
53
|
+
paths.temp("tmp-export.csv"); // → <cwd>/storage/tmp/tmp-export.csv
|
|
54
|
+
paths.warlock("manifest.json"); // → <cwd>/.warlock/manifest.json
|
|
55
|
+
paths.sanitize("../etc/passwd"); // → "..etcpasswd"
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
Use the named import (`appPath`, `uploadsPath`, ...) when one helper dominates the file; reach for `paths.*` when you're shuttling multiple paths together.
|
|
@@ -65,10 +65,7 @@ Use the named import (`appPath`, `uploadsPath`, ...) when one helper dominates t
|
|
|
65
65
|
import { appPath } from "@warlock.js/core";
|
|
66
66
|
import { readFile } from "node:fs/promises";
|
|
67
67
|
|
|
68
|
-
const template = await readFile(
|
|
69
|
-
appPath("mailers/templates/welcome.html"),
|
|
70
|
-
"utf-8",
|
|
71
|
-
);
|
|
68
|
+
const template = await readFile(appPath("mailers/templates/welcome.html"), "utf-8");
|
|
72
69
|
```
|
|
73
70
|
|
|
74
71
|
### Locate a config file
|
|
@@ -84,13 +81,17 @@ const httpConfigFile = configPath("http.ts");
|
|
|
84
81
|
```ts
|
|
85
82
|
import { uploadsPath } from "@warlock.js/core";
|
|
86
83
|
|
|
84
|
+
declare const userId: string;
|
|
85
|
+
|
|
87
86
|
const avatar = uploadsPath(`avatars/${userId}/profile.png`);
|
|
88
87
|
```
|
|
89
88
|
|
|
90
89
|
### Sanitize a user-supplied filename before joining
|
|
91
90
|
|
|
92
91
|
```ts
|
|
93
|
-
import { sanitizePath, uploadsPath } from "@warlock.js/core";
|
|
92
|
+
import { sanitizePath, uploadsPath, type Request } from "@warlock.js/core";
|
|
93
|
+
|
|
94
|
+
declare const req: Request; // the current request
|
|
94
95
|
|
|
95
96
|
const safe = sanitizePath(req.input("filename"));
|
|
96
97
|
const dest = uploadsPath(`exports/${safe}`);
|
|
@@ -115,7 +116,7 @@ const manifest = warlockPath("manifest.json");
|
|
|
115
116
|
```ts title="src/config/uploads.ts"
|
|
116
117
|
export default {
|
|
117
118
|
uploads: {
|
|
118
|
-
root: "/mnt/uploads",
|
|
119
|
+
root: "/mnt/uploads", // static
|
|
119
120
|
// root: (rel) => `/mnt/uploads/${rel}`, // dynamic
|
|
120
121
|
},
|
|
121
122
|
};
|
|
@@ -137,18 +138,18 @@ The override is applied **inside** `uploadsPath()`. So `Application.uploadsPath`
|
|
|
137
138
|
|
|
138
139
|
## When to use which
|
|
139
140
|
|
|
140
|
-
| Goal
|
|
141
|
-
|
|
|
142
|
-
| File inside a module (controllers/services) | `appPath`
|
|
143
|
-
| Top-level subsystem config
|
|
144
|
-
| Static asset served as-is over HTTP
|
|
145
|
-
| User-uploaded file (avatar, document)
|
|
146
|
-
| Persistent cache for an expensive op
|
|
147
|
-
| Application log line
|
|
148
|
-
| Short-lived scratch (cleaned aggressively)
|
|
149
|
-
| Bundled artifact (build outputs)
|
|
150
|
-
| Reading a TS source from disk
|
|
151
|
-
| Framework internals (manifest, transpile)
|
|
141
|
+
| Goal | Helper |
|
|
142
|
+
| ------------------------------------------- | --------------------------- |
|
|
143
|
+
| File inside a module (controllers/services) | `appPath` |
|
|
144
|
+
| Top-level subsystem config | `configPath` |
|
|
145
|
+
| Static asset served as-is over HTTP | `publicPath` |
|
|
146
|
+
| User-uploaded file (avatar, document) | `uploadsPath` |
|
|
147
|
+
| Persistent cache for an expensive op | `cachePath` |
|
|
148
|
+
| Application log line | `logsPath` |
|
|
149
|
+
| Short-lived scratch (cleaned aggressively) | `tempPath` |
|
|
150
|
+
| Bundled artifact (build outputs) | `rootPath("dist", ...)` |
|
|
151
|
+
| Reading a TS source from disk | `srcPath` / `appPath` |
|
|
152
|
+
| Framework internals (manifest, transpile) | `warlockPath` _(read-only)_ |
|
|
152
153
|
|
|
153
154
|
If you find yourself reaching for `path.join(process.cwd(), ...)` — that's a sign you want one of these helpers instead.
|
|
154
155
|
|
|
@@ -12,22 +12,25 @@ description: 'Wrap a flaky operation with `retry(fn, options)` — now provided
|
|
|
12
12
|
```ts
|
|
13
13
|
import { retry } from "@mongez/reinforcements";
|
|
14
14
|
|
|
15
|
+
declare function fetchUser(id: string): Promise<{ id: string }>; // any flaky async call
|
|
16
|
+
declare const id: string;
|
|
17
|
+
|
|
15
18
|
const user = await retry(() => fetchUser(id), {
|
|
16
|
-
attempts: 4,
|
|
17
|
-
delay: 200,
|
|
19
|
+
attempts: 4, // TOTAL tries (initial + retries) — default 3
|
|
20
|
+
delay: 200, // base ms between attempts
|
|
18
21
|
backoff: "exponential", // 200, 400, 800 ms
|
|
19
22
|
});
|
|
20
23
|
```
|
|
21
24
|
|
|
22
25
|
## What changed from the old core `retry`
|
|
23
26
|
|
|
24
|
-
| Old (`@warlock.js/core`)
|
|
25
|
-
|
|
|
26
|
-
| `count` = **extra** attempts
|
|
27
|
-
| fixed `delay` only
|
|
28
|
-
| —
|
|
29
|
-
| `shouldRetry(error, attempt)`
|
|
30
|
-
| —
|
|
27
|
+
| Old (`@warlock.js/core`) | New (`@mongez/reinforcements`) |
|
|
28
|
+
| ----------------------------- | -------------------------------------------------------- |
|
|
29
|
+
| `count` = **extra** attempts | `attempts` = **total** attempts (`count + 1`) |
|
|
30
|
+
| fixed `delay` only | `delay` + `backoff` (`"linear" \| "exponential" \| fn`) |
|
|
31
|
+
| — | `maxDelay`, `jitter` (`"full" \| "equal"`), `signal` |
|
|
32
|
+
| `shouldRetry(error, attempt)` | `shouldRetry(error, attempt)` (kept) + `onError` observe |
|
|
33
|
+
| — | `retryable(fn, options)` to pre-bind a reusable wrapper |
|
|
31
34
|
|
|
32
35
|
Migration: `count: 3` → `attempts: 4`.
|
|
33
36
|
|
|
@@ -56,8 +59,8 @@ await retry(() => fetch(url), {
|
|
|
56
59
|
attempts: 6,
|
|
57
60
|
delay: 100,
|
|
58
61
|
backoff: "exponential",
|
|
59
|
-
maxDelay: 2_000,
|
|
60
|
-
jitter: "full",
|
|
62
|
+
maxDelay: 2_000, // never wait more than 2s as backoff grows
|
|
63
|
+
jitter: "full", // randomise each delay to avoid thundering herd
|
|
61
64
|
});
|
|
62
65
|
```
|
|
63
66
|
|
|
@@ -74,6 +77,9 @@ controller.abort(); // rejects promptly with signal.reason
|
|
|
74
77
|
```ts
|
|
75
78
|
import { retryable } from "@mongez/reinforcements";
|
|
76
79
|
|
|
80
|
+
declare function getUser(id: string): Promise<{ id: string }>; // any flaky async call
|
|
81
|
+
declare const id: string;
|
|
82
|
+
|
|
77
83
|
const fetchUser = retryable(getUser, { attempts: 4, backoff: "exponential" });
|
|
78
84
|
await fetchUser(id);
|
|
79
85
|
```
|
|
@@ -86,6 +92,9 @@ await fetchUser(id);
|
|
|
86
92
|
import { measure } from "@warlock.js/core";
|
|
87
93
|
import { retry } from "@mongez/reinforcements";
|
|
88
94
|
|
|
95
|
+
declare const bus: { publish(event: unknown): Promise<void> }; // your event bus
|
|
96
|
+
declare const event: { type: string };
|
|
97
|
+
|
|
89
98
|
const result = await measure("publish-event", () =>
|
|
90
99
|
retry(() => bus.publish(event), { attempts: 4, delay: 200 }),
|
|
91
100
|
); // result.latency includes all retries
|