@velajs/cli 1.22.1 → 1.24.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/README.md +98 -12
- package/dist/config.d.ts +18 -9
- package/dist/config.js +48 -17
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +37 -8
- package/dist/index.js +596 -71
- package/dist/index.js.map +1 -1
- package/package.json +15 -12
- package/templates/worker/.swcrc +10 -0
- package/templates/worker/README.md +53 -0
- package/templates/worker/gitignore +8 -0
- package/templates/worker/package.json +28 -0
- package/templates/worker/pnpm-workspace.yaml +4 -0
- package/templates/worker/src/app.controller.ts +18 -0
- package/templates/worker/src/app.module.ts +9 -0
- package/templates/worker/src/app.service.ts +8 -0
- package/templates/worker/src/worker.ts +7 -0
- package/templates/worker/tsconfig.json +18 -0
- package/templates/worker/vela.config.mjs +9 -0
- package/templates/worker/wrangler.jsonc +12 -0
package/README.md
CHANGED
|
@@ -14,6 +14,9 @@ pnpm add -D @velajs/cli
|
|
|
14
14
|
|
|
15
15
|
| Command | What it does |
|
|
16
16
|
| --- | --- |
|
|
17
|
+
| `vela new my-api` | Create a minimal Workers project with a module, controller, injected service, and a working local development setup. |
|
|
18
|
+
| `vela doctor` | Explain config resolution without importing it; `--app` opts into application graph snapshots and teardown. Supports `--json`. |
|
|
19
|
+
| `vela deploy check` | Check an explicit Wrangler config/environment against a saved entrypoint snapshot without bootstrapping, building or deploying. See the [deployment guide](../../docs/deployment.md). |
|
|
17
20
|
| `vela db seed` | Build the app and run all `@Seeder()` classes in order. |
|
|
18
21
|
| `vela route list` | HTTP route table: framework-composed controller routes (`Controller#handler`, full paths incl. prefix/version) plus `(mounted)` extras (CRUD/contributed, doc UIs). |
|
|
19
22
|
| `vela module graph` | Module graph: imports tree with `global`/`lazy` flags and provider counts (`--json` for the raw graph). |
|
|
@@ -21,8 +24,37 @@ pnpm add -D @velajs/cli
|
|
|
21
24
|
| `vela openapi dump` | Emit the OpenAPI document (needs `rootModule` in the config; `--out`, `--title`, `--api-version`, `--global-prefix`). |
|
|
22
25
|
| `vela client generate` | Generate an `AppType` for `hc` from the app or `--input openapi.json`; `--out`, `--strict`, and CI `--check`. |
|
|
23
26
|
| `vela mcp serve` | Run a Model Context Protocol stdio server exposing the introspection above as read-only tools (`route_list`, `module_graph`, `entrypoint_list`, `openapi_dump`, `token_describe`) plus a `vela://openapi` resource — for AI agents. |
|
|
27
|
+
| `vela studio` | Serve the optional Studio UI through a local host, proxying the app selected by `--url`. |
|
|
24
28
|
|
|
25
|
-
All introspection commands take `--config <path>`; the
|
|
29
|
+
All introspection commands take `--config <path>`; the listing commands also take `--json`.
|
|
30
|
+
|
|
31
|
+
### Create a project
|
|
32
|
+
|
|
33
|
+
Requires Node.js 24+ and pnpm 11.11.0:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpm dlx @velajs/cli@latest new my-api
|
|
37
|
+
cd my-api
|
|
38
|
+
pnpm install
|
|
39
|
+
pnpm typecheck
|
|
40
|
+
pnpm build
|
|
41
|
+
pnpm dev
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Request `http://localhost:8787` to receive `{"message":"Hello from Vela!"}`.
|
|
45
|
+
The greeting comes from a constructor-injected service. SWC emits decorator
|
|
46
|
+
metadata, and Wrangler rebuilds source changes during local development.
|
|
47
|
+
The generated application uses published npm dependencies and requires no
|
|
48
|
+
Cloudflare login, authentication integration, D1, Studio, or live queries.
|
|
49
|
+
|
|
50
|
+
With an installed CLI, use `vela new my-api`. Names start with a lowercase letter
|
|
51
|
+
and contain lowercase letters, digits, or single hyphens (at most 63 characters).
|
|
52
|
+
Paths and reserved device names are rejected. Existing empty directories are
|
|
53
|
+
accepted; nonempty directories, files, and symbolic links are rejected without
|
|
54
|
+
overwriting them. Creation does not install dependencies or initialize Git.
|
|
55
|
+
|
|
56
|
+
See the [project creation guide](https://github.com/velajs/vela/blob/main/docs/getting-started.md).
|
|
57
|
+
Module, controller, service, and resource generators are not included yet.
|
|
26
58
|
|
|
27
59
|
### MCP server
|
|
28
60
|
|
|
@@ -47,25 +79,74 @@ the client disconnects, then disposes the app.
|
|
|
47
79
|
## Configure
|
|
48
80
|
|
|
49
81
|
Create a `vela.config.{js,mjs,ts}` at your project root that builds your app.
|
|
50
|
-
|
|
51
|
-
|
|
82
|
+
Import compiled application JavaScript, including its decorator metadata. The
|
|
83
|
+
starter's SWC build produces these files in `dist/`; run `pnpm build` first.
|
|
84
|
+
This minimal config uses the portable factory in Node:
|
|
52
85
|
|
|
53
|
-
```
|
|
54
|
-
// vela.config.
|
|
86
|
+
```js
|
|
87
|
+
// vela.config.mjs
|
|
55
88
|
import { defineVelaConfig } from '@velajs/cli/config';
|
|
56
|
-
import {
|
|
89
|
+
import { VelaFactory } from '@velajs/vela';
|
|
90
|
+
import { AppModule } from './dist/app.module.js';
|
|
57
91
|
|
|
58
92
|
export default defineVelaConfig({
|
|
59
93
|
rootModule: AppModule, // needed by `vela openapi dump` and `vela client generate`
|
|
60
|
-
|
|
61
|
-
const { createCloudflareApp } = await import('@velajs/cloudflare');
|
|
62
|
-
return createCloudflareApp(AppModule);
|
|
63
|
-
},
|
|
94
|
+
createApp: () => VelaFactory.create(AppModule),
|
|
64
95
|
});
|
|
65
96
|
```
|
|
66
97
|
|
|
67
|
-
|
|
68
|
-
|
|
98
|
+
Supply local runtime bindings inside `createApp` if the application needs them.
|
|
99
|
+
Do not import the Worker entrypoint into Node when it uses native
|
|
100
|
+
`cloudflare:workers` APIs. A plain default-exported object or named `config`
|
|
101
|
+
export also works; `defineVelaConfig` preserves the inferred app subtype and
|
|
102
|
+
custom fields. The loader validates `createApp` and optional `rootModule` before
|
|
103
|
+
commands use them. Command teardown awaits application disposal even when work
|
|
104
|
+
fails, and cleanup warnings do not replace the command's exit result.
|
|
105
|
+
|
|
106
|
+
Node 24 can strip erasable types in a `.ts` config, but it does not transform
|
|
107
|
+
legacy decorators, emit constructor metadata, or resolve `tsconfig` path
|
|
108
|
+
aliases. A `.ts` config should therefore also import the compiled `.js` graph
|
|
109
|
+
with explicit extensions. Use SWC's `legacyDecorator` and `decoratorMetadata`
|
|
110
|
+
settings from the starter, or a compiler with equivalent output. The CLI adds
|
|
111
|
+
no compiler hooks. See [Node's TypeScript documentation](https://nodejs.org/docs/latest-v24.x/api/typescript.html#typescript-features).
|
|
112
|
+
|
|
113
|
+
The loader checks `vela.config.js`, then `.mjs`, then `.ts` in the current
|
|
114
|
+
directory; it does not search parents. `--config` selects exactly that path,
|
|
115
|
+
relative to the current directory or absolute, with no fallback to another file.
|
|
116
|
+
`resolveConfig()` from `@velajs/cli/config` returns the selected absolute path,
|
|
117
|
+
the `explicit`/`discovered` source and the candidates actually checked, without
|
|
118
|
+
importing user code.
|
|
119
|
+
|
|
120
|
+
### Diagnose configuration
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
vela doctor --json
|
|
124
|
+
pnpm build
|
|
125
|
+
vela doctor --app --config vela.config.mjs --json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The default only resolves the config file. `--app` imports it and runs normal
|
|
129
|
+
application bootstrap and shutdown hooks, which may perform application-defined
|
|
130
|
+
work. It then reads existing module, route and entrypoint descriptions without
|
|
131
|
+
resolving providers or materializing lazy modules for inspection. Reports omit
|
|
132
|
+
provider values, environment values and arbitrary entrypoint metadata, and show
|
|
133
|
+
only entrypoints belonging to that app. `--json` uses `schemaVersion: 1`; missing
|
|
134
|
+
configs, bootstrap/snapshot errors or cleanup warnings return exit code 1.
|
|
135
|
+
Send application startup logs to stderr when consuming JSON output.
|
|
136
|
+
|
|
137
|
+
For breakpoints and source maps, see the [debugging guide](../../docs/debugging.md).
|
|
138
|
+
|
|
139
|
+
### Studio
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
vela studio --url http://127.0.0.1:8787 --port 4000
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
The optional `@velajs/studio-host` and `@velajs/studio-ui` packages provide the
|
|
146
|
+
host and UI. `--port` accepts a decimal integer from 0 to 65535 (0 asks the OS
|
|
147
|
+
for an available port). Tokens come from `--token` or `VELA_STUDIO_TOKEN` and are
|
|
148
|
+
injected by the host. The CLI config and client-generation entrypoints remain
|
|
149
|
+
usable without Studio installed.
|
|
69
150
|
|
|
70
151
|
## Commands
|
|
71
152
|
|
|
@@ -74,9 +155,14 @@ export default defineVelaConfig({
|
|
|
74
155
|
vela db seed
|
|
75
156
|
vela db seed --config ./config/vela.config.js
|
|
76
157
|
vela db seed --continue-on-error
|
|
158
|
+
# Inspect registration owners without running seeders:
|
|
159
|
+
vela db seed --list --json
|
|
77
160
|
```
|
|
78
161
|
|
|
79
162
|
Exit code is `0` when all seeders run and `1` if any fail.
|
|
163
|
+
Seeders registered in multiple modules run once per owner, including async
|
|
164
|
+
providers. Invocations finish their managed deferred work and dispose request
|
|
165
|
+
resources before the next seeder starts. See [seeding](../../docs/seeding.md).
|
|
80
166
|
|
|
81
167
|
## Typed HTTP clients
|
|
82
168
|
|
package/dist/config.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ import { Type, VelaApplication } from "@velajs/vela";
|
|
|
6
6
|
* Cloudflare Worker, or a plain Node adapter — and return a built app.
|
|
7
7
|
*
|
|
8
8
|
* ```ts
|
|
9
|
-
* // vela.config.
|
|
9
|
+
* // vela.config.mjs — run `pnpm build` before using app-aware commands.
|
|
10
10
|
* import { defineVelaConfig } from '@velajs/cli/config';
|
|
11
|
+
* import { VelaFactory } from '@velajs/vela';
|
|
12
|
+
* import { AppModule } from './dist/app.module.js';
|
|
11
13
|
* export default defineVelaConfig({
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* return createCloudflareApp(AppModule);
|
|
15
|
-
* },
|
|
14
|
+
* rootModule: AppModule,
|
|
15
|
+
* createApp: () => VelaFactory.create(AppModule),
|
|
16
16
|
* });
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
@@ -25,12 +25,21 @@ export interface VelaConfig {
|
|
|
25
25
|
rootModule?: Type;
|
|
26
26
|
}
|
|
27
27
|
/** Identity helper for type-safe config files. */
|
|
28
|
-
export declare function defineVelaConfig(config:
|
|
28
|
+
export declare function defineVelaConfig<const Config extends VelaConfig>(config: Config): Config;
|
|
29
29
|
/**
|
|
30
|
-
* Locate
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* Locate and import a config using Node's loader. Node 24 can strip erasable
|
|
31
|
+
* types in `.ts` configs, but does not emit legacy decorators or DI metadata.
|
|
32
|
+
* Import compiled application `.js` from the config (e.g. the SWC build used
|
|
33
|
+
* by Wrangler). This loader does not install compiler or path-alias hooks.
|
|
33
34
|
*/
|
|
34
35
|
export declare function loadConfig(cwd?: string, explicitPath?: string): Promise<VelaConfig>;
|
|
36
|
+
export interface ConfigResolution {
|
|
37
|
+
readonly path: string;
|
|
38
|
+
readonly source: 'explicit' | 'discovered';
|
|
39
|
+
/** Absolute paths checked in order, ending at the selected file. */
|
|
40
|
+
readonly candidates: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
/** Resolve provenance without importing application code or walking parent directories. */
|
|
43
|
+
export declare function resolveConfig(cwd?: string, explicitPath?: string): Promise<ConfigResolution>;
|
|
35
44
|
//#endregion
|
|
36
45
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { stat } from "node:fs/promises";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
//#region src/config.ts
|
|
5
5
|
/** Identity helper for type-safe config files. */
|
|
@@ -12,28 +12,59 @@ const CANDIDATES = [
|
|
|
12
12
|
"vela.config.ts"
|
|
13
13
|
];
|
|
14
14
|
/**
|
|
15
|
-
* Locate
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Locate and import a config using Node's loader. Node 24 can strip erasable
|
|
16
|
+
* types in `.ts` configs, but does not emit legacy decorators or DI metadata.
|
|
17
|
+
* Import compiled application `.js` from the config (e.g. the SWC build used
|
|
18
|
+
* by Wrangler). This loader does not install compiler or path-alias hooks.
|
|
18
19
|
*/
|
|
19
20
|
async function loadConfig(cwd = process.cwd(), explicitPath) {
|
|
20
|
-
const path =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const { path } = await resolveConfig(cwd, explicitPath);
|
|
22
|
+
let mod;
|
|
23
|
+
try {
|
|
24
|
+
mod = await import(pathToFileURL(path).href);
|
|
25
|
+
} catch (cause) {
|
|
26
|
+
throw new Error(`Could not import config at ${path}: ${cause instanceof Error ? cause.message : String(cause)}\nConfigs run in Node. Compile decorated application source with SWC (legacyDecorator + decoratorMetadata) or an equivalent metadata-emitting compiler, then import its compiled .js files with explicit extensions. Run your application build first; native TypeScript stripping does not transform decorators or tsconfig paths.`, { cause });
|
|
27
|
+
}
|
|
28
|
+
const config = isRecord(mod) ? mod.default ?? mod.config : void 0;
|
|
29
|
+
if (!isVelaConfig(config)) throw new Error(`Config at ${path} must export an object with createApp(): VelaApplication | Promise<VelaApplication> (default export or a named 'config'); rootModule, when provided, must be a constructor.`);
|
|
25
30
|
return config;
|
|
26
31
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
/** Resolve provenance without importing application code or walking parent directories. */
|
|
33
|
+
async function resolveConfig(cwd = process.cwd(), explicitPath) {
|
|
34
|
+
if (explicitPath !== void 0 && explicitPath.trim() === "") throw new Error("--config must name a file.");
|
|
35
|
+
const candidates = explicitPath === void 0 ? CANDIDATES.map((name) => join(resolve(cwd), name)) : [resolve(cwd, explicitPath)];
|
|
36
|
+
const checked = [];
|
|
37
|
+
for (const candidate of candidates) {
|
|
38
|
+
checked.push(candidate);
|
|
30
39
|
try {
|
|
31
|
-
await
|
|
32
|
-
return
|
|
33
|
-
|
|
40
|
+
if (!(await stat(candidate)).isFile()) throw new Error(`Config at ${candidate} must be a file.`);
|
|
41
|
+
return {
|
|
42
|
+
path: candidate,
|
|
43
|
+
source: explicitPath === void 0 ? "discovered" : "explicit",
|
|
44
|
+
candidates: checked
|
|
45
|
+
};
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (!isRecord(error) || error.code !== "ENOENT") throw error;
|
|
48
|
+
}
|
|
34
49
|
}
|
|
50
|
+
throw new Error(`No vela config found. Checked: ${checked.join(", ")}. Create one of: ${CANDIDATES.join(", ")} (or pass --config <path>).`);
|
|
51
|
+
}
|
|
52
|
+
function isRecord(value) {
|
|
53
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
54
|
+
}
|
|
55
|
+
function isConstructor(value) {
|
|
56
|
+
if (typeof value !== "function") return false;
|
|
57
|
+
try {
|
|
58
|
+
Reflect.construct(Object, [], value);
|
|
59
|
+
return true;
|
|
60
|
+
} catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function isVelaConfig(value) {
|
|
65
|
+
return isRecord(value) && typeof value.createApp === "function" && (value.rootModule === void 0 || isConstructor(value.rootModule));
|
|
35
66
|
}
|
|
36
67
|
//#endregion
|
|
37
|
-
export { defineVelaConfig, loadConfig };
|
|
68
|
+
export { defineVelaConfig, loadConfig, resolveConfig };
|
|
38
69
|
|
|
39
70
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":[],"sources":["../src/config.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../src/config.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport { join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport type { Type, VelaApplication } from '@velajs/vela';\n\n/**\n * A `vela.config.{js,mjs,ts}` default-exports (or exports `config`) this shape.\n * You wire your runtime bindings inside `createApp` — e.g. via miniflare for a\n * Cloudflare Worker, or a plain Node adapter — and return a built app.\n *\n * ```ts\n * // vela.config.mjs — run `pnpm build` before using app-aware commands.\n * import { defineVelaConfig } from '@velajs/cli/config';\n * import { VelaFactory } from '@velajs/vela';\n * import { AppModule } from './dist/app.module.js';\n * export default defineVelaConfig({\n * rootModule: AppModule,\n * createApp: () => VelaFactory.create(AppModule),\n * });\n * ```\n */\nexport interface VelaConfig {\n createApp(): Promise<VelaApplication> | VelaApplication;\n /**\n * The app's root module class — needed only by commands that work from\n * module metadata rather than the built app (`vela openapi dump`, `vela client generate`).\n */\n rootModule?: Type;\n}\n\n/** Identity helper for type-safe config files. */\nexport function defineVelaConfig<const Config extends VelaConfig>(config: Config): Config {\n return config;\n}\n\nconst CANDIDATES = ['vela.config.js', 'vela.config.mjs', 'vela.config.ts'];\n\n/**\n * Locate and import a config using Node's loader. Node 24 can strip erasable\n * types in `.ts` configs, but does not emit legacy decorators or DI metadata.\n * Import compiled application `.js` from the config (e.g. the SWC build used\n * by Wrangler). This loader does not install compiler or path-alias hooks.\n */\nexport async function loadConfig(\n cwd: string = process.cwd(),\n explicitPath?: string,\n): Promise<VelaConfig> {\n const { path } = await resolveConfig(cwd, explicitPath);\n let mod: unknown;\n try {\n mod = await import(pathToFileURL(path).href);\n } catch (cause) {\n throw new Error(\n `Could not import config at ${path}: ${cause instanceof Error ? cause.message : String(cause)}\\n` +\n 'Configs run in Node. Compile decorated application source with SWC (legacyDecorator + decoratorMetadata) ' +\n 'or an equivalent metadata-emitting compiler, then import its compiled .js files with explicit extensions. ' +\n 'Run your application build first; native TypeScript stripping does not transform decorators or tsconfig paths.',\n { cause },\n );\n }\n const config = isRecord(mod) ? (mod.default ?? mod.config) : undefined;\n if (!isVelaConfig(config)) {\n throw new Error(\n `Config at ${path} must export an object with createApp(): VelaApplication | Promise<VelaApplication> ` +\n \"(default export or a named 'config'); rootModule, when provided, must be a constructor.\",\n );\n }\n return config;\n}\n\nexport interface ConfigResolution {\n readonly path: string;\n readonly source: 'explicit' | 'discovered';\n /** Absolute paths checked in order, ending at the selected file. */\n readonly candidates: readonly string[];\n}\n\n/** Resolve provenance without importing application code or walking parent directories. */\nexport async function resolveConfig(\n cwd: string = process.cwd(),\n explicitPath?: string,\n): Promise<ConfigResolution> {\n if (explicitPath !== undefined && explicitPath.trim() === '') {\n throw new Error('--config must name a file.');\n }\n const candidates =\n explicitPath === undefined\n ? CANDIDATES.map((name) => join(resolve(cwd), name))\n : [resolve(cwd, explicitPath)];\n const checked: string[] = [];\n for (const candidate of candidates) {\n checked.push(candidate);\n try {\n if (!(await stat(candidate)).isFile()) {\n throw new Error(`Config at ${candidate} must be a file.`);\n }\n return {\n path: candidate,\n source: explicitPath === undefined ? 'discovered' : 'explicit',\n candidates: checked,\n };\n } catch (error) {\n if (!isRecord(error) || error.code !== 'ENOENT') throw error;\n }\n }\n throw new Error(\n `No vela config found. Checked: ${checked.join(', ')}. Create one of: ${CANDIDATES.join(', ')} (or pass --config <path>).`,\n );\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction isConstructor(value: unknown): value is Type {\n if (typeof value !== 'function') return false;\n try {\n // Validate constructability without invoking the user's constructor.\n Reflect.construct(Object, [], value);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isVelaConfig(value: unknown): value is VelaConfig {\n return (\n isRecord(value) &&\n typeof value.createApp === 'function' &&\n (value.rootModule === undefined || isConstructor(value.rootModule))\n );\n}\n"],"mappings":";;;;;AA+BA,SAAgB,iBAAkD,QAAwB;CACxF,OAAO;AACT;AAEA,MAAM,aAAa;CAAC;CAAkB;CAAmB;AAAgB;;;;;;;AAQzE,eAAsB,WACpB,MAAc,QAAQ,IAAI,GAC1B,cACqB;CACrB,MAAM,EAAE,SAAS,MAAM,cAAc,KAAK,YAAY;CACtD,IAAI;CACJ,IAAI;EACF,MAAM,MAAM,OAAO,cAAc,IAAI,CAAC,CAAC;CACzC,SAAS,OAAO;EACd,MAAM,IAAI,MACR,8BAA8B,KAAK,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,sUAI9F,EAAE,MAAM,CACV;CACF;CACA,MAAM,SAAS,SAAS,GAAG,IAAK,IAAI,WAAW,IAAI,SAAU,KAAA;CAC7D,IAAI,CAAC,aAAa,MAAM,GACtB,MAAM,IAAI,MACR,aAAa,KAAK,4KAEpB;CAEF,OAAO;AACT;;AAUA,eAAsB,cACpB,MAAc,QAAQ,IAAI,GAC1B,cAC2B;CAC3B,IAAI,iBAAiB,KAAA,KAAa,aAAa,KAAK,MAAM,IACxD,MAAM,IAAI,MAAM,4BAA4B;CAE9C,MAAM,aACJ,iBAAiB,KAAA,IACb,WAAW,KAAK,SAAS,KAAK,QAAQ,GAAG,GAAG,IAAI,CAAC,IACjD,CAAC,QAAQ,KAAK,YAAY,CAAC;CACjC,MAAM,UAAoB,CAAC;CAC3B,KAAK,MAAM,aAAa,YAAY;EAClC,QAAQ,KAAK,SAAS;EACtB,IAAI;GACF,IAAI,EAAE,MAAM,KAAK,SAAS,EAAA,CAAG,OAAO,GAClC,MAAM,IAAI,MAAM,aAAa,UAAU,iBAAiB;GAE1D,OAAO;IACL,MAAM;IACN,QAAQ,iBAAiB,KAAA,IAAY,eAAe;IACpD,YAAY;GACd;EACF,SAAS,OAAO;GACd,IAAI,CAAC,SAAS,KAAK,KAAK,MAAM,SAAS,UAAU,MAAM;EACzD;CACF;CACA,MAAM,IAAI,MACR,kCAAkC,QAAQ,KAAK,IAAI,EAAE,mBAAmB,WAAW,KAAK,IAAI,EAAE,4BAChG;AACF;AAEA,SAAS,SAAS,OAAkD;CAClE,OAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,cAAc,OAA+B;CACpD,IAAI,OAAO,UAAU,YAAY,OAAO;CACxC,IAAI;EAEF,QAAQ,UAAU,QAAQ,CAAC,GAAG,KAAK;EACnC,OAAO;CACT,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,aAAa,OAAqC;CACzD,OACE,SAAS,KAAK,KACd,OAAO,MAAM,cAAc,eAC1B,MAAM,eAAe,KAAA,KAAa,cAAc,MAAM,UAAU;AAErE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GeneratedClientContract, generateClientContract } from "./client-contract.js";
|
|
2
|
-
import { VelaConfig, defineVelaConfig, loadConfig } from "./config.js";
|
|
2
|
+
import { ConfigResolution, VelaConfig, defineVelaConfig, loadConfig, resolveConfig } from "./config.js";
|
|
3
3
|
import { Command } from "clipanion";
|
|
4
4
|
import { ModuleDescription, VelaApplication } from "@velajs/vela";
|
|
5
5
|
import { SeederResult } from "@velajs/vela/seeder";
|
|
@@ -10,6 +10,16 @@ export declare class SeedCommand extends Command {
|
|
|
10
10
|
static usage: import("clipanion").Usage;
|
|
11
11
|
config: string | undefined;
|
|
12
12
|
continueOnError: boolean;
|
|
13
|
+
list: boolean;
|
|
14
|
+
json: boolean;
|
|
15
|
+
execute(): Promise<number>;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/commands/new.command.d.ts
|
|
19
|
+
export declare class NewCommand extends Command {
|
|
20
|
+
static paths: string[][];
|
|
21
|
+
static usage: import("clipanion").Usage;
|
|
22
|
+
name: string;
|
|
13
23
|
execute(): Promise<number>;
|
|
14
24
|
}
|
|
15
25
|
//#endregion
|
|
@@ -58,10 +68,8 @@ export declare class OpenApiDumpCommand extends Command {
|
|
|
58
68
|
* introspection as the `route`/`module`/`entrypoint`/`openapi` commands, so an
|
|
59
69
|
* AI agent can query a Vela app's shape over the Model Context Protocol.
|
|
60
70
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* the transport closes. stdout is reserved for JSON-RPC framing; every human
|
|
64
|
-
* message goes to stderr.
|
|
71
|
+
* The application lifetime includes the transport's close promise. stdout is
|
|
72
|
+
* reserved for JSON-RPC framing; every human message goes to stderr.
|
|
65
73
|
*/
|
|
66
74
|
export declare class McpServeCommand extends Command {
|
|
67
75
|
static paths: string[][];
|
|
@@ -93,6 +101,7 @@ export declare class StudioCommand extends Command {
|
|
|
93
101
|
//#endregion
|
|
94
102
|
//#region src/commands/client.command.d.ts
|
|
95
103
|
export declare class ClientGenerateCommand extends Command {
|
|
104
|
+
#private;
|
|
96
105
|
static paths: string[][];
|
|
97
106
|
static usage: import("clipanion").Usage;
|
|
98
107
|
config: string | undefined;
|
|
@@ -101,8 +110,28 @@ export declare class ClientGenerateCommand extends Command {
|
|
|
101
110
|
check: boolean;
|
|
102
111
|
strict: boolean;
|
|
103
112
|
execute(): Promise<number>;
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/commands/doctor.command.d.ts
|
|
116
|
+
export declare class DoctorCommand extends Command {
|
|
117
|
+
static paths: string[][];
|
|
118
|
+
static usage: import("clipanion").Usage;
|
|
119
|
+
config: string | undefined;
|
|
120
|
+
app: boolean;
|
|
121
|
+
json: boolean;
|
|
122
|
+
execute(): Promise<number>;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/commands/deploy-check.command.d.ts
|
|
126
|
+
/** Static application deployment preflight; never invokes Wrangler or application code. */
|
|
127
|
+
export declare class DeployCheckCommand extends Command {
|
|
128
|
+
static paths: string[][];
|
|
129
|
+
static usage: import("clipanion").Usage;
|
|
130
|
+
config: string;
|
|
131
|
+
environment: string;
|
|
132
|
+
entrypoints: string;
|
|
133
|
+
json: boolean;
|
|
134
|
+
execute(): Promise<number>;
|
|
106
135
|
}
|
|
107
136
|
//#endregion
|
|
108
137
|
//#region src/introspect.d.ts
|
|
@@ -146,5 +175,5 @@ export declare function formatSeedResults(results: SeederResult[], log?: (messag
|
|
|
146
175
|
/** Aligned plain-text table. Pure; returns lines. */
|
|
147
176
|
export declare function renderTable(headers: string[], rows: string[][]): string[];
|
|
148
177
|
//#endregion
|
|
149
|
-
export { type EntrypointRow, type GeneratedClientContract, type RouteRow, type VelaConfig, defineVelaConfig, generateClientContract, loadConfig };
|
|
178
|
+
export { type ConfigResolution, type EntrypointRow, type GeneratedClientContract, type RouteRow, type VelaConfig, defineVelaConfig, generateClientContract, loadConfig, resolveConfig };
|
|
150
179
|
//# sourceMappingURL=index.d.ts.map
|