@hawkeyexl/manni 0.0.0-bootstrap.0 → 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/LICENSE +21 -0
- package/README.md +178 -0
- package/dist/chunk-HJZFU2P5.js +1049 -0
- package/dist/chunk-HJZFU2P5.js.map +1 -0
- package/dist/chunk-Y6FSY35O.js +10814 -0
- package/dist/chunk-Y6FSY35O.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +38 -0
- package/dist/cli.js.map +1 -0
- package/dist/docmeta.d.ts +2 -0
- package/dist/docmeta.js +10 -0
- package/dist/docmeta.js.map +1 -0
- package/dist/index.d.ts +1623 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/package.json +102 -3
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The `manni` CLI: one bin, one subcommand per tool in the family.
|
|
5
|
+
*
|
|
6
|
+
* Each tool builds its own commander program and is mounted here under its
|
|
7
|
+
* name, so `manni meta validate …` is the metadata tool's `validate` with
|
|
8
|
+
* nothing in between. The umbrella owns only what is common to all of them:
|
|
9
|
+
* the name, the version, and the exit-code contract in `runProgram`.
|
|
10
|
+
*
|
|
11
|
+
* Tools land here one at a time, on their own branches; until one merges its
|
|
12
|
+
* subcommand does not exist.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
declare function buildProgram(): Command;
|
|
16
|
+
|
|
17
|
+
export { buildProgram };
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildProgram,
|
|
4
|
+
runIfMain
|
|
5
|
+
} from "./chunk-HJZFU2P5.js";
|
|
6
|
+
import {
|
|
7
|
+
package_default
|
|
8
|
+
} from "./chunk-Y6FSY35O.js";
|
|
9
|
+
|
|
10
|
+
// src/cli.ts
|
|
11
|
+
import { Command } from "commander";
|
|
12
|
+
function buildProgram2() {
|
|
13
|
+
const meta = buildProgram().name("meta").description(
|
|
14
|
+
"Validate, read, query and fill document metadata against JSON Schema"
|
|
15
|
+
);
|
|
16
|
+
const metaCommands = new Set(meta.commands.map((c) => c.name()));
|
|
17
|
+
const program = new Command();
|
|
18
|
+
program.name("manni").description("Tools for documentation that is meant to be checked.").version(package_default.version, "-V, --version").showHelpAfterError("(add --help for usage)").exitOverride().configureOutput({
|
|
19
|
+
outputError: (str, write) => {
|
|
20
|
+
write(str);
|
|
21
|
+
const m = /unknown command '([^']+)'/.exec(str);
|
|
22
|
+
const name = m?.[1];
|
|
23
|
+
if (name !== void 0 && metaCommands.has(name)) {
|
|
24
|
+
write(
|
|
25
|
+
`(\`${name}\` is a metadata command: try \`manni meta ${name}\`)
|
|
26
|
+
`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
program.addCommand(meta);
|
|
32
|
+
return program;
|
|
33
|
+
}
|
|
34
|
+
runIfMain(import.meta.url, buildProgram2);
|
|
35
|
+
export {
|
|
36
|
+
buildProgram2 as buildProgram
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["/**\n * The `manni` CLI: one bin, one subcommand per tool in the family.\n *\n * Each tool builds its own commander program and is mounted here under its\n * name, so `manni meta validate …` is the metadata tool's `validate` with\n * nothing in between. The umbrella owns only what is common to all of them:\n * the name, the version, and the exit-code contract in `runProgram`.\n *\n * Tools land here one at a time, on their own branches; until one merges its\n * subcommand does not exist.\n */\nimport { Command } from \"commander\";\nimport pkg from \"../package.json\" with { type: \"json\" };\nimport { buildProgram as buildMeta } from \"./meta/cli.js\";\nimport { runIfMain } from \"./shared/run.js\";\n\nexport function buildProgram(): Command {\n const meta = buildMeta()\n .name(\"meta\")\n .description(\n \"Validate, read, query and fill document metadata against JSON Schema\",\n );\n const metaCommands = new Set(meta.commands.map((c) => c.name()));\n\n const program = new Command();\n program\n .name(\"manni\")\n .description(\"Tools for documentation that is meant to be checked.\")\n .version(pkg.version, \"-V, --version\")\n // A pointer, not the whole help screen. Commander appends this after every\n // usage error, and the message that precedes it already names the problem.\n .showHelpAfterError(\"(add --help for usage)\")\n // MUST come before `addCommand`, which copies the exit callback into the\n // mounted program by value. See the same note in ./meta/cli.ts.\n .exitOverride()\n .configureOutput({\n outputError: (str, write) => {\n write(str);\n // `manni validate …` is the most likely thing a docmeta user types\n // first. Commander's \"unknown command\" is correct and unhelpful; say\n // where the command went.\n const m = /unknown command '([^']+)'/.exec(str);\n const name = m?.[1];\n if (name !== undefined && metaCommands.has(name)) {\n write(\n `(\\`${name}\\` is a metadata command: try \\`manni meta ${name}\\`)\\n`,\n );\n }\n },\n });\n\n program.addCommand(meta);\n return program;\n}\n\nrunIfMain(import.meta.url, buildProgram);\n"],"mappings":";;;;;;;;;;AAWA,SAAS,eAAe;AAKjB,SAASA,gBAAwB;AACtC,QAAM,OAAO,aAAU,EACpB,KAAK,MAAM,EACX;AAAA,IACC;AAAA,EACF;AACF,QAAM,eAAe,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAE/D,QAAM,UAAU,IAAI,QAAQ;AAC5B,UACG,KAAK,OAAO,EACZ,YAAY,sDAAsD,EAClE,QAAQ,gBAAI,SAAS,eAAe,EAGpC,mBAAmB,wBAAwB,EAG3C,aAAa,EACb,gBAAgB;AAAA,IACf,aAAa,CAAC,KAAK,UAAU;AAC3B,YAAM,GAAG;AAIT,YAAM,IAAI,4BAA4B,KAAK,GAAG;AAC9C,YAAM,OAAO,IAAI,CAAC;AAClB,UAAI,SAAS,UAAa,aAAa,IAAI,IAAI,GAAG;AAChD;AAAA,UACE,MAAM,IAAI,8CAA8C,IAAI;AAAA;AAAA,QAC9D;AAAA,MACF;AAAA,IACF;AAAA,EACF,CAAC;AAEH,UAAQ,WAAW,IAAI;AACvB,SAAO;AACT;AAEA,UAAU,YAAY,KAAKA,aAAY;","names":["buildProgram"]}
|
package/dist/docmeta.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/docmeta.ts"],"sourcesContent":["/**\n * The `docmeta` bin: the metadata tool under the name it had before it became\n * `manni meta`. Same program, same options, same exit codes, so a script or\n * workflow written against `docmeta …` keeps working. Only the usage line and\n * the stderr prefix say `docmeta`.\n */\nimport { buildProgram } from \"./meta/cli.js\";\nimport { runIfMain } from \"./shared/run.js\";\n\nrunIfMain(import.meta.url, () => buildProgram().name(\"docmeta\"));\n"],"mappings":";;;;;;;;AASA,UAAU,YAAY,KAAK,MAAM,aAAa,EAAE,KAAK,SAAS,CAAC;","names":[]}
|