@warlock.js/core 5.30.0 → 5.32.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 +165 -36
- package/README.md +28 -23
- package/bin/source-load-hook.mjs +63 -0
- package/bin/warlock.js +102 -42
- package/esm/application/app.d.mts +3 -3
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/application-config-types.d.mts +1 -2
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +5 -7
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +3 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +14 -12
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/index.d.mts +2 -1
- package/esm/application/index.mjs +1 -1
- package/esm/application/public-url.d.mts +1 -2
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/roles.d.mts +10 -11
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -3
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -3
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -3
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/index.mjs +1 -1
- package/esm/benchmark/profiler.d.mts +1 -3
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +2 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +22 -17
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -2
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap.d.mts +1 -2
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +3 -5
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/index.d.mts +2 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs +6 -3
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- 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 +70 -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 +12 -3
- 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 +89 -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 +23 -27
- 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 +15 -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/controller.generator.mjs +5 -2
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +313 -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 +4 -3
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +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 +136 -0
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.mjs +2 -2
- package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +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 +73 -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/issue/collect-environment.mjs +187 -0
- package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
- package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
- package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
- package/esm/cli/commands/issue.command.mjs +31 -0
- package/esm/cli/commands/issue.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +104 -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 +1 -1
- 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 +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/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +3 -3
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +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/commands-loader.mjs +1 -1
- 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 +25 -1
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +3 -2
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.d.mts +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/commands/cli-command.d.mts +2 -4
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/index.d.mts +2 -1
- package/esm/commands/index.mjs +1 -1
- package/esm/commands/types.d.mts +8 -8
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +2 -3
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +5 -5
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -3
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-loader.d.mts +1 -2
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +35 -14
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +70 -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/config-setter.d.mts +2 -4
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +2 -2
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +2 -4
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/index.d.mts +7 -0
- package/esm/config/index.mjs +2 -1
- package/esm/config/types.d.mts +4 -5
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -3
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +2 -2
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -3
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +2 -2
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
- 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 +1 -3
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +26 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -3
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -3
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +2 -4
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +2 -2
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -3
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +2 -2
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +4 -4
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -3
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +2 -2
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -3
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +11 -9
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -1
- package/esm/connectors/index.mjs +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -3
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +2 -2
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -3
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +2 -2
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -3
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +2 -2
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +2 -4
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/single-server-warnings.mjs.map +1 -1
- package/esm/connectors/socket-connector.d.mts +1 -3
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +12 -10
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -3
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +2 -2
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +17 -14
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +7 -5
- package/esm/container/development-app-modules.d.mts.map +1 -1
- package/esm/container/development-model-modules.d.mts +6 -5
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +4 -4
- package/esm/container/index.d.mts.map +1 -1
- package/esm/container/index.mjs.map +1 -1
- package/esm/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/migrate-action.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -31
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/index.d.mts +2 -1
- package/esm/database/models/database-log/index.mjs +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seeds/seeder.d.mts +2 -4
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +6 -3
- 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/database/seeds/seeders.manager.mjs +2 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +7 -8
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +4 -5
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +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 +17 -9
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -3
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.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/extract-translation-keys.mjs +16 -17
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +3 -7
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -3
- package/esm/dev-server/file-operations.d.mts.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 +12 -11
- package/esm/dev-server/files-watcher.mjs.map +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/checkers/typescript-health-checker.mjs +36 -115
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
- 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 +12 -6
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +16 -4
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +303 -0
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -0
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
- 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/health-checker/workers/ts-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +4 -8
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +10 -6
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +4 -3
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- 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/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +4 -3
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +3 -2
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +3 -2
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -3
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +3 -3
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +40 -47
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +3 -2
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs +7 -39
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +3 -33
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/route-types-publisher.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -4
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/start-development-server.mjs.map +1 -1
- package/esm/dev-server/supervisor.mjs +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 +3 -3
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +31 -38
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +3 -4
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +2 -2
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +2 -3
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/hash.d.mts +1 -2
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/index.mjs +1 -1
- package/esm/encryption/password.d.mts +2 -3
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/types.d.mts +2 -3
- package/esm/encryption/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 +660 -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 +21 -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 +22 -5
- 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 +3 -2
- 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 +7 -3
- 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 +16 -23
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +2 -2
- package/esm/generations/features/shared/patch-tsconfig-include.mjs.map +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +2 -2
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -1
- package/esm/generations/features/sitemap.feature.mjs +3 -2
- 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 +156 -14
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +4 -5
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +2 -2
- package/esm/http/boot-port-preflight.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-cors-options.mjs +2 -2
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +15 -3
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +87 -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/config.d.mts +2 -4
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +2 -2
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +6 -7
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -2
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/createHttpApplication.d.mts +2 -3
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +2 -2
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +12 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +3 -2
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +2 -4
- package/esm/http/csrf-default-guard.d.mts.map +1 -1
- package/esm/http/csrf-default-guard.mjs +1 -1
- package/esm/http/csrf-default-guard.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.d.mts +7 -9
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +2 -2
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +26 -87
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/error-codes.d.mts +1 -2
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-mapper.d.mts +2 -4
- package/esm/http/error-mapper.d.mts.map +1 -1
- package/esm/http/error-mapper.mjs +2 -2
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +30 -29
- 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 +17 -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/events.d.mts +2 -4
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/flush-pending-cookies.mjs.map +1 -1
- package/esm/http/health.d.mts +4 -4
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/index.d.mts +9 -3
- package/esm/http/index.mjs +5 -2
- package/esm/http/lazy-static.mjs +194 -0
- package/esm/http/lazy-static.mjs.map +1 -0
- package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/index.d.mts +3 -1
- package/esm/http/middleware/index.mjs +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +2 -4
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +4 -4
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -3
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/index.d.mts +2 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -2
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +2 -2
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +2 -4
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +17 -14
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +3 -4
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +6 -4
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/ready-report.d.mts +15 -10
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/request-controller.d.mts +1 -3
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +26 -15
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +85 -6
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +6 -5
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +13 -11
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +23 -12
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +169 -81
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +50 -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 +12 -13
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +3 -5
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server.d.mts +11 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +17 -7
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +7 -7
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/stream-transport.mjs +4 -2
- package/esm/http/stream-transport.mjs.map +1 -1
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/trace-id.d.mts +2 -3
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +11 -9
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +78 -39
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +6 -5
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variant.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +13 -10
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +62 -25
- 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 +9 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +4 -3
- 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/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +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/parse-uploaded-file-query.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +9 -6
- 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 +6 -9
- 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 +7 -5
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-original-content-type.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 +9 -6
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +18 -9
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +2 -2
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +22 -16
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -2
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +6 -7
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/image/index.d.mts +2 -1
- package/esm/image/index.mjs +1 -1
- package/esm/index.d.mts +38 -6
- package/esm/index.mjs +14 -3
- package/esm/loader/app-module-importer.d.mts +1 -2
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/localization/index.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +6 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +2 -1
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +3 -4
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +2 -2
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -2
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/index.d.mts +2 -1
- package/esm/logger/index.mjs +1 -1
- package/esm/logger/logger.d.mts +1 -3
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/types.d.mts +2 -3
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +21 -12
- 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/events.d.mts +4 -6
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/index.d.mts +3 -2
- package/esm/mail/index.mjs +2 -2
- package/esm/mail/mail.d.mts +1 -3
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mailer-pool.d.mts +5 -7
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -3
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -3
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +2 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +11 -13
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/types.d.mts +17 -18
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/manifest/manifest-manager.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 +2 -4
- 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/cast-schema.mjs +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +5 -6
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/error-responses.mjs +28 -2
- package/esm/openapi/error-responses.mjs.map +1 -1
- package/esm/openapi/index.d.mts +3 -1
- package/esm/openapi/index.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs +2 -2
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/postman/build-request-body.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs +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 +1 -3
- 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/index.d.mts +2 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
- 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/postman-types.d.mts +19 -18
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -3
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.mjs.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs +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 +1 -1
- package/esm/openapi/security.mjs.map +1 -1
- package/esm/openapi/types.d.mts +23 -20
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +2 -1
- package/esm/production/assert-generated-imports.mjs.map +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/production-builder.mjs +14 -5
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/registration-child-runner.mjs +4 -3
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +4 -4
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +2 -1
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/production/route-registration-child.d.mts +1 -1
- package/esm/production/route-registration-child.mjs +8 -7
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/route-registration-snapshot.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/react/index.d.mts +1 -3
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/index.d.mts +2 -1
- package/esm/repositories/adapters/cascade/index.mjs +1 -1
- package/esm/repositories/contracts/index.d.mts +2 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +23 -25
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/index.d.mts +4 -1
- package/esm/repositories/index.mjs +1 -1
- package/esm/repositories/repository.manager.d.mts +2 -3
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +2 -2
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +3 -5
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/index.d.mts +2 -1
- package/esm/resource/index.mjs +1 -1
- package/esm/resource/nullable-resource.d.mts +5 -7
- package/esm/resource/nullable-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -3
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -3
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource.d.mts +3 -5
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +4 -2
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +21 -21
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/index.d.mts +2 -1
- package/esm/restful/index.mjs +1 -1
- package/esm/restful/restful.d.mts +11 -31
- 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 +5 -2
- package/esm/router/index.mjs +3 -1
- package/esm/router/log-request-lifecycle.mjs.map +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +2 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -2
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -2
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +15 -13
- 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-builder.d.mts +1 -3
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-guard-names.mjs +30 -0
- package/esm/router/route-guard-names.mjs.map +1 -0
- package/esm/router/route-name-method-suffix.d.mts +2 -3
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-taken-error.d.mts +12 -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/route-registry.d.mts +1 -3
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/router.d.mts +34 -17
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +74 -39
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +156 -37
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +38 -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/socket/index.d.mts +2 -1
- package/esm/socket/index.mjs +1 -1
- package/esm/socket/types.d.mts +2 -4
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +1 -3
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/storage/config.d.mts +4 -6
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +3 -4
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +2 -4
- 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/do-spaces-driver.d.mts +1 -3
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +2 -3
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +8 -3
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -3
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -3
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/index.d.mts +2 -1
- package/esm/storage/index.mjs +1 -1
- package/esm/storage/local-disk-roots.mjs +24 -0
- package/esm/storage/local-disk-roots.mjs.map +1 -0
- package/esm/storage/scoped-storage.d.mts +2 -3
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -3
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage.d.mts +17 -4
- 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 +36 -36
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -2
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -2
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +2 -3
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +6 -6
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +3 -3
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -3
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +2 -3
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +3 -2
- 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 +31 -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 +74 -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 +34 -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 +37 -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 +12 -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 +23 -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 +9 -0
- package/esm/tests/fakes/index.mjs +10 -0
- package/esm/tests/fakes/mail-fake.d.mts +49 -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 +56 -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 +35 -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 +38 -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 +15 -2
- package/esm/tests/index.mjs +15 -2
- package/esm/tests/snapshot-response.d.mts +33 -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 +25 -5
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +41 -8
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +2 -2
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-helpers.d.mts +28 -10
- 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 +66 -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/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +17 -7
- 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 +26 -0
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs +60 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +43 -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 +34 -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 +34 -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 +38 -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 +29 -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 +121 -0
- package/esm/tooling/board/board.d.mts.map +1 -0
- package/esm/tooling/board/board.mjs +407 -0
- package/esm/tooling/board/board.mjs.map +1 -0
- package/esm/tooling/board/board.types.d.mts +81 -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 +31 -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 +67 -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 +32 -0
- package/esm/tooling/check/conventions-step.d.mts.map +1 -0
- package/esm/tooling/check/conventions-step.mjs +173 -0
- package/esm/tooling/check/conventions-step.mjs.map +1 -0
- package/esm/tooling/check/environment-step.d.mts +16 -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.mjs +10 -0
- package/esm/tooling/check/lint-step.d.mts +18 -0
- package/esm/tooling/check/lint-step.d.mts.map +1 -0
- package/esm/tooling/check/lint-step.mjs +112 -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 +43 -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 +55 -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 +650 -0
- package/esm/tooling/check/security-conventions.mjs.map +1 -0
- package/esm/tooling/check/source-ast.mjs +155 -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 +33 -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 +43 -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 +100 -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 +90 -0
- package/esm/tooling/generate/generation.d.mts.map +1 -0
- package/esm/tooling/generate/generation.mjs +127 -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 +43 -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 +40 -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 +42 -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 +10 -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 +9 -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 +8 -0
- package/esm/tooling/inspect/index.mjs +7 -0
- package/esm/tooling/inspect/inspect-app.d.mts +62 -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 +14 -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 +228 -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 +29 -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 +50 -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 +77 -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 +61 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/load-ai-tools.mjs +45 -0
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -0
- package/esm/tooling/mcp/mcp-tools.d.mts +70 -0
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/mcp-tools.mjs +514 -0
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts +63 -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 +55 -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/syntax/ast.mjs +230 -0
- package/esm/tooling/syntax/ast.mjs.map +1 -0
- package/esm/tooling/syntax/imports.mjs +34 -0
- package/esm/tooling/syntax/imports.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +85 -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 +90 -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.mjs +3 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts +26 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -0
- package/esm/tooling/typecheck/run-typecheck.mjs +90 -0
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -0
- package/esm/tooling/typescript/compiler.d.mts +31 -0
- package/esm/tooling/typescript/compiler.d.mts.map +1 -0
- package/esm/tooling/typescript/compiler.mjs +120 -0
- package/esm/tooling/typescript/compiler.mjs.map +1 -0
- package/esm/updater/update-warlock-packages.mjs +3 -2
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- 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 +49 -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/index.d.mts +2 -1
- package/esm/use-cases/index.mjs +1 -1
- package/esm/use-cases/types.d.mts +116 -63
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -3
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +3 -5
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +6 -6
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case.d.mts +2 -4
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -3
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +8 -10
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.mjs.map +1 -1
- package/esm/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +35 -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/database-log.d.mts +3 -4
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/environment.d.mts +4 -5
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/framework-vesion.mjs +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +2 -3
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/ids.d.mts +35 -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 +5 -1
- package/esm/utils/index.mjs +4 -1
- package/esm/utils/normalized-path.d.mts +1 -2
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -2
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/paths.d.mts +13 -14
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +2 -2
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -2
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/queue.d.mts +1 -2
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/runtime.d.mts +60 -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/utils/sleep.d.mts +1 -2
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -3
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/to-json.d.mts +1 -2
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/types.d.mts +1 -2
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +5 -6
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -2
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +2 -3
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +2 -3
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/index.d.mts +2 -1
- package/esm/validation/database/index.mjs +1 -1
- package/esm/validation/database/types.d.mts +14 -10
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +2 -3
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +2 -3
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/file/file.d.mts +4 -6
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/index.d.mts +2 -1
- package/esm/validation/file/index.mjs +1 -1
- package/esm/validation/index.d.mts +6 -2
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +61 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +21 -4
- 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 +2 -20
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/index.d.mts +2 -1
- package/esm/validation/validators/index.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +2 -3
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/warlock-config/bundle-config.mjs +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -3
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +3 -2
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/types.d.mts +31 -6
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +2 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
- package/llms-full.txt +3211 -731
- package/llms.txt +16 -6
- package/package.json +47 -15
- 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 +10 -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 +11 -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/report-framework-issue.md +154 -0
- 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 +107 -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 +454 -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 +133 -0
- package/skills/warlock-conventions/SKILL.md +115 -0
- package/skills/warlock-doctor/SKILL.md +55 -22
- package/skills/warlock-inspect/SKILL.md +134 -0
- package/skills/warlock-mcp/SKILL.md +120 -0
- package/skills/warlock-routes/SKILL.md +18 -11
- package/skills/warlock-trace/SKILL.md +81 -0
- package/skills/wire-socket/SKILL.md +8 -8
- package/skills/write-seeder/SKILL.md +46 -32
- package/skills/write-use-case/SKILL.md +40 -27
- package/esm/http/uploads/matches-if-none-match.mjs +0 -13
- package/esm/http/uploads/matches-if-none-match.mjs.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createProblem } from "../problem.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { execFile } from "node:child_process";
|
|
5
|
+
|
|
6
|
+
//#region ../../packages/core/src/tooling/check/changed-files.ts
|
|
7
|
+
/** The default {@link GitRunner}: the `git` on PATH. */
|
|
8
|
+
const runGit = (args, cwd) => new Promise((resolve) => {
|
|
9
|
+
execFile("git", [...args], {
|
|
10
|
+
cwd,
|
|
11
|
+
encoding: "utf8",
|
|
12
|
+
windowsHide: true,
|
|
13
|
+
maxBuffer: 16777216
|
|
14
|
+
}, (error, stdout, stderr) => {
|
|
15
|
+
resolve({
|
|
16
|
+
code: error === null ? 0 : typeof error.code === "number" ? error.code : 127,
|
|
17
|
+
stdout,
|
|
18
|
+
stderr: stderr || (error?.message ?? "")
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
/** Files `warlock check --changed` considers: JavaScript and TypeScript sources. */
|
|
23
|
+
const SOURCE_FILE = /\.(?:[cm]?[jt]sx?)$/i;
|
|
24
|
+
function lines(output) {
|
|
25
|
+
return output.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
|
|
26
|
+
}
|
|
27
|
+
function gitProblem(message) {
|
|
28
|
+
return createProblem({
|
|
29
|
+
code: "WL8006",
|
|
30
|
+
source: "environment",
|
|
31
|
+
message
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The source files changed in the working tree — tracked changes against
|
|
36
|
+
* `base` (or HEAD) plus untracked files — relative to `cwd`, existing only.
|
|
37
|
+
*
|
|
38
|
+
* With `base`, the comparison point is `git merge-base <base> HEAD`, so a
|
|
39
|
+
* branch is compared with where it left `base` rather than with `base`'s tip.
|
|
40
|
+
* A git failure is a `WL8006` environment problem.
|
|
41
|
+
*/
|
|
42
|
+
async function listChangedFiles(options) {
|
|
43
|
+
const git = options.git ?? runGit;
|
|
44
|
+
let ref = "HEAD";
|
|
45
|
+
if (options.base) {
|
|
46
|
+
const mergeBase = await git([
|
|
47
|
+
"merge-base",
|
|
48
|
+
options.base,
|
|
49
|
+
"HEAD"
|
|
50
|
+
], options.cwd);
|
|
51
|
+
if (mergeBase.code !== 0) return { problem: gitProblem(`git merge-base ${options.base} HEAD failed: ${mergeBase.stderr.trim() || `exit ${mergeBase.code}`}`) };
|
|
52
|
+
ref = mergeBase.stdout.trim();
|
|
53
|
+
}
|
|
54
|
+
const diff = await git([
|
|
55
|
+
"diff",
|
|
56
|
+
"--name-only",
|
|
57
|
+
"--relative",
|
|
58
|
+
"--diff-filter=ACMR",
|
|
59
|
+
ref
|
|
60
|
+
], options.cwd);
|
|
61
|
+
if (diff.code !== 0) return { problem: gitProblem(`git diff against ${ref} failed: ${diff.stderr.trim() || `exit ${diff.code}`}`) };
|
|
62
|
+
const untracked = await git([
|
|
63
|
+
"ls-files",
|
|
64
|
+
"--others",
|
|
65
|
+
"--exclude-standard"
|
|
66
|
+
], options.cwd);
|
|
67
|
+
if (untracked.code !== 0) return { problem: gitProblem(`git ls-files failed: ${untracked.stderr.trim() || `exit ${untracked.code}`}`) };
|
|
68
|
+
return { files: [.../* @__PURE__ */ new Set([...lines(diff.stdout), ...lines(untracked.stdout)])].map((file) => file.split(path.sep).join("/")).filter((file) => SOURCE_FILE.test(file) && existsSync(path.join(options.cwd, file))).sort() };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
export { listChangedFiles, runGit };
|
|
73
|
+
//# sourceMappingURL=changed-files.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changed-files.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/changed-files.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\n\n/** The result of one git invocation. */\nexport type GitResult = { code: number; stdout: string; stderr: string };\n\n/** Runs `git <args>` in `cwd`. Injectable so tests need no repository. */\nexport type GitRunner = (args: readonly string[], cwd: string) => Promise<GitResult>;\n\n/** The default {@link GitRunner}: the `git` on PATH. */\nexport const runGit: GitRunner = (args, cwd) =>\n new Promise((resolve) => {\n execFile(\n \"git\",\n [...args],\n { cwd, encoding: \"utf8\", windowsHide: true, maxBuffer: 16 * 1024 * 1024 },\n (error, stdout, stderr) => {\n const code = error === null ? 0 : typeof error.code === \"number\" ? error.code : 127;\n\n resolve({ code, stdout, stderr: stderr || (error?.message ?? \"\") });\n },\n );\n });\n\n/** Files `warlock check --changed` considers: JavaScript and TypeScript sources. */\nconst SOURCE_FILE = /\\.(?:[cm]?[jt]sx?)$/i;\n\nfunction lines(output: string): string[] {\n return output\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter((line) => line.length > 0);\n}\n\nfunction gitProblem(message: string): ToolingProblem {\n return createProblem({ code: \"WL8006\", source: \"environment\", message });\n}\n\n/**\n * The source files changed in the working tree — tracked changes against\n * `base` (or HEAD) plus untracked files — relative to `cwd`, existing only.\n *\n * With `base`, the comparison point is `git merge-base <base> HEAD`, so a\n * branch is compared with where it left `base` rather than with `base`'s tip.\n * A git failure is a `WL8006` environment problem.\n */\nexport async function listChangedFiles(options: {\n cwd: string;\n base?: string;\n git?: GitRunner;\n}): Promise<{ files: string[] } | { problem: ToolingProblem }> {\n const git = options.git ?? runGit;\n let ref = \"HEAD\";\n\n if (options.base) {\n const mergeBase = await git([\"merge-base\", options.base, \"HEAD\"], options.cwd);\n\n if (mergeBase.code !== 0) {\n return {\n problem: gitProblem(\n `git merge-base ${options.base} HEAD failed: ${mergeBase.stderr.trim() || `exit ${mergeBase.code}`}`,\n ),\n };\n }\n\n ref = mergeBase.stdout.trim();\n }\n\n // `--relative` makes the paths relative to cwd and limits them to it.\n const diff = await git(\n [\"diff\", \"--name-only\", \"--relative\", \"--diff-filter=ACMR\", ref],\n options.cwd,\n );\n\n if (diff.code !== 0) {\n return {\n problem: gitProblem(\n `git diff against ${ref} failed: ${diff.stderr.trim() || `exit ${diff.code}`}`,\n ),\n };\n }\n\n const untracked = await git([\"ls-files\", \"--others\", \"--exclude-standard\"], options.cwd);\n\n if (untracked.code !== 0) {\n return {\n problem: gitProblem(\n `git ls-files failed: ${untracked.stderr.trim() || `exit ${untracked.code}`}`,\n ),\n };\n }\n\n const files = [...new Set([...lines(diff.stdout), ...lines(untracked.stdout)])]\n .map((file) => file.split(path.sep).join(\"/\"))\n .filter((file) => SOURCE_FILE.test(file) && existsSync(path.join(options.cwd, file)))\n .sort();\n\n return { files };\n}\n"],"mappings":";;;;;;;AAYA,MAAa,UAAqB,MAAM,QACtC,IAAI,SAAS,YAAY;CACvB,SACE,OACA,CAAC,GAAG,IAAI,GACR;EAAE;EAAK,UAAU;EAAQ,aAAa;EAAM,WAAW;CAAiB,IACvE,OAAO,QAAQ,WAAW;EAGzB,QAAQ;GAAE,MAFG,UAAU,OAAO,IAAI,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO;GAEhE;GAAQ,QAAQ,WAAW,OAAO,WAAW;EAAI,CAAC;CACpE,CACF;AACF,CAAC;;AAGH,MAAM,cAAc;AAEpB,SAAS,MAAM,QAA0B;CACvC,OAAO,OACJ,MAAM,OAAO,CAAC,CACd,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,CAAC;AACrC;AAEA,SAAS,WAAW,SAAiC;CACnD,OAAO,cAAc;EAAE,MAAM;EAAU,QAAQ;EAAe;CAAQ,CAAC;AACzE;;;;;;;;;AAUA,eAAsB,iBAAiB,SAIwB;CAC7D,MAAM,MAAM,QAAQ,OAAO;CAC3B,IAAI,MAAM;CAEV,IAAI,QAAQ,MAAM;EAChB,MAAM,YAAY,MAAM,IAAI;GAAC;GAAc,QAAQ;GAAM;EAAM,GAAG,QAAQ,GAAG;EAE7E,IAAI,UAAU,SAAS,GACrB,OAAO,EACL,SAAS,WACP,kBAAkB,QAAQ,KAAK,gBAAgB,UAAU,OAAO,KAAK,KAAK,QAAQ,UAAU,QAC9F,EACF;EAGF,MAAM,UAAU,OAAO,KAAK;CAC9B;CAGA,MAAM,OAAO,MAAM,IACjB;EAAC;EAAQ;EAAe;EAAc;EAAsB;CAAG,GAC/D,QAAQ,GACV;CAEA,IAAI,KAAK,SAAS,GAChB,OAAO,EACL,SAAS,WACP,oBAAoB,IAAI,WAAW,KAAK,OAAO,KAAK,KAAK,QAAQ,KAAK,QACxE,EACF;CAGF,MAAM,YAAY,MAAM,IAAI;EAAC;EAAY;EAAY;CAAoB,GAAG,QAAQ,GAAG;CAEvF,IAAI,UAAU,SAAS,GACrB,OAAO,EACL,SAAS,WACP,wBAAwB,UAAU,OAAO,KAAK,KAAK,QAAQ,UAAU,QACvE,EACF;CAQF,OAAO,EAAE,OALK,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,MAAM,KAAK,MAAM,GAAG,GAAG,MAAM,UAAU,MAAM,CAAC,CAAC,CAAC,CAAC,CAC5E,KAAK,SAAS,KAAK,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAC7C,QAAQ,SAAS,YAAY,KAAK,IAAI,KAAK,WAAW,KAAK,KAAK,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CACpF,KAEU,EAAE;AACjB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ToolingProblem } from "../problem.mjs";
|
|
2
|
+
//#region ../../packages/core/src/tooling/check/check-report.types.d.ts
|
|
3
|
+
/** The steps `warlock check` runs, in order. */
|
|
4
|
+
export declare const CHECK_STEPS: readonly ["environment", "typecheck", "lint", "tests", "conventions"];
|
|
5
|
+
/** One step name. */
|
|
6
|
+
export type CheckStepName = (typeof CHECK_STEPS)[number];
|
|
7
|
+
/**
|
|
8
|
+
* - `passed`: ran and found no error.
|
|
9
|
+
* - `failed`: ran and found at least one error-severity problem.
|
|
10
|
+
* - `skipped`: does not apply (no lint config, no tests, nothing changed, `--skip`).
|
|
11
|
+
* - `blocked`: could not run because of this machine; an environment problem says why.
|
|
12
|
+
*/
|
|
13
|
+
export type CheckStepStatus = "passed" | "failed" | "skipped" | "blocked";
|
|
14
|
+
/** One step of the report. */
|
|
15
|
+
export type CheckStep = {
|
|
16
|
+
name: CheckStepName;
|
|
17
|
+
status: CheckStepStatus;
|
|
18
|
+
durationMs: number;
|
|
19
|
+
/** One line on what the step did or why it did not run, or `null`. */
|
|
20
|
+
detail: string | null;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Exit codes of `warlock check` and `warlock typecheck`:
|
|
24
|
+
*
|
|
25
|
+
* | Code | Meaning |
|
|
26
|
+
* | ---- | -------------------------------------------------------------------------- |
|
|
27
|
+
* | 0 | no error-severity problem (warnings are allowed) |
|
|
28
|
+
* | 1 | problems in your code only: type, lint, test or convention errors |
|
|
29
|
+
* | 2 | this machine: Node version, missing tool, unreachable service, busy port, |
|
|
30
|
+
* | | git unavailable, a tool that crashed — the run is incomplete |
|
|
31
|
+
*
|
|
32
|
+
* 2 wins over 1: when the machine kept a step from running, the run did not
|
|
33
|
+
* check everything, so "only your code is wrong" cannot be claimed.
|
|
34
|
+
*/
|
|
35
|
+
export declare const CHECK_EXIT_CODES: {
|
|
36
|
+
readonly ok: 0;
|
|
37
|
+
readonly code: 1;
|
|
38
|
+
readonly environment: 2;
|
|
39
|
+
};
|
|
40
|
+
/** One of {@link CHECK_EXIT_CODES}. */
|
|
41
|
+
export type CheckExitCode = (typeof CHECK_EXIT_CODES)[keyof typeof CHECK_EXIT_CODES];
|
|
42
|
+
/** The exit code for a set of problems; see {@link CHECK_EXIT_CODES}. */
|
|
43
|
+
export declare function checkExitCode(problems: readonly ToolingProblem[]): CheckExitCode;
|
|
44
|
+
/** What `warlock check --json` prints. */
|
|
45
|
+
export type CheckReport = {
|
|
46
|
+
schemaVersion: 1;
|
|
47
|
+
/** `true` when the exit code is 0. */
|
|
48
|
+
ok: boolean;
|
|
49
|
+
exitCode: CheckExitCode;
|
|
50
|
+
/** Whether the run was limited to changed files. */
|
|
51
|
+
changed: boolean;
|
|
52
|
+
/** The changed files the run was limited to (project-relative), or `null` for a full run. */
|
|
53
|
+
files: string[] | null;
|
|
54
|
+
steps: CheckStep[];
|
|
55
|
+
/** One entry per problem, in step order. */
|
|
56
|
+
problems: ToolingProblem[];
|
|
57
|
+
summary: {
|
|
58
|
+
errors: number;
|
|
59
|
+
warnings: number;
|
|
60
|
+
/** Error-severity problems in the code. */
|
|
61
|
+
code: number;
|
|
62
|
+
/** Error-severity problems with the machine. */
|
|
63
|
+
environment: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
//# sourceMappingURL=check-report.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-report.types.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/check-report.types.ts"],"mappings":";;;qBAGa;;YAGD,wBAAwB;;;;;;;YAQxB;;YAGA;EACV,MAAM;EACN,QAAQ;EACR;;EAEA;;;;;;;;;;;;;;;qBAgBW;WACX;WACA;WACA;;;YAIU,wBAAwB,+BAA+B;;wBAGnD,cAAc,mBAAmB,mBAAmB;;YAWxD;EACV;;EAEA;EACA,UAAU;;EAEV;;EAEA;EACA,OAAO;;EAEP,UAAU;EACV;IACE;IACA;;IAEA;;IAEA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region ../../packages/core/src/tooling/check/check-report.types.ts
|
|
2
|
+
/** The steps `warlock check` runs, in order. */
|
|
3
|
+
const CHECK_STEPS = [
|
|
4
|
+
"environment",
|
|
5
|
+
"typecheck",
|
|
6
|
+
"lint",
|
|
7
|
+
"tests",
|
|
8
|
+
"conventions"
|
|
9
|
+
];
|
|
10
|
+
/**
|
|
11
|
+
* Exit codes of `warlock check` and `warlock typecheck`:
|
|
12
|
+
*
|
|
13
|
+
* | Code | Meaning |
|
|
14
|
+
* | ---- | -------------------------------------------------------------------------- |
|
|
15
|
+
* | 0 | no error-severity problem (warnings are allowed) |
|
|
16
|
+
* | 1 | problems in your code only: type, lint, test or convention errors |
|
|
17
|
+
* | 2 | this machine: Node version, missing tool, unreachable service, busy port, |
|
|
18
|
+
* | | git unavailable, a tool that crashed — the run is incomplete |
|
|
19
|
+
*
|
|
20
|
+
* 2 wins over 1: when the machine kept a step from running, the run did not
|
|
21
|
+
* check everything, so "only your code is wrong" cannot be claimed.
|
|
22
|
+
*/
|
|
23
|
+
const CHECK_EXIT_CODES = {
|
|
24
|
+
ok: 0,
|
|
25
|
+
code: 1,
|
|
26
|
+
environment: 2
|
|
27
|
+
};
|
|
28
|
+
/** The exit code for a set of problems; see {@link CHECK_EXIT_CODES}. */
|
|
29
|
+
function checkExitCode(problems) {
|
|
30
|
+
const errors = problems.filter((problem) => problem.severity === "error");
|
|
31
|
+
if (errors.some((problem) => problem.category === "environment")) return CHECK_EXIT_CODES.environment;
|
|
32
|
+
return errors.length > 0 ? CHECK_EXIT_CODES.code : CHECK_EXIT_CODES.ok;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { CHECK_EXIT_CODES, CHECK_STEPS, checkExitCode };
|
|
37
|
+
//# sourceMappingURL=check-report.types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-report.types.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/check-report.types.ts"],"sourcesContent":["import type { ToolingProblem } from \"../problem\";\n\n/** The steps `warlock check` runs, in order. */\nexport const CHECK_STEPS = [\"environment\", \"typecheck\", \"lint\", \"tests\", \"conventions\"] as const;\n\n/** One step name. */\nexport type CheckStepName = (typeof CHECK_STEPS)[number];\n\n/**\n * - `passed`: ran and found no error.\n * - `failed`: ran and found at least one error-severity problem.\n * - `skipped`: does not apply (no lint config, no tests, nothing changed, `--skip`).\n * - `blocked`: could not run because of this machine; an environment problem says why.\n */\nexport type CheckStepStatus = \"passed\" | \"failed\" | \"skipped\" | \"blocked\";\n\n/** One step of the report. */\nexport type CheckStep = {\n name: CheckStepName;\n status: CheckStepStatus;\n durationMs: number;\n /** One line on what the step did or why it did not run, or `null`. */\n detail: string | null;\n};\n\n/**\n * Exit codes of `warlock check` and `warlock typecheck`:\n *\n * | Code | Meaning |\n * | ---- | -------------------------------------------------------------------------- |\n * | 0 | no error-severity problem (warnings are allowed) |\n * | 1 | problems in your code only: type, lint, test or convention errors |\n * | 2 | this machine: Node version, missing tool, unreachable service, busy port, |\n * | | git unavailable, a tool that crashed — the run is incomplete |\n *\n * 2 wins over 1: when the machine kept a step from running, the run did not\n * check everything, so \"only your code is wrong\" cannot be claimed.\n */\nexport const CHECK_EXIT_CODES = {\n ok: 0,\n code: 1,\n environment: 2,\n} as const;\n\n/** One of {@link CHECK_EXIT_CODES}. */\nexport type CheckExitCode = (typeof CHECK_EXIT_CODES)[keyof typeof CHECK_EXIT_CODES];\n\n/** The exit code for a set of problems; see {@link CHECK_EXIT_CODES}. */\nexport function checkExitCode(problems: readonly ToolingProblem[]): CheckExitCode {\n const errors = problems.filter((problem) => problem.severity === \"error\");\n\n if (errors.some((problem) => problem.category === \"environment\")) {\n return CHECK_EXIT_CODES.environment;\n }\n\n return errors.length > 0 ? CHECK_EXIT_CODES.code : CHECK_EXIT_CODES.ok;\n}\n\n/** What `warlock check --json` prints. */\nexport type CheckReport = {\n schemaVersion: 1;\n /** `true` when the exit code is 0. */\n ok: boolean;\n exitCode: CheckExitCode;\n /** Whether the run was limited to changed files. */\n changed: boolean;\n /** The changed files the run was limited to (project-relative), or `null` for a full run. */\n files: string[] | null;\n steps: CheckStep[];\n /** One entry per problem, in step order. */\n problems: ToolingProblem[];\n summary: {\n errors: number;\n warnings: number;\n /** Error-severity problems in the code. */\n code: number;\n /** Error-severity problems with the machine. */\n environment: number;\n };\n};\n"],"mappings":";;AAGA,MAAa,cAAc;CAAC;CAAe;CAAa;CAAQ;CAAS;AAAa;;;;;;;;;;;;;;AAmCtF,MAAa,mBAAmB;CAC9B,IAAI;CACJ,MAAM;CACN,aAAa;AACf;;AAMA,SAAgB,cAAc,UAAoD;CAChF,MAAM,SAAS,SAAS,QAAQ,YAAY,QAAQ,aAAa,OAAO;CAExE,IAAI,OAAO,MAAM,YAAY,QAAQ,aAAa,aAAa,GAC7D,OAAO,iBAAiB;CAG1B,OAAO,OAAO,SAAS,IAAI,iBAAiB,OAAO,iBAAiB;AACtE"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { expressionOf, forEachChild, isAwaitExpression, isCallExpression, isClassDeclaration, isComputedPropertyName, isFunctionDeclaration, isIdentifier, isLiteralTypeNode, isPropertySignature, isUnionTypeNode, isVariableStatement, nameNode, topLevelDeclarations, valueText } from "../syntax/ast.mjs";
|
|
2
|
+
import { isMemberAccess, keyName, memberName, unwrap } from "./source-ast.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../packages/core/src/tooling/check/code-style-conventions.ts
|
|
5
|
+
const AWAITED_LOGGER_NAMES = /* @__PURE__ */ new Set(["log", "logger"]);
|
|
6
|
+
/** Logger methods that return the logger synchronously since 5.30. */
|
|
7
|
+
const SYNC_LOG_METHODS = /* @__PURE__ */ new Set([
|
|
8
|
+
"info",
|
|
9
|
+
"warn",
|
|
10
|
+
"error",
|
|
11
|
+
"debug",
|
|
12
|
+
"success",
|
|
13
|
+
"fatal",
|
|
14
|
+
"log",
|
|
15
|
+
"assert"
|
|
16
|
+
]);
|
|
17
|
+
function checkAwaitLog(node, findings) {
|
|
18
|
+
if (!isAwaitExpression(node)) return;
|
|
19
|
+
const argument = unwrap(expressionOf(node));
|
|
20
|
+
if (!isCallExpression(argument)) return;
|
|
21
|
+
const callee = unwrap(expressionOf(argument));
|
|
22
|
+
if (!isMemberAccess(callee)) return;
|
|
23
|
+
const owner = unwrap(expressionOf(callee));
|
|
24
|
+
if (!isIdentifier(owner) || !AWAITED_LOGGER_NAMES.has(valueText(owner))) return;
|
|
25
|
+
const method = memberName(callee);
|
|
26
|
+
if (!method || !SYNC_LOG_METHODS.has(method)) return;
|
|
27
|
+
findings.push({
|
|
28
|
+
code: "WL9010",
|
|
29
|
+
severity: "warning",
|
|
30
|
+
node,
|
|
31
|
+
message: `\`${valueText(owner)}.${method}()\` returns the logger synchronously; \`await\` does nothing here. Remove it (use \`await log.flush()\` to wait for delivery).`
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** Handler type annotations that mark a constant as a controller. */
|
|
35
|
+
const HANDLER_TYPE_PATTERN = /RequestHandler$/;
|
|
36
|
+
const CONTROLLER_NAME_PATTERN = /Controller$/;
|
|
37
|
+
function hasHandlerType(declaration) {
|
|
38
|
+
const type = declaration.id.typeAnnotation?.typeAnnotation;
|
|
39
|
+
return type?.type === "TSTypeReference" && type.typeName.type === "Identifier" && HANDLER_TYPE_PATTERN.test(type.typeName.name);
|
|
40
|
+
}
|
|
41
|
+
function controllerIdentifiers(statement) {
|
|
42
|
+
if (isFunctionDeclaration(statement) || isClassDeclaration(statement)) return statement.id && CONTROLLER_NAME_PATTERN.test(statement.id.name) ? [statement.id] : [];
|
|
43
|
+
if (!isVariableStatement(statement)) return [];
|
|
44
|
+
const found = [];
|
|
45
|
+
for (const declaration of statement.declarations) {
|
|
46
|
+
if (!isIdentifier(declaration.id)) continue;
|
|
47
|
+
if (CONTROLLER_NAME_PATTERN.test(valueText(declaration.id)) || hasHandlerType(declaration)) found.push(declaration.id);
|
|
48
|
+
}
|
|
49
|
+
return found;
|
|
50
|
+
}
|
|
51
|
+
function ordinal(position) {
|
|
52
|
+
if (position === 2) return "2nd";
|
|
53
|
+
if (position === 3) return "3rd";
|
|
54
|
+
return `${position}th`;
|
|
55
|
+
}
|
|
56
|
+
function checkOneControllerPerFile(sourceFile, findings) {
|
|
57
|
+
const controllers = topLevelDeclarations(sourceFile).flatMap((node) => controllerIdentifiers(node));
|
|
58
|
+
const first = controllers[0];
|
|
59
|
+
if (!first) return;
|
|
60
|
+
controllers.slice(1).forEach((identifier, index) => {
|
|
61
|
+
findings.push({
|
|
62
|
+
code: "WL9011",
|
|
63
|
+
severity: "warning",
|
|
64
|
+
node: identifier,
|
|
65
|
+
message: `\`${valueText(identifier)}\` is the ${ordinal(index + 2)} controller in this file (after \`${valueText(first)}\`). Move it to its own \`*.controller.ts\` file.`
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/** A string/number literal type, or a union made only of them. */
|
|
70
|
+
function isLiteralType(node) {
|
|
71
|
+
if (!node) return false;
|
|
72
|
+
if (isLiteralTypeNode(node)) return true;
|
|
73
|
+
return isUnionTypeNode(node) && node.types.every((member) => isLiteralTypeNode(member));
|
|
74
|
+
}
|
|
75
|
+
function checkKindDiscriminator(node, findings) {
|
|
76
|
+
if (!isPropertySignature(node) || isComputedPropertyName(nameNode(node))) return;
|
|
77
|
+
if (keyName(nameNode(node)) !== "kind" || !isLiteralType(node.typeAnnotation?.typeAnnotation)) return;
|
|
78
|
+
findings.push({
|
|
79
|
+
code: "WL9012",
|
|
80
|
+
severity: "warning",
|
|
81
|
+
node: nameNode(node),
|
|
82
|
+
message: "Name this discriminator `type`, not `kind` (the framework's convention for tagged unions)."
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The code-style conventions in one parsed file, all reported as warnings:
|
|
87
|
+
*
|
|
88
|
+
* - `WL9010` `await` on a synchronous `log.*()` call;
|
|
89
|
+
* - `WL9011` a second (third, …) controller in one file;
|
|
90
|
+
* - `WL9012` a tagged union whose discriminator is `kind` instead of `type`.
|
|
91
|
+
*/
|
|
92
|
+
function codeStyleFindings(sourceFile) {
|
|
93
|
+
const findings = [];
|
|
94
|
+
checkOneControllerPerFile(sourceFile, findings);
|
|
95
|
+
const visit = (node) => {
|
|
96
|
+
checkAwaitLog(node, findings);
|
|
97
|
+
checkKindDiscriminator(node, findings);
|
|
98
|
+
forEachChild(node, visit);
|
|
99
|
+
};
|
|
100
|
+
visit(sourceFile);
|
|
101
|
+
return findings;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
export { codeStyleFindings };
|
|
106
|
+
//# sourceMappingURL=code-style-conventions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-style-conventions.mjs","names":["ast.isAwaitExpression","ast.expressionOf","ast.isCallExpression","ast.isIdentifier","ast.valueText","ast.isFunctionDeclaration","ast.isClassDeclaration","ast.isVariableStatement","ast\n .topLevelDeclarations","ast.isLiteralTypeNode","ast.isUnionTypeNode","ast.isPropertySignature","ast.isComputedPropertyName","ast.nameNode"],"sources":["../../../../../../../../../packages/core/src/tooling/check/code-style-conventions.ts"],"sourcesContent":["import * as ast from \"../syntax/ast\";\nimport { isMemberAccess, keyName, memberName, type SourceFinding, unwrap } from \"./source-ast\";\n\n// ── WL9010: await on a synchronous log call ─────────────────────────────────\n\nconst AWAITED_LOGGER_NAMES: ReadonlySet<string> = new Set([\"log\", \"logger\"]);\n\n/** Logger methods that return the logger synchronously since 5.30. */\nconst SYNC_LOG_METHODS: ReadonlySet<string> = new Set([\n \"info\",\n \"warn\",\n \"error\",\n \"debug\",\n \"success\",\n \"fatal\",\n \"log\",\n \"assert\",\n]);\n\nfunction checkAwaitLog(node: ast.Node, findings: SourceFinding[]): void {\n if (!ast.isAwaitExpression(node)) return;\n\n const argument = unwrap(ast.expressionOf(node));\n\n if (!ast.isCallExpression(argument)) return;\n\n const callee = unwrap(ast.expressionOf(argument));\n\n if (!isMemberAccess(callee)) return;\n\n const owner = unwrap(ast.expressionOf(callee));\n\n if (!ast.isIdentifier(owner) || !AWAITED_LOGGER_NAMES.has(ast.valueText(owner))) return;\n\n const method = memberName(callee);\n\n if (!method || !SYNC_LOG_METHODS.has(method)) return;\n\n findings.push({\n code: \"WL9010\",\n severity: \"warning\",\n node,\n message: `\\`${ast.valueText(owner)}.${method}()\\` returns the logger synchronously; \\`await\\` does nothing here. Remove it (use \\`await log.flush()\\` to wait for delivery).`,\n });\n}\n\n// ── WL9011: more than one controller in a file ──────────────────────────────\n\n/** Handler type annotations that mark a constant as a controller. */\nconst HANDLER_TYPE_PATTERN = /RequestHandler$/;\n\nconst CONTROLLER_NAME_PATTERN = /Controller$/;\n\nfunction hasHandlerType(declaration: ast.VariableDeclarator): boolean {\n const type = declaration.id.typeAnnotation?.typeAnnotation;\n return (\n type?.type === \"TSTypeReference\" &&\n type.typeName.type === \"Identifier\" &&\n HANDLER_TYPE_PATTERN.test(type.typeName.name)\n );\n}\n\nfunction controllerIdentifiers(statement: ast.Node): ast.Identifier[] {\n if (ast.isFunctionDeclaration(statement) || ast.isClassDeclaration(statement)) {\n return statement.id && CONTROLLER_NAME_PATTERN.test(statement.id.name) ? [statement.id] : [];\n }\n\n if (!ast.isVariableStatement(statement)) return [];\n\n const found: ast.Identifier[] = [];\n\n for (const declaration of statement.declarations) {\n if (!ast.isIdentifier(declaration.id)) continue;\n\n if (\n CONTROLLER_NAME_PATTERN.test(ast.valueText(declaration.id)) ||\n hasHandlerType(declaration)\n ) {\n found.push(declaration.id);\n }\n }\n\n return found;\n}\n\nfunction ordinal(position: number): string {\n if (position === 2) return \"2nd\";\n if (position === 3) return \"3rd\";\n\n return `${position}th`;\n}\n\nfunction checkOneControllerPerFile(sourceFile: ast.SourceFile, findings: SourceFinding[]): void {\n const controllers = ast\n .topLevelDeclarations(sourceFile)\n .flatMap((node) => controllerIdentifiers(node));\n const first = controllers[0];\n\n if (!first) return;\n\n controllers.slice(1).forEach((identifier, index) => {\n findings.push({\n code: \"WL9011\",\n severity: \"warning\",\n node: identifier,\n message: `\\`${ast.valueText(identifier)}\\` is the ${ordinal(index + 2)} controller in this file (after \\`${ast.valueText(first)}\\`). Move it to its own \\`*.controller.ts\\` file.`,\n });\n });\n}\n\n// ── WL9012: a union discriminator named `kind` ──────────────────────────────\n\n/** A string/number literal type, or a union made only of them. */\nfunction isLiteralType(node: ast.Node | undefined): boolean {\n if (!node) return false;\n if (ast.isLiteralTypeNode(node)) return true;\n\n return ast.isUnionTypeNode(node) && node.types.every((member) => ast.isLiteralTypeNode(member));\n}\n\nfunction checkKindDiscriminator(node: ast.Node, findings: SourceFinding[]): void {\n if (!ast.isPropertySignature(node) || ast.isComputedPropertyName(ast.nameNode(node))) return;\n if (keyName(ast.nameNode(node)) !== \"kind\" || !isLiteralType(node.typeAnnotation?.typeAnnotation))\n return;\n\n findings.push({\n code: \"WL9012\",\n severity: \"warning\",\n node: ast.nameNode(node),\n message:\n \"Name this discriminator `type`, not `kind` (the framework's convention for tagged unions).\",\n });\n}\n\n/**\n * The code-style conventions in one parsed file, all reported as warnings:\n *\n * - `WL9010` `await` on a synchronous `log.*()` call;\n * - `WL9011` a second (third, …) controller in one file;\n * - `WL9012` a tagged union whose discriminator is `kind` instead of `type`.\n */\nexport function codeStyleFindings(sourceFile: ast.SourceFile): SourceFinding[] {\n const findings: SourceFinding[] = [];\n\n checkOneControllerPerFile(sourceFile, findings);\n\n // Every node, type nodes included: discriminators live in type literals and interfaces.\n const visit = (node: ast.Node): void => {\n checkAwaitLog(node, findings);\n checkKindDiscriminator(node, findings);\n ast.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return findings;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ToolingProblem } from "../problem.mjs";
|
|
2
|
+
//#region ../../packages/core/src/tooling/check/conventions-step.d.ts
|
|
3
|
+
/** Matches a project-relative path of a file the framework loads by itself. */
|
|
4
|
+
export declare function isAutoLoadedFile(relativePath: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* The convention problems in one source file, in source order:
|
|
7
|
+
*
|
|
8
|
+
* - `WL9001` an import of a file the framework loads by itself (`routes.ts`,
|
|
9
|
+
* `main.ts`, `worker.ts`, `events/*`) — importing it registers it twice;
|
|
10
|
+
* - `WL9002` a relative import ending in `.js`;
|
|
11
|
+
* - `WL9003` a relative import from one `src/app/<module>` into another, which
|
|
12
|
+
* should use the `app/<module>/...` alias;
|
|
13
|
+
* - `WL9005`–`WL9009` the security conventions (see `securityFindings`):
|
|
14
|
+
* `request.all()` into a query or service, a mutating route with no guard
|
|
15
|
+
* and no `public: true`, a redirect target from request input, sensitive
|
|
16
|
+
* values in logs, unbounded regexes on request input;
|
|
17
|
+
* - `WL9010`–`WL9012` warnings: `await log.*()`, a second controller in one
|
|
18
|
+
* file, a `kind` discriminator.
|
|
19
|
+
*
|
|
20
|
+
* A `// warlock-check-ignore WL9006` comment on the problem's line or the line
|
|
21
|
+
* above silences that code there; without codes it silences every one.
|
|
22
|
+
*/
|
|
23
|
+
export declare function checkFileConventions(relativePath: string, source: string, cwd: string): ToolingProblem[];
|
|
24
|
+
/** `WL9004` when the project tsconfig turns on legacy decorators. */
|
|
25
|
+
export declare function checkTsconfigConventions(cwd: string, project?: string): ToolingProblem[];
|
|
26
|
+
/**
|
|
27
|
+
* Run every convention check over `files` (project-relative) plus the
|
|
28
|
+
* project tsconfig.
|
|
29
|
+
*/
|
|
30
|
+
export declare function runConventions(cwd: string, files: readonly string[], project?: string): ToolingProblem[];
|
|
31
|
+
//#endregion
|
|
32
|
+
//# sourceMappingURL=conventions-step.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conventions-step.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/conventions-step.ts"],"mappings":";;;wBAiBgB,iBAAiB;;;;;;;;;;;;;;;;;;;wBAiKjB,qBACd,sBACA,gBACA,cACC;;wBAmBa,yBAAyB,aAAa,mBAA4B;;;;;wBAyClE,eACd,aACA,0BACA,mBACC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { parseSourceFile } from "../syntax/ast.mjs";
|
|
2
|
+
import { importSpecifiers } from "../syntax/imports.mjs";
|
|
3
|
+
import { createProblem } from "../problem.mjs";
|
|
4
|
+
import { positionOf } from "./source-ast.mjs";
|
|
5
|
+
import { codeStyleFindings } from "./code-style-conventions.mjs";
|
|
6
|
+
import { securityFindings } from "./security-conventions.mjs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
9
|
+
import { parse } from "jsonc-parser";
|
|
10
|
+
|
|
11
|
+
//#region ../../packages/core/src/tooling/check/conventions-step.ts
|
|
12
|
+
/** Extensions tried when resolving an extension-less import. */
|
|
13
|
+
const RESOLVE_EXTENSIONS = [
|
|
14
|
+
".ts",
|
|
15
|
+
".tsx",
|
|
16
|
+
".js",
|
|
17
|
+
".jsx",
|
|
18
|
+
"/index.ts",
|
|
19
|
+
"/index.tsx"
|
|
20
|
+
];
|
|
21
|
+
/** Test files may import anything on purpose. */
|
|
22
|
+
const TEST_FILE = /\.(?:test|spec)\.[cm]?[jt]sx?$/i;
|
|
23
|
+
/** Matches a project-relative path of a file the framework loads by itself. */
|
|
24
|
+
function isAutoLoadedFile(relativePath) {
|
|
25
|
+
return /^src\/app\/main\.tsx?$/.test(relativePath) || /^src\/app\/[^/]+\/(?:routes|main|worker)\.tsx?$/.test(relativePath) || /^src\/app\/.+\/events\/[^/]+\.tsx?$/.test(relativePath);
|
|
26
|
+
}
|
|
27
|
+
/** The module folder (`src/app/<module>`) a project-relative path lives in, if any. */
|
|
28
|
+
function moduleOf(relativePath) {
|
|
29
|
+
return /^src\/app\/([^/]+)\//.exec(relativePath)?.[1];
|
|
30
|
+
}
|
|
31
|
+
function toPosix(file) {
|
|
32
|
+
return file.split(path.sep).join("/");
|
|
33
|
+
}
|
|
34
|
+
/** Resolve a relative or `app/...` specifier to a project-relative file, if it exists. */
|
|
35
|
+
function resolveSpecifier(specifier, importer, cwd) {
|
|
36
|
+
let base;
|
|
37
|
+
if (specifier.startsWith(".")) base = path.resolve(path.dirname(path.join(cwd, importer)), specifier);
|
|
38
|
+
else if (specifier.startsWith("app/")) base = path.join(cwd, "src", specifier);
|
|
39
|
+
else return;
|
|
40
|
+
const candidates = [base, ...RESOLVE_EXTENSIONS.map((extension) => `${base}${extension}`)];
|
|
41
|
+
const withoutJs = base.replace(/\.jsx?$/, "");
|
|
42
|
+
if (withoutJs !== base) candidates.push(...RESOLVE_EXTENSIONS.map((extension) => `${withoutJs}${extension}`));
|
|
43
|
+
const found = candidates.find((candidate) => existsSync(candidate) && path.extname(candidate) !== "");
|
|
44
|
+
return found ? toPosix(path.relative(cwd, found)) : void 0;
|
|
45
|
+
}
|
|
46
|
+
/** Every module specifier a source file imports, with its position. */
|
|
47
|
+
function importsOf(sourceFile) {
|
|
48
|
+
return importSpecifiers(sourceFile.fileName, sourceFile.text);
|
|
49
|
+
}
|
|
50
|
+
/** `// warlock-check-ignore [WLxxxx …]` on a problem's line or the line above it. */
|
|
51
|
+
const IGNORE_COMMENT = /\/[/*]\s*warlock-check-ignore\b(.*)/;
|
|
52
|
+
/** Whether an ignore comment on `line` (1-based) or the line before covers `code`. */
|
|
53
|
+
function isIgnored(lines, line, code) {
|
|
54
|
+
for (const text of [lines[line - 1], lines[line - 2]]) {
|
|
55
|
+
const match = text === void 0 ? null : IGNORE_COMMENT.exec(text);
|
|
56
|
+
if (!match) continue;
|
|
57
|
+
const codes = match[1]?.match(/WL\d{4}/g);
|
|
58
|
+
if (!codes || codes.includes(code)) return true;
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
/** The import conventions (`WL9001`–`WL9003`) of one parsed file. */
|
|
63
|
+
function importProblems(sourceFile, relativePath, cwd) {
|
|
64
|
+
const problems = [];
|
|
65
|
+
const importerModule = moduleOf(relativePath);
|
|
66
|
+
for (const { specifier, node } of importsOf(sourceFile)) {
|
|
67
|
+
const at = {
|
|
68
|
+
file: relativePath,
|
|
69
|
+
...positionOf(sourceFile, node)
|
|
70
|
+
};
|
|
71
|
+
if (specifier.startsWith(".") && /\.jsx?$/.test(specifier)) problems.push(createProblem({
|
|
72
|
+
code: "WL9002",
|
|
73
|
+
source: "convention",
|
|
74
|
+
message: `Import "${specifier}" ends in a .js extension.`,
|
|
75
|
+
...at
|
|
76
|
+
}));
|
|
77
|
+
const target = resolveSpecifier(specifier, relativePath, cwd);
|
|
78
|
+
if (!target) continue;
|
|
79
|
+
if (!TEST_FILE.test(relativePath) && isAutoLoadedFile(target)) problems.push(createProblem({
|
|
80
|
+
code: "WL9001",
|
|
81
|
+
source: "convention",
|
|
82
|
+
message: `"${specifier}" imports ${target}, which the framework loads by itself.`,
|
|
83
|
+
...at
|
|
84
|
+
}));
|
|
85
|
+
const targetModule = moduleOf(target);
|
|
86
|
+
if (specifier.startsWith(".") && importerModule !== void 0 && targetModule !== void 0 && importerModule !== targetModule) {
|
|
87
|
+
const alias = `app/${target.replace(/^src\/app\//, "").replace(/\.[cm]?[jt]sx?$/, "")}`;
|
|
88
|
+
problems.push(createProblem({
|
|
89
|
+
code: "WL9003",
|
|
90
|
+
source: "convention",
|
|
91
|
+
message: `"${specifier}" reaches from module "${importerModule}" into "${targetModule}"; import "${alias}" instead.`,
|
|
92
|
+
...at
|
|
93
|
+
}));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return problems;
|
|
97
|
+
}
|
|
98
|
+
function findingProblem(sourceFile, relativePath, finding) {
|
|
99
|
+
return createProblem({
|
|
100
|
+
code: finding.code,
|
|
101
|
+
source: "convention",
|
|
102
|
+
severity: finding.severity ?? "error",
|
|
103
|
+
message: finding.message,
|
|
104
|
+
file: relativePath,
|
|
105
|
+
...positionOf(sourceFile, finding.node)
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The convention problems in one source file, in source order:
|
|
110
|
+
*
|
|
111
|
+
* - `WL9001` an import of a file the framework loads by itself (`routes.ts`,
|
|
112
|
+
* `main.ts`, `worker.ts`, `events/*`) — importing it registers it twice;
|
|
113
|
+
* - `WL9002` a relative import ending in `.js`;
|
|
114
|
+
* - `WL9003` a relative import from one `src/app/<module>` into another, which
|
|
115
|
+
* should use the `app/<module>/...` alias;
|
|
116
|
+
* - `WL9005`–`WL9009` the security conventions (see `securityFindings`):
|
|
117
|
+
* `request.all()` into a query or service, a mutating route with no guard
|
|
118
|
+
* and no `public: true`, a redirect target from request input, sensitive
|
|
119
|
+
* values in logs, unbounded regexes on request input;
|
|
120
|
+
* - `WL9010`–`WL9012` warnings: `await log.*()`, a second controller in one
|
|
121
|
+
* file, a `kind` discriminator.
|
|
122
|
+
*
|
|
123
|
+
* A `// warlock-check-ignore WL9006` comment on the problem's line or the line
|
|
124
|
+
* above silences that code there; without codes it silences every one.
|
|
125
|
+
*/
|
|
126
|
+
function checkFileConventions(relativePath, source, cwd) {
|
|
127
|
+
const sourceFile = parseSourceFile(relativePath, source);
|
|
128
|
+
const problems = [...importProblems(sourceFile, relativePath, cwd), ...[...securityFindings(sourceFile), ...codeStyleFindings(sourceFile)].map((finding) => findingProblem(sourceFile, relativePath, finding))];
|
|
129
|
+
const lines = source.split(/\r?\n/);
|
|
130
|
+
return problems.filter((problem) => problem.line === null || !isIgnored(lines, problem.line, problem.code)).sort((first, second) => (first.line ?? 0) - (second.line ?? 0) || (first.column ?? 0) - (second.column ?? 0));
|
|
131
|
+
}
|
|
132
|
+
/** `WL9004` when the project tsconfig turns on legacy decorators. */
|
|
133
|
+
function checkTsconfigConventions(cwd, project = "tsconfig.json") {
|
|
134
|
+
const file = path.join(cwd, project);
|
|
135
|
+
if (!existsSync(file)) return [];
|
|
136
|
+
const text = readFileSync(file, "utf8");
|
|
137
|
+
const config = parse(text);
|
|
138
|
+
const options = typeof config === "object" && config !== null ? Reflect.get(config, "compilerOptions") : void 0;
|
|
139
|
+
if (typeof options !== "object" || options === null || Reflect.get(options, "experimentalDecorators") !== true) return [];
|
|
140
|
+
const index = text.indexOf("experimentalDecorators");
|
|
141
|
+
const before = index === -1 ? "" : text.slice(0, index);
|
|
142
|
+
const line = index === -1 ? null : before.split("\n").length;
|
|
143
|
+
const column = index === -1 ? null : index - before.lastIndexOf("\n");
|
|
144
|
+
return [createProblem({
|
|
145
|
+
code: "WL9004",
|
|
146
|
+
source: "convention",
|
|
147
|
+
message: "\"experimentalDecorators\": true switches TypeScript to legacy decorators.",
|
|
148
|
+
file: toPosix(project),
|
|
149
|
+
line,
|
|
150
|
+
column
|
|
151
|
+
})];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Run every convention check over `files` (project-relative) plus the
|
|
155
|
+
* project tsconfig.
|
|
156
|
+
*/
|
|
157
|
+
function runConventions(cwd, files, project) {
|
|
158
|
+
const problems = checkTsconfigConventions(cwd, project);
|
|
159
|
+
for (const file of files) {
|
|
160
|
+
let source;
|
|
161
|
+
try {
|
|
162
|
+
source = readFileSync(path.join(cwd, file), "utf8");
|
|
163
|
+
} catch {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
problems.push(...checkFileConventions(file, source, cwd));
|
|
167
|
+
}
|
|
168
|
+
return problems;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
//#endregion
|
|
172
|
+
export { checkFileConventions, checkTsconfigConventions, isAutoLoadedFile, runConventions };
|
|
173
|
+
//# sourceMappingURL=conventions-step.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conventions-step.mjs","names":["ast.parseSourceFile"],"sources":["../../../../../../../../../packages/core/src/tooling/check/conventions-step.ts"],"sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { parse } from \"jsonc-parser\";\nimport { importSpecifiers } from \"../syntax/imports\";\nimport * as ast from \"../syntax/ast\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\nimport { codeStyleFindings } from \"./code-style-conventions\";\nimport { securityFindings } from \"./security-conventions\";\nimport { positionOf, type SourceFinding } from \"./source-ast\";\n\n/** Extensions tried when resolving an extension-less import. */\nconst RESOLVE_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".jsx\", \"/index.ts\", \"/index.tsx\"];\n\n/** Test files may import anything on purpose. */\nconst TEST_FILE = /\\.(?:test|spec)\\.[cm]?[jt]sx?$/i;\n\n/** Matches a project-relative path of a file the framework loads by itself. */\nexport function isAutoLoadedFile(relativePath: string): boolean {\n return (\n /^src\\/app\\/main\\.tsx?$/.test(relativePath) ||\n /^src\\/app\\/[^/]+\\/(?:routes|main|worker)\\.tsx?$/.test(relativePath) ||\n /^src\\/app\\/.+\\/events\\/[^/]+\\.tsx?$/.test(relativePath)\n );\n}\n\n/** The module folder (`src/app/<module>`) a project-relative path lives in, if any. */\nfunction moduleOf(relativePath: string): string | undefined {\n return /^src\\/app\\/([^/]+)\\//.exec(relativePath)?.[1];\n}\n\nfunction toPosix(file: string): string {\n return file.split(path.sep).join(\"/\");\n}\n\n/** Resolve a relative or `app/...` specifier to a project-relative file, if it exists. */\nfunction resolveSpecifier(specifier: string, importer: string, cwd: string): string | undefined {\n let base: string;\n\n if (specifier.startsWith(\".\")) {\n base = path.resolve(path.dirname(path.join(cwd, importer)), specifier);\n } else if (specifier.startsWith(\"app/\")) {\n base = path.join(cwd, \"src\", specifier);\n } else {\n return undefined;\n }\n\n const candidates = [base, ...RESOLVE_EXTENSIONS.map((extension) => `${base}${extension}`)];\n const withoutJs = base.replace(/\\.jsx?$/, \"\");\n\n if (withoutJs !== base) {\n candidates.push(...RESOLVE_EXTENSIONS.map((extension) => `${withoutJs}${extension}`));\n }\n\n const found = candidates.find(\n (candidate) => existsSync(candidate) && path.extname(candidate) !== \"\",\n );\n\n return found ? toPosix(path.relative(cwd, found)) : undefined;\n}\n\n/** Every module specifier a source file imports, with its position. */\nfunction importsOf(sourceFile: ast.SourceFile): { specifier: string; node: ast.Node }[] {\n return importSpecifiers(sourceFile.fileName, sourceFile.text);\n}\n\n/** `// warlock-check-ignore [WLxxxx …]` on a problem's line or the line above it. */\nconst IGNORE_COMMENT = /\\/[/*]\\s*warlock-check-ignore\\b(.*)/;\n\n/** Whether an ignore comment on `line` (1-based) or the line before covers `code`. */\nfunction isIgnored(lines: readonly string[], line: number, code: string): boolean {\n for (const text of [lines[line - 1], lines[line - 2]]) {\n const match = text === undefined ? null : IGNORE_COMMENT.exec(text);\n\n if (!match) continue;\n\n const codes = match[1]?.match(/WL\\d{4}/g);\n\n if (!codes || codes.includes(code)) return true;\n }\n\n return false;\n}\n\n/** The import conventions (`WL9001`–`WL9003`) of one parsed file. */\nfunction importProblems(\n sourceFile: ast.SourceFile,\n relativePath: string,\n cwd: string,\n): ToolingProblem[] {\n const problems: ToolingProblem[] = [];\n const importerModule = moduleOf(relativePath);\n\n for (const { specifier, node } of importsOf(sourceFile)) {\n const at = { file: relativePath, ...positionOf(sourceFile, node) };\n\n if (specifier.startsWith(\".\") && /\\.jsx?$/.test(specifier)) {\n problems.push(\n createProblem({\n code: \"WL9002\",\n source: \"convention\",\n message: `Import \"${specifier}\" ends in a .js extension.`,\n ...at,\n }),\n );\n }\n\n const target = resolveSpecifier(specifier, relativePath, cwd);\n\n if (!target) continue;\n\n if (!TEST_FILE.test(relativePath) && isAutoLoadedFile(target)) {\n problems.push(\n createProblem({\n code: \"WL9001\",\n source: \"convention\",\n message: `\"${specifier}\" imports ${target}, which the framework loads by itself.`,\n ...at,\n }),\n );\n }\n\n const targetModule = moduleOf(target);\n\n if (\n specifier.startsWith(\".\") &&\n importerModule !== undefined &&\n targetModule !== undefined &&\n importerModule !== targetModule\n ) {\n const alias = `app/${target.replace(/^src\\/app\\//, \"\").replace(/\\.[cm]?[jt]sx?$/, \"\")}`;\n\n problems.push(\n createProblem({\n code: \"WL9003\",\n source: \"convention\",\n message: `\"${specifier}\" reaches from module \"${importerModule}\" into \"${targetModule}\"; import \"${alias}\" instead.`,\n ...at,\n }),\n );\n }\n }\n\n return problems;\n}\n\nfunction findingProblem(\n sourceFile: ast.SourceFile,\n relativePath: string,\n finding: SourceFinding,\n): ToolingProblem {\n return createProblem({\n code: finding.code,\n source: \"convention\",\n severity: finding.severity ?? \"error\",\n message: finding.message,\n file: relativePath,\n ...positionOf(sourceFile, finding.node),\n });\n}\n\n/**\n * The convention problems in one source file, in source order:\n *\n * - `WL9001` an import of a file the framework loads by itself (`routes.ts`,\n * `main.ts`, `worker.ts`, `events/*`) — importing it registers it twice;\n * - `WL9002` a relative import ending in `.js`;\n * - `WL9003` a relative import from one `src/app/<module>` into another, which\n * should use the `app/<module>/...` alias;\n * - `WL9005`–`WL9009` the security conventions (see `securityFindings`):\n * `request.all()` into a query or service, a mutating route with no guard\n * and no `public: true`, a redirect target from request input, sensitive\n * values in logs, unbounded regexes on request input;\n * - `WL9010`–`WL9012` warnings: `await log.*()`, a second controller in one\n * file, a `kind` discriminator.\n *\n * A `// warlock-check-ignore WL9006` comment on the problem's line or the line\n * above silences that code there; without codes it silences every one.\n */\nexport function checkFileConventions(\n relativePath: string,\n source: string,\n cwd: string,\n): ToolingProblem[] {\n const sourceFile = ast.parseSourceFile(relativePath, source);\n const problems = [\n ...importProblems(sourceFile, relativePath, cwd),\n ...[...securityFindings(sourceFile), ...codeStyleFindings(sourceFile)].map((finding) =>\n findingProblem(sourceFile, relativePath, finding),\n ),\n ];\n const lines = source.split(/\\r?\\n/);\n\n return problems\n .filter((problem) => problem.line === null || !isIgnored(lines, problem.line, problem.code))\n .sort(\n (first, second) =>\n (first.line ?? 0) - (second.line ?? 0) || (first.column ?? 0) - (second.column ?? 0),\n );\n}\n\n/** `WL9004` when the project tsconfig turns on legacy decorators. */\nexport function checkTsconfigConventions(cwd: string, project = \"tsconfig.json\"): ToolingProblem[] {\n const file = path.join(cwd, project);\n\n if (!existsSync(file)) return [];\n\n const text = readFileSync(file, \"utf8\");\n const config: unknown = parse(text);\n const options: unknown =\n typeof config === \"object\" && config !== null\n ? Reflect.get(config, \"compilerOptions\")\n : undefined;\n\n if (\n typeof options !== \"object\" ||\n options === null ||\n Reflect.get(options, \"experimentalDecorators\") !== true\n ) {\n return [];\n }\n\n const index = text.indexOf(\"experimentalDecorators\");\n const before = index === -1 ? \"\" : text.slice(0, index);\n const line = index === -1 ? null : before.split(\"\\n\").length;\n const column = index === -1 ? null : index - before.lastIndexOf(\"\\n\");\n\n return [\n createProblem({\n code: \"WL9004\",\n source: \"convention\",\n message: '\"experimentalDecorators\": true switches TypeScript to legacy decorators.',\n file: toPosix(project),\n line,\n column,\n }),\n ];\n}\n\n/**\n * Run every convention check over `files` (project-relative) plus the\n * project tsconfig.\n */\nexport function runConventions(\n cwd: string,\n files: readonly string[],\n project?: string,\n): ToolingProblem[] {\n const problems = checkTsconfigConventions(cwd, project);\n\n for (const file of files) {\n let source: string;\n\n try {\n source = readFileSync(path.join(cwd, file), \"utf8\");\n } catch {\n continue;\n }\n\n problems.push(...checkFileConventions(file, source, cwd));\n }\n\n return problems;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ToolingProblem } from "../problem.mjs";
|
|
2
|
+
//#region ../../packages/core/src/tooling/check/environment-step.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The oldest Node.js release core supports — `engines.node` in core's
|
|
5
|
+
* package.json (`>=22.15`). `bin/warlock.js` refuses older versions before
|
|
6
|
+
* the CLI loads; this check covers programmatic `runCheck()` calls too.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MIN_NODE_VERSION = "22.15.0";
|
|
9
|
+
/**
|
|
10
|
+
* Check the running Node.js against core's minimum and the app's own
|
|
11
|
+
* `engines.node` (when it is a plain `>=` range). A mismatch is a `WL8001`
|
|
12
|
+
* environment problem.
|
|
13
|
+
*/
|
|
14
|
+
export declare function checkNodeVersion(cwd: string, running?: string): ToolingProblem[];
|
|
15
|
+
//#endregion
|
|
16
|
+
//# sourceMappingURL=environment-step.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-step.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/environment-step.ts"],"mappings":";;;;;;;qBASa;;;;;;wBAoDG,iBAAiB,aAAa,mBAAkC"}
|