@couch-kit/cli 0.3.7 → 0.3.8
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/index.js +27 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2463,38 +2463,49 @@ var require2 = createRequire2(import.meta.url);
|
|
|
2463
2463
|
var { version } = require2("../package.json");
|
|
2464
2464
|
var program2 = new Command;
|
|
2465
2465
|
program2.name("couch-kit").description("CLI for Couch Kit").version(version);
|
|
2466
|
-
program2.command("bundle").description("Bundles the web controller into the Android assets directory").option("-s, --source <path>", "Source directory of web controller", "./web-controller").option("-o, --output <path>", "Android assets directory", "./android/app/src/main/assets/www").option("--no-build", "Skip build step (just copy)").option("-m, --manifest <path>", "Also write manifest to this path for import in app source").action(async (
|
|
2466
|
+
program2.command("bundle").description("Bundles the web controller into the Android assets directory").option("-s, --source <path>", "Source directory of web controller", "./web-controller").option("-o, --output <path>", "Android assets directory", "./android/app/src/main/assets/www").option("--no-build", "Skip build step (just copy)").option("-m, --manifest <path>", "Also write manifest to this path for import in app source").action(async (_options, command) => {
|
|
2467
2467
|
const { bundleCommand: bundleCommand2 } = await Promise.resolve().then(() => (init_bundle(), exports_bundle));
|
|
2468
|
-
await bundleCommand2.parseAsync(
|
|
2468
|
+
await bundleCommand2.parseAsync(reconstructArgs(command), {
|
|
2469
2469
|
from: "user"
|
|
2470
2470
|
});
|
|
2471
2471
|
});
|
|
2472
|
-
program2.command("simulate").description("Spawns headless bots to simulate players").option("-n, --count <number>", "Number of bots", "4").option("-u, --url <url>", "WebSocket URL of host", "ws://localhost:8082").option("-i, --interval <ms>", "Action interval in ms", "1000").action(async (
|
|
2472
|
+
program2.command("simulate").description("Spawns headless bots to simulate players").option("-n, --count <number>", "Number of bots", "4").option("-u, --url <url>", "WebSocket URL of host", "ws://localhost:8082").option("-i, --interval <ms>", "Action interval in ms", "1000").action(async (_options, command) => {
|
|
2473
2473
|
const { simulateCommand: simulateCommand2 } = await Promise.resolve().then(() => (init_simulate(), exports_simulate));
|
|
2474
|
-
await simulateCommand2.parseAsync(
|
|
2474
|
+
await simulateCommand2.parseAsync(reconstructArgs(command), {
|
|
2475
|
+
from: "user"
|
|
2476
|
+
});
|
|
2475
2477
|
});
|
|
2476
2478
|
program2.command("init").description("Scaffolds a new web controller project").argument("[name]", "Project name", "web-controller").action(async (name) => {
|
|
2477
2479
|
const { initCommand: initCommand2 } = await Promise.resolve().then(() => (init_init(), exports_init));
|
|
2478
|
-
await initCommand2.parseAsync([
|
|
2480
|
+
await initCommand2.parseAsync([name], { from: "user" });
|
|
2479
2481
|
});
|
|
2480
|
-
program2.command("replay").description("Replay a recorded game session against a reducer").argument("<recording>", "Path to recording JSON file").argument("<reducer>", "Path to reducer module").option("--snapshots", "Output intermediate state snapshots").option("--json", "Output as formatted JSON").action(async (recording, reducer2,
|
|
2482
|
+
program2.command("replay").description("Replay a recorded game session against a reducer").argument("<recording>", "Path to recording JSON file").argument("<reducer>", "Path to reducer module").option("--snapshots", "Output intermediate state snapshots").option("--json", "Output as formatted JSON").action(async (recording, reducer2, _options, command) => {
|
|
2481
2483
|
const { replay: replay3 } = await Promise.resolve().then(() => (init_replay(), exports_replay));
|
|
2482
|
-
await replay3.parseAsync([
|
|
2484
|
+
await replay3.parseAsync([recording, reducer2, ...reconstructArgs(command)], {
|
|
2485
|
+
from: "user"
|
|
2486
|
+
});
|
|
2483
2487
|
});
|
|
2484
|
-
program2.command("dev").description("Start development server with LAN access").option("-p, --port <port>", "Port number", "5173").option("--host", "Expose to LAN").option("--open", "Open browser automatically").action(async (
|
|
2488
|
+
program2.command("dev").description("Start development server with LAN access").option("-p, --port <port>", "Port number", "5173").option("--host", "Expose to LAN").option("--open", "Open browser automatically").action(async (_options, command) => {
|
|
2485
2489
|
const { dev: dev2 } = await Promise.resolve().then(() => (init_dev(), exports_dev));
|
|
2486
|
-
await dev2.parseAsync(
|
|
2490
|
+
await dev2.parseAsync(reconstructArgs(command), {
|
|
2487
2491
|
from: "user"
|
|
2488
2492
|
});
|
|
2489
2493
|
});
|
|
2490
|
-
function reconstructArgs(
|
|
2494
|
+
function reconstructArgs(command) {
|
|
2491
2495
|
const args = [];
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2496
|
+
const opts = command.opts();
|
|
2497
|
+
for (const option of command.options) {
|
|
2498
|
+
const value = opts[option.attributeName()];
|
|
2499
|
+
if (value === undefined)
|
|
2500
|
+
continue;
|
|
2501
|
+
if (option.negate) {
|
|
2502
|
+
if (value === false)
|
|
2503
|
+
args.push(option.long ?? option.short ?? "");
|
|
2504
|
+
} else if (option.isBoolean()) {
|
|
2505
|
+
if (value === true)
|
|
2506
|
+
args.push(option.long ?? option.short ?? "");
|
|
2507
|
+
} else {
|
|
2508
|
+
args.push(option.long ?? option.short ?? "", String(value));
|
|
2498
2509
|
}
|
|
2499
2510
|
}
|
|
2500
2511
|
return args;
|