@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/doctor/doctor-command.action.ts"],"sourcesContent":["import type { CommandActionData } from \"../../../commands/types\";\nimport { bootForDiagnostics } from \"./boot-for-diagnostics\";\nimport { defaultDoctorChecks } from \"./checks\";\nimport { fixLocaleSources } from \"./checks/locales-ts-deprecated.check\";\nimport { printReport } from \"./format-report\";\nimport { runChecks } from \"./run-checks\";\n\n/**\n * Action behind `warlock doctor`.\n *\n * Two steps, in this order and for a reason: ONE boot pass, then every check\n * against what that pass observed. The checks never boot anything themselves,\n * so the report cannot contain two lines that inspected the app at different\n * moments and contradicted each other — which is exactly what it used to\n * contain (`routes: 0 registered` beside `health: /health + /ready\n * registered`, in the same run, on an app serving fourteen routes).\n *\n * The pass boots every connector and starts none, so no database, cache or\n * socket connection is opened and no port is bound. See\n * `boot-for-diagnostics.ts`.\n *\n * A failing check is REPORTED (a line in the report + a non-zero exit), never\n * thrown: the runner converts any thrown check into a `fail` result first.\n *\n * On success this simply returns; the CLI manager then prints its own success\n * banner and exits zero — which also disposes of the handles the boot pass\n * left open (a Fastify instance, a Vite dev server for `web` apps).\n *\n * @param data Parsed CLI args
|
|
1
|
+
{"version":3,"file":"doctor-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/doctor/doctor-command.action.ts"],"sourcesContent":["import type { CommandActionData } from \"../../../commands/types\";\nimport { bootForDiagnostics } from \"./boot-for-diagnostics\";\nimport { defaultDoctorChecks } from \"./checks\";\nimport { fixLocaleSources } from \"./checks/locales-ts-deprecated.check\";\nimport { flushAndExit } from \"../../flush-and-exit\";\nimport { withConsoleOnStderr } from \"../routes/with-console-on-stderr\";\nimport { printReport, toDoctorJson } from \"./format-report\";\nimport { runChecks } from \"./run-checks\";\n\n/**\n * Action behind `warlock doctor`.\n *\n * Two steps, in this order and for a reason: ONE boot pass, then every check\n * against what that pass observed. The checks never boot anything themselves,\n * so the report cannot contain two lines that inspected the app at different\n * moments and contradicted each other — which is exactly what it used to\n * contain (`routes: 0 registered` beside `health: /health + /ready\n * registered`, in the same run, on an app serving fourteen routes).\n *\n * The pass boots every connector and starts none, so no database, cache or\n * socket connection is opened and no port is bound. See\n * `boot-for-diagnostics.ts`.\n *\n * A failing check is REPORTED (a line in the report + a non-zero exit), never\n * thrown: the runner converts any thrown check into a `fail` result first.\n *\n * On success this simply returns; the CLI manager then prints its own success\n * banner and exits zero — which also disposes of the handles the boot pass\n * left open (a Fastify instance, a Vite dev server for `web` apps).\n *\n * With `--json` the report is printed as JSON (see `toDoctorJson`): every\n * finding carries its stable `WL` code, `hint`, `skill` and `docs`.\n *\n * @param data Parsed CLI args: the optional safe migration flag and `--json`.\n */\nexport async function doctorCommandAction(data: CommandActionData): Promise<void> {\n const json = data.options.json === true;\n\n // With `--json`, stdout carries the report alone: the fix log and the boot's\n // progress lines go to stderr.\n const log = json ? console.error : console.log;\n\n if (data.options.fix === true) {\n for (const result of fixLocaleSources()) {\n const file = result.file.replace(process.cwd(), \".\").replaceAll(\"\\\\\", \"/\");\n log(`${result.convertible ? \"converted\" : \"manual\"} ${file}: ${result.reason}`);\n }\n }\n\n const context = json ? await withConsoleOnStderr(bootForDiagnostics) : await bootForDiagnostics();\n\n const report = await runChecks(defaultDoctorChecks, context);\n\n if (json) {\n console.log(JSON.stringify(toDoctorJson(report), null, 2));\n } else {\n printReport(report);\n }\n\n if (report.hasFailures) {\n await flushAndExit(report.exitCode);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,eAAsB,oBAAoB,MAAwC;CAChF,MAAM,OAAO,KAAK,QAAQ,SAAS;CAInC,MAAM,MAAM,OAAO,QAAQ,QAAQ,QAAQ;CAE3C,IAAI,KAAK,QAAQ,QAAQ,MACvB,KAAK,MAAM,UAAU,iBAAiB,GAAG;EACvC,MAAM,OAAO,OAAO,KAAK,QAAQ,QAAQ,IAAI,GAAG,GAAG,CAAC,CAAC,WAAW,MAAM,GAAG;EACzE,IAAI,GAAG,OAAO,cAAc,cAAc,SAAS,GAAG,KAAK,IAAI,OAAO,QAAQ;CAChF;CAKF,MAAM,SAAS,MAAM,UAAU,qBAFf,OAAO,MAAM,oBAAoB,kBAAkB,IAAI,MAAM,mBAAmB,CAErC;CAE3D,IAAI,MACF,QAAQ,IAAI,KAAK,UAAU,aAAa,MAAM,GAAG,MAAM,CAAC,CAAC;MAEzD,YAAY,MAAM;CAGpB,IAAI,OAAO,aACT,MAAM,aAAa,OAAO,QAAQ;AAEtC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ERROR_CODES, errorCodeDocsUrl } from "../../../errors/error-codes.mjs";
|
|
1
2
|
import { colors } from "@mongez/copper";
|
|
2
3
|
|
|
3
4
|
//#region ../../packages/core/src/cli/commands/doctor/format-report.ts
|
|
@@ -31,14 +32,41 @@ function colorizeSymbol(status) {
|
|
|
31
32
|
function printReport(report) {
|
|
32
33
|
for (const result of report.results) {
|
|
33
34
|
const symbol = colorizeSymbol(result.status);
|
|
34
|
-
|
|
35
|
+
const code = result.code ? colors.dim(` [${result.code}]`) : "";
|
|
36
|
+
console.log(`${symbol} ${colors.bold(result.name)}: ${result.detail}${code}`);
|
|
35
37
|
}
|
|
36
38
|
const { ok, warn, fail } = report.summary;
|
|
37
39
|
const summaryLine = `Summary: ${ok} ok, ${warn} warn, ${fail} fail`;
|
|
38
40
|
console.log("");
|
|
39
41
|
console.log(report.hasFailures ? colors.red(summaryLine) : colors.green(summaryLine));
|
|
40
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The machine-readable form of a doctor report: each finding with its stable
|
|
45
|
+
* code and the same `hint` / `skill` / `docs` fields `warlock check --json`
|
|
46
|
+
* prints, so one consumer reads both.
|
|
47
|
+
*
|
|
48
|
+
* @param report The aggregated doctor report.
|
|
49
|
+
*/
|
|
50
|
+
function toDoctorJson(report) {
|
|
51
|
+
return {
|
|
52
|
+
schemaVersion: 1,
|
|
53
|
+
results: report.results.map((result) => {
|
|
54
|
+
const definition = result.code ? ERROR_CODES[result.code] : void 0;
|
|
55
|
+
return {
|
|
56
|
+
name: result.name,
|
|
57
|
+
status: result.status,
|
|
58
|
+
detail: result.detail,
|
|
59
|
+
code: result.code ?? null,
|
|
60
|
+
hint: definition?.fix ?? null,
|
|
61
|
+
skill: definition?.skill ?? null,
|
|
62
|
+
docs: result.code ? errorCodeDocsUrl(result.code) : null
|
|
63
|
+
};
|
|
64
|
+
}),
|
|
65
|
+
summary: { ...report.summary },
|
|
66
|
+
exitCode: report.exitCode
|
|
67
|
+
};
|
|
68
|
+
}
|
|
41
69
|
|
|
42
70
|
//#endregion
|
|
43
|
-
export { printReport };
|
|
71
|
+
export { printReport, toDoctorJson };
|
|
44
72
|
//# sourceMappingURL=format-report.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-report.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/doctor/format-report.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport type { CheckStatus, DoctorReport } from \"./check.types\";\n\n/**\n * The glyph shown beside each check, keyed by status.\n */\nconst STATUS_SYMBOL: Record<CheckStatus, string> = {\n ok: \"✓\",\n warn: \"⚠\",\n fail: \"✗\",\n};\n\n/**\n * Colorize a status glyph. Kept separate from {@link STATUS_SYMBOL} so the\n * plain glyphs remain available for snapshot-friendly, color-free assertions.\n */\nfunction colorizeSymbol(status: CheckStatus): string {\n const symbol = STATUS_SYMBOL[status];\n\n switch (status) {\n case \"ok\":\n return colors.green(symbol);\n case \"warn\":\n return colors.yellow(symbol);\n case \"fail\":\n return colors.red(symbol);\n }\n}\n\n/**\n * Build the report body as an ordered list of plain (uncolored) lines:\n * one `<symbol> <name>: <detail>` line per check, a blank line, then a summary\n * line. Returned as strings (not printed) so the formatting is unit-testable.\n *\n * @param report The aggregated doctor report.\n * @returns The lines to print, top to bottom.\n */\nexport function formatReportLines(report: DoctorReport): string[] {\n const lines = report.results.map((result) => {\n return `${STATUS_SYMBOL[result.status]} ${result.name}: ${result.detail}`;\n });\n\n const { ok, warn, fail } = report.summary;\n\n lines.push(\"\");\n lines.push(`Summary: ${ok} ok, ${warn} warn, ${fail} fail`);\n\n return lines;\n}\n\n/**\n * Print the report to stdout with colored status glyphs and a colored summary\n * verdict. Thin wrapper over {@link formatReportLines} — the structured report\n * stays the source of truth for the exit code.\n *\n * @param report The aggregated doctor report.\n */\nexport function printReport(report: DoctorReport): void {\n for (const result of report.results) {\n const symbol = colorizeSymbol(result.status);\n\n console.log(`${symbol} ${colors.bold(result.name)}: ${result.detail}`);\n }\n\n const { ok, warn, fail } = report.summary;\n const summaryLine = `Summary: ${ok} ok, ${warn} warn, ${fail} fail`;\n\n console.log(\"\");\n console.log(report.hasFailures ? colors.red(summaryLine) : colors.green(summaryLine));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"format-report.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/doctor/format-report.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { ERROR_CODES, errorCodeDocsUrl, type WarlockErrorCode } from \"../../../errors/error-codes\";\nimport type { CheckStatus, DoctorReport } from \"./check.types\";\n\n/**\n * The glyph shown beside each check, keyed by status.\n */\nconst STATUS_SYMBOL: Record<CheckStatus, string> = {\n ok: \"✓\",\n warn: \"⚠\",\n fail: \"✗\",\n};\n\n/**\n * Colorize a status glyph. Kept separate from {@link STATUS_SYMBOL} so the\n * plain glyphs remain available for snapshot-friendly, color-free assertions.\n */\nfunction colorizeSymbol(status: CheckStatus): string {\n const symbol = STATUS_SYMBOL[status];\n\n switch (status) {\n case \"ok\":\n return colors.green(symbol);\n case \"warn\":\n return colors.yellow(symbol);\n case \"fail\":\n return colors.red(symbol);\n }\n}\n\n/**\n * Build the report body as an ordered list of plain (uncolored) lines:\n * one `<symbol> <name>: <detail>` line per check, a blank line, then a summary\n * line. Returned as strings (not printed) so the formatting is unit-testable.\n *\n * @param report The aggregated doctor report.\n * @returns The lines to print, top to bottom.\n */\nexport function formatReportLines(report: DoctorReport): string[] {\n const lines = report.results.map((result) => {\n const code = result.code ? ` [${result.code}]` : \"\";\n\n return `${STATUS_SYMBOL[result.status]} ${result.name}: ${result.detail}${code}`;\n });\n\n const { ok, warn, fail } = report.summary;\n\n lines.push(\"\");\n lines.push(`Summary: ${ok} ok, ${warn} warn, ${fail} fail`);\n\n return lines;\n}\n\n/**\n * Print the report to stdout with colored status glyphs and a colored summary\n * verdict. Thin wrapper over {@link formatReportLines} — the structured report\n * stays the source of truth for the exit code.\n *\n * @param report The aggregated doctor report.\n */\nexport function printReport(report: DoctorReport): void {\n for (const result of report.results) {\n const symbol = colorizeSymbol(result.status);\n\n const code = result.code ? colors.dim(` [${result.code}]`) : \"\";\n\n console.log(`${symbol} ${colors.bold(result.name)}: ${result.detail}${code}`);\n }\n\n const { ok, warn, fail } = report.summary;\n const summaryLine = `Summary: ${ok} ok, ${warn} warn, ${fail} fail`;\n\n console.log(\"\");\n console.log(report.hasFailures ? colors.red(summaryLine) : colors.green(summaryLine));\n}\n\n/** One check in `warlock doctor --json`. Every key is always present. */\nexport type DoctorJsonResult = {\n name: string;\n status: CheckStatus;\n detail: string;\n /** Stable Warlock error code of a `warn`/`fail` verdict, else `null`. */\n code: WarlockErrorCode | null;\n /** One line on what to do, from the code registry, else `null`. */\n hint: string | null;\n /** Slug of the skill that explains the fix, else `null`. */\n skill: string | null;\n /** Docs URL of the code, else `null`. */\n docs: string | null;\n};\n\n/** What `warlock doctor --json` prints. */\nexport type DoctorJsonReport = {\n schemaVersion: 1;\n results: DoctorJsonResult[];\n summary: Record<CheckStatus, number>;\n exitCode: 0 | 1;\n};\n\n/**\n * The machine-readable form of a doctor report: each finding with its stable\n * code and the same `hint` / `skill` / `docs` fields `warlock check --json`\n * prints, so one consumer reads both.\n *\n * @param report The aggregated doctor report.\n */\nexport function toDoctorJson(report: DoctorReport): DoctorJsonReport {\n return {\n schemaVersion: 1,\n results: report.results.map((result) => {\n const definition = result.code ? ERROR_CODES[result.code] : undefined;\n\n return {\n name: result.name,\n status: result.status,\n detail: result.detail,\n code: result.code ?? null,\n hint: definition?.fix ?? null,\n skill: definition?.skill ?? null,\n docs: result.code ? errorCodeDocsUrl(result.code) : null,\n };\n }),\n summary: { ...report.summary },\n exitCode: report.exitCode,\n };\n}\n"],"mappings":";;;;;;;AAOA,MAAM,gBAA6C;CACjD,IAAI;CACJ,MAAM;CACN,MAAM;AACR;;;;;AAMA,SAAS,eAAe,QAA6B;CACnD,MAAM,SAAS,cAAc;CAE7B,QAAQ,QAAR;EACE,KAAK,MACH,OAAO,OAAO,MAAM,MAAM;EAC5B,KAAK,QACH,OAAO,OAAO,OAAO,MAAM;EAC7B,KAAK,QACH,OAAO,OAAO,IAAI,MAAM;CAC5B;AACF;;;;;;;;AAgCA,SAAgB,YAAY,QAA4B;CACtD,KAAK,MAAM,UAAU,OAAO,SAAS;EACnC,MAAM,SAAS,eAAe,OAAO,MAAM;EAE3C,MAAM,OAAO,OAAO,OAAO,OAAO,IAAI,KAAK,OAAO,KAAK,EAAE,IAAI;EAE7D,QAAQ,IAAI,GAAG,OAAO,GAAG,OAAO,KAAK,OAAO,IAAI,EAAE,IAAI,OAAO,SAAS,MAAM;CAC9E;CAEA,MAAM,EAAE,IAAI,MAAM,SAAS,OAAO;CAClC,MAAM,cAAc,YAAY,GAAG,OAAO,KAAK,SAAS,KAAK;CAE7D,QAAQ,IAAI,EAAE;CACd,QAAQ,IAAI,OAAO,cAAc,OAAO,IAAI,WAAW,IAAI,OAAO,MAAM,WAAW,CAAC;AACtF;;;;;;;;AAgCA,SAAgB,aAAa,QAAwC;CACnE,OAAO;EACL,eAAe;EACf,SAAS,OAAO,QAAQ,KAAK,WAAW;GACtC,MAAM,aAAa,OAAO,OAAO,YAAY,OAAO,QAAQ;GAE5D,OAAO;IACL,MAAM,OAAO;IACb,QAAQ,OAAO;IACf,QAAQ,OAAO;IACf,MAAM,OAAO,QAAQ;IACrB,MAAM,YAAY,OAAO;IACzB,OAAO,YAAY,SAAS;IAC5B,MAAM,OAAO,OAAO,iBAAiB,OAAO,IAAI,IAAI;GACtD;EACF,CAAC;EACD,SAAS,EAAE,GAAG,OAAO,QAAQ;EAC7B,UAAU,OAAO;CACnB;AACF"}
|
|
@@ -28,6 +28,10 @@ const doctorCommand = command({
|
|
|
28
28
|
text: "--fix",
|
|
29
29
|
description: "Convert safely auto-convertible legacy utils/locales.ts files to locales.json",
|
|
30
30
|
type: "boolean"
|
|
31
|
+
}, {
|
|
32
|
+
text: "--json, -j",
|
|
33
|
+
description: "Print the report as JSON, each finding with its stable error code",
|
|
34
|
+
type: "boolean"
|
|
31
35
|
}],
|
|
32
36
|
preload: {
|
|
33
37
|
runtimeStrategy: "development",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/doctor.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\nimport { doctorCommandAction } from \"./doctor/doctor-command.action\";\n\n/**\n * `warlock doctor` — run a set of diagnostic checks against the real app and\n * print a grouped pass/warn/fail report. Exits non-zero if any check fails.\n *\n * Preload plan: config + env + framework bootstrap, and NO connectors. The\n * `connectors` preloader would START them (open the database, dial the cache,\n * bind the port); doctor's own boot pass BOOTS them instead — the phase where\n * routes and endpoints register — which is what gives the checks a real app to\n * read without opening a single connection. See\n * `doctor/boot-for-diagnostics.ts` for that seam.\n *\n * `runtimeStrategy: \"development\"` is declared, not defaulted: connectors branch\n * on it (`web` serves pages from a manifest in production and from Vite in\n * development, `http` picks its router scan the same way), and a diagnostic\n * command that left the strategy unset would take the production branch by\n * accident — refusing to boot a perfectly healthy app because no build manifest\n * exists. Doctor reads a working tree, so it says so.\n */\nexport const doctorCommand = command({\n name: \"doctor\",\n description:\n \"Boot the app read-only (no connections, no port) and report on its routes, config, connectors, drivers and health endpoints\",\n action: doctorCommandAction,\n options: [\n {\n text: \"--fix\",\n description: \"Convert safely auto-convertible legacy utils/locales.ts files to locales.json\",\n type: \"boolean\",\n },\n ],\n preload: {\n runtimeStrategy: \"development\",\n config: true,\n env: true,\n bootstrap: true,\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,aACE;CACF,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;CACA,SAAS;EACP,iBAAiB;EACjB,QAAQ;EACR,KAAK;EACL,WAAW;CACb;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"doctor.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/doctor.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\nimport { doctorCommandAction } from \"./doctor/doctor-command.action\";\n\n/**\n * `warlock doctor` — run a set of diagnostic checks against the real app and\n * print a grouped pass/warn/fail report. Exits non-zero if any check fails.\n *\n * Preload plan: config + env + framework bootstrap, and NO connectors. The\n * `connectors` preloader would START them (open the database, dial the cache,\n * bind the port); doctor's own boot pass BOOTS them instead — the phase where\n * routes and endpoints register — which is what gives the checks a real app to\n * read without opening a single connection. See\n * `doctor/boot-for-diagnostics.ts` for that seam.\n *\n * `runtimeStrategy: \"development\"` is declared, not defaulted: connectors branch\n * on it (`web` serves pages from a manifest in production and from Vite in\n * development, `http` picks its router scan the same way), and a diagnostic\n * command that left the strategy unset would take the production branch by\n * accident — refusing to boot a perfectly healthy app because no build manifest\n * exists. Doctor reads a working tree, so it says so.\n */\nexport const doctorCommand = command({\n name: \"doctor\",\n description:\n \"Boot the app read-only (no connections, no port) and report on its routes, config, connectors, drivers and health endpoints\",\n action: doctorCommandAction,\n options: [\n {\n text: \"--fix\",\n description: \"Convert safely auto-convertible legacy utils/locales.ts files to locales.json\",\n type: \"boolean\",\n },\n {\n text: \"--json, -j\",\n description: \"Print the report as JSON, each finding with its stable error code\",\n type: \"boolean\",\n },\n ],\n preload: {\n runtimeStrategy: \"development\",\n config: true,\n env: true,\n bootstrap: true,\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,gBAAgB,QAAQ;CACnC,MAAM;CACN,aACE;CACF,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;CACA,SAAS;EACP,iBAAiB;EACjB,QAAQ;EACR,KAAK;EACL,WAAW;CACb;AACF,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ERROR_CODES, errorCodeDocsUrl, explainErrorCode, isWarlockErrorCode } from "../../../errors/error-codes.mjs";
|
|
2
|
+
import { colors } from "@mongez/copper";
|
|
3
|
+
|
|
4
|
+
//#region ../../packages/core/src/cli/commands/explain/explain-command.action.ts
|
|
5
|
+
function withDocs(definition) {
|
|
6
|
+
return {
|
|
7
|
+
...definition,
|
|
8
|
+
docs: isWarlockErrorCode(definition.code) ? errorCodeDocsUrl(definition.code) : ""
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The lines `warlock explain <code>` prints, uncolored, so they are testable.
|
|
13
|
+
*
|
|
14
|
+
* @param definition The registry entry to describe.
|
|
15
|
+
*/
|
|
16
|
+
function formatExplanation(definition) {
|
|
17
|
+
const { docs } = withDocs(definition);
|
|
18
|
+
return [
|
|
19
|
+
`${definition.code} ${definition.title}`,
|
|
20
|
+
"",
|
|
21
|
+
` Area: ${definition.area} (${definition.category === "environment" ? "this machine" : "your code"})`,
|
|
22
|
+
` Fix: ${definition.fix}`,
|
|
23
|
+
` Skill: ${definition.skill}`,
|
|
24
|
+
` Docs: ${docs}`,
|
|
25
|
+
...definition.errorNames?.length ? [` Thrown as: ${definition.errorNames.join(", ")}`] : []
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
/** One line per registered code, for `warlock explain` without an argument. */
|
|
29
|
+
function formatCodeList() {
|
|
30
|
+
return Object.values(ERROR_CODES).map((definition) => `${definition.code} ${definition.title}`);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Action behind `warlock explain [code]`.
|
|
34
|
+
*
|
|
35
|
+
* With a code, prints what it means and what to do; with `--json`, the registry
|
|
36
|
+
* entry as JSON. Without a code, lists every code (or, with `--json`, every
|
|
37
|
+
* entry). An unknown code is thrown, so the CLI exits 1.
|
|
38
|
+
*
|
|
39
|
+
* @param data Parsed CLI args: the code as the first positional, `options.json`.
|
|
40
|
+
*/
|
|
41
|
+
async function explainCommandAction({ args, options }) {
|
|
42
|
+
const requested = args[0];
|
|
43
|
+
if (requested === void 0 || requested.trim() === "") {
|
|
44
|
+
if (options.json) {
|
|
45
|
+
console.log(JSON.stringify(Object.values(ERROR_CODES).map(withDocs), null, 2));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
for (const line of formatCodeList()) console.log(line);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const definition = explainErrorCode(requested);
|
|
52
|
+
if (!definition) throw new Error(`Unknown error code ${JSON.stringify(requested)}. Run \`warlock explain\` to list every code.`);
|
|
53
|
+
if (options.json) {
|
|
54
|
+
console.log(JSON.stringify(withDocs(definition), null, 2));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const [heading, ...rest] = formatExplanation(definition);
|
|
58
|
+
console.log(colors.bold(heading ?? definition.code));
|
|
59
|
+
for (const line of rest) console.log(line);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { explainCommandAction };
|
|
64
|
+
//# sourceMappingURL=explain-command.action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain-command.action.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/explain/explain-command.action.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport type { CommandActionData } from \"../../../commands/types\";\nimport {\n ERROR_CODES,\n type ErrorCodeDefinition,\n errorCodeDocsUrl,\n explainErrorCode,\n isWarlockErrorCode,\n} from \"../../../errors/error-codes\";\n\n/** What `warlock explain <code> --json` prints: the registry entry plus its docs URL. */\nexport type ExplainedErrorCode = ErrorCodeDefinition & { docs: string };\n\nfunction withDocs(definition: ErrorCodeDefinition): ExplainedErrorCode {\n return {\n ...definition,\n docs: isWarlockErrorCode(definition.code) ? errorCodeDocsUrl(definition.code) : \"\",\n };\n}\n\n/**\n * The lines `warlock explain <code>` prints, uncolored, so they are testable.\n *\n * @param definition The registry entry to describe.\n */\nexport function formatExplanation(definition: ErrorCodeDefinition): string[] {\n const { docs } = withDocs(definition);\n\n return [\n `${definition.code} ${definition.title}`,\n \"\",\n ` Area: ${definition.area} (${definition.category === \"environment\" ? \"this machine\" : \"your code\"})`,\n ` Fix: ${definition.fix}`,\n ` Skill: ${definition.skill}`,\n ` Docs: ${docs}`,\n ...(definition.errorNames?.length ? [` Thrown as: ${definition.errorNames.join(\", \")}`] : []),\n ];\n}\n\n/** One line per registered code, for `warlock explain` without an argument. */\nexport function formatCodeList(): string[] {\n return Object.values(ERROR_CODES).map(\n (definition: ErrorCodeDefinition) => `${definition.code} ${definition.title}`,\n );\n}\n\n/**\n * Action behind `warlock explain [code]`.\n *\n * With a code, prints what it means and what to do; with `--json`, the registry\n * entry as JSON. Without a code, lists every code (or, with `--json`, every\n * entry). An unknown code is thrown, so the CLI exits 1.\n *\n * @param data Parsed CLI args: the code as the first positional, `options.json`.\n */\nexport async function explainCommandAction({ args, options }: CommandActionData): Promise<void> {\n const requested = args[0];\n\n if (requested === undefined || requested.trim() === \"\") {\n if (options.json) {\n console.log(JSON.stringify(Object.values(ERROR_CODES).map(withDocs), null, 2));\n return;\n }\n\n for (const line of formatCodeList()) {\n console.log(line);\n }\n\n return;\n }\n\n const definition = explainErrorCode(requested);\n\n if (!definition) {\n // Thrown, not printed: the CLI reports it on stderr and exits 1.\n throw new Error(\n `Unknown error code ${JSON.stringify(requested)}. Run \\`warlock explain\\` to list every code.`,\n );\n }\n\n if (options.json) {\n console.log(JSON.stringify(withDocs(definition), null, 2));\n return;\n }\n\n const [heading, ...rest] = formatExplanation(definition);\n\n console.log(colors.bold(heading ?? definition.code));\n\n for (const line of rest) {\n console.log(line);\n }\n}\n"],"mappings":";;;;AAaA,SAAS,SAAS,YAAqD;CACrE,OAAO;EACL,GAAG;EACH,MAAM,mBAAmB,WAAW,IAAI,IAAI,iBAAiB,WAAW,IAAI,IAAI;CAClF;AACF;;;;;;AAOA,SAAgB,kBAAkB,YAA2C;CAC3E,MAAM,EAAE,SAAS,SAAS,UAAU;CAEpC,OAAO;EACL,GAAG,WAAW,KAAK,IAAI,WAAW;EAClC;EACA,eAAe,WAAW,KAAK,IAAI,WAAW,aAAa,gBAAgB,iBAAiB,YAAY;EACxG,eAAe,WAAW;EAC1B,eAAe,WAAW;EAC1B,eAAe;EACf,GAAI,WAAW,YAAY,SAAS,CAAC,gBAAgB,WAAW,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;CAC9F;AACF;;AAGA,SAAgB,iBAA2B;CACzC,OAAO,OAAO,OAAO,WAAW,CAAC,CAAC,KAC/B,eAAoC,GAAG,WAAW,KAAK,IAAI,WAAW,OACzE;AACF;;;;;;;;;;AAWA,eAAsB,qBAAqB,EAAE,MAAM,WAA6C;CAC9F,MAAM,YAAY,KAAK;CAEvB,IAAI,cAAc,UAAa,UAAU,KAAK,MAAM,IAAI;EACtD,IAAI,QAAQ,MAAM;GAChB,QAAQ,IAAI,KAAK,UAAU,OAAO,OAAO,WAAW,CAAC,CAAC,IAAI,QAAQ,GAAG,MAAM,CAAC,CAAC;GAC7E;EACF;EAEA,KAAK,MAAM,QAAQ,eAAe,GAChC,QAAQ,IAAI,IAAI;EAGlB;CACF;CAEA,MAAM,aAAa,iBAAiB,SAAS;CAE7C,IAAI,CAAC,YAEH,MAAM,IAAI,MACR,sBAAsB,KAAK,UAAU,SAAS,EAAE,8CAClD;CAGF,IAAI,QAAQ,MAAM;EAChB,QAAQ,IAAI,KAAK,UAAU,SAAS,UAAU,GAAG,MAAM,CAAC,CAAC;EACzD;CACF;CAEA,MAAM,CAAC,SAAS,GAAG,QAAQ,kBAAkB,UAAU;CAEvD,QAAQ,IAAI,OAAO,KAAK,WAAW,WAAW,IAAI,CAAC;CAEnD,KAAK,MAAM,QAAQ,MACjB,QAAQ,IAAI,IAAI;AAEpB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { command } from "../../commands/cli-command.mjs";
|
|
2
|
+
import { explainCommandAction } from "./explain/explain-command.action.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../packages/core/src/cli/commands/explain.command.ts
|
|
5
|
+
/**
|
|
6
|
+
* `warlock explain [code]` — print what a stable Warlock error code (`WL3001`)
|
|
7
|
+
* means, what to do about it, the skill that covers it and its docs link.
|
|
8
|
+
* Without a code it lists every code. Reads a static table: no preload.
|
|
9
|
+
*/
|
|
10
|
+
const explainCommand = command({
|
|
11
|
+
name: "explain [code]",
|
|
12
|
+
description: "Explain a Warlock error code (e.g. WL3001): what it means and how to fix it",
|
|
13
|
+
action: explainCommandAction,
|
|
14
|
+
options: [{
|
|
15
|
+
text: "--json, -j",
|
|
16
|
+
description: "Print the registry entry as JSON",
|
|
17
|
+
type: "boolean"
|
|
18
|
+
}]
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { explainCommand };
|
|
23
|
+
//# sourceMappingURL=explain.command.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain.command.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/cli/commands/explain.command.ts"],"sourcesContent":["import { command } from \"../../commands/cli-command\";\nimport { explainCommandAction } from \"./explain/explain-command.action\";\n\n/**\n * `warlock explain [code]` — print what a stable Warlock error code (`WL3001`)\n * means, what to do about it, the skill that covers it and its docs link.\n * Without a code it lists every code. Reads a static table: no preload.\n */\nexport const explainCommand = command({\n name: \"explain [code]\",\n description: \"Explain a Warlock error code (e.g. WL3001): what it means and how to fix it\",\n action: explainCommandAction,\n options: [\n {\n text: \"--json, -j\",\n description: \"Print the registry entry as JSON\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;;;;;AAQA,MAAa,iBAAiB,QAAQ;CACpC,MAAM;CACN,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;AACF,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { command } from "../../../commands/cli-command.mjs";
|
|
2
|
+
import { runGenerationCommand } from "../../../generations/generation-run.mjs";
|
|
2
3
|
import { generateController } from "./generators/controller.generator.mjs";
|
|
4
|
+
import { generateEndpoint } from "./generators/endpoint.generator.mjs";
|
|
3
5
|
import { generateMigration } from "./generators/migration.generator.mjs";
|
|
4
6
|
import { generateModel } from "./generators/model.generator.mjs";
|
|
5
7
|
import { generateModule } from "./generators/module.generator.mjs";
|
|
@@ -12,6 +14,7 @@ import { colors } from "@mongez/copper";
|
|
|
12
14
|
//#region ../../packages/core/src/cli/commands/generate/generate.command.ts
|
|
13
15
|
const generators = {
|
|
14
16
|
module: generateModule,
|
|
17
|
+
endpoint: generateEndpoint,
|
|
15
18
|
controller: generateController,
|
|
16
19
|
service: generateService,
|
|
17
20
|
"use-case": generateUseCase,
|
|
@@ -20,131 +23,162 @@ const generators = {
|
|
|
20
23
|
repository: generateRepository,
|
|
21
24
|
resource: generateResource
|
|
22
25
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Run one generator under the recorder that implements `--dry-run` and
|
|
28
|
+
* `--json` (see `generations/generation-run.ts`).
|
|
29
|
+
*/
|
|
30
|
+
function recorded(commandName, generator) {
|
|
31
|
+
return (data) => runGenerationCommand(commandName, data, generator);
|
|
32
|
+
}
|
|
33
|
+
/** Options every generator accepts. */
|
|
34
|
+
const commonOptions = [
|
|
35
|
+
{
|
|
36
|
+
text: "--force, -f",
|
|
37
|
+
description: "Overwrite existing files",
|
|
38
|
+
type: "boolean"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
text: "--dry-run",
|
|
42
|
+
description: "Preview the files that would be written or skipped without writing anything",
|
|
43
|
+
type: "boolean"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
text: "--json",
|
|
47
|
+
description: "Print one JSON report on stdout: files written, files skipped because they exist, messages",
|
|
48
|
+
type: "boolean"
|
|
33
49
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
];
|
|
51
|
+
/** Options of `make endpoint` / `generate.endpoint`. */
|
|
52
|
+
const endpointOptions = [
|
|
53
|
+
{
|
|
54
|
+
text: "--method <method>",
|
|
55
|
+
description: "HTTP method: get, post, put, patch or delete (default: post)"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
text: "--path <path>",
|
|
59
|
+
description: "Route path (default: /<module>, or /<module>/:id for put, patch and delete)"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
text: "--schema <file>",
|
|
63
|
+
description: "A TypeScript file exporting the request's seal object schema; its fields shape the resource and the test"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
text: "--resource <Name>",
|
|
67
|
+
description: "Resource the endpoint answers with (default: the module's singular name)"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
text: "--auth",
|
|
71
|
+
description: "Guard the route with the auth middleware (the default)",
|
|
72
|
+
type: "boolean"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
text: "--public",
|
|
76
|
+
description: "Register the route without a guard, marked public: true",
|
|
77
|
+
type: "boolean"
|
|
42
78
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
79
|
+
];
|
|
80
|
+
/** The `generate <generator>` / `make <generator>` dispatcher. */
|
|
81
|
+
function dispatchGenerator(label) {
|
|
82
|
+
return async (data) => {
|
|
83
|
+
const generatorName = data.args[0];
|
|
84
|
+
const generator = generatorName ? generators[generatorName] : void 0;
|
|
85
|
+
if (!generatorName || !generator) {
|
|
86
|
+
console.log(colors.red(generatorName ? `Error: Unknown generator "${generatorName}"` : "Error: Generator name is required"));
|
|
87
|
+
console.log(colors.yellow("\nAvailable generators:"));
|
|
88
|
+
Object.keys(generators).forEach((name) => {
|
|
89
|
+
console.log(colors.cyan(` - ${name}`));
|
|
90
|
+
});
|
|
91
|
+
console.log(colors.yellow(`\nUsage: warlock ${label} <generator> <name> [options]`));
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
await runGenerationCommand(`${label} ${generatorName}`, {
|
|
95
|
+
...data,
|
|
96
|
+
args: data.args.slice(1)
|
|
97
|
+
}, generator);
|
|
98
|
+
};
|
|
47
99
|
}
|
|
100
|
+
const generatorOptionsForDispatch = [
|
|
101
|
+
...commonOptions,
|
|
102
|
+
{
|
|
103
|
+
text: "--overwrite",
|
|
104
|
+
description: "With --force, also replace existing files that differ from the generated output (default: skip and list them)",
|
|
105
|
+
type: "boolean"
|
|
106
|
+
},
|
|
107
|
+
...endpointOptions
|
|
108
|
+
];
|
|
48
109
|
const generateCommand = command({
|
|
49
110
|
name: "generate <generator> [args...]",
|
|
50
111
|
alias: "g",
|
|
51
112
|
description: "Scaffold a new component",
|
|
52
|
-
action:
|
|
53
|
-
options:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
113
|
+
action: dispatchGenerator("generate"),
|
|
114
|
+
options: generatorOptionsForDispatch
|
|
115
|
+
});
|
|
116
|
+
/**
|
|
117
|
+
* `warlock make <generator>` — the same generators as `generate`, e.g.
|
|
118
|
+
* `warlock make endpoint posts/create-post --schema ./schema.ts --public`.
|
|
119
|
+
*/
|
|
120
|
+
const makeCommand = command({
|
|
121
|
+
name: "make <generator> [args...]",
|
|
122
|
+
description: "Scaffold a new component (same generators as generate)",
|
|
123
|
+
action: dispatchGenerator("make"),
|
|
124
|
+
options: generatorOptionsForDispatch
|
|
125
|
+
});
|
|
126
|
+
/** `warlock make.endpoint` / `generate.endpoint` — one spec-first endpoint. */
|
|
127
|
+
const generateEndpointCommand = command({
|
|
128
|
+
name: "generate.endpoint <module>/<name>",
|
|
129
|
+
alias: "make.endpoint",
|
|
130
|
+
description: "Generate an endpoint: route, controller, validation, service, resource, locale key, OpenAPI response schema and an HTTP test",
|
|
131
|
+
action: recorded("make endpoint", generateEndpoint),
|
|
132
|
+
options: [...endpointOptions, ...commonOptions]
|
|
62
133
|
});
|
|
63
134
|
const generateModuleCommand = command({
|
|
64
135
|
name: "generate.module <name>",
|
|
65
136
|
alias: "gen.m",
|
|
66
137
|
description: "Generate a new module",
|
|
67
|
-
action: generateModule,
|
|
138
|
+
action: recorded("generate.module", generateModule),
|
|
68
139
|
options: [
|
|
69
140
|
{
|
|
70
141
|
text: "--minimal, -m",
|
|
71
142
|
description: "Generate a minimal skeleton (routes, main, locales, empty subfolders) instead of the full CRUD scaffold",
|
|
72
143
|
type: "boolean"
|
|
73
144
|
},
|
|
74
|
-
{
|
|
75
|
-
text: "--force, -f",
|
|
76
|
-
description: "Overwrite existing files",
|
|
77
|
-
type: "boolean"
|
|
78
|
-
},
|
|
79
145
|
{
|
|
80
146
|
text: "--overwrite",
|
|
81
147
|
description: "With --force, also replace existing files that differ from the generated output (default: skip and list them)",
|
|
82
148
|
type: "boolean"
|
|
83
149
|
},
|
|
84
|
-
|
|
85
|
-
text: "--dry-run",
|
|
86
|
-
description: "Preview the files that would be generated without writing anything",
|
|
87
|
-
type: "boolean"
|
|
88
|
-
}
|
|
150
|
+
...commonOptions
|
|
89
151
|
]
|
|
90
152
|
});
|
|
91
153
|
const generateControllerCommand = command({
|
|
92
154
|
name: "generate.controller <module>/<name>",
|
|
93
155
|
alias: "gen.c",
|
|
94
156
|
description: "Generate a new controller",
|
|
95
|
-
action: generateController,
|
|
96
|
-
options: [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
text: "--force, -f",
|
|
104
|
-
description: "Overwrite existing files",
|
|
105
|
-
type: "boolean"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
text: "--dry-run",
|
|
109
|
-
description: "Preview the files that would be generated without writing anything",
|
|
110
|
-
type: "boolean"
|
|
111
|
-
}
|
|
112
|
-
]
|
|
157
|
+
action: recorded("generate.controller", generateController),
|
|
158
|
+
options: [{
|
|
159
|
+
text: "--with-validation, -v",
|
|
160
|
+
description: "Generate a validation schema and bind it to the controller",
|
|
161
|
+
type: "boolean"
|
|
162
|
+
}, ...commonOptions]
|
|
113
163
|
});
|
|
114
164
|
const generateServiceCommand = command({
|
|
115
165
|
name: "generate.service <module>/<name>",
|
|
116
166
|
alias: "gen.s",
|
|
117
167
|
description: "Generate a new service",
|
|
118
|
-
action: generateService,
|
|
119
|
-
options:
|
|
120
|
-
text: "--force, -f",
|
|
121
|
-
description: "Overwrite existing files",
|
|
122
|
-
type: "boolean"
|
|
123
|
-
}, {
|
|
124
|
-
text: "--dry-run",
|
|
125
|
-
description: "Preview the files that would be generated without writing anything",
|
|
126
|
-
type: "boolean"
|
|
127
|
-
}]
|
|
168
|
+
action: recorded("generate.service", generateService),
|
|
169
|
+
options: commonOptions
|
|
128
170
|
});
|
|
129
171
|
const generateUseCaseCommand = command({
|
|
130
172
|
name: "generate.use-case <module>/<verb-noun>",
|
|
131
173
|
description: "Generate a transport-agnostic use-case and its spec",
|
|
132
|
-
action: generateUseCase,
|
|
133
|
-
options:
|
|
134
|
-
text: "--force, -f",
|
|
135
|
-
description: "Overwrite existing files",
|
|
136
|
-
type: "boolean"
|
|
137
|
-
}, {
|
|
138
|
-
text: "--dry-run",
|
|
139
|
-
description: "Preview the files that would be generated without writing anything",
|
|
140
|
-
type: "boolean"
|
|
141
|
-
}]
|
|
174
|
+
action: recorded("generate.use-case", generateUseCase),
|
|
175
|
+
options: commonOptions
|
|
142
176
|
});
|
|
143
177
|
const generateModelCommand = command({
|
|
144
178
|
name: "generate.model <module>/<name>",
|
|
145
179
|
alias: "gen.md",
|
|
146
180
|
description: "Generate a new model with migration",
|
|
147
|
-
action: generateModel,
|
|
181
|
+
action: recorded("generate.model", generateModel),
|
|
148
182
|
options: [
|
|
149
183
|
{
|
|
150
184
|
text: "--with-resource, -rs",
|
|
@@ -155,21 +189,12 @@ const generateModelCommand = command({
|
|
|
155
189
|
text: "--table <name>",
|
|
156
190
|
description: "Specify table name"
|
|
157
191
|
},
|
|
158
|
-
{
|
|
159
|
-
text: "--force, -f",
|
|
160
|
-
description: "Overwrite existing files",
|
|
161
|
-
type: "boolean"
|
|
162
|
-
},
|
|
163
192
|
{
|
|
164
193
|
text: "--overwrite",
|
|
165
194
|
description: "With --force, also replace existing files that differ from the generated output (default: skip and list them)",
|
|
166
195
|
type: "boolean"
|
|
167
196
|
},
|
|
168
|
-
|
|
169
|
-
text: "--dry-run",
|
|
170
|
-
description: "Preview the files that would be generated without writing anything",
|
|
171
|
-
type: "boolean"
|
|
172
|
-
},
|
|
197
|
+
...commonOptions,
|
|
173
198
|
{
|
|
174
199
|
text: "--timestamps [bool]",
|
|
175
200
|
description: "Include timestamps in migration (default: true)",
|
|
@@ -186,48 +211,23 @@ const generateRepositoryCommand = command({
|
|
|
186
211
|
name: "generate.repository <module>/<name>",
|
|
187
212
|
alias: "gen.r",
|
|
188
213
|
description: "Generate a new repository",
|
|
189
|
-
action: generateRepository,
|
|
190
|
-
options:
|
|
191
|
-
text: "--force, -f",
|
|
192
|
-
description: "Overwrite existing files",
|
|
193
|
-
type: "boolean"
|
|
194
|
-
}, {
|
|
195
|
-
text: "--dry-run",
|
|
196
|
-
description: "Preview the files that would be generated without writing anything",
|
|
197
|
-
type: "boolean"
|
|
198
|
-
}]
|
|
214
|
+
action: recorded("generate.repository", generateRepository),
|
|
215
|
+
options: commonOptions
|
|
199
216
|
});
|
|
200
217
|
const generateResourceCommand = command({
|
|
201
218
|
name: "generate.resource <module>/<name>",
|
|
202
219
|
alias: "gen.rs",
|
|
203
220
|
description: "Generate a new resource",
|
|
204
|
-
action: generateResource,
|
|
205
|
-
options:
|
|
206
|
-
text: "--force, -f",
|
|
207
|
-
description: "Overwrite existing files",
|
|
208
|
-
type: "boolean"
|
|
209
|
-
}, {
|
|
210
|
-
text: "--dry-run",
|
|
211
|
-
description: "Preview the files that would be generated without writing anything",
|
|
212
|
-
type: "boolean"
|
|
213
|
-
}]
|
|
221
|
+
action: recorded("generate.resource", generateResource),
|
|
222
|
+
options: commonOptions
|
|
214
223
|
});
|
|
215
224
|
const generateMigrationCommand = command({
|
|
216
225
|
name: "generate.migration <model-path>",
|
|
217
226
|
alias: "gen.mig",
|
|
218
227
|
description: "Generate a new migration for a model",
|
|
219
|
-
action: generateMigration,
|
|
228
|
+
action: recorded("generate.migration", generateMigration),
|
|
220
229
|
options: [
|
|
221
|
-
|
|
222
|
-
text: "--force, -f",
|
|
223
|
-
description: "Overwrite existing files",
|
|
224
|
-
type: "boolean"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
text: "--dry-run",
|
|
228
|
-
description: "Preview the files that would be generated without writing anything",
|
|
229
|
-
type: "boolean"
|
|
230
|
-
},
|
|
230
|
+
...commonOptions,
|
|
231
231
|
{
|
|
232
232
|
text: "--add <columns>",
|
|
233
233
|
description: "Columns to add (DSL: name:type:modifier,...)"
|
|
@@ -254,5 +254,5 @@ const generateMigrationCommand = command({
|
|
|
254
254
|
});
|
|
255
255
|
|
|
256
256
|
//#endregion
|
|
257
|
-
export { generateCommand, generateControllerCommand, generateMigrationCommand, generateModelCommand, generateModuleCommand, generateRepositoryCommand, generateResourceCommand, generateServiceCommand, generateUseCaseCommand };
|
|
257
|
+
export { generateCommand, generateControllerCommand, generateEndpointCommand, generateMigrationCommand, generateModelCommand, generateModuleCommand, generateRepositoryCommand, generateResourceCommand, generateServiceCommand, generateUseCaseCommand, makeCommand };
|
|
258
258
|
//# sourceMappingURL=generate.command.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.command.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/generate/generate.command.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { command } from \"../../../commands/cli-command\";\nimport type { CommandActionData } from \"../../../commands/types\";\nimport { generateController } from \"./generators/controller.generator\";\nimport { generateMigration } from \"./generators/migration.generator\";\nimport { generateModel } from \"./generators/model.generator\";\nimport { generateModule } from \"./generators/module.generator\";\nimport { generateRepository } from \"./generators/repository.generator\";\nimport { generateResource } from \"./generators/resource.generator\";\nimport { generateService } from \"./generators/service.generator\";\nimport { generateUseCase } from \"./generators/use-case.generator\";\n\nconst generators: Record<string, (data: CommandActionData) => Promise<void>> = {\n module: generateModule,\n controller: generateController,\n service: generateService,\n \"use-case\": generateUseCase,\n model: generateModel,\n migration: generateMigration,\n repository: generateRepository,\n resource: generateResource,\n};\n\nasync function generateCommandAction(data: CommandActionData) {\n const commandName = data.args[0];\n\n if (!commandName) {\n console.log(colors.red(\"Error: Generator name is required\"));\n console.log(colors.yellow(\"\\nAvailable generators:\"));\n Object.keys(generators).forEach((cmd) => {\n console.log(colors.cyan(` - ${cmd}`));\n });\n console.log(colors.yellow(\"\\nUsage: warlock generate <generator> <name> [options]\"));\n process.exit(1);\n }\n\n const generator = generators[commandName];\n\n if (!generator) {\n console.log(colors.red(`Error: Unknown generator \"${commandName}\"`));\n console.log(colors.yellow(\"\\nAvailable generators:\"));\n Object.keys(generators).forEach((cmd) => {\n console.log(colors.cyan(` - ${cmd}`));\n });\n process.exit(1);\n }\n\n // Remove the command name from args for the generator\n const generatorData: CommandActionData = {\n ...data,\n args: data.args.slice(1),\n };\n\n await generator(generatorData);\n}\n\n// Master generate command\nexport const generateCommand = command({\n name: \"generate <generator> [args...]\",\n alias: \"g\", // Allows 'warlock g module ...'\n description: \"Scaffold a new component\",\n action: generateCommandAction,\n options: [\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n ],\n});\n\n// Individual commands\nexport const generateModuleCommand = command({\n name: \"generate.module <name>\",\n alias: \"gen.m\",\n description: \"Generate a new module\",\n action: generateModule,\n options: [\n {\n text: \"--minimal, -m\",\n description:\n \"Generate a minimal skeleton (routes, main, locales, empty subfolders) instead of the full CRUD scaffold\",\n type: \"boolean\",\n },\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--overwrite\",\n description:\n \"With --force, also replace existing files that differ from the generated output (default: skip and list them)\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateControllerCommand = command({\n name: \"generate.controller <module>/<name>\",\n alias: \"gen.c\",\n description: \"Generate a new controller\",\n action: generateController,\n options: [\n {\n text: \"--with-validation, -v\",\n description: \"Generate a validation schema and bind it to the controller\",\n type: \"boolean\",\n },\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateServiceCommand = command({\n name: \"generate.service <module>/<name>\",\n alias: \"gen.s\",\n description: \"Generate a new service\",\n action: generateService,\n options: [\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateUseCaseCommand = command({\n name: \"generate.use-case <module>/<verb-noun>\",\n description: \"Generate a transport-agnostic use-case and its spec\",\n action: generateUseCase,\n options: [\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateModelCommand = command({\n name: \"generate.model <module>/<name>\",\n alias: \"gen.md\",\n description: \"Generate a new model with migration\",\n action: generateModel,\n options: [\n {\n text: \"--with-resource, -rs\",\n description: \"Generate resource\",\n type: \"boolean\",\n },\n {\n text: \"--table <name>\",\n description: \"Specify table name\",\n },\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--overwrite\",\n description:\n \"With --force, also replace existing files that differ from the generated output (default: skip and list them)\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n {\n text: \"--timestamps [bool]\",\n description: \"Include timestamps in migration (default: true)\",\n type: \"boolean\",\n },\n {\n text: \"--no-timestamps\",\n description: \"Disable timestamps (same as --timestamps false)\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateRepositoryCommand = command({\n name: \"generate.repository <module>/<name>\",\n alias: \"gen.r\",\n description: \"Generate a new repository\",\n action: generateRepository,\n options: [\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateResourceCommand = command({\n name: \"generate.resource <module>/<name>\",\n alias: \"gen.rs\",\n description: \"Generate a new resource\",\n action: generateResource,\n options: [\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateMigrationCommand = command({\n name: \"generate.migration <model-path>\",\n alias: \"gen.mig\",\n description: \"Generate a new migration for a model\",\n action: generateMigration,\n options: [\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\",\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be generated without writing anything\",\n type: \"boolean\",\n },\n {\n text: \"--add <columns>\",\n description: \"Columns to add (DSL: name:type:modifier,...)\",\n },\n {\n text: \"--drop <columns>\",\n description: \"Columns to drop (comma-separated names)\",\n },\n {\n text: \"--rename <columns>\",\n description: \"Columns to rename (DSL: old:new,...)\",\n },\n {\n text: \"--timestamps [bool]\",\n description: \"Include timestamps (default: true)\",\n type: \"boolean\",\n },\n {\n text: \"--no-timestamps\",\n description: \"Disable timestamps (same as --timestamps false)\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;;;;;;;;AAYA,MAAM,aAAyE;CAC7E,QAAQ;CACR,YAAY;CACZ,SAAS;CACT,YAAY;CACZ,OAAO;CACP,WAAW;CACX,YAAY;CACZ,UAAU;AACZ;AAEA,eAAe,sBAAsB,MAAyB;CAC5D,MAAM,cAAc,KAAK,KAAK;CAE9B,IAAI,CAAC,aAAa;EAChB,QAAQ,IAAI,OAAO,IAAI,mCAAmC,CAAC;EAC3D,QAAQ,IAAI,OAAO,OAAO,yBAAyB,CAAC;EACpD,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;GACvC,QAAQ,IAAI,OAAO,KAAK,OAAO,KAAK,CAAC;EACvC,CAAC;EACD,QAAQ,IAAI,OAAO,OAAO,wDAAwD,CAAC;EACnF,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,YAAY,WAAW;CAE7B,IAAI,CAAC,WAAW;EACd,QAAQ,IAAI,OAAO,IAAI,6BAA6B,YAAY,EAAE,CAAC;EACnE,QAAQ,IAAI,OAAO,OAAO,yBAAyB,CAAC;EACpD,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;GACvC,QAAQ,IAAI,OAAO,KAAK,OAAO,KAAK,CAAC;EACvC,CAAC;EACD,QAAQ,KAAK,CAAC;CAChB;CAQA,MAAM,UAAU;EAJd,GAAG;EACH,MAAM,KAAK,KAAK,MAAM,CAAC;CAGG,CAAC;AAC/B;AAGA,MAAa,kBAAkB,QAAQ;CACrC,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;AACF,CAAC;AAGD,MAAa,wBAAwB,QAAQ;CAC3C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;EACP;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,QAAQ;CAC/C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC;AAED,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;AACF,CAAC;AAED,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;AACF,CAAC;AAED,MAAa,uBAAuB,QAAQ;CAC1C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,QAAQ;CAC/C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;AACF,CAAC;AAED,MAAa,0BAA0B,QAAQ;CAC7C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,GACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,CACF;AACF,CAAC;AAED,MAAa,2BAA2B,QAAQ;CAC9C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"generate.command.mjs","names":[],"sources":["../../../../../../../../../../packages/core/src/cli/commands/generate/generate.command.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport { command } from \"../../../commands/cli-command\";\nimport type { CommandActionData } from \"../../../commands/types\";\nimport { runGenerationCommand } from \"../../../generations/generation-run\";\nimport { generateController } from \"./generators/controller.generator\";\nimport { generateEndpoint } from \"./generators/endpoint.generator\";\nimport { generateMigration } from \"./generators/migration.generator\";\nimport { generateModel } from \"./generators/model.generator\";\nimport { generateModule } from \"./generators/module.generator\";\nimport { generateRepository } from \"./generators/repository.generator\";\nimport { generateResource } from \"./generators/resource.generator\";\nimport { generateService } from \"./generators/service.generator\";\nimport { generateUseCase } from \"./generators/use-case.generator\";\n\nconst generators: Record<string, (data: CommandActionData) => Promise<void>> = {\n module: generateModule,\n endpoint: generateEndpoint,\n controller: generateController,\n service: generateService,\n \"use-case\": generateUseCase,\n model: generateModel,\n migration: generateMigration,\n repository: generateRepository,\n resource: generateResource,\n};\n\n/**\n * Run one generator under the recorder that implements `--dry-run` and\n * `--json` (see `generations/generation-run.ts`).\n */\nfunction recorded(\n commandName: string,\n generator: (data: CommandActionData) => Promise<void>,\n): (data: CommandActionData) => Promise<void> {\n return (data) => runGenerationCommand(commandName, data, generator);\n}\n\n/** Options every generator accepts. */\nconst commonOptions = [\n {\n text: \"--force, -f\",\n description: \"Overwrite existing files\",\n type: \"boolean\" as const,\n },\n {\n text: \"--dry-run\",\n description: \"Preview the files that would be written or skipped without writing anything\",\n type: \"boolean\" as const,\n },\n {\n text: \"--json\",\n description:\n \"Print one JSON report on stdout: files written, files skipped because they exist, messages\",\n type: \"boolean\" as const,\n },\n];\n\n/** Options of `make endpoint` / `generate.endpoint`. */\nconst endpointOptions = [\n {\n text: \"--method <method>\",\n description: \"HTTP method: get, post, put, patch or delete (default: post)\",\n },\n {\n text: \"--path <path>\",\n description: \"Route path (default: /<module>, or /<module>/:id for put, patch and delete)\",\n },\n {\n text: \"--schema <file>\",\n description:\n \"A TypeScript file exporting the request's seal object schema; its fields shape the resource and the test\",\n },\n {\n text: \"--resource <Name>\",\n description: \"Resource the endpoint answers with (default: the module's singular name)\",\n },\n {\n text: \"--auth\",\n description: \"Guard the route with the auth middleware (the default)\",\n type: \"boolean\" as const,\n },\n {\n text: \"--public\",\n description: \"Register the route without a guard, marked public: true\",\n type: \"boolean\" as const,\n },\n];\n\n/** The `generate <generator>` / `make <generator>` dispatcher. */\nfunction dispatchGenerator(label: \"generate\" | \"make\") {\n return async (data: CommandActionData) => {\n const generatorName = data.args[0];\n const generator = generatorName ? generators[generatorName] : undefined;\n\n if (!generatorName || !generator) {\n console.log(\n colors.red(\n generatorName\n ? `Error: Unknown generator \"${generatorName}\"`\n : \"Error: Generator name is required\",\n ),\n );\n console.log(colors.yellow(\"\\nAvailable generators:\"));\n Object.keys(generators).forEach((name) => {\n console.log(colors.cyan(` - ${name}`));\n });\n console.log(colors.yellow(`\\nUsage: warlock ${label} <generator> <name> [options]`));\n process.exit(1);\n }\n\n // Remove the generator name from args for the generator\n await runGenerationCommand(\n `${label} ${generatorName}`,\n { ...data, args: data.args.slice(1) },\n generator,\n );\n };\n}\n\nconst generatorOptionsForDispatch = [\n ...commonOptions,\n {\n text: \"--overwrite\",\n description:\n \"With --force, also replace existing files that differ from the generated output (default: skip and list them)\",\n type: \"boolean\" as const,\n },\n ...endpointOptions,\n];\n\n// Master generate command\nexport const generateCommand = command({\n name: \"generate <generator> [args...]\",\n alias: \"g\", // Allows 'warlock g module ...'\n description: \"Scaffold a new component\",\n action: dispatchGenerator(\"generate\"),\n options: generatorOptionsForDispatch,\n});\n\n/**\n * `warlock make <generator>` — the same generators as `generate`, e.g.\n * `warlock make endpoint posts/create-post --schema ./schema.ts --public`.\n */\nexport const makeCommand = command({\n name: \"make <generator> [args...]\",\n description: \"Scaffold a new component (same generators as generate)\",\n action: dispatchGenerator(\"make\"),\n options: generatorOptionsForDispatch,\n});\n\n/** `warlock make.endpoint` / `generate.endpoint` — one spec-first endpoint. */\nexport const generateEndpointCommand = command({\n name: \"generate.endpoint <module>/<name>\",\n alias: \"make.endpoint\",\n description:\n \"Generate an endpoint: route, controller, validation, service, resource, locale key, OpenAPI response schema and an HTTP test\",\n action: recorded(\"make endpoint\", generateEndpoint),\n options: [...endpointOptions, ...commonOptions],\n});\n\n// Individual commands\nexport const generateModuleCommand = command({\n name: \"generate.module <name>\",\n alias: \"gen.m\",\n description: \"Generate a new module\",\n action: recorded(\"generate.module\", generateModule),\n options: [\n {\n text: \"--minimal, -m\",\n description:\n \"Generate a minimal skeleton (routes, main, locales, empty subfolders) instead of the full CRUD scaffold\",\n type: \"boolean\",\n },\n {\n text: \"--overwrite\",\n description:\n \"With --force, also replace existing files that differ from the generated output (default: skip and list them)\",\n type: \"boolean\",\n },\n ...commonOptions,\n ],\n});\n\nexport const generateControllerCommand = command({\n name: \"generate.controller <module>/<name>\",\n alias: \"gen.c\",\n description: \"Generate a new controller\",\n action: recorded(\"generate.controller\", generateController),\n options: [\n {\n text: \"--with-validation, -v\",\n description: \"Generate a validation schema and bind it to the controller\",\n type: \"boolean\",\n },\n ...commonOptions,\n ],\n});\n\nexport const generateServiceCommand = command({\n name: \"generate.service <module>/<name>\",\n alias: \"gen.s\",\n description: \"Generate a new service\",\n action: recorded(\"generate.service\", generateService),\n options: commonOptions,\n});\n\nexport const generateUseCaseCommand = command({\n name: \"generate.use-case <module>/<verb-noun>\",\n description: \"Generate a transport-agnostic use-case and its spec\",\n action: recorded(\"generate.use-case\", generateUseCase),\n options: commonOptions,\n});\n\nexport const generateModelCommand = command({\n name: \"generate.model <module>/<name>\",\n alias: \"gen.md\",\n description: \"Generate a new model with migration\",\n action: recorded(\"generate.model\", generateModel),\n options: [\n {\n text: \"--with-resource, -rs\",\n description: \"Generate resource\",\n type: \"boolean\",\n },\n {\n text: \"--table <name>\",\n description: \"Specify table name\",\n },\n {\n text: \"--overwrite\",\n description:\n \"With --force, also replace existing files that differ from the generated output (default: skip and list them)\",\n type: \"boolean\",\n },\n ...commonOptions,\n {\n text: \"--timestamps [bool]\",\n description: \"Include timestamps in migration (default: true)\",\n type: \"boolean\",\n },\n {\n text: \"--no-timestamps\",\n description: \"Disable timestamps (same as --timestamps false)\",\n type: \"boolean\",\n },\n ],\n});\n\nexport const generateRepositoryCommand = command({\n name: \"generate.repository <module>/<name>\",\n alias: \"gen.r\",\n description: \"Generate a new repository\",\n action: recorded(\"generate.repository\", generateRepository),\n options: commonOptions,\n});\n\nexport const generateResourceCommand = command({\n name: \"generate.resource <module>/<name>\",\n alias: \"gen.rs\",\n description: \"Generate a new resource\",\n action: recorded(\"generate.resource\", generateResource),\n options: commonOptions,\n});\n\nexport const generateMigrationCommand = command({\n name: \"generate.migration <model-path>\",\n alias: \"gen.mig\",\n description: \"Generate a new migration for a model\",\n action: recorded(\"generate.migration\", generateMigration),\n options: [\n ...commonOptions,\n {\n text: \"--add <columns>\",\n description: \"Columns to add (DSL: name:type:modifier,...)\",\n },\n {\n text: \"--drop <columns>\",\n description: \"Columns to drop (comma-separated names)\",\n },\n {\n text: \"--rename <columns>\",\n description: \"Columns to rename (DSL: old:new,...)\",\n },\n {\n text: \"--timestamps [bool]\",\n description: \"Include timestamps (default: true)\",\n type: \"boolean\",\n },\n {\n text: \"--no-timestamps\",\n description: \"Disable timestamps (same as --timestamps false)\",\n type: \"boolean\",\n },\n ],\n});\n"],"mappings":";;;;;;;;;;;;;;AAcA,MAAM,aAAyE;CAC7E,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,SAAS;CACT,YAAY;CACZ,OAAO;CACP,WAAW;CACX,YAAY;CACZ,UAAU;AACZ;;;;;AAMA,SAAS,SACP,aACA,WAC4C;CAC5C,QAAQ,SAAS,qBAAqB,aAAa,MAAM,SAAS;AACpE;;AAGA,MAAM,gBAAgB;CACpB;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA;EACE,MAAM;EACN,aACE;EACF,MAAM;CACR;AACF;;AAGA,MAAM,kBAAkB;CACtB;EACE,MAAM;EACN,aAAa;CACf;CACA;EACE,MAAM;EACN,aAAa;CACf;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aAAa;CACf;CACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR;AACF;;AAGA,SAAS,kBAAkB,OAA4B;CACrD,OAAO,OAAO,SAA4B;EACxC,MAAM,gBAAgB,KAAK,KAAK;EAChC,MAAM,YAAY,gBAAgB,WAAW,iBAAiB;EAE9D,IAAI,CAAC,iBAAiB,CAAC,WAAW;GAChC,QAAQ,IACN,OAAO,IACL,gBACI,6BAA6B,cAAc,KAC3C,mCACN,CACF;GACA,QAAQ,IAAI,OAAO,OAAO,yBAAyB,CAAC;GACpD,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,SAAS;IACxC,QAAQ,IAAI,OAAO,KAAK,OAAO,MAAM,CAAC;GACxC,CAAC;GACD,QAAQ,IAAI,OAAO,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;GACnF,QAAQ,KAAK,CAAC;EAChB;EAGA,MAAM,qBACJ,GAAG,MAAM,GAAG,iBACZ;GAAE,GAAG;GAAM,MAAM,KAAK,KAAK,MAAM,CAAC;EAAE,GACpC,SACF;CACF;AACF;AAEA,MAAM,8BAA8B;CAClC,GAAG;CACH;EACE,MAAM;EACN,aACE;EACF,MAAM;CACR;CACA,GAAG;AACL;AAGA,MAAa,kBAAkB,QAAQ;CACrC,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,kBAAkB,UAAU;CACpC,SAAS;AACX,CAAC;;;;;AAMD,MAAa,cAAc,QAAQ;CACjC,MAAM;CACN,aAAa;CACb,QAAQ,kBAAkB,MAAM;CAChC,SAAS;AACX,CAAC;;AAGD,MAAa,0BAA0B,QAAQ;CAC7C,MAAM;CACN,OAAO;CACP,aACE;CACF,QAAQ,SAAS,iBAAiB,gBAAgB;CAClD,SAAS,CAAC,GAAG,iBAAiB,GAAG,aAAa;AAChD,CAAC;AAGD,MAAa,wBAAwB,QAAQ;CAC3C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,SAAS,mBAAmB,cAAc;CAClD,SAAS;EACP;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA,GAAG;CACL;AACF,CAAC;AAED,MAAa,4BAA4B,QAAQ;CAC/C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,SAAS,uBAAuB,kBAAkB;CAC1D,SAAS,CACP;EACE,MAAM;EACN,aAAa;EACb,MAAM;CACR,GACA,GAAG,aACL;AACF,CAAC;AAED,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,SAAS,oBAAoB,eAAe;CACpD,SAAS;AACX,CAAC;AAED,MAAa,yBAAyB,QAAQ;CAC5C,MAAM;CACN,aAAa;CACb,QAAQ,SAAS,qBAAqB,eAAe;CACrD,SAAS;AACX,CAAC;AAED,MAAa,uBAAuB,QAAQ;CAC1C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,SAAS,kBAAkB,aAAa;CAChD,SAAS;EACP;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aACE;GACF,MAAM;EACR;EACA,GAAG;EACH;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,QAAQ;CAC/C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,SAAS,uBAAuB,kBAAkB;CAC1D,SAAS;AACX,CAAC;AAED,MAAa,0BAA0B,QAAQ;CAC7C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,SAAS,qBAAqB,gBAAgB;CACtD,SAAS;AACX,CAAC;AAED,MAAa,2BAA2B,QAAQ;CAC9C,MAAM;CACN,OAAO;CACP,aAAa;CACb,QAAQ,SAAS,sBAAsB,iBAAiB;CACxD,SAAS;EACP,GAAG;EACH;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;EACA;GACE,MAAM;GACN,aAAa;GACb,MAAM;EACR;CACF;AACF,CAAC"}
|