@warlock.js/core 5.30.0 → 5.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +165 -36
- package/README.md +28 -23
- package/bin/source-load-hook.mjs +63 -0
- package/bin/warlock.js +102 -42
- package/esm/application/app.d.mts +3 -3
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/application-config-types.d.mts +1 -2
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +5 -7
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +3 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/application/boot-signal.d.mts +14 -12
- package/esm/application/boot-signal.d.mts.map +1 -1
- package/esm/application/index.d.mts +2 -1
- package/esm/application/index.mjs +1 -1
- package/esm/application/public-url.d.mts +1 -2
- package/esm/application/public-url.d.mts.map +1 -1
- package/esm/application/roles.d.mts +10 -11
- package/esm/application/roles.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -3
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -3
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -3
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/index.mjs +1 -1
- package/esm/benchmark/profiler.d.mts +1 -3
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +2 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +22 -17
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -2
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap.d.mts +1 -2
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +3 -5
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/index.d.mts +2 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cli/cli-commands.manager.mjs +6 -3
- package/esm/cli/cli-commands.manager.mjs.map +1 -1
- package/esm/cli/commands/add.command.mjs +4 -2
- package/esm/cli/commands/add.command.mjs.map +1 -1
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs +70 -0
- package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -0
- package/esm/cli/commands/agents-md.command.mjs +38 -0
- package/esm/cli/commands/agents-md.command.mjs.map +1 -0
- package/esm/cli/commands/board/board-command.action.mjs +279 -0
- package/esm/cli/commands/board/board-command.action.mjs.map +1 -0
- package/esm/cli/commands/board.command.mjs +78 -0
- package/esm/cli/commands/board.command.mjs.map +1 -0
- package/esm/cli/commands/build.command.mjs +6 -1
- package/esm/cli/commands/build.command.mjs.map +1 -1
- package/esm/cli/commands/check/check-command.action.mjs +57 -0
- package/esm/cli/commands/check/check-command.action.mjs.map +1 -0
- package/esm/cli/commands/check/child-typecheck.mjs +66 -0
- package/esm/cli/commands/check/child-typecheck.mjs.map +1 -0
- package/esm/cli/commands/check/format-problems.mjs +43 -0
- package/esm/cli/commands/check/format-problems.mjs.map +1 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs +61 -0
- package/esm/cli/commands/check/typecheck-command.action.mjs.map +1 -0
- package/esm/cli/commands/check.command.mjs +50 -0
- package/esm/cli/commands/check.command.mjs.map +1 -0
- package/esm/cli/commands/dev-server.command.mjs +12 -3
- package/esm/cli/commands/dev-server.command.mjs.map +1 -1
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs +8 -3
- package/esm/cli/commands/doctor/boot-for-diagnostics.mjs.map +1 -1
- package/esm/cli/commands/doctor/check.types.d.mts +89 -0
- package/esm/cli/commands/doctor/check.types.d.mts.map +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/config.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/connectors.check.mjs +2 -0
- package/esm/cli/commands/doctor/checks/connectors.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/handler-signature.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/health.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/health.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +23 -27
- package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs +1 -0
- package/esm/cli/commands/doctor/checks/optional-peers.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs +4 -0
- package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/checks/routes.check.mjs +3 -0
- package/esm/cli/commands/doctor/checks/routes.check.mjs.map +1 -1
- package/esm/cli/commands/doctor/doctor-command.action.mjs +15 -6
- package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
- package/esm/cli/commands/doctor/format-report.mjs +30 -2
- package/esm/cli/commands/doctor/format-report.mjs.map +1 -1
- package/esm/cli/commands/doctor.command.mjs +4 -0
- package/esm/cli/commands/doctor.command.mjs.map +1 -1
- package/esm/cli/commands/explain/explain-command.action.mjs +64 -0
- package/esm/cli/commands/explain/explain-command.action.mjs.map +1 -0
- package/esm/cli/commands/explain.command.mjs +23 -0
- package/esm/cli/commands/explain.command.mjs.map +1 -0
- package/esm/cli/commands/generate/generate.command.mjs +124 -124
- package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs +313 -0
- package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -0
- package/esm/cli/commands/generate/generators/migration.generator.mjs +1 -1
- package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +4 -3
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +341 -0
- package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -0
- package/esm/cli/commands/generate/templates/stubs.mjs +19 -6
- package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs +136 -0
- package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -0
- package/esm/cli/commands/generate/utils/name-parser.mjs +2 -2
- package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
- package/esm/cli/commands/generate/utils/prompt.mjs.map +1 -1
- package/esm/cli/commands/generate/utils/writer.mjs +38 -13
- package/esm/cli/commands/generate/utils/writer.mjs.map +1 -1
- package/esm/cli/commands/inspect/inspect-command.action.mjs +73 -0
- package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -0
- package/esm/cli/commands/inspect.command.mjs +39 -0
- package/esm/cli/commands/inspect.command.mjs.map +1 -0
- package/esm/cli/commands/issue/collect-environment.mjs +187 -0
- package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
- package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
- package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
- package/esm/cli/commands/issue.command.mjs +31 -0
- package/esm/cli/commands/issue.command.mjs.map +1 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs +104 -0
- package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -0
- package/esm/cli/commands/mcp.command.mjs +76 -0
- package/esm/cli/commands/mcp.command.mjs.map +1 -0
- package/esm/cli/commands/openapi-generator.action.mjs +1 -1
- package/esm/cli/commands/openapi-generator.action.mjs.map +1 -1
- package/esm/cli/commands/openapi-generator.command.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.action.mjs +1 -1
- package/esm/cli/commands/postman-generator.action.mjs.map +1 -1
- package/esm/cli/commands/postman-generator.command.mjs.map +1 -1
- package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
- package/esm/cli/commands/routes/route-row.mjs +1 -1
- package/esm/cli/commands/routes/routes-diff.action.mjs +3 -3
- package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
- package/esm/cli/commands/test.command.mjs +131 -0
- package/esm/cli/commands/test.command.mjs.map +1 -0
- package/esm/cli/commands/trace/trace-command.action.mjs +145 -0
- package/esm/cli/commands/trace/trace-command.action.mjs.map +1 -0
- package/esm/cli/commands/trace.command.mjs +60 -0
- package/esm/cli/commands/trace.command.mjs.map +1 -0
- package/esm/cli/commands/typecheck.command.mjs +40 -0
- package/esm/cli/commands/typecheck.command.mjs.map +1 -0
- package/esm/cli/commands/upgrade.command.mjs +46 -0
- package/esm/cli/commands/upgrade.command.mjs.map +1 -0
- package/esm/cli/commands-loader.mjs +1 -1
- package/esm/cli/flush-and-exit.mjs +34 -0
- package/esm/cli/flush-and-exit.mjs.map +1 -0
- package/esm/cli/framework-cli-commands.mjs +25 -1
- package/esm/cli/framework-cli-commands.mjs.map +1 -1
- package/esm/cli/parse-cli-args.mjs +3 -2
- package/esm/cli/parse-cli-args.mjs.map +1 -1
- package/esm/cli/start.d.mts +1 -1
- package/esm/cli/string-similarity.mjs +1 -1
- package/esm/commands/cli-command.d.mts +2 -4
- package/esm/commands/cli-command.d.mts.map +1 -1
- package/esm/commands/index.d.mts +2 -1
- package/esm/commands/index.mjs +1 -1
- package/esm/commands/types.d.mts +8 -8
- package/esm/commands/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +2 -3
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +5 -5
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -3
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-loader.d.mts +1 -2
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +35 -14
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-schema.d.mts +70 -0
- package/esm/config/config-schema.d.mts.map +1 -0
- package/esm/config/config-schema.mjs +77 -0
- package/esm/config/config-schema.mjs.map +1 -0
- package/esm/config/config-setter.d.mts +2 -4
- package/esm/config/config-setter.d.mts.map +1 -1
- package/esm/config/config-setter.mjs +2 -2
- package/esm/config/config-setter.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +2 -4
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/index.d.mts +7 -0
- package/esm/config/index.mjs +2 -1
- package/esm/config/types.d.mts +4 -5
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +1 -3
- package/esm/connectors/access-connector.d.mts.map +1 -1
- package/esm/connectors/access-connector.mjs +2 -2
- package/esm/connectors/access-connector.mjs.map +1 -1
- package/esm/connectors/ai-connector.d.mts +1 -3
- package/esm/connectors/ai-connector.d.mts.map +1 -1
- package/esm/connectors/ai-connector.mjs +2 -2
- package/esm/connectors/ai-connector.mjs.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
- package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs +2 -1
- package/esm/connectors/assert-no-reserved-connector-names.mjs.map +1 -1
- package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
- package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
- package/esm/connectors/assert-unique-connector-names.mjs +26 -1
- package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
- package/esm/connectors/base-connector.d.mts +1 -3
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -3
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +2 -4
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +2 -2
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -3
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +2 -2
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/describe-server-address.mjs +4 -4
- package/esm/connectors/describe-server-address.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -3
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +2 -2
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -3
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +11 -9
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -1
- package/esm/connectors/index.mjs +1 -1
- package/esm/connectors/logger-connector.d.mts +1 -3
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +2 -2
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -3
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +2 -2
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +1 -3
- package/esm/connectors/notifications-connector.d.mts.map +1 -1
- package/esm/connectors/notifications-connector.mjs +2 -2
- package/esm/connectors/notifications-connector.mjs.map +1 -1
- package/esm/connectors/register-configured-connectors.d.mts +2 -4
- package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
- package/esm/connectors/single-server-warnings.mjs.map +1 -1
- package/esm/connectors/socket-connector.d.mts +1 -3
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +12 -10
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -3
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +2 -2
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +17 -14
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/container/container-instance-registry.mjs.map +1 -1
- package/esm/container/development-app-modules.d.mts +7 -5
- package/esm/container/development-app-modules.d.mts.map +1 -1
- package/esm/container/development-model-modules.d.mts +6 -5
- package/esm/container/development-model-modules.d.mts.map +1 -1
- package/esm/container/index.d.mts +4 -4
- package/esm/container/index.d.mts.map +1 -1
- package/esm/container/index.mjs.map +1 -1
- package/esm/database/index.d.mts +3 -1
- package/esm/database/index.mjs +1 -1
- package/esm/database/migrate-action.mjs +1 -1
- package/esm/database/migrate-action.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.d.mts +2 -31
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/index.d.mts +2 -1
- package/esm/database/models/database-log/index.mjs +1 -1
- package/esm/database/seed-command-action.mjs +1 -1
- package/esm/database/seeds/seeder.d.mts +2 -4
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.d.mts +6 -3
- package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
- package/esm/database/seeds/seeder.errors.mjs +2 -0
- package/esm/database/seeds/seeder.errors.mjs.map +1 -1
- package/esm/database/seeds/seeders.manager.mjs +2 -1
- package/esm/database/seeds/seeders.manager.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +7 -8
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +4 -5
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/dev-server/app-module-registry.mjs +1 -1
- package/esm/dev-server/boot-precondition-error.mjs +1 -0
- package/esm/dev-server/boot-precondition-error.mjs.map +1 -1
- package/esm/dev-server/create-worker.mjs +17 -9
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -3
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/dev-agent-tooling.mjs +135 -0
- package/esm/dev-server/dev-agent-tooling.mjs.map +1 -0
- package/esm/dev-server/dev-logger.mjs.map +1 -1
- package/esm/dev-server/development-server.mjs +8 -0
- package/esm/dev-server/development-server.mjs.map +1 -1
- package/esm/dev-server/extract-translation-keys.mjs +16 -17
- package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +3 -7
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -3
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs +4 -5
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/files-watcher.mjs +12 -11
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +2 -3
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs +33 -0
- package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs.map +1 -0
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/default-health-checkers.mjs +31 -0
- package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -0
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +12 -6
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +16 -4
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/oxlint-runner.mjs +303 -0
- package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -0
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs +42 -0
- package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs.map +1 -0
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/hook-thread.d.mts +4 -8
- package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.d.mts +10 -6
- package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/load-hook.mjs +4 -3
- package/esm/dev-server/loader/load-hook.mjs.map +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs +1 -1
- package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -1
- package/esm/dev-server/loader/own-resolver.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs +4 -3
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
- package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
- package/esm/dev-server/loader/resolve-hook.mjs +3 -2
- package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +3 -2
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -3
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/model-module-registry.mjs +3 -3
- package/esm/dev-server/model-module-registry.mjs.map +1 -1
- package/esm/dev-server/model-resource-typings.mjs +40 -47
- package/esm/dev-server/model-resource-typings.mjs.map +1 -1
- package/esm/dev-server/module-loader.mjs +3 -2
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs +7 -39
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/read-config-ast.mjs +3 -33
- package/esm/dev-server/read-config-ast.mjs.map +1 -1
- package/esm/dev-server/ready-block.mjs +1 -1
- package/esm/dev-server/route-types-publisher.mjs +1 -1
- package/esm/dev-server/shortcuts.mjs +1 -1
- package/esm/dev-server/special-files-collector.d.mts +2 -4
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/start-development-server.mjs.map +1 -1
- package/esm/dev-server/supervisor.mjs +1 -1
- package/esm/dev-server/translation-keys-sources.mjs +1 -1
- package/esm/dev-server/translation-keys-sources.mjs.map +1 -1
- package/esm/dev-server/tsconfig-manager.mjs +3 -3
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/type-generator.mjs +31 -38
- package/esm/dev-server/type-generator.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +3 -4
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/update-check-cache.mjs +2 -2
- package/esm/dev-server/update-check-cache.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +2 -3
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/hash.d.mts +1 -2
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/index.mjs +1 -1
- package/esm/encryption/password.d.mts +2 -3
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/types.d.mts +2 -3
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/errors/container-key-missing-error.mjs +1 -0
- package/esm/errors/container-key-missing-error.mjs.map +1 -1
- package/esm/errors/error-codes.d.mts +660 -0
- package/esm/errors/error-codes.d.mts.map +1 -0
- package/esm/errors/error-codes.mjs +634 -0
- package/esm/errors/error-codes.mjs.map +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs +1 -0
- package/esm/errors/esbuild-binary-missing-error.mjs.map +1 -1
- package/esm/errors/index.d.mts +3 -1
- package/esm/errors/index.mjs +3 -1
- package/esm/errors/unknown-locale-error.mjs +1 -0
- package/esm/errors/unknown-locale-error.mjs.map +1 -1
- package/esm/errors/warlock-error.d.mts +21 -0
- package/esm/errors/warlock-error.d.mts.map +1 -0
- package/esm/errors/warlock-error.mjs +22 -0
- package/esm/errors/warlock-error.mjs.map +1 -0
- package/esm/generations/add-command.action.mjs +22 -5
- package/esm/generations/add-command.action.mjs.map +1 -1
- package/esm/generations/features/access.feature.mjs +1 -1
- package/esm/generations/features/access.feature.mjs.map +1 -1
- package/esm/generations/features/bull-board.feature.mjs +3 -2
- package/esm/generations/features/bull-board.feature.mjs.map +1 -1
- package/esm/generations/features/mysql.feature.mjs.map +1 -1
- package/esm/generations/features/notifications.feature.mjs +7 -3
- package/esm/generations/features/notifications.feature.mjs.map +1 -1
- package/esm/generations/features/queue.feature.mjs +1 -1
- package/esm/generations/features/queue.feature.mjs.map +1 -1
- package/esm/generations/features/react-email.feature.mjs +1 -1
- package/esm/generations/features/react-email.feature.mjs.map +1 -1
- package/esm/generations/features/shadcn.feature.mjs +1 -1
- package/esm/generations/features/shadcn.feature.mjs.map +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs +1 -1
- package/esm/generations/features/shared/link-ai-package-import.mjs.map +1 -1
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
- package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
- package/esm/generations/features/shared/patch-tsconfig-include.mjs +2 -2
- package/esm/generations/features/shared/patch-tsconfig-include.mjs.map +1 -1
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +2 -2
- package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -1
- package/esm/generations/features/sitemap.feature.mjs +3 -2
- package/esm/generations/features/sitemap.feature.mjs.map +1 -1
- package/esm/generations/features/tailwind.feature.mjs +1 -1
- package/esm/generations/features/tailwind.feature.mjs.map +1 -1
- package/esm/generations/features/test.feature.mjs +11 -6
- package/esm/generations/features/test.feature.mjs.map +1 -1
- package/esm/generations/features/web.feature.mjs +1 -1
- package/esm/generations/features/web.feature.mjs.map +1 -1
- package/esm/generations/generation-fs.mjs +73 -0
- package/esm/generations/generation-fs.mjs.map +1 -0
- package/esm/generations/generation-run.mjs +185 -0
- package/esm/generations/generation-run.mjs.map +1 -0
- package/esm/generations/stubs.mjs +156 -14
- package/esm/generations/stubs.mjs.map +1 -1
- package/esm/http/boot-port-preflight.d.mts +4 -5
- package/esm/http/boot-port-preflight.d.mts.map +1 -1
- package/esm/http/boot-port-preflight.mjs +2 -2
- package/esm/http/boot-port-preflight.mjs.map +1 -1
- package/esm/http/bounded-stream-queue.d.mts +10 -0
- package/esm/http/bounded-stream-queue.d.mts.map +1 -0
- package/esm/http/bounded-stream-queue.mjs +97 -0
- package/esm/http/bounded-stream-queue.mjs.map +1 -0
- package/esm/http/build-cors-options.mjs +2 -2
- package/esm/http/build-cors-options.mjs.map +1 -1
- package/esm/http/build-rate-limit-options.d.mts +15 -3
- package/esm/http/build-rate-limit-options.d.mts.map +1 -1
- package/esm/http/build-rate-limit-options.mjs +1 -1
- package/esm/http/build-rate-limit-options.mjs.map +1 -1
- package/esm/http/conditional-request.d.mts +87 -0
- package/esm/http/conditional-request.d.mts.map +1 -0
- package/esm/http/conditional-request.mjs +121 -0
- package/esm/http/conditional-request.mjs.map +1 -0
- package/esm/http/config.d.mts +2 -4
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +2 -2
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +6 -7
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-memo.d.mts +1 -2
- package/esm/http/context/request-memo.d.mts.map +1 -1
- package/esm/http/createHttpApplication.d.mts +2 -3
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +2 -2
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/csp.d.mts +12 -12
- package/esm/http/csp.d.mts.map +1 -1
- package/esm/http/csp.mjs +3 -2
- package/esm/http/csp.mjs.map +1 -1
- package/esm/http/csrf-default-guard.d.mts +2 -4
- package/esm/http/csrf-default-guard.d.mts.map +1 -1
- package/esm/http/csrf-default-guard.mjs +1 -1
- package/esm/http/csrf-default-guard.mjs.map +1 -1
- package/esm/http/csrf-origin-policy.d.mts +7 -9
- package/esm/http/csrf-origin-policy.d.mts.map +1 -1
- package/esm/http/csrf-origin-policy.mjs +2 -2
- package/esm/http/csrf-origin-policy.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +26 -87
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/error-codes.d.mts +1 -2
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-mapper.d.mts +2 -4
- package/esm/http/error-mapper.d.mts.map +1 -1
- package/esm/http/error-mapper.mjs +2 -2
- package/esm/http/error-mapper.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +30 -29
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/errors/errors.mjs +1 -0
- package/esm/http/errors/errors.mjs.map +1 -1
- package/esm/http/escape-header-value.d.mts +17 -0
- package/esm/http/escape-header-value.d.mts.map +1 -0
- package/esm/http/escape-header-value.mjs +27 -0
- package/esm/http/escape-header-value.mjs.map +1 -0
- package/esm/http/events.d.mts +2 -4
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/flush-pending-cookies.mjs.map +1 -1
- package/esm/http/health.d.mts +4 -4
- package/esm/http/health.d.mts.map +1 -1
- package/esm/http/index.d.mts +9 -3
- package/esm/http/index.mjs +5 -2
- package/esm/http/lazy-static.mjs +194 -0
- package/esm/http/lazy-static.mjs.map +1 -0
- package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/index.d.mts +3 -1
- package/esm/http/middleware/index.mjs +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +2 -4
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +4 -4
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -3
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/index.d.mts +2 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -2
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +2 -2
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +2 -4
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +17 -14
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/port-preflight.d.mts +3 -4
- package/esm/http/port-preflight.d.mts.map +1 -1
- package/esm/http/rate-limit-cache-store.mjs +6 -4
- package/esm/http/rate-limit-cache-store.mjs.map +1 -1
- package/esm/http/ready-report.d.mts +15 -10
- package/esm/http/ready-report.d.mts.map +1 -1
- package/esm/http/request-controller.d.mts +1 -3
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.d.mts +26 -15
- package/esm/http/request-log-snapshot.d.mts.map +1 -1
- package/esm/http/request-log-snapshot.mjs +85 -6
- package/esm/http/request-log-snapshot.mjs.map +1 -1
- package/esm/http/request.d.mts +6 -5
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +13 -11
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +23 -12
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +169 -81
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/safe-redirect.d.mts +50 -0
- package/esm/http/safe-redirect.d.mts.map +1 -0
- package/esm/http/safe-redirect.mjs +80 -0
- package/esm/http/safe-redirect.mjs.map +1 -0
- package/esm/http/serialized.d.mts +12 -13
- package/esm/http/serialized.d.mts.map +1 -1
- package/esm/http/server-rebuilt.d.mts +3 -5
- package/esm/http/server-rebuilt.d.mts.map +1 -1
- package/esm/http/server.d.mts +11 -9
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +17 -7
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/stream-react-response.d.mts +7 -7
- package/esm/http/stream-react-response.d.mts.map +1 -1
- package/esm/http/stream-transport.mjs +4 -2
- package/esm/http/stream-transport.mjs.map +1 -1
- package/esm/http/tracing/index.mjs +1 -1
- package/esm/http/tracing/trace-id.d.mts +2 -3
- package/esm/http/tracing/trace-id.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
- package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
- package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
- package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
- package/esm/http/tracing/tracing.type.d.mts +11 -9
- package/esm/http/tracing/tracing.type.d.mts.map +1 -1
- package/esm/http/types.d.mts +78 -39
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +6 -5
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variant.mjs +1 -1
- package/esm/http/uploads/generate-image-variants.d.mts +13 -10
- package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/generate-image-variants.mjs +62 -25
- package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
- package/esm/http/uploads/image-variant-cache-entries.mjs +78 -0
- package/esm/http/uploads/image-variant-cache-entries.mjs.map +1 -0
- package/esm/http/uploads/image-variant-cache.mjs +72 -30
- package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
- package/esm/http/uploads/image-variant-types.d.mts +9 -9
- package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.d.mts +4 -3
- package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
- package/esm/http/uploads/image-variants-config-error.mjs +3 -2
- package/esm/http/uploads/image-variants-config-error.mjs.map +1 -1
- package/esm/http/uploads/index.d.mts +2 -1
- package/esm/http/uploads/index.mjs +1 -1
- package/esm/http/uploads/load-variant-source.mjs +1 -1
- package/esm/http/uploads/load-variant-source.mjs.map +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
- package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
- package/esm/http/uploads/purge-image-variants.d.mts +9 -6
- package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
- package/esm/http/uploads/purge-image-variants.mjs +16 -16
- package/esm/http/uploads/purge-image-variants.mjs.map +1 -1
- package/esm/http/uploads/remote-variant-source.mjs +115 -0
- package/esm/http/uploads/remote-variant-source.mjs.map +1 -0
- package/esm/http/uploads/resolve-image-variant.d.mts +6 -9
- package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
- package/esm/http/uploads/resolve-image-variant.mjs +10 -18
- package/esm/http/uploads/resolve-image-variant.mjs.map +1 -1
- package/esm/http/uploads/resolve-image-variants-config.mjs +7 -5
- package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
- package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
- package/esm/http/uploads/resolve-remote-image-variant.mjs +89 -0
- package/esm/http/uploads/resolve-remote-image-variant.mjs.map +1 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs +193 -0
- package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -0
- package/esm/http/uploads/uploaded-file.controller.d.mts +9 -6
- package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
- package/esm/http/uploads/uploaded-file.controller.mjs +18 -9
- package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
- package/esm/http/uploads/variant-cache-key.mjs +2 -2
- package/esm/http/uploads-config.d.mts +2 -4
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-types.d.mts +22 -16
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/http/xmlable.d.mts +1 -2
- package/esm/http/xmlable.d.mts.map +1 -1
- package/esm/image/image.d.mts +6 -7
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/image/index.d.mts +2 -1
- package/esm/image/index.mjs +1 -1
- package/esm/index.d.mts +38 -6
- package/esm/index.mjs +14 -3
- package/esm/loader/app-module-importer.d.mts +1 -2
- package/esm/loader/app-module-importer.d.mts.map +1 -1
- package/esm/localization/index.mjs +1 -1
- package/esm/localization/parse-locale-dictionary.d.mts +6 -5
- package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/parse-locale-dictionary.mjs +2 -1
- package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
- package/esm/localization/register-locale-dictionary.d.mts +3 -4
- package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
- package/esm/localization/register-locale-dictionary.mjs +2 -2
- package/esm/localization/register-locale-dictionary.mjs.map +1 -1
- package/esm/logger/fatal-visibility.d.mts +1 -2
- package/esm/logger/fatal-visibility.d.mts.map +1 -1
- package/esm/logger/index.d.mts +2 -1
- package/esm/logger/index.mjs +1 -1
- package/esm/logger/logger.d.mts +1 -3
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/types.d.mts +2 -3
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +21 -12
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/config.mjs +16 -1
- package/esm/mail/config.mjs.map +1 -1
- package/esm/mail/events.d.mts +4 -6
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/index.d.mts +3 -2
- package/esm/mail/index.mjs +2 -2
- package/esm/mail/mail.d.mts +1 -3
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mailer-pool.d.mts +5 -7
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -3
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -3
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +2 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +11 -13
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/types.d.mts +17 -18
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/manifest/manifest-manager.mjs +1 -1
- package/esm/net/index.d.mts +2 -0
- package/esm/net/index.mjs +3 -0
- package/esm/openapi/build-openapi-document.d.mts +2 -4
- package/esm/openapi/build-openapi-document.d.mts.map +1 -1
- package/esm/openapi/build-openapi-document.mjs +8 -5
- package/esm/openapi/build-openapi-document.mjs.map +1 -1
- package/esm/openapi/cast-schema.mjs +1 -1
- package/esm/openapi/development-openapi-provider.d.mts +5 -6
- package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
- package/esm/openapi/error-responses.mjs +28 -2
- package/esm/openapi/error-responses.mjs.map +1 -1
- package/esm/openapi/index.d.mts +3 -1
- package/esm/openapi/index.mjs +1 -1
- package/esm/openapi/openapi-child-output.mjs +2 -2
- package/esm/openapi/openapi-child-output.mjs.map +1 -1
- package/esm/openapi/postman/build-request-body.mjs.map +1 -1
- package/esm/openapi/postman/build-request-url.mjs +1 -1
- package/esm/openapi/postman/build-request-url.mjs.map +1 -1
- package/esm/openapi/postman/build-saved-responses.mjs.map +1 -1
- package/esm/openapi/postman/example-from-schema.d.mts +1 -3
- package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
- package/esm/openapi/postman/example-from-schema.mjs.map +1 -1
- package/esm/openapi/postman/index.d.mts +2 -1
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
- package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
- package/esm/openapi/postman/openapi-to-postman-collection.mjs.map +1 -1
- package/esm/openapi/postman/postman-types.d.mts +19 -18
- package/esm/openapi/postman/postman-types.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.d.mts +1 -3
- package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
- package/esm/openapi/postman/schema-refs.mjs.map +1 -1
- package/esm/openapi/postman/uuid-v5.mjs +1 -1
- package/esm/openapi/postman/uuid-v5.mjs.map +1 -1
- package/esm/openapi/request-schemas.mjs.map +1 -1
- package/esm/openapi/response-schemas.mjs.map +1 -1
- package/esm/openapi/schema-registry.d.mts +1 -0
- package/esm/openapi/schema-registry.mjs.map +1 -1
- package/esm/openapi/security.mjs +1 -1
- package/esm/openapi/security.mjs.map +1 -1
- package/esm/openapi/types.d.mts +23 -20
- package/esm/openapi/types.d.mts.map +1 -1
- package/esm/production/assert-generated-imports.mjs +2 -1
- package/esm/production/assert-generated-imports.mjs.map +1 -1
- package/esm/production/build-contributions.mjs +1 -1
- package/esm/production/bundle-framework-dependencies.mjs +1 -1
- package/esm/production/dist-build-manifest.mjs +1 -1
- package/esm/production/esbuild-plugins.mjs.map +1 -1
- package/esm/production/esbuild-preflight.mjs +1 -1
- package/esm/production/production-builder.mjs +14 -5
- package/esm/production/production-builder.mjs.map +1 -1
- package/esm/production/production-supervisor.mjs +1 -1
- package/esm/production/registration-child-runner.mjs +4 -3
- package/esm/production/registration-child-runner.mjs.map +1 -1
- package/esm/production/resolve-build-config.d.mts +4 -4
- package/esm/production/resolve-build-config.d.mts.map +1 -1
- package/esm/production/resolve-build-config.mjs +2 -1
- package/esm/production/resolve-build-config.mjs.map +1 -1
- package/esm/production/route-registration-child.d.mts +1 -1
- package/esm/production/route-registration-child.mjs +8 -7
- package/esm/production/route-registration-child.mjs.map +1 -1
- package/esm/production/route-registration-snapshot.mjs.map +1 -1
- package/esm/production/tsconfig-path-aliases.mjs +1 -1
- package/esm/react/index.d.mts +1 -3
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/index.d.mts +2 -1
- package/esm/repositories/adapters/cascade/index.mjs +1 -1
- package/esm/repositories/contracts/index.d.mts +2 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +23 -25
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/index.d.mts +4 -1
- package/esm/repositories/index.mjs +1 -1
- package/esm/repositories/repository.manager.d.mts +2 -3
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +2 -2
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +3 -5
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/index.d.mts +2 -1
- package/esm/resource/index.mjs +1 -1
- package/esm/resource/nullable-resource.d.mts +5 -7
- package/esm/resource/nullable-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -3
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -3
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource.d.mts +3 -5
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +4 -2
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +21 -21
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/index.d.mts +2 -1
- package/esm/restful/index.mjs +1 -1
- package/esm/restful/restful.d.mts +11 -31
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/restful/restful.mjs.map +1 -1
- package/esm/router/build-route-rate-limit.mjs.map +1 -1
- package/esm/router/dev-dispatch.mjs +31 -12
- package/esm/router/dev-dispatch.mjs.map +1 -1
- package/esm/router/index.d.mts +5 -2
- package/esm/router/index.mjs +3 -1
- package/esm/router/log-request-lifecycle.mjs.map +1 -1
- package/esm/router/named-api-routes-with-responses.mjs +2 -1
- package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
- package/esm/router/normalize-request-path.d.mts +1 -2
- package/esm/router/normalize-request-path.d.mts.map +1 -1
- package/esm/router/normalize-route-path.d.mts +1 -2
- package/esm/router/normalize-route-path.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.d.mts +15 -13
- package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
- package/esm/router/positional-handler-diagnostics.mjs.map +1 -1
- package/esm/router/resolve-route-rate-limit.mjs +47 -0
- package/esm/router/resolve-route-rate-limit.mjs.map +1 -0
- package/esm/router/resolve-route-validation.mjs +19 -0
- package/esm/router/resolve-route-validation.mjs.map +1 -0
- package/esm/router/route-builder.d.mts +1 -3
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-guard-names.mjs +30 -0
- package/esm/router/route-guard-names.mjs.map +1 -0
- package/esm/router/route-name-method-suffix.d.mts +2 -3
- package/esm/router/route-name-method-suffix.d.mts.map +1 -1
- package/esm/router/route-name-taken-error.d.mts +12 -0
- package/esm/router/route-name-taken-error.d.mts.map +1 -0
- package/esm/router/route-name-taken-error.mjs +18 -0
- package/esm/router/route-name-taken-error.mjs.map +1 -0
- package/esm/router/route-registry.d.mts +1 -3
- package/esm/router/route-registry.d.mts.map +1 -1
- package/esm/router/router.d.mts +34 -17
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +74 -39
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +156 -37
- package/esm/router/types.d.mts.map +1 -1
- package/esm/router/unguarded-route-diagnostics.d.mts +38 -0
- package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -0
- package/esm/router/unguarded-route-diagnostics.mjs +95 -0
- package/esm/router/unguarded-route-diagnostics.mjs.map +1 -0
- package/esm/socket/index.d.mts +2 -1
- package/esm/socket/index.mjs +1 -1
- package/esm/socket/types.d.mts +2 -4
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +1 -3
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/storage/config.d.mts +4 -6
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +3 -4
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +2 -4
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +2 -3
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +8 -3
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -3
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -3
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/index.d.mts +2 -1
- package/esm/storage/index.mjs +1 -1
- package/esm/storage/local-disk-roots.mjs +24 -0
- package/esm/storage/local-disk-roots.mjs.map +1 -0
- package/esm/storage/scoped-storage.d.mts +2 -3
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -3
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage.d.mts +17 -4
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/storage.mjs +22 -0
- package/esm/storage/storage.mjs.map +1 -1
- package/esm/storage/types.d.mts +36 -36
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/classify-ip-address.d.mts +1 -2
- package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
- package/esm/storage/utils/contain-path.d.mts +1 -2
- package/esm/storage/utils/contain-path.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +2 -3
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.d.mts +6 -6
- package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
- package/esm/storage/utils/safe-fetch.mjs +3 -3
- package/esm/storage/utils/safe-fetch.mjs.map +1 -1
- package/esm/storage/utils/storage-capability-error.d.mts +1 -3
- package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-error.d.mts +2 -3
- package/esm/storage/utils/storage-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.d.mts +3 -2
- package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
- package/esm/storage/utils/storage-not-initialized-error.mjs +1 -0
- package/esm/storage/utils/storage-not-initialized-error.mjs.map +1 -1
- package/esm/tests/authenticated-test-client.d.mts +31 -0
- package/esm/tests/authenticated-test-client.d.mts.map +1 -0
- package/esm/tests/authenticated-test-client.mjs +40 -0
- package/esm/tests/authenticated-test-client.mjs.map +1 -0
- package/esm/tests/factories.d.mts +74 -0
- package/esm/tests/factories.d.mts.map +1 -0
- package/esm/tests/factories.mjs +105 -0
- package/esm/tests/factories.mjs.map +1 -0
- package/esm/tests/fakes/cache-fake.d.mts +34 -0
- package/esm/tests/fakes/cache-fake.d.mts.map +1 -0
- package/esm/tests/fakes/cache-fake.mjs +79 -0
- package/esm/tests/fakes/cache-fake.mjs.map +1 -0
- package/esm/tests/fakes/clock-fake.d.mts +37 -0
- package/esm/tests/fakes/clock-fake.d.mts.map +1 -0
- package/esm/tests/fakes/clock-fake.mjs +69 -0
- package/esm/tests/fakes/clock-fake.mjs.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts +12 -0
- package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -0
- package/esm/tests/fakes/fake-assertion-error.mjs +20 -0
- package/esm/tests/fakes/fake-assertion-error.mjs.map +1 -0
- package/esm/tests/fakes/ids-fake.d.mts +23 -0
- package/esm/tests/fakes/ids-fake.d.mts.map +1 -0
- package/esm/tests/fakes/ids-fake.mjs +57 -0
- package/esm/tests/fakes/ids-fake.mjs.map +1 -0
- package/esm/tests/fakes/index.d.mts +9 -0
- package/esm/tests/fakes/index.mjs +10 -0
- package/esm/tests/fakes/mail-fake.d.mts +49 -0
- package/esm/tests/fakes/mail-fake.d.mts.map +1 -0
- package/esm/tests/fakes/mail-fake.mjs +111 -0
- package/esm/tests/fakes/mail-fake.mjs.map +1 -0
- package/esm/tests/fakes/queue-fake.d.mts +56 -0
- package/esm/tests/fakes/queue-fake.d.mts.map +1 -0
- package/esm/tests/fakes/queue-fake.mjs +134 -0
- package/esm/tests/fakes/queue-fake.mjs.map +1 -0
- package/esm/tests/fakes/storage-fake.d.mts +35 -0
- package/esm/tests/fakes/storage-fake.d.mts.map +1 -0
- package/esm/tests/fakes/storage-fake.mjs +122 -0
- package/esm/tests/fakes/storage-fake.mjs.map +1 -0
- package/esm/tests/fakes/test-fakes.d.mts +38 -0
- package/esm/tests/fakes/test-fakes.d.mts.map +1 -0
- package/esm/tests/fakes/test-fakes.mjs +90 -0
- package/esm/tests/fakes/test-fakes.mjs.map +1 -0
- package/esm/tests/index.d.mts +15 -2
- package/esm/tests/index.mjs +15 -2
- package/esm/tests/snapshot-response.d.mts +33 -0
- package/esm/tests/snapshot-response.d.mts.map +1 -0
- package/esm/tests/snapshot-response.mjs +42 -0
- package/esm/tests/snapshot-response.mjs.map +1 -0
- package/esm/tests/start-http-development-server.d.mts +25 -5
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +41 -8
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-connectors-selection.d.mts +2 -2
- package/esm/tests/test-connectors-selection.d.mts.map +1 -1
- package/esm/tests/test-connectors-selection.mjs +1 -1
- package/esm/tests/test-helpers.d.mts +28 -10
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-helpers.mjs +40 -27
- package/esm/tests/test-helpers.mjs.map +1 -1
- package/esm/tests/test-http-server.d.mts +66 -0
- package/esm/tests/test-http-server.d.mts.map +1 -0
- package/esm/tests/test-http-server.mjs +119 -0
- package/esm/tests/test-http-server.mjs.map +1 -0
- package/esm/tests/test-lifecycle-state.mjs +1 -1
- package/esm/tests/vitest-setup.d.mts +17 -7
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +12 -4
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/tooling/agents-md/agents-md-markers.d.mts +26 -0
- package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs +60 -0
- package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts +43 -0
- package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs +72 -0
- package/esm/tooling/agents-md/agents-md-refresher.mjs.map +1 -0
- package/esm/tooling/agents-md/index.mjs +7 -0
- package/esm/tooling/agents-md/installed-skills.d.mts +34 -0
- package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -0
- package/esm/tooling/agents-md/installed-skills.mjs +74 -0
- package/esm/tooling/agents-md/installed-skills.mjs.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts +34 -0
- package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/render-agents-md.mjs +195 -0
- package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts +38 -0
- package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -0
- package/esm/tooling/agents-md/write-agents-md.mjs +49 -0
- package/esm/tooling/agents-md/write-agents-md.mjs.map +1 -0
- package/esm/tooling/board/board-message.d.mts +29 -0
- package/esm/tooling/board/board-message.d.mts.map +1 -0
- package/esm/tooling/board/board-message.mjs +86 -0
- package/esm/tooling/board/board-message.mjs.map +1 -0
- package/esm/tooling/board/board.d.mts +121 -0
- package/esm/tooling/board/board.d.mts.map +1 -0
- package/esm/tooling/board/board.mjs +407 -0
- package/esm/tooling/board/board.mjs.map +1 -0
- package/esm/tooling/board/board.types.d.mts +81 -0
- package/esm/tooling/board/board.types.d.mts.map +1 -0
- package/esm/tooling/board/board.types.mjs +54 -0
- package/esm/tooling/board/board.types.mjs.map +1 -0
- package/esm/tooling/check/changed-files.d.mts +31 -0
- package/esm/tooling/check/changed-files.d.mts.map +1 -0
- package/esm/tooling/check/changed-files.mjs +73 -0
- package/esm/tooling/check/changed-files.mjs.map +1 -0
- package/esm/tooling/check/check-report.types.d.mts +67 -0
- package/esm/tooling/check/check-report.types.d.mts.map +1 -0
- package/esm/tooling/check/check-report.types.mjs +37 -0
- package/esm/tooling/check/check-report.types.mjs.map +1 -0
- package/esm/tooling/check/code-style-conventions.mjs +106 -0
- package/esm/tooling/check/code-style-conventions.mjs.map +1 -0
- package/esm/tooling/check/conventions-step.d.mts +32 -0
- package/esm/tooling/check/conventions-step.d.mts.map +1 -0
- package/esm/tooling/check/conventions-step.mjs +173 -0
- package/esm/tooling/check/conventions-step.mjs.map +1 -0
- package/esm/tooling/check/environment-step.d.mts +16 -0
- package/esm/tooling/check/environment-step.d.mts.map +1 -0
- package/esm/tooling/check/environment-step.mjs +78 -0
- package/esm/tooling/check/environment-step.mjs.map +1 -0
- package/esm/tooling/check/index.mjs +10 -0
- package/esm/tooling/check/lint-step.d.mts +18 -0
- package/esm/tooling/check/lint-step.d.mts.map +1 -0
- package/esm/tooling/check/lint-step.mjs +112 -0
- package/esm/tooling/check/lint-step.mjs.map +1 -0
- package/esm/tooling/check/request-input.mjs +132 -0
- package/esm/tooling/check/request-input.mjs.map +1 -0
- package/esm/tooling/check/run-check.d.mts +43 -0
- package/esm/tooling/check/run-check.d.mts.map +1 -0
- package/esm/tooling/check/run-check.mjs +192 -0
- package/esm/tooling/check/run-check.mjs.map +1 -0
- package/esm/tooling/check/run-tests.d.mts +55 -0
- package/esm/tooling/check/run-tests.d.mts.map +1 -0
- package/esm/tooling/check/run-tests.mjs +93 -0
- package/esm/tooling/check/run-tests.mjs.map +1 -0
- package/esm/tooling/check/security-conventions.mjs +650 -0
- package/esm/tooling/check/security-conventions.mjs.map +1 -0
- package/esm/tooling/check/source-ast.mjs +155 -0
- package/esm/tooling/check/source-ast.mjs.map +1 -0
- package/esm/tooling/check/source-files.mjs +27 -0
- package/esm/tooling/check/source-files.mjs.map +1 -0
- package/esm/tooling/check/tests-step.d.mts +33 -0
- package/esm/tooling/check/tests-step.d.mts.map +1 -0
- package/esm/tooling/check/tests-step.mjs +177 -0
- package/esm/tooling/check/tests-step.mjs.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts +43 -0
- package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -0
- package/esm/tooling/dev-state/dev-server-state.mjs +67 -0
- package/esm/tooling/dev-state/dev-server-state.mjs.map +1 -0
- package/esm/tooling/devtools/devtools-client.d.mts +100 -0
- package/esm/tooling/devtools/devtools-client.d.mts.map +1 -0
- package/esm/tooling/devtools/devtools-client.mjs +155 -0
- package/esm/tooling/devtools/devtools-client.mjs.map +1 -0
- package/esm/tooling/generate/generation.d.mts +90 -0
- package/esm/tooling/generate/generation.d.mts.map +1 -0
- package/esm/tooling/generate/generation.mjs +127 -0
- package/esm/tooling/generate/generation.mjs.map +1 -0
- package/esm/tooling/generate/generator-spec.d.mts +57 -0
- package/esm/tooling/generate/generator-spec.d.mts.map +1 -0
- package/esm/tooling/generate/generator-spec.mjs +102 -0
- package/esm/tooling/generate/generator-spec.mjs.map +1 -0
- package/esm/tooling/generate/index.mjs +6 -0
- package/esm/tooling/generate/project-files.mjs +121 -0
- package/esm/tooling/generate/project-files.mjs.map +1 -0
- package/esm/tooling/generate/run-cli.d.mts +43 -0
- package/esm/tooling/generate/run-cli.d.mts.map +1 -0
- package/esm/tooling/generate/run-cli.mjs +93 -0
- package/esm/tooling/generate/run-cli.mjs.map +1 -0
- package/esm/tooling/generate/unified-diff.d.mts +40 -0
- package/esm/tooling/generate/unified-diff.d.mts.map +1 -0
- package/esm/tooling/generate/unified-diff.mjs +161 -0
- package/esm/tooling/generate/unified-diff.mjs.map +1 -0
- package/esm/tooling/index.d.mts +42 -0
- package/esm/tooling/index.mjs +45 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts +23 -0
- package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs +63 -0
- package/esm/tooling/inspect/boot-for-inspect.mjs.map +1 -0
- package/esm/tooling/inspect/collect-config.mjs +77 -0
- package/esm/tooling/inspect/collect-config.mjs.map +1 -0
- package/esm/tooling/inspect/collect-models.d.mts +10 -0
- package/esm/tooling/inspect/collect-models.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-models.mjs +154 -0
- package/esm/tooling/inspect/collect-models.mjs.map +1 -0
- package/esm/tooling/inspect/collect-packages.d.mts +9 -0
- package/esm/tooling/inspect/collect-packages.d.mts.map +1 -0
- package/esm/tooling/inspect/collect-packages.mjs +157 -0
- package/esm/tooling/inspect/collect-packages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-pages.mjs +108 -0
- package/esm/tooling/inspect/collect-pages.mjs.map +1 -0
- package/esm/tooling/inspect/collect-routes.mjs +168 -0
- package/esm/tooling/inspect/collect-routes.mjs.map +1 -0
- package/esm/tooling/inspect/event-recorder.d.mts +37 -0
- package/esm/tooling/inspect/event-recorder.d.mts.map +1 -0
- package/esm/tooling/inspect/event-recorder.mjs +91 -0
- package/esm/tooling/inspect/event-recorder.mjs.map +1 -0
- package/esm/tooling/inspect/index.d.mts +8 -0
- package/esm/tooling/inspect/index.mjs +7 -0
- package/esm/tooling/inspect/inspect-app.d.mts +62 -0
- package/esm/tooling/inspect/inspect-app.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-app.mjs +92 -0
- package/esm/tooling/inspect/inspect-app.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts +14 -0
- package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs +463 -0
- package/esm/tooling/inspect/inspect-report.schema.mjs.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts +228 -0
- package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -0
- package/esm/tooling/inspect/inspect-report.types.mjs +33 -0
- package/esm/tooling/inspect/inspect-report.types.mjs.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts +29 -0
- package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -0
- package/esm/tooling/mcp/create-mcp-context.mjs +75 -0
- package/esm/tooling/mcp/create-mcp-context.mjs.map +1 -0
- package/esm/tooling/mcp/db-schema.d.mts +50 -0
- package/esm/tooling/mcp/db-schema.d.mts.map +1 -0
- package/esm/tooling/mcp/db-schema.mjs +56 -0
- package/esm/tooling/mcp/db-schema.mjs.map +1 -0
- package/esm/tooling/mcp/docs-search.d.mts +77 -0
- package/esm/tooling/mcp/docs-search.d.mts.map +1 -0
- package/esm/tooling/mcp/docs-search.mjs +178 -0
- package/esm/tooling/mcp/docs-search.mjs.map +1 -0
- package/esm/tooling/mcp/index.mjs +9 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts +61 -0
- package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/load-ai-tools.mjs +45 -0
- package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -0
- package/esm/tooling/mcp/mcp-tools.d.mts +70 -0
- package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -0
- package/esm/tooling/mcp/mcp-tools.mjs +514 -0
- package/esm/tooling/mcp/mcp-tools.mjs.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts +63 -0
- package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -0
- package/esm/tooling/mcp/start-mcp-server.mjs +126 -0
- package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -0
- package/esm/tooling/mcp/tool-input.d.mts +75 -0
- package/esm/tooling/mcp/tool-input.d.mts.map +1 -0
- package/esm/tooling/mcp/tool-input.mjs +72 -0
- package/esm/tooling/mcp/tool-input.mjs.map +1 -0
- package/esm/tooling/problem.d.mts +55 -0
- package/esm/tooling/problem.d.mts.map +1 -0
- package/esm/tooling/problem.mjs +28 -0
- package/esm/tooling/problem.mjs.map +1 -0
- package/esm/tooling/syntax/ast.mjs +230 -0
- package/esm/tooling/syntax/ast.mjs.map +1 -0
- package/esm/tooling/syntax/imports.mjs +34 -0
- package/esm/tooling/syntax/imports.mjs.map +1 -0
- package/esm/tooling/trace/trace-report.types.d.mts +85 -0
- package/esm/tooling/trace/trace-report.types.d.mts.map +1 -0
- package/esm/tooling/trace/trace-report.types.mjs +7 -0
- package/esm/tooling/trace/trace-report.types.mjs.map +1 -0
- package/esm/tooling/trace/trace-request.d.mts +90 -0
- package/esm/tooling/trace/trace-request.d.mts.map +1 -0
- package/esm/tooling/trace/trace-request.mjs +241 -0
- package/esm/tooling/trace/trace-request.mjs.map +1 -0
- package/esm/tooling/typecheck/index.mjs +3 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts +26 -0
- package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -0
- package/esm/tooling/typecheck/run-typecheck.mjs +90 -0
- package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -0
- package/esm/tooling/typescript/compiler.d.mts +31 -0
- package/esm/tooling/typescript/compiler.d.mts.map +1 -0
- package/esm/tooling/typescript/compiler.mjs +120 -0
- package/esm/tooling/typescript/compiler.mjs.map +1 -0
- package/esm/updater/update-warlock-packages.mjs +3 -2
- package/esm/updater/update-warlock-packages.mjs.map +1 -1
- package/esm/upgrade/codemods/head-viewport.mjs +46 -0
- package/esm/upgrade/codemods/head-viewport.mjs.map +1 -0
- package/esm/upgrade/codemods/helpers.mjs +81 -0
- package/esm/upgrade/codemods/helpers.mjs.map +1 -0
- package/esm/upgrade/codemods/index.mjs +34 -0
- package/esm/upgrade/codemods/index.mjs.map +1 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs +57 -0
- package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -0
- package/esm/upgrade/codemods/package-json.mjs +122 -0
- package/esm/upgrade/codemods/package-json.mjs.map +1 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs +82 -0
- package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -0
- package/esm/upgrade/codemods/review-sites.mjs +262 -0
- package/esm/upgrade/codemods/review-sites.mjs.map +1 -0
- package/esm/upgrade/diff.mjs +119 -0
- package/esm/upgrade/diff.mjs.map +1 -0
- package/esm/upgrade/format-upgrade-report.mjs +32 -0
- package/esm/upgrade/format-upgrade-report.mjs.map +1 -0
- package/esm/upgrade/load-ts-morph.mjs +49 -0
- package/esm/upgrade/load-ts-morph.mjs.map +1 -0
- package/esm/upgrade/notes.mjs +16 -0
- package/esm/upgrade/notes.mjs.map +1 -0
- package/esm/upgrade/run-upgrade.mjs +246 -0
- package/esm/upgrade/run-upgrade.mjs.map +1 -0
- package/esm/upgrade/upgrade-command.action.mjs +37 -0
- package/esm/upgrade/upgrade-command.action.mjs.map +1 -0
- package/esm/upgrade/version.mjs +39 -0
- package/esm/upgrade/version.mjs.map +1 -0
- package/esm/use-cases/index.d.mts +2 -1
- package/esm/use-cases/index.mjs +1 -1
- package/esm/use-cases/types.d.mts +116 -63
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -3
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +3 -5
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +6 -6
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case.d.mts +2 -4
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -3
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +8 -10
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.mjs.map +1 -1
- package/esm/utils/app-log.d.mts +1 -2
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/clock.d.mts +35 -0
- package/esm/utils/clock.d.mts.map +1 -0
- package/esm/utils/clock.mjs +27 -0
- package/esm/utils/clock.mjs.map +1 -0
- package/esm/utils/database-log.d.mts +3 -4
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/environment.d.mts +4 -5
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/framework-vesion.mjs +1 -1
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +2 -3
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/ids.d.mts +35 -0
- package/esm/utils/ids.d.mts.map +1 -0
- package/esm/utils/ids.mjs +33 -0
- package/esm/utils/ids.mjs.map +1 -0
- package/esm/utils/index.d.mts +5 -1
- package/esm/utils/index.mjs +4 -1
- package/esm/utils/normalized-path.d.mts +1 -2
- package/esm/utils/normalized-path.d.mts.map +1 -1
- package/esm/utils/npm-registry.d.mts +1 -2
- package/esm/utils/npm-registry.d.mts.map +1 -1
- package/esm/utils/paths.d.mts +13 -14
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +2 -2
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -2
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/queue.d.mts +1 -2
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/runtime.d.mts +60 -0
- package/esm/utils/runtime.d.mts.map +1 -0
- package/esm/utils/runtime.mjs +85 -0
- package/esm/utils/runtime.mjs.map +1 -0
- package/esm/utils/sleep.d.mts +1 -2
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -3
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/to-json.d.mts +1 -2
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/types.d.mts +1 -2
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +5 -6
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/version-compare.d.mts +1 -2
- package/esm/utils/version-compare.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +2 -3
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +2 -3
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/index.d.mts +2 -1
- package/esm/validation/database/index.mjs +1 -1
- package/esm/validation/database/types.d.mts +14 -10
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +2 -3
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +2 -3
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/file/file.d.mts +4 -6
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/index.d.mts +2 -1
- package/esm/validation/file/index.mjs +1 -1
- package/esm/validation/index.d.mts +6 -2
- package/esm/validation/index.mjs +1 -1
- package/esm/validation/plugins/index.mjs +1 -1
- package/esm/validation/types.d.mts +61 -4
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +21 -4
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validation-failure-status.mjs +15 -0
- package/esm/validation/validation-failure-status.mjs.map +1 -0
- package/esm/validation/validators/file-validator.d.mts +2 -20
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/index.d.mts +2 -1
- package/esm/validation/validators/index.mjs +1 -1
- package/esm/vite/lower-stage3-decorators.d.mts +2 -3
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
- package/esm/warlock-config/bundle-config.mjs +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -3
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +3 -2
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/index.d.mts +2 -1
- package/esm/warlock-config/index.mjs +1 -1
- package/esm/warlock-config/types.d.mts +31 -6
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +2 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
- package/llms-full.txt +3211 -731
- package/llms.txt +16 -6
- package/package.json +47 -15
- package/schemas/inspect-report.schema.json +554 -0
- package/skills/README.md +9 -0
- package/skills/add-connector/SKILL.md +26 -38
- package/skills/benchmark-code/SKILL.md +30 -24
- package/skills/build-restful/SKILL.md +14 -14
- package/skills/build-url/SKILL.md +18 -18
- package/skills/configure-app/SKILL.md +107 -14
- package/skills/create-controller/SKILL.md +25 -12
- package/skills/create-module/SKILL.md +10 -3
- package/skills/define-resource/SKILL.md +32 -29
- package/skills/encrypt-data/SKILL.md +21 -19
- package/skills/generate-openapi/SKILL.md +50 -24
- package/skills/hash-password/SKILL.md +2 -2
- package/skills/health-checks/SKILL.md +24 -7
- package/skills/index.md +11 -4
- package/skills/lower-stage3-decorators/SKILL.md +4 -4
- package/skills/make-endpoint/SKILL.md +110 -0
- package/skills/model-factories/SKILL.md +92 -0
- package/skills/process-image/SKILL.md +32 -30
- package/skills/register-route/SKILL.md +109 -10
- package/skills/report-framework-issue.md +154 -0
- package/skills/request-memo/SKILL.md +1 -1
- package/skills/request-tracing/SKILL.md +4 -1
- package/skills/resolve-path/SKILL.md +45 -44
- package/skills/retry-operation/SKILL.md +20 -11
- package/skills/run-app/SKILL.md +107 -22
- package/skills/send-response/SKILL.md +179 -14
- package/skills/store-file/SKILL.md +93 -53
- package/skills/test-fakes/SKILL.md +123 -0
- package/skills/test-http/SKILL.md +125 -21
- package/skills/test-service/SKILL.md +41 -1
- package/skills/update-packages/SKILL.md +29 -18
- package/skills/upgrade-from-5-29/SKILL.md +454 -0
- package/skills/upload-file/SKILL.md +31 -33
- package/skills/use-app-context/SKILL.md +38 -31
- package/skills/use-middleware/SKILL.md +45 -25
- package/skills/use-model-transformers/SKILL.md +37 -28
- package/skills/use-repository/SKILL.md +2 -2
- package/skills/validate-input/SKILL.md +72 -28
- package/skills/warlock-agents-md/SKILL.md +96 -0
- package/skills/warlock-board/SKILL.md +123 -0
- package/skills/warlock-check/SKILL.md +133 -0
- package/skills/warlock-conventions/SKILL.md +115 -0
- package/skills/warlock-doctor/SKILL.md +55 -22
- package/skills/warlock-inspect/SKILL.md +134 -0
- package/skills/warlock-mcp/SKILL.md +120 -0
- package/skills/warlock-routes/SKILL.md +18 -11
- package/skills/warlock-trace/SKILL.md +81 -0
- package/skills/wire-socket/SKILL.md +8 -8
- package/skills/write-seeder/SKILL.md +46 -32
- package/skills/write-use-case/SKILL.md +40 -27
- package/esm/http/uploads/matches-if-none-match.mjs +0 -13
- package/esm/http/uploads/matches-if-none-match.mjs.map +0 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
//#region ../../packages/core/src/upgrade/diff.ts
|
|
2
|
+
/**
|
|
3
|
+
* A minimal unified diff (`diff -u` shape, 3 lines of context) between two
|
|
4
|
+
* versions of one file, enough for `warlock upgrade --dry-run` to show what
|
|
5
|
+
* it would change. Line-based longest common subsequence; files too large for
|
|
6
|
+
* that are shown as one replaced hunk.
|
|
7
|
+
*/
|
|
8
|
+
const CONTEXT = 3;
|
|
9
|
+
const MAX_CELLS = 16e6;
|
|
10
|
+
function unifiedDiff(file, before, after) {
|
|
11
|
+
if (before === after) return "";
|
|
12
|
+
const operations = diffLines(splitLines(before), splitLines(after));
|
|
13
|
+
return `--- a/${file}\n+++ b/${file}\n` + formatHunks(operations);
|
|
14
|
+
}
|
|
15
|
+
function splitLines(text) {
|
|
16
|
+
if (text === "") return [];
|
|
17
|
+
const lines = text.split("\n");
|
|
18
|
+
if (lines[lines.length - 1] === "") lines.pop();
|
|
19
|
+
return lines;
|
|
20
|
+
}
|
|
21
|
+
function diffLines(oldLines, newLines) {
|
|
22
|
+
const n = oldLines.length;
|
|
23
|
+
const m = newLines.length;
|
|
24
|
+
if (n * m > MAX_CELLS) return [...oldLines.map((text) => ({
|
|
25
|
+
type: "removed",
|
|
26
|
+
text
|
|
27
|
+
})), ...newLines.map((text) => ({
|
|
28
|
+
type: "added",
|
|
29
|
+
text
|
|
30
|
+
}))];
|
|
31
|
+
const lengths = [];
|
|
32
|
+
for (let i = 0; i <= n; i++) lengths.push(new Uint32Array(m + 1));
|
|
33
|
+
for (let i = n - 1; i >= 0; i--) {
|
|
34
|
+
const row = lengths[i];
|
|
35
|
+
const below = lengths[i + 1];
|
|
36
|
+
for (let j = m - 1; j >= 0; j--) row[j] = oldLines[i] === newLines[j] ? (below[j + 1] ?? 0) + 1 : Math.max(below[j] ?? 0, row[j + 1] ?? 0);
|
|
37
|
+
}
|
|
38
|
+
const operations = [];
|
|
39
|
+
let i = 0;
|
|
40
|
+
let j = 0;
|
|
41
|
+
while (i < n && j < m) if (oldLines[i] === newLines[j]) {
|
|
42
|
+
operations.push({
|
|
43
|
+
type: "same",
|
|
44
|
+
text: oldLines[i] ?? ""
|
|
45
|
+
});
|
|
46
|
+
i++;
|
|
47
|
+
j++;
|
|
48
|
+
} else if ((lengths[i + 1]?.[j] ?? 0) >= (lengths[i]?.[j + 1] ?? 0)) {
|
|
49
|
+
operations.push({
|
|
50
|
+
type: "removed",
|
|
51
|
+
text: oldLines[i] ?? ""
|
|
52
|
+
});
|
|
53
|
+
i++;
|
|
54
|
+
} else {
|
|
55
|
+
operations.push({
|
|
56
|
+
type: "added",
|
|
57
|
+
text: newLines[j] ?? ""
|
|
58
|
+
});
|
|
59
|
+
j++;
|
|
60
|
+
}
|
|
61
|
+
while (i < n) operations.push({
|
|
62
|
+
type: "removed",
|
|
63
|
+
text: oldLines[i++] ?? ""
|
|
64
|
+
});
|
|
65
|
+
while (j < m) operations.push({
|
|
66
|
+
type: "added",
|
|
67
|
+
text: newLines[j++] ?? ""
|
|
68
|
+
});
|
|
69
|
+
return operations;
|
|
70
|
+
}
|
|
71
|
+
function formatHunks(operations) {
|
|
72
|
+
const changed = operations.map((operation, index) => operation.type === "same" ? -1 : index).filter((index) => index >= 0);
|
|
73
|
+
let output = "";
|
|
74
|
+
let cursor = 0;
|
|
75
|
+
while (cursor < changed.length) {
|
|
76
|
+
const firstChange = changed[cursor] ?? 0;
|
|
77
|
+
let lastChange = firstChange;
|
|
78
|
+
while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= 6) {
|
|
79
|
+
cursor++;
|
|
80
|
+
lastChange = changed[cursor] ?? lastChange;
|
|
81
|
+
}
|
|
82
|
+
cursor++;
|
|
83
|
+
const start = Math.max(0, firstChange - CONTEXT);
|
|
84
|
+
const end = Math.min(operations.length, lastChange + CONTEXT + 1);
|
|
85
|
+
let oldStart = 1;
|
|
86
|
+
let newStart = 1;
|
|
87
|
+
for (let index = 0; index < start; index++) {
|
|
88
|
+
const type = operations[index]?.type;
|
|
89
|
+
if (type !== "added") oldStart++;
|
|
90
|
+
if (type !== "removed") newStart++;
|
|
91
|
+
}
|
|
92
|
+
let oldCount = 0;
|
|
93
|
+
let newCount = 0;
|
|
94
|
+
let body = "";
|
|
95
|
+
for (let index = start; index < end; index++) {
|
|
96
|
+
const operation = operations[index];
|
|
97
|
+
if (!operation) continue;
|
|
98
|
+
if (operation.type === "same") {
|
|
99
|
+
oldCount++;
|
|
100
|
+
newCount++;
|
|
101
|
+
body += ` ${operation.text}\n`;
|
|
102
|
+
} else if (operation.type === "removed") {
|
|
103
|
+
oldCount++;
|
|
104
|
+
body += `-${operation.text}\n`;
|
|
105
|
+
} else {
|
|
106
|
+
newCount++;
|
|
107
|
+
body += `+${operation.text}\n`;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const oldRange = oldCount === 0 ? `${oldStart - 1},0` : `${oldStart},${oldCount}`;
|
|
111
|
+
const newRange = newCount === 0 ? `${newStart - 1},0` : `${newStart},${newCount}`;
|
|
112
|
+
output += `@@ -${oldRange} +${newRange} @@\n${body}`;
|
|
113
|
+
}
|
|
114
|
+
return output;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
export { unifiedDiff };
|
|
119
|
+
//# sourceMappingURL=diff.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/diff.ts"],"sourcesContent":["/**\n * A minimal unified diff (`diff -u` shape, 3 lines of context) between two\n * versions of one file, enough for `warlock upgrade --dry-run` to show what\n * it would change. Line-based longest common subsequence; files too large for\n * that are shown as one replaced hunk.\n */\nconst CONTEXT = 3;\nconst MAX_CELLS = 16_000_000;\n\ntype Operation = { type: \"same\" | \"removed\" | \"added\"; text: string };\n\nexport function unifiedDiff(file: string, before: string, after: string): string {\n if (before === after) return \"\";\n\n const oldLines = splitLines(before);\n const newLines = splitLines(after);\n const operations = diffLines(oldLines, newLines);\n\n const header = `--- a/${file}\\n+++ b/${file}\\n`;\n return header + formatHunks(operations);\n}\n\nfunction splitLines(text: string): string[] {\n if (text === \"\") return [];\n const lines = text.split(\"\\n\");\n if (lines[lines.length - 1] === \"\") lines.pop();\n return lines;\n}\n\nfunction diffLines(oldLines: string[], newLines: string[]): Operation[] {\n const n = oldLines.length;\n const m = newLines.length;\n\n if (n * m > MAX_CELLS) {\n return [\n ...oldLines.map((text): Operation => ({ type: \"removed\", text })),\n ...newLines.map((text): Operation => ({ type: \"added\", text })),\n ];\n }\n\n // lengths[i][j] = LCS length of oldLines[i..] and newLines[j..]\n const lengths: Uint32Array[] = [];\n for (let i = 0; i <= n; i++) lengths.push(new Uint32Array(m + 1));\n\n for (let i = n - 1; i >= 0; i--) {\n const row = lengths[i] as Uint32Array;\n const below = lengths[i + 1] as Uint32Array;\n for (let j = m - 1; j >= 0; j--) {\n row[j] =\n oldLines[i] === newLines[j]\n ? (below[j + 1] ?? 0) + 1\n : Math.max(below[j] ?? 0, row[j + 1] ?? 0);\n }\n }\n\n const operations: Operation[] = [];\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (oldLines[i] === newLines[j]) {\n operations.push({ type: \"same\", text: oldLines[i] ?? \"\" });\n i++;\n j++;\n } else if ((lengths[i + 1]?.[j] ?? 0) >= (lengths[i]?.[j + 1] ?? 0)) {\n operations.push({ type: \"removed\", text: oldLines[i] ?? \"\" });\n i++;\n } else {\n operations.push({ type: \"added\", text: newLines[j] ?? \"\" });\n j++;\n }\n }\n while (i < n) operations.push({ type: \"removed\", text: oldLines[i++] ?? \"\" });\n while (j < m) operations.push({ type: \"added\", text: newLines[j++] ?? \"\" });\n\n return operations;\n}\n\nfunction formatHunks(operations: Operation[]): string {\n const changed = operations\n .map((operation, index) => (operation.type === \"same\" ? -1 : index))\n .filter((index) => index >= 0);\n\n let output = \"\";\n let cursor = 0;\n\n while (cursor < changed.length) {\n const firstChange = changed[cursor] ?? 0;\n let lastChange = firstChange;\n // Merge changes whose context windows touch.\n while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= CONTEXT * 2) {\n cursor++;\n lastChange = changed[cursor] ?? lastChange;\n }\n cursor++;\n\n const start = Math.max(0, firstChange - CONTEXT);\n const end = Math.min(operations.length, lastChange + CONTEXT + 1);\n\n let oldStart = 1;\n let newStart = 1;\n for (let index = 0; index < start; index++) {\n const type = operations[index]?.type;\n if (type !== \"added\") oldStart++;\n if (type !== \"removed\") newStart++;\n }\n\n let oldCount = 0;\n let newCount = 0;\n let body = \"\";\n for (let index = start; index < end; index++) {\n const operation = operations[index];\n if (!operation) continue;\n if (operation.type === \"same\") {\n oldCount++;\n newCount++;\n body += ` ${operation.text}\\n`;\n } else if (operation.type === \"removed\") {\n oldCount++;\n body += `-${operation.text}\\n`;\n } else {\n newCount++;\n body += `+${operation.text}\\n`;\n }\n }\n\n const oldRange = oldCount === 0 ? `${oldStart - 1},0` : `${oldStart},${oldCount}`;\n const newRange = newCount === 0 ? `${newStart - 1},0` : `${newStart},${newCount}`;\n output += `@@ -${oldRange} +${newRange} @@\\n${body}`;\n }\n\n return output;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { colors } from "@mongez/copper";
|
|
2
|
+
|
|
3
|
+
//#region ../../packages/core/src/upgrade/format-upgrade-report.ts
|
|
4
|
+
/** The human-readable `warlock upgrade` report. */
|
|
5
|
+
function formatUpgradeReport(result) {
|
|
6
|
+
const lines = [];
|
|
7
|
+
const verb = result.dryRun ? "would change" : "changed";
|
|
8
|
+
lines.push(colors.bold(`warlock upgrade ${result.from} → ${result.to}`) + (result.dryRun ? colors.dim(" (dry run: nothing written)") : ""), "");
|
|
9
|
+
for (const codemod of result.codemods) {
|
|
10
|
+
const applied = result.applied.filter((item) => item.codemod === codemod.id);
|
|
11
|
+
const manual = result.manual.filter((item) => item.codemod === codemod.id);
|
|
12
|
+
const mark = applied.length > 0 ? colors.green("✓") : manual.length > 0 ? colors.yellow("!") : colors.dim("·");
|
|
13
|
+
const counts = [applied.length > 0 ? `${applied.length} ${verb}` : "", manual.length > 0 ? `${manual.length} to review` : ""].filter(Boolean).join(", ");
|
|
14
|
+
lines.push(`${mark} ${codemod.id} ${colors.dim(`(${codemod.version})`)} ${codemod.title}${counts ? colors.dim(` — ${counts}`) : colors.dim(" — nothing to do")}`);
|
|
15
|
+
for (const item of applied) lines.push(` ${colors.cyan(`${item.file}:${item.line}`)} ${item.description}`);
|
|
16
|
+
for (const item of manual) lines.push(` ${colors.yellow(`${item.file}:${item.line}`)} ${item.hint}`);
|
|
17
|
+
}
|
|
18
|
+
if (result.notes.length > 0) {
|
|
19
|
+
lines.push("", colors.bold("Plan for (no code change):"));
|
|
20
|
+
for (const note of result.notes) lines.push(` - ${note.text} ${colors.dim(`(${note.version})`)}`);
|
|
21
|
+
}
|
|
22
|
+
if (result.dryRun && result.diff) lines.push("", colors.bold("Diff:"), result.diff.trimEnd());
|
|
23
|
+
lines.push("");
|
|
24
|
+
lines.push(`${result.changedFiles.length} file(s) ${verb}, ${result.manual.length} place(s) to review by hand.`);
|
|
25
|
+
if (result.installHint) lines.push(`Package versions ${result.dryRun ? "would be" : "were"} updated in package.json: run ${colors.cyan(result.installHint)}.`);
|
|
26
|
+
lines.push(`Then run your type check and tests. The ${colors.cyan("upgrade-from-5-29")} skill explains each change.`);
|
|
27
|
+
return lines.join("\n");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { formatUpgradeReport };
|
|
32
|
+
//# sourceMappingURL=format-upgrade-report.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-upgrade-report.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/format-upgrade-report.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\nimport type { UpgradeResult } from \"./types\";\n\n/** The human-readable `warlock upgrade` report. */\nexport function formatUpgradeReport(result: UpgradeResult): string {\n const lines: string[] = [];\n const verb = result.dryRun ? \"would change\" : \"changed\";\n\n lines.push(\n colors.bold(`warlock upgrade ${result.from} → ${result.to}`) +\n (result.dryRun ? colors.dim(\" (dry run: nothing written)\") : \"\"),\n \"\",\n );\n\n for (const codemod of result.codemods) {\n const applied = result.applied.filter((item) => item.codemod === codemod.id);\n const manual = result.manual.filter((item) => item.codemod === codemod.id);\n const mark =\n applied.length > 0\n ? colors.green(\"✓\")\n : manual.length > 0\n ? colors.yellow(\"!\")\n : colors.dim(\"·\");\n const counts = [\n applied.length > 0 ? `${applied.length} ${verb}` : \"\",\n manual.length > 0 ? `${manual.length} to review` : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n\n lines.push(\n `${mark} ${codemod.id} ${colors.dim(`(${codemod.version})`)} ${codemod.title}${counts ? colors.dim(` — ${counts}`) : colors.dim(\" — nothing to do\")}`,\n );\n for (const item of applied) {\n lines.push(` ${colors.cyan(`${item.file}:${item.line}`)} ${item.description}`);\n }\n for (const item of manual) {\n lines.push(` ${colors.yellow(`${item.file}:${item.line}`)} ${item.hint}`);\n }\n }\n\n if (result.notes.length > 0) {\n lines.push(\"\", colors.bold(\"Plan for (no code change):\"));\n for (const note of result.notes)\n lines.push(` - ${note.text} ${colors.dim(`(${note.version})`)}`);\n }\n\n if (result.dryRun && result.diff) {\n lines.push(\"\", colors.bold(\"Diff:\"), result.diff.trimEnd());\n }\n\n lines.push(\"\");\n lines.push(\n `${result.changedFiles.length} file(s) ${verb}, ${result.manual.length} place(s) to review by hand.`,\n );\n if (result.installHint) {\n lines.push(\n `Package versions ${result.dryRun ? \"would be\" : \"were\"} updated in package.json: run ${colors.cyan(result.installHint)}.`,\n );\n }\n lines.push(\n `Then run your type check and tests. The ${colors.cyan(\"upgrade-from-5-29\")} skill explains each change.`,\n );\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;AAIA,SAAgB,oBAAoB,QAA+B;CACjE,MAAM,QAAkB,CAAC;CACzB,MAAM,OAAO,OAAO,SAAS,iBAAiB;CAE9C,MAAM,KACJ,OAAO,KAAK,mBAAmB,OAAO,KAAK,KAAK,OAAO,IAAI,KACxD,OAAO,SAAS,OAAO,IAAI,6BAA6B,IAAI,KAC/D,EACF;CAEA,KAAK,MAAM,WAAW,OAAO,UAAU;EACrC,MAAM,UAAU,OAAO,QAAQ,QAAQ,SAAS,KAAK,YAAY,QAAQ,EAAE;EAC3E,MAAM,SAAS,OAAO,OAAO,QAAQ,SAAS,KAAK,YAAY,QAAQ,EAAE;EACzE,MAAM,OACJ,QAAQ,SAAS,IACb,OAAO,MAAM,GAAG,IAChB,OAAO,SAAS,IACd,OAAO,OAAO,GAAG,IACjB,OAAO,IAAI,GAAG;EACtB,MAAM,SAAS,CACb,QAAQ,SAAS,IAAI,GAAG,QAAQ,OAAO,GAAG,SAAS,IACnD,OAAO,SAAS,IAAI,GAAG,OAAO,OAAO,cAAc,EACrD,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,IAAI;EAEZ,MAAM,KACJ,GAAG,KAAK,GAAG,QAAQ,GAAG,GAAG,OAAO,IAAI,IAAI,QAAQ,QAAQ,EAAE,EAAE,GAAG,QAAQ,QAAQ,SAAS,OAAO,IAAI,MAAM,QAAQ,IAAI,OAAO,IAAI,kBAAkB,GACpJ;EACA,KAAK,MAAM,QAAQ,SACjB,MAAM,KAAK,OAAO,OAAO,KAAK,GAAG,KAAK,KAAK,GAAG,KAAK,MAAM,EAAE,IAAI,KAAK,aAAa;EAEnF,KAAK,MAAM,QAAQ,QACjB,MAAM,KAAK,OAAO,OAAO,OAAO,GAAG,KAAK,KAAK,GAAG,KAAK,MAAM,EAAE,IAAI,KAAK,MAAM;CAEhF;CAEA,IAAI,OAAO,MAAM,SAAS,GAAG;EAC3B,MAAM,KAAK,IAAI,OAAO,KAAK,4BAA4B,CAAC;EACxD,KAAK,MAAM,QAAQ,OAAO,OACxB,MAAM,KAAK,OAAO,KAAK,KAAK,GAAG,OAAO,IAAI,IAAI,KAAK,QAAQ,EAAE,GAAG;CACpE;CAEA,IAAI,OAAO,UAAU,OAAO,MAC1B,MAAM,KAAK,IAAI,OAAO,KAAK,OAAO,GAAG,OAAO,KAAK,QAAQ,CAAC;CAG5D,MAAM,KAAK,EAAE;CACb,MAAM,KACJ,GAAG,OAAO,aAAa,OAAO,WAAW,KAAK,IAAI,OAAO,OAAO,OAAO,6BACzE;CACA,IAAI,OAAO,aACT,MAAM,KACJ,oBAAoB,OAAO,SAAS,aAAa,OAAO,gCAAgC,OAAO,KAAK,OAAO,WAAW,EAAE,EAC1H;CAEF,MAAM,KACJ,2CAA2C,OAAO,KAAK,mBAAmB,EAAE,6BAC9E;CAEA,OAAO,MAAM,KAAK,IAAI;AACxB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { detectPackageManager } from "../updater/package-manager.mjs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
|
|
6
|
+
//#region ../../packages/core/src/upgrade/load-ts-morph.ts
|
|
7
|
+
/** Thrown when `ts-morph` is not installed; the message says how to add it. */
|
|
8
|
+
var TsMorphMissingError = class extends Error {
|
|
9
|
+
constructor(installCommand) {
|
|
10
|
+
super(`warlock upgrade edits source files with ts-morph, which is not installed. Add it as a development dependency, then run the command again:\n\n ${installCommand}\n`);
|
|
11
|
+
this.installCommand = installCommand;
|
|
12
|
+
this.name = "TsMorphMissingError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/** The dev-dependency install command for `ts-morph` with this package manager. */
|
|
16
|
+
function tsMorphInstallCommand(packageManager) {
|
|
17
|
+
switch (packageManager) {
|
|
18
|
+
case "pnpm": return "pnpm add --save-dev ts-morph";
|
|
19
|
+
case "yarn": return "yarn add --dev ts-morph";
|
|
20
|
+
case "bun": return "bun add --dev ts-morph";
|
|
21
|
+
default: return "npm install --save-dev ts-morph";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Load `ts-morph` lazily: it is an optional peer of `@warlock.js/core`, needed
|
|
26
|
+
* only by `warlock upgrade`. Resolved from the app first (where the user
|
|
27
|
+
* installs it), then from core's own location.
|
|
28
|
+
*/
|
|
29
|
+
async function loadTsMorph(root) {
|
|
30
|
+
try {
|
|
31
|
+
const resolved = createRequire(path.join(root, "package.json")).resolve("ts-morph");
|
|
32
|
+
return fromNamespace(await import(pathToFileURL(resolved).href));
|
|
33
|
+
} catch {}
|
|
34
|
+
try {
|
|
35
|
+
return fromNamespace(await import("ts-morph"));
|
|
36
|
+
} catch {
|
|
37
|
+
throw new TsMorphMissingError(tsMorphInstallCommand(await detectPackageManager(root)));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** A CommonJS package imported from ESM may expose its API on `default` only. */
|
|
41
|
+
function fromNamespace(namespace) {
|
|
42
|
+
const candidate = namespace;
|
|
43
|
+
if (typeof candidate.Project === "function") return namespace;
|
|
44
|
+
return candidate.default;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { TsMorphMissingError, loadTsMorph, tsMorphInstallCommand };
|
|
49
|
+
//# sourceMappingURL=load-ts-morph.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-ts-morph.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/load-ts-morph.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { detectPackageManager, type PackageManager } from \"../updater/package-manager\";\nimport type { TsMorphModule } from \"./types\";\n\n/** Thrown when `ts-morph` is not installed; the message says how to add it. */\nexport class TsMorphMissingError extends Error {\n public override readonly name = \"TsMorphMissingError\";\n\n public constructor(public readonly installCommand: string) {\n super(\n `warlock upgrade edits source files with ts-morph, which is not installed. ` +\n `Add it as a development dependency, then run the command again:\\n\\n ${installCommand}\\n`,\n );\n }\n}\n\n/** The dev-dependency install command for `ts-morph` with this package manager. */\nexport function tsMorphInstallCommand(packageManager: PackageManager): string {\n switch (packageManager) {\n case \"pnpm\":\n return \"pnpm add --save-dev ts-morph\";\n case \"yarn\":\n return \"yarn add --dev ts-morph\";\n case \"bun\":\n return \"bun add --dev ts-morph\";\n default:\n return \"npm install --save-dev ts-morph\";\n }\n}\n\n/**\n * Load `ts-morph` lazily: it is an optional peer of `@warlock.js/core`, needed\n * only by `warlock upgrade`. Resolved from the app first (where the user\n * installs it), then from core's own location.\n */\nexport async function loadTsMorph(root: string): Promise<TsMorphModule> {\n try {\n const resolved = createRequire(path.join(root, \"package.json\")).resolve(\"ts-morph\");\n return fromNamespace(await import(pathToFileURL(resolved).href));\n } catch {\n // Not in the app; try core's own resolution below.\n }\n\n try {\n return fromNamespace(await import(\"ts-morph\"));\n } catch {\n throw new TsMorphMissingError(tsMorphInstallCommand(await detectPackageManager(root)));\n }\n}\n\n/** A CommonJS package imported from ESM may expose its API on `default` only. */\nfunction fromNamespace(namespace: unknown): TsMorphModule {\n const candidate = namespace as { Project?: unknown; default?: unknown };\n if (typeof candidate.Project === \"function\") return namespace as TsMorphModule;\n return candidate.default as TsMorphModule;\n}\n"],"mappings":";;;;;;;AAOA,IAAa,sBAAb,cAAyC,MAAM;CAG7C,AAAO,YAAY,AAAgB,gBAAwB;EACzD,MACE,kJAC0E,eAAe,GAC3F;EAJiC;cAFH;CAOhC;AACF;;AAGA,SAAgB,sBAAsB,gBAAwC;CAC5E,QAAQ,gBAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,OACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;;;AAOA,eAAsB,YAAY,MAAsC;CACtE,IAAI;EACF,MAAM,WAAW,cAAc,KAAK,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,QAAQ,UAAU;EAClF,OAAO,cAAc,MAAM,OAAO,cAAc,QAAQ,CAAC,CAAC,KAAK;CACjE,QAAQ,CAER;CAEA,IAAI;EACF,OAAO,cAAc,MAAM,OAAO,WAAW;CAC/C,QAAQ;EACN,MAAM,IAAI,oBAAoB,sBAAsB,MAAM,qBAAqB,IAAI,CAAC,CAAC;CACvF;AACF;;AAGA,SAAS,cAAc,WAAmC;CACxD,MAAM,YAAY;CAClB,IAAI,OAAO,UAAU,YAAY,YAAY,OAAO;CACpD,OAAO,UAAU;AACnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region ../../packages/core/src/upgrade/notes.ts
|
|
2
|
+
/**
|
|
3
|
+
* Breaking changes with nothing to edit in source: they change data or
|
|
4
|
+
* operations. Printed so the rollout plans for them.
|
|
5
|
+
*/
|
|
6
|
+
const UPGRADE_NOTES = [{
|
|
7
|
+
version: "5.30.0",
|
|
8
|
+
text: "Auth login throttle keys are hashed: counters and lockouts written by 5.29 are forgotten on upgrade (locked accounts and IPs unlock)."
|
|
9
|
+
}, {
|
|
10
|
+
version: "5.30.0",
|
|
11
|
+
text: "Image derivatives use a new cache layout: the first request re-renders each one. Delete the old two-level cache folders once the rollout is done."
|
|
12
|
+
}];
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { UPGRADE_NOTES };
|
|
16
|
+
//# sourceMappingURL=notes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/notes.ts"],"sourcesContent":["import type { UpgradeNote } from \"./types\";\n\n/**\n * Breaking changes with nothing to edit in source: they change data or\n * operations. Printed so the rollout plans for them.\n */\nexport const UPGRADE_NOTES: readonly UpgradeNote[] = [\n {\n version: \"5.30.0\",\n text: \"Auth login throttle keys are hashed: counters and lockouts written by 5.29 are forgotten on upgrade (locked accounts and IPs unlock).\",\n },\n {\n version: \"5.30.0\",\n text: \"Image derivatives use a new cache layout: the first request re-renders each one. Delete the old two-level cache folders once the rollout is done.\",\n },\n];\n"],"mappings":";;;;;AAMA,MAAa,gBAAwC,CACnD;CACE,SAAS;CACT,MAAM;AACR,GACA;CACE,SAAS;CACT,MAAM;AACR,CACF"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { detectPackageManager, getInstallCommand } from "../updater/package-manager.mjs";
|
|
2
|
+
import { loadTsMorph } from "./load-ts-morph.mjs";
|
|
3
|
+
import { compareVersions, normalizeVersion, parseVersion } from "./version.mjs";
|
|
4
|
+
import { CODEMODS } from "./codemods/index.mjs";
|
|
5
|
+
import { unifiedDiff } from "./diff.mjs";
|
|
6
|
+
import { UPGRADE_NOTES } from "./notes.mjs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
9
|
+
import glob from "fast-glob";
|
|
10
|
+
|
|
11
|
+
//#region ../../packages/core/src/upgrade/run-upgrade.ts
|
|
12
|
+
/** Thrown for a request the command cannot act on (bad versions, nothing to detect). */
|
|
13
|
+
var UpgradeUsageError = class extends Error {
|
|
14
|
+
constructor(..._args) {
|
|
15
|
+
super(..._args);
|
|
16
|
+
this.name = "UpgradeUsageError";
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Apply the mechanical edits for every breaking change between two releases
|
|
21
|
+
* and list what needs a decision. Writes nothing with `dryRun`.
|
|
22
|
+
*/
|
|
23
|
+
async function runUpgrade(options) {
|
|
24
|
+
const root = path.resolve(options.root ?? process.cwd());
|
|
25
|
+
const to = toVersion(options.to);
|
|
26
|
+
const from = options.from ? toVersion(options.from) : detectInstalledVersion(root);
|
|
27
|
+
if (compareVersions(from, to) >= 0) throw new UpgradeUsageError(notNewerMessage(from, to, options.from !== void 0));
|
|
28
|
+
const selected = (options.codemods ?? CODEMODS).filter((codemod) => codemod.version === "target" || compareVersions(codemod.version, from) > 0 && compareVersions(codemod.version, to) <= 0);
|
|
29
|
+
const tsMorph = await (options.loadTsMorph ?? loadTsMorph)(root);
|
|
30
|
+
const project = new tsMorph.Project({
|
|
31
|
+
skipAddingFilesFromTsConfig: true,
|
|
32
|
+
skipFileDependencyResolution: true,
|
|
33
|
+
compilerOptions: {
|
|
34
|
+
jsx: tsMorph.ts.JsxEmit.Preserve,
|
|
35
|
+
allowJs: false
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const relativePaths = await glob("src/**/*.{ts,tsx}", {
|
|
39
|
+
cwd: root,
|
|
40
|
+
ignore: [
|
|
41
|
+
"**/node_modules/**",
|
|
42
|
+
"**/dist/**",
|
|
43
|
+
"**/.warlock/**",
|
|
44
|
+
"**/*.d.ts"
|
|
45
|
+
],
|
|
46
|
+
dot: false
|
|
47
|
+
});
|
|
48
|
+
relativePaths.sort();
|
|
49
|
+
const originals = /* @__PURE__ */ new Map();
|
|
50
|
+
const sourceFiles = [];
|
|
51
|
+
for (const relative of relativePaths) {
|
|
52
|
+
const content = readFileSync(path.join(root, relative), "utf8");
|
|
53
|
+
originals.set(relative, content);
|
|
54
|
+
sourceFiles.push(project.createSourceFile(path.join(root, relative), content, { overwrite: true }));
|
|
55
|
+
}
|
|
56
|
+
const relativeOf = new Map(sourceFiles.map((sourceFile, index) => [sourceFile, relativePaths[index] ?? ""]));
|
|
57
|
+
const applied = [];
|
|
58
|
+
const manual = [];
|
|
59
|
+
const textFiles = createTextFiles(root);
|
|
60
|
+
let activeCodemod;
|
|
61
|
+
const context = {
|
|
62
|
+
tsMorph,
|
|
63
|
+
sourceFiles,
|
|
64
|
+
relativePath: (sourceFile) => relativeOf.get(sourceFile) ?? path.relative(root, sourceFile.getFilePath()).split(path.sep).join("/"),
|
|
65
|
+
text: {
|
|
66
|
+
read: (file) => textFiles.read(file),
|
|
67
|
+
write: (file, content, change) => {
|
|
68
|
+
textFiles.write(file, content);
|
|
69
|
+
if (activeCodemod) applied.push({
|
|
70
|
+
codemod: activeCodemod.id,
|
|
71
|
+
file,
|
|
72
|
+
...change
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
targetVersion: to
|
|
77
|
+
};
|
|
78
|
+
const summary = [];
|
|
79
|
+
for (const codemod of selected) {
|
|
80
|
+
activeCodemod = codemod;
|
|
81
|
+
const appliedBefore = applied.length;
|
|
82
|
+
const output = codemod.run(context);
|
|
83
|
+
for (const finding of output.manual) manual.push({
|
|
84
|
+
...finding,
|
|
85
|
+
codemod: codemod.id,
|
|
86
|
+
skill: codemod.skill
|
|
87
|
+
});
|
|
88
|
+
const byFile = /* @__PURE__ */ new Map();
|
|
89
|
+
for (const edit of output.edits) {
|
|
90
|
+
const list = byFile.get(edit.file) ?? [];
|
|
91
|
+
list.push(edit);
|
|
92
|
+
byFile.set(edit.file, list);
|
|
93
|
+
}
|
|
94
|
+
for (const [file, edits] of byFile) {
|
|
95
|
+
const sourceFile = sourceFiles[relativePaths.indexOf(file)];
|
|
96
|
+
if (!sourceFile) continue;
|
|
97
|
+
let content = sourceFile.getFullText();
|
|
98
|
+
let lowestStart = Number.POSITIVE_INFINITY;
|
|
99
|
+
for (const edit of [...edits].sort((left, right) => right.start - left.start)) {
|
|
100
|
+
if (edit.end > lowestStart) {
|
|
101
|
+
manual.push({
|
|
102
|
+
codemod: codemod.id,
|
|
103
|
+
skill: codemod.skill,
|
|
104
|
+
file,
|
|
105
|
+
line: edit.line,
|
|
106
|
+
hint: `Not edited automatically (overlaps another change): ${edit.description}. Run the upgrade again after reviewing.`
|
|
107
|
+
});
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
content = content.slice(0, edit.start) + edit.text + content.slice(edit.end);
|
|
111
|
+
lowestStart = edit.start;
|
|
112
|
+
applied.push({
|
|
113
|
+
codemod: codemod.id,
|
|
114
|
+
file,
|
|
115
|
+
line: edit.line,
|
|
116
|
+
description: edit.description
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
sourceFile.replaceWithText(content);
|
|
120
|
+
}
|
|
121
|
+
summary.push({
|
|
122
|
+
id: codemod.id,
|
|
123
|
+
version: codemod.version === "target" ? to : codemod.version,
|
|
124
|
+
title: codemod.title,
|
|
125
|
+
applied: applied.length - appliedBefore,
|
|
126
|
+
manual: manual.filter((item) => item.codemod === codemod.id).length
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
activeCodemod = void 0;
|
|
130
|
+
applied.sort(byFileAndLine);
|
|
131
|
+
manual.sort(byFileAndLine);
|
|
132
|
+
const changes = [];
|
|
133
|
+
sourceFiles.forEach((sourceFile, index) => {
|
|
134
|
+
const file = relativePaths[index];
|
|
135
|
+
if (file === void 0) return;
|
|
136
|
+
const before = originals.get(file) ?? "";
|
|
137
|
+
const after = sourceFile.getFullText();
|
|
138
|
+
if (before !== after) changes.push({
|
|
139
|
+
file,
|
|
140
|
+
before,
|
|
141
|
+
after
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
for (const change of textFiles.changes()) changes.push(change);
|
|
145
|
+
changes.sort((left, right) => left.file.localeCompare(right.file));
|
|
146
|
+
if (!options.dryRun) for (const change of changes) writeFileSync(path.join(root, change.file), change.after);
|
|
147
|
+
const packageJsonChanged = changes.some((change) => change.file === "package.json" && applied.some((item) => item.codemod === "warlock-versions" && item.file === "package.json"));
|
|
148
|
+
return {
|
|
149
|
+
from,
|
|
150
|
+
to,
|
|
151
|
+
dryRun: options.dryRun === true,
|
|
152
|
+
codemods: summary,
|
|
153
|
+
applied,
|
|
154
|
+
manual,
|
|
155
|
+
notes: UPGRADE_NOTES.filter((note) => compareVersions(note.version, from) > 0 && compareVersions(note.version, to) <= 0),
|
|
156
|
+
changedFiles: changes.map((change) => change.file),
|
|
157
|
+
diff: changes.map((change) => unifiedDiff(change.file, change.before, change.after)).join(""),
|
|
158
|
+
...packageJsonChanged && { installHint: getInstallCommand(await detectPackageManager(root)) }
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Explain why `--to` is not newer than the starting version. The usual cause
|
|
163
|
+
* is running the command after installing the new release: the starting
|
|
164
|
+
* version is read from the installed `@warlock.js/core`, which is then already
|
|
165
|
+
* the target, so the command needs `--from`.
|
|
166
|
+
*/
|
|
167
|
+
function notNewerMessage(from, to, fromWasPassed) {
|
|
168
|
+
if (fromWasPassed) return `--from ${from} is not older than --to ${to}. Pass the version this app is upgrading from.`;
|
|
169
|
+
const example = `warlock upgrade --from ${previousMinor(to)} --to ${to}`;
|
|
170
|
+
if (compareVersions(from, to) === 0) return `The installed @warlock.js/core is already ${from}, the --to version, so the version this app is upgrading from cannot be detected. Pass it with --from <previous version>, e.g. ${example}.`;
|
|
171
|
+
return `This app is already on ${from}; --to ${to} is not newer. If the detected version is wrong, pass --from <previous version>, e.g. ${example}.`;
|
|
172
|
+
}
|
|
173
|
+
/** `5.31.0` → `5.30`. A major's first release has no minor to step back to, so it gets a placeholder. */
|
|
174
|
+
function previousMinor(version) {
|
|
175
|
+
const [major, minor] = parseVersion(version) ?? [
|
|
176
|
+
0,
|
|
177
|
+
0,
|
|
178
|
+
0
|
|
179
|
+
];
|
|
180
|
+
return minor > 0 ? `${major}.${minor - 1}` : "<previous version>";
|
|
181
|
+
}
|
|
182
|
+
function toVersion(value) {
|
|
183
|
+
try {
|
|
184
|
+
return normalizeVersion(value);
|
|
185
|
+
} catch (error) {
|
|
186
|
+
throw new UpgradeUsageError(error instanceof Error ? error.message : String(error));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/** The installed `@warlock.js/core`, or the version its package.json range names. */
|
|
190
|
+
function detectInstalledVersion(root) {
|
|
191
|
+
const installed = path.join(root, "node_modules", "@warlock.js", "core", "package.json");
|
|
192
|
+
if (existsSync(installed)) {
|
|
193
|
+
const version = JSON.parse(readFileSync(installed, "utf8")).version;
|
|
194
|
+
if (typeof version === "string" && parseVersion(version)) return normalizeVersion(stripRange(version));
|
|
195
|
+
}
|
|
196
|
+
const manifest = path.join(root, "package.json");
|
|
197
|
+
if (existsSync(manifest)) {
|
|
198
|
+
const pkg = JSON.parse(readFileSync(manifest, "utf8"));
|
|
199
|
+
const spec = pkg.dependencies?.["@warlock.js/core"] ?? pkg.devDependencies?.["@warlock.js/core"];
|
|
200
|
+
const parsed = typeof spec === "string" ? parseVersion(spec) : void 0;
|
|
201
|
+
if (parsed) return parsed.join(".");
|
|
202
|
+
}
|
|
203
|
+
throw new UpgradeUsageError("Could not tell which Warlock version this app is on (no installed @warlock.js/core). Pass it with --from, e.g. --from 5.29.");
|
|
204
|
+
}
|
|
205
|
+
function stripRange(version) {
|
|
206
|
+
return (parseVersion(version) ?? [
|
|
207
|
+
0,
|
|
208
|
+
0,
|
|
209
|
+
0
|
|
210
|
+
]).join(".");
|
|
211
|
+
}
|
|
212
|
+
function byFileAndLine(left, right) {
|
|
213
|
+
return left.file.localeCompare(right.file) || left.line - right.line;
|
|
214
|
+
}
|
|
215
|
+
/** Non-TypeScript files a codemod reads and rewrites, buffered until the end. */
|
|
216
|
+
function createTextFiles(root) {
|
|
217
|
+
const files = /* @__PURE__ */ new Map();
|
|
218
|
+
const entry = (file) => {
|
|
219
|
+
let existing = files.get(file);
|
|
220
|
+
if (!existing) {
|
|
221
|
+
const absolute = path.join(root, file);
|
|
222
|
+
const content = existsSync(absolute) ? readFileSync(absolute, "utf8") : void 0;
|
|
223
|
+
existing = {
|
|
224
|
+
before: content,
|
|
225
|
+
current: content
|
|
226
|
+
};
|
|
227
|
+
files.set(file, existing);
|
|
228
|
+
}
|
|
229
|
+
return existing;
|
|
230
|
+
};
|
|
231
|
+
return {
|
|
232
|
+
read: (file) => entry(file).current,
|
|
233
|
+
write: (file, content) => {
|
|
234
|
+
entry(file).current = content;
|
|
235
|
+
},
|
|
236
|
+
changes: () => [...files.entries()].filter(([, value]) => value.current !== void 0 && value.current !== value.before).map(([file, value]) => ({
|
|
237
|
+
file,
|
|
238
|
+
before: value.before ?? "",
|
|
239
|
+
after: value.current ?? ""
|
|
240
|
+
}))
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
//#endregion
|
|
245
|
+
export { UpgradeUsageError, detectInstalledVersion, runUpgrade };
|
|
246
|
+
//# sourceMappingURL=run-upgrade.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-upgrade.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/run-upgrade.ts"],"sourcesContent":["import glob from \"fast-glob\";\nimport { existsSync, readFileSync, writeFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { detectPackageManager, getInstallCommand } from \"../updater/package-manager\";\nimport { CODEMODS } from \"./codemods\";\nimport { unifiedDiff } from \"./diff\";\nimport { loadTsMorph } from \"./load-ts-morph\";\nimport { UPGRADE_NOTES } from \"./notes\";\nimport type {\n AppliedChange,\n Codemod,\n CodemodContext,\n ManualItem,\n SourceEdit,\n SourceFile,\n TextFiles,\n TsMorphModule,\n UpgradeResult,\n} from \"./types\";\nimport { compareVersions, normalizeVersion, parseVersion } from \"./version\";\n\nexport type RunUpgradeOptions = {\n /** App root. Defaults to the current directory. */\n root?: string;\n /** Target version, e.g. `5.31` or `5.31.0`. */\n to: string;\n /** Version upgrading from; detected from the installed `@warlock.js/core` when omitted. */\n from?: string;\n /** Compute and report everything, write nothing. */\n dryRun?: boolean;\n /** Override the codemod list (tests). */\n codemods?: readonly Codemod[];\n /** Override how ts-morph is loaded (tests). */\n loadTsMorph?: (root: string) => Promise<TsMorphModule>;\n};\n\n/** Thrown for a request the command cannot act on (bad versions, nothing to detect). */\nexport class UpgradeUsageError extends Error {\n public override readonly name = \"UpgradeUsageError\";\n}\n\n/**\n * Apply the mechanical edits for every breaking change between two releases\n * and list what needs a decision. Writes nothing with `dryRun`.\n */\nexport async function runUpgrade(options: RunUpgradeOptions): Promise<UpgradeResult> {\n const root = path.resolve(options.root ?? process.cwd());\n const to = toVersion(options.to);\n const from = options.from ? toVersion(options.from) : detectInstalledVersion(root);\n\n if (compareVersions(from, to) >= 0) {\n throw new UpgradeUsageError(notNewerMessage(from, to, options.from !== undefined));\n }\n\n const selected = (options.codemods ?? CODEMODS).filter(\n (codemod) =>\n codemod.version === \"target\" ||\n (compareVersions(codemod.version, from) > 0 && compareVersions(codemod.version, to) <= 0),\n );\n\n const tsMorph = await (options.loadTsMorph ?? loadTsMorph)(root);\n const project = new tsMorph.Project({\n skipAddingFilesFromTsConfig: true,\n skipFileDependencyResolution: true,\n compilerOptions: { jsx: tsMorph.ts.JsxEmit.Preserve, allowJs: false },\n });\n\n const relativePaths = await glob(\"src/**/*.{ts,tsx}\", {\n cwd: root,\n ignore: [\"**/node_modules/**\", \"**/dist/**\", \"**/.warlock/**\", \"**/*.d.ts\"],\n dot: false,\n });\n relativePaths.sort();\n\n const originals = new Map<string, string>();\n const sourceFiles: SourceFile[] = [];\n for (const relative of relativePaths) {\n const content = readFileSync(path.join(root, relative), \"utf8\");\n originals.set(relative, content);\n sourceFiles.push(\n project.createSourceFile(path.join(root, relative), content, { overwrite: true }),\n );\n }\n\n const relativeOf = new Map<SourceFile, string>(\n sourceFiles.map((sourceFile, index) => [sourceFile, relativePaths[index] ?? \"\"]),\n );\n\n const applied: AppliedChange[] = [];\n const manual: ManualItem[] = [];\n const textFiles = createTextFiles(root);\n let activeCodemod: Codemod | undefined;\n\n const text: TextFiles = {\n read: (file) => textFiles.read(file),\n write: (file, content, change) => {\n textFiles.write(file, content);\n if (activeCodemod) {\n applied.push({ codemod: activeCodemod.id, file, ...change });\n }\n },\n };\n\n const context: CodemodContext = {\n tsMorph,\n sourceFiles,\n relativePath: (sourceFile) =>\n relativeOf.get(sourceFile) ??\n path.relative(root, sourceFile.getFilePath()).split(path.sep).join(\"/\"),\n text,\n targetVersion: to,\n };\n\n const summary: UpgradeResult[\"codemods\"] = [];\n\n for (const codemod of selected) {\n activeCodemod = codemod;\n const appliedBefore = applied.length;\n const output = codemod.run(context);\n\n for (const finding of output.manual) {\n manual.push({ ...finding, codemod: codemod.id, skill: codemod.skill });\n }\n\n const byFile = new Map<string, SourceEdit[]>();\n for (const edit of output.edits) {\n const list = byFile.get(edit.file) ?? [];\n list.push(edit);\n byFile.set(edit.file, list);\n }\n\n for (const [file, edits] of byFile) {\n const sourceFile = sourceFiles[relativePaths.indexOf(file)];\n if (!sourceFile) continue;\n\n let content = sourceFile.getFullText();\n let lowestStart = Number.POSITIVE_INFINITY;\n for (const edit of [...edits].sort((left, right) => right.start - left.start)) {\n // Overlapping edits (one inside another) would corrupt the file: keep the outer one.\n if (edit.end > lowestStart) {\n manual.push({\n codemod: codemod.id,\n skill: codemod.skill,\n file,\n line: edit.line,\n hint: `Not edited automatically (overlaps another change): ${edit.description}. Run the upgrade again after reviewing.`,\n });\n continue;\n }\n content = content.slice(0, edit.start) + edit.text + content.slice(edit.end);\n lowestStart = edit.start;\n applied.push({ codemod: codemod.id, file, line: edit.line, description: edit.description });\n }\n\n sourceFile.replaceWithText(content);\n }\n\n summary.push({\n id: codemod.id,\n version: codemod.version === \"target\" ? to : codemod.version,\n title: codemod.title,\n applied: applied.length - appliedBefore,\n manual: manual.filter((item) => item.codemod === codemod.id).length,\n });\n }\n activeCodemod = undefined;\n\n applied.sort(byFileAndLine);\n manual.sort(byFileAndLine);\n\n const changes: { file: string; before: string; after: string }[] = [];\n sourceFiles.forEach((sourceFile, index) => {\n const file = relativePaths[index];\n if (file === undefined) return;\n const before = originals.get(file) ?? \"\";\n const after = sourceFile.getFullText();\n if (before !== after) changes.push({ file, before, after });\n });\n for (const change of textFiles.changes()) changes.push(change);\n changes.sort((left, right) => left.file.localeCompare(right.file));\n\n if (!options.dryRun) {\n for (const change of changes) writeFileSync(path.join(root, change.file), change.after);\n }\n\n const packageJsonChanged = changes.some(\n (change) =>\n change.file === \"package.json\" &&\n applied.some((item) => item.codemod === \"warlock-versions\" && item.file === \"package.json\"),\n );\n\n return {\n from,\n to,\n dryRun: options.dryRun === true,\n codemods: summary,\n applied,\n manual,\n notes: UPGRADE_NOTES.filter(\n (note) => compareVersions(note.version, from) > 0 && compareVersions(note.version, to) <= 0,\n ),\n changedFiles: changes.map((change) => change.file),\n diff: changes.map((change) => unifiedDiff(change.file, change.before, change.after)).join(\"\"),\n ...(packageJsonChanged && {\n installHint: getInstallCommand(await detectPackageManager(root)),\n }),\n };\n}\n\n/**\n * Explain why `--to` is not newer than the starting version. The usual cause\n * is running the command after installing the new release: the starting\n * version is read from the installed `@warlock.js/core`, which is then already\n * the target, so the command needs `--from`.\n */\nfunction notNewerMessage(from: string, to: string, fromWasPassed: boolean): string {\n if (fromWasPassed) {\n return `--from ${from} is not older than --to ${to}. Pass the version this app is upgrading from.`;\n }\n\n const example = `warlock upgrade --from ${previousMinor(to)} --to ${to}`;\n\n if (compareVersions(from, to) === 0) {\n return `The installed @warlock.js/core is already ${from}, the --to version, so the version this app is upgrading from cannot be detected. Pass it with --from <previous version>, e.g. ${example}.`;\n }\n\n return `This app is already on ${from}; --to ${to} is not newer. If the detected version is wrong, pass --from <previous version>, e.g. ${example}.`;\n}\n\n/** `5.31.0` → `5.30`. A major's first release has no minor to step back to, so it gets a placeholder. */\nfunction previousMinor(version: string): string {\n const [major, minor] = parseVersion(version) ?? [0, 0, 0];\n\n return minor > 0 ? `${major}.${minor - 1}` : \"<previous version>\";\n}\n\nfunction toVersion(value: string): string {\n try {\n return normalizeVersion(value);\n } catch (error) {\n throw new UpgradeUsageError(error instanceof Error ? error.message : String(error));\n }\n}\n\n/** The installed `@warlock.js/core`, or the version its package.json range names. */\nexport function detectInstalledVersion(root: string): string {\n const installed = path.join(root, \"node_modules\", \"@warlock.js\", \"core\", \"package.json\");\n if (existsSync(installed)) {\n const version = (JSON.parse(readFileSync(installed, \"utf8\")) as { version?: unknown }).version;\n if (typeof version === \"string\" && parseVersion(version))\n return normalizeVersion(stripRange(version));\n }\n\n const manifest = path.join(root, \"package.json\");\n if (existsSync(manifest)) {\n const pkg = JSON.parse(readFileSync(manifest, \"utf8\")) as {\n dependencies?: Record<string, unknown>;\n devDependencies?: Record<string, unknown>;\n };\n const spec =\n pkg.dependencies?.[\"@warlock.js/core\"] ?? pkg.devDependencies?.[\"@warlock.js/core\"];\n const parsed = typeof spec === \"string\" ? parseVersion(spec) : undefined;\n if (parsed) return parsed.join(\".\");\n }\n\n throw new UpgradeUsageError(\n \"Could not tell which Warlock version this app is on (no installed @warlock.js/core). Pass it with --from, e.g. --from 5.29.\",\n );\n}\n\nfunction stripRange(version: string): string {\n return (parseVersion(version) ?? [0, 0, 0]).join(\".\");\n}\n\nfunction byFileAndLine(\n left: { file: string; line: number },\n right: { file: string; line: number },\n) {\n return left.file.localeCompare(right.file) || left.line - right.line;\n}\n\n/** Non-TypeScript files a codemod reads and rewrites, buffered until the end. */\nfunction createTextFiles(root: string) {\n const files = new Map<string, { before: string | undefined; current: string | undefined }>();\n\n const entry = (file: string) => {\n let existing = files.get(file);\n if (!existing) {\n const absolute = path.join(root, file);\n const content = existsSync(absolute) ? readFileSync(absolute, \"utf8\") : undefined;\n existing = { before: content, current: content };\n files.set(file, existing);\n }\n return existing;\n };\n\n return {\n read: (file: string) => entry(file).current,\n write: (file: string, content: string) => {\n entry(file).current = content;\n },\n changes: () =>\n [...files.entries()]\n .filter(([, value]) => value.current !== undefined && value.current !== value.before)\n .map(([file, value]) => ({ file, before: value.before ?? \"\", after: value.current ?? \"\" })),\n };\n}\n"],"mappings":";;;;;;;;;;;;AAqCA,IAAa,oBAAb,cAAuC,MAAM;;;cACX;;AAClC;;;;;AAMA,eAAsB,WAAW,SAAoD;CACnF,MAAM,OAAO,KAAK,QAAQ,QAAQ,QAAQ,QAAQ,IAAI,CAAC;CACvD,MAAM,KAAK,UAAU,QAAQ,EAAE;CAC/B,MAAM,OAAO,QAAQ,OAAO,UAAU,QAAQ,IAAI,IAAI,uBAAuB,IAAI;CAEjF,IAAI,gBAAgB,MAAM,EAAE,KAAK,GAC/B,MAAM,IAAI,kBAAkB,gBAAgB,MAAM,IAAI,QAAQ,SAAS,MAAS,CAAC;CAGnF,MAAM,YAAY,QAAQ,YAAY,SAAQ,CAAE,QAC7C,YACC,QAAQ,YAAY,YACnB,gBAAgB,QAAQ,SAAS,IAAI,IAAI,KAAK,gBAAgB,QAAQ,SAAS,EAAE,KAAK,CAC3F;CAEA,MAAM,UAAU,OAAO,QAAQ,eAAe,YAAW,CAAE,IAAI;CAC/D,MAAM,UAAU,IAAI,QAAQ,QAAQ;EAClC,6BAA6B;EAC7B,8BAA8B;EAC9B,iBAAiB;GAAE,KAAK,QAAQ,GAAG,QAAQ;GAAU,SAAS;EAAM;CACtE,CAAC;CAED,MAAM,gBAAgB,MAAM,KAAK,qBAAqB;EACpD,KAAK;EACL,QAAQ;GAAC;GAAsB;GAAc;GAAkB;EAAW;EAC1E,KAAK;CACP,CAAC;CACD,cAAc,KAAK;CAEnB,MAAM,4BAAY,IAAI,IAAoB;CAC1C,MAAM,cAA4B,CAAC;CACnC,KAAK,MAAM,YAAY,eAAe;EACpC,MAAM,UAAU,aAAa,KAAK,KAAK,MAAM,QAAQ,GAAG,MAAM;EAC9D,UAAU,IAAI,UAAU,OAAO;EAC/B,YAAY,KACV,QAAQ,iBAAiB,KAAK,KAAK,MAAM,QAAQ,GAAG,SAAS,EAAE,WAAW,KAAK,CAAC,CAClF;CACF;CAEA,MAAM,aAAa,IAAI,IACrB,YAAY,KAAK,YAAY,UAAU,CAAC,YAAY,cAAc,UAAU,EAAE,CAAC,CACjF;CAEA,MAAM,UAA2B,CAAC;CAClC,MAAM,SAAuB,CAAC;CAC9B,MAAM,YAAY,gBAAgB,IAAI;CACtC,IAAI;CAYJ,MAAM,UAA0B;EAC9B;EACA;EACA,eAAe,eACb,WAAW,IAAI,UAAU,KACzB,KAAK,SAAS,MAAM,WAAW,YAAY,CAAC,CAAC,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG;EACxE;GAfA,OAAO,SAAS,UAAU,KAAK,IAAI;GACnC,QAAQ,MAAM,SAAS,WAAW;IAChC,UAAU,MAAM,MAAM,OAAO;IAC7B,IAAI,eACF,QAAQ,KAAK;KAAE,SAAS,cAAc;KAAI;KAAM,GAAG;IAAO,CAAC;GAE/D;EASG;EACH,eAAe;CACjB;CAEA,MAAM,UAAqC,CAAC;CAE5C,KAAK,MAAM,WAAW,UAAU;EAC9B,gBAAgB;EAChB,MAAM,gBAAgB,QAAQ;EAC9B,MAAM,SAAS,QAAQ,IAAI,OAAO;EAElC,KAAK,MAAM,WAAW,OAAO,QAC3B,OAAO,KAAK;GAAE,GAAG;GAAS,SAAS,QAAQ;GAAI,OAAO,QAAQ;EAAM,CAAC;EAGvE,MAAM,yBAAS,IAAI,IAA0B;EAC7C,KAAK,MAAM,QAAQ,OAAO,OAAO;GAC/B,MAAM,OAAO,OAAO,IAAI,KAAK,IAAI,KAAK,CAAC;GACvC,KAAK,KAAK,IAAI;GACd,OAAO,IAAI,KAAK,MAAM,IAAI;EAC5B;EAEA,KAAK,MAAM,CAAC,MAAM,UAAU,QAAQ;GAClC,MAAM,aAAa,YAAY,cAAc,QAAQ,IAAI;GACzD,IAAI,CAAC,YAAY;GAEjB,IAAI,UAAU,WAAW,YAAY;GACrC,IAAI,cAAc,OAAO;GACzB,KAAK,MAAM,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,MAAM,UAAU,MAAM,QAAQ,KAAK,KAAK,GAAG;IAE7E,IAAI,KAAK,MAAM,aAAa;KAC1B,OAAO,KAAK;MACV,SAAS,QAAQ;MACjB,OAAO,QAAQ;MACf;MACA,MAAM,KAAK;MACX,MAAM,uDAAuD,KAAK,YAAY;KAChF,CAAC;KACD;IACF;IACA,UAAU,QAAQ,MAAM,GAAG,KAAK,KAAK,IAAI,KAAK,OAAO,QAAQ,MAAM,KAAK,GAAG;IAC3E,cAAc,KAAK;IACnB,QAAQ,KAAK;KAAE,SAAS,QAAQ;KAAI;KAAM,MAAM,KAAK;KAAM,aAAa,KAAK;IAAY,CAAC;GAC5F;GAEA,WAAW,gBAAgB,OAAO;EACpC;EAEA,QAAQ,KAAK;GACX,IAAI,QAAQ;GACZ,SAAS,QAAQ,YAAY,WAAW,KAAK,QAAQ;GACrD,OAAO,QAAQ;GACf,SAAS,QAAQ,SAAS;GAC1B,QAAQ,OAAO,QAAQ,SAAS,KAAK,YAAY,QAAQ,EAAE,CAAC,CAAC;EAC/D,CAAC;CACH;CACA,gBAAgB;CAEhB,QAAQ,KAAK,aAAa;CAC1B,OAAO,KAAK,aAAa;CAEzB,MAAM,UAA6D,CAAC;CACpE,YAAY,SAAS,YAAY,UAAU;EACzC,MAAM,OAAO,cAAc;EAC3B,IAAI,SAAS,QAAW;EACxB,MAAM,SAAS,UAAU,IAAI,IAAI,KAAK;EACtC,MAAM,QAAQ,WAAW,YAAY;EACrC,IAAI,WAAW,OAAO,QAAQ,KAAK;GAAE;GAAM;GAAQ;EAAM,CAAC;CAC5D,CAAC;CACD,KAAK,MAAM,UAAU,UAAU,QAAQ,GAAG,QAAQ,KAAK,MAAM;CAC7D,QAAQ,MAAM,MAAM,UAAU,KAAK,KAAK,cAAc,MAAM,IAAI,CAAC;CAEjE,IAAI,CAAC,QAAQ,QACX,KAAK,MAAM,UAAU,SAAS,cAAc,KAAK,KAAK,MAAM,OAAO,IAAI,GAAG,OAAO,KAAK;CAGxF,MAAM,qBAAqB,QAAQ,MAChC,WACC,OAAO,SAAS,kBAChB,QAAQ,MAAM,SAAS,KAAK,YAAY,sBAAsB,KAAK,SAAS,cAAc,CAC9F;CAEA,OAAO;EACL;EACA;EACA,QAAQ,QAAQ,WAAW;EAC3B,UAAU;EACV;EACA;EACA,OAAO,cAAc,QAClB,SAAS,gBAAgB,KAAK,SAAS,IAAI,IAAI,KAAK,gBAAgB,KAAK,SAAS,EAAE,KAAK,CAC5F;EACA,cAAc,QAAQ,KAAK,WAAW,OAAO,IAAI;EACjD,MAAM,QAAQ,KAAK,WAAW,YAAY,OAAO,MAAM,OAAO,QAAQ,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE;EAC5F,GAAI,sBAAsB,EACxB,aAAa,kBAAkB,MAAM,qBAAqB,IAAI,CAAC,EACjE;CACF;AACF;;;;;;;AAQA,SAAS,gBAAgB,MAAc,IAAY,eAAgC;CACjF,IAAI,eACF,OAAO,UAAU,KAAK,0BAA0B,GAAG;CAGrD,MAAM,UAAU,0BAA0B,cAAc,EAAE,EAAE,QAAQ;CAEpE,IAAI,gBAAgB,MAAM,EAAE,MAAM,GAChC,OAAO,6CAA6C,KAAK,iIAAiI,QAAQ;CAGpM,OAAO,0BAA0B,KAAK,SAAS,GAAG,wFAAwF,QAAQ;AACpJ;;AAGA,SAAS,cAAc,SAAyB;CAC9C,MAAM,CAAC,OAAO,SAAS,aAAa,OAAO,KAAK;EAAC;EAAG;EAAG;CAAC;CAExD,OAAO,QAAQ,IAAI,GAAG,MAAM,GAAG,QAAQ,MAAM;AAC/C;AAEA,SAAS,UAAU,OAAuB;CACxC,IAAI;EACF,OAAO,iBAAiB,KAAK;CAC/B,SAAS,OAAO;EACd,MAAM,IAAI,kBAAkB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;CACpF;AACF;;AAGA,SAAgB,uBAAuB,MAAsB;CAC3D,MAAM,YAAY,KAAK,KAAK,MAAM,gBAAgB,eAAe,QAAQ,cAAc;CACvF,IAAI,WAAW,SAAS,GAAG;EACzB,MAAM,UAAW,KAAK,MAAM,aAAa,WAAW,MAAM,CAAC,CAAC,CAA2B;EACvF,IAAI,OAAO,YAAY,YAAY,aAAa,OAAO,GACrD,OAAO,iBAAiB,WAAW,OAAO,CAAC;CAC/C;CAEA,MAAM,WAAW,KAAK,KAAK,MAAM,cAAc;CAC/C,IAAI,WAAW,QAAQ,GAAG;EACxB,MAAM,MAAM,KAAK,MAAM,aAAa,UAAU,MAAM,CAAC;EAIrD,MAAM,OACJ,IAAI,eAAe,uBAAuB,IAAI,kBAAkB;EAClE,MAAM,SAAS,OAAO,SAAS,WAAW,aAAa,IAAI,IAAI;EAC/D,IAAI,QAAQ,OAAO,OAAO,KAAK,GAAG;CACpC;CAEA,MAAM,IAAI,kBACR,6HACF;AACF;AAEA,SAAS,WAAW,SAAyB;CAC3C,QAAQ,aAAa,OAAO,KAAK;EAAC;EAAG;EAAG;CAAC,EAAC,CAAE,KAAK,GAAG;AACtD;AAEA,SAAS,cACP,MACA,OACA;CACA,OAAO,KAAK,KAAK,cAAc,MAAM,IAAI,KAAK,KAAK,OAAO,MAAM;AAClE;;AAGA,SAAS,gBAAgB,MAAc;CACrC,MAAM,wBAAQ,IAAI,IAAyE;CAE3F,MAAM,SAAS,SAAiB;EAC9B,IAAI,WAAW,MAAM,IAAI,IAAI;EAC7B,IAAI,CAAC,UAAU;GACb,MAAM,WAAW,KAAK,KAAK,MAAM,IAAI;GACrC,MAAM,UAAU,WAAW,QAAQ,IAAI,aAAa,UAAU,MAAM,IAAI;GACxE,WAAW;IAAE,QAAQ;IAAS,SAAS;GAAQ;GAC/C,MAAM,IAAI,MAAM,QAAQ;EAC1B;EACA,OAAO;CACT;CAEA,OAAO;EACL,OAAO,SAAiB,MAAM,IAAI,CAAC,CAAC;EACpC,QAAQ,MAAc,YAAoB;GACxC,MAAM,IAAI,CAAC,CAAC,UAAU;EACxB;EACA,eACE,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,CACjB,QAAQ,GAAG,WAAW,MAAM,YAAY,UAAa,MAAM,YAAY,MAAM,MAAM,CAAC,CACpF,KAAK,CAAC,MAAM,YAAY;GAAE;GAAM,QAAQ,MAAM,UAAU;GAAI,OAAO,MAAM,WAAW;EAAG,EAAE;CAChG;AACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { formatUpgradeReport } from "./format-upgrade-report.mjs";
|
|
2
|
+
import { TsMorphMissingError } from "./load-ts-morph.mjs";
|
|
3
|
+
import { UpgradeUsageError, runUpgrade } from "./run-upgrade.mjs";
|
|
4
|
+
|
|
5
|
+
//#region ../../packages/core/src/upgrade/upgrade-command.action.ts
|
|
6
|
+
/**
|
|
7
|
+
* The `warlock upgrade` action. Returns the exit code it set: 0 when it ran
|
|
8
|
+
* (even with places to review), 1 for unusable arguments or a missing ts-morph.
|
|
9
|
+
*/
|
|
10
|
+
async function runUpgradeCommand(options, overrides = {}, output = console) {
|
|
11
|
+
const json = Boolean(options.json);
|
|
12
|
+
const fail = (message) => {
|
|
13
|
+
if (json) output.log(JSON.stringify({ error: message }, null, 2));
|
|
14
|
+
else output.error(message);
|
|
15
|
+
process.exitCode = 1;
|
|
16
|
+
return 1;
|
|
17
|
+
};
|
|
18
|
+
const to = typeof options.to === "string" || typeof options.to === "number" ? String(options.to) : "";
|
|
19
|
+
if (!to) return fail("Pass the version to upgrade to, and the version upgrading from once the new release is installed: warlock upgrade --from 5.30 --to 5.31.0");
|
|
20
|
+
try {
|
|
21
|
+
const result = await runUpgrade({
|
|
22
|
+
...overrides,
|
|
23
|
+
to,
|
|
24
|
+
...options.from !== void 0 && options.from !== true && { from: String(options.from) },
|
|
25
|
+
dryRun: Boolean(options.dryRun)
|
|
26
|
+
});
|
|
27
|
+
output.log(json ? JSON.stringify(result, null, 2) : formatUpgradeReport(result));
|
|
28
|
+
return 0;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error instanceof UpgradeUsageError || error instanceof TsMorphMissingError) return fail(error.message);
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { runUpgradeCommand };
|
|
37
|
+
//# sourceMappingURL=upgrade-command.action.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade-command.action.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/upgrade-command.action.ts"],"sourcesContent":["import { formatUpgradeReport } from \"./format-upgrade-report\";\nimport { TsMorphMissingError } from \"./load-ts-morph\";\nimport { type RunUpgradeOptions, runUpgrade, UpgradeUsageError } from \"./run-upgrade\";\n\ntype Output = { log(message: string): void; error(message: string): void };\n\n/**\n * The `warlock upgrade` action. Returns the exit code it set: 0 when it ran\n * (even with places to review), 1 for unusable arguments or a missing ts-morph.\n */\nexport async function runUpgradeCommand(\n options: Record<string, string | boolean | number>,\n overrides: Pick<RunUpgradeOptions, \"root\" | \"codemods\" | \"loadTsMorph\"> = {},\n output: Output = console,\n): Promise<number> {\n const json = Boolean(options.json);\n const fail = (message: string): number => {\n if (json) output.log(JSON.stringify({ error: message }, null, 2));\n else output.error(message);\n process.exitCode = 1;\n return 1;\n };\n\n const to =\n typeof options.to === \"string\" || typeof options.to === \"number\" ? String(options.to) : \"\";\n if (!to) {\n return fail(\n \"Pass the version to upgrade to, and the version upgrading from once the new release is installed: warlock upgrade --from 5.30 --to 5.31.0\",\n );\n }\n\n try {\n const result = await runUpgrade({\n ...overrides,\n to,\n ...(options.from !== undefined && options.from !== true && { from: String(options.from) }),\n dryRun: Boolean(options.dryRun),\n });\n\n output.log(json ? JSON.stringify(result, null, 2) : formatUpgradeReport(result));\n return 0;\n } catch (error) {\n if (error instanceof UpgradeUsageError || error instanceof TsMorphMissingError) {\n return fail(error.message);\n }\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;AAUA,eAAsB,kBACpB,SACA,YAA0E,CAAC,GAC3E,SAAiB,SACA;CACjB,MAAM,OAAO,QAAQ,QAAQ,IAAI;CACjC,MAAM,QAAQ,YAA4B;EACxC,IAAI,MAAM,OAAO,IAAI,KAAK,UAAU,EAAE,OAAO,QAAQ,GAAG,MAAM,CAAC,CAAC;OAC3D,OAAO,MAAM,OAAO;EACzB,QAAQ,WAAW;EACnB,OAAO;CACT;CAEA,MAAM,KACJ,OAAO,QAAQ,OAAO,YAAY,OAAO,QAAQ,OAAO,WAAW,OAAO,QAAQ,EAAE,IAAI;CAC1F,IAAI,CAAC,IACH,OAAO,KACL,2IACF;CAGF,IAAI;EACF,MAAM,SAAS,MAAM,WAAW;GAC9B,GAAG;GACH;GACA,GAAI,QAAQ,SAAS,UAAa,QAAQ,SAAS,QAAQ,EAAE,MAAM,OAAO,QAAQ,IAAI,EAAE;GACxF,QAAQ,QAAQ,QAAQ,MAAM;EAChC,CAAC;EAED,OAAO,IAAI,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC,IAAI,oBAAoB,MAAM,CAAC;EAC/E,OAAO;CACT,SAAS,OAAO;EACd,IAAI,iBAAiB,qBAAqB,iBAAiB,qBACzD,OAAO,KAAK,MAAM,OAAO;EAE3B,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region ../../packages/core/src/upgrade/version.ts
|
|
2
|
+
/** Parse `5.31`, `5.31.0`, `v5.31.2`, `^5.30.0` into `[major, minor, patch]`. */
|
|
3
|
+
function parseVersion(value) {
|
|
4
|
+
const match = /(\d{1,6})(?:\.(\d{1,6}))?(?:\.(\d{1,6}))?/.exec(value.trim());
|
|
5
|
+
if (!match) return void 0;
|
|
6
|
+
return [
|
|
7
|
+
Number(match[1]),
|
|
8
|
+
Number(match[2] ?? 0),
|
|
9
|
+
Number(match[3] ?? 0)
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
/** `5.31` → `5.31.0`; throws on something that is not a version. */
|
|
13
|
+
function normalizeVersion(value) {
|
|
14
|
+
const parsed = parseVersion(value);
|
|
15
|
+
if (!parsed || !/^v?\d{1,6}(\.\d{1,6}){0,2}$/.test(value.trim())) throw new Error(`"${value}" is not a version. Pass one like --to 5.31 or --to 5.31.0.`);
|
|
16
|
+
return parsed.join(".");
|
|
17
|
+
}
|
|
18
|
+
/** Negative when `left` is older than `right`, 0 when equal, positive when newer. */
|
|
19
|
+
function compareVersions(left, right) {
|
|
20
|
+
const a = parseVersion(left) ?? [
|
|
21
|
+
0,
|
|
22
|
+
0,
|
|
23
|
+
0
|
|
24
|
+
];
|
|
25
|
+
const b = parseVersion(right) ?? [
|
|
26
|
+
0,
|
|
27
|
+
0,
|
|
28
|
+
0
|
|
29
|
+
];
|
|
30
|
+
for (let index = 0; index < 3; index++) {
|
|
31
|
+
const difference = (a[index] ?? 0) - (b[index] ?? 0);
|
|
32
|
+
if (difference !== 0) return difference;
|
|
33
|
+
}
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { compareVersions, normalizeVersion, parseVersion };
|
|
39
|
+
//# sourceMappingURL=version.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/version.ts"],"sourcesContent":["/** Parse `5.31`, `5.31.0`, `v5.31.2`, `^5.30.0` into `[major, minor, patch]`. */\nexport function parseVersion(value: string): [number, number, number] | undefined {\n const match = /(\\d{1,6})(?:\\.(\\d{1,6}))?(?:\\.(\\d{1,6}))?/.exec(value.trim());\n if (!match) return undefined;\n\n return [Number(match[1]), Number(match[2] ?? 0), Number(match[3] ?? 0)];\n}\n\n/** `5.31` → `5.31.0`; throws on something that is not a version. */\nexport function normalizeVersion(value: string): string {\n const parsed = parseVersion(value);\n if (!parsed || !/^v?\\d{1,6}(\\.\\d{1,6}){0,2}$/.test(value.trim())) {\n throw new Error(`\"${value}\" is not a version. Pass one like --to 5.31 or --to 5.31.0.`);\n }\n\n return parsed.join(\".\");\n}\n\n/** Negative when `left` is older than `right`, 0 when equal, positive when newer. */\nexport function compareVersions(left: string, right: string): number {\n const a = parseVersion(left) ?? [0, 0, 0];\n const b = parseVersion(right) ?? [0, 0, 0];\n\n for (let index = 0; index < 3; index++) {\n const difference = (a[index] ?? 0) - (b[index] ?? 0);\n if (difference !== 0) return difference;\n }\n\n return 0;\n}\n"],"mappings":";;AACA,SAAgB,aAAa,OAAqD;CAChF,MAAM,QAAQ,4CAA4C,KAAK,MAAM,KAAK,CAAC;CAC3E,IAAI,CAAC,OAAO,OAAO;CAEnB,OAAO;EAAC,OAAO,MAAM,EAAE;EAAG,OAAO,MAAM,MAAM,CAAC;EAAG,OAAO,MAAM,MAAM,CAAC;CAAC;AACxE;;AAGA,SAAgB,iBAAiB,OAAuB;CACtD,MAAM,SAAS,aAAa,KAAK;CACjC,IAAI,CAAC,UAAU,CAAC,8BAA8B,KAAK,MAAM,KAAK,CAAC,GAC7D,MAAM,IAAI,MAAM,IAAI,MAAM,4DAA4D;CAGxF,OAAO,OAAO,KAAK,GAAG;AACxB;;AAGA,SAAgB,gBAAgB,MAAc,OAAuB;CACnE,MAAM,IAAI,aAAa,IAAI,KAAK;EAAC;EAAG;EAAG;CAAC;CACxC,MAAM,IAAI,aAAa,KAAK,KAAK;EAAC;EAAG;EAAG;CAAC;CAEzC,KAAK,IAAI,QAAQ,GAAG,QAAQ,GAAG,SAAS;EACtC,MAAM,cAAc,EAAE,UAAU,MAAM,EAAE,UAAU;EAClD,IAAI,eAAe,GAAG,OAAO;CAC/B;CAEA,OAAO;AACT"}
|
|
@@ -4,4 +4,5 @@ import { broadcastUseCaseResult } from "./use-case-broadcast.mjs";
|
|
|
4
4
|
import { fireLifecycleEvent, globalEventsCallbacksMap, globalUseCasesEvents } from "./use-case-events.mjs";
|
|
5
5
|
import { PipelineOptions, runPipeline } from "./use-case-pipeline.mjs";
|
|
6
6
|
import { BadSchemaUseCaseError } from "./use-case.errors.mjs";
|
|
7
|
-
import { $registerUseCase, $unregisterUseCase, addUseCaseHistory, getUseCase, getUseCaseHistory, getUseCases, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls } from "./use-cases-registry.mjs";
|
|
7
|
+
import { $registerUseCase, $unregisterUseCase, addUseCaseHistory, getUseCase, getUseCaseHistory, getUseCases, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls } from "./use-cases-registry.mjs";
|
|
8
|
+
export { $registerUseCase, $unregisterUseCase, BadSchemaUseCaseError, PipelineOptions, RegisteredUseCase, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema, addUseCaseHistory, broadcastUseCaseResult, fireLifecycleEvent, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, runPipeline, useCase };
|