@celsian/vura-cli 0.2.0 → 0.5.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.
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Shared helpers for CLI commands that need to load route module files
3
+ * (TypeScript/JSX) at runtime without a full Vite build.
4
+ *
5
+ * Extracted from commands/dev.ts (Task 12) so that the tasks command can reuse
6
+ * the same transpile-then-import flow without duplicating it.
7
+ */
8
+ import { mkdir, writeFile } from 'node:fs/promises';
9
+ import { join, resolve } from 'node:path';
10
+ import { pathToFileURL } from 'node:url';
11
+ /**
12
+ * Cache-dir relative to the project root — matches where dev.ts wrote its
13
+ * temporary modules so we don't litter multiple cache dirs.
14
+ */
15
+ const DEV_CACHE_SUBPATH = join('node_modules', '.then-dev-cache');
16
+ /**
17
+ * Transpile a TypeScript/JSX route file via esbuild and import it as an ES
18
+ * module. Each call writes a uniquely-named `.mjs` file (keyed by wall-clock
19
+ * time) so repeated loads within the same process never collide.
20
+ *
21
+ * @param projectRoot Absolute path to the project root.
22
+ * @param filePath Path to the route file, relative to `projectRoot`.
23
+ * @returns The dynamically-imported module record.
24
+ */
25
+ export async function importRouteModule(projectRoot, filePath) {
26
+ const { build: esbuild } = await import('esbuild');
27
+ const absPath = resolve(projectRoot, filePath);
28
+ const isPage = filePath.endsWith('.tsx') || filePath.endsWith('.jsx');
29
+ // Determine JSX import source (mirrors dev.ts heuristic)
30
+ let jsxImportSource = '@celsian/vura-core';
31
+ try {
32
+ // @ts-ignore — optional peer dep
33
+ await import('what-framework/jsx-runtime');
34
+ jsxImportSource = 'what-framework';
35
+ }
36
+ catch {
37
+ // not installed — keep default
38
+ }
39
+ const result = await esbuild({
40
+ entryPoints: [absPath],
41
+ bundle: true,
42
+ format: 'esm',
43
+ target: 'es2022',
44
+ platform: 'node',
45
+ write: false,
46
+ outfile: 'handler.mjs',
47
+ ...(isPage ? { jsx: 'automatic', jsxImportSource } : {}),
48
+ });
49
+ const tmpDir = join(projectRoot, DEV_CACHE_SUBPATH);
50
+ await mkdir(tmpDir, { recursive: true });
51
+ const hash = Date.now().toString(36);
52
+ const safeName = filePath.replace(/[/\\:]/g, '_');
53
+ const outPath = join(tmpDir, `${safeName}_${hash}.mjs`);
54
+ await writeFile(outPath, result.outputFiles[0].text);
55
+ return import(pathToFileURL(outPath).href);
56
+ }
57
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/commands/shared.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,WAAmB,EACnB,QAAgB;IAEhB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEtE,yDAAyD;IACzD,IAAI,eAAe,GAAG,oBAAoB,CAAC;IAC3C,IAAI,CAAC;QACH,iCAAiC;QACjC,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC;QAC3C,eAAe,GAAG,gBAAgB,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,+BAA+B;IACjC,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC3B,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,aAAa;QACtB,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzD,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACpD,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEzC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,IAAI,IAAI,MAAM,CAAC,CAAC;IACxD,MAAM,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC,IAAI,CAAC,CAAC;IAEtD,OAAO,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAqC,CAAC;AACjF,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `vura tasks list|run <name>` — CLI interface for task routes.
3
+ *
4
+ * list Scan the project's task routes and print their names and schedules.
5
+ * run Invoke a task by name immediately, with optional JSON input, using
6
+ * the same runTaskOnce semantics as the server (retry + timeout).
7
+ *
8
+ * Exit-code seam: on failure (unknown task, handler throws, failed result)
9
+ * this command sets process.exitCode = 1 and returns normally — it never calls
10
+ * process.exit() directly. This lets vitest keep running while still signalling
11
+ * the right exit code to the shell via the CLI entry point.
12
+ */
13
+ /**
14
+ * Derive a human-readable task name from a manifest urlPattern.
15
+ * "/api/report" → "report"
16
+ * "/api/jobs/notify" → "jobs.notify"
17
+ */
18
+ export declare function taskNameFromPattern(urlPattern: string): string;
19
+ /**
20
+ * @param args CLI argument slice (everything after "tasks").
21
+ * @param projectRoot Override the project root — defaults to process.cwd().
22
+ * Exposed for testing so tests do not need process.chdir()
23
+ * (which is process-global and unsafe in concurrent workers).
24
+ */
25
+ export declare function tasksCommand(args: string[], projectRoot?: string): Promise<void>;
26
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/commands/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D;AAoFD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoCtF"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * `vura tasks list|run <name>` — CLI interface for task routes.
3
+ *
4
+ * list Scan the project's task routes and print their names and schedules.
5
+ * run Invoke a task by name immediately, with optional JSON input, using
6
+ * the same runTaskOnce semantics as the server (retry + timeout).
7
+ *
8
+ * Exit-code seam: on failure (unknown task, handler throws, failed result)
9
+ * this command sets process.exitCode = 1 and returns normally — it never calls
10
+ * process.exit() directly. This lets vitest keep running while still signalling
11
+ * the right exit code to the shell via the CLI entry point.
12
+ */
13
+ import { buildManifest, runTaskOnce } from '@celsian/vura-core';
14
+ import { importRouteModule } from './shared.js';
15
+ // ─── Name helpers ────────────────────────────────────────────────────────────
16
+ /**
17
+ * Derive a human-readable task name from a manifest urlPattern.
18
+ * "/api/report" → "report"
19
+ * "/api/jobs/notify" → "jobs.notify"
20
+ */
21
+ export function taskNameFromPattern(urlPattern) {
22
+ return urlPattern.replace(/^\/api\//, '').replace(/\//g, '.');
23
+ }
24
+ // ─── Subcommands ─────────────────────────────────────────────────────────────
25
+ async function listTasks(projectRoot) {
26
+ const manifest = await buildManifest(projectRoot);
27
+ const taskRoutes = manifest.api.filter((r) => r.kind === 'task');
28
+ if (taskRoutes.length === 0) {
29
+ console.log(' No task routes found in src/api/');
30
+ return;
31
+ }
32
+ console.log('\n Task routes:\n');
33
+ for (const route of taskRoutes) {
34
+ const name = taskNameFromPattern(route.urlPattern);
35
+ const schedule = route.config.schedule;
36
+ const suffix = schedule ? ` (cron: ${schedule})` : '';
37
+ console.log(` ${name}${suffix}`);
38
+ }
39
+ console.log();
40
+ }
41
+ async function runTask(projectRoot, taskName, rawInput) {
42
+ const manifest = await buildManifest(projectRoot);
43
+ const taskRoutes = manifest.api.filter((r) => r.kind === 'task');
44
+ // Find matching route
45
+ const route = taskRoutes.find((r) => taskNameFromPattern(r.urlPattern) === taskName);
46
+ if (!route) {
47
+ const available = taskRoutes.map((r) => taskNameFromPattern(r.urlPattern));
48
+ console.error(` Unknown task: "${taskName}"`);
49
+ if (available.length > 0) {
50
+ console.error(` Available tasks: ${available.join(', ')}`);
51
+ }
52
+ else {
53
+ console.error(' No task routes found in src/api/');
54
+ }
55
+ process.exitCode = 1;
56
+ return;
57
+ }
58
+ // Parse input
59
+ let input = undefined;
60
+ if (rawInput !== undefined) {
61
+ try {
62
+ input = JSON.parse(rawInput);
63
+ }
64
+ catch {
65
+ console.error(` Invalid JSON for --input: ${rawInput}`);
66
+ process.exitCode = 1;
67
+ return;
68
+ }
69
+ }
70
+ // Load the module
71
+ const mod = await importRouteModule(projectRoot, route.filePath);
72
+ // Validate that POST is a function
73
+ if (typeof mod.POST !== 'function') {
74
+ console.error(` Task file "${route.filePath}" does not export a POST function`);
75
+ process.exitCode = 1;
76
+ return;
77
+ }
78
+ const result = await runTaskOnce({
79
+ name: taskName,
80
+ config: {
81
+ retries: typeof route.config.retries === 'number' ? route.config.retries : 0,
82
+ timeout: typeof route.config.timeout === 'number' ? route.config.timeout : 30_000,
83
+ },
84
+ handler: mod.POST,
85
+ }, { input });
86
+ console.log(JSON.stringify(result, null, 2));
87
+ if (result.status === 'failed') {
88
+ process.exitCode = 1;
89
+ }
90
+ }
91
+ // ─── Command entry ────────────────────────────────────────────────────────────
92
+ /**
93
+ * @param args CLI argument slice (everything after "tasks").
94
+ * @param projectRoot Override the project root — defaults to process.cwd().
95
+ * Exposed for testing so tests do not need process.chdir()
96
+ * (which is process-global and unsafe in concurrent workers).
97
+ */
98
+ export async function tasksCommand(args, projectRoot) {
99
+ const root = projectRoot ?? process.cwd();
100
+ const subcommand = args[0];
101
+ if (subcommand === 'list') {
102
+ await listTasks(root);
103
+ return;
104
+ }
105
+ if (subcommand === 'run') {
106
+ const taskName = args[1];
107
+ if (!taskName) {
108
+ console.error(' Usage: vura tasks run <name> [--input \'<json>\']');
109
+ process.exitCode = 1;
110
+ return;
111
+ }
112
+ // Parse --input flag
113
+ const inputFlagIdx = args.indexOf('--input');
114
+ if (inputFlagIdx !== -1 && args[inputFlagIdx + 1] === undefined) {
115
+ console.error(" --input requires a JSON value, e.g. --input '{\"day\":\"mon\"}'");
116
+ process.exitCode = 1;
117
+ return;
118
+ }
119
+ const rawInput = inputFlagIdx !== -1 ? args[inputFlagIdx + 1] : undefined;
120
+ await runTask(root, taskName, rawInput);
121
+ return;
122
+ }
123
+ // Unknown subcommand
124
+ console.error(` Unknown subcommand: vura tasks ${subcommand ?? ''}`);
125
+ console.error(' Usage:');
126
+ console.error(' vura tasks list');
127
+ console.error(" vura tasks run <name> [--input '<json>']");
128
+ process.exitCode = 1;
129
+ }
130
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/commands/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,C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AC,CAgBvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBvD"}
package/dist/index.js CHANGED
@@ -9,12 +9,14 @@ import { manifestCommand } from './commands/manifest.js';
9
9
  import { deployCommand } from './commands/deploy.js';
10
10
  import { devCommand } from './commands/dev.js';
11
11
  import { adminCommand } from './commands/admin.js';
12
+ import { tasksCommand } from './commands/tasks.js';
12
13
  const COMMANDS = {
13
14
  build: buildCommand,
14
15
  manifest: manifestCommand,
15
16
  deploy: deployCommand,
16
17
  dev: devCommand,
17
18
  admin: adminCommand,
19
+ tasks: tasksCommand,
18
20
  };
19
21
  export async function run(args) {
20
22
  const command = args[0];
@@ -40,6 +42,9 @@ function printHelp() {
40
42
  deploy Explain managed deployment availability (not in OSS CLI yet)
41
43
  admin Launch the admin dashboard
42
44
  manifest Print the route manifest (debug)
45
+ tasks Manage and run task routes
46
+ vura tasks list
47
+ vura tasks run <name> [--input '<json>']
43
48
 
44
49
  Options:
45
50
  --help, -h Show this help message
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,QAAQ,GAAsD;IAClE,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,aAAa;IACrB,GAAG,EAAE,UAA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,YAAY;CACpB,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAExB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACzD,SAAS,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;QAC7C,SAAS,EAAE,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;CAeb,CAAC,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celsian/vura-cli",
3
- "version": "0.2.0",
3
+ "version": "0.5.0",
4
4
  "description": "Vura CLI — build and deploy full-stack apps",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,14 +13,22 @@
13
13
  "bin.js",
14
14
  "dist"
15
15
  ],
16
- "scripts": {
17
- "build": "tsc -b",
18
- "dev": "tsc -b --watch",
19
- "prepack": "pnpm run build"
20
- },
21
16
  "dependencies": {
22
- "@celsian/vura-core": "workspace:0.2.0",
23
- "esbuild": "^0.27.3"
17
+ "@celsian/vura-core": "0.5.0",
18
+ "esbuild": "^0.27.3",
19
+ "what-framework": "^0.11.1"
20
+ },
21
+ "peerDependencies": {
22
+ "ws": "^8.0.0"
23
+ },
24
+ "peerDependenciesMeta": {
25
+ "ws": {
26
+ "optional": true
27
+ }
28
+ },
29
+ "devDependencies": {
30
+ "@types/ws": "^8.18.1",
31
+ "ws": "^8.21.0"
24
32
  },
25
33
  "license": "MIT",
26
34
  "publishConfig": {
@@ -43,5 +51,9 @@
43
51
  ],
44
52
  "engines": {
45
53
  "node": ">=20 <23"
54
+ },
55
+ "scripts": {
56
+ "build": "tsc -b",
57
+ "dev": "tsc -b --watch"
46
58
  }
47
- }
59
+ }