raiton 6.8.8-beta.24 → 6.10.0-beta.28
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 +50 -0
- package/README.md +46 -1
- package/benchmarks/README.md +16 -0
- package/benchmarks/latest.json +172 -0
- package/benchmarks/latest.md +66 -0
- package/build/bin/index.mjs +33575 -21723
- package/build/types/bin/bootstrapper.d.ts +2 -0
- package/build/types/bin/cli-output.d.ts +46 -0
- package/build/types/bin/cli-tools.d.ts +13 -0
- package/build/types/bin/cli.d.ts +3 -0
- package/build/types/bin/commands.registry.d.ts +4 -0
- package/build/types/bin/constants.d.ts +3 -0
- package/build/types/bin/file-utils.d.ts +21 -0
- package/build/types/bin/index.d.ts +2 -0
- package/build/types/bin/name-utils.d.ts +4 -0
- package/build/types/bin/project-utils.d.ts +12 -0
- package/build/types/commands/artifact.command.d.ts +7 -0
- package/build/types/commands/build.command.d.ts +8 -0
- package/build/types/commands/client.command.d.ts +7 -0
- package/build/types/commands/contract.command.d.ts +8 -0
- package/build/types/commands/develop.command.d.ts +9 -0
- package/build/types/commands/docs.command.d.ts +8 -0
- package/build/types/commands/doctor.command.d.ts +9 -0
- package/build/types/commands/generate.command.d.ts +7 -0
- package/build/types/commands/inspect.command.d.ts +7 -0
- package/build/types/commands/mcp.command.d.ts +11 -0
- package/build/types/commands/new.command.d.ts +7 -0
- package/build/types/commands/openapi.command.d.ts +7 -0
- package/build/types/commands/routes.command.d.ts +7 -0
- package/build/types/commands/start.command.d.ts +9 -0
- package/build/types/commands/why.command.d.ts +7 -0
- package/build/types/contracts/decorators.d.ts +41 -0
- package/build/types/contracts/errors.d.ts +42 -0
- package/build/types/contracts/index.d.ts +4 -0
- package/build/types/contracts/schema.d.ts +70 -0
- package/build/types/contracts/typebox.d.ts +81 -0
- package/build/types/core/application.d.ts +37 -0
- package/build/types/core/artifacts/artifact.d.ts +3 -0
- package/build/types/core/artifacts/index.d.ts +1 -0
- package/build/types/core/artifacts/runner.d.ts +1 -0
- package/build/types/core/builder.d.ts +42 -0
- package/build/types/core/bytes.util.d.ts +3 -0
- package/build/types/core/command.d.ts +13 -0
- package/build/types/core/commands.d.ts +10 -0
- package/build/types/core/config/config.d.ts +27 -0
- package/build/types/core/config/define.d.ts +8 -0
- package/build/types/core/config/index.d.ts +3 -0
- package/build/types/core/config/schema.d.ts +24 -0
- package/build/types/core/context.d.ts +11 -0
- package/build/types/core/controller/builder.d.ts +26 -0
- package/build/types/core/controller/compiler.d.ts +2 -0
- package/build/types/core/controller/index.d.ts +4 -0
- package/build/types/core/controller/metadata.d.ts +3 -0
- package/build/types/core/controller/tracker.d.ts +9 -0
- package/build/types/core/directories.d.ts +10 -0
- package/build/types/core/guards.d.ts +11 -0
- package/build/types/core/helpers/index.d.ts +1 -0
- package/build/types/core/helpers/raiton.d.ts +1 -0
- package/build/types/core/hooks.d.ts +14 -0
- package/build/types/core/index.d.ts +17 -0
- package/build/types/core/injection/index.d.ts +1 -0
- package/build/types/core/injection/injection.d.ts +37 -0
- package/build/types/core/mcp/builder.d.ts +2 -0
- package/build/types/core/mcp/index.d.ts +3 -0
- package/build/types/core/mcp/metadata.d.ts +9 -0
- package/build/types/core/mcp/tracker.d.ts +9 -0
- package/build/types/core/middleware/compose.d.ts +8 -0
- package/build/types/core/middleware/index.d.ts +2 -0
- package/build/types/core/middleware/pipeline.d.ts +12 -0
- package/build/types/core/plugins/index.d.ts +2 -0
- package/build/types/core/plugins/plugin.d.ts +2 -0
- package/build/types/core/plugins/scope.d.ts +15 -0
- package/build/types/core/process.util.d.ts +1 -0
- package/build/types/core/raiton.d.ts +15 -0
- package/build/types/core/router/handler.d.ts +2 -0
- package/build/types/core/router/handler.utils.d.ts +37 -0
- package/build/types/core/router/index.d.ts +4 -0
- package/build/types/core/router/matcher.d.ts +50 -0
- package/build/types/core/router/route.d.ts +52 -0
- package/build/types/core/router/router.d.ts +23 -0
- package/build/types/core/scheduler/builder.d.ts +2 -0
- package/build/types/core/scheduler/cron.d.ts +32 -0
- package/build/types/core/scheduler/duration.d.ts +7 -0
- package/build/types/core/scheduler/index.d.ts +6 -0
- package/build/types/core/scheduler/manager.d.ts +47 -0
- package/build/types/core/scheduler/metadata.d.ts +8 -0
- package/build/types/core/scheduler/queue/backend.d.ts +42 -0
- package/build/types/core/scheduler/queue/index.d.ts +3 -0
- package/build/types/core/scheduler/queue/rabbitmq.backend.d.ts +37 -0
- package/build/types/core/scheduler/queue/redis.backend.d.ts +38 -0
- package/build/types/core/server.d.ts +9 -0
- package/build/types/core/socket/builder.d.ts +1 -0
- package/build/types/core/socket/index.d.ts +2 -0
- package/build/types/core/socket/metadata.d.ts +14 -0
- package/build/types/core/thread.d.ts +21 -0
- package/build/types/framework/artifacts.d.ts +20 -0
- package/build/types/framework/cache/cache.d.ts +84 -0
- package/build/types/framework/cache/cache.decorator.d.ts +21 -0
- package/build/types/framework/cache/etag.d.ts +62 -0
- package/build/types/framework/cache/index.d.ts +4 -0
- package/build/types/framework/cache/types.d.ts +89 -0
- package/build/types/framework/constants/decorators.constant.d.ts +28 -0
- package/build/types/framework/constants/index.d.ts +2 -0
- package/build/types/framework/constants/microservices.constant.d.ts +3 -0
- package/build/types/framework/controllers.d.ts +2 -0
- package/build/types/framework/data-transfer-object.d.ts +5 -0
- package/build/types/framework/decorators/access-guard.decorator.d.ts +1 -0
- package/build/types/framework/decorators/api-response.decorator.d.ts +66 -0
- package/build/types/framework/decorators/api.decorator.d.ts +160 -0
- package/build/types/framework/decorators/controllable.decorator.d.ts +3 -0
- package/build/types/framework/decorators/csrf-guard.decorator.d.ts +2 -0
- package/build/types/framework/decorators/csrf-token.decorator.d.ts +1 -0
- package/build/types/framework/decorators/guard.decorator.d.ts +2 -0
- package/build/types/framework/decorators/health-check.decorator.d.ts +17 -0
- package/build/types/framework/decorators/index.d.ts +15 -0
- package/build/types/framework/decorators/injection.decorator.d.ts +5 -0
- package/build/types/framework/decorators/mcp.decorator.d.ts +68 -0
- package/build/types/framework/decorators/middleware.decorator.d.ts +3 -0
- package/build/types/framework/decorators/parametrable.decorator.d.ts +9 -0
- package/build/types/framework/decorators/routable.decorator.d.ts +12 -0
- package/build/types/framework/decorators/route-interaction.decorator.d.ts +81 -0
- package/build/types/framework/decorators/scheduler.decorator.d.ts +54 -0
- package/build/types/framework/decorators/socket.decorator.d.ts +5 -0
- package/build/types/framework/encryption.d.ts +25 -0
- package/build/types/framework/enums/csrf.enum.d.ts +4 -0
- package/build/types/framework/enums/encrypted.enum.d.ts +20 -0
- package/build/types/framework/enums/event.message.enum.d.ts +4 -0
- package/build/types/framework/enums/http-method.enum.d.ts +10 -0
- package/build/types/framework/enums/http-parameters.enum.d.ts +11 -0
- package/build/types/framework/enums/http-status.enum.d.ts +64 -0
- package/build/types/framework/enums/index.d.ts +9 -0
- package/build/types/framework/enums/runtime.enum.d.ts +5 -0
- package/build/types/framework/enums/scheduler.enum.d.ts +21 -0
- package/build/types/framework/enums/timestamp.enum.d.ts +6 -0
- package/build/types/framework/env.d.ts +3 -0
- package/build/types/framework/errors/catalog.d.ts +42 -0
- package/build/types/framework/exceptions/http-exception.d.ts +18 -0
- package/build/types/framework/exceptions/index.d.ts +2 -0
- package/build/types/framework/exceptions/throwable.d.ts +76 -0
- package/build/types/framework/health-check.d.ts +42 -0
- package/build/types/framework/index.d.ts +20 -0
- package/build/types/framework/mcp/audit.d.ts +12 -0
- package/build/types/framework/mcp/conformance.d.ts +31 -0
- package/build/types/framework/mcp/handler.d.ts +11 -0
- package/build/types/framework/mcp/index.d.ts +5 -0
- package/build/types/framework/mcp/protocol.d.ts +17 -0
- package/build/types/framework/mcp/rate-limit.d.ts +10 -0
- package/build/types/framework/mcp/stdio.d.ts +40 -0
- package/build/types/framework/mcp/streamable-http.d.ts +17 -0
- package/build/types/framework/observability/index.d.ts +6 -0
- package/build/types/framework/observability/metrics.d.ts +23 -0
- package/build/types/framework/observability/plugin.d.ts +20 -0
- package/build/types/framework/observability/readiness.d.ts +9 -0
- package/build/types/framework/observability/request.d.ts +7 -0
- package/build/types/framework/observability/shutdown.d.ts +21 -0
- package/build/types/framework/observability/trace.d.ts +96 -0
- package/build/types/framework/parameter-bag.d.ts +14 -0
- package/build/types/framework/plugins/body-parser.plugin.d.ts +3 -0
- package/build/types/framework/plugins/dev.plugin.d.ts +12 -0
- package/build/types/framework/plugins/index.d.ts +5 -0
- package/build/types/framework/plugins/mcp.plugin.d.ts +15 -0
- package/build/types/framework/plugins/openapi.plugin.d.ts +58 -0
- package/build/types/framework/plugins/security/body-limit.d.ts +1 -0
- package/build/types/framework/plugins/security/cors.d.ts +10 -0
- package/build/types/framework/plugins/security/csrf.d.ts +2 -0
- package/build/types/framework/plugins/security/headers.d.ts +1 -0
- package/build/types/framework/plugins/security/index.d.ts +13 -0
- package/build/types/framework/plugins/security/method-guard.d.ts +1 -0
- package/build/types/framework/plugins/security/rate-limit.d.ts +5 -0
- package/build/types/framework/repositories.d.ts +5 -0
- package/build/types/framework/responses/error.d.ts +13 -0
- package/build/types/framework/responses/helpers.d.ts +7 -0
- package/build/types/framework/responses/http-throwable.d.ts +14 -0
- package/build/types/framework/responses/http.d.ts +13 -0
- package/build/types/framework/responses/index.d.ts +4 -0
- package/build/types/framework/runtime/bun/server.d.ts +2 -0
- package/build/types/framework/runtime/deno/server.d.ts +2 -0
- package/build/types/framework/runtime/index.d.ts +17 -0
- package/build/types/framework/runtime/node/reply.d.ts +12 -0
- package/build/types/framework/runtime/node/request.d.ts +33 -0
- package/build/types/framework/runtime/node/server.d.ts +2 -0
- package/build/types/framework/runtime/web/server.d.ts +1 -0
- package/build/types/framework/services.d.ts +5 -0
- package/build/types/framework/utilities/alias-path.util.d.ts +1 -0
- package/build/types/framework/utilities/artifact.util.d.ts +7 -0
- package/build/types/framework/utilities/callable.util.d.ts +1 -0
- package/build/types/framework/utilities/cookie.util.d.ts +1 -0
- package/build/types/framework/utilities/csrf.util.d.ts +26 -0
- package/build/types/framework/utilities/https.util.d.ts +49 -0
- package/build/types/framework/utilities/index.d.ts +12 -0
- package/build/types/framework/utilities/ip.util.d.ts +15 -0
- package/build/types/framework/utilities/json.util.d.ts +10 -0
- package/build/types/framework/utilities/openapi.utils.d.ts +7 -0
- package/build/types/framework/utilities/openapi.utils.impl.d.ts +18 -0
- package/build/types/framework/utilities/path.util.d.ts +3 -0
- package/build/types/framework/utilities/route-suggestion.util.d.ts +10 -0
- package/build/types/framework/utilities/url.util.d.ts +1 -0
- package/build/types/framework/utilities/utilities.util.d.ts +3 -0
- package/build/types/framework/utilities/validation.util.d.ts +8 -0
- package/build/types/framework/view-model.d.ts +4 -0
- package/build/types/generators/artifact.templates.d.ts +7 -0
- package/build/types/generators/index.d.ts +2 -0
- package/build/types/generators/project.templates.d.ts +21 -0
- package/build/types/manifest/client.d.ts +12 -0
- package/build/types/manifest/contract.d.ts +25 -0
- package/build/types/manifest/index.d.ts +5 -0
- package/build/types/manifest/introspect.d.ts +18 -0
- package/build/types/manifest/manifest.d.ts +18 -0
- package/build/types/manifest/schema.d.ts +177 -0
- package/build/types/requirements.d.ts +1 -0
- package/build/types/types/access-guards.d.ts +4 -0
- package/build/types/types/application.d.ts +32 -0
- package/build/types/types/artifact.d.ts +8 -0
- package/build/types/types/builder.d.ts +37 -0
- package/build/types/types/config.d.ts +62 -0
- package/build/types/types/controller.d.ts +27 -0
- package/build/types/types/contruct.d.ts +1 -0
- package/build/types/types/core.d.ts +11 -0
- package/build/types/types/csrf.d.ts +33 -0
- package/build/types/types/directory.d.ts +6 -0
- package/build/types/types/encryption.d.ts +14 -0
- package/build/types/types/generic.d.ts +2 -0
- package/build/types/types/guard.d.ts +9 -0
- package/build/types/types/http-responses.d.ts +7 -0
- package/build/types/types/index.d.ts +27 -0
- package/build/types/types/injection.d.ts +11 -0
- package/build/types/types/lifecycle.d.ts +9 -0
- package/build/types/types/mcp.d.ts +148 -0
- package/build/types/types/middleware.d.ts +12 -0
- package/build/types/types/parseable.d.ts +3 -0
- package/build/types/types/plugin.d.ts +6 -0
- package/build/types/types/raiton.d.ts +13 -0
- package/build/types/types/responses.d.ts +20 -0
- package/build/types/types/router.d.ts +13 -0
- package/build/types/types/runtime.d.ts +48 -0
- package/build/types/types/scheduler.d.ts +140 -0
- package/build/types/types/scheme.d.ts +125 -0
- package/build/types/types/server.d.ts +10 -0
- package/build/types/types/socket.d.ts +11 -0
- package/build/types/types/thread.d.ts +25 -0
- package/build/types/types/utilities.d.ts +4 -0
- package/build/types/types/values.d.ts +2 -0
- package/docs/AGENTS.md +55 -0
- package/docs/CLAUDE.md +55 -0
- package/docs/README.md +5 -0
- package/docs/contributors/cli/README.md +17 -3
- package/docs/contributors/cli/commands.md +28 -17
- package/docs/contributors/framework/plugins/openapi.md +12 -3
- package/docs/generated/cli/commands.md +26 -0
- package/docs/generated/config-schema.json +150 -0
- package/docs/generated/manifest-schema.json +236 -0
- package/docs/generated/manifest.json +101 -0
- package/docs/llms-full.txt +1271 -0
- package/docs/llms.txt +46 -0
- package/docs/user-guide/README.md +18 -12
- package/docs/user-guide/cli.md +21 -0
- package/docs/user-guide/config.md +14 -0
- package/docs/user-guide/contracts.md +67 -0
- package/docs/user-guide/en/README.md +83 -0
- package/docs/user-guide/getting-started.md +13 -1
- package/docs/user-guide/mcp.md +45 -2
- package/docs/user-guide/observability.md +74 -0
- package/docs/user-guide/openapi/plugin.md +10 -0
- package/docs/user-guide/recipes/README.md +32 -0
- package/docs/user-guide/recipes/contracts.md +52 -0
- package/docs/user-guide/recipes/doctor.md +16 -0
- package/docs/user-guide/recipes/generate.md +28 -0
- package/docs/user-guide/recipes/manifest.md +17 -0
- package/docs/user-guide/recipes/mcp-stdio.md +35 -0
- package/docs/user-guide/recipes/new-project.md +34 -0
- package/docs/user-guide/recipes/observability.md +17 -0
- package/package.json +40 -7
- package/scripts/bench.ts +586 -0
- package/scripts/postinstall.mjs +15 -0
- package/source/bin/cli-output.ts +139 -0
- package/source/bin/commands.registry.ts +23 -3
- package/source/bin/file-utils.ts +95 -0
- package/source/bin/name-utils.ts +26 -0
- package/source/bin/project-utils.ts +78 -0
- package/source/commands/artifact.command.ts +30 -15
- package/source/commands/client.command.ts +64 -0
- package/source/commands/contract.command.ts +104 -0
- package/source/commands/docs.command.ts +263 -0
- package/source/commands/doctor.command.ts +226 -0
- package/source/commands/generate.command.ts +58 -0
- package/source/commands/inspect.command.ts +108 -0
- package/source/commands/mcp.command.ts +258 -0
- package/source/commands/new.command.ts +135 -0
- package/source/commands/openapi.command.ts +95 -0
- package/source/commands/routes.command.ts +39 -0
- package/source/commands/why.command.ts +61 -0
- package/source/contracts/decorators.ts +151 -0
- package/source/contracts/errors.ts +76 -0
- package/source/contracts/index.ts +4 -0
- package/source/contracts/schema.ts +377 -0
- package/source/contracts/typebox.ts +193 -0
- package/source/core/application.ts +215 -73
- package/source/core/builder.ts +6 -2
- package/source/core/config/config.ts +144 -26
- package/source/core/config/define.ts +35 -8
- package/source/core/config/index.ts +2 -1
- package/source/core/config/schema.ts +263 -0
- package/source/core/controller/builder.ts +38 -13
- package/source/core/controller/compiler.ts +14 -7
- package/source/core/controller/metadata.ts +1 -1
- package/source/core/hooks.ts +13 -1
- package/source/core/injection/injection.ts +47 -9
- package/source/core/mcp/builder.ts +13 -2
- package/source/core/mcp/metadata.ts +2 -1
- package/source/core/middleware/compose.ts +48 -0
- package/source/core/middleware/pipeline.ts +69 -46
- package/source/core/raiton.ts +8 -0
- package/source/core/router/handler.ts +91 -31
- package/source/core/router/handler.utils.ts +107 -51
- package/source/core/router/matcher.ts +195 -24
- package/source/core/router/route.ts +100 -31
- package/source/core/router/router.ts +27 -2
- package/source/core/scheduler/metadata.ts +1 -1
- package/source/core/socket/metadata.ts +1 -1
- package/source/core/thread.ts +37 -2
- package/source/framework/artifacts.ts +92 -19
- package/source/framework/cache/cache.ts +48 -3
- package/source/framework/constants/decorators.constant.ts +5 -0
- package/source/framework/data-transfer-object.ts +4 -3
- package/source/framework/decorators/controllable.decorator.ts +3 -3
- package/source/framework/decorators/csrf-guard.decorator.ts +3 -2
- package/source/framework/decorators/csrf-token.decorator.ts +1 -1
- package/source/framework/decorators/guard.decorator.ts +3 -2
- package/source/framework/decorators/health-check.decorator.ts +1 -1
- package/source/framework/decorators/mcp.decorator.ts +38 -7
- package/source/framework/decorators/middleware.decorator.ts +2 -2
- package/source/framework/decorators/parametrable.decorator.ts +2 -1
- package/source/framework/decorators/routable.decorator.ts +3 -3
- package/source/framework/decorators/route-interaction.decorator.ts +2 -2
- package/source/framework/decorators/scheduler.decorator.ts +3 -3
- package/source/framework/decorators/socket.decorator.ts +3 -3
- package/source/framework/encryption.ts +46 -7
- package/source/framework/errors/catalog.ts +159 -0
- package/source/framework/exceptions/http-exception.ts +1 -1
- package/source/framework/health-check.ts +18 -0
- package/source/framework/index.ts +2 -0
- package/source/framework/mcp/audit.ts +57 -0
- package/source/framework/mcp/conformance.ts +195 -0
- package/source/framework/mcp/handler.ts +131 -9
- package/source/framework/mcp/index.ts +6 -1
- package/source/framework/mcp/protocol.ts +6 -0
- package/source/framework/mcp/rate-limit.ts +33 -0
- package/source/framework/mcp/stdio.ts +150 -0
- package/source/framework/mcp/streamable-http.ts +36 -5
- package/source/framework/observability/index.ts +6 -0
- package/source/framework/observability/metrics.ts +162 -0
- package/source/framework/observability/plugin.ts +151 -0
- package/source/framework/observability/readiness.ts +22 -0
- package/source/framework/observability/request.ts +31 -0
- package/source/framework/observability/shutdown.ts +68 -0
- package/source/framework/observability/trace.ts +241 -0
- package/source/framework/plugins/body-parser.plugin.ts +88 -85
- package/source/framework/plugins/dev.plugin.ts +227 -0
- package/source/framework/plugins/index.ts +2 -1
- package/source/framework/plugins/mcp.plugin.ts +14 -3
- package/source/framework/plugins/openapi.plugin.ts +56 -13
- package/source/framework/responses/helpers.ts +4 -4
- package/source/framework/responses/http-throwable.ts +1 -1
- package/source/framework/runtime/bun/server.ts +2 -1
- package/source/framework/runtime/deno/server.ts +2 -1
- package/source/framework/runtime/index.ts +45 -13
- package/source/framework/runtime/node/request.ts +59 -13
- package/source/framework/utilities/index.ts +3 -1
- package/source/framework/utilities/openapi.utils.impl.ts +705 -0
- package/source/framework/utilities/openapi.utils.ts +6 -636
- package/source/framework/utilities/route-suggestion.util.ts +59 -0
- package/source/framework/utilities/validation.util.ts +20 -0
- package/source/generators/artifact.templates.ts +230 -0
- package/source/generators/index.ts +2 -0
- package/source/generators/project.templates.ts +392 -0
- package/source/manifest/client.ts +299 -0
- package/source/manifest/contract.ts +138 -0
- package/source/manifest/index.ts +5 -0
- package/source/manifest/introspect.ts +52 -0
- package/source/manifest/manifest.ts +341 -0
- package/source/manifest/schema.ts +149 -0
- package/source/types/builder.ts +5 -0
- package/source/types/config.ts +64 -2
- package/source/types/mcp.ts +63 -1
- package/tsconfig.build.json +13 -0
- package/source/commands/grafts.command.ts +0 -27
- package/tests/artifact-resolution.test.ts +0 -60
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Version of the stable CLI JSON envelope. */
|
|
2
|
+
export declare const CLI_JSON_SCHEMA_VERSION = "1.0.0";
|
|
3
|
+
export declare enum ExitCode {
|
|
4
|
+
SUCCESS = 0,
|
|
5
|
+
USAGE = 1,
|
|
6
|
+
PREREQUISITE_MISSING = 2,
|
|
7
|
+
FILE_CONFLICT = 3,
|
|
8
|
+
DIAGNOSTIC_FAILED = 4
|
|
9
|
+
}
|
|
10
|
+
export interface CliErrorOptions {
|
|
11
|
+
code?: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
docsUrl?: string;
|
|
14
|
+
location?: string;
|
|
15
|
+
exitCode?: ExitCode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Stable CLI error shape shared by every command:
|
|
19
|
+
* `{ code, message, hint, docsUrl, location? }`.
|
|
20
|
+
*/
|
|
21
|
+
export declare class CliError extends Error {
|
|
22
|
+
readonly code: string;
|
|
23
|
+
readonly hint: string;
|
|
24
|
+
readonly docsUrl: string;
|
|
25
|
+
readonly location?: string;
|
|
26
|
+
readonly exitCode: ExitCode;
|
|
27
|
+
constructor(message: string, options?: CliErrorOptions);
|
|
28
|
+
toJSON(): {
|
|
29
|
+
code: string;
|
|
30
|
+
message: string;
|
|
31
|
+
hint: string;
|
|
32
|
+
docsUrl: string;
|
|
33
|
+
location?: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare function fail(error: unknown, json?: boolean): void;
|
|
37
|
+
export declare function printJson(value: unknown): void;
|
|
38
|
+
export declare function print(value: unknown, json?: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Redirect incidental framework logs to stderr while a machine-readable
|
|
41
|
+
* command runs, so `--json` always emits exactly one valid JSON document on
|
|
42
|
+
* stdout.
|
|
43
|
+
*/
|
|
44
|
+
export declare function silenceStdout<T>(callable: () => Promise<T> | T): Promise<T>;
|
|
45
|
+
export declare function isInteractive(): boolean;
|
|
46
|
+
export declare function ensureNonInteractive(required: Record<string, any>): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class CliTools {
|
|
2
|
+
static get cwd(): string;
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the runtime-appropriate CLI entry point.
|
|
5
|
+
* - Node: `build/bin/index.mjs` (compiled bundle)
|
|
6
|
+
* - Bun / Deno: `bin/index.ts` (native TypeScript execution)
|
|
7
|
+
*/
|
|
8
|
+
static cliEntry(appdir: string): string;
|
|
9
|
+
static set cwd(value: string);
|
|
10
|
+
static get argv(): any;
|
|
11
|
+
static get process(): any;
|
|
12
|
+
static spawn(command: string | string[], args?: string[], options?: Record<string, any>): Deno.ChildProcess | import("node:child_process").ChildProcessWithoutNullStreams | Bun.Subprocess<"ignore", "pipe", "inherit">;
|
|
13
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { RaitonCommand } from "../core/index.ts";
|
|
3
|
+
export type RaitonCommandConstructor = new (cli: Command, workdir: string, appdir: string) => RaitonCommand;
|
|
4
|
+
export declare const RaitonCommandsRegistry: RaitonCommandConstructor[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface GeneratedFile {
|
|
2
|
+
path: string;
|
|
3
|
+
content: string;
|
|
4
|
+
}
|
|
5
|
+
export interface WriteOptions {
|
|
6
|
+
force?: boolean;
|
|
7
|
+
dryRun?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface WriteResult {
|
|
10
|
+
files: string[];
|
|
11
|
+
conflicts: string[];
|
|
12
|
+
written: string[];
|
|
13
|
+
dryRun: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Write generated files without ever overwriting an existing file unless
|
|
17
|
+
* `force` is explicit. `dryRun` returns the same plan without touching disk.
|
|
18
|
+
*/
|
|
19
|
+
export declare function writeFiles(baseDir: string, files: GeneratedFile[], options?: WriteOptions): WriteResult;
|
|
20
|
+
export declare function isDirectoryEmpty(directory: string): boolean;
|
|
21
|
+
export declare function readJsonFile<T = any>(filename: string): T;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Introspection } from "../manifest/introspect.ts";
|
|
2
|
+
import type { ProjectManifest, ProjectRouteManifest } from "../manifest/schema.ts";
|
|
3
|
+
export declare function loadProject(workdir: string, json?: boolean): Promise<Introspection>;
|
|
4
|
+
export interface RouteRow {
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
handler: string;
|
|
8
|
+
source: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function routeRows(manifest: ProjectManifest): RouteRow[];
|
|
11
|
+
export declare function printTable(rows: RouteRow[]): string;
|
|
12
|
+
export declare function findRoute(manifest: ProjectManifest, method: string, routePath: string): ProjectRouteManifest | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RaitonCommand } from "../core/index.ts";
|
|
2
|
+
import type { BuildCommandOptionsInterface } from "../types/index.ts";
|
|
3
|
+
export default class BuildCommand extends RaitonCommand {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
register(): void;
|
|
7
|
+
protected run(options: BuildCommandOptionsInterface): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RaitonCommand } from "../core/command.ts";
|
|
2
|
+
export default class ContractCommand extends RaitonCommand {
|
|
3
|
+
readonly name = "contract";
|
|
4
|
+
readonly description = "Check published route contracts for breaking changes";
|
|
5
|
+
register(): void;
|
|
6
|
+
private check;
|
|
7
|
+
private snapshot;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RaitonCommand } from "../core/index.ts";
|
|
2
|
+
export default class DevelopCommand extends RaitonCommand {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly description: string;
|
|
5
|
+
private child;
|
|
6
|
+
register(): void;
|
|
7
|
+
protected restart(): Promise<void>;
|
|
8
|
+
protected run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RaitonCommand } from "../core/command.ts";
|
|
2
|
+
export default class DocsCommand extends RaitonCommand {
|
|
3
|
+
readonly name = "docs";
|
|
4
|
+
readonly description = "Generate agent-oriented and reference documentation";
|
|
5
|
+
register(): void;
|
|
6
|
+
private run;
|
|
7
|
+
private generate;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RaitonCommand } from "../core/command.ts";
|
|
2
|
+
export default class DoctorCommand extends RaitonCommand {
|
|
3
|
+
readonly name = "doctor";
|
|
4
|
+
readonly description = "Diagnose the runtime, configuration and project prerequisites";
|
|
5
|
+
register(): void;
|
|
6
|
+
private run;
|
|
7
|
+
private diagnose;
|
|
8
|
+
private fixEnv;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RaitonCommand } from "../core/command.ts";
|
|
2
|
+
export default class McpCommand extends RaitonCommand {
|
|
3
|
+
readonly name = "mcp";
|
|
4
|
+
readonly description = "Inspect, test and serve MCP servers";
|
|
5
|
+
register(): void;
|
|
6
|
+
private list;
|
|
7
|
+
private inspect;
|
|
8
|
+
private test;
|
|
9
|
+
private serve;
|
|
10
|
+
private conformance;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RaitonCommand } from "../core/index.ts";
|
|
2
|
+
import { StartCommandOptionsInterface } from "../types/index.ts";
|
|
3
|
+
export default class StartCommand extends RaitonCommand {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
private child;
|
|
7
|
+
register(): void;
|
|
8
|
+
protected run(options: StartCommandOptionsInterface): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import { type ContractSchema, type ContractIssue } from "./schema.ts";
|
|
3
|
+
export interface RouteInputContract {
|
|
4
|
+
body?: ContractSchema;
|
|
5
|
+
query?: ContractSchema;
|
|
6
|
+
params?: ContractSchema;
|
|
7
|
+
headers?: ContractSchema;
|
|
8
|
+
}
|
|
9
|
+
export interface RouteContract {
|
|
10
|
+
input?: ContractSchema | RouteInputContract;
|
|
11
|
+
output?: ContractSchema;
|
|
12
|
+
}
|
|
13
|
+
export declare function isCompositeInput(input: any): input is RouteInputContract;
|
|
14
|
+
/**
|
|
15
|
+
* Declare the input contract of a route. A single schema validates the request
|
|
16
|
+
* body; an object with `body`/`query`/`params`/`headers` keys validates each
|
|
17
|
+
* part independently.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Input(input: ContractSchema | RouteInputContract): (target: any, propertyKey: string | symbol) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Declare the output contract of a route. Enforced in development only by
|
|
22
|
+
* default; see `validation.responses` configuration.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Output(output: ContractSchema): (target: any, propertyKey: string | symbol) => void;
|
|
25
|
+
export declare function getRouteContract(target: any, propertyKey?: string | symbol): RouteContract | undefined;
|
|
26
|
+
export interface RouteInputValidationResult {
|
|
27
|
+
success: boolean;
|
|
28
|
+
issues: ContractIssue[];
|
|
29
|
+
body?: any;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Validate every declared part of a route input without mutating the request.
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateRouteInput(contract: RouteContract | undefined, ctx: any): Promise<RouteInputValidationResult>;
|
|
35
|
+
export declare function validateRouteOutput(contract: RouteContract | undefined, value: any): Promise<{
|
|
36
|
+
success: boolean;
|
|
37
|
+
issues: ContractIssue[];
|
|
38
|
+
}>;
|
|
39
|
+
export declare const RouteContractMetadata: {
|
|
40
|
+
contractKey: symbol;
|
|
41
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ContractIssue } from "./schema.ts";
|
|
2
|
+
export declare const DOCS_BASE_URL = "https://github.com/protorians/raiton/blob/main/docs";
|
|
3
|
+
export declare function docsUrl(path?: string): string;
|
|
4
|
+
export interface ValidationErrorBody {
|
|
5
|
+
error: true;
|
|
6
|
+
code: "VALIDATION_ERROR";
|
|
7
|
+
message: string;
|
|
8
|
+
statusCode: number;
|
|
9
|
+
details: ContractIssue[];
|
|
10
|
+
docsUrl: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Stable validation error payload shared by runtime validation and generated
|
|
14
|
+
* clients. Never includes a stack trace or internal field.
|
|
15
|
+
*/
|
|
16
|
+
export declare function validationErrorBody(issues: ContractIssue[], message?: string): ValidationErrorBody;
|
|
17
|
+
/**
|
|
18
|
+
* Thrown before the route handler executes when the input contract fails.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ContractValidationError extends Error {
|
|
21
|
+
readonly issues: ContractIssue[];
|
|
22
|
+
readonly statusCode = 400;
|
|
23
|
+
constructor(issues: ContractIssue[], message?: string);
|
|
24
|
+
render(): ValidationErrorBody;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Thrown in development when a response does not match its `@Output` contract.
|
|
28
|
+
*/
|
|
29
|
+
export declare class OutputContractError extends Error {
|
|
30
|
+
readonly route: string;
|
|
31
|
+
readonly issues: ContractIssue[];
|
|
32
|
+
readonly statusCode = 500;
|
|
33
|
+
constructor(route: string, issues: ContractIssue[]);
|
|
34
|
+
render(): {
|
|
35
|
+
error: boolean;
|
|
36
|
+
code: string;
|
|
37
|
+
statusCode: number;
|
|
38
|
+
message: string;
|
|
39
|
+
details: ContractIssue[];
|
|
40
|
+
docsUrl: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type TSchema } from "@sinclair/typebox";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal Standard Schema v1 surface. We only rely on the `validate` method so
|
|
4
|
+
* Zod, Valibot, ArkType and friends can be plugged without a hard dependency.
|
|
5
|
+
*/
|
|
6
|
+
export interface StandardSchemaIssue {
|
|
7
|
+
path?: ReadonlyArray<PropertyKey | {
|
|
8
|
+
key: PropertyKey;
|
|
9
|
+
}>;
|
|
10
|
+
message?: string;
|
|
11
|
+
code?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface StandardSchemaV1<T = unknown> {
|
|
14
|
+
readonly "~standard": {
|
|
15
|
+
readonly version: number;
|
|
16
|
+
readonly vendor: string;
|
|
17
|
+
readonly validate: (value: unknown) => StandardSchemaResult<T> | Promise<StandardSchemaResult<T>>;
|
|
18
|
+
readonly jsonSchema?: Record<string, unknown>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export type StandardSchemaResult<T = unknown> = {
|
|
22
|
+
value: T;
|
|
23
|
+
issues?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
issues: ReadonlyArray<StandardSchemaIssue>;
|
|
26
|
+
value?: undefined;
|
|
27
|
+
};
|
|
28
|
+
export type ContractSchema = TSchema | StandardSchemaV1<any>;
|
|
29
|
+
export interface ContractIssue {
|
|
30
|
+
path: string;
|
|
31
|
+
code: string;
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ContractValidationResult<T = unknown> {
|
|
35
|
+
success: boolean;
|
|
36
|
+
value?: T;
|
|
37
|
+
issues: ContractIssue[];
|
|
38
|
+
}
|
|
39
|
+
export declare function isStandardSchema(value: any): value is StandardSchemaV1;
|
|
40
|
+
export declare function isTypeBoxSchema(value: any): value is TSchema;
|
|
41
|
+
export declare function isContractSchema(value: any): value is ContractSchema;
|
|
42
|
+
/**
|
|
43
|
+
* Convert plain JSON Schema (no TypeBox `Kind`) to TypeBox so the value checker
|
|
44
|
+
* can validate it. Already-compiled TypeBox schemas are returned unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export declare function toTypeBoxSchema(schema: any): TSchema;
|
|
47
|
+
/**
|
|
48
|
+
* Validate a value against a TypeBox schema or any Standard Schema provider.
|
|
49
|
+
* Never throws for invalid user input: callers receive a stable issue list.
|
|
50
|
+
*/
|
|
51
|
+
export declare function validateContract<T = unknown>(schema: ContractSchema, value: unknown): Promise<ContractValidationResult<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* Convert any supported contract to a JSON Schema object suitable for
|
|
54
|
+
* publication in the manifest or in OpenAPI documents.
|
|
55
|
+
*/
|
|
56
|
+
export declare function contractToJsonSchema(schema?: ContractSchema): Record<string, any> | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* OpenAPI 3.0 does not understand every JSON Schema 2020 keyword. This adapter
|
|
59
|
+
* keeps the contract source unique while emitting a document most tools accept.
|
|
60
|
+
*/
|
|
61
|
+
export declare function contractToOpenApiSchema(schema?: ContractSchema): Record<string, any> | undefined;
|
|
62
|
+
export interface FlattenedContractField {
|
|
63
|
+
path: string;
|
|
64
|
+
type?: string;
|
|
65
|
+
required: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Flatten an object contract to a list of field paths. Used by `contract check`.
|
|
69
|
+
*/
|
|
70
|
+
export declare function flattenContractFields(schema?: ContractSchema, prefix?: string): FlattenedContractField[];
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema-first contracts.
|
|
3
|
+
*
|
|
4
|
+
* A single TypeBox schema feeds runtime validation, TypeScript inference and
|
|
5
|
+
* documentation generation. The `t` facade exposes:
|
|
6
|
+
* - the lower-case builder API documented by Raiton (`t.object`, `t.string`);
|
|
7
|
+
* - chainable constraints (`t.string().min(2).email()`);
|
|
8
|
+
* - `t.infer<S>()` for compile-time inference.
|
|
9
|
+
*
|
|
10
|
+
* Chain methods are attached as non-enumerable properties so schemas stay
|
|
11
|
+
* pure JSON Schema for OpenAPI, the manifest and `JSON.stringify`.
|
|
12
|
+
*/
|
|
13
|
+
import { Type, type Static, type TSchema, type TOptional } from "@sinclair/typebox";
|
|
14
|
+
declare module "@sinclair/typebox" {
|
|
15
|
+
interface TSchema {
|
|
16
|
+
/** Minimum string length, number value, array items or object properties. */
|
|
17
|
+
min(value: number): this;
|
|
18
|
+
/** Maximum string length, number value, array items or object properties. */
|
|
19
|
+
max(value: number): this;
|
|
20
|
+
email(): this;
|
|
21
|
+
url(): this;
|
|
22
|
+
uuid(): this;
|
|
23
|
+
regex(pattern: RegExp | string): this;
|
|
24
|
+
length(value: number): this;
|
|
25
|
+
optional(): TOptional<this>;
|
|
26
|
+
default(value: unknown): this;
|
|
27
|
+
describe(value: string): this;
|
|
28
|
+
example(value: unknown): this;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export type { TSchema, Static };
|
|
32
|
+
export type Infer<S extends TSchema> = Static<S>;
|
|
33
|
+
export { Type };
|
|
34
|
+
declare const LOWERCASE_METHODS: {
|
|
35
|
+
readonly string: "String";
|
|
36
|
+
readonly number: "Number";
|
|
37
|
+
readonly integer: "Integer";
|
|
38
|
+
readonly boolean: "Boolean";
|
|
39
|
+
readonly object: "Object";
|
|
40
|
+
readonly array: "Array";
|
|
41
|
+
readonly optional: "Optional";
|
|
42
|
+
readonly readonly: "Readonly";
|
|
43
|
+
readonly readonlyOptional: "ReadonlyOptional";
|
|
44
|
+
readonly record: "Record";
|
|
45
|
+
readonly any: "Any";
|
|
46
|
+
readonly unknown: "Unknown";
|
|
47
|
+
readonly never: "Never";
|
|
48
|
+
readonly null: "Null";
|
|
49
|
+
readonly undefined: "Undefined";
|
|
50
|
+
readonly union: "Union";
|
|
51
|
+
readonly literal: "Literal";
|
|
52
|
+
readonly enum: "Enum";
|
|
53
|
+
readonly intersect: "Intersect";
|
|
54
|
+
readonly tuple: "Tuple";
|
|
55
|
+
readonly ref: "Ref";
|
|
56
|
+
readonly partial: "Partial";
|
|
57
|
+
readonly required: "Required";
|
|
58
|
+
readonly pick: "Pick";
|
|
59
|
+
readonly omit: "Omit";
|
|
60
|
+
readonly keyof: "KeyOf";
|
|
61
|
+
readonly composite: "Composite";
|
|
62
|
+
readonly const: "Const";
|
|
63
|
+
readonly date: "Date";
|
|
64
|
+
readonly function: "Function";
|
|
65
|
+
readonly constructor: "Constructor";
|
|
66
|
+
readonly promise: "Promise";
|
|
67
|
+
readonly symbol: "Symbol";
|
|
68
|
+
readonly bigint: "BigInt";
|
|
69
|
+
readonly uint8array: "Uint8Array";
|
|
70
|
+
readonly this: "This";
|
|
71
|
+
readonly recursive: "Recursive";
|
|
72
|
+
readonly asyncIterator: "AsyncIterator";
|
|
73
|
+
readonly iterator: "Iterator";
|
|
74
|
+
};
|
|
75
|
+
type LowercaseMethods = {
|
|
76
|
+
[K in keyof typeof LOWERCASE_METHODS]: (typeof Type)[Extract<(typeof LOWERCASE_METHODS)[K], keyof typeof Type>];
|
|
77
|
+
};
|
|
78
|
+
type InferMethod = {
|
|
79
|
+
infer: <S extends TSchema>(schema: S) => Static<S>;
|
|
80
|
+
};
|
|
81
|
+
export declare const t: typeof Type & LowercaseMethods & InferMethod;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ApplicationConfigInterface, ApplicationInterface } from "../types/application.ts";
|
|
2
|
+
import { HttpMethod } from "../framework/enums/http-method.enum.ts";
|
|
3
|
+
import { RouteHandlerCallable } from "../types/index.ts";
|
|
4
|
+
import { Injection } from "./injection/index.ts";
|
|
5
|
+
import { HttpsConfigInterface } from "../framework/utilities/https.util.ts";
|
|
6
|
+
export declare class Application implements ApplicationInterface {
|
|
7
|
+
readonly config: ApplicationConfigInterface;
|
|
8
|
+
private root;
|
|
9
|
+
private _resolvedHttps;
|
|
10
|
+
private readonly _observability;
|
|
11
|
+
private readonly _plugins;
|
|
12
|
+
readonly version: string;
|
|
13
|
+
static get container(): typeof Injection;
|
|
14
|
+
constructor(config: ApplicationConfigInterface);
|
|
15
|
+
protected initialize(): this;
|
|
16
|
+
/**
|
|
17
|
+
* Development mode follows HMR, explicit `develop`, or NODE_ENV.
|
|
18
|
+
*/
|
|
19
|
+
get development(): boolean;
|
|
20
|
+
get hostname(): string;
|
|
21
|
+
get https(): HttpsConfigInterface | undefined;
|
|
22
|
+
setOption<K extends keyof ApplicationConfigInterface>(key: K, value: ApplicationConfigInterface[K]): this;
|
|
23
|
+
setOptions(options: ApplicationConfigInterface): this;
|
|
24
|
+
register(plugin: any): this;
|
|
25
|
+
use(mw: any): this;
|
|
26
|
+
route(method: HttpMethod, path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
27
|
+
get(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
28
|
+
post(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
29
|
+
patch(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
30
|
+
put(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
31
|
+
delete(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
32
|
+
options(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
33
|
+
head(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
34
|
+
trace(path: string, handler: RouteHandlerCallable, version?: string): this;
|
|
35
|
+
private parseRequestUrl;
|
|
36
|
+
handle(req: any, reply: any): Promise<any>;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./artifact.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function artifactRunner(): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import fs, { WatchEventType } from "node:fs";
|
|
2
|
+
import type { BuilderConfigInterface, BuilderInterface, ThreadInterface } from "../types/index.ts";
|
|
3
|
+
import { HmrChannel } from "../framework/artifacts.ts";
|
|
4
|
+
export declare class RaitonBuilder implements BuilderInterface {
|
|
5
|
+
readonly workdir: string;
|
|
6
|
+
readonly options: BuilderConfigInterface;
|
|
7
|
+
protected _source: string | null;
|
|
8
|
+
protected _out: string | null;
|
|
9
|
+
protected _bootstrapper: string | null;
|
|
10
|
+
protected _bootstrapperFile: string | null;
|
|
11
|
+
protected _compiledVersionNumber: number;
|
|
12
|
+
protected _watcher?: fs.FSWatcher;
|
|
13
|
+
constructor(workdir: string, options?: BuilderConfigInterface);
|
|
14
|
+
get source(): string | null;
|
|
15
|
+
get out(): string | null;
|
|
16
|
+
get bootstrapper(): string | null;
|
|
17
|
+
get bootstrapperFile(): string | null;
|
|
18
|
+
get watcher(): fs.FSWatcher | undefined;
|
|
19
|
+
protected parse(filename: string, type?: WatchEventType): Promise<{
|
|
20
|
+
filename: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
version: number;
|
|
23
|
+
type: WatchEventType | undefined;
|
|
24
|
+
channel: HmrChannel;
|
|
25
|
+
artifactType: string;
|
|
26
|
+
} | undefined>;
|
|
27
|
+
protected parsing(): Promise<this>;
|
|
28
|
+
protected watching(): this;
|
|
29
|
+
protected initialize(): Promise<this>;
|
|
30
|
+
prepare(): Promise<this>;
|
|
31
|
+
protected listenHmrDi(): void;
|
|
32
|
+
protected listenHmrController(): void;
|
|
33
|
+
protected listenHmrSocket(): void;
|
|
34
|
+
protected listenHmrMiddleware(): void;
|
|
35
|
+
protected listenHmrHook(): void;
|
|
36
|
+
protected listenHmrMcp(): void;
|
|
37
|
+
protected listenHmrScheduler(): void;
|
|
38
|
+
protected build(thread: ThreadInterface): Promise<this>;
|
|
39
|
+
protected typecheck(): Promise<this>;
|
|
40
|
+
protected compile(): Promise<this>;
|
|
41
|
+
boot(): Promise<any>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
export declare class RaitonCommand {
|
|
3
|
+
readonly cli: Command;
|
|
4
|
+
readonly workdir: string;
|
|
5
|
+
readonly appdir: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description?: string;
|
|
8
|
+
readonly version: string;
|
|
9
|
+
readonly enabled: boolean;
|
|
10
|
+
constructor(cli: Command, workdir: string, appdir?: string);
|
|
11
|
+
construct(): void;
|
|
12
|
+
register(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { RaitonCommand } from "./command.ts";
|
|
3
|
+
export declare class RaitonCommands {
|
|
4
|
+
readonly cli: Command;
|
|
5
|
+
readonly appdir: string;
|
|
6
|
+
readonly workdir: string;
|
|
7
|
+
readonly stack: Set<RaitonCommand>;
|
|
8
|
+
constructor(cli: Command, appdir: string, workdir: string);
|
|
9
|
+
harvest(): Promise<void>;
|
|
10
|
+
}
|