@stealthscale/tool-cli 0.1.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 ADDED
@@ -0,0 +1,20 @@
1
+ # @stealthscale/tool-cli
2
+
3
+ A **cli**: it ships the `stealth` bin.
4
+
5
+ | Command | What it does |
6
+ | ----------------- | ---------------------------------------------------------------- |
7
+ | `stealth release` | publishes the closure of the public packages in dependency order |
8
+
9
+ The publish harness is a module of this package, not a package of its own.
10
+
11
+ The command tree is [citty](https://github.com/unjs/citty): a subcommand is one object with
12
+ its arguments typed from their declarations, and it is imported when a run asks for it, so
13
+ `stealth --help` loads nothing else. Commander and cac both hand a command's options to its
14
+ callback as `any`, which is the one place a typo in an option name would otherwise be caught.
15
+
16
+ ## Install
17
+
18
+ ```sh
19
+ bun add -d @stealthscale/tool-cli
20
+ ```
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { n as stealth } from "../cli-DC07sdDR.mjs";
3
+ import { runMain } from "citty";
4
+ //#region src/bin/stealth.ts
5
+ /**
6
+ * @fileoverview The `stealth` bin. It hands the command to citty and does nothing else, so
7
+ * everything worth a specification lives beside it rather than in an entry a build rewrites.
8
+ */
9
+ await runMain(stealth);
10
+ //#endregion
11
+ export {};
@@ -0,0 +1,37 @@
1
+ import { defineCommand } from "citty";
2
+ import { packageRoot, readManifest } from "@stealthscale/tool-workspace";
3
+ //#region src/cli.ts
4
+ /**
5
+ * @fileoverview The `stealth` command: what it calls itself, and which subcommand takes a
6
+ * run. Every subcommand is imported when it is asked for, so `stealth --help` loads this
7
+ * file and nothing else.
8
+ */
9
+ /**
10
+ * Reads what a command calls itself off the manifest of the package that ships it, so the
11
+ * name, the summary and the version have one source.
12
+ *
13
+ * @param {Manifest} manifest - The manifest of the package that ships the bin.
14
+ * @returns {CommandMeta} The first command the manifest installs, its summary and its version.
15
+ */
16
+ function commandMeta(manifest) {
17
+ return {
18
+ description: manifest.description ?? "",
19
+ name: Object.keys(manifest.bin)[0] ?? manifest.name,
20
+ version: manifest.version
21
+ };
22
+ }
23
+ /**
24
+ * The `stealth` command: the bin's name, its own version, and the subcommands under it.
25
+ */
26
+ const stealth = defineCommand({
27
+ meta: commandMeta(readManifest(packageRoot(import.meta.dirname))),
28
+ subCommands: {
29
+ /**
30
+ * Loads the release command the first time a run asks for it.
31
+ *
32
+ * @returns {Promise<CommandDef>} The release command.
33
+ */
34
+ release: () => import("./command-DHNo5e1V.mjs").then((module) => module.releaseCommand) }
35
+ });
36
+ //#endregion
37
+ export { stealth as n, commandMeta as t };
@@ -0,0 +1,2 @@
1
+ import { t as releaseCommand } from "./command-wCHt33VW.mjs";
2
+ export { releaseCommand };