@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,78 @@
|
|
|
1
|
+
import { createProblem } from "../problem.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
|
|
5
|
+
//#region ../../packages/core/src/tooling/check/environment-step.ts
|
|
6
|
+
/**
|
|
7
|
+
* The oldest Node.js release core supports — `engines.node` in core's
|
|
8
|
+
* package.json (`>=22.15`). `bin/warlock.js` refuses older versions before
|
|
9
|
+
* the CLI loads; this check covers programmatic `runCheck()` calls too.
|
|
10
|
+
*/
|
|
11
|
+
const MIN_NODE_VERSION = "22.15.0";
|
|
12
|
+
function parseVersion(version) {
|
|
13
|
+
const match = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?/.exec(version.trim());
|
|
14
|
+
if (!match) return void 0;
|
|
15
|
+
return [
|
|
16
|
+
Number(match[1]),
|
|
17
|
+
Number(match[2] ?? 0),
|
|
18
|
+
Number(match[3] ?? 0)
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
function compareVersions(left, right) {
|
|
22
|
+
for (let index = 0; index < 3; index++) {
|
|
23
|
+
const difference = (left[index] ?? 0) - (right[index] ?? 0);
|
|
24
|
+
if (difference !== 0) return difference;
|
|
25
|
+
}
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The minimum version of a `>=x.y.z` engines range, or `undefined` for any
|
|
30
|
+
* other form (`^22`, `22.x || 24.x`): those are not interpreted rather than
|
|
31
|
+
* guessed at.
|
|
32
|
+
*/
|
|
33
|
+
function minimumOfRange(range) {
|
|
34
|
+
return /^\s*>=\s*v?(\d+(?:\.\d+){0,2})\s*$/.exec(range)?.[1];
|
|
35
|
+
}
|
|
36
|
+
function appEnginesRange(cwd) {
|
|
37
|
+
try {
|
|
38
|
+
const manifest = JSON.parse(readFileSync(path.join(cwd, "package.json"), "utf8"));
|
|
39
|
+
const engines = typeof manifest === "object" && manifest !== null ? Reflect.get(manifest, "engines") : void 0;
|
|
40
|
+
const node = typeof engines === "object" && engines !== null ? Reflect.get(engines, "node") : void 0;
|
|
41
|
+
return typeof node === "string" ? node : void 0;
|
|
42
|
+
} catch {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Check the running Node.js against core's minimum and the app's own
|
|
48
|
+
* `engines.node` (when it is a plain `>=` range). A mismatch is a `WL8001`
|
|
49
|
+
* environment problem.
|
|
50
|
+
*/
|
|
51
|
+
function checkNodeVersion(cwd, running = process.versions.node) {
|
|
52
|
+
const current = parseVersion(running);
|
|
53
|
+
if (!current) return [];
|
|
54
|
+
const requirements = [{
|
|
55
|
+
minimum: MIN_NODE_VERSION,
|
|
56
|
+
source: "@warlock.js/core (engines.node >=22.15)"
|
|
57
|
+
}];
|
|
58
|
+
const appRange = appEnginesRange(cwd);
|
|
59
|
+
const appMinimum = appRange ? minimumOfRange(appRange) : void 0;
|
|
60
|
+
if (appMinimum) requirements.push({
|
|
61
|
+
minimum: appMinimum,
|
|
62
|
+
source: `package.json engines.node ${appRange}`
|
|
63
|
+
});
|
|
64
|
+
const problems = [];
|
|
65
|
+
for (const requirement of requirements) {
|
|
66
|
+
const minimum = parseVersion(requirement.minimum);
|
|
67
|
+
if (minimum && compareVersions(current, minimum) < 0) problems.push(createProblem({
|
|
68
|
+
code: "WL8001",
|
|
69
|
+
source: "environment",
|
|
70
|
+
message: `Node.js ${running} is older than ${requirement.minimum}, required by ${requirement.source}.`
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
return problems;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { MIN_NODE_VERSION, checkNodeVersion };
|
|
78
|
+
//# sourceMappingURL=environment-step.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-step.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/environment-step.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\n\n/**\n * The oldest Node.js release core supports — `engines.node` in core's\n * package.json (`>=22.15`). `bin/warlock.js` refuses older versions before\n * the CLI loads; this check covers programmatic `runCheck()` calls too.\n */\nexport const MIN_NODE_VERSION = \"22.15.0\";\n\nfunction parseVersion(version: string): [number, number, number] | undefined {\n const match = /^v?(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?/.exec(version.trim());\n\n if (!match) return undefined;\n\n return [Number(match[1]), Number(match[2] ?? 0), Number(match[3] ?? 0)];\n}\n\nfunction compareVersions(left: [number, number, number], right: [number, number, number]): number {\n for (let index = 0; index < 3; index++) {\n const difference = (left[index] ?? 0) - (right[index] ?? 0);\n\n if (difference !== 0) return difference;\n }\n\n return 0;\n}\n\n/**\n * The minimum version of a `>=x.y.z` engines range, or `undefined` for any\n * other form (`^22`, `22.x || 24.x`): those are not interpreted rather than\n * guessed at.\n */\nexport function minimumOfRange(range: string): string | undefined {\n const match = /^\\s*>=\\s*v?(\\d+(?:\\.\\d+){0,2})\\s*$/.exec(range);\n\n return match?.[1];\n}\n\nfunction appEnginesRange(cwd: string): string | undefined {\n try {\n const manifest: unknown = JSON.parse(readFileSync(path.join(cwd, \"package.json\"), \"utf8\"));\n const engines =\n typeof manifest === \"object\" && manifest !== null\n ? Reflect.get(manifest, \"engines\")\n : undefined;\n const node =\n typeof engines === \"object\" && engines !== null ? Reflect.get(engines, \"node\") : undefined;\n\n return typeof node === \"string\" ? node : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Check the running Node.js against core's minimum and the app's own\n * `engines.node` (when it is a plain `>=` range). A mismatch is a `WL8001`\n * environment problem.\n */\nexport function checkNodeVersion(cwd: string, running = process.versions.node): ToolingProblem[] {\n const current = parseVersion(running);\n\n if (!current) return [];\n\n const requirements: { minimum: string; source: string }[] = [\n { minimum: MIN_NODE_VERSION, source: \"@warlock.js/core (engines.node >=22.15)\" },\n ];\n const appRange = appEnginesRange(cwd);\n const appMinimum = appRange ? minimumOfRange(appRange) : undefined;\n\n if (appMinimum) {\n requirements.push({ minimum: appMinimum, source: `package.json engines.node ${appRange}` });\n }\n\n const problems: ToolingProblem[] = [];\n\n for (const requirement of requirements) {\n const minimum = parseVersion(requirement.minimum);\n\n if (minimum && compareVersions(current, minimum) < 0) {\n problems.push(\n createProblem({\n code: \"WL8001\",\n source: \"environment\",\n message: `Node.js ${running} is older than ${requirement.minimum}, required by ${requirement.source}.`,\n }),\n );\n }\n }\n\n return problems;\n}\n"],"mappings":";;;;;;;;;;AASA,MAAa,mBAAmB;AAEhC,SAAS,aAAa,SAAuD;CAC3E,MAAM,QAAQ,mCAAmC,KAAK,QAAQ,KAAK,CAAC;CAEpE,IAAI,CAAC,OAAO,OAAO;CAEnB,OAAO;EAAC,OAAO,MAAM,EAAE;EAAG,OAAO,MAAM,MAAM,CAAC;EAAG,OAAO,MAAM,MAAM,CAAC;CAAC;AACxE;AAEA,SAAS,gBAAgB,MAAgC,OAAyC;CAChG,KAAK,IAAI,QAAQ,GAAG,QAAQ,GAAG,SAAS;EACtC,MAAM,cAAc,KAAK,UAAU,MAAM,MAAM,UAAU;EAEzD,IAAI,eAAe,GAAG,OAAO;CAC/B;CAEA,OAAO;AACT;;;;;;AAOA,SAAgB,eAAe,OAAmC;CAGhE,OAFc,qCAAqC,KAAK,KAE7C,CAAC,GAAG;AACjB;AAEA,SAAS,gBAAgB,KAAiC;CACxD,IAAI;EACF,MAAM,WAAoB,KAAK,MAAM,aAAa,KAAK,KAAK,KAAK,cAAc,GAAG,MAAM,CAAC;EACzF,MAAM,UACJ,OAAO,aAAa,YAAY,aAAa,OACzC,QAAQ,IAAI,UAAU,SAAS,IAC/B;EACN,MAAM,OACJ,OAAO,YAAY,YAAY,YAAY,OAAO,QAAQ,IAAI,SAAS,MAAM,IAAI;EAEnF,OAAO,OAAO,SAAS,WAAW,OAAO;CAC3C,QAAQ;EACN;CACF;AACF;;;;;;AAOA,SAAgB,iBAAiB,KAAa,UAAU,QAAQ,SAAS,MAAwB;CAC/F,MAAM,UAAU,aAAa,OAAO;CAEpC,IAAI,CAAC,SAAS,OAAO,CAAC;CAEtB,MAAM,eAAsD,CAC1D;EAAE,SAAS;EAAkB,QAAQ;CAA0C,CACjF;CACA,MAAM,WAAW,gBAAgB,GAAG;CACpC,MAAM,aAAa,WAAW,eAAe,QAAQ,IAAI;CAEzD,IAAI,YACF,aAAa,KAAK;EAAE,SAAS;EAAY,QAAQ,6BAA6B;CAAW,CAAC;CAG5F,MAAM,WAA6B,CAAC;CAEpC,KAAK,MAAM,eAAe,cAAc;EACtC,MAAM,UAAU,aAAa,YAAY,OAAO;EAEhD,IAAI,WAAW,gBAAgB,SAAS,OAAO,IAAI,GACjD,SAAS,KACP,cAAc;GACZ,MAAM;GACN,QAAQ;GACR,SAAS,WAAW,QAAQ,iBAAiB,YAAY,QAAQ,gBAAgB,YAAY,OAAO;EACtG,CAAC,CACH;CAEJ;CAEA,OAAO;AACT"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GitResult, GitRunner, listChangedFiles, runGit } from "./changed-files.mjs";
|
|
2
|
+
import { CHECK_EXIT_CODES, CHECK_STEPS, CheckExitCode, CheckReport, CheckStep, CheckStepName, CheckStepStatus, checkExitCode } from "./check-report.types.mjs";
|
|
3
|
+
import { checkFileConventions, checkTsconfigConventions, isAutoLoadedFile, runConventions } from "./conventions-step.mjs";
|
|
4
|
+
import { MIN_NODE_VERSION, checkNodeVersion } from "./environment-step.mjs";
|
|
5
|
+
import { LintOutcome, runLint } from "./lint-step.mjs";
|
|
6
|
+
import { VitestRun, VitestRunner, findVitest, parseVitestReport, runVitest } from "./tests-step.mjs";
|
|
7
|
+
import { CheckOptions, TypecheckRunner, runCheck } from "./run-check.mjs";
|
|
8
|
+
import { RunTestsOptions, TestRunReport, runTests, testRunArguments } from "./run-tests.mjs";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CHECK_EXIT_CODES, CHECK_STEPS, checkExitCode } from "./check-report.types.mjs";
|
|
2
|
+
import { listChangedFiles, runGit } from "./changed-files.mjs";
|
|
3
|
+
import { checkFileConventions, checkTsconfigConventions, isAutoLoadedFile, runConventions } from "./conventions-step.mjs";
|
|
4
|
+
import { MIN_NODE_VERSION, checkNodeVersion } from "./environment-step.mjs";
|
|
5
|
+
import { runLint } from "./lint-step.mjs";
|
|
6
|
+
import { findVitest, parseVitestReport, runVitest } from "./tests-step.mjs";
|
|
7
|
+
import { runCheck } from "./run-check.mjs";
|
|
8
|
+
import { runTests, testRunArguments } from "./run-tests.mjs";
|
|
9
|
+
|
|
10
|
+
export { };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ToolingProblem } from "../problem.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../../packages/core/src/tooling/check/lint-step.d.ts
|
|
4
|
+
/** What the lint step found, and which linters ran. */
|
|
5
|
+
type LintOutcome = {
|
|
6
|
+
problems: ToolingProblem[]; /** The linters that ran (`eslint`, `oxlint`); empty when the app configures none. */
|
|
7
|
+
linters: string[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Lint `files` (project-relative) with the linters the app configures, the
|
|
11
|
+
* same ones `warlock dev` runs in the background: ESLint when an
|
|
12
|
+
* `eslint.config.*` exists, oxlint when an oxlint config exists and the app
|
|
13
|
+
* has the `oxlint` package. A config without its tool is a `WL8002`
|
|
14
|
+
* environment problem.
|
|
15
|
+
*/
|
|
16
|
+
declare function runLint(cwd: string, files: readonly string[]): Promise<LintOutcome>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { LintOutcome, runLint };
|
|
19
|
+
//# sourceMappingURL=lint-step.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-step.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/lint-step.ts"],"mappings":";;;;KAWY,WAAA;EACV,QAAA,EAAU,cAAc,IADH;EAGrB,OAAA;AAAA;;;;;AAAO;AAuFT;;iBAAsB,OAAA,CAAQ,GAAA,UAAa,KAAA,sBAA2B,OAAO,CAAC,WAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { OxlintRunner, findOxlint, hasOxlintConfig } from "../../dev-server/health-checker/oxlint-runner.mjs";
|
|
2
|
+
import { hasEslint } from "../../dev-server/health-checker/default-health-checkers.mjs";
|
|
3
|
+
import { createProblem } from "../problem.mjs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { ESLint } from "eslint";
|
|
6
|
+
|
|
7
|
+
//#region ../../packages/core/src/tooling/check/lint-step.ts
|
|
8
|
+
const LINTABLE = /\.[cm]?[jt]sx?$/i;
|
|
9
|
+
function errorMessage(error) {
|
|
10
|
+
return error instanceof Error ? error.message : String(error);
|
|
11
|
+
}
|
|
12
|
+
/** A missing package/plugin is the machine's install; anything else is the tool crashing. */
|
|
13
|
+
function toolFailure(tool, error) {
|
|
14
|
+
const message = errorMessage(error);
|
|
15
|
+
return createProblem({
|
|
16
|
+
code: /cannot find (?:module|package)|ERR_MODULE_NOT_FOUND/i.test(message) ? "WL8002" : "WL8007",
|
|
17
|
+
source: "environment",
|
|
18
|
+
message: `${tool} could not run: ${message.split("\n")[0]}`
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async function runEslint(cwd, files) {
|
|
22
|
+
const results = await new ESLint({
|
|
23
|
+
cwd,
|
|
24
|
+
errorOnUnmatchedPattern: false,
|
|
25
|
+
warnIgnored: false
|
|
26
|
+
}).lintFiles([...files]);
|
|
27
|
+
const problems = [];
|
|
28
|
+
for (const result of results) {
|
|
29
|
+
const file = path.relative(cwd, result.filePath).split(path.sep).join("/");
|
|
30
|
+
for (const message of result.messages) {
|
|
31
|
+
const error = message.severity === 2 || message.fatal === true;
|
|
32
|
+
problems.push(createProblem({
|
|
33
|
+
code: error ? "WL7201" : "WL7202",
|
|
34
|
+
source: "eslint",
|
|
35
|
+
severity: error ? "error" : "warning",
|
|
36
|
+
message: message.message,
|
|
37
|
+
file,
|
|
38
|
+
line: message.line || null,
|
|
39
|
+
column: message.column || null,
|
|
40
|
+
rule: message.ruleId ?? null
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return problems;
|
|
45
|
+
}
|
|
46
|
+
async function runOxlint(cwd, files) {
|
|
47
|
+
const runner = new OxlintRunner();
|
|
48
|
+
runner.initialize(cwd);
|
|
49
|
+
try {
|
|
50
|
+
return (await runner.checkFiles(files.map((file) => ({
|
|
51
|
+
path: path.join(cwd, file),
|
|
52
|
+
relativePath: file
|
|
53
|
+
})))).flatMap((result) => [...result.errors, ...result.warnings].map((message) => createProblem({
|
|
54
|
+
code: message.type === "error" ? "WL7201" : "WL7202",
|
|
55
|
+
source: "oxlint",
|
|
56
|
+
severity: message.type,
|
|
57
|
+
message: message.message,
|
|
58
|
+
file: message.relativePath,
|
|
59
|
+
line: message.lineNumber,
|
|
60
|
+
column: message.columnNumber,
|
|
61
|
+
rule: message.ruleId ?? null
|
|
62
|
+
})));
|
|
63
|
+
} finally {
|
|
64
|
+
await runner.shutdown();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Lint `files` (project-relative) with the linters the app configures, the
|
|
69
|
+
* same ones `warlock dev` runs in the background: ESLint when an
|
|
70
|
+
* `eslint.config.*` exists, oxlint when an oxlint config exists and the app
|
|
71
|
+
* has the `oxlint` package. A config without its tool is a `WL8002`
|
|
72
|
+
* environment problem.
|
|
73
|
+
*/
|
|
74
|
+
async function runLint(cwd, files) {
|
|
75
|
+
const lintable = files.filter((file) => LINTABLE.test(file));
|
|
76
|
+
const problems = [];
|
|
77
|
+
const linters = [];
|
|
78
|
+
if (lintable.length === 0) return {
|
|
79
|
+
problems,
|
|
80
|
+
linters
|
|
81
|
+
};
|
|
82
|
+
if (hasEslint(cwd)) {
|
|
83
|
+
linters.push("eslint");
|
|
84
|
+
try {
|
|
85
|
+
problems.push(...await runEslint(cwd, lintable));
|
|
86
|
+
} catch (error) {
|
|
87
|
+
problems.push(toolFailure("ESLint", error));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (hasOxlintConfig(cwd)) {
|
|
91
|
+
linters.push("oxlint");
|
|
92
|
+
if (!findOxlint(cwd)) problems.push(createProblem({
|
|
93
|
+
code: "WL8002",
|
|
94
|
+
source: "environment",
|
|
95
|
+
message: "An oxlint config exists but the oxlint package is not installed in the app."
|
|
96
|
+
}));
|
|
97
|
+
else try {
|
|
98
|
+
problems.push(...await runOxlint(cwd, lintable));
|
|
99
|
+
} catch (error) {
|
|
100
|
+
problems.push(toolFailure("oxlint", error));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
problems,
|
|
105
|
+
linters
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { runLint };
|
|
111
|
+
//# sourceMappingURL=lint-step.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lint-step.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/lint-step.ts"],"sourcesContent":["import { ESLint } from \"eslint\";\nimport path from \"node:path\";\nimport { hasEslint } from \"../../dev-server/health-checker/default-health-checkers\";\nimport {\n findOxlint,\n hasOxlintConfig,\n OxlintRunner,\n} from \"../../dev-server/health-checker/oxlint-runner\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\n\n/** What the lint step found, and which linters ran. */\nexport type LintOutcome = {\n problems: ToolingProblem[];\n /** The linters that ran (`eslint`, `oxlint`); empty when the app configures none. */\n linters: string[];\n};\n\nconst LINTABLE = /\\.[cm]?[jt]sx?$/i;\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/** A missing package/plugin is the machine's install; anything else is the tool crashing. */\nfunction toolFailure(tool: string, error: unknown): ToolingProblem {\n const message = errorMessage(error);\n const missing = /cannot find (?:module|package)|ERR_MODULE_NOT_FOUND/i.test(message);\n\n return createProblem({\n code: missing ? \"WL8002\" : \"WL8007\",\n source: \"environment\",\n message: `${tool} could not run: ${message.split(\"\\n\")[0]}`,\n });\n}\n\nasync function runEslint(cwd: string, files: readonly string[]): Promise<ToolingProblem[]> {\n // The same flat-config lookup the dev server's ESLint checker uses.\n const eslint = new ESLint({ cwd, errorOnUnmatchedPattern: false, warnIgnored: false });\n const results = await eslint.lintFiles([...files]);\n const problems: ToolingProblem[] = [];\n\n for (const result of results) {\n const file = path.relative(cwd, result.filePath).split(path.sep).join(\"/\");\n\n for (const message of result.messages) {\n const error = message.severity === 2 || message.fatal === true;\n\n problems.push(\n createProblem({\n code: error ? \"WL7201\" : \"WL7202\",\n source: \"eslint\",\n severity: error ? \"error\" : \"warning\",\n message: message.message,\n file,\n line: message.line || null,\n column: message.column || null,\n rule: message.ruleId ?? null,\n }),\n );\n }\n }\n\n return problems;\n}\n\nasync function runOxlint(cwd: string, files: readonly string[]): Promise<ToolingProblem[]> {\n const runner = new OxlintRunner();\n\n runner.initialize(cwd);\n\n try {\n const results = await runner.checkFiles(\n files.map((file) => ({ path: path.join(cwd, file), relativePath: file })),\n );\n\n return results.flatMap((result) =>\n [...result.errors, ...result.warnings].map((message) =>\n createProblem({\n code: message.type === \"error\" ? \"WL7201\" : \"WL7202\",\n source: \"oxlint\",\n severity: message.type,\n message: message.message,\n file: message.relativePath,\n line: message.lineNumber,\n column: message.columnNumber,\n rule: message.ruleId ?? null,\n }),\n ),\n );\n } finally {\n await runner.shutdown();\n }\n}\n\n/**\n * Lint `files` (project-relative) with the linters the app configures, the\n * same ones `warlock dev` runs in the background: ESLint when an\n * `eslint.config.*` exists, oxlint when an oxlint config exists and the app\n * has the `oxlint` package. A config without its tool is a `WL8002`\n * environment problem.\n */\nexport async function runLint(cwd: string, files: readonly string[]): Promise<LintOutcome> {\n const lintable = files.filter((file) => LINTABLE.test(file));\n const problems: ToolingProblem[] = [];\n const linters: string[] = [];\n\n // ESLint lints the whole directory when handed no pattern; nothing to lint\n // means nothing to run.\n if (lintable.length === 0) return { problems, linters };\n\n if (hasEslint(cwd)) {\n linters.push(\"eslint\");\n\n try {\n problems.push(...(await runEslint(cwd, lintable)));\n } catch (error) {\n problems.push(toolFailure(\"ESLint\", error));\n }\n }\n\n if (hasOxlintConfig(cwd)) {\n linters.push(\"oxlint\");\n\n if (!findOxlint(cwd)) {\n problems.push(\n createProblem({\n code: \"WL8002\",\n source: \"environment\",\n message: \"An oxlint config exists but the oxlint package is not installed in the app.\",\n }),\n );\n } else {\n try {\n problems.push(...(await runOxlint(cwd, lintable)));\n } catch (error) {\n problems.push(toolFailure(\"oxlint\", error));\n }\n }\n }\n\n return { problems, linters };\n}\n"],"mappings":";;;;;;;AAiBA,MAAM,WAAW;AAEjB,SAAS,aAAa,OAAwB;CAC5C,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;;AAGA,SAAS,YAAY,MAAc,OAAgC;CACjE,MAAM,UAAU,aAAa,KAAK;CAGlC,OAAO,cAAc;EACnB,MAHc,uDAAuD,KAAK,OAG9D,IAAI,WAAW;EAC3B,QAAQ;EACR,SAAS,GAAG,KAAK,kBAAkB,QAAQ,MAAM,IAAI,CAAC,CAAC;CACzD,CAAC;AACH;AAEA,eAAe,UAAU,KAAa,OAAqD;CAGzF,MAAM,UAAU,MAAM,IADH,OAAO;EAAE;EAAK,yBAAyB;EAAO,aAAa;CAAM,CACzD,CAAC,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC;CACjD,MAAM,WAA6B,CAAC;CAEpC,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,OAAO,KAAK,SAAS,KAAK,OAAO,QAAQ,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG;EAEzE,KAAK,MAAM,WAAW,OAAO,UAAU;GACrC,MAAM,QAAQ,QAAQ,aAAa,KAAK,QAAQ,UAAU;GAE1D,SAAS,KACP,cAAc;IACZ,MAAM,QAAQ,WAAW;IACzB,QAAQ;IACR,UAAU,QAAQ,UAAU;IAC5B,SAAS,QAAQ;IACjB;IACA,MAAM,QAAQ,QAAQ;IACtB,QAAQ,QAAQ,UAAU;IAC1B,MAAM,QAAQ,UAAU;GAC1B,CAAC,CACH;EACF;CACF;CAEA,OAAO;AACT;AAEA,eAAe,UAAU,KAAa,OAAqD;CACzF,MAAM,SAAS,IAAI,aAAa;CAEhC,OAAO,WAAW,GAAG;CAErB,IAAI;EAKF,QAAO,MAJe,OAAO,WAC3B,MAAM,KAAK,UAAU;GAAE,MAAM,KAAK,KAAK,KAAK,IAAI;GAAG,cAAc;EAAK,EAAE,CAC1E,EAEc,CAAC,SAAS,WACtB,CAAC,GAAG,OAAO,QAAQ,GAAG,OAAO,QAAQ,CAAC,CAAC,KAAK,YAC1C,cAAc;GACZ,MAAM,QAAQ,SAAS,UAAU,WAAW;GAC5C,QAAQ;GACR,UAAU,QAAQ;GAClB,SAAS,QAAQ;GACjB,MAAM,QAAQ;GACd,MAAM,QAAQ;GACd,QAAQ,QAAQ;GAChB,MAAM,QAAQ,UAAU;EAC1B,CAAC,CACH,CACF;CACF,UAAU;EACR,MAAM,OAAO,SAAS;CACxB;AACF;;;;;;;;AASA,eAAsB,QAAQ,KAAa,OAAgD;CACzF,MAAM,WAAW,MAAM,QAAQ,SAAS,SAAS,KAAK,IAAI,CAAC;CAC3D,MAAM,WAA6B,CAAC;CACpC,MAAM,UAAoB,CAAC;CAI3B,IAAI,SAAS,WAAW,GAAG,OAAO;EAAE;EAAU;CAAQ;CAEtD,IAAI,UAAU,GAAG,GAAG;EAClB,QAAQ,KAAK,QAAQ;EAErB,IAAI;GACF,SAAS,KAAK,GAAI,MAAM,UAAU,KAAK,QAAQ,CAAE;EACnD,SAAS,OAAO;GACd,SAAS,KAAK,YAAY,UAAU,KAAK,CAAC;EAC5C;CACF;CAEA,IAAI,gBAAgB,GAAG,GAAG;EACxB,QAAQ,KAAK,QAAQ;EAErB,IAAI,CAAC,WAAW,GAAG,GACjB,SAAS,KACP,cAAc;GACZ,MAAM;GACN,QAAQ;GACR,SAAS;EACX,CAAC,CACH;OAEA,IAAI;GACF,SAAS,KAAK,GAAI,MAAM,UAAU,KAAK,QAAQ,CAAE;EACnD,SAAS,OAAO;GACd,SAAS,KAAK,YAAY,UAAU,KAAK,CAAC;EAC5C;CAEJ;CAEA,OAAO;EAAE;EAAU;CAAQ;AAC7B"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { isMemberAccess, isValueReference, memberName, resolveInitializer, unwrap, walk } from "./source-ast.mjs";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
//#region ../../packages/core/src/tooling/check/request-input.ts
|
|
5
|
+
/** Identifiers the source checks treat as the incoming request. */
|
|
6
|
+
const REQUEST_NAMES = new Set(["request", "req"]);
|
|
7
|
+
/**
|
|
8
|
+
* Request members that return client-controlled input. Reading any of them
|
|
9
|
+
* (as a property or a call) yields data the client chose.
|
|
10
|
+
*/
|
|
11
|
+
const REQUEST_INPUT_MEMBERS = new Set([
|
|
12
|
+
"all",
|
|
13
|
+
"allExceptParams",
|
|
14
|
+
"heavy",
|
|
15
|
+
"heavyExceptParams",
|
|
16
|
+
"only",
|
|
17
|
+
"pluck",
|
|
18
|
+
"except",
|
|
19
|
+
"input",
|
|
20
|
+
"get",
|
|
21
|
+
"email",
|
|
22
|
+
"string",
|
|
23
|
+
"int",
|
|
24
|
+
"bool",
|
|
25
|
+
"float",
|
|
26
|
+
"number",
|
|
27
|
+
"body",
|
|
28
|
+
"bodyInputs",
|
|
29
|
+
"params",
|
|
30
|
+
"query",
|
|
31
|
+
"validated",
|
|
32
|
+
"validatedExcept",
|
|
33
|
+
"idParam",
|
|
34
|
+
"headers",
|
|
35
|
+
"header",
|
|
36
|
+
"cookie",
|
|
37
|
+
"cookies",
|
|
38
|
+
"referer",
|
|
39
|
+
"referrer"
|
|
40
|
+
]);
|
|
41
|
+
/** Request members that return the whole (or most of the) request body. */
|
|
42
|
+
const REQUEST_BODY_MEMBERS = new Set([
|
|
43
|
+
"all",
|
|
44
|
+
"allExceptParams",
|
|
45
|
+
"heavy",
|
|
46
|
+
"heavyExceptParams",
|
|
47
|
+
"body",
|
|
48
|
+
"bodyInputs",
|
|
49
|
+
"validated",
|
|
50
|
+
"validatedExcept",
|
|
51
|
+
"only",
|
|
52
|
+
"except",
|
|
53
|
+
"pluck",
|
|
54
|
+
"headers",
|
|
55
|
+
"cookies"
|
|
56
|
+
]);
|
|
57
|
+
/**
|
|
58
|
+
* When `node` is `<request>.<member>` or `<request>.<member>(…)` (also through
|
|
59
|
+
* `request.query.next`-style chains), the `<member>`.
|
|
60
|
+
*/
|
|
61
|
+
function requestMemberAccess(node) {
|
|
62
|
+
let current = unwrap(node);
|
|
63
|
+
if (ts.isCallExpression(current)) current = unwrap(current.expression);
|
|
64
|
+
if (!isMemberAccess(current)) return void 0;
|
|
65
|
+
let member = current;
|
|
66
|
+
for (;;) {
|
|
67
|
+
const object = unwrap(member.expression);
|
|
68
|
+
if (ts.isIdentifier(object)) return REQUEST_NAMES.has(object.text) ? memberName(member) : void 0;
|
|
69
|
+
if (isMemberAccess(object)) {
|
|
70
|
+
member = object;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (ts.isCallExpression(object)) {
|
|
74
|
+
const callee = unwrap(object.expression);
|
|
75
|
+
if (!isMemberAccess(callee)) return void 0;
|
|
76
|
+
member = callee;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** Whether `node` reads client-controlled input from the request. */
|
|
83
|
+
function isRequestInputExpression(node) {
|
|
84
|
+
const member = requestMemberAccess(node);
|
|
85
|
+
return member !== void 0 && REQUEST_INPUT_MEMBERS.has(member);
|
|
86
|
+
}
|
|
87
|
+
function isSanitizerCall(call, sanitizers) {
|
|
88
|
+
const callee = unwrap(call.expression);
|
|
89
|
+
if (ts.isIdentifier(callee)) return sanitizers.has(callee.text);
|
|
90
|
+
if (isMemberAccess(callee)) {
|
|
91
|
+
const name = memberName(callee);
|
|
92
|
+
return name !== void 0 && sanitizers.has(name);
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Whether an expression carries request input: it reads the request directly,
|
|
98
|
+
* or names a local constant initialised from request input. A call to a
|
|
99
|
+
* sanitizer launders its arguments.
|
|
100
|
+
*/
|
|
101
|
+
function containsRequestInput(node, options = {}, seen = /* @__PURE__ */ new Set()) {
|
|
102
|
+
let found = false;
|
|
103
|
+
const sanitizers = options.sanitizers ?? /* @__PURE__ */ new Set();
|
|
104
|
+
walk(node, (child) => {
|
|
105
|
+
if (found) return false;
|
|
106
|
+
if (ts.isCallExpression(child) && isSanitizerCall(child, sanitizers)) return false;
|
|
107
|
+
if (isMemberAccess(child) || ts.isCallExpression(child)) {
|
|
108
|
+
if (isRequestInputExpression(child) || options.isSource?.(child) === true) {
|
|
109
|
+
found = true;
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (ts.isIdentifier(child) && !seen.has(child)) {
|
|
114
|
+
seen.add(child);
|
|
115
|
+
if (isValueReference(child)) {
|
|
116
|
+
const initializer = resolveInitializer(child);
|
|
117
|
+
if (initializer && !seen.has(initializer)) {
|
|
118
|
+
seen.add(initializer);
|
|
119
|
+
if (containsRequestInput(initializer, options, seen)) {
|
|
120
|
+
found = true;
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return found;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
export { REQUEST_BODY_MEMBERS, REQUEST_NAMES, containsRequestInput, requestMemberAccess };
|
|
132
|
+
//# sourceMappingURL=request-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-input.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/request-input.ts"],"sourcesContent":["import ts from \"typescript\";\nimport {\n isMemberAccess,\n isValueReference,\n memberName,\n resolveInitializer,\n unwrap,\n walk,\n} from \"./source-ast\";\n\n/** Identifiers the source checks treat as the incoming request. */\nexport const REQUEST_NAMES: ReadonlySet<string> = new Set([\"request\", \"req\"]);\n\n/**\n * Request members that return client-controlled input. Reading any of them\n * (as a property or a call) yields data the client chose.\n */\nconst REQUEST_INPUT_MEMBERS: ReadonlySet<string> = new Set([\n \"all\",\n \"allExceptParams\",\n \"heavy\",\n \"heavyExceptParams\",\n \"only\",\n \"pluck\",\n \"except\",\n \"input\",\n \"get\",\n \"email\",\n \"string\",\n \"int\",\n \"bool\",\n \"float\",\n \"number\",\n \"body\",\n \"bodyInputs\",\n \"params\",\n \"query\",\n \"validated\",\n \"validatedExcept\",\n \"idParam\",\n \"headers\",\n \"header\",\n \"cookie\",\n \"cookies\",\n \"referer\",\n \"referrer\",\n]);\n\n/** Request members that return the whole (or most of the) request body. */\nexport const REQUEST_BODY_MEMBERS: ReadonlySet<string> = new Set([\n \"all\",\n \"allExceptParams\",\n \"heavy\",\n \"heavyExceptParams\",\n \"body\",\n \"bodyInputs\",\n \"validated\",\n \"validatedExcept\",\n \"only\",\n \"except\",\n \"pluck\",\n \"headers\",\n \"cookies\",\n]);\n\n/**\n * When `node` is `<request>.<member>` or `<request>.<member>(…)` (also through\n * `request.query.next`-style chains), the `<member>`.\n */\nexport function requestMemberAccess(node: ts.Node): string | undefined {\n let current = unwrap(node);\n\n if (ts.isCallExpression(current)) current = unwrap(current.expression);\n if (!isMemberAccess(current)) return undefined;\n\n // Walk down to the member read directly off the request: `request.query.next` → `query`.\n let member = current;\n\n for (;;) {\n const object = unwrap(member.expression);\n\n if (ts.isIdentifier(object)) {\n return REQUEST_NAMES.has(object.text) ? memberName(member) : undefined;\n }\n\n if (isMemberAccess(object)) {\n member = object;\n continue;\n }\n\n if (ts.isCallExpression(object)) {\n const callee = unwrap(object.expression);\n if (!isMemberAccess(callee)) return undefined;\n member = callee;\n continue;\n }\n\n return undefined;\n }\n}\n\n/** Whether `node` reads client-controlled input from the request. */\nexport function isRequestInputExpression(node: ts.Node): boolean {\n const member = requestMemberAccess(node);\n\n return member !== undefined && REQUEST_INPUT_MEMBERS.has(member);\n}\n\nexport type TaintOptions = {\n /** Calls whose result is clean, whatever their arguments (matched by name). */\n sanitizers?: ReadonlySet<string>;\n /** Input sources besides the request (client query-string hooks, `location.search`). */\n isSource?: (node: ts.Node) => boolean;\n};\n\nfunction isSanitizerCall(call: ts.CallExpression, sanitizers: ReadonlySet<string>): boolean {\n const callee = unwrap(call.expression);\n\n if (ts.isIdentifier(callee)) return sanitizers.has(callee.text);\n\n if (isMemberAccess(callee)) {\n const name = memberName(callee);\n return name !== undefined && sanitizers.has(name);\n }\n\n return false;\n}\n\n/**\n * Whether an expression carries request input: it reads the request directly,\n * or names a local constant initialised from request input. A call to a\n * sanitizer launders its arguments.\n */\nexport function containsRequestInput(\n node: ts.Node,\n options: TaintOptions = {},\n seen: Set<ts.Node> = new Set(),\n): boolean {\n let found = false;\n const sanitizers = options.sanitizers ?? new Set<string>();\n\n walk(node, (child) => {\n if (found) return false;\n\n if (ts.isCallExpression(child) && isSanitizerCall(child, sanitizers)) return false;\n\n if (isMemberAccess(child) || ts.isCallExpression(child)) {\n if (isRequestInputExpression(child) || options.isSource?.(child) === true) {\n found = true;\n return false;\n }\n }\n\n if (ts.isIdentifier(child) && !seen.has(child)) {\n seen.add(child);\n\n if (isValueReference(child)) {\n const initializer = resolveInitializer(child);\n\n if (initializer && !seen.has(initializer)) {\n seen.add(initializer);\n\n if (containsRequestInput(initializer, options, seen)) {\n found = true;\n return false;\n }\n }\n }\n }\n\n return undefined;\n });\n\n return found;\n}\n"],"mappings":";;;;;AAWA,MAAa,gBAAqC,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC;;;;;AAM5E,MAAM,wBAA6C,IAAI,IAAI;CACzD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,MAAa,uBAA4C,IAAI,IAAI;CAC/D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;AAMD,SAAgB,oBAAoB,MAAmC;CACrE,IAAI,UAAU,OAAO,IAAI;CAEzB,IAAI,GAAG,iBAAiB,OAAO,GAAG,UAAU,OAAO,QAAQ,UAAU;CACrE,IAAI,CAAC,eAAe,OAAO,GAAG,OAAO;CAGrC,IAAI,SAAS;CAEb,SAAS;EACP,MAAM,SAAS,OAAO,OAAO,UAAU;EAEvC,IAAI,GAAG,aAAa,MAAM,GACxB,OAAO,cAAc,IAAI,OAAO,IAAI,IAAI,WAAW,MAAM,IAAI;EAG/D,IAAI,eAAe,MAAM,GAAG;GAC1B,SAAS;GACT;EACF;EAEA,IAAI,GAAG,iBAAiB,MAAM,GAAG;GAC/B,MAAM,SAAS,OAAO,OAAO,UAAU;GACvC,IAAI,CAAC,eAAe,MAAM,GAAG,OAAO;GACpC,SAAS;GACT;EACF;EAEA;CACF;AACF;;AAGA,SAAgB,yBAAyB,MAAwB;CAC/D,MAAM,SAAS,oBAAoB,IAAI;CAEvC,OAAO,WAAW,UAAa,sBAAsB,IAAI,MAAM;AACjE;AASA,SAAS,gBAAgB,MAAyB,YAA0C;CAC1F,MAAM,SAAS,OAAO,KAAK,UAAU;CAErC,IAAI,GAAG,aAAa,MAAM,GAAG,OAAO,WAAW,IAAI,OAAO,IAAI;CAE9D,IAAI,eAAe,MAAM,GAAG;EAC1B,MAAM,OAAO,WAAW,MAAM;EAC9B,OAAO,SAAS,UAAa,WAAW,IAAI,IAAI;CAClD;CAEA,OAAO;AACT;;;;;;AAOA,SAAgB,qBACd,MACA,UAAwB,CAAC,GACzB,uBAAqB,IAAI,IAAI,GACpB;CACT,IAAI,QAAQ;CACZ,MAAM,aAAa,QAAQ,8BAAc,IAAI,IAAY;CAEzD,KAAK,OAAO,UAAU;EACpB,IAAI,OAAO,OAAO;EAElB,IAAI,GAAG,iBAAiB,KAAK,KAAK,gBAAgB,OAAO,UAAU,GAAG,OAAO;EAE7E,IAAI,eAAe,KAAK,KAAK,GAAG,iBAAiB,KAAK,GACpD;OAAI,yBAAyB,KAAK,KAAK,QAAQ,WAAW,KAAK,MAAM,MAAM;IACzE,QAAQ;IACR,OAAO;GACT;;EAGF,IAAI,GAAG,aAAa,KAAK,KAAK,CAAC,KAAK,IAAI,KAAK,GAAG;GAC9C,KAAK,IAAI,KAAK;GAEd,IAAI,iBAAiB,KAAK,GAAG;IAC3B,MAAM,cAAc,mBAAmB,KAAK;IAE5C,IAAI,eAAe,CAAC,KAAK,IAAI,WAAW,GAAG;KACzC,KAAK,IAAI,WAAW;KAEpB,IAAI,qBAAqB,aAAa,SAAS,IAAI,GAAG;MACpD,QAAQ;MACR,OAAO;KACT;IACF;GACF;EACF;CAGF,CAAC;CAED,OAAO;AACT"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { GitRunner } from "./changed-files.mjs";
|
|
2
|
+
import { CheckReport, CheckStepName } from "./check-report.types.mjs";
|
|
3
|
+
import { TypecheckOptions, TypecheckResult } from "../typecheck/run-typecheck.mjs";
|
|
4
|
+
import { VitestRunner } from "./tests-step.mjs";
|
|
5
|
+
|
|
6
|
+
//#region ../../packages/core/src/tooling/check/run-check.d.ts
|
|
7
|
+
/** Runs the typecheck step. The CLI swaps in a child process so a heap overflow cannot end `check`. */
|
|
8
|
+
type TypecheckRunner = (options: TypecheckOptions) => Promise<TypecheckResult> | TypecheckResult;
|
|
9
|
+
/** Inputs of {@link runCheck}. */
|
|
10
|
+
type CheckOptions = {
|
|
11
|
+
/** Project root. Default: `process.cwd()`. */cwd?: string; /** Limit every step to the files changed against `base` (default HEAD) plus untracked files. */
|
|
12
|
+
changed?: boolean; /** Compare with `git merge-base <base> HEAD` instead of HEAD. Implies `changed`. */
|
|
13
|
+
base?: string; /** Steps not to run. */
|
|
14
|
+
skip?: readonly CheckStepName[]; /** tsconfig path, relative to `cwd`. Default: `tsconfig.json`. */
|
|
15
|
+
project?: string; /** How git is run. */
|
|
16
|
+
git?: GitRunner; /** How the typecheck runs. Default: in this process. */
|
|
17
|
+
typecheck?: TypecheckRunner; /** How vitest runs. */
|
|
18
|
+
vitest?: VitestRunner; /** Where the app's vitest CLI is. Default: resolved from the app root. */
|
|
19
|
+
vitestBinary?: string | null; /** The Node.js version to check. Default: the running one. */
|
|
20
|
+
nodeVersion?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The single verify command: typecheck, lint, the tests affected by the
|
|
24
|
+
* change, and the framework's convention checks, as one report with one entry
|
|
25
|
+
* per problem and an exit code that tells "your code" (1) from "this machine"
|
|
26
|
+
* (2).
|
|
27
|
+
*
|
|
28
|
+
* Every step runs even when an earlier one failed, so one run lists every
|
|
29
|
+
* problem. The only exception: with `changed`, a git failure leaves no file
|
|
30
|
+
* list, and every step after `environment` is `blocked`.
|
|
31
|
+
*/
|
|
32
|
+
declare function runCheck(options?: CheckOptions): Promise<CheckReport>;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { CheckOptions, TypecheckRunner, runCheck };
|
|
35
|
+
//# sourceMappingURL=run-check.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-check.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/run-check.ts"],"mappings":";;;;;;;KA8BY,eAAA,IACV,OAAA,EAAS,gBAAA,KACN,OAAA,CAAQ,eAAA,IAAmB,eAAA;AAFhC;AAAA,KAKY,YAAA;gDAEV,GAAA,WALW;EAOX,OAAA,YAP8B;EAS9B,IAAA,WAT6C;EAW7C,IAAA,YAAgB,aAAA,IAZhB;EAcA,OAAA,WAbW;EAeX,GAAA,GAAM,SAAA,EAfuC;EAiB7C,SAAA,GAAY,eAAA,EAdF;EAgBV,MAAA,GAAS,YAAA;EAET,YAAA,kBANM;EAQN,WAAA;AAAA;;;;;;;;;;;iBA4BoB,QAAA,CAAS,OAAA,GAAS,YAAA,GAAoB,OAAA,CAAQ,WAAA"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { CHECK_STEPS, checkExitCode } from "./check-report.types.mjs";
|
|
2
|
+
import { createProblem } from "../problem.mjs";
|
|
3
|
+
import { runTypecheck } from "../typecheck/run-typecheck.mjs";
|
|
4
|
+
import { listChangedFiles } from "./changed-files.mjs";
|
|
5
|
+
import { runConventions } from "./conventions-step.mjs";
|
|
6
|
+
import { checkNodeVersion } from "./environment-step.mjs";
|
|
7
|
+
import { runLint } from "./lint-step.mjs";
|
|
8
|
+
import { listSourceFiles, listTestFiles } from "./source-files.mjs";
|
|
9
|
+
import { findVitest, parseVitestReport, runVitest, vitestArguments, vitestRunFailure } from "./tests-step.mjs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
|
|
12
|
+
//#region ../../packages/core/src/tooling/check/run-check.ts
|
|
13
|
+
function errorMessage(error) {
|
|
14
|
+
return error instanceof Error ? error.message : String(error);
|
|
15
|
+
}
|
|
16
|
+
function statusOf(problems) {
|
|
17
|
+
const errors = problems.filter((problem) => problem.severity === "error");
|
|
18
|
+
if (errors.some((problem) => problem.category === "environment")) return "blocked";
|
|
19
|
+
return errors.length > 0 ? "failed" : "passed";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The single verify command: typecheck, lint, the tests affected by the
|
|
23
|
+
* change, and the framework's convention checks, as one report with one entry
|
|
24
|
+
* per problem and an exit code that tells "your code" (1) from "this machine"
|
|
25
|
+
* (2).
|
|
26
|
+
*
|
|
27
|
+
* Every step runs even when an earlier one failed, so one run lists every
|
|
28
|
+
* problem. The only exception: with `changed`, a git failure leaves no file
|
|
29
|
+
* list, and every step after `environment` is `blocked`.
|
|
30
|
+
*/
|
|
31
|
+
async function runCheck(options = {}) {
|
|
32
|
+
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
33
|
+
const changed = options.changed === true || options.base !== void 0;
|
|
34
|
+
const skip = new Set(options.skip ?? []);
|
|
35
|
+
const steps = [];
|
|
36
|
+
const problems = [];
|
|
37
|
+
let files = null;
|
|
38
|
+
let filesBlocked = false;
|
|
39
|
+
const run = async (name, body) => {
|
|
40
|
+
const startedAt = Date.now();
|
|
41
|
+
if (skip.has(name)) {
|
|
42
|
+
steps.push({
|
|
43
|
+
name,
|
|
44
|
+
status: "skipped",
|
|
45
|
+
durationMs: 0,
|
|
46
|
+
detail: "skipped with --skip"
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (filesBlocked && name !== "environment") {
|
|
51
|
+
steps.push({
|
|
52
|
+
name,
|
|
53
|
+
status: "blocked",
|
|
54
|
+
durationMs: 0,
|
|
55
|
+
detail: "the changed files could not be listed"
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let outcome;
|
|
60
|
+
try {
|
|
61
|
+
outcome = await body();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
outcome = {
|
|
64
|
+
detail: null,
|
|
65
|
+
problems: [createProblem({
|
|
66
|
+
code: "WL8007",
|
|
67
|
+
source: "environment",
|
|
68
|
+
message: `The ${name} step crashed: ${errorMessage(error)}`
|
|
69
|
+
})]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
problems.push(...outcome.problems);
|
|
73
|
+
steps.push({
|
|
74
|
+
name,
|
|
75
|
+
status: outcome.status ?? statusOf(outcome.problems),
|
|
76
|
+
durationMs: Date.now() - startedAt,
|
|
77
|
+
detail: outcome.detail
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
await run("environment", async () => {
|
|
81
|
+
const found = checkNodeVersion(cwd, options.nodeVersion);
|
|
82
|
+
if (changed) {
|
|
83
|
+
const listed = await listChangedFiles({
|
|
84
|
+
cwd,
|
|
85
|
+
base: options.base,
|
|
86
|
+
git: options.git
|
|
87
|
+
});
|
|
88
|
+
if ("problem" in listed) {
|
|
89
|
+
filesBlocked = true;
|
|
90
|
+
found.push(listed.problem);
|
|
91
|
+
} else files = listed.files;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
detail: `Node ${options.nodeVersion ?? process.versions.node}${files ? `, ${files.length} changed file(s)` : ""}`,
|
|
95
|
+
problems: found
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
const targets = async () => files ?? await listSourceFiles(cwd);
|
|
99
|
+
await run("typecheck", async () => {
|
|
100
|
+
if (files !== null && files.length === 0) return {
|
|
101
|
+
status: "skipped",
|
|
102
|
+
detail: "no changed files",
|
|
103
|
+
problems: []
|
|
104
|
+
};
|
|
105
|
+
const result = await (options.typecheck ?? runTypecheck)({
|
|
106
|
+
cwd,
|
|
107
|
+
project: options.project,
|
|
108
|
+
...files !== null ? { files } : {}
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
detail: `${result.checkedFiles} file(s) checked in ${result.durationMs}ms`,
|
|
112
|
+
problems: result.problems
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
await run("lint", async () => {
|
|
116
|
+
const lintFiles = await targets();
|
|
117
|
+
if (lintFiles.length === 0) return {
|
|
118
|
+
status: "skipped",
|
|
119
|
+
detail: "no files to lint",
|
|
120
|
+
problems: []
|
|
121
|
+
};
|
|
122
|
+
const { linters, problems: found } = await runLint(cwd, lintFiles);
|
|
123
|
+
if (linters.length === 0) return {
|
|
124
|
+
status: "skipped",
|
|
125
|
+
detail: "no ESLint or oxlint config",
|
|
126
|
+
problems: []
|
|
127
|
+
};
|
|
128
|
+
return {
|
|
129
|
+
detail: `${linters.join(" + ")} over ${lintFiles.length} file(s)`,
|
|
130
|
+
problems: found
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
await run("tests", async () => {
|
|
134
|
+
if (files !== null && files.length === 0) return {
|
|
135
|
+
status: "skipped",
|
|
136
|
+
detail: "no changed files",
|
|
137
|
+
problems: []
|
|
138
|
+
};
|
|
139
|
+
const binary = options.vitestBinary === void 0 ? findVitest(cwd) : options.vitestBinary;
|
|
140
|
+
if (!binary) {
|
|
141
|
+
if ((await listTestFiles(cwd)).length === 0) return {
|
|
142
|
+
status: "skipped",
|
|
143
|
+
detail: "no test files",
|
|
144
|
+
problems: []
|
|
145
|
+
};
|
|
146
|
+
return {
|
|
147
|
+
detail: null,
|
|
148
|
+
problems: [createProblem({
|
|
149
|
+
code: "WL8002",
|
|
150
|
+
source: "environment",
|
|
151
|
+
message: "The project has test files but vitest is not installed in the app."
|
|
152
|
+
})]
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const outcome = await (options.vitest ?? runVitest)(binary, vitestArguments(files), cwd);
|
|
156
|
+
const found = outcome.report === void 0 ? vitestRunFailure(outcome) : parseVitestReport(outcome.report, cwd);
|
|
157
|
+
const total = typeof outcome.report === "object" && outcome.report !== null ? Reflect.get(outcome.report, "numTotalTests") : void 0;
|
|
158
|
+
return {
|
|
159
|
+
detail: typeof total === "number" ? `${total} test(s) ran` : null,
|
|
160
|
+
problems: found
|
|
161
|
+
};
|
|
162
|
+
});
|
|
163
|
+
await run("conventions", async () => {
|
|
164
|
+
const conventionFiles = await targets();
|
|
165
|
+
return {
|
|
166
|
+
detail: `${conventionFiles.length} file(s) checked`,
|
|
167
|
+
problems: runConventions(cwd, conventionFiles, options.project)
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
steps.sort((first, second) => CHECK_STEPS.indexOf(first.name) - CHECK_STEPS.indexOf(second.name));
|
|
171
|
+
const exitCode = checkExitCode(problems);
|
|
172
|
+
const errors = problems.filter((problem) => problem.severity === "error");
|
|
173
|
+
return {
|
|
174
|
+
schemaVersion: 1,
|
|
175
|
+
ok: exitCode === 0,
|
|
176
|
+
exitCode,
|
|
177
|
+
changed,
|
|
178
|
+
files,
|
|
179
|
+
steps,
|
|
180
|
+
problems,
|
|
181
|
+
summary: {
|
|
182
|
+
errors: errors.length,
|
|
183
|
+
warnings: problems.length - errors.length,
|
|
184
|
+
code: errors.filter((problem) => problem.category === "code").length,
|
|
185
|
+
environment: errors.filter((problem) => problem.category === "environment").length
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
//#endregion
|
|
191
|
+
export { runCheck };
|
|
192
|
+
//# sourceMappingURL=run-check.mjs.map
|