@warlock.js/core 5.31.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 +23 -0
- 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/agents-md/agents-md-command.action.mjs +3 -2
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
- package/esm/cli/commands/board/board-command.action.mjs +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs +1 -1
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
- package/esm/cli/commands/check/format-problems.mjs +1 -1
- package/esm/cli/commands/dev-server.command.mjs +3 -2
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +29 -16
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +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 +5 -3
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
- 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 +2 -2
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
- 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 +15 -14
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs +1 -1
- package/esm/cli/commands/postman-generator.action.mjs +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 +2 -2
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/test.command.mjs +1 -1
- package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/framework-cli-commands.mjs +2 -0
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +2 -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 +3 -3
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +19 -16
- package/esm/config/config-schema.d.mts.map +1 -1
- 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 +2 -1
- package/esm/config/index.mjs +1 -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-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 +2 -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 +8 -7
- 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/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/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -3
- 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 +2 -3
- package/esm/database/seeds/seeder.errors.d.mts.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/create-worker.mjs +5 -3
- 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/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-watcher.mjs +12 -11
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- 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/file-health-checker.contract.d.mts +5 -5
- 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 +1 -0
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
- 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 -1
- 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/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +3 -2
- 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 +2 -1
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +2 -1
- 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 +2 -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 +6 -38
- 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/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/supervisor.mjs +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 +28 -35
- 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/error-codes.d.mts +29 -22
- package/esm/errors/error-codes.d.mts.map +1 -1
- package/esm/errors/warlock-error.d.mts +1 -3
- package/esm/errors/warlock-error.d.mts.map +1 -1
- package/esm/generations/add-command.action.mjs +3 -2
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +2 -1
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +2 -1
- package/esm/generations/features/notifications.feature.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 +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
- package/esm/generations/features/sitemap.feature.mjs +2 -1
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +1 -1
- package/esm/generations/generation-run.mjs +1 -1
- package/esm/generations/stubs.mjs +1 -1
- 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 +4 -4
- package/esm/http/bounded-stream-queue.d.mts.map +1 -1
- package/esm/http/bounded-stream-queue.mjs +1 -1
- package/esm/http/bounded-stream-queue.mjs.map +1 -1
- 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 +2 -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 +14 -13
- package/esm/http/conditional-request.d.mts.map +1 -1
- 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 +10 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +2 -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 +2 -3
- 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 +28 -29
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/escape-header-value.d.mts +1 -2
- package/esm/http/escape-header-value.d.mts.map +1 -1
- package/esm/http/events.d.mts +2 -4
- package/esm/http/events.d.mts.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 +4 -1
- package/esm/http/index.mjs +1 -1
- 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 +10 -10
- 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 +4 -3
- 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 +20 -16
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +3 -3
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +8 -7
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +8 -7
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +12 -11
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +7 -7
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +3 -4
- package/esm/http/safe-redirect.d.mts.map +1 -1
- 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 +9 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +4 -4
- 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/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 +49 -43
- 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-variants.d.mts +6 -6
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
- package/esm/http/uploads/image-variant-cache.mjs +8 -8
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +7 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +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 +2 -4
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
- 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/trim-image-variant-cache.mjs +3 -3
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +1 -1
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +19 -17
- 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 +21 -0
- 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 +4 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +1 -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 +12 -14
- package/esm/mail/config.d.mts.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 +2 -1
- package/esm/mail/index.mjs +1 -1
- 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/openapi/build-openapi-document.d.mts +2 -4
- package/esm/openapi/build-openapi-document.d.mts.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/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-url.mjs +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/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/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/uuid-v5.mjs +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -1
- package/esm/openapi/security.mjs +1 -1
- package/esm/openapi/types.d.mts +23 -21
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +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 +2 -1
- 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 +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/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 +12 -32
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/router/index.d.mts +2 -1
- package/esm/router/index.mjs +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/resolve-route-rate-limit.mjs +3 -3
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
- 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 +1 -1
- package/esm/router/route-guard-names.mjs.map +1 -1
- 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 +1 -3
- package/esm/router/route-name-taken-error.d.mts.map +1 -1
- 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 +2 -4
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +8 -6
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +25 -26
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
- 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 +2 -2
- package/esm/storage/local-disk-roots.mjs.map +1 -1
- 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 +3 -4
- package/esm/storage/storage.d.mts.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 +1 -2
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +5 -6
- package/esm/tests/authenticated-test-client.d.mts.map +1 -1
- package/esm/tests/factories.d.mts +38 -23
- package/esm/tests/factories.d.mts.map +1 -1
- package/esm/tests/fakes/cache-fake.d.mts +14 -9
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
- package/esm/tests/fakes/clock-fake.d.mts +13 -8
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
- package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
- package/esm/tests/fakes/ids-fake.d.mts +5 -4
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
- package/esm/tests/fakes/index.d.mts +2 -1
- package/esm/tests/fakes/index.mjs +1 -1
- package/esm/tests/fakes/mail-fake.d.mts +21 -13
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
- package/esm/tests/fakes/queue-fake.d.mts +21 -13
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.d.mts +12 -8
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
- package/esm/tests/fakes/storage-fake.mjs +1 -1
- package/esm/tests/fakes/test-fakes.d.mts +8 -9
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
- package/esm/tests/fakes/test-fakes.mjs +1 -1
- package/esm/tests/fakes/test-fakes.mjs.map +1 -1
- package/esm/tests/index.d.mts +1 -0
- package/esm/tests/snapshot-response.d.mts +4 -5
- package/esm/tests/snapshot-response.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.d.mts +4 -6
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +5 -5
- 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 +11 -12
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-http-server.d.mts +14 -10
- package/esm/tests/test-http-server.d.mts.map +1 -1
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +6 -7
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
- package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
- package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
- package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
- package/esm/tooling/board/board-message.d.mts +4 -6
- package/esm/tooling/board/board-message.d.mts.map +1 -1
- package/esm/tooling/board/board.d.mts +50 -38
- package/esm/tooling/board/board.d.mts.map +1 -1
- package/esm/tooling/board/board.mjs +4 -3
- package/esm/tooling/board/board.mjs.map +1 -1
- package/esm/tooling/board/board.types.d.mts +32 -23
- package/esm/tooling/board/board.types.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.d.mts +4 -6
- package/esm/tooling/check/changed-files.d.mts.map +1 -1
- package/esm/tooling/check/changed-files.mjs +2 -2
- package/esm/tooling/check/changed-files.mjs.map +1 -1
- package/esm/tooling/check/check-report.types.d.mts +22 -17
- package/esm/tooling/check/check-report.types.d.mts.map +1 -1
- package/esm/tooling/check/code-style-conventions.mjs +25 -25
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
- package/esm/tooling/check/conventions-step.d.mts +4 -6
- package/esm/tooling/check/conventions-step.d.mts.map +1 -1
- package/esm/tooling/check/conventions-step.mjs +7 -18
- package/esm/tooling/check/conventions-step.mjs.map +1 -1
- package/esm/tooling/check/environment-step.d.mts +2 -4
- package/esm/tooling/check/environment-step.d.mts.map +1 -1
- package/esm/tooling/check/environment-step.mjs +1 -1
- package/esm/tooling/check/index.mjs +1 -1
- package/esm/tooling/check/lint-step.d.mts +4 -5
- package/esm/tooling/check/lint-step.d.mts.map +1 -1
- package/esm/tooling/check/lint-step.mjs +2 -1
- package/esm/tooling/check/lint-step.mjs.map +1 -1
- package/esm/tooling/check/request-input.mjs +15 -15
- package/esm/tooling/check/request-input.mjs.map +1 -1
- package/esm/tooling/check/run-check.d.mts +22 -14
- package/esm/tooling/check/run-check.d.mts.map +1 -1
- package/esm/tooling/check/run-tests.d.mts +22 -15
- package/esm/tooling/check/run-tests.d.mts.map +1 -1
- package/esm/tooling/check/security-conventions.mjs +133 -131
- package/esm/tooling/check/security-conventions.mjs.map +1 -1
- package/esm/tooling/check/source-ast.mjs +92 -132
- package/esm/tooling/check/source-ast.mjs.map +1 -1
- package/esm/tooling/check/tests-step.d.mts +7 -8
- package/esm/tooling/check/tests-step.d.mts.map +1 -1
- package/esm/tooling/check/tests-step.mjs +3 -3
- package/esm/tooling/check/tests-step.mjs.map +1 -1
- package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
- package/esm/tooling/devtools/devtools-client.d.mts +29 -20
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
- package/esm/tooling/generate/generation.d.mts +34 -22
- package/esm/tooling/generate/generation.d.mts.map +1 -1
- package/esm/tooling/generate/generation.mjs +9 -5
- package/esm/tooling/generate/generation.mjs.map +1 -1
- package/esm/tooling/generate/generator-spec.d.mts +9 -9
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
- package/esm/tooling/generate/index.mjs +1 -1
- package/esm/tooling/generate/project-files.mjs +3 -3
- package/esm/tooling/generate/project-files.mjs.map +1 -1
- package/esm/tooling/generate/run-cli.d.mts +14 -11
- package/esm/tooling/generate/run-cli.d.mts.map +1 -1
- package/esm/tooling/generate/run-cli.mjs +2 -2
- package/esm/tooling/generate/run-cli.mjs.map +1 -1
- package/esm/tooling/generate/unified-diff.d.mts +10 -7
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
- package/esm/tooling/index.d.mts +1 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-config.mjs +3 -3
- package/esm/tooling/inspect/collect-config.mjs.map +1 -1
- package/esm/tooling/inspect/collect-models.d.mts +4 -3
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-models.mjs +1 -1
- package/esm/tooling/inspect/collect-packages.d.mts +1 -2
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
- package/esm/tooling/inspect/collect-pages.mjs +10 -10
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
- package/esm/tooling/inspect/collect-routes.mjs +1 -1
- package/esm/tooling/inspect/event-recorder.d.mts +7 -7
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
- package/esm/tooling/inspect/index.d.mts +2 -1
- package/esm/tooling/inspect/index.mjs +1 -1
- package/esm/tooling/inspect/inspect-app.d.mts +25 -16
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
- package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
- package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
- package/esm/tooling/mcp/db-schema.d.mts +10 -9
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
- package/esm/tooling/mcp/docs-search.d.mts +20 -15
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
- package/esm/tooling/mcp/index.mjs +1 -1
- package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
- package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
- package/esm/tooling/mcp/mcp-tools.mjs +3 -2
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
- package/esm/tooling/mcp/tool-input.d.mts +7 -7
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
- package/esm/tooling/problem.d.mts +27 -17
- package/esm/tooling/problem.d.mts.map +1 -1
- 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 +36 -22
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.d.mts +27 -20
- package/esm/tooling/trace/trace-request.d.mts.map +1 -1
- package/esm/tooling/trace/trace-request.mjs +2 -2
- package/esm/tooling/trace/trace-request.mjs.map +1 -1
- package/esm/tooling/typecheck/index.mjs +1 -1
- package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
- package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
- 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/index.mjs +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
- package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
- package/esm/upgrade/diff.mjs +1 -1
- package/esm/upgrade/diff.mjs.map +1 -1
- package/esm/upgrade/load-ts-morph.mjs +3 -2
- package/esm/upgrade/load-ts-morph.mjs.map +1 -1
- package/esm/upgrade/run-upgrade.mjs +1 -1
- 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/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +8 -6
- package/esm/utils/clock.d.mts.map +1 -1
- 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.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 +9 -6
- package/esm/utils/ids.d.mts.map +1 -1
- package/esm/utils/index.d.mts +2 -1
- package/esm/utils/index.mjs +1 -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 +11 -10
- package/esm/utils/runtime.d.mts.map +1 -1
- 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 +5 -1
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +6 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +2 -2
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +2 -2
- package/esm/validation/validation-failure-status.mjs.map +1 -1
- package/esm/validation/validators/file-validator.d.mts +2 -4
- 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/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 +6 -5
- 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 +55 -5
- package/package.json +17 -15
- package/skills/create-module/SKILL.md +7 -0
- package/skills/index.md +2 -0
- package/skills/report-framework-issue.md +154 -0
- package/skills/run-app/SKILL.md +6 -5
- package/skills/upgrade-from-5-29/SKILL.md +41 -0
- package/skills/warlock-check/SKILL.md +1 -0
- package/esm/tooling/check/index.d.mts +0 -8
- package/esm/tooling/typecheck/index.d.mts +0 -1
|
@@ -63,7 +63,7 @@ function resolveTestFakes(explicit) {
|
|
|
63
63
|
async function installTestFakes(explicit) {
|
|
64
64
|
const selected = resolveTestFakes(explicit);
|
|
65
65
|
for (const name of selected) await fakes[name].install();
|
|
66
|
-
active = [
|
|
66
|
+
active = [.../* @__PURE__ */ new Set([...active, ...selected])];
|
|
67
67
|
return selected;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-fakes.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tests/fakes/test-fakes.ts"],"sourcesContent":["import type { GenericObject } from \"@mongez/reinforcements\";\nimport { config } from \"../../config\";\nimport { cacheFake } from \"./cache-fake\";\nimport { clockFake } from \"./clock-fake\";\nimport { idsFake } from \"./ids-fake\";\nimport { mailFake } from \"./mail-fake\";\nimport { queueFake } from \"./queue-fake\";\nimport { storageFake } from \"./storage-fake\";\n\n/** The fakes the test kit installs. */\nexport const TEST_FAKE_NAMES = [\"mail\", \"queue\", \"cache\", \"storage\", \"clock\", \"ids\"] as const;\n\nexport type TestFakeName = (typeof TEST_FAKE_NAMES)[number];\n\n/**\n * Which fakes to install.\n *\n * - `true` (the default) — all of them.\n * - `false` — none: real drivers, real clock, real ids.\n * - an object — all of them except the ones set to `false`, e.g.\n * `{ cache: false }` keeps the configured cache driver.\n */\nexport type TestFakesSelection = boolean | Partial<Record<TestFakeName, boolean>>;\n\nconst fakes: Record<\n TestFakeName,\n { install(): void | Promise<void>; restore(): void | Promise<void> }\n> = {\n mail: mailFake,\n queue: queueFake,\n cache: cacheFake,\n storage: storageFake,\n clock: clockFake,\n ids: idsFake,\n};\n\nlet active: TestFakeName[] = [];\n\n/** Read `tests.fakes` from `src/config/tests.ts`, or `undefined` when unset. */\nexport function readConfiguredFakes(): TestFakesSelection | undefined {\n // `config.get` resolves an absent key to `null`, not to its default's shape.\n const testsConfig = config.get<GenericObject>(\"tests\", {}) ?? {};\n\n return validateSelection(testsConfig.fakes as unknown, \"tests.fakes\");\n}\n\nfunction validateSelection(value: unknown, source: string): TestFakesSelection | undefined {\n if (value === undefined || typeof value === \"boolean\") return value;\n\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new Error(\n `${source} must be true, false, or an object such as { cache: false }; got ${JSON.stringify(value)}.`,\n );\n }\n\n const selection: Partial<Record<TestFakeName, boolean>> = {};\n\n for (const [key, flag] of Object.entries(value)) {\n const name = TEST_FAKE_NAMES.find((candidate) => candidate === key);\n\n if (!name) {\n throw new Error(\n `${source} has an unknown fake \"${key}\". Known fakes: ${TEST_FAKE_NAMES.join(\", \")}.`,\n );\n }\n\n if (typeof flag !== \"boolean\") {\n throw new Error(`${source}.${key} must be true or false; got ${JSON.stringify(flag)}.`);\n }\n\n selection[name] = flag;\n }\n\n return selection;\n}\n\n/**\n * The fakes to install. Precedence: an explicit selection (the `fakes`\n * option of `setupTest()` / `startHttpTestServer()`) > `tests.fakes` in\n * `src/config/tests.ts` > all on.\n */\nexport function resolveTestFakes(explicit?: TestFakesSelection): TestFakeName[] {\n const selection =\n explicit !== undefined ? validateSelection(explicit, \"fakes\") : readConfiguredFakes();\n\n if (selection === undefined || selection === true) return [...TEST_FAKE_NAMES];\n if (selection === false) return [];\n\n return TEST_FAKE_NAMES.filter((name) => selection[name] !== false);\n}\n\n/**\n * Install the selected fakes. Called by `setupTest()` and\n * `startHttpTestServer()` once their connectors are up; call it yourself only\n * when you bootstrap the framework without them.\n *\n * @returns the fakes that are now installed.\n */\nexport async function installTestFakes(explicit?: TestFakesSelection): Promise<TestFakeName[]> {\n const selected = resolveTestFakes(explicit);\n\n for (const name of selected) {\n await fakes[name].install();\n }\n\n active = [...new Set([...active, ...selected])];\n\n return selected;\n}\n\n/**\n * Restore every installed fake, in reverse order. Every fake is restored even\n * when one fails; the failures are rethrown together afterwards.\n */\nexport async function restoreTestFakes(): Promise<void> {\n const errors: unknown[] = [];\n\n for (const name of [...active].reverse()) {\n try {\n await fakes[name].restore();\n } catch (error) {\n errors.push(error);\n }\n }\n\n active = [];\n\n if (errors.length > 0) throw new AggregateError(errors, \"Restoring the test fakes failed.\");\n}\n\n/** The fakes installed right now. */\nexport function installedTestFakes(): TestFakeName[] {\n return [...active];\n}\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,kBAAkB;CAAC;CAAQ;CAAS;CAAS;CAAW;CAAS;AAAK;AAcnF,MAAM,QAGF;CACF,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,KAAK;AACP;AAEA,IAAI,SAAyB,CAAC;;AAG9B,SAAgB,sBAAsD;CAIpE,OAAO,mBAFa,OAAO,IAAmB,SAAS,CAAC,CAAC,KAAK,CAAC,EAE3B,CAAC,OAAkB,aAAa;AACtE;AAEA,SAAS,kBAAkB,OAAgB,QAAgD;CACzF,IAAI,UAAU,UAAa,OAAO,UAAU,WAAW,OAAO;CAE9D,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GACpE,MAAM,IAAI,MACR,GAAG,OAAO,mEAAmE,KAAK,UAAU,KAAK,EAAE,EACrG;CAGF,MAAM,YAAoD,CAAC;CAE3D,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,KAAK,GAAG;EAC/C,MAAM,OAAO,gBAAgB,MAAM,cAAc,cAAc,GAAG;EAElE,IAAI,CAAC,MACH,MAAM,IAAI,MACR,GAAG,OAAO,wBAAwB,IAAI,kBAAkB,gBAAgB,KAAK,IAAI,EAAE,EACrF;EAGF,IAAI,OAAO,SAAS,WAClB,MAAM,IAAI,MAAM,GAAG,OAAO,GAAG,IAAI,8BAA8B,KAAK,UAAU,IAAI,EAAE,EAAE;EAGxF,UAAU,QAAQ;CACpB;CAEA,OAAO;AACT;;;;;;AAOA,SAAgB,iBAAiB,UAA+C;CAC9E,MAAM,YACJ,aAAa,SAAY,kBAAkB,UAAU,OAAO,IAAI,oBAAoB;CAEtF,IAAI,cAAc,UAAa,cAAc,MAAM,OAAO,CAAC,GAAG,eAAe;CAC7E,IAAI,cAAc,OAAO,OAAO,CAAC;CAEjC,OAAO,gBAAgB,QAAQ,SAAS,UAAU,UAAU,KAAK;AACnE;;;;;;;;AASA,eAAsB,iBAAiB,UAAwD;CAC7F,MAAM,WAAW,iBAAiB,QAAQ;CAE1C,KAAK,MAAM,QAAQ,UACjB,MAAM,MAAM,KAAK,CAAC,QAAQ;CAG5B,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"test-fakes.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tests/fakes/test-fakes.ts"],"sourcesContent":["import type { GenericObject } from \"@mongez/reinforcements\";\nimport { config } from \"../../config\";\nimport { cacheFake } from \"./cache-fake\";\nimport { clockFake } from \"./clock-fake\";\nimport { idsFake } from \"./ids-fake\";\nimport { mailFake } from \"./mail-fake\";\nimport { queueFake } from \"./queue-fake\";\nimport { storageFake } from \"./storage-fake\";\n\n/** The fakes the test kit installs. */\nexport const TEST_FAKE_NAMES = [\"mail\", \"queue\", \"cache\", \"storage\", \"clock\", \"ids\"] as const;\n\nexport type TestFakeName = (typeof TEST_FAKE_NAMES)[number];\n\n/**\n * Which fakes to install.\n *\n * - `true` (the default) — all of them.\n * - `false` — none: real drivers, real clock, real ids.\n * - an object — all of them except the ones set to `false`, e.g.\n * `{ cache: false }` keeps the configured cache driver.\n */\nexport type TestFakesSelection = boolean | Partial<Record<TestFakeName, boolean>>;\n\nconst fakes: Record<\n TestFakeName,\n { install(): void | Promise<void>; restore(): void | Promise<void> }\n> = {\n mail: mailFake,\n queue: queueFake,\n cache: cacheFake,\n storage: storageFake,\n clock: clockFake,\n ids: idsFake,\n};\n\nlet active: TestFakeName[] = [];\n\n/** Read `tests.fakes` from `src/config/tests.ts`, or `undefined` when unset. */\nexport function readConfiguredFakes(): TestFakesSelection | undefined {\n // `config.get` resolves an absent key to `null`, not to its default's shape.\n const testsConfig = config.get<GenericObject>(\"tests\", {}) ?? {};\n\n return validateSelection(testsConfig.fakes as unknown, \"tests.fakes\");\n}\n\nfunction validateSelection(value: unknown, source: string): TestFakesSelection | undefined {\n if (value === undefined || typeof value === \"boolean\") return value;\n\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new Error(\n `${source} must be true, false, or an object such as { cache: false }; got ${JSON.stringify(value)}.`,\n );\n }\n\n const selection: Partial<Record<TestFakeName, boolean>> = {};\n\n for (const [key, flag] of Object.entries(value)) {\n const name = TEST_FAKE_NAMES.find((candidate) => candidate === key);\n\n if (!name) {\n throw new Error(\n `${source} has an unknown fake \"${key}\". Known fakes: ${TEST_FAKE_NAMES.join(\", \")}.`,\n );\n }\n\n if (typeof flag !== \"boolean\") {\n throw new Error(`${source}.${key} must be true or false; got ${JSON.stringify(flag)}.`);\n }\n\n selection[name] = flag;\n }\n\n return selection;\n}\n\n/**\n * The fakes to install. Precedence: an explicit selection (the `fakes`\n * option of `setupTest()` / `startHttpTestServer()`) > `tests.fakes` in\n * `src/config/tests.ts` > all on.\n */\nexport function resolveTestFakes(explicit?: TestFakesSelection): TestFakeName[] {\n const selection =\n explicit !== undefined ? validateSelection(explicit, \"fakes\") : readConfiguredFakes();\n\n if (selection === undefined || selection === true) return [...TEST_FAKE_NAMES];\n if (selection === false) return [];\n\n return TEST_FAKE_NAMES.filter((name) => selection[name] !== false);\n}\n\n/**\n * Install the selected fakes. Called by `setupTest()` and\n * `startHttpTestServer()` once their connectors are up; call it yourself only\n * when you bootstrap the framework without them.\n *\n * @returns the fakes that are now installed.\n */\nexport async function installTestFakes(explicit?: TestFakesSelection): Promise<TestFakeName[]> {\n const selected = resolveTestFakes(explicit);\n\n for (const name of selected) {\n await fakes[name].install();\n }\n\n active = [...new Set([...active, ...selected])];\n\n return selected;\n}\n\n/**\n * Restore every installed fake, in reverse order. Every fake is restored even\n * when one fails; the failures are rethrown together afterwards.\n */\nexport async function restoreTestFakes(): Promise<void> {\n const errors: unknown[] = [];\n\n for (const name of [...active].reverse()) {\n try {\n await fakes[name].restore();\n } catch (error) {\n errors.push(error);\n }\n }\n\n active = [];\n\n if (errors.length > 0) throw new AggregateError(errors, \"Restoring the test fakes failed.\");\n}\n\n/** The fakes installed right now. */\nexport function installedTestFakes(): TestFakeName[] {\n return [...active];\n}\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,kBAAkB;CAAC;CAAQ;CAAS;CAAS;CAAW;CAAS;AAAK;AAcnF,MAAM,QAGF;CACF,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;CACT,OAAO;CACP,KAAK;AACP;AAEA,IAAI,SAAyB,CAAC;;AAG9B,SAAgB,sBAAsD;CAIpE,OAAO,mBAFa,OAAO,IAAmB,SAAS,CAAC,CAAC,KAAK,CAAC,EAE3B,CAAC,OAAkB,aAAa;AACtE;AAEA,SAAS,kBAAkB,OAAgB,QAAgD;CACzF,IAAI,UAAU,UAAa,OAAO,UAAU,WAAW,OAAO;CAE9D,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GACpE,MAAM,IAAI,MACR,GAAG,OAAO,mEAAmE,KAAK,UAAU,KAAK,EAAE,EACrG;CAGF,MAAM,YAAoD,CAAC;CAE3D,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,KAAK,GAAG;EAC/C,MAAM,OAAO,gBAAgB,MAAM,cAAc,cAAc,GAAG;EAElE,IAAI,CAAC,MACH,MAAM,IAAI,MACR,GAAG,OAAO,wBAAwB,IAAI,kBAAkB,gBAAgB,KAAK,IAAI,EAAE,EACrF;EAGF,IAAI,OAAO,SAAS,WAClB,MAAM,IAAI,MAAM,GAAG,OAAO,GAAG,IAAI,8BAA8B,KAAK,UAAU,IAAI,EAAE,EAAE;EAGxF,UAAU,QAAQ;CACpB;CAEA,OAAO;AACT;;;;;;AAOA,SAAgB,iBAAiB,UAA+C;CAC9E,MAAM,YACJ,aAAa,SAAY,kBAAkB,UAAU,OAAO,IAAI,oBAAoB;CAEtF,IAAI,cAAc,UAAa,cAAc,MAAM,OAAO,CAAC,GAAG,eAAe;CAC7E,IAAI,cAAc,OAAO,OAAO,CAAC;CAEjC,OAAO,gBAAgB,QAAQ,SAAS,UAAU,UAAU,KAAK;AACnE;;;;;;;;AASA,eAAsB,iBAAiB,UAAwD;CAC7F,MAAM,WAAW,iBAAiB,QAAQ;CAE1C,KAAK,MAAM,QAAQ,UACjB,MAAM,MAAM,KAAK,CAAC,QAAQ;CAG5B,SAAS,CAAC,mBAAG,IAAI,IAAI,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC;CAE9C,OAAO;AACT;;;;;AAMA,eAAsB,mBAAkC;CACtD,MAAM,SAAoB,CAAC;CAE3B,KAAK,MAAM,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,GACrC,IAAI;EACF,MAAM,MAAM,KAAK,CAAC,QAAQ;CAC5B,SAAS,OAAO;EACd,OAAO,KAAK,KAAK;CACnB;CAGF,SAAS,CAAC;CAEV,IAAI,OAAO,SAAS,GAAG,MAAM,IAAI,eAAe,QAAQ,kCAAkC;AAC5F;;AAGA,SAAgB,qBAAqC;CACnD,OAAO,CAAC,GAAG,MAAM;AACnB"}
|
package/esm/tests/index.d.mts
CHANGED
|
@@ -12,6 +12,7 @@ import { idsFake } from "./fakes/ids-fake.mjs";
|
|
|
12
12
|
import { MailMatcher, mailFake } from "./fakes/mail-fake.mjs";
|
|
13
13
|
import { JobReference, PushedJob, PushedJobMatcher, queueFake } from "./fakes/queue-fake.mjs";
|
|
14
14
|
import { storageFake } from "./fakes/storage-fake.mjs";
|
|
15
|
+
import "./fakes/index.mjs";
|
|
15
16
|
import { Factory, FactoryAttributes, FactoryOverrides, FactorySeed, FactoryState, defineFactory, resetFactorySequences } from "./factories.mjs";
|
|
16
17
|
import { CreateTestHttpServerOptions, TestHttpServer, createTestHttpServer } from "./test-http-server.mjs";
|
|
17
18
|
import { REDACTED, ResponseSnapshot, SnapshotResponseOptions, snapshotResponse } from "./snapshot-response.mjs";
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* timestamps) replaced, so the snapshot fails only when the shape or a stable
|
|
6
6
|
* value changes.
|
|
7
7
|
*/
|
|
8
|
-
type ResponseSnapshot = {
|
|
8
|
+
export type ResponseSnapshot = {
|
|
9
9
|
status: number;
|
|
10
10
|
contentType: string | null;
|
|
11
11
|
body: unknown;
|
|
12
12
|
};
|
|
13
|
-
type SnapshotResponseOptions = {
|
|
13
|
+
export type SnapshotResponseOptions = {
|
|
14
14
|
/**
|
|
15
15
|
* Dot paths whose values are replaced by `"[redacted]"`. `*` matches any
|
|
16
16
|
* key or array index: `"post.id"`, `"posts.*.createdAt"`, `"*.token"`.
|
|
17
17
|
*/
|
|
18
18
|
redact?: string[];
|
|
19
19
|
};
|
|
20
|
-
declare const REDACTED = "[redacted]";
|
|
20
|
+
export declare const REDACTED = "[redacted]";
|
|
21
21
|
/**
|
|
22
22
|
* Read a response into a {@link ResponseSnapshot} for `toMatchSnapshot()`.
|
|
23
23
|
* Consumes the body: call it instead of `response.json()`, not after.
|
|
@@ -28,7 +28,6 @@ declare const REDACTED = "[redacted]";
|
|
|
28
28
|
* expect(await snapshotResponse(response, { redact: ["post.id", "post.createdAt"] }))
|
|
29
29
|
* .toMatchSnapshot();
|
|
30
30
|
*/
|
|
31
|
-
declare function snapshotResponse(response: Response, options?: SnapshotResponseOptions): Promise<ResponseSnapshot>;
|
|
31
|
+
export declare function snapshotResponse(response: Response, options?: SnapshotResponseOptions): Promise<ResponseSnapshot>;
|
|
32
32
|
//#endregion
|
|
33
|
-
export { REDACTED, ResponseSnapshot, SnapshotResponseOptions, snapshotResponse };
|
|
34
33
|
//# sourceMappingURL=snapshot-response.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-response.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/snapshot-response.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"snapshot-response.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/snapshot-response.ts"],"mappings":";;;;;;;YAMY;EACV;EACA;EACA;;YAGU;;;;;EAKV;;qBAGW;;;;;;;;;;;wBAkCS,iBACpB,UAAU,UACV,UAAS,0BACR,QAAQ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TestFakesSelection } from "./fakes/test-fakes.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/tests/start-http-development-server.d.ts
|
|
4
|
-
type StartHttpTestServerOptions = {
|
|
3
|
+
export type StartHttpTestServerOptions = {
|
|
5
4
|
/**
|
|
6
5
|
* Port the test server binds to, overriding `http.port`.
|
|
7
6
|
*
|
|
@@ -48,16 +47,15 @@ type StartHttpTestServerOptions = {
|
|
|
48
47
|
* // let the OS pick a free port; the request helpers follow it
|
|
49
48
|
* await startHttpTestServer({ port: 0 });
|
|
50
49
|
*/
|
|
51
|
-
declare function startHttpTestServer(options?: StartHttpTestServerOptions): Promise<void>;
|
|
50
|
+
export declare function startHttpTestServer(options?: StartHttpTestServerOptions): Promise<void>;
|
|
52
51
|
/**
|
|
53
52
|
* Stop the HTTP test server
|
|
54
53
|
* Call this in Vitest's globalTeardown
|
|
55
54
|
*/
|
|
56
|
-
declare function stopHttpTestServer(): Promise<void>;
|
|
55
|
+
export declare function stopHttpTestServer(): Promise<void>;
|
|
57
56
|
/**
|
|
58
57
|
* Check if test server is running
|
|
59
58
|
*/
|
|
60
|
-
declare function isTestServerRunning(): boolean;
|
|
59
|
+
export declare function isTestServerRunning(): boolean;
|
|
61
60
|
//#endregion
|
|
62
|
-
export { StartHttpTestServerOptions, isTestServerRunning, startHttpTestServer, stopHttpTestServer };
|
|
63
61
|
//# sourceMappingURL=start-http-development-server.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-http-development-server.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/start-http-development-server.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"start-http-development-server.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/start-http-development-server.ts"],"mappings":";;YA4BY;;;;;;;;;;;EAWV;;;;;;;;;;EAWA;;;;;;;;;;;;EAaA,QAAQ;;;;;;;;;;;;;;wBA6HY,oBAAoB,UAAS,6BAAkC;;;;;wBA2H/D,sBAAsB;;;;wBAmC5B"}
|
|
@@ -11,7 +11,7 @@ import { filesOrchestrator } from "../dev-server/files-orchestrator.mjs";
|
|
|
11
11
|
import { loadConfigFiles } from "../config/load-config-files.mjs";
|
|
12
12
|
import { installTestFakes, restoreTestFakes } from "./fakes/test-fakes.mjs";
|
|
13
13
|
import { publishTestServerPort, withdrawTestServerPort } from "./test-server-port-channel.mjs";
|
|
14
|
-
import
|
|
14
|
+
import baseConfig from "@mongez/config";
|
|
15
15
|
|
|
16
16
|
//#region ../../packages/core/src/tests/start-http-development-server.ts
|
|
17
17
|
/**
|
|
@@ -50,16 +50,16 @@ async function startTestServerPhase(phase) {
|
|
|
50
50
|
* and never falls back to `process.env`.
|
|
51
51
|
*/
|
|
52
52
|
async function applyTestServerPort(port) {
|
|
53
|
-
if (!
|
|
53
|
+
if (!baseConfig.get("http")) {
|
|
54
54
|
if (port !== void 0) throw new Error(`startHttpTestServer({ port: ${port} }) was given a port, but this app has no \`http\` config, so no HTTP server is started. Add \`src/config/http.ts\` first.`);
|
|
55
55
|
return "none";
|
|
56
56
|
}
|
|
57
|
-
if (port !== void 0)
|
|
58
|
-
const resolvedPort =
|
|
57
|
+
if (port !== void 0) baseConfig.set("http.port", port);
|
|
58
|
+
const resolvedPort = baseConfig.get("http.port");
|
|
59
59
|
if (typeof resolvedPort !== "number") throw new Error(`startHttpTestServer() cannot use \`http.port\` value ${JSON.stringify(resolvedPort)} — it did not round-trip through Number() (env() only coerces a value when \`String(Number(v)) === v\`, so "03999", "+3999", "1e3", and values with stray whitespace stay strings). Fix \`HTTP_PORT\` in .env, or pass an explicit numeric port: startHttpTestServer({ port: 3999 }).`);
|
|
60
60
|
if (resolvedPort === 0) return "ephemeral";
|
|
61
61
|
if (resolvedPort < 0) throw new Error(`startHttpTestServer() cannot run on port ${resolvedPort}. Pass a port number, or 0 to let the OS pick a free one — e.g. startHttpTestServer({ port: 0 }).`);
|
|
62
|
-
await assertPortIsAvailable(resolvedPort,
|
|
62
|
+
await assertPortIsAvailable(resolvedPort, baseConfig.get("http.host") || "localhost");
|
|
63
63
|
publishTestServerPort(resolvedPort);
|
|
64
64
|
return "published";
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-http-development-server.mjs","names":[],"sources":["../../../../../../../../packages/core/src/tests/start-http-development-server.ts"],"sourcesContent":["/**\n * HTTP Test Server\n *\n * Starts a minimal HTTP server for testing.\n * Unlike the full DevelopmentServer, this:\n * - Does NOT watch files\n * - Does NOT do HMR\n * - Only starts connectors needed for HTTP requests\n *\n * Used in Vitest's globalSetup to start server once for all test workers.\n */\nimport config from \"@mongez/config\";\nimport { Application } from \"../application\";\nimport { bootstrap } from \"../bootstrap\";\nimport { loadConfigFiles } from \"../config/load-config-files\";\nimport { connectorsManager } from \"../connectors/connectors-manager\";\nimport { ConnectorLifecyclePhase } from \"../connectors/types\";\nimport { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { assertPortIsAvailable } from \"../http/port-preflight\";\nimport { getHttpReadyReport } from \"../http/ready-report\";\nimport { loadEnvironmentFiles } from \"../utils/load-environment\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\nimport { installTestFakes, restoreTestFakes } from \"./fakes/test-fakes\";\nimport type { TestFakesSelection } from \"./fakes/test-fakes\";\nimport { publishTestServerPort, withdrawTestServerPort } from \"./test-server-port-channel\";\n\nlet isServerRunning = false;\n\nexport type StartHttpTestServerOptions = {\n /**\n * Port the test server binds to, overriding `http.port`.\n *\n * Needed because the server cannot be moved from outside: this function\n * bootstraps the app itself, and that bootstrap re-reads `.env`.\n *\n * `0` asks the OS for a free port. The port actually bound is published to\n * the test workers, so `testGet()`, `actingAs()` and friends follow it, and\n * a suite never collides with `warlock dev` or another suite.\n */\n port?: number;\n\n /**\n * Whether to boot the optional web connector.\n *\n * Defaults to `true` to preserve the full-stack test server. Pass `false`\n * for API-only suites: the web connector's lazy delegate is skipped before\n * `boot()`, so it never constructs its Vite-backed implementation.\n *\n * @default true\n */\n web?: boolean;\n\n /**\n * Which test fakes the server process installs (mail, queue, cache,\n * storage, clock, ids). Same values and precedence as `setupTest({ fakes })`:\n * this option > `tests.fakes` config > all on.\n *\n * A fake records what happens in ITS process: mail sent while this server\n * handles a request is captured here, not in the test worker that sent the\n * request. To assert on what an HTTP request did, serve it in the worker\n * with `createTestHttpServer()`. The storage fake is the exception: its\n * temp root is shared with the workers.\n */\n fakes?: TestFakesSelection;\n};\n\n/**\n * Start one lifecycle phase while omitting the web connector.\n *\n * Kept here rather than changing the manager's public API: this is a\n * test-server-only selection, and retaining the manager's boot-all / start-all\n * ordering is essential for HTTP and socket connector wiring.\n */\nasync function startTestServerPhase(phase: ConnectorLifecyclePhase): Promise<void> {\n const connectors = connectorsManager\n .list()\n .filter((connector) => connector.lifecyclePhase === phase)\n .filter((connector) => connector.name !== \"web\");\n\n for (const connector of connectors) {\n await connector.boot();\n }\n\n for (const connector of connectors) {\n await connector.start();\n }\n}\n\n/**\n * Apply the caller's port and preflight the bind.\n *\n * Called at the last moment before the HTTP connector binds, and that timing is\n * the fix: `bootstrap()` re-reads `.env` through `loadEnv()` (dotenv overrides\n * by default), and `src/config/http.ts` then resolves its port from that store,\n * so anything the caller set earlier is gone by the time the port is read.\n * Writing into `config` here is also the only channel that works — assigning\n * `process.env.HTTP_PORT` has no effect, since `env()` reads dotenv's own store\n * and never falls back to `process.env`.\n */\nasync function applyTestServerPort(port?: number): Promise<\"published\" | \"ephemeral\" | \"none\"> {\n const httpConfig = config.get(\"http\");\n\n if (!httpConfig) {\n if (port !== undefined) {\n throw new Error(\n `startHttpTestServer({ port: ${port} }) was given a port, but this app has no \\`http\\` config, so no HTTP server is started. Add \\`src/config/http.ts\\` first.`,\n );\n }\n\n return \"none\";\n }\n\n if (port !== undefined) {\n config.set(\"http.port\", port);\n }\n\n const resolvedPort = config.get(\"http.port\");\n\n // No configured port at all is fine: Fastify falls back to its own default and\n // the workers resolve the same one from their own config, so both ends agree\n // without the channel.\n //\n // A non-numeric port is NOT fine, and must fail loudly rather than skip the\n // preflight silently. `env()` coerces a value only when it round-trips exactly\n // (`String(Number(v)) === v`), so `HTTP_PORT=3999` and `HTTP_PORT=0` arrive as\n // numbers, but `03999`, `+3999`, `1e3` and anything with stray whitespace stay\n // strings. Letting those through used to reach `HttpConnector.start()`'s\n // `listen({ port })` unchanged — no preflight, no published port, and every\n // test worker resolving a URL from a channel nothing ever wrote to.\n if (typeof resolvedPort !== \"number\") {\n throw new Error(\n `startHttpTestServer() cannot use \\`http.port\\` value ${JSON.stringify(resolvedPort)} — it did not round-trip through Number() (env() only coerces a value when \\`String(Number(v)) === v\\`, so \"03999\", \"+3999\", \"1e3\", and values with stray whitespace stay strings). Fix \\`HTTP_PORT\\` in .env, or pass an explicit numeric port: startHttpTestServer({ port: 3999 }).`,\n );\n }\n\n // `0` is the OS's \"pick a free one for me\". There is nothing to preflight —\n // probing 0 would bind some unrelated port and prove nothing — and nothing to\n // publish yet: the port is only known once the HTTP connector has bound, and\n // `HttpConnector.start()` records the port `listen()` actually returned (see\n // `ready-report.ts`). It is published right after the late phase instead.\n if (resolvedPort === 0) {\n return \"ephemeral\";\n }\n\n if (resolvedPort < 0) {\n throw new Error(\n `startHttpTestServer() cannot run on port ${resolvedPort}. Pass a port number, or 0 to let the OS pick a free one — e.g. startHttpTestServer({ port: 0 }).`,\n );\n }\n\n await assertPortIsAvailable(resolvedPort, config.get(\"http.host\") || \"localhost\");\n\n publishTestServerPort(resolvedPort);\n\n return \"published\";\n}\n\n/**\n * Publish the port an ephemeral (`port: 0`) bind actually took.\n *\n * `before` is the ready report from before the late phase: the report is a\n * module-level record, so an unchanged one means THIS boot bound nothing and an\n * older report must not be mistaken for it.\n */\nfunction publishEphemeralPort(before: ReturnType<typeof getHttpReadyReport>): void {\n const report = getHttpReadyReport();\n\n if (!report || report === before || report.port <= 0) {\n throw new Error(\n \"startHttpTestServer({ port: 0 }) booted, but the HTTP connector did not bind a port, so there is no address to give the test workers. Check that `src/config/http.ts` exists and that this process serves HTTP (its role is not worker-only).\",\n );\n }\n\n publishTestServerPort(report.port);\n}\n\n/**\n * Start the HTTP test server (minimal - no file watching)\n * Call this in Vitest's globalSetup\n *\n * @example\n * // run this suite on its own port, whatever `.env` says\n * await startHttpTestServer({ port: 3999 });\n *\n * @example\n * // let the OS pick a free port; the request helpers follow it\n * await startHttpTestServer({ port: 0 });\n */\nexport async function startHttpTestServer(options: StartHttpTestServerOptions = {}): Promise<void> {\n const nodeEnvironment = process.env.NODE_ENV;\n\n if (nodeEnvironment === undefined) {\n process.env.NODE_ENV = \"test\";\n } else if (nodeEnvironment !== \"test\") {\n throw new Error(\n `startHttpTestServer() requires NODE_ENV=\"test\", but received NODE_ENV=${JSON.stringify(nodeEnvironment)}. Set NODE_ENV=test before starting the test server.`,\n );\n }\n\n if (isServerRunning) {\n console.log(\"[test-server] Server already running, skipping start\");\n return;\n }\n\n console.log(\"[test-server] Starting HTTP test server...\");\n\n try {\n // `globalSetup` runs in Vitest's main process, where Vitest's worker env\n // setup has not run. Load `.env.test` here, before any config is read.\n await loadEnvironmentFiles();\n\n // Set environment\n Application.setRuntimeStrategy(\"development\");\n Application.setEnvironment(\"test\");\n\n // Bootstrap (env, etc.)\n await warlockConfigManager.load();\n await bootstrap();\n\n // Initialize file orchestrator (but don't watch)\n await filesOrchestrator.init();\n await filesOrchestrator.initializeAll();\n\n // Load config files\n await loadConfigFiles(true);\n\n // Early-phase connectors (database, cache, logger, storage, mailer,\n // herald) must start BEFORE app modules load: a module's `main.ts` boot\n // side-effect can query the DB at import time, so the data source has to\n // be registered first. This mirrors the dev/prod boot order (see\n // `cli-commands.manager`, `production-builder`, and `DevelopmentServer`).\n if (options.web === false) {\n await startTestServerPhase(ConnectorLifecyclePhase.Early);\n } else {\n await connectorsManager.startPhase(ConnectorLifecyclePhase.Early);\n }\n\n // Fakes before app modules load, so module boot code already sees them.\n await installTestFakes(options.fakes);\n\n // Load application modules (their boot side-effects now see a live DB).\n await filesOrchestrator.moduleLoader.loadAll();\n\n const portMode = await applyTestServerPort(options.port);\n const readyReportBefore = getHttpReadyReport();\n\n // A rejecting validator (Application.onValidateBoot) must abort boot\n // before late-phase connectors bind a port — same slot as\n // `DevelopmentServer.start()` and the generated production `app.ts`.\n await Application.runStartupValidators();\n\n // Late-phase connectors (http, socket) bind after app code has\n // registered its routes and listeners.\n if (options.web === false) {\n await startTestServerPhase(ConnectorLifecyclePhase.Late);\n } else {\n await connectorsManager.startPhase(ConnectorLifecyclePhase.Late);\n }\n\n if (portMode === \"ephemeral\") {\n publishEphemeralPort(readyReportBefore);\n }\n\n isServerRunning = true;\n } catch (error) {\n // This function owns the connectors it starts, so a failure part-way\n // through has to leave nothing behind. Without this, `isServerRunning` was\n // still `false` — it is only set on the last line — so `globalTeardown`'s\n // `stopHttpTestServer()` reported \"No server to stop\" and walked away from\n // live early-phase connectors and a published port that outlived them.\n await unwindPartialStartup();\n\n // Rethrown unchanged: the startup failure is the one the caller needs to\n // read. A cleanup failure that replaced it would hide the actual cause.\n throw error;\n }\n}\n\n/**\n * Best-effort teardown of whatever a failed {@link startHttpTestServer} managed\n * to start.\n *\n * Every step is independent and none may throw: this runs while an error is\n * already in flight, and the caller is about to rethrow it.\n */\nasync function unwindPartialStartup(): Promise<void> {\n try {\n await restoreTestFakes();\n } catch (fakesError) {\n console.error(\n \"[test-server] Restoring the test fakes after a failed start did not complete:\",\n fakesError,\n );\n }\n\n try {\n await connectorsManager.shutdown();\n } catch (shutdownError) {\n // Reported, not thrown — it is secondary to the startup error being\n // rethrown, and losing that one to this would be the worse outcome.\n console.error(\"[test-server] Cleanup after a failed start did not complete:\", shutdownError);\n }\n\n withdrawTestServerPort();\n isServerRunning = false;\n}\n\n/**\n * Stop the HTTP test server\n * Call this in Vitest's globalTeardown\n */\nexport async function stopHttpTestServer(): Promise<void> {\n if (!isServerRunning) {\n console.log(\"[test-server] No server to stop\");\n return;\n }\n\n try {\n try {\n await restoreTestFakes();\n } catch (fakesError) {\n console.error(\"[test-server] Restoring the test fakes did not complete:\", fakesError);\n }\n\n await connectorsManager.shutdown();\n\n console.log(\"[test-server] HTTP test server stopped\");\n } catch (error) {\n // Surfaced, never swallowed — cleaning up is not the same as the shutdown\n // having succeeded, and a suite whose teardown failed should say so.\n console.error(\"[test-server] Error stopping HTTP server:\", error);\n\n throw error;\n } finally {\n // In a `finally` rather than after the `await`: when `shutdown()` threw,\n // the published port survived the server it pointed at, so the next run in\n // the same process inherited a stale one and sent every request to it.\n withdrawTestServerPort();\n\n isServerRunning = false;\n }\n}\n\n/**\n * Check if test server is running\n */\nexport function isTestServerRunning(): boolean {\n return isServerRunning;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,kBAAkB;;;;;;;;AA+CtB,eAAe,qBAAqB,OAA+C;CACjF,MAAM,aAAa,kBAChB,KAAK,CAAC,CACN,QAAQ,cAAc,UAAU,mBAAmB,KAAK,CAAC,CACzD,QAAQ,cAAc,UAAU,SAAS,KAAK;CAEjD,KAAK,MAAM,aAAa,YACtB,MAAM,UAAU,KAAK;CAGvB,KAAK,MAAM,aAAa,YACtB,MAAM,UAAU,MAAM;AAE1B;;;;;;;;;;;;AAaA,eAAe,oBAAoB,MAA4D;CAG7F,IAAI,CAFe,OAAO,IAAI,MAEhB,GAAG;EACf,IAAI,SAAS,QACX,MAAM,IAAI,MACR,+BAA+B,KAAK,2HACtC;EAGF,OAAO;CACT;CAEA,IAAI,SAAS,QACX,OAAO,IAAI,aAAa,IAAI;CAG9B,MAAM,eAAe,OAAO,IAAI,WAAW;CAa3C,IAAI,OAAO,iBAAiB,UAC1B,MAAM,IAAI,MACR,wDAAwD,KAAK,UAAU,YAAY,EAAE,sRACvF;CAQF,IAAI,iBAAiB,GACnB,OAAO;CAGT,IAAI,eAAe,GACjB,MAAM,IAAI,MACR,4CAA4C,aAAa,kGAC3D;CAGF,MAAM,sBAAsB,cAAc,OAAO,IAAI,WAAW,KAAK,WAAW;CAEhF,sBAAsB,YAAY;CAElC,OAAO;AACT;;;;;;;;AASA,SAAS,qBAAqB,QAAqD;CACjF,MAAM,SAAS,mBAAmB;CAElC,IAAI,CAAC,UAAU,WAAW,UAAU,OAAO,QAAQ,GACjD,MAAM,IAAI,MACR,+OACF;CAGF,sBAAsB,OAAO,IAAI;AACnC;;;;;;;;;;;;;AAcA,eAAsB,oBAAoB,UAAsC,CAAC,GAAkB;CACjG,MAAM,kBAAkB,QAAQ,IAAI;CAEpC,IAAI,oBAAoB,QACtB,QAAQ,IAAI,WAAW;MAClB,IAAI,oBAAoB,QAC7B,MAAM,IAAI,MACR,yEAAyE,KAAK,UAAU,eAAe,EAAE,qDAC3G;CAGF,IAAI,iBAAiB;EACnB,QAAQ,IAAI,sDAAsD;EAClE;CACF;CAEA,QAAQ,IAAI,4CAA4C;CAExD,IAAI;EAGF,MAAM,qBAAqB;EAG3B,YAAY,mBAAmB,aAAa;EAC5C,YAAY,eAAe,MAAM;EAGjC,MAAM,qBAAqB,KAAK;EAChC,MAAM,UAAU;EAGhB,MAAM,kBAAkB,KAAK;EAC7B,MAAM,kBAAkB,cAAc;EAGtC,MAAM,gBAAgB,IAAI;EAO1B,IAAI,QAAQ,QAAQ,OAClB,MAAM,4BAAkD;OAExD,MAAM,kBAAkB,kBAAwC;EAIlE,MAAM,iBAAiB,QAAQ,KAAK;EAGpC,MAAM,kBAAkB,aAAa,QAAQ;EAE7C,MAAM,WAAW,MAAM,oBAAoB,QAAQ,IAAI;EACvD,MAAM,oBAAoB,mBAAmB;EAK7C,MAAM,YAAY,qBAAqB;EAIvC,IAAI,QAAQ,QAAQ,OAClB,MAAM,2BAAiD;OAEvD,MAAM,kBAAkB,iBAAuC;EAGjE,IAAI,aAAa,aACf,qBAAqB,iBAAiB;EAGxC,kBAAkB;CACpB,SAAS,OAAO;EAMd,MAAM,qBAAqB;EAI3B,MAAM;CACR;AACF;;;;;;;;AASA,eAAe,uBAAsC;CACnD,IAAI;EACF,MAAM,iBAAiB;CACzB,SAAS,YAAY;EACnB,QAAQ,MACN,iFACA,UACF;CACF;CAEA,IAAI;EACF,MAAM,kBAAkB,SAAS;CACnC,SAAS,eAAe;EAGtB,QAAQ,MAAM,gEAAgE,aAAa;CAC7F;CAEA,uBAAuB;CACvB,kBAAkB;AACpB;;;;;AAMA,eAAsB,qBAAoC;CACxD,IAAI,CAAC,iBAAiB;EACpB,QAAQ,IAAI,iCAAiC;EAC7C;CACF;CAEA,IAAI;EACF,IAAI;GACF,MAAM,iBAAiB;EACzB,SAAS,YAAY;GACnB,QAAQ,MAAM,4DAA4D,UAAU;EACtF;EAEA,MAAM,kBAAkB,SAAS;EAEjC,QAAQ,IAAI,wCAAwC;CACtD,SAAS,OAAO;EAGd,QAAQ,MAAM,6CAA6C,KAAK;EAEhE,MAAM;CACR,UAAU;EAIR,uBAAuB;EAEvB,kBAAkB;CACpB;AACF;;;;AAKA,SAAgB,sBAA+B;CAC7C,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"start-http-development-server.mjs","names":["config"],"sources":["../../../../../../../../packages/core/src/tests/start-http-development-server.ts"],"sourcesContent":["/**\n * HTTP Test Server\n *\n * Starts a minimal HTTP server for testing.\n * Unlike the full DevelopmentServer, this:\n * - Does NOT watch files\n * - Does NOT do HMR\n * - Only starts connectors needed for HTTP requests\n *\n * Used in Vitest's globalSetup to start server once for all test workers.\n */\nimport config from \"@mongez/config\";\nimport { Application } from \"../application\";\nimport { bootstrap } from \"../bootstrap\";\nimport { loadConfigFiles } from \"../config/load-config-files\";\nimport { connectorsManager } from \"../connectors/connectors-manager\";\nimport { ConnectorLifecyclePhase } from \"../connectors/types\";\nimport { filesOrchestrator } from \"../dev-server/files-orchestrator\";\nimport { assertPortIsAvailable } from \"../http/port-preflight\";\nimport { getHttpReadyReport } from \"../http/ready-report\";\nimport { loadEnvironmentFiles } from \"../utils/load-environment\";\nimport { warlockConfigManager } from \"../warlock-config/warlock-config.manager\";\nimport { installTestFakes, restoreTestFakes } from \"./fakes/test-fakes\";\nimport type { TestFakesSelection } from \"./fakes/test-fakes\";\nimport { publishTestServerPort, withdrawTestServerPort } from \"./test-server-port-channel\";\n\nlet isServerRunning = false;\n\nexport type StartHttpTestServerOptions = {\n /**\n * Port the test server binds to, overriding `http.port`.\n *\n * Needed because the server cannot be moved from outside: this function\n * bootstraps the app itself, and that bootstrap re-reads `.env`.\n *\n * `0` asks the OS for a free port. The port actually bound is published to\n * the test workers, so `testGet()`, `actingAs()` and friends follow it, and\n * a suite never collides with `warlock dev` or another suite.\n */\n port?: number;\n\n /**\n * Whether to boot the optional web connector.\n *\n * Defaults to `true` to preserve the full-stack test server. Pass `false`\n * for API-only suites: the web connector's lazy delegate is skipped before\n * `boot()`, so it never constructs its Vite-backed implementation.\n *\n * @default true\n */\n web?: boolean;\n\n /**\n * Which test fakes the server process installs (mail, queue, cache,\n * storage, clock, ids). Same values and precedence as `setupTest({ fakes })`:\n * this option > `tests.fakes` config > all on.\n *\n * A fake records what happens in ITS process: mail sent while this server\n * handles a request is captured here, not in the test worker that sent the\n * request. To assert on what an HTTP request did, serve it in the worker\n * with `createTestHttpServer()`. The storage fake is the exception: its\n * temp root is shared with the workers.\n */\n fakes?: TestFakesSelection;\n};\n\n/**\n * Start one lifecycle phase while omitting the web connector.\n *\n * Kept here rather than changing the manager's public API: this is a\n * test-server-only selection, and retaining the manager's boot-all / start-all\n * ordering is essential for HTTP and socket connector wiring.\n */\nasync function startTestServerPhase(phase: ConnectorLifecyclePhase): Promise<void> {\n const connectors = connectorsManager\n .list()\n .filter((connector) => connector.lifecyclePhase === phase)\n .filter((connector) => connector.name !== \"web\");\n\n for (const connector of connectors) {\n await connector.boot();\n }\n\n for (const connector of connectors) {\n await connector.start();\n }\n}\n\n/**\n * Apply the caller's port and preflight the bind.\n *\n * Called at the last moment before the HTTP connector binds, and that timing is\n * the fix: `bootstrap()` re-reads `.env` through `loadEnv()` (dotenv overrides\n * by default), and `src/config/http.ts` then resolves its port from that store,\n * so anything the caller set earlier is gone by the time the port is read.\n * Writing into `config` here is also the only channel that works — assigning\n * `process.env.HTTP_PORT` has no effect, since `env()` reads dotenv's own store\n * and never falls back to `process.env`.\n */\nasync function applyTestServerPort(port?: number): Promise<\"published\" | \"ephemeral\" | \"none\"> {\n const httpConfig = config.get(\"http\");\n\n if (!httpConfig) {\n if (port !== undefined) {\n throw new Error(\n `startHttpTestServer({ port: ${port} }) was given a port, but this app has no \\`http\\` config, so no HTTP server is started. Add \\`src/config/http.ts\\` first.`,\n );\n }\n\n return \"none\";\n }\n\n if (port !== undefined) {\n config.set(\"http.port\", port);\n }\n\n const resolvedPort = config.get(\"http.port\");\n\n // No configured port at all is fine: Fastify falls back to its own default and\n // the workers resolve the same one from their own config, so both ends agree\n // without the channel.\n //\n // A non-numeric port is NOT fine, and must fail loudly rather than skip the\n // preflight silently. `env()` coerces a value only when it round-trips exactly\n // (`String(Number(v)) === v`), so `HTTP_PORT=3999` and `HTTP_PORT=0` arrive as\n // numbers, but `03999`, `+3999`, `1e3` and anything with stray whitespace stay\n // strings. Letting those through used to reach `HttpConnector.start()`'s\n // `listen({ port })` unchanged — no preflight, no published port, and every\n // test worker resolving a URL from a channel nothing ever wrote to.\n if (typeof resolvedPort !== \"number\") {\n throw new Error(\n `startHttpTestServer() cannot use \\`http.port\\` value ${JSON.stringify(resolvedPort)} — it did not round-trip through Number() (env() only coerces a value when \\`String(Number(v)) === v\\`, so \"03999\", \"+3999\", \"1e3\", and values with stray whitespace stay strings). Fix \\`HTTP_PORT\\` in .env, or pass an explicit numeric port: startHttpTestServer({ port: 3999 }).`,\n );\n }\n\n // `0` is the OS's \"pick a free one for me\". There is nothing to preflight —\n // probing 0 would bind some unrelated port and prove nothing — and nothing to\n // publish yet: the port is only known once the HTTP connector has bound, and\n // `HttpConnector.start()` records the port `listen()` actually returned (see\n // `ready-report.ts`). It is published right after the late phase instead.\n if (resolvedPort === 0) {\n return \"ephemeral\";\n }\n\n if (resolvedPort < 0) {\n throw new Error(\n `startHttpTestServer() cannot run on port ${resolvedPort}. Pass a port number, or 0 to let the OS pick a free one — e.g. startHttpTestServer({ port: 0 }).`,\n );\n }\n\n await assertPortIsAvailable(resolvedPort, config.get(\"http.host\") || \"localhost\");\n\n publishTestServerPort(resolvedPort);\n\n return \"published\";\n}\n\n/**\n * Publish the port an ephemeral (`port: 0`) bind actually took.\n *\n * `before` is the ready report from before the late phase: the report is a\n * module-level record, so an unchanged one means THIS boot bound nothing and an\n * older report must not be mistaken for it.\n */\nfunction publishEphemeralPort(before: ReturnType<typeof getHttpReadyReport>): void {\n const report = getHttpReadyReport();\n\n if (!report || report === before || report.port <= 0) {\n throw new Error(\n \"startHttpTestServer({ port: 0 }) booted, but the HTTP connector did not bind a port, so there is no address to give the test workers. Check that `src/config/http.ts` exists and that this process serves HTTP (its role is not worker-only).\",\n );\n }\n\n publishTestServerPort(report.port);\n}\n\n/**\n * Start the HTTP test server (minimal - no file watching)\n * Call this in Vitest's globalSetup\n *\n * @example\n * // run this suite on its own port, whatever `.env` says\n * await startHttpTestServer({ port: 3999 });\n *\n * @example\n * // let the OS pick a free port; the request helpers follow it\n * await startHttpTestServer({ port: 0 });\n */\nexport async function startHttpTestServer(options: StartHttpTestServerOptions = {}): Promise<void> {\n const nodeEnvironment = process.env.NODE_ENV;\n\n if (nodeEnvironment === undefined) {\n process.env.NODE_ENV = \"test\";\n } else if (nodeEnvironment !== \"test\") {\n throw new Error(\n `startHttpTestServer() requires NODE_ENV=\"test\", but received NODE_ENV=${JSON.stringify(nodeEnvironment)}. Set NODE_ENV=test before starting the test server.`,\n );\n }\n\n if (isServerRunning) {\n console.log(\"[test-server] Server already running, skipping start\");\n return;\n }\n\n console.log(\"[test-server] Starting HTTP test server...\");\n\n try {\n // `globalSetup` runs in Vitest's main process, where Vitest's worker env\n // setup has not run. Load `.env.test` here, before any config is read.\n await loadEnvironmentFiles();\n\n // Set environment\n Application.setRuntimeStrategy(\"development\");\n Application.setEnvironment(\"test\");\n\n // Bootstrap (env, etc.)\n await warlockConfigManager.load();\n await bootstrap();\n\n // Initialize file orchestrator (but don't watch)\n await filesOrchestrator.init();\n await filesOrchestrator.initializeAll();\n\n // Load config files\n await loadConfigFiles(true);\n\n // Early-phase connectors (database, cache, logger, storage, mailer,\n // herald) must start BEFORE app modules load: a module's `main.ts` boot\n // side-effect can query the DB at import time, so the data source has to\n // be registered first. This mirrors the dev/prod boot order (see\n // `cli-commands.manager`, `production-builder`, and `DevelopmentServer`).\n if (options.web === false) {\n await startTestServerPhase(ConnectorLifecyclePhase.Early);\n } else {\n await connectorsManager.startPhase(ConnectorLifecyclePhase.Early);\n }\n\n // Fakes before app modules load, so module boot code already sees them.\n await installTestFakes(options.fakes);\n\n // Load application modules (their boot side-effects now see a live DB).\n await filesOrchestrator.moduleLoader.loadAll();\n\n const portMode = await applyTestServerPort(options.port);\n const readyReportBefore = getHttpReadyReport();\n\n // A rejecting validator (Application.onValidateBoot) must abort boot\n // before late-phase connectors bind a port — same slot as\n // `DevelopmentServer.start()` and the generated production `app.ts`.\n await Application.runStartupValidators();\n\n // Late-phase connectors (http, socket) bind after app code has\n // registered its routes and listeners.\n if (options.web === false) {\n await startTestServerPhase(ConnectorLifecyclePhase.Late);\n } else {\n await connectorsManager.startPhase(ConnectorLifecyclePhase.Late);\n }\n\n if (portMode === \"ephemeral\") {\n publishEphemeralPort(readyReportBefore);\n }\n\n isServerRunning = true;\n } catch (error) {\n // This function owns the connectors it starts, so a failure part-way\n // through has to leave nothing behind. Without this, `isServerRunning` was\n // still `false` — it is only set on the last line — so `globalTeardown`'s\n // `stopHttpTestServer()` reported \"No server to stop\" and walked away from\n // live early-phase connectors and a published port that outlived them.\n await unwindPartialStartup();\n\n // Rethrown unchanged: the startup failure is the one the caller needs to\n // read. A cleanup failure that replaced it would hide the actual cause.\n throw error;\n }\n}\n\n/**\n * Best-effort teardown of whatever a failed {@link startHttpTestServer} managed\n * to start.\n *\n * Every step is independent and none may throw: this runs while an error is\n * already in flight, and the caller is about to rethrow it.\n */\nasync function unwindPartialStartup(): Promise<void> {\n try {\n await restoreTestFakes();\n } catch (fakesError) {\n console.error(\n \"[test-server] Restoring the test fakes after a failed start did not complete:\",\n fakesError,\n );\n }\n\n try {\n await connectorsManager.shutdown();\n } catch (shutdownError) {\n // Reported, not thrown — it is secondary to the startup error being\n // rethrown, and losing that one to this would be the worse outcome.\n console.error(\"[test-server] Cleanup after a failed start did not complete:\", shutdownError);\n }\n\n withdrawTestServerPort();\n isServerRunning = false;\n}\n\n/**\n * Stop the HTTP test server\n * Call this in Vitest's globalTeardown\n */\nexport async function stopHttpTestServer(): Promise<void> {\n if (!isServerRunning) {\n console.log(\"[test-server] No server to stop\");\n return;\n }\n\n try {\n try {\n await restoreTestFakes();\n } catch (fakesError) {\n console.error(\"[test-server] Restoring the test fakes did not complete:\", fakesError);\n }\n\n await connectorsManager.shutdown();\n\n console.log(\"[test-server] HTTP test server stopped\");\n } catch (error) {\n // Surfaced, never swallowed — cleaning up is not the same as the shutdown\n // having succeeded, and a suite whose teardown failed should say so.\n console.error(\"[test-server] Error stopping HTTP server:\", error);\n\n throw error;\n } finally {\n // In a `finally` rather than after the `await`: when `shutdown()` threw,\n // the published port survived the server it pointed at, so the next run in\n // the same process inherited a stale one and sent every request to it.\n withdrawTestServerPort();\n\n isServerRunning = false;\n }\n}\n\n/**\n * Check if test server is running\n */\nexport function isTestServerRunning(): boolean {\n return isServerRunning;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAI,kBAAkB;;;;;;;;AA+CtB,eAAe,qBAAqB,OAA+C;CACjF,MAAM,aAAa,kBAChB,KAAK,CAAC,CACN,QAAQ,cAAc,UAAU,mBAAmB,KAAK,CAAC,CACzD,QAAQ,cAAc,UAAU,SAAS,KAAK;CAEjD,KAAK,MAAM,aAAa,YACtB,MAAM,UAAU,KAAK;CAGvB,KAAK,MAAM,aAAa,YACtB,MAAM,UAAU,MAAM;AAE1B;;;;;;;;;;;;AAaA,eAAe,oBAAoB,MAA4D;CAG7F,IAAI,CAFeA,WAAO,IAAI,MAEhB,GAAG;EACf,IAAI,SAAS,QACX,MAAM,IAAI,MACR,+BAA+B,KAAK,2HACtC;EAGF,OAAO;CACT;CAEA,IAAI,SAAS,QACX,WAAO,IAAI,aAAa,IAAI;CAG9B,MAAM,eAAeA,WAAO,IAAI,WAAW;CAa3C,IAAI,OAAO,iBAAiB,UAC1B,MAAM,IAAI,MACR,wDAAwD,KAAK,UAAU,YAAY,EAAE,sRACvF;CAQF,IAAI,iBAAiB,GACnB,OAAO;CAGT,IAAI,eAAe,GACjB,MAAM,IAAI,MACR,4CAA4C,aAAa,kGAC3D;CAGF,MAAM,sBAAsB,cAAcA,WAAO,IAAI,WAAW,KAAK,WAAW;CAEhF,sBAAsB,YAAY;CAElC,OAAO;AACT;;;;;;;;AASA,SAAS,qBAAqB,QAAqD;CACjF,MAAM,SAAS,mBAAmB;CAElC,IAAI,CAAC,UAAU,WAAW,UAAU,OAAO,QAAQ,GACjD,MAAM,IAAI,MACR,+OACF;CAGF,sBAAsB,OAAO,IAAI;AACnC;;;;;;;;;;;;;AAcA,eAAsB,oBAAoB,UAAsC,CAAC,GAAkB;CACjG,MAAM,kBAAkB,QAAQ,IAAI;CAEpC,IAAI,oBAAoB,QACtB,QAAQ,IAAI,WAAW;MAClB,IAAI,oBAAoB,QAC7B,MAAM,IAAI,MACR,yEAAyE,KAAK,UAAU,eAAe,EAAE,qDAC3G;CAGF,IAAI,iBAAiB;EACnB,QAAQ,IAAI,sDAAsD;EAClE;CACF;CAEA,QAAQ,IAAI,4CAA4C;CAExD,IAAI;EAGF,MAAM,qBAAqB;EAG3B,YAAY,mBAAmB,aAAa;EAC5C,YAAY,eAAe,MAAM;EAGjC,MAAM,qBAAqB,KAAK;EAChC,MAAM,UAAU;EAGhB,MAAM,kBAAkB,KAAK;EAC7B,MAAM,kBAAkB,cAAc;EAGtC,MAAM,gBAAgB,IAAI;EAO1B,IAAI,QAAQ,QAAQ,OAClB,MAAM,4BAAkD;OAExD,MAAM,kBAAkB,kBAAwC;EAIlE,MAAM,iBAAiB,QAAQ,KAAK;EAGpC,MAAM,kBAAkB,aAAa,QAAQ;EAE7C,MAAM,WAAW,MAAM,oBAAoB,QAAQ,IAAI;EACvD,MAAM,oBAAoB,mBAAmB;EAK7C,MAAM,YAAY,qBAAqB;EAIvC,IAAI,QAAQ,QAAQ,OAClB,MAAM,2BAAiD;OAEvD,MAAM,kBAAkB,iBAAuC;EAGjE,IAAI,aAAa,aACf,qBAAqB,iBAAiB;EAGxC,kBAAkB;CACpB,SAAS,OAAO;EAMd,MAAM,qBAAqB;EAI3B,MAAM;CACR;AACF;;;;;;;;AASA,eAAe,uBAAsC;CACnD,IAAI;EACF,MAAM,iBAAiB;CACzB,SAAS,YAAY;EACnB,QAAQ,MACN,iFACA,UACF;CACF;CAEA,IAAI;EACF,MAAM,kBAAkB,SAAS;CACnC,SAAS,eAAe;EAGtB,QAAQ,MAAM,gEAAgE,aAAa;CAC7F;CAEA,uBAAuB;CACvB,kBAAkB;AACpB;;;;;AAMA,eAAsB,qBAAoC;CACxD,IAAI,CAAC,iBAAiB;EACpB,QAAQ,IAAI,iCAAiC;EAC7C;CACF;CAEA,IAAI;EACF,IAAI;GACF,MAAM,iBAAiB;EACzB,SAAS,YAAY;GACnB,QAAQ,MAAM,4DAA4D,UAAU;EACtF;EAEA,MAAM,kBAAkB,SAAS;EAEjC,QAAQ,IAAI,wCAAwC;CACtD,SAAS,OAAO;EAGd,QAAQ,MAAM,6CAA6C,KAAK;EAEhE,MAAM;CACR,UAAU;EAIR,uBAAuB;EAEvB,kBAAkB;CACpB;AACF;;;;AAKA,SAAgB,sBAA+B;CAC7C,OAAO;AACT"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConnectorName } from "../connectors/types.mjs";
|
|
2
|
+
import "../connectors/index.mjs";
|
|
2
3
|
//#region ../../packages/core/src/tests/test-connectors-selection.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* What a test runtime was asked to start.
|
|
@@ -8,7 +9,6 @@ import { ConnectorName } from "../connectors/types.mjs";
|
|
|
8
9
|
* - an array — start exactly those. Order is not promised; lifecycle priority
|
|
9
10
|
* decides the real boot/shutdown order.
|
|
10
11
|
*/
|
|
11
|
-
type TestConnectorsSelection = boolean | ConnectorName[];
|
|
12
|
+
export type TestConnectorsSelection = boolean | ConnectorName[];
|
|
12
13
|
//#endregion
|
|
13
|
-
export { TestConnectorsSelection };
|
|
14
14
|
//# sourceMappingURL=test-connectors-selection.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-connectors-selection.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/test-connectors-selection.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-connectors-selection.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/test-connectors-selection.ts"],"mappings":";;;;;;;;;;;YAqBY,oCAAoC"}
|
|
@@ -68,5 +68,5 @@ function describeConnectorsSelection(selection) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
//#endregion
|
|
71
|
-
export { describeConnectorsSelection, isSameConnectorsSelection, normalizeConnectorNames, readRequestedConnectors, resolveEffectiveConnectors };
|
|
71
|
+
export { describeConnectorsSelection, isSameConnectorsSelection, normalizeConnectorNames, readConfiguredConnectors, readRequestedConnectors, resolveEffectiveConnectors };
|
|
72
72
|
//# sourceMappingURL=test-connectors-selection.mjs.map
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Get the test server base URL
|
|
9
9
|
*/
|
|
10
|
-
declare function getTestServerUrl(): string;
|
|
10
|
+
export declare function getTestServerUrl(): string;
|
|
11
11
|
/**
|
|
12
12
|
* Simple HTTP request helper for test server
|
|
13
13
|
* Uses native fetch - lightweight, no extra dependencies
|
|
14
14
|
*/
|
|
15
|
-
declare function testRequest(path: string, options?: RequestInit): Promise<Response>;
|
|
15
|
+
export declare function testRequest(path: string, options?: RequestInit): Promise<Response>;
|
|
16
16
|
/** The request helpers, bound to one server. */
|
|
17
|
-
type TestRequestClient = {
|
|
17
|
+
export type TestRequestClient = {
|
|
18
18
|
request(path: string, options?: RequestInit): Promise<Response>;
|
|
19
19
|
get(path: string, options?: RequestInit): Promise<Response>;
|
|
20
20
|
post(path: string, body?: unknown, options?: RequestInit): Promise<Response>;
|
|
@@ -31,35 +31,34 @@ type TestRequestClient = {
|
|
|
31
31
|
* const client = createTestRequestClient("http://127.0.0.1:4100");
|
|
32
32
|
* await client.post("/posts", { title: "Hello" });
|
|
33
33
|
*/
|
|
34
|
-
declare function createTestRequestClient(baseUrl: string | (() => string)): TestRequestClient;
|
|
34
|
+
export declare function createTestRequestClient(baseUrl: string | (() => string)): TestRequestClient;
|
|
35
35
|
/**
|
|
36
36
|
* GET request helper
|
|
37
37
|
*/
|
|
38
|
-
declare function testGet(path: string, options?: RequestInit): Promise<Response>;
|
|
38
|
+
export declare function testGet(path: string, options?: RequestInit): Promise<Response>;
|
|
39
39
|
/**
|
|
40
40
|
* POST request helper
|
|
41
41
|
*/
|
|
42
|
-
declare function testPost(path: string, body?: unknown, options?: RequestInit): Promise<Response>;
|
|
42
|
+
export declare function testPost(path: string, body?: unknown, options?: RequestInit): Promise<Response>;
|
|
43
43
|
/**
|
|
44
44
|
* PUT request helper
|
|
45
45
|
*/
|
|
46
|
-
declare function testPut(path: string, body?: unknown, options?: RequestInit): Promise<Response>;
|
|
46
|
+
export declare function testPut(path: string, body?: unknown, options?: RequestInit): Promise<Response>;
|
|
47
47
|
/**
|
|
48
48
|
* DELETE request helper
|
|
49
49
|
*/
|
|
50
|
-
declare function testDelete(path: string, options?: RequestInit): Promise<Response>;
|
|
50
|
+
export declare function testDelete(path: string, options?: RequestInit): Promise<Response>;
|
|
51
51
|
/**
|
|
52
52
|
* PATCH request helper
|
|
53
53
|
*/
|
|
54
|
-
declare function testPatch(path: string, body?: unknown, options?: RequestInit): Promise<Response>;
|
|
54
|
+
export declare function testPatch(path: string, body?: unknown, options?: RequestInit): Promise<Response>;
|
|
55
55
|
/**
|
|
56
56
|
* Parse JSON response with type safety
|
|
57
57
|
*/
|
|
58
|
-
declare function parseJsonResponse<T>(response: Response): Promise<T>;
|
|
58
|
+
export declare function parseJsonResponse<T>(response: Response): Promise<T>;
|
|
59
59
|
/**
|
|
60
60
|
* Assert response status and return parsed JSON
|
|
61
61
|
*/
|
|
62
|
-
declare function expectJson<T>(response: Response, expectedStatus?: number): Promise<T>;
|
|
62
|
+
export declare function expectJson<T>(response: Response, expectedStatus?: number): Promise<T>;
|
|
63
63
|
//#endregion
|
|
64
|
-
export { TestRequestClient, createTestRequestClient, expectJson, getTestServerUrl, parseJsonResponse, testDelete, testGet, testPatch, testPost, testPut, testRequest };
|
|
65
64
|
//# sourceMappingURL=test-helpers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/test-helpers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-helpers.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/test-helpers.ts"],"mappings":";;;;;;;;;wBAagB;;;;;wBA6BM,YAAY,cAAc,UAAS,cAAmB,QAAQ;;YA8CxE;EACV,QAAQ,cAAc,UAAU,cAAc,QAAQ;EACtD,IAAI,cAAc,UAAU,cAAc,QAAQ;EAClD,KAAK,cAAc,gBAAgB,UAAU,cAAc,QAAQ;EACnE,IAAI,cAAc,gBAAgB,UAAU,cAAc,QAAQ;EAClE,MAAM,cAAc,gBAAgB,UAAU,cAAc,QAAQ;EACpE,OAAO,cAAc,UAAU,cAAc,QAAQ;;;;;;;;;;;wBAYvC,wBAAwB,mCAAmC;;;;wBAqBrD,QAAQ,cAAc,UAAS,cAAmB,QAAQ;;;;wBAO1D,SACpB,cACA,gBACA,UAAS,cACR,QAAQ;;;;wBAOW,QACpB,cACA,gBACA,UAAS,cACR,QAAQ;;;;wBAOW,WAAW,cAAc,UAAS,cAAmB,QAAQ;;;;wBAO7D,UACpB,cACA,gBACA,UAAS,cACR,QAAQ;;;;wBAOW,kBAAkB,GAAG,UAAU,WAAW,QAAQ;;;;wBAOlD,WAAW,GAAG,UAAU,UAAU,0BAAuB,QAAQ"}
|
|
@@ -3,9 +3,8 @@ import { Router } from "../router/router.mjs";
|
|
|
3
3
|
import { TestRequestClient } from "./test-helpers.mjs";
|
|
4
4
|
import { AuthenticatedTestClient, TestAuthenticableUser } from "./authenticated-test-client.mjs";
|
|
5
5
|
import { AppModuleImporter } from "../loader/app-module-importer.mjs";
|
|
6
|
-
|
|
7
6
|
//#region ../../packages/core/src/tests/test-http-server.d.ts
|
|
8
|
-
type CreateTestHttpServerOptions = {
|
|
7
|
+
export type CreateTestHttpServerOptions = {
|
|
9
8
|
/**
|
|
10
9
|
* Register routes for this server, exactly as a `routes.ts` would. They are
|
|
11
10
|
* tagged with a source of their own and removed again by `close()`.
|
|
@@ -22,14 +21,20 @@ type CreateTestHttpServerOptions = {
|
|
|
22
21
|
* `(file) => import(file)` from the test file, as `setupTest()` takes it, so
|
|
23
22
|
* app classes are the same ones the test imports.
|
|
24
23
|
*/
|
|
25
|
-
importModule?: AppModuleImporter;
|
|
24
|
+
importModule?: AppModuleImporter;
|
|
25
|
+
/** Interface to bind. Defaults to `127.0.0.1`. */
|
|
26
26
|
host?: string;
|
|
27
27
|
};
|
|
28
|
-
type TestHttpServer = TestRequestClient & {
|
|
29
|
-
/** `http://127.0.0.1:<port>` */
|
|
30
|
-
readonly
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
export type TestHttpServer = TestRequestClient & {
|
|
29
|
+
/** `http://127.0.0.1:<port>` */
|
|
30
|
+
readonly url: string;
|
|
31
|
+
/** The port the OS assigned. */
|
|
32
|
+
readonly port: number;
|
|
33
|
+
/** The Fastify instance, for `inject()` or anything else Fastify offers. */
|
|
34
|
+
readonly server: FastifyInstance;
|
|
35
|
+
/** A client for this server, signed in as `user` with a real access token. */
|
|
36
|
+
actingAs(user: TestAuthenticableUser): Promise<AuthenticatedTestClient>;
|
|
37
|
+
/** Stop listening and remove the routes `routes` registered. */
|
|
33
38
|
close(): Promise<void>;
|
|
34
39
|
};
|
|
35
40
|
/**
|
|
@@ -56,7 +61,6 @@ type TestHttpServer = TestRequestClient & {
|
|
|
56
61
|
* await app.post("/contact", { email: "ada@example.test", message: "Hi" });
|
|
57
62
|
* mailFake.assertSent({ to: "support@example.test" });
|
|
58
63
|
*/
|
|
59
|
-
declare function createTestHttpServer(options?: CreateTestHttpServerOptions): Promise<TestHttpServer>;
|
|
64
|
+
export declare function createTestHttpServer(options?: CreateTestHttpServerOptions): Promise<TestHttpServer>;
|
|
60
65
|
//#endregion
|
|
61
|
-
export { CreateTestHttpServerOptions, TestHttpServer, createTestHttpServer };
|
|
62
66
|
//# sourceMappingURL=test-http-server.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-http-server.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/test-http-server.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"test-http-server.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/test-http-server.ts"],"mappings":";;;;;;YA+BY;;;;;EAKV,UAAU,QAAQ;;;;;;EAMlB;;;;;;EAMA,eAAe;;EAEf;;YAGU,iBAAiB;;WAElB;;WAEA;;WAEA,QAAQ;;EAEjB,SAAS,MAAM,wBAAwB,QAAQ;;EAE/C,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;wBAmEW,qBACpB,UAAS,8BACR,QAAQ"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { TestFakesSelection } from "./fakes/test-fakes.mjs";
|
|
2
2
|
import { AppModuleImporter } from "../loader/app-module-importer.mjs";
|
|
3
3
|
import { TestConnectorsSelection } from "./test-connectors-selection.mjs";
|
|
4
|
-
|
|
5
4
|
//#region ../../packages/core/src/tests/vitest-setup.d.ts
|
|
6
|
-
type TestSetupOptions = {
|
|
5
|
+
export type TestSetupOptions = {
|
|
7
6
|
/**
|
|
8
7
|
* Which connectors to start.
|
|
9
8
|
*
|
|
@@ -37,12 +36,12 @@ type TestSetupOptions = {
|
|
|
37
36
|
/**
|
|
38
37
|
* Warn — once per process — that app modules are loaded outside Vitest's graph.
|
|
39
38
|
*/
|
|
40
|
-
declare function warnMissingImportModule(importModule: AppModuleImporter | undefined): void;
|
|
39
|
+
export declare function warnMissingImportModule(importModule: AppModuleImporter | undefined): void;
|
|
41
40
|
/**
|
|
42
41
|
* Raised by the lifecycle itself, never by the runtime it manages — a conflict
|
|
43
42
|
* between two calls, or a refusal to reuse a runtime that did not close.
|
|
44
43
|
*/
|
|
45
|
-
declare class TestLifecycleError extends Error {
|
|
44
|
+
export declare class TestLifecycleError extends Error {
|
|
46
45
|
constructor(message: string);
|
|
47
46
|
}
|
|
48
47
|
/**
|
|
@@ -72,7 +71,7 @@ declare class TestLifecycleError extends Error {
|
|
|
72
71
|
* // bootstrap only — no connectors, whatever config says
|
|
73
72
|
* await setupTest({ connectors: false });
|
|
74
73
|
*/
|
|
75
|
-
declare function setupTest(options?: TestSetupOptions): Promise<void>;
|
|
74
|
+
export declare function setupTest(options?: TestSetupOptions): Promise<void>;
|
|
76
75
|
/**
|
|
77
76
|
* Shut the test runtime down and release the lifecycle.
|
|
78
77
|
*
|
|
@@ -90,7 +89,7 @@ declare function setupTest(options?: TestSetupOptions): Promise<void>;
|
|
|
90
89
|
* `connectorsManager.shutdown()`, so they never reach this function and never
|
|
91
90
|
* poison anything. This lifecycle can only surface what that layer reports.
|
|
92
91
|
*/
|
|
93
|
-
declare function teardownTest(): Promise<void>;
|
|
92
|
+
export declare function teardownTest(): Promise<void>;
|
|
94
93
|
//#endregion
|
|
95
|
-
export {
|
|
94
|
+
export type { TestConnectorsSelection };
|
|
96
95
|
//# sourceMappingURL=vitest-setup.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest-setup.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/vitest-setup.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"vitest-setup.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/tests/vitest-setup.ts"],"mappings":";;;;YAqDY;;;;;;;;;EASV,aAAa;;;;;;;;;;EAUb,eAAe;;;;;;;;;;EAUf,QAAQ;;;;;wBAQM,wBAAwB,cAAc;;;;;qBAkBzC,2BAA2B;EACtC,YAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqCC,UAAU,UAAU,mBAAmB;;;;;;;;;;;;;;;;;;wBA0DvC,gBAAgB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region ../../packages/core/src/tooling/agents-md/agents-md-markers.d.ts
|
|
2
2
|
/** The file `warlock agents-md --write` and `warlock dev` maintain, at the project root. */
|
|
3
|
-
declare const AGENTS_MD_FILE = "AGENTS.md";
|
|
3
|
+
export declare const AGENTS_MD_FILE = "AGENTS.md";
|
|
4
4
|
/** Opens the generated section. Everything outside the two markers is hand-written. */
|
|
5
|
-
declare const AGENTS_MD_START = "<!-- warlock:generated:start -->";
|
|
5
|
+
export declare const AGENTS_MD_START = "<!-- warlock:generated:start -->";
|
|
6
6
|
/** Closes the generated section. */
|
|
7
|
-
declare const AGENTS_MD_END = "<!-- warlock:generated:end -->";
|
|
7
|
+
export declare const AGENTS_MD_END = "<!-- warlock:generated:end -->";
|
|
8
8
|
/**
|
|
9
9
|
* Put `section` between the generated-section markers of `existing`.
|
|
10
10
|
*
|
|
@@ -21,7 +21,6 @@ declare const AGENTS_MD_END = "<!-- warlock:generated:end -->";
|
|
|
21
21
|
* @param existing The current file content, or `undefined` when the file does not exist.
|
|
22
22
|
* @param section The generated markdown, without markers.
|
|
23
23
|
*/
|
|
24
|
-
declare function upsertGeneratedSection(existing: string | undefined, section: string): string;
|
|
24
|
+
export declare function upsertGeneratedSection(existing: string | undefined, section: string): string;
|
|
25
25
|
//#endregion
|
|
26
|
-
export { AGENTS_MD_END, AGENTS_MD_FILE, AGENTS_MD_START, upsertGeneratedSection };
|
|
27
26
|
//# sourceMappingURL=agents-md-markers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md-markers.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/agents-md/agents-md-markers.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"agents-md-markers.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/agents-md/agents-md-markers.ts"],"mappings":";;qBAGa;;qBAGA;;qBAGA;;;;;;;;;;;;;;;;;wBAoCG,uBAAuB,8BAA8B"}
|
|
@@ -39,7 +39,8 @@ function lineBreakOf(text) {
|
|
|
39
39
|
*/
|
|
40
40
|
function upsertGeneratedSection(existing, section) {
|
|
41
41
|
const eol = existing === void 0 ? "\n" : lineBreakOf(existing);
|
|
42
|
-
const
|
|
42
|
+
const body = section.replace(/\r?\n/g, eol).replace(/(?:\r?\n)+$/, "");
|
|
43
|
+
const block = `${AGENTS_MD_START}${eol}${body}${eol}${AGENTS_MD_END}`;
|
|
43
44
|
if (existing === void 0) return `${block}${eol}`;
|
|
44
45
|
const starts = occurrences(existing, AGENTS_MD_START);
|
|
45
46
|
const ends = occurrences(existing, AGENTS_MD_END);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md-markers.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/agents-md/agents-md-markers.ts"],"sourcesContent":["import { WarlockError } from \"../../errors/warlock-error\";\n\n/** The file `warlock agents-md --write` and `warlock dev` maintain, at the project root. */\nexport const AGENTS_MD_FILE = \"AGENTS.md\";\n\n/** Opens the generated section. Everything outside the two markers is hand-written. */\nexport const AGENTS_MD_START = \"<!-- warlock:generated:start -->\";\n\n/** Closes the generated section. */\nexport const AGENTS_MD_END = \"<!-- warlock:generated:end -->\";\n\n/** Every index at which `needle` occurs in `text`. */\nfunction occurrences(text: string, needle: string): number[] {\n const found: number[] = [];\n let index = text.indexOf(needle);\n\n while (index !== -1) {\n found.push(index);\n index = text.indexOf(needle, index + needle.length);\n }\n\n return found;\n}\n\n/** The line break the file already uses, so an inserted section matches it. */\nfunction lineBreakOf(text: string): string {\n return text.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n}\n\n/**\n * Put `section` between the generated-section markers of `existing`.\n *\n * - `existing` undefined (no file): the markers and the section, alone.\n * - no markers: the existing text unchanged, then a blank line, then the\n * markers and the section at the end.\n * - one start marker followed by one end marker: only the bytes between them\n * are replaced; the markers and everything outside them stay byte-for-byte.\n *\n * Throws `WL7501` when the markers are malformed (one without the other, a\n * duplicate, or the end before the start) — rather than guess which part is\n * hand-written.\n *\n * @param existing The current file content, or `undefined` when the file does not exist.\n * @param section The generated markdown, without markers.\n */\nexport function upsertGeneratedSection(existing: string | undefined, section: string): string {\n const eol = existing === undefined ? \"\\n\" : lineBreakOf(existing);\n const body = section.replace(/\\r?\\n/g, eol).replace(/(?:\\r?\\n)+$/, \"\");\n const block = `${AGENTS_MD_START}${eol}${body}${eol}${AGENTS_MD_END}`;\n\n if (existing === undefined) return `${block}${eol}`;\n\n const starts = occurrences(existing, AGENTS_MD_START);\n const ends = occurrences(existing, AGENTS_MD_END);\n\n if (starts.length === 0 && ends.length === 0) {\n if (existing.length === 0) return `${block}${eol}`;\n\n const separator = existing.endsWith(eol) ? eol : `${eol}${eol}`;\n\n return `${existing}${separator}${block}${eol}`;\n }\n\n const [start] = starts;\n const [end] = ends;\n\n if (starts.length !== 1 || ends.length !== 1 || start === undefined || end === undefined) {\n throw new WarlockError(\n \"WL7501\",\n `AGENTS.md has ${starts.length} \"${AGENTS_MD_START}\" and ${ends.length} \"${AGENTS_MD_END}\" marker(s); expected exactly one of each. Fix the markers by hand — nothing was written.`,\n );\n }\n\n if (end < start) {\n throw new WarlockError(\n \"WL7501\",\n `AGENTS.md has \"${AGENTS_MD_END}\" before \"${AGENTS_MD_START}\". Fix the markers by hand — nothing was written.`,\n );\n }\n\n return `${existing.slice(0, start)}${block}${existing.slice(end + AGENTS_MD_END.length)}`;\n}\n"],"mappings":";;;;AAGA,MAAa,iBAAiB;;AAG9B,MAAa,kBAAkB;;AAG/B,MAAa,gBAAgB;;AAG7B,SAAS,YAAY,MAAc,QAA0B;CAC3D,MAAM,QAAkB,CAAC;CACzB,IAAI,QAAQ,KAAK,QAAQ,MAAM;CAE/B,OAAO,UAAU,IAAI;EACnB,MAAM,KAAK,KAAK;EAChB,QAAQ,KAAK,QAAQ,QAAQ,QAAQ,OAAO,MAAM;CACpD;CAEA,OAAO;AACT;;AAGA,SAAS,YAAY,MAAsB;CACzC,OAAO,KAAK,SAAS,MAAM,IAAI,SAAS;AAC1C;;;;;;;;;;;;;;;;;AAkBA,SAAgB,uBAAuB,UAA8B,SAAyB;CAC5F,MAAM,MAAM,aAAa,SAAY,OAAO,YAAY,QAAQ;
|
|
1
|
+
{"version":3,"file":"agents-md-markers.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/agents-md/agents-md-markers.ts"],"sourcesContent":["import { WarlockError } from \"../../errors/warlock-error\";\n\n/** The file `warlock agents-md --write` and `warlock dev` maintain, at the project root. */\nexport const AGENTS_MD_FILE = \"AGENTS.md\";\n\n/** Opens the generated section. Everything outside the two markers is hand-written. */\nexport const AGENTS_MD_START = \"<!-- warlock:generated:start -->\";\n\n/** Closes the generated section. */\nexport const AGENTS_MD_END = \"<!-- warlock:generated:end -->\";\n\n/** Every index at which `needle` occurs in `text`. */\nfunction occurrences(text: string, needle: string): number[] {\n const found: number[] = [];\n let index = text.indexOf(needle);\n\n while (index !== -1) {\n found.push(index);\n index = text.indexOf(needle, index + needle.length);\n }\n\n return found;\n}\n\n/** The line break the file already uses, so an inserted section matches it. */\nfunction lineBreakOf(text: string): string {\n return text.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n}\n\n/**\n * Put `section` between the generated-section markers of `existing`.\n *\n * - `existing` undefined (no file): the markers and the section, alone.\n * - no markers: the existing text unchanged, then a blank line, then the\n * markers and the section at the end.\n * - one start marker followed by one end marker: only the bytes between them\n * are replaced; the markers and everything outside them stay byte-for-byte.\n *\n * Throws `WL7501` when the markers are malformed (one without the other, a\n * duplicate, or the end before the start) — rather than guess which part is\n * hand-written.\n *\n * @param existing The current file content, or `undefined` when the file does not exist.\n * @param section The generated markdown, without markers.\n */\nexport function upsertGeneratedSection(existing: string | undefined, section: string): string {\n const eol = existing === undefined ? \"\\n\" : lineBreakOf(existing);\n const body = section.replace(/\\r?\\n/g, eol).replace(/(?:\\r?\\n)+$/, \"\");\n const block = `${AGENTS_MD_START}${eol}${body}${eol}${AGENTS_MD_END}`;\n\n if (existing === undefined) return `${block}${eol}`;\n\n const starts = occurrences(existing, AGENTS_MD_START);\n const ends = occurrences(existing, AGENTS_MD_END);\n\n if (starts.length === 0 && ends.length === 0) {\n if (existing.length === 0) return `${block}${eol}`;\n\n const separator = existing.endsWith(eol) ? eol : `${eol}${eol}`;\n\n return `${existing}${separator}${block}${eol}`;\n }\n\n const [start] = starts;\n const [end] = ends;\n\n if (starts.length !== 1 || ends.length !== 1 || start === undefined || end === undefined) {\n throw new WarlockError(\n \"WL7501\",\n `AGENTS.md has ${starts.length} \"${AGENTS_MD_START}\" and ${ends.length} \"${AGENTS_MD_END}\" marker(s); expected exactly one of each. Fix the markers by hand — nothing was written.`,\n );\n }\n\n if (end < start) {\n throw new WarlockError(\n \"WL7501\",\n `AGENTS.md has \"${AGENTS_MD_END}\" before \"${AGENTS_MD_START}\". Fix the markers by hand — nothing was written.`,\n );\n }\n\n return `${existing.slice(0, start)}${block}${existing.slice(end + AGENTS_MD_END.length)}`;\n}\n"],"mappings":";;;;AAGA,MAAa,iBAAiB;;AAG9B,MAAa,kBAAkB;;AAG/B,MAAa,gBAAgB;;AAG7B,SAAS,YAAY,MAAc,QAA0B;CAC3D,MAAM,QAAkB,CAAC;CACzB,IAAI,QAAQ,KAAK,QAAQ,MAAM;CAE/B,OAAO,UAAU,IAAI;EACnB,MAAM,KAAK,KAAK;EAChB,QAAQ,KAAK,QAAQ,QAAQ,QAAQ,OAAO,MAAM;CACpD;CAEA,OAAO;AACT;;AAGA,SAAS,YAAY,MAAsB;CACzC,OAAO,KAAK,SAAS,MAAM,IAAI,SAAS;AAC1C;;;;;;;;;;;;;;;;;AAkBA,SAAgB,uBAAuB,UAA8B,SAAyB;CAC5F,MAAM,MAAM,aAAa,SAAY,OAAO,YAAY,QAAQ;CAChE,MAAM,OAAO,QAAQ,QAAQ,UAAU,GAAG,CAAC,CAAC,QAAQ,eAAe,EAAE;CACrE,MAAM,QAAQ,GAAG,kBAAkB,MAAM,OAAO,MAAM;CAEtD,IAAI,aAAa,QAAW,OAAO,GAAG,QAAQ;CAE9C,MAAM,SAAS,YAAY,UAAU,eAAe;CACpD,MAAM,OAAO,YAAY,UAAU,aAAa;CAEhD,IAAI,OAAO,WAAW,KAAK,KAAK,WAAW,GAAG;EAC5C,IAAI,SAAS,WAAW,GAAG,OAAO,GAAG,QAAQ;EAI7C,OAAO,GAAG,WAFQ,SAAS,SAAS,GAAG,IAAI,MAAM,GAAG,MAAM,QAEzB,QAAQ;CAC3C;CAEA,MAAM,CAAC,SAAS;CAChB,MAAM,CAAC,OAAO;CAEd,IAAI,OAAO,WAAW,KAAK,KAAK,WAAW,KAAK,UAAU,UAAa,QAAQ,QAC7E,MAAM,IAAI,aACR,UACA,iBAAiB,OAAO,OAAO,IAAI,gBAAgB,QAAQ,KAAK,OAAO,IAAI,cAAc,0FAC3F;CAGF,IAAI,MAAM,OACR,MAAM,IAAI,aACR,UACA,kBAAkB,cAAc,YAAY,gBAAgB,kDAC9D;CAGF,OAAO,GAAG,SAAS,MAAM,GAAG,KAAK,IAAI,QAAQ,SAAS,MAAM,MAAM,EAAoB;AACxF"}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { InspectReport } from "../inspect/inspect-report.types.mjs";
|
|
2
2
|
import { WriteAgentsMdResult } from "./write-agents-md.mjs";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/tooling/agents-md/agents-md-refresher.d.ts
|
|
5
4
|
/** Options of {@link createAgentsMdRefresher}. */
|
|
6
|
-
type AgentsMdRefresherOptions = {
|
|
7
|
-
/** Project root. Default: `process.cwd()`. */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export type AgentsMdRefresherOptions = {
|
|
6
|
+
/** Project root. Default: `process.cwd()`. */
|
|
7
|
+
cwd?: string;
|
|
8
|
+
/** Produce a fresh report (the dev server calls `inspectApp()` in-process). */
|
|
9
|
+
collect: () => Promise<InspectReport>;
|
|
10
|
+
/** Quiet period after the last `schedule()` before a refresh runs. Default: 1000 ms. */
|
|
11
|
+
debounceMs?: number;
|
|
12
|
+
/** Create AGENTS.md when it is missing. Default: `true`. */
|
|
13
|
+
create?: boolean;
|
|
14
|
+
/** Called with each refresh's result. */
|
|
15
|
+
onWrite?: (result: WriteAgentsMdResult) => void;
|
|
16
|
+
/** Called when a refresh fails; the error never escapes the timer. */
|
|
12
17
|
onError?: (error: unknown) => void;
|
|
13
18
|
};
|
|
14
19
|
/** A debounced AGENTS.md refresher. */
|
|
15
|
-
type AgentsMdRefresher = {
|
|
16
|
-
/** Ask for a refresh; calls within `debounceMs` of each other collapse into one. */
|
|
17
|
-
|
|
20
|
+
export type AgentsMdRefresher = {
|
|
21
|
+
/** Ask for a refresh; calls within `debounceMs` of each other collapse into one. */
|
|
22
|
+
schedule(): void;
|
|
23
|
+
/** Run a pending (or, with none pending, a fresh) refresh now and wait for it. */
|
|
24
|
+
flush(): Promise<void>;
|
|
25
|
+
/** Cancel a pending refresh; later `schedule()` calls do nothing. */
|
|
18
26
|
dispose(): void;
|
|
19
27
|
};
|
|
20
28
|
/**
|
|
@@ -30,7 +38,6 @@ type AgentsMdRefresher = {
|
|
|
30
38
|
* });
|
|
31
39
|
* refresher.schedule();
|
|
32
40
|
*/
|
|
33
|
-
declare function createAgentsMdRefresher(options: AgentsMdRefresherOptions): AgentsMdRefresher;
|
|
41
|
+
export declare function createAgentsMdRefresher(options: AgentsMdRefresherOptions): AgentsMdRefresher;
|
|
34
42
|
//#endregion
|
|
35
|
-
export { AgentsMdRefresher, AgentsMdRefresherOptions, createAgentsMdRefresher };
|
|
36
43
|
//# sourceMappingURL=agents-md-refresher.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-md-refresher.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/agents-md/agents-md-refresher.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents-md-refresher.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/agents-md/agents-md-refresher.ts"],"mappings":";;;;YAIY;;EAEV;;EAEA,eAAe,QAAQ;;EAEvB;;EAEA;;EAEA,WAAW,QAAQ;;EAEnB,WAAW;;;YAID;;EAEV;;EAEA,SAAS;;EAET;;;;;;;;;;;;;;;wBAgBc,wBAAwB,SAAS,2BAA2B"}
|