@ucdjs/cli 0.2.1 → 0.2.2
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-utils-CN8LG6LB.js → cli-utils-DY82m2wz.js} +3 -3
- package/dist/cli.js +1 -1
- package/dist/{download-B_K_Pxjt.js → download-CCx2vdOj.js} +7 -1
- package/dist/{fields-wpvpYJjf.js → fields-Cz0PV1Co.js} +1 -1
- package/dist/{root-DKyNgiwV.js → root-oHWSp_5G.js} +2 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import yargs from "yargs-parser";
|
|
|
4
4
|
|
|
5
5
|
//#region package.json
|
|
6
6
|
var name = "@ucdjs/cli";
|
|
7
|
-
var version = "0.2.
|
|
7
|
+
var version = "0.2.2";
|
|
8
8
|
var type = "module";
|
|
9
9
|
var author = {
|
|
10
10
|
"name": "Lucas Nørgård",
|
|
@@ -147,13 +147,13 @@ async function runCommand(cmd, flags) {
|
|
|
147
147
|
console.log(` ${bgGreen(black(` ucd `))} ${green(`v${package_default.version ?? "x.y.z"}`)}`);
|
|
148
148
|
break;
|
|
149
149
|
case "codegen": {
|
|
150
|
-
const { runCodegenRoot } = await import("./root-
|
|
150
|
+
const { runCodegenRoot } = await import("./root-oHWSp_5G.js");
|
|
151
151
|
const subcommand = flags._[3]?.toString() ?? "";
|
|
152
152
|
await runCodegenRoot(subcommand, { flags });
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
155
|
case "download": {
|
|
156
|
-
const { runDownload } = await import("./download-
|
|
156
|
+
const { runDownload } = await import("./download-CCx2vdOj.js");
|
|
157
157
|
const versions = flags._.slice(3);
|
|
158
158
|
await runDownload({
|
|
159
159
|
versions,
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { printHelp } from "./cli-utils-
|
|
1
|
+
import { printHelp } from "./cli-utils-DY82m2wz.js";
|
|
2
2
|
import { gray, green, red, yellow } from "farver/fast";
|
|
3
3
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
4
|
import path, { dirname } from "node:path";
|
|
@@ -20,6 +20,7 @@ async function runDownload({ versions: providedVersions, flags }) {
|
|
|
20
20
|
["--exclude", "Exclude files matching glob patterns (e.g., '*Test*,ReadMe.txt,*.draft')."],
|
|
21
21
|
["--exclude-test", "Exclude all test files (ending with Test.txt)."],
|
|
22
22
|
["--exclude-draft", "Exclude all draft files"],
|
|
23
|
+
["--create-comment-files", "Create comment files for each downloaded file."],
|
|
23
24
|
["--force", "Force the download, even if the files already exist."],
|
|
24
25
|
["--debug", "Enable debug output."],
|
|
25
26
|
["--help (-h)", "See all available flags."]
|
|
@@ -114,6 +115,11 @@ async function runDownload({ versions: providedVersions, flags }) {
|
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
116
117
|
const content = await response.text();
|
|
118
|
+
if (flags.createCommentFiles) {
|
|
119
|
+
const parsed = path.parse(outputPath);
|
|
120
|
+
const commentPath = path.join(parsed.dir, `${parsed.name}.comments.txt`);
|
|
121
|
+
await writeFile(commentPath, "");
|
|
122
|
+
}
|
|
117
123
|
await writeFile(outputPath, content);
|
|
118
124
|
downloadedFiles.push(outputPath);
|
|
119
125
|
} catch (err) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { printHelp } from "./cli-utils-
|
|
1
|
+
import { printHelp } from "./cli-utils-DY82m2wz.js";
|
|
2
2
|
|
|
3
3
|
//#region src/cmd/codegen/root.ts
|
|
4
4
|
const CODEGEN_SUBCOMMANDS = ["fields"];
|
|
@@ -18,7 +18,7 @@ async function runCodegenRoot(subcommand, { flags }) {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
if (subcommand === "fields") {
|
|
21
|
-
const { runFieldCodegen } = await import("./fields-
|
|
21
|
+
const { runFieldCodegen } = await import("./fields-Cz0PV1Co.js");
|
|
22
22
|
const inputPath = flags._.slice(4)?.toString() ?? "";
|
|
23
23
|
await runFieldCodegen({
|
|
24
24
|
inputPath,
|