@rune-cli/rune 0.0.2 → 0.0.4
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/dist/cli.mjs +53 -26
- package/dist/{index-B-_q5V0A.d.mts → index-BF5_G9J2.d.mts} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/runtime.d.mts +1 -1
- package/dist/test.d.mts +1 -1
- package/package.json +1 -2
package/dist/cli.mjs
CHANGED
|
@@ -5,6 +5,9 @@ import { build } from "esbuild";
|
|
|
5
5
|
import { cp, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import ts from "typescript";
|
|
8
|
+
//#region package.json
|
|
9
|
+
var version = "0.0.4";
|
|
10
|
+
//#endregion
|
|
8
11
|
//#region src/manifest/generate-manifest.ts
|
|
9
12
|
const COMMAND_ENTRY_FILE = "index.ts";
|
|
10
13
|
function comparePathSegments(left, right) {
|
|
@@ -313,6 +316,21 @@ async function writeBuiltRuntimeFiles(distDirectory, manifest) {
|
|
|
313
316
|
await mkdir(distDirectory, { recursive: true });
|
|
314
317
|
await writeFile(path.join(distDirectory, BUILD_MANIFEST_FILENAME), serializeCommandManifest(manifest));
|
|
315
318
|
}
|
|
319
|
+
function renderRuneBuildHelp() {
|
|
320
|
+
return `\
|
|
321
|
+
Build a Rune project into a distributable CLI.
|
|
322
|
+
|
|
323
|
+
Usage: rune build [options]
|
|
324
|
+
|
|
325
|
+
Options:
|
|
326
|
+
--project <path> Path to the Rune project root (default: current directory)
|
|
327
|
+
-h, --help Show this help message
|
|
328
|
+
|
|
329
|
+
Examples:
|
|
330
|
+
rune build
|
|
331
|
+
rune build --project ./my-app
|
|
332
|
+
`;
|
|
333
|
+
}
|
|
316
334
|
async function runBuildCommand(options) {
|
|
317
335
|
let projectRoot = "";
|
|
318
336
|
try {
|
|
@@ -340,14 +358,6 @@ async function runBuildCommand(options) {
|
|
|
340
358
|
return failureResult(error instanceof Error ? error.message : "Failed to run rune build");
|
|
341
359
|
}
|
|
342
360
|
}
|
|
343
|
-
function renderRuneBuildHelp() {
|
|
344
|
-
return [
|
|
345
|
-
"Usage: rune build [--project <path>]",
|
|
346
|
-
"",
|
|
347
|
-
"Build a Rune project into a distributable CLI.",
|
|
348
|
-
""
|
|
349
|
-
].join("\n");
|
|
350
|
-
}
|
|
351
361
|
//#endregion
|
|
352
362
|
//#region src/cli/dev-command.ts
|
|
353
363
|
const DEV_MANIFEST_DIRECTORY_PATH = ".rune";
|
|
@@ -358,6 +368,21 @@ async function writeDevManifest(projectRoot, manifestContents) {
|
|
|
358
368
|
await mkdir(manifestDirectory, { recursive: true });
|
|
359
369
|
await writeFile(manifestPath, manifestContents);
|
|
360
370
|
}
|
|
371
|
+
function renderRuneDevHelp() {
|
|
372
|
+
return `\
|
|
373
|
+
Run a Rune project in development mode.
|
|
374
|
+
|
|
375
|
+
Usage: rune dev [options] [command...]
|
|
376
|
+
|
|
377
|
+
Options:
|
|
378
|
+
--project <path> Path to the Rune project root (default: current directory)
|
|
379
|
+
-h, --help Show this help message
|
|
380
|
+
|
|
381
|
+
Examples:
|
|
382
|
+
rune dev hello
|
|
383
|
+
rune dev --project ./my-app hello
|
|
384
|
+
`;
|
|
385
|
+
}
|
|
361
386
|
async function runDevCommand(options) {
|
|
362
387
|
try {
|
|
363
388
|
const projectRoot = resolveProjectPath(options);
|
|
@@ -375,24 +400,6 @@ async function runDevCommand(options) {
|
|
|
375
400
|
return failureResult(error instanceof Error ? error.message : "Failed to run rune dev");
|
|
376
401
|
}
|
|
377
402
|
}
|
|
378
|
-
function renderRuneDevHelp() {
|
|
379
|
-
return [
|
|
380
|
-
"Usage: rune dev [--project <path>] [--] [command...]",
|
|
381
|
-
"",
|
|
382
|
-
"Run a Rune project in development mode.",
|
|
383
|
-
""
|
|
384
|
-
].join("\n");
|
|
385
|
-
}
|
|
386
|
-
function renderRuneCliHelp() {
|
|
387
|
-
return [
|
|
388
|
-
"Usage: rune <command>",
|
|
389
|
-
"",
|
|
390
|
-
"Commands:",
|
|
391
|
-
" build Build a Rune project into a distributable CLI",
|
|
392
|
-
" dev Run a Rune project in development mode",
|
|
393
|
-
""
|
|
394
|
-
].join("\n");
|
|
395
|
-
}
|
|
396
403
|
//#endregion
|
|
397
404
|
//#region src/cli/rune-cli.ts
|
|
398
405
|
function tryParseProjectOption(argv, index) {
|
|
@@ -413,6 +420,12 @@ function tryParseProjectOption(argv, index) {
|
|
|
413
420
|
function isHelpFlag(token) {
|
|
414
421
|
return token === "--help" || token === "-h";
|
|
415
422
|
}
|
|
423
|
+
function isVersionFlag(token) {
|
|
424
|
+
return token === "--version" || token === "-V";
|
|
425
|
+
}
|
|
426
|
+
function getRuneVersion() {
|
|
427
|
+
return version;
|
|
428
|
+
}
|
|
416
429
|
function parseDevArgs(argv) {
|
|
417
430
|
const commandArgs = [];
|
|
418
431
|
let projectPath;
|
|
@@ -460,9 +473,23 @@ function parseBuildArgs(argv) {
|
|
|
460
473
|
}
|
|
461
474
|
return { projectPath };
|
|
462
475
|
}
|
|
476
|
+
function renderRuneCliHelp() {
|
|
477
|
+
return `\
|
|
478
|
+
Usage: rune <command>
|
|
479
|
+
|
|
480
|
+
Commands:
|
|
481
|
+
build Build a Rune project into a distributable CLI
|
|
482
|
+
dev Run a Rune project in development mode
|
|
483
|
+
|
|
484
|
+
Options:
|
|
485
|
+
-h, --help Show this help message
|
|
486
|
+
-V, --version Show the version number
|
|
487
|
+
`;
|
|
488
|
+
}
|
|
463
489
|
async function runRuneCli(options) {
|
|
464
490
|
const [subcommand, ...restArgs] = options.argv;
|
|
465
491
|
if (!subcommand || isHelpFlag(subcommand)) return successResult(renderRuneCliHelp());
|
|
492
|
+
if (isVersionFlag(subcommand)) return successResult(`rune v${getRuneVersion()}\n`);
|
|
466
493
|
if (subcommand === "dev") {
|
|
467
494
|
const parsedDevArgs = parseDevArgs(restArgs);
|
|
468
495
|
if ("exitCode" in parsedDevArgs) return parsedDevArgs;
|
|
@@ -283,4 +283,4 @@ interface CommandExecutionResult {
|
|
|
283
283
|
readonly stderr: string;
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
|
-
export {
|
|
286
|
+
export { DefinedCommand as a, PrimitiveArgField as c, SchemaArgField as d, SchemaOptionField as f, CommandOptionField as i, PrimitiveFieldType as l, CommandContext as n, ExecuteCommandInput as o, defineCommand as p, CommandExecutionResult as r, InferExecutionFields as s, CommandArgField as t, PrimitiveOptionField as u };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { defineCommand };
|
|
1
|
+
import { a as DefinedCommand, c as PrimitiveArgField, d as SchemaArgField, f as SchemaOptionField, i as CommandOptionField, l as PrimitiveFieldType, n as CommandContext, o as ExecuteCommandInput, p as defineCommand, r as CommandExecutionResult, s as InferExecutionFields, t as CommandArgField, u as PrimitiveOptionField } from "./index-BF5_G9J2.mjs";
|
|
2
|
+
export { type CommandArgField, type CommandContext, type CommandExecutionResult, type CommandOptionField, type DefinedCommand, type ExecuteCommandInput, type InferExecutionFields, type PrimitiveArgField, type PrimitiveFieldType, type PrimitiveOptionField, type SchemaArgField, type SchemaOptionField, defineCommand };
|
package/dist/runtime.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as DefinedCommand, i as CommandOptionField, r as CommandExecutionResult, t as CommandArgField } from "./index-BF5_G9J2.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/manifest/manifest-types.d.ts
|
|
4
4
|
type CommandManifestPath = readonly string[];
|
package/dist/test.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as DefinedCommand, i as CommandOptionField, o as ExecuteCommandInput, r as CommandExecutionResult, s as InferExecutionFields, t as CommandArgField } from "./index-BF5_G9J2.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/test.d.ts
|
|
4
4
|
type RunCommandOptions<TOptions, TArgs> = ExecuteCommandInput<TOptions, TArgs>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rune-cli/rune",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Rune is a CLI framework built around the concept of file-based command routing.",
|
|
5
5
|
"homepage": "https://github.com/morinokami/rune#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "24.12.0",
|
|
46
46
|
"@typescript/native-preview": "7.0.0-dev.20260317.1",
|
|
47
|
-
"bumpp": "11.0.1",
|
|
48
47
|
"typescript": "5.9.3",
|
|
49
48
|
"vite-plus": "v0.1.13",
|
|
50
49
|
"@rune-cli/core": "0.0.0"
|