@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
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { ToolingProblem } from "../problem.mjs";
|
|
2
|
-
|
|
3
2
|
//#region ../../packages/core/src/tooling/check/tests-step.d.ts
|
|
4
3
|
/** How a vitest run ended: its exit code, output, and the JSON report if one was written. */
|
|
5
|
-
type VitestRun = {
|
|
4
|
+
export type VitestRun = {
|
|
6
5
|
code: number | null;
|
|
7
6
|
signal: string | null;
|
|
8
7
|
stdout: string;
|
|
9
|
-
stderr: string;
|
|
8
|
+
stderr: string;
|
|
9
|
+
/** The `--reporter=json` report, parsed; `undefined` when none was written. */
|
|
10
10
|
report: unknown;
|
|
11
11
|
};
|
|
12
12
|
/** Runs the app's vitest with the given arguments. Injectable for tests. */
|
|
13
|
-
type VitestRunner = (binary: string, args: readonly string[], cwd: string) => Promise<VitestRun>;
|
|
13
|
+
export type VitestRunner = (binary: string, args: readonly string[], cwd: string) => Promise<VitestRun>;
|
|
14
14
|
/**
|
|
15
15
|
* The app's own vitest CLI entry, resolved from the app root — never a global
|
|
16
16
|
* install — or `undefined` when the app does not have vitest.
|
|
17
17
|
*/
|
|
18
|
-
declare function findVitest(cwd: string): string | undefined;
|
|
18
|
+
export declare function findVitest(cwd: string): string | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* The default {@link VitestRunner}: `node <vitest> <args> --reporter=json
|
|
21
21
|
* --outputFile=<tmp>`, reading the report back from the file so test output on
|
|
22
22
|
* stdout cannot corrupt it.
|
|
23
23
|
*/
|
|
24
|
-
declare const runVitest: VitestRunner;
|
|
24
|
+
export declare const runVitest: VitestRunner;
|
|
25
25
|
/**
|
|
26
26
|
* Turn vitest's JSON report (the Jest-compatible shape `--reporter=json`
|
|
27
27
|
* writes) into problems: a failed test is `WL7301`, a file that failed before
|
|
28
28
|
* its tests ran is `WL7302`, and a failure caused by an unreachable service or
|
|
29
29
|
* a busy port is the matching environment code instead.
|
|
30
30
|
*/
|
|
31
|
-
declare function parseVitestReport(report: unknown, cwd: string): ToolingProblem[];
|
|
31
|
+
export declare function parseVitestReport(report: unknown, cwd: string): ToolingProblem[];
|
|
32
32
|
//#endregion
|
|
33
|
-
export { VitestRun, VitestRunner, findVitest, parseVitestReport, runVitest };
|
|
34
33
|
//# sourceMappingURL=tests-step.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests-step.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/tests-step.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"tests-step.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/check/tests-step.ts"],"mappings":";;;YASY;EACV;EACA;EACA;EACA;;EAEA;;;YAIU,gBACV,gBACA,yBACA,gBACG,QAAQ;;;;;wBASG,WAAW;;;;;;qBA6Bd,WAAW;;;;;;;wBA0FR,kBAAkB,iBAAiB,cAAc"}
|
|
@@ -8,7 +8,7 @@ import os from "node:os";
|
|
|
8
8
|
|
|
9
9
|
//#region ../../packages/core/src/tooling/check/tests-step.ts
|
|
10
10
|
/** Ten minutes: a suite slower than that is reported as a crashed tool, not a failure. */
|
|
11
|
-
const TEST_TIMEOUT_MS =
|
|
11
|
+
const TEST_TIMEOUT_MS = 6e5;
|
|
12
12
|
/**
|
|
13
13
|
* The app's own vitest CLI entry, resolved from the app root — never a global
|
|
14
14
|
* install — or `undefined` when the app does not have vitest.
|
|
@@ -45,7 +45,7 @@ const runVitest = (binary, args, cwd) => {
|
|
|
45
45
|
encoding: "utf8",
|
|
46
46
|
windowsHide: true,
|
|
47
47
|
timeout: TEST_TIMEOUT_MS,
|
|
48
|
-
maxBuffer:
|
|
48
|
+
maxBuffer: 67108864,
|
|
49
49
|
env: {
|
|
50
50
|
...process.env,
|
|
51
51
|
CI: process.env.CI ?? "1"
|
|
@@ -173,5 +173,5 @@ function vitestRunFailure(run) {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
//#endregion
|
|
176
|
-
export { findVitest, parseVitestReport, runVitest, vitestArguments, vitestRunFailure };
|
|
176
|
+
export { environmentCodeOf, findVitest, parseVitestReport, runVitest, vitestArguments, vitestRunFailure };
|
|
177
177
|
//# sourceMappingURL=tests-step.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests-step.mjs","names":["relative"],"sources":["../../../../../../../../../packages/core/src/tooling/check/tests-step.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { existsSync, mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { errorCodeOf } from \"../../errors/error-codes\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\n\n/** How a vitest run ended: its exit code, output, and the JSON report if one was written. */\nexport type VitestRun = {\n code: number | null;\n signal: string | null;\n stdout: string;\n stderr: string;\n /** The `--reporter=json` report, parsed; `undefined` when none was written. */\n report: unknown;\n};\n\n/** Runs the app's vitest with the given arguments. Injectable for tests. */\nexport type VitestRunner = (\n binary: string,\n args: readonly string[],\n cwd: string,\n) => Promise<VitestRun>;\n\n/** Ten minutes: a suite slower than that is reported as a crashed tool, not a failure. */\nconst TEST_TIMEOUT_MS = 10 * 60 * 1000;\n\n/**\n * The app's own vitest CLI entry, resolved from the app root — never a global\n * install — or `undefined` when the app does not have vitest.\n */\nexport function findVitest(cwd: string): string | undefined {\n try {\n const require = createRequire(path.join(cwd, \"package.json\"));\n const manifestPath = require.resolve(\"vitest/package.json\");\n const manifest: unknown = JSON.parse(readFileSync(manifestPath, \"utf8\"));\n const bin =\n typeof manifest === \"object\" && manifest !== null ? Reflect.get(manifest, \"bin\") : undefined;\n const entry =\n typeof bin === \"string\"\n ? bin\n : typeof bin === \"object\" && bin !== null\n ? Reflect.get(bin, \"vitest\")\n : undefined;\n\n if (typeof entry !== \"string\") return undefined;\n\n const binary = path.resolve(path.dirname(manifestPath), entry);\n\n return existsSync(binary) ? binary : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The default {@link VitestRunner}: `node <vitest> <args> --reporter=json\n * --outputFile=<tmp>`, reading the report back from the file so test output on\n * stdout cannot corrupt it.\n */\nexport const runVitest: VitestRunner = (binary, args, cwd) => {\n const directory = mkdtempSync(path.join(os.tmpdir(), \"warlock-check-vitest-\"));\n const outputFile = path.join(directory, \"report.json\");\n\n return new Promise((resolve) => {\n execFile(\n process.execPath,\n [binary, ...args, \"--reporter=json\", `--outputFile=${outputFile}`],\n {\n cwd,\n encoding: \"utf8\",\n windowsHide: true,\n timeout: TEST_TIMEOUT_MS,\n maxBuffer: 64 * 1024 * 1024,\n env: { ...process.env, CI: process.env.CI ?? \"1\" },\n },\n (error, stdout, stderr) => {\n let report: unknown;\n\n try {\n report = JSON.parse(readFileSync(outputFile, \"utf8\"));\n } catch {\n report = undefined;\n }\n\n rmSync(directory, { recursive: true, force: true });\n resolve({\n code: error === null ? 0 : typeof error.code === \"number\" ? error.code : null,\n signal: error?.signal ?? null,\n stdout,\n stderr,\n report,\n });\n },\n );\n });\n};\n\n/**\n * The vitest arguments for a run. Verified against `vitest --help` (4.1):\n * `run` executes once without watch; `related <files> --run` runs only the\n * tests that import the given source files; `--passWithNoTests` exits 0 when\n * nothing matches; `--reporter=json --outputFile=<file>` writes the report.\n */\nexport function vitestArguments(files: readonly string[] | null): string[] {\n if (files === null) return [\"run\", \"--passWithNoTests\"];\n\n return [\"related\", ...files, \"--run\", \"--passWithNoTests\"];\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** ANSI color sequences, which vitest leaves in failure messages. */\nconst ANSI_SEQUENCE = new RegExp(`${String.fromCharCode(27)}\\\\[[0-9;]*m`, \"g\");\n\n/** The first meaningful lines of a failure message, bounded for one JSON field. */\nfunction summarize(message: string): string {\n const text = message.replace(ANSI_SEQUENCE, \"\").trim();\n\n return text.length > 1000 ? `${text.slice(0, 1000)}…` : text;\n}\n\n/**\n * Whether a failure message shows the machine rather than the code: a\n * refused/unreachable service (`WL8003`) or a port already taken (`WL8004`).\n */\nexport function environmentCodeOf(message: string): \"WL8003\" | \"WL8004\" | undefined {\n const errno = /\\b(ECONNREFUSED|ENOTFOUND|EHOSTUNREACH|EADDRINUSE)\\b/.exec(message)?.[1];\n\n if (!errno) return undefined;\n\n const code = errorCodeOf({ code: errno });\n\n return code === \"WL8003\" || code === \"WL8004\" ? code : undefined;\n}\n\nfunction relative(cwd: string, file: unknown): string | null {\n if (typeof file !== \"string\" || file.length === 0) return null;\n\n return (path.isAbsolute(file) ? path.relative(cwd, file) : file).split(path.sep).join(\"/\");\n}\n\n/**\n * Turn vitest's JSON report (the Jest-compatible shape `--reporter=json`\n * writes) into problems: a failed test is `WL7301`, a file that failed before\n * its tests ran is `WL7302`, and a failure caused by an unreachable service or\n * a busy port is the matching environment code instead.\n */\nexport function parseVitestReport(report: unknown, cwd: string): ToolingProblem[] {\n if (!isRecord(report) || !Array.isArray(report.testResults)) return [];\n\n const problems: ToolingProblem[] = [];\n\n for (const suite of report.testResults) {\n if (!isRecord(suite)) continue;\n\n const file = relative(cwd, suite.name);\n const assertions = Array.isArray(suite.assertionResults) ? suite.assertionResults : [];\n const failed = assertions.filter(\n (assertion): assertion is Record<string, unknown> =>\n isRecord(assertion) && assertion.status === \"failed\",\n );\n\n for (const assertion of failed) {\n const messages = Array.isArray(assertion.failureMessages)\n ? assertion.failureMessages.filter(\n (message): message is string => typeof message === \"string\",\n )\n : [];\n const message = summarize(messages.join(\"\\n\") || \"Test failed.\");\n const location = isRecord(assertion.location) ? assertion.location : undefined;\n const name =\n typeof assertion.fullName === \"string\"\n ? assertion.fullName\n : typeof assertion.title === \"string\"\n ? assertion.title\n : null;\n const environment = environmentCodeOf(message);\n\n problems.push(\n createProblem({\n code: environment ?? \"WL7301\",\n source: environment ? \"environment\" : \"vitest\",\n message,\n file,\n line: typeof location?.line === \"number\" ? location.line : null,\n column: typeof location?.column === \"number\" ? location.column : null,\n rule: name,\n }),\n );\n }\n\n const suiteMessage = typeof suite.message === \"string\" ? suite.message.trim() : \"\";\n\n if (suite.status === \"failed\" && failed.length === 0) {\n const message = summarize(suiteMessage || \"The test file failed before its tests ran.\");\n const environment = environmentCodeOf(message);\n\n problems.push(\n createProblem({\n code: environment ?? \"WL7302\",\n source: environment ? \"environment\" : \"vitest\",\n message,\n file,\n }),\n );\n }\n }\n\n return problems;\n}\n\n/**\n * Problems for a vitest run that produced no report: a crash, a timeout or a\n * signal is the tool (`WL8007`); an exit without a report after a config or\n * import error is the code (`WL7302`).\n */\nexport function vitestRunFailure(run: VitestRun): ToolingProblem[] {\n const output = summarize(`${run.stderr}\\n${run.stdout}`) || \"vitest wrote no report.\";\n\n if (\n run.signal !== null ||\n run.code === null ||\n run.code > 1 ||\n /heap out of memory/i.test(output)\n ) {\n return [\n createProblem({\n code: \"WL8007\",\n source: \"environment\",\n message: `vitest ${run.signal ? `was killed (${run.signal})` : `exited with ${run.code ?? \"no code\"}`}: ${output}`,\n }),\n ];\n }\n\n const environment = environmentCodeOf(output);\n\n return [\n createProblem({\n code: environment ?? \"WL7302\",\n source: environment ? \"environment\" : \"vitest\",\n message: output,\n }),\n ];\n}\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,kBAAkB,MAAU;;;;;AAMlC,SAAgB,WAAW,KAAiC;CAC1D,IAAI;EAEF,MAAM,eADU,cAAc,KAAK,KAAK,KAAK,cAAc,CAChC,CAAC,CAAC,QAAQ,qBAAqB;EAC1D,MAAM,WAAoB,KAA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,OAAO,CACL,cAAc;EACZ,MAAM,eAAe;EACrB,QAAQ,cAAc,gBAAgB;EACtC,SAAS;CACX,CAAC,CACH;AACF"}
|
|
1
|
+
{"version":3,"file":"tests-step.mjs","names":["relative"],"sources":["../../../../../../../../../packages/core/src/tooling/check/tests-step.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { existsSync, mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { errorCodeOf } from \"../../errors/error-codes\";\nimport { createProblem, type ToolingProblem } from \"../problem\";\n\n/** How a vitest run ended: its exit code, output, and the JSON report if one was written. */\nexport type VitestRun = {\n code: number | null;\n signal: string | null;\n stdout: string;\n stderr: string;\n /** The `--reporter=json` report, parsed; `undefined` when none was written. */\n report: unknown;\n};\n\n/** Runs the app's vitest with the given arguments. Injectable for tests. */\nexport type VitestRunner = (\n binary: string,\n args: readonly string[],\n cwd: string,\n) => Promise<VitestRun>;\n\n/** Ten minutes: a suite slower than that is reported as a crashed tool, not a failure. */\nconst TEST_TIMEOUT_MS = 10 * 60 * 1000;\n\n/**\n * The app's own vitest CLI entry, resolved from the app root — never a global\n * install — or `undefined` when the app does not have vitest.\n */\nexport function findVitest(cwd: string): string | undefined {\n try {\n const require = createRequire(path.join(cwd, \"package.json\"));\n const manifestPath = require.resolve(\"vitest/package.json\");\n const manifest: unknown = JSON.parse(readFileSync(manifestPath, \"utf8\"));\n const bin =\n typeof manifest === \"object\" && manifest !== null ? Reflect.get(manifest, \"bin\") : undefined;\n const entry =\n typeof bin === \"string\"\n ? bin\n : typeof bin === \"object\" && bin !== null\n ? Reflect.get(bin, \"vitest\")\n : undefined;\n\n if (typeof entry !== \"string\") return undefined;\n\n const binary = path.resolve(path.dirname(manifestPath), entry);\n\n return existsSync(binary) ? binary : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The default {@link VitestRunner}: `node <vitest> <args> --reporter=json\n * --outputFile=<tmp>`, reading the report back from the file so test output on\n * stdout cannot corrupt it.\n */\nexport const runVitest: VitestRunner = (binary, args, cwd) => {\n const directory = mkdtempSync(path.join(os.tmpdir(), \"warlock-check-vitest-\"));\n const outputFile = path.join(directory, \"report.json\");\n\n return new Promise((resolve) => {\n execFile(\n process.execPath,\n [binary, ...args, \"--reporter=json\", `--outputFile=${outputFile}`],\n {\n cwd,\n encoding: \"utf8\",\n windowsHide: true,\n timeout: TEST_TIMEOUT_MS,\n maxBuffer: 64 * 1024 * 1024,\n env: { ...process.env, CI: process.env.CI ?? \"1\" },\n },\n (error, stdout, stderr) => {\n let report: unknown;\n\n try {\n report = JSON.parse(readFileSync(outputFile, \"utf8\"));\n } catch {\n report = undefined;\n }\n\n rmSync(directory, { recursive: true, force: true });\n resolve({\n code: error === null ? 0 : typeof error.code === \"number\" ? error.code : null,\n signal: error?.signal ?? null,\n stdout,\n stderr,\n report,\n });\n },\n );\n });\n};\n\n/**\n * The vitest arguments for a run. Verified against `vitest --help` (4.1):\n * `run` executes once without watch; `related <files> --run` runs only the\n * tests that import the given source files; `--passWithNoTests` exits 0 when\n * nothing matches; `--reporter=json --outputFile=<file>` writes the report.\n */\nexport function vitestArguments(files: readonly string[] | null): string[] {\n if (files === null) return [\"run\", \"--passWithNoTests\"];\n\n return [\"related\", ...files, \"--run\", \"--passWithNoTests\"];\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/** ANSI color sequences, which vitest leaves in failure messages. */\nconst ANSI_SEQUENCE = new RegExp(`${String.fromCharCode(27)}\\\\[[0-9;]*m`, \"g\");\n\n/** The first meaningful lines of a failure message, bounded for one JSON field. */\nfunction summarize(message: string): string {\n const text = message.replace(ANSI_SEQUENCE, \"\").trim();\n\n return text.length > 1000 ? `${text.slice(0, 1000)}…` : text;\n}\n\n/**\n * Whether a failure message shows the machine rather than the code: a\n * refused/unreachable service (`WL8003`) or a port already taken (`WL8004`).\n */\nexport function environmentCodeOf(message: string): \"WL8003\" | \"WL8004\" | undefined {\n const errno = /\\b(ECONNREFUSED|ENOTFOUND|EHOSTUNREACH|EADDRINUSE)\\b/.exec(message)?.[1];\n\n if (!errno) return undefined;\n\n const code = errorCodeOf({ code: errno });\n\n return code === \"WL8003\" || code === \"WL8004\" ? code : undefined;\n}\n\nfunction relative(cwd: string, file: unknown): string | null {\n if (typeof file !== \"string\" || file.length === 0) return null;\n\n return (path.isAbsolute(file) ? path.relative(cwd, file) : file).split(path.sep).join(\"/\");\n}\n\n/**\n * Turn vitest's JSON report (the Jest-compatible shape `--reporter=json`\n * writes) into problems: a failed test is `WL7301`, a file that failed before\n * its tests ran is `WL7302`, and a failure caused by an unreachable service or\n * a busy port is the matching environment code instead.\n */\nexport function parseVitestReport(report: unknown, cwd: string): ToolingProblem[] {\n if (!isRecord(report) || !Array.isArray(report.testResults)) return [];\n\n const problems: ToolingProblem[] = [];\n\n for (const suite of report.testResults) {\n if (!isRecord(suite)) continue;\n\n const file = relative(cwd, suite.name);\n const assertions = Array.isArray(suite.assertionResults) ? suite.assertionResults : [];\n const failed = assertions.filter(\n (assertion): assertion is Record<string, unknown> =>\n isRecord(assertion) && assertion.status === \"failed\",\n );\n\n for (const assertion of failed) {\n const messages = Array.isArray(assertion.failureMessages)\n ? assertion.failureMessages.filter(\n (message): message is string => typeof message === \"string\",\n )\n : [];\n const message = summarize(messages.join(\"\\n\") || \"Test failed.\");\n const location = isRecord(assertion.location) ? assertion.location : undefined;\n const name =\n typeof assertion.fullName === \"string\"\n ? assertion.fullName\n : typeof assertion.title === \"string\"\n ? assertion.title\n : null;\n const environment = environmentCodeOf(message);\n\n problems.push(\n createProblem({\n code: environment ?? \"WL7301\",\n source: environment ? \"environment\" : \"vitest\",\n message,\n file,\n line: typeof location?.line === \"number\" ? location.line : null,\n column: typeof location?.column === \"number\" ? location.column : null,\n rule: name,\n }),\n );\n }\n\n const suiteMessage = typeof suite.message === \"string\" ? suite.message.trim() : \"\";\n\n if (suite.status === \"failed\" && failed.length === 0) {\n const message = summarize(suiteMessage || \"The test file failed before its tests ran.\");\n const environment = environmentCodeOf(message);\n\n problems.push(\n createProblem({\n code: environment ?? \"WL7302\",\n source: environment ? \"environment\" : \"vitest\",\n message,\n file,\n }),\n );\n }\n }\n\n return problems;\n}\n\n/**\n * Problems for a vitest run that produced no report: a crash, a timeout or a\n * signal is the tool (`WL8007`); an exit without a report after a config or\n * import error is the code (`WL7302`).\n */\nexport function vitestRunFailure(run: VitestRun): ToolingProblem[] {\n const output = summarize(`${run.stderr}\\n${run.stdout}`) || \"vitest wrote no report.\";\n\n if (\n run.signal !== null ||\n run.code === null ||\n run.code > 1 ||\n /heap out of memory/i.test(output)\n ) {\n return [\n createProblem({\n code: \"WL8007\",\n source: \"environment\",\n message: `vitest ${run.signal ? `was killed (${run.signal})` : `exited with ${run.code ?? \"no code\"}`}: ${output}`,\n }),\n ];\n }\n\n const environment = environmentCodeOf(output);\n\n return [\n createProblem({\n code: environment ?? \"WL7302\",\n source: environment ? \"environment\" : \"vitest\",\n message: output,\n }),\n ];\n}\n"],"mappings":";;;;;;;;;;AA0BA,MAAM,kBAAkB;;;;;AAMxB,SAAgB,WAAW,KAAiC;CAC1D,IAAI;EAEF,MAAM,eADU,cAAc,KAAK,KAAK,KAAK,cAAc,CAChC,CAAC,CAAC,QAAQ,qBAAqB;EAC1D,MAAM,WAAoB,KAAK,MAAM,aAAa,cAAc,MAAM,CAAC;EACvE,MAAM,MACJ,OAAO,aAAa,YAAY,aAAa,OAAO,QAAQ,IAAI,UAAU,KAAK,IAAI;EACrF,MAAM,QACJ,OAAO,QAAQ,WACX,MACA,OAAO,QAAQ,YAAY,QAAQ,OACjC,QAAQ,IAAI,KAAK,QAAQ,IACzB;EAER,IAAI,OAAO,UAAU,UAAU,OAAO;EAEtC,MAAM,SAAS,KAAK,QAAQ,KAAK,QAAQ,YAAY,GAAG,KAAK;EAE7D,OAAO,WAAW,MAAM,IAAI,SA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,MAAM,eAAe;IACrB,QAAQ,cAAc,gBAAgB;IACtC;IACA;IACA,MAAM,OAAO,UAAU,SAAS,WAAW,SAAS,OAAO;IAC3D,QAAQ,OAAO,UAAU,WAAW,WAAW,SAAS,SAAS;IACjE,MAAM;GACR,CAAC,CACH;EACF;EAEA,MAAM,eAAe,OAAO,MAAM,YAAY,WAAW,MAAM,QAAQ,KAAK,IAAI;EAEhF,IAAI,MAAM,WAAW,YAAY,OAAO,WAAW,GAAG;GACpD,MAAM,UAAU,UAAU,gBAAgB,4CAA4C;GACtF,MAAM,cAAc,kBAAkB,OAAO;GAE7C,SAAS,KACP,cAAc;IACZ,MAAM,eAAe;IACrB,QAAQ,cAAc,gBAAgB;IACtC;IACA;GACF,CAAC,CACH;EACF;CACF;CAEA,OAAO;AACT;;;;;;AAOA,SAAgB,iBAAiB,KAAkC;CACjE,MAAM,SAAS,UAAU,GAAG,IAAI,OAAO,IAAI,IAAI,QAAQ,KAAK;CAE5D,IACE,IAAI,WAAW,QACf,IAAI,SAAS,QACb,IAAI,OAAO,KACX,sBAAsB,KAAK,MAAM,GAEjC,OAAO,CACL,cAAc;EACZ,MAAM;EACN,QAAQ;EACR,SAAS,UAAU,IAAI,SAAS,eAAe,IAAI,OAAO,KAAK,eAAe,IAAI,QAAQ,YAAY,IAAI;CAC5G,CAAC,CACH;CAGF,MAAM,cAAc,kBAAkB,MAAM;CAE5C,OAAO,CACL,cAAc;EACZ,MAAM,eAAe;EACrB,QAAQ,cAAc,gBAAgB;EACtC,SAAS;CACX,CAAC,CACH;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region ../../packages/core/src/tooling/dev-state/dev-server-state.d.ts
|
|
2
2
|
/** Where `warlock dev` records the address of the running server, under the project root. */
|
|
3
|
-
declare const DEV_SERVER_STATE_FILE = ".warlock/dev-server.json";
|
|
3
|
+
export declare const DEV_SERVER_STATE_FILE = ".warlock/dev-server.json";
|
|
4
4
|
/**
|
|
5
5
|
* What a running `warlock dev` worker records about itself, so `warlock trace`
|
|
6
6
|
* and `warlock mcp` can find it without guessing a port.
|
|
@@ -9,31 +9,35 @@ declare const DEV_SERVER_STATE_FILE = ".warlock/dev-server.json";
|
|
|
9
9
|
* when the worker shuts down. A crashed worker can leave a stale file behind,
|
|
10
10
|
* so readers confirm the server answers before trusting it.
|
|
11
11
|
*/
|
|
12
|
-
type DevServerState = {
|
|
13
|
-
schemaVersion: 1;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export type DevServerState = {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
/** The worker process id (informational: readers never signal it). */
|
|
15
|
+
pid: number;
|
|
16
|
+
/** The address to send requests to, e.g. `http://localhost:2030`. */
|
|
17
|
+
url: string;
|
|
18
|
+
/** ISO time the worker became ready. */
|
|
19
|
+
startedAt: string;
|
|
20
|
+
/** The devtools mount, when `@warlock.js/devtools` was registered. */
|
|
17
21
|
devtools: {
|
|
18
22
|
path: string;
|
|
19
|
-
} | null;
|
|
23
|
+
} | null;
|
|
24
|
+
/** The MCP endpoint `warlock dev --mcp` serves, when it is on. */
|
|
20
25
|
mcp: {
|
|
21
26
|
url: string;
|
|
22
27
|
} | null;
|
|
23
28
|
};
|
|
24
29
|
/** Narrow parsed JSON to a {@link DevServerState}; `undefined` for anything else. */
|
|
25
|
-
declare function parseDevServerState(value: unknown): DevServerState | undefined;
|
|
30
|
+
export declare function parseDevServerState(value: unknown): DevServerState | undefined;
|
|
26
31
|
/** The recorded state, or `undefined` when no dev server recorded one. */
|
|
27
|
-
declare function readDevServerState(cwd?: string): DevServerState | undefined;
|
|
32
|
+
export declare function readDevServerState(cwd?: string): DevServerState | undefined;
|
|
28
33
|
/** Record the state atomically (temp file + rename), creating `.warlock/` when needed. */
|
|
29
|
-
declare function writeDevServerState(state: DevServerState, cwd?: string): void;
|
|
34
|
+
export declare function writeDevServerState(state: DevServerState, cwd?: string): void;
|
|
30
35
|
/** Merge fields into the recorded state; a no-op when there is none. */
|
|
31
|
-
declare function updateDevServerState(patch: Partial<Omit<DevServerState, "schemaVersion">>, cwd?: string): void;
|
|
36
|
+
export declare function updateDevServerState(patch: Partial<Omit<DevServerState, "schemaVersion">>, cwd?: string): void;
|
|
32
37
|
/**
|
|
33
38
|
* Remove the state file — only when it still belongs to `pid`, so a worker
|
|
34
39
|
* that shuts down late never deletes the record of the worker that replaced it.
|
|
35
40
|
*/
|
|
36
|
-
declare function removeDevServerState(pid?: number, cwd?: string): void;
|
|
41
|
+
export declare function removeDevServerState(pid?: number, cwd?: string): void;
|
|
37
42
|
//#endregion
|
|
38
|
-
export { DEV_SERVER_STATE_FILE, DevServerState, parseDevServerState, readDevServerState, removeDevServerState, updateDevServerState, writeDevServerState };
|
|
39
43
|
//# sourceMappingURL=dev-server-state.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server-state.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/dev-state/dev-server-state.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"dev-server-state.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/dev-state/dev-server-state.ts"],"mappings":";;qBAIa;;;;;;;;;YAUD;EACV;;EAEA;;EAEA;;EAEA;;EAEA;IAAY;;;EAEZ;IAAO;;;;wBAYO,oBAAoB,iBAAiB;;wBAsBrC,mBAAmB,eAAsB;;wBAazC,oBAAoB,OAAO,gBAAgB;;wBAU3C,qBACd,OAAO,QAAQ,KAAK,mCACpB;;;;;wBAac,qBAAqB,cAAmB"}
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
* optional dev dependency, and this module must load without it.
|
|
8
8
|
*/
|
|
9
9
|
/** The devtools mount every app uses unless it wired devtools by hand. */
|
|
10
|
-
declare const DEFAULT_DEVTOOLS_PATH = "/__warlock";
|
|
10
|
+
export declare const DEFAULT_DEVTOOLS_PATH = "/__warlock";
|
|
11
11
|
/** The `fetch` this client calls; injectable for tests. */
|
|
12
|
-
type DevtoolsFetch = (input: string, init?: RequestInit) => Promise<Response>;
|
|
12
|
+
export type DevtoolsFetch = (input: string, init?: RequestInit) => Promise<Response>;
|
|
13
13
|
/** One timed phase: `route.match`, `middleware` (with `attrs.name`), `validation`, `handler`. */
|
|
14
|
-
type DevtoolsPhaseRecord = {
|
|
14
|
+
export type DevtoolsPhaseRecord = {
|
|
15
15
|
name: string;
|
|
16
16
|
startedAt: number;
|
|
17
17
|
durationMs: number;
|
|
18
18
|
attrs?: Record<string, unknown>;
|
|
19
19
|
};
|
|
20
20
|
/** The row `GET <path>/api/requests` returns. */
|
|
21
|
-
type DevtoolsRequestSummaryRecord = {
|
|
21
|
+
export type DevtoolsRequestSummaryRecord = {
|
|
22
22
|
id: string;
|
|
23
23
|
method: string;
|
|
24
24
|
path: string;
|
|
@@ -30,37 +30,47 @@ type DevtoolsRequestSummaryRecord = {
|
|
|
30
30
|
warningCount: number;
|
|
31
31
|
};
|
|
32
32
|
/** Everything devtools recorded for one request (`GET <path>/api/requests/:id`). */
|
|
33
|
-
type DevtoolsRequestRecord = {
|
|
33
|
+
export type DevtoolsRequestRecord = {
|
|
34
34
|
id: string;
|
|
35
35
|
method: string;
|
|
36
36
|
path: string;
|
|
37
37
|
route?: string;
|
|
38
38
|
status?: number;
|
|
39
|
-
startedAt: number;
|
|
39
|
+
startedAt: number;
|
|
40
|
+
/** Absent while the request is still in flight. */
|
|
40
41
|
durationMs?: number;
|
|
41
42
|
error?: string;
|
|
42
|
-
phases: DevtoolsPhaseRecord[];
|
|
43
|
+
phases: DevtoolsPhaseRecord[];
|
|
44
|
+
/** Queries: `sql`/`collection`, `durationMs`, `shape`, `caller`, `error`. */
|
|
43
45
|
queries: Record<string, unknown>[];
|
|
44
46
|
cache: Record<string, unknown>[];
|
|
45
47
|
logs: Record<string, unknown>[];
|
|
46
|
-
mails: string[];
|
|
48
|
+
mails: string[];
|
|
49
|
+
/** `{ type: "n+1", message, shape, count, caller }` entries. */
|
|
47
50
|
warnings: Record<string, unknown>[];
|
|
48
51
|
};
|
|
49
52
|
/** Where the dev server and its devtools API live. */
|
|
50
|
-
type DevtoolsEndpoint = {
|
|
51
|
-
/** The dev server origin, e.g. `http://localhost:2030`. */
|
|
53
|
+
export type DevtoolsEndpoint = {
|
|
54
|
+
/** The dev server origin, e.g. `http://localhost:2030`. */
|
|
55
|
+
url: string;
|
|
56
|
+
/** The devtools mount, e.g. `/__warlock`. */
|
|
52
57
|
devtoolsPath: string;
|
|
53
58
|
};
|
|
54
59
|
/** Options of {@link connectDevtools}. */
|
|
55
|
-
type ConnectDevtoolsOptions = {
|
|
56
|
-
/** Project root, where `.warlock/dev-server.json` is read. Default: `process.cwd()`. */
|
|
57
|
-
|
|
60
|
+
export type ConnectDevtoolsOptions = {
|
|
61
|
+
/** Project root, where `.warlock/dev-server.json` is read. Default: `process.cwd()`. */
|
|
62
|
+
cwd?: string;
|
|
63
|
+
/** The dev server address; overrides the recorded one. */
|
|
64
|
+
url?: string;
|
|
65
|
+
/** The devtools mount; overrides the recorded one. */
|
|
58
66
|
devtoolsPath?: string;
|
|
59
67
|
fetch?: DevtoolsFetch;
|
|
60
68
|
};
|
|
61
69
|
/** A connected devtools API. */
|
|
62
|
-
type DevtoolsClient = DevtoolsEndpoint & {
|
|
63
|
-
/** The summaries devtools holds, newest last (the order the collector keeps). */
|
|
70
|
+
export type DevtoolsClient = DevtoolsEndpoint & {
|
|
71
|
+
/** The summaries devtools holds, newest last (the order the collector keeps). */
|
|
72
|
+
listRequests(): Promise<DevtoolsRequestSummaryRecord[]>;
|
|
73
|
+
/** One request's full record, or `undefined` when devtools does not hold it. */
|
|
64
74
|
getRequest(id: string): Promise<DevtoolsRequestRecord | undefined>;
|
|
65
75
|
/**
|
|
66
76
|
* Poll until the request is recorded AND settled (`durationMs` set), or the
|
|
@@ -73,11 +83,11 @@ type DevtoolsClient = DevtoolsEndpoint & {
|
|
|
73
83
|
}): Promise<DevtoolsRequestRecord | undefined>;
|
|
74
84
|
};
|
|
75
85
|
/** Narrow one summary row; `undefined` when it is not one. */
|
|
76
|
-
declare function parseRequestSummary(value: unknown): DevtoolsRequestSummaryRecord | undefined;
|
|
86
|
+
export declare function parseRequestSummary(value: unknown): DevtoolsRequestSummaryRecord | undefined;
|
|
77
87
|
/** Narrow a full request record; `undefined` when it is not one. */
|
|
78
|
-
declare function parseRequestRecord(value: unknown): DevtoolsRequestRecord | undefined;
|
|
88
|
+
export declare function parseRequestRecord(value: unknown): DevtoolsRequestRecord | undefined;
|
|
79
89
|
/** Where the dev server is: the explicit option, else `.warlock/dev-server.json`. Throws `WL8008`. */
|
|
80
|
-
declare function resolveDevServerEndpoint(options?: ConnectDevtoolsOptions): DevtoolsEndpoint;
|
|
90
|
+
export declare function resolveDevServerEndpoint(options?: ConnectDevtoolsOptions): DevtoolsEndpoint;
|
|
81
91
|
/**
|
|
82
92
|
* Connect to the devtools API of the running dev server.
|
|
83
93
|
*
|
|
@@ -85,7 +95,6 @@ declare function resolveDevServerEndpoint(options?: ConnectDevtoolsOptions): Dev
|
|
|
85
95
|
* `WL8009` when it answers but devtools is not mounted (404, or anything that
|
|
86
96
|
* is not the devtools JSON).
|
|
87
97
|
*/
|
|
88
|
-
declare function connectDevtools(options?: ConnectDevtoolsOptions): Promise<DevtoolsClient>;
|
|
98
|
+
export declare function connectDevtools(options?: ConnectDevtoolsOptions): Promise<DevtoolsClient>;
|
|
89
99
|
//#endregion
|
|
90
|
-
export { ConnectDevtoolsOptions, DEFAULT_DEVTOOLS_PATH, DevtoolsClient, DevtoolsEndpoint, DevtoolsFetch, DevtoolsPhaseRecord, DevtoolsRequestRecord, DevtoolsRequestSummaryRecord, connectDevtools, parseRequestRecord, parseRequestSummary, resolveDevServerEndpoint };
|
|
91
100
|
//# sourceMappingURL=devtools-client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-client.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/devtools/devtools-client.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"devtools-client.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/devtools/devtools-client.ts"],"mappings":";;;;;;;;;qBAYa;;YAGD,iBAAiB,eAAe,OAAO,gBAAgB,QAAQ;;YAG/D;EACV;EACA;EACA;EACA,QAAQ;;;YAIE;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;YAIU;EACV;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA,QAAQ;;EAER,SAAS;EACT,OAAO;EACP,MAAM;EACN;;EAEA,UAAU;;;YAIA;;EAEV;;EAEA;;;YAIU;;EAEV;;EAEA;;EAEA;EACA,QAAQ;;;YAIE,iBAAiB;;EAE3B,gBAAgB,QAAQ;;EAExB,WAAW,aAAa,QAAQ;;;;;;EAMhC,eACE,YACA;IAAY;IAAoB;MAC/B,QAAQ;;;wBAoBG,oBAAoB,iBAAiB;;wBAmBrC,mBAAmB,iBAAiB;;wBAsDpC,yBAAyB,UAAS,yBAA8B;;;;;;;;wBAyB1D,gBACpB,UAAS,yBACR,QAAQ"}
|
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import { GeneratorSpec } from "./generator-spec.mjs";
|
|
2
2
|
import { CliRunner } from "./run-cli.mjs";
|
|
3
|
-
|
|
4
3
|
//#region ../../packages/core/src/tooling/generate/generation.d.ts
|
|
5
4
|
/** The largest diff kept per file; a longer one is cut with a note. */
|
|
6
|
-
declare const MAX_FILE_DIFF_BYTES: number;
|
|
5
|
+
export declare const MAX_FILE_DIFF_BYTES: number;
|
|
7
6
|
/** One file a generation creates, changes or removes. */
|
|
8
|
-
type GeneratedFile = {
|
|
9
|
-
/** Project-relative POSIX path. */
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export type GeneratedFile = {
|
|
8
|
+
/** Project-relative POSIX path. */
|
|
9
|
+
path: string;
|
|
10
|
+
status: "created" | "modified" | "deleted";
|
|
11
|
+
/** Unified diff against the project's current content (`""` for a binary file). */
|
|
12
|
+
diff: string;
|
|
13
|
+
/** Set when the file is binary; `diff` is then empty. */
|
|
12
14
|
binary?: boolean;
|
|
13
15
|
};
|
|
14
16
|
/** What a generation would do (or did). */
|
|
15
|
-
type GenerationPlan = {
|
|
16
|
-
spec: GeneratorSpec;
|
|
17
|
-
|
|
17
|
+
export type GenerationPlan = {
|
|
18
|
+
spec: GeneratorSpec;
|
|
19
|
+
/** The argv that ran, starting with `warlock`. */
|
|
20
|
+
command: string[];
|
|
21
|
+
/** Whether the command exited 0. A failed run usually lists no files. */
|
|
18
22
|
ok: boolean;
|
|
19
23
|
exitCode: number | null;
|
|
20
|
-
files: GeneratedFile[];
|
|
24
|
+
files: GeneratedFile[];
|
|
25
|
+
/** The command's stdout and stderr, ANSI stripped and capped. */
|
|
21
26
|
output: string;
|
|
22
27
|
};
|
|
23
28
|
/** Options every backend accepts. */
|
|
24
|
-
type GenerationPlanOptions = {
|
|
25
|
-
/** Project root. Default: `process.cwd()`. */
|
|
29
|
+
export type GenerationPlanOptions = {
|
|
30
|
+
/** Project root. Default: `process.cwd()`. */
|
|
31
|
+
cwd?: string;
|
|
32
|
+
/** Default {@link DEFAULT_GENERATION_TIMEOUT_MS}. */
|
|
26
33
|
timeoutMs?: number;
|
|
27
34
|
};
|
|
28
35
|
/**
|
|
@@ -31,13 +38,16 @@ type GenerationPlanOptions = {
|
|
|
31
38
|
* The seam a native `warlock generate.* --dry-run --json` can implement later;
|
|
32
39
|
* {@link sandboxBackend} implements it by generating into a throwaway copy.
|
|
33
40
|
*/
|
|
34
|
-
type GenerationBackend = {
|
|
41
|
+
export type GenerationBackend = {
|
|
35
42
|
plan(spec: GeneratorSpec, options?: GenerationPlanOptions): Promise<GenerationPlan>;
|
|
36
43
|
};
|
|
37
44
|
/** Options of {@link sandboxBackend}. */
|
|
38
|
-
type SandboxBackendOptions = {
|
|
39
|
-
/** The `warlock` bin to run. Default: {@link resolveCliEntry}. */
|
|
40
|
-
|
|
45
|
+
export type SandboxBackendOptions = {
|
|
46
|
+
/** The `warlock` bin to run. Default: {@link resolveCliEntry}. */
|
|
47
|
+
cliEntry?: string;
|
|
48
|
+
/** How the CLI runs. Default: {@link spawnCli}. */
|
|
49
|
+
runner?: CliRunner;
|
|
50
|
+
/** Where sandboxes are created. Default: `os.tmpdir()`. */
|
|
41
51
|
tempDirectory?: string;
|
|
42
52
|
};
|
|
43
53
|
/**
|
|
@@ -57,11 +67,14 @@ type SandboxBackendOptions = {
|
|
|
57
67
|
* );
|
|
58
68
|
* plan.files.map((file) => `${file.status} ${file.path}`);
|
|
59
69
|
*/
|
|
60
|
-
declare function sandboxBackend(options?: SandboxBackendOptions): GenerationBackend;
|
|
70
|
+
export declare function sandboxBackend(options?: SandboxBackendOptions): GenerationBackend;
|
|
61
71
|
/** Options of {@link applyGeneration}. */
|
|
62
|
-
type ApplyGenerationOptions = GenerationPlanOptions & {
|
|
63
|
-
/** The `warlock` bin to run. Default: {@link resolveCliEntry}. */
|
|
64
|
-
|
|
72
|
+
export type ApplyGenerationOptions = GenerationPlanOptions & {
|
|
73
|
+
/** The `warlock` bin to run. Default: {@link resolveCliEntry}. */
|
|
74
|
+
cliEntry?: string;
|
|
75
|
+
/** How the CLI runs. Default: {@link spawnCli}. */
|
|
76
|
+
runner?: CliRunner;
|
|
77
|
+
/** For `add`: install the packages it records. Default `true`. */
|
|
65
78
|
install?: boolean;
|
|
66
79
|
};
|
|
67
80
|
/**
|
|
@@ -72,7 +85,6 @@ type ApplyGenerationOptions = GenerationPlanOptions & {
|
|
|
72
85
|
* compared. This WRITES the project: `warlock mcp` exposes it only with
|
|
73
86
|
* `--allow-writes`.
|
|
74
87
|
*/
|
|
75
|
-
declare function applyGeneration(spec: GeneratorSpec, options?: ApplyGenerationOptions): Promise<GenerationPlan>;
|
|
88
|
+
export declare function applyGeneration(spec: GeneratorSpec, options?: ApplyGenerationOptions): Promise<GenerationPlan>;
|
|
76
89
|
//#endregion
|
|
77
|
-
export { ApplyGenerationOptions, GeneratedFile, GenerationBackend, GenerationPlan, GenerationPlanOptions, MAX_FILE_DIFF_BYTES, SandboxBackendOptions, applyGeneration, sandboxBackend };
|
|
78
90
|
//# sourceMappingURL=generation.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/generate/generation.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generation.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/generate/generation.ts"],"mappings":";;;;qBAwBa;;YAGD;;EAEV;EACA;;EAEA;;EAEA;;;YAIU;EACV,MAAM;;EAEN;;EAEA;EACA;EACA,OAAO;;EAEP;;;YAIU;;EAEV;;EAEA;;;;;;;;YASU;EACV,KAAK,MAAM,eAAe,UAAU,wBAAwB,QAAQ;;;YAI1D;;EAEV;;EAEA,SAAS;;EAET;;;;;;;;;;;;;;;;;;;wBA6Ec,eAAe,UAAS,wBAA6B;;YA2CzD,yBAAyB;;EAEnC;;EAEA,SAAS;;EAET;;;;;;;;;;wBAWoB,gBACpB,MAAM,eACN,UAAS,yBACR,QAAQ"}
|
|
@@ -8,7 +8,7 @@ import os from "node:os";
|
|
|
8
8
|
|
|
9
9
|
//#region ../../packages/core/src/tooling/generate/generation.ts
|
|
10
10
|
/** The largest diff kept per file; a longer one is cut with a note. */
|
|
11
|
-
const MAX_FILE_DIFF_BYTES =
|
|
11
|
+
const MAX_FILE_DIFF_BYTES = 204800;
|
|
12
12
|
function readOrNull(file) {
|
|
13
13
|
return existsSync(file) ? readFileSync(file) : null;
|
|
14
14
|
}
|
|
@@ -74,12 +74,14 @@ function sandboxBackend(options = {}) {
|
|
|
74
74
|
try {
|
|
75
75
|
copyProjectScope(cwd, sandbox);
|
|
76
76
|
const before = snapshotFiles(sandbox, forEachSandboxFile);
|
|
77
|
-
|
|
77
|
+
const run = await runner({
|
|
78
78
|
entry: options.cliEntry ?? resolveCliEntry(),
|
|
79
79
|
args,
|
|
80
80
|
cwd: sandbox,
|
|
81
81
|
timeoutMs: planOptions.timeoutMs ?? 12e4
|
|
82
|
-
})
|
|
82
|
+
});
|
|
83
|
+
const after = snapshotFiles(sandbox, forEachSandboxFile);
|
|
84
|
+
return planFrom(spec, args, run, compareSnapshots(before, after).flatMap((change) => {
|
|
83
85
|
const file = describeChange(change, readOrNull(path.join(cwd, change.path)), change.status === "deleted" ? null : readOrNull(path.join(sandbox, change.path)));
|
|
84
86
|
return file ? [file] : [];
|
|
85
87
|
}));
|
|
@@ -107,12 +109,14 @@ async function applyGeneration(spec, options = {}) {
|
|
|
107
109
|
contents.set(relative, readFileSync(absolute));
|
|
108
110
|
});
|
|
109
111
|
const before = snapshotFiles(cwd, forEachScopedFile);
|
|
110
|
-
|
|
112
|
+
const run = await (options.runner ?? spawnCli)({
|
|
111
113
|
entry: options.cliEntry ?? resolveCliEntry(),
|
|
112
114
|
args,
|
|
113
115
|
cwd,
|
|
114
116
|
timeoutMs: options.timeoutMs ?? 12e4
|
|
115
|
-
})
|
|
117
|
+
});
|
|
118
|
+
const after = snapshotFiles(cwd, forEachScopedFile);
|
|
119
|
+
return planFrom(spec, args, run, compareSnapshots(before, after).flatMap((change) => {
|
|
116
120
|
const file = describeChange(change, contents.get(change.path) ?? null, change.status === "deleted" ? null : readOrNull(path.join(cwd, change.path)));
|
|
117
121
|
return file ? [file] : [];
|
|
118
122
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/generate/generation.ts"],"sourcesContent":["import { existsSync, mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { buildGeneratorArgs, type GeneratorSpec } from \"./generator-spec\";\nimport {\n compareSnapshots,\n copyProjectScope,\n forEachSandboxFile,\n forEachScopedFile,\n isBinary,\n type SnapshotChange,\n snapshotFiles,\n} from \"./project-files\";\nimport {\n type CliRun,\n type CliRunner,\n DEFAULT_GENERATION_TIMEOUT_MS,\n describeRun,\n resolveCliEntry,\n spawnCli,\n} from \"./run-cli\";\nimport { unifiedDiff } from \"./unified-diff\";\n\n/** The largest diff kept per file; a longer one is cut with a note. */\nexport const MAX_FILE_DIFF_BYTES = 200 * 1024;\n\n/** One file a generation creates, changes or removes. */\nexport type GeneratedFile = {\n /** Project-relative POSIX path. */\n path: string;\n status: \"created\" | \"modified\" | \"deleted\";\n /** Unified diff against the project's current content (`\"\"` for a binary file). */\n diff: string;\n /** Set when the file is binary; `diff` is then empty. */\n binary?: boolean;\n};\n\n/** What a generation would do (or did). */\nexport type GenerationPlan = {\n spec: GeneratorSpec;\n /** The argv that ran, starting with `warlock`. */\n command: string[];\n /** Whether the command exited 0. A failed run usually lists no files. */\n ok: boolean;\n exitCode: number | null;\n files: GeneratedFile[];\n /** The command's stdout and stderr, ANSI stripped and capped. */\n output: string;\n};\n\n/** Options every backend accepts. */\nexport type GenerationPlanOptions = {\n /** Project root. Default: `process.cwd()`. */\n cwd?: string;\n /** Default {@link DEFAULT_GENERATION_TIMEOUT_MS}. */\n timeoutMs?: number;\n};\n\n/**\n * Computes what a generation would change without touching the project.\n *\n * The seam a native `warlock generate.* --dry-run --json` can implement later;\n * {@link sandboxBackend} implements it by generating into a throwaway copy.\n */\nexport type GenerationBackend = {\n plan(spec: GeneratorSpec, options?: GenerationPlanOptions): Promise<GenerationPlan>;\n};\n\n/** Options of {@link sandboxBackend}. */\nexport type SandboxBackendOptions = {\n /** The `warlock` bin to run. Default: {@link resolveCliEntry}. */\n cliEntry?: string;\n /** How the CLI runs. Default: {@link spawnCli}. */\n runner?: CliRunner;\n /** Where sandboxes are created. Default: `os.tmpdir()`. */\n tempDirectory?: string;\n};\n\nfunction readOrNull(file: string): Buffer | null {\n return existsSync(file) ? readFileSync(file) : null;\n}\n\nfunction capDiff(diff: string): string {\n return diff.length > MAX_FILE_DIFF_BYTES\n ? `${diff.slice(0, MAX_FILE_DIFF_BYTES)}\\n… (diff truncated)\\n`\n : diff;\n}\n\n/**\n * Build the {@link GeneratedFile} for one change from the two contents, or\n * `undefined` when they are byte-identical (a file rewritten unchanged).\n */\nfunction describeChange(\n change: SnapshotChange,\n before: Buffer | null,\n after: Buffer | null,\n): GeneratedFile | undefined {\n if (before !== null && after !== null && before.equals(after)) return undefined;\n\n const status: GeneratedFile[\"status\"] =\n before === null ? \"created\" : after === null ? \"deleted\" : \"modified\";\n\n if ((before && isBinary(before)) || (after && isBinary(after))) {\n return { path: change.path, status, diff: \"\", binary: true };\n }\n\n return {\n path: change.path,\n status,\n diff: capDiff(\n unifiedDiff({\n path: change.path,\n before: before === null ? null : before.toString(\"utf8\"),\n after: after === null ? null : after.toString(\"utf8\"),\n }),\n ),\n };\n}\n\nfunction planFrom(\n spec: GeneratorSpec,\n args: string[],\n run: CliRun,\n files: GeneratedFile[],\n): GenerationPlan {\n return {\n spec,\n command: [\"warlock\", ...args],\n ok: run.exitCode === 0 && !run.timedOut,\n exitCode: run.exitCode,\n files,\n output: describeRun(run),\n };\n}\n\n/**\n * The sandbox {@link GenerationBackend}: copies the project's root files and\n * `src/` tree (never `.env` files) into a temporary directory, links the\n * project's `node_modules` into it, runs the real `warlock` command there,\n * and reports every file that changed as a unified diff against the project.\n * The project is never written; the sandbox is always removed.\n *\n * `add` runs with `--no-install`: package.json shows the dependencies it\n * would record, and nothing is downloaded.\n *\n * @example\n * const plan = await sandboxBackend().plan(\n * { type: \"make\", generator: \"service\", name: \"users/send-welcome\" },\n * { cwd: projectRoot },\n * );\n * plan.files.map((file) => `${file.status} ${file.path}`);\n */\nexport function sandboxBackend(options: SandboxBackendOptions = {}): GenerationBackend {\n const runner = options.runner ?? spawnCli;\n\n return {\n async plan(spec, planOptions = {}) {\n const cwd = path.resolve(planOptions.cwd ?? process.cwd());\n const args = buildGeneratorArgs(spec, { install: false });\n const sandbox = mkdtempSync(\n path.join(options.tempDirectory ?? os.tmpdir(), \"warlock-generate-\"),\n );\n\n try {\n copyProjectScope(cwd, sandbox);\n\n const before = snapshotFiles(sandbox, forEachSandboxFile);\n const run = await runner({\n entry: options.cliEntry ?? resolveCliEntry(),\n args,\n cwd: sandbox,\n timeoutMs: planOptions.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS,\n });\n const after = snapshotFiles(sandbox, forEachSandboxFile);\n const files = compareSnapshots(before, after).flatMap((change) => {\n // Compared with the PROJECT, not the sandbox copy: a file outside the\n // copied scope that the project already has is a change, not a creation.\n const file = describeChange(\n change,\n readOrNull(path.join(cwd, change.path)),\n change.status === \"deleted\" ? null : readOrNull(path.join(sandbox, change.path)),\n );\n\n return file ? [file] : [];\n });\n\n return planFrom(spec, args, run, files);\n } finally {\n rmSync(sandbox, { recursive: true, force: true });\n }\n },\n };\n}\n\n/** Options of {@link applyGeneration}. */\nexport type ApplyGenerationOptions = GenerationPlanOptions & {\n /** The `warlock` bin to run. Default: {@link resolveCliEntry}. */\n cliEntry?: string;\n /** How the CLI runs. Default: {@link spawnCli}. */\n runner?: CliRunner;\n /** For `add`: install the packages it records. Default `true`. */\n install?: boolean;\n};\n\n/**\n * Run a generation in the real project and report what it changed, as a\n * {@link GenerationPlan} whose diffs compare the files before and after.\n *\n * Only the generation scope (root files and `src/`, never `.env` files) is\n * compared. This WRITES the project: `warlock mcp` exposes it only with\n * `--allow-writes`.\n */\nexport async function applyGeneration(\n spec: GeneratorSpec,\n options: ApplyGenerationOptions = {},\n): Promise<GenerationPlan> {\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const args = buildGeneratorArgs(spec, { install: options.install ?? true });\n const contents = new Map<string, Buffer>();\n\n forEachScopedFile(cwd, (absolute, relative) => {\n contents.set(relative, readFileSync(absolute));\n });\n\n const before = snapshotFiles(cwd, forEachScopedFile);\n const run = await (options.runner ?? spawnCli)({\n entry: options.cliEntry ?? resolveCliEntry(),\n args,\n cwd,\n timeoutMs: options.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS,\n });\n const after = snapshotFiles(cwd, forEachScopedFile);\n const files = compareSnapshots(before, after).flatMap((change) => {\n const file = describeChange(\n change,\n contents.get(change.path) ?? null,\n change.status === \"deleted\" ? null : readOrNull(path.join(cwd, change.path)),\n );\n\n return file ? [file] : [];\n });\n\n return planFrom(spec, args, run, files);\n}\n"],"mappings":";;;;;;;;;;AAwBA,MAAa,sBAAsB,MAAM;AAsDzC,SAAS,WAAW,MAA6B;CAC/C,OAAO,WAAW,IAAI,IAAI,aAAa,IAAI,IAAI;AACjD;AAEA,SAAS,QAAQ,MAAsB;CACrC,OAAO,KAAK,kBACR,GAAG,KAAK,MAAM,GAAG,mBAAmB,EAAE,0BACtC;AACN;;;;;AAMA,SAAS,eACP,QACA,QACA,OAC2B;CAC3B,IAAI,WAAW,QAAQ,UAAU,QAAQ,OAAO,OAAO,KAAK,GAAG,OAAO;CAEtE,MAAM,SACJ,WAAW,OAAO,YAAY,UAAU,OAAO,YAAY;CAE7D,IAAK,UAAU,SAAS,MAAM,KAAO,SAAS,SAAS,KAAK,GAC1D,OAAO;EAAE,MAAM,OAAO;EAAM;EAAQ,MAAM;EAAI,QAAQ;CAAK;CAG7D,OAAO;EACL,MAAM,OAAO;EACb;EACA,MAAM,QACJ,YAAY;GACV,MAAM,OAAO;GACb,QAAQ,WAAW,OAAO,OAAO,OAAO,SAAS,MAAM;GACvD,OAAO,UAAU,OAAO,OAAO,MAAM,SAAS,MAAM;EACtD,CAAC,CACH;CACF;AACF;AAEA,SAAS,SACP,MACA,MACA,KACA,OACgB;CAChB,OAAO;EACL;EACA,SAAS,CAAC,WAAW,GAAG,IAAI;EAC5B,IAAI,IAAI,aAAa,KAAK,CAAC,IAAI;EAC/B,UAAU,IAAI;EACd;EACA,QAAQ,YAAY,GAAG;CACzB;AACF;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,eAAe,UAAiC,CAAC,GAAsB;CACrF,MAAM,SAAS,QAAQ,UAAU;CAEjC,OAAO,EACL,MAAM,KAAK,MAAM,cAAc,CAAC,GAAG;EACjC,MAA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AW,QAAQ;CACrB,CAAC,GAEa,iBAAiB,QADjB,cAAc,KAAK,iBACU,CAAC,CAAC,CAAC,SAAS,WAAW;EAChE,MAAM,OAAO,eACX,QACA,SAAS,IAAI,OAAO,IAAI,KAAK,MAC7B,OAAO,WAAW,YAAY,OAAO,WAAW,KAAK,KAAK,KAAK,OAAO,IAAI,CAAC,CAC7E;EAEA,OAAO,OAAO,CAAC,IAAI,IAAI,CAAC;CAC1B,CAEqC,CAAC;AACxC"}
|
|
1
|
+
{"version":3,"file":"generation.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/generate/generation.ts"],"sourcesContent":["import { existsSync, mkdtempSync, readFileSync, rmSync } from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { buildGeneratorArgs, type GeneratorSpec } from \"./generator-spec\";\nimport {\n compareSnapshots,\n copyProjectScope,\n forEachSandboxFile,\n forEachScopedFile,\n isBinary,\n type SnapshotChange,\n snapshotFiles,\n} from \"./project-files\";\nimport {\n type CliRun,\n type CliRunner,\n DEFAULT_GENERATION_TIMEOUT_MS,\n describeRun,\n resolveCliEntry,\n spawnCli,\n} from \"./run-cli\";\nimport { unifiedDiff } from \"./unified-diff\";\n\n/** The largest diff kept per file; a longer one is cut with a note. */\nexport const MAX_FILE_DIFF_BYTES = 200 * 1024;\n\n/** One file a generation creates, changes or removes. */\nexport type GeneratedFile = {\n /** Project-relative POSIX path. */\n path: string;\n status: \"created\" | \"modified\" | \"deleted\";\n /** Unified diff against the project's current content (`\"\"` for a binary file). */\n diff: string;\n /** Set when the file is binary; `diff` is then empty. */\n binary?: boolean;\n};\n\n/** What a generation would do (or did). */\nexport type GenerationPlan = {\n spec: GeneratorSpec;\n /** The argv that ran, starting with `warlock`. */\n command: string[];\n /** Whether the command exited 0. A failed run usually lists no files. */\n ok: boolean;\n exitCode: number | null;\n files: GeneratedFile[];\n /** The command's stdout and stderr, ANSI stripped and capped. */\n output: string;\n};\n\n/** Options every backend accepts. */\nexport type GenerationPlanOptions = {\n /** Project root. Default: `process.cwd()`. */\n cwd?: string;\n /** Default {@link DEFAULT_GENERATION_TIMEOUT_MS}. */\n timeoutMs?: number;\n};\n\n/**\n * Computes what a generation would change without touching the project.\n *\n * The seam a native `warlock generate.* --dry-run --json` can implement later;\n * {@link sandboxBackend} implements it by generating into a throwaway copy.\n */\nexport type GenerationBackend = {\n plan(spec: GeneratorSpec, options?: GenerationPlanOptions): Promise<GenerationPlan>;\n};\n\n/** Options of {@link sandboxBackend}. */\nexport type SandboxBackendOptions = {\n /** The `warlock` bin to run. Default: {@link resolveCliEntry}. */\n cliEntry?: string;\n /** How the CLI runs. Default: {@link spawnCli}. */\n runner?: CliRunner;\n /** Where sandboxes are created. Default: `os.tmpdir()`. */\n tempDirectory?: string;\n};\n\nfunction readOrNull(file: string): Buffer | null {\n return existsSync(file) ? readFileSync(file) : null;\n}\n\nfunction capDiff(diff: string): string {\n return diff.length > MAX_FILE_DIFF_BYTES\n ? `${diff.slice(0, MAX_FILE_DIFF_BYTES)}\\n… (diff truncated)\\n`\n : diff;\n}\n\n/**\n * Build the {@link GeneratedFile} for one change from the two contents, or\n * `undefined` when they are byte-identical (a file rewritten unchanged).\n */\nfunction describeChange(\n change: SnapshotChange,\n before: Buffer | null,\n after: Buffer | null,\n): GeneratedFile | undefined {\n if (before !== null && after !== null && before.equals(after)) return undefined;\n\n const status: GeneratedFile[\"status\"] =\n before === null ? \"created\" : after === null ? \"deleted\" : \"modified\";\n\n if ((before && isBinary(before)) || (after && isBinary(after))) {\n return { path: change.path, status, diff: \"\", binary: true };\n }\n\n return {\n path: change.path,\n status,\n diff: capDiff(\n unifiedDiff({\n path: change.path,\n before: before === null ? null : before.toString(\"utf8\"),\n after: after === null ? null : after.toString(\"utf8\"),\n }),\n ),\n };\n}\n\nfunction planFrom(\n spec: GeneratorSpec,\n args: string[],\n run: CliRun,\n files: GeneratedFile[],\n): GenerationPlan {\n return {\n spec,\n command: [\"warlock\", ...args],\n ok: run.exitCode === 0 && !run.timedOut,\n exitCode: run.exitCode,\n files,\n output: describeRun(run),\n };\n}\n\n/**\n * The sandbox {@link GenerationBackend}: copies the project's root files and\n * `src/` tree (never `.env` files) into a temporary directory, links the\n * project's `node_modules` into it, runs the real `warlock` command there,\n * and reports every file that changed as a unified diff against the project.\n * The project is never written; the sandbox is always removed.\n *\n * `add` runs with `--no-install`: package.json shows the dependencies it\n * would record, and nothing is downloaded.\n *\n * @example\n * const plan = await sandboxBackend().plan(\n * { type: \"make\", generator: \"service\", name: \"users/send-welcome\" },\n * { cwd: projectRoot },\n * );\n * plan.files.map((file) => `${file.status} ${file.path}`);\n */\nexport function sandboxBackend(options: SandboxBackendOptions = {}): GenerationBackend {\n const runner = options.runner ?? spawnCli;\n\n return {\n async plan(spec, planOptions = {}) {\n const cwd = path.resolve(planOptions.cwd ?? process.cwd());\n const args = buildGeneratorArgs(spec, { install: false });\n const sandbox = mkdtempSync(\n path.join(options.tempDirectory ?? os.tmpdir(), \"warlock-generate-\"),\n );\n\n try {\n copyProjectScope(cwd, sandbox);\n\n const before = snapshotFiles(sandbox, forEachSandboxFile);\n const run = await runner({\n entry: options.cliEntry ?? resolveCliEntry(),\n args,\n cwd: sandbox,\n timeoutMs: planOptions.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS,\n });\n const after = snapshotFiles(sandbox, forEachSandboxFile);\n const files = compareSnapshots(before, after).flatMap((change) => {\n // Compared with the PROJECT, not the sandbox copy: a file outside the\n // copied scope that the project already has is a change, not a creation.\n const file = describeChange(\n change,\n readOrNull(path.join(cwd, change.path)),\n change.status === \"deleted\" ? null : readOrNull(path.join(sandbox, change.path)),\n );\n\n return file ? [file] : [];\n });\n\n return planFrom(spec, args, run, files);\n } finally {\n rmSync(sandbox, { recursive: true, force: true });\n }\n },\n };\n}\n\n/** Options of {@link applyGeneration}. */\nexport type ApplyGenerationOptions = GenerationPlanOptions & {\n /** The `warlock` bin to run. Default: {@link resolveCliEntry}. */\n cliEntry?: string;\n /** How the CLI runs. Default: {@link spawnCli}. */\n runner?: CliRunner;\n /** For `add`: install the packages it records. Default `true`. */\n install?: boolean;\n};\n\n/**\n * Run a generation in the real project and report what it changed, as a\n * {@link GenerationPlan} whose diffs compare the files before and after.\n *\n * Only the generation scope (root files and `src/`, never `.env` files) is\n * compared. This WRITES the project: `warlock mcp` exposes it only with\n * `--allow-writes`.\n */\nexport async function applyGeneration(\n spec: GeneratorSpec,\n options: ApplyGenerationOptions = {},\n): Promise<GenerationPlan> {\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const args = buildGeneratorArgs(spec, { install: options.install ?? true });\n const contents = new Map<string, Buffer>();\n\n forEachScopedFile(cwd, (absolute, relative) => {\n contents.set(relative, readFileSync(absolute));\n });\n\n const before = snapshotFiles(cwd, forEachScopedFile);\n const run = await (options.runner ?? spawnCli)({\n entry: options.cliEntry ?? resolveCliEntry(),\n args,\n cwd,\n timeoutMs: options.timeoutMs ?? DEFAULT_GENERATION_TIMEOUT_MS,\n });\n const after = snapshotFiles(cwd, forEachScopedFile);\n const files = compareSnapshots(before, after).flatMap((change) => {\n const file = describeChange(\n change,\n contents.get(change.path) ?? null,\n change.status === \"deleted\" ? null : readOrNull(path.join(cwd, change.path)),\n );\n\n return file ? [file] : [];\n });\n\n return planFrom(spec, args, run, files);\n}\n"],"mappings":";;;;;;;;;;AAwBA,MAAa,sBAAsB;AAsDnC,SAAS,WAAW,MAA6B;CAC/C,OAAO,WAAW,IAAI,IAAI,aAAa,IAAI,IAAI;AACjD;AAEA,SAAS,QAAQ,MAAsB;CACrC,OAAO,KAAK,kBACR,GAAG,KAAK,MAAM,GAAG,mBAAmB,EAAE,0BACtC;AACN;;;;;AAMA,SAAS,eACP,QACA,QACA,OAC2B;CAC3B,IAAI,WAAW,QAAQ,UAAU,QAAQ,OAAO,OAAO,KAAK,GAAG,OAAO;CAEtE,MAAM,SACJ,WAAW,OAAO,YAAY,UAAU,OAAO,YAAY;CAE7D,IAAK,UAAU,SAAS,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W,YAAY,OAAO,WAAW,KAAK,KAAK,SAAS,OAAO,IAAI,CAAC,CACjF;IAEA,OAAO,OAAO,CAAC,IAAI,IAAI,CAAC;GAC1B,CAEqC,CAAC;EACxC,UAAU;GACR,OAAO,SAAS;IAAE,WAAW;IAAM,OAAO;GAAK,CAAC;EAClD;CACF,EACF;AACF;;;;;;;;;AAoBA,eAAsB,gBACpB,MACA,UAAkC,CAAC,GACV;CACzB,MAAM,MAAM,KAAK,QAAQ,QAAQ,OAAO,QAAQ,IAAI,CAAC;CACrD,MAAM,OAAO,mBAAmB,MAAM,EAAE,SAAS,QAAQ,WAAW,KAAK,CAAC;CAC1E,MAAM,2BAAW,IAAI,IAAoB;CAEzC,kBAAkB,MAAM,UAAU,aAAa;EAC7C,SAAS,IAAI,UAAU,aAAa,QAAQ,CAAC;CAC/C,CAAC;CAED,MAAM,SAAS,cAAc,KAAK,iBAAiB;CACnD,MAAM,MAAM,OAAO,QAAQ,UAAU,SAAQ,CAAE;EAC7C,OAAO,QAAQ,YAAY,gBAAgB;EAC3C;EACA;EACA,WAAW,QAAQ;CACrB,CAAC;CACD,MAAM,QAAQ,cAAc,KAAK,iBAAiB;CAWlD,OAAO,SAAS,MAAM,MAAM,KAVd,iBAAiB,QAAQ,KAAK,CAAC,CAAC,SAAS,WAAW;EAChE,MAAM,OAAO,eACX,QACA,SAAS,IAAI,OAAO,IAAI,KAAK,MAC7B,OAAO,WAAW,YAAY,OAAO,WAAW,KAAK,KAAK,KAAK,OAAO,IAAI,CAAC,CAC7E;EAEA,OAAO,OAAO,CAAC,IAAI,IAAI,CAAC;CAC1B,CAEqC,CAAC;AACxC"}
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* are accepted, and no value can be read as another flag.
|
|
8
8
|
*/
|
|
9
9
|
/** The `warlock generate.<name>` scaffolders. */
|
|
10
|
-
declare const MAKE_GENERATORS: readonly ["module", "controller", "service", "use-case", "model", "repository", "resource", "migration"];
|
|
10
|
+
export declare const MAKE_GENERATORS: readonly ["module", "controller", "service", "use-case", "model", "repository", "resource", "migration"];
|
|
11
11
|
/** One `warlock generate.<name>` scaffolder. */
|
|
12
|
-
type MakeGenerator = (typeof MAKE_GENERATORS)[number];
|
|
12
|
+
export type MakeGenerator = (typeof MAKE_GENERATORS)[number];
|
|
13
13
|
/**
|
|
14
14
|
* The flags each generator declares (see `cli/commands/generate/generate.command.ts`),
|
|
15
15
|
* minus `--dry-run`: the sandbox generates for real into a throwaway copy.
|
|
16
16
|
*/
|
|
17
|
-
declare const MAKE_GENERATOR_FLAGS: Readonly<Record<MakeGenerator, readonly string[]>>;
|
|
17
|
+
export declare const MAKE_GENERATOR_FLAGS: Readonly<Record<MakeGenerator, readonly string[]>>;
|
|
18
18
|
/**
|
|
19
19
|
* A generation request.
|
|
20
20
|
*
|
|
@@ -22,17 +22,18 @@ declare const MAKE_GENERATOR_FLAGS: Readonly<Record<MakeGenerator, readonly stri
|
|
|
22
22
|
* command takes (`users`, `users/create-user`, a model path for `migration`).
|
|
23
23
|
* - `add`: `warlock add <features…>`.
|
|
24
24
|
*/
|
|
25
|
-
type GeneratorSpec = {
|
|
25
|
+
export type GeneratorSpec = {
|
|
26
26
|
type: "make";
|
|
27
27
|
generator: MakeGenerator;
|
|
28
|
-
name: string;
|
|
28
|
+
name: string;
|
|
29
|
+
/** `true` → `--flag`, `false` → `--flag=false`, a string → `--flag=value`. */
|
|
29
30
|
flags?: Record<string, string | boolean>;
|
|
30
31
|
} | {
|
|
31
32
|
type: "add";
|
|
32
33
|
features: string[];
|
|
33
34
|
};
|
|
34
35
|
/** Options of {@link buildGeneratorArgs}. */
|
|
35
|
-
type GeneratorArgsOptions = {
|
|
36
|
+
export type GeneratorArgsOptions = {
|
|
36
37
|
/**
|
|
37
38
|
* For `add`: install the packages (`false` adds `--no-install`, which still
|
|
38
39
|
* records them in package.json). Default `false`.
|
|
@@ -40,7 +41,7 @@ type GeneratorArgsOptions = {
|
|
|
40
41
|
install?: boolean;
|
|
41
42
|
};
|
|
42
43
|
/** Whether a string names a `warlock generate.*` scaffolder. */
|
|
43
|
-
declare function isMakeGenerator(value: string): value is MakeGenerator;
|
|
44
|
+
export declare function isMakeGenerator(value: string): value is MakeGenerator;
|
|
44
45
|
/**
|
|
45
46
|
* The `warlock` arguments (without the `warlock` itself) that run a spec.
|
|
46
47
|
* Throws on an unknown generator, flag or feature, or an unsafe name or value.
|
|
@@ -51,7 +52,6 @@ declare function isMakeGenerator(value: string): value is MakeGenerator;
|
|
|
51
52
|
* buildGeneratorArgs({ type: "add", features: ["devtools"] });
|
|
52
53
|
* // ["add", "devtools", "--no-install"]
|
|
53
54
|
*/
|
|
54
|
-
declare function buildGeneratorArgs(spec: GeneratorSpec, options?: GeneratorArgsOptions): string[];
|
|
55
|
+
export declare function buildGeneratorArgs(spec: GeneratorSpec, options?: GeneratorArgsOptions): string[];
|
|
55
56
|
//#endregion
|
|
56
|
-
export { GeneratorArgsOptions, GeneratorSpec, MAKE_GENERATORS, MAKE_GENERATOR_FLAGS, MakeGenerator, buildGeneratorArgs, isMakeGenerator };
|
|
57
57
|
//# sourceMappingURL=generator-spec.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator-spec.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/generate/generator-spec.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generator-spec.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/generate/generator-spec.ts"],"mappings":";;;;;;;;;qBASa;;YAYD,wBAAwB;;;;;qBAMvB,sBAAsB,SAAS,OAAO;;;;;;;;YAkBvC;EAEN;EACA,WAAW;EACX;;EAEA,QAAQ;;EAGR;EACA;;;YAIM;;;;;EAKV;;;wBAQc,gBAAgB,gBAAgB,SAAS;;;;;;;;;;;wBA+CzC,mBACd,MAAM,eACN,UAAS"}
|
|
@@ -3,4 +3,4 @@ import { DEFAULT_GENERATION_TIMEOUT_MS, describeRun, resolveCliEntry, spawnCli }
|
|
|
3
3
|
import { DIFF_CONTEXT_LINES, unifiedDiff } from "./unified-diff.mjs";
|
|
4
4
|
import { MAX_FILE_DIFF_BYTES, applyGeneration, sandboxBackend } from "./generation.mjs";
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { DEFAULT_GENERATION_TIMEOUT_MS, DIFF_CONTEXT_LINES, MAKE_GENERATORS, MAKE_GENERATOR_FLAGS, MAX_FILE_DIFF_BYTES, applyGeneration, buildGeneratorArgs, describeRun, isMakeGenerator, resolveCliEntry, sandboxBackend, spawnCli, unifiedDiff };
|
|
@@ -13,9 +13,9 @@ import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, symlink
|
|
|
13
13
|
* or diffed: they hold secrets, and a diff is text an agent will read.
|
|
14
14
|
*/
|
|
15
15
|
/** Directory names never entered anywhere. */
|
|
16
|
-
const SKIPPED_DIRECTORIES = new Set([".git", "node_modules"]);
|
|
16
|
+
const SKIPPED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
17
17
|
/** Root directories outside the scope that a sandbox still never copies (listed for the walk of a sandbox). */
|
|
18
|
-
const SKIPPED_ROOT_DIRECTORIES = new Set([
|
|
18
|
+
const SKIPPED_ROOT_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
19
19
|
".git",
|
|
20
20
|
"node_modules",
|
|
21
21
|
".warlock",
|
|
@@ -117,5 +117,5 @@ function isBinary(content) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
//#endregion
|
|
120
|
-
export { compareSnapshots, copyProjectScope, forEachSandboxFile, forEachScopedFile, isBinary, snapshotFiles };
|
|
120
|
+
export { compareSnapshots, copyProjectScope, forEachSandboxFile, forEachScopedFile, isBinary, isEnvFile, snapshotFiles };
|
|
121
121
|
//# sourceMappingURL=project-files.mjs.map
|