uloop-cli 0.54.6 → 0.54.7
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.bundle.cjs +35 -9
- package/dist/cli.bundle.cjs.map +2 -2
- package/package.json +1 -1
- package/src/__tests__/cli-e2e.test.ts +64 -1
- package/src/cli.ts +43 -9
- package/src/default-tools.json +2 -2
- package/src/version.ts +1 -1
package/dist/cli.bundle.cjs
CHANGED
|
@@ -5759,7 +5759,7 @@ var import_path3 = require("path");
|
|
|
5759
5759
|
|
|
5760
5760
|
// src/default-tools.json
|
|
5761
5761
|
var default_tools_default = {
|
|
5762
|
-
version: "0.54.
|
|
5762
|
+
version: "0.54.7",
|
|
5763
5763
|
tools: [
|
|
5764
5764
|
{
|
|
5765
5765
|
name: "compile",
|
|
@@ -5803,7 +5803,7 @@ var default_tools_default = {
|
|
|
5803
5803
|
IncludeStackTrace: {
|
|
5804
5804
|
type: "boolean",
|
|
5805
5805
|
description: "Include stack trace in output",
|
|
5806
|
-
default:
|
|
5806
|
+
default: false
|
|
5807
5807
|
},
|
|
5808
5808
|
UseRegex: {
|
|
5809
5809
|
type: "boolean",
|
|
@@ -6190,7 +6190,7 @@ function getCacheFilePath() {
|
|
|
6190
6190
|
}
|
|
6191
6191
|
|
|
6192
6192
|
// src/version.ts
|
|
6193
|
-
var VERSION = "0.54.
|
|
6193
|
+
var VERSION = "0.54.7";
|
|
6194
6194
|
|
|
6195
6195
|
// src/spinner.ts
|
|
6196
6196
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -7257,8 +7257,9 @@ function registerToolCommand(tool) {
|
|
|
7257
7257
|
const optionStr = generateOptionString(propName, propInfo);
|
|
7258
7258
|
const description = buildOptionDescription(propInfo);
|
|
7259
7259
|
const defaultValue = propInfo.default;
|
|
7260
|
-
if (defaultValue !== void 0) {
|
|
7261
|
-
|
|
7260
|
+
if (defaultValue !== void 0 && defaultValue !== null) {
|
|
7261
|
+
const defaultStr = convertDefaultToString(defaultValue);
|
|
7262
|
+
cmd.option(optionStr, description, defaultStr);
|
|
7262
7263
|
} else {
|
|
7263
7264
|
cmd.option(optionStr, description);
|
|
7264
7265
|
}
|
|
@@ -7275,12 +7276,18 @@ function registerToolCommand(tool) {
|
|
|
7275
7276
|
);
|
|
7276
7277
|
});
|
|
7277
7278
|
}
|
|
7279
|
+
function convertDefaultToString(value) {
|
|
7280
|
+
if (typeof value === "string") {
|
|
7281
|
+
return value;
|
|
7282
|
+
}
|
|
7283
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
7284
|
+
return String(value);
|
|
7285
|
+
}
|
|
7286
|
+
return JSON.stringify(value);
|
|
7287
|
+
}
|
|
7278
7288
|
function generateOptionString(propName, propInfo) {
|
|
7279
7289
|
const kebabName = pascalToKebabCase(propName);
|
|
7280
|
-
|
|
7281
|
-
if (lowerType === "boolean") {
|
|
7282
|
-
return `--${kebabName}`;
|
|
7283
|
-
}
|
|
7290
|
+
void propInfo;
|
|
7284
7291
|
return `--${kebabName} <value>`;
|
|
7285
7292
|
}
|
|
7286
7293
|
function buildOptionDescription(propInfo) {
|
|
@@ -7304,7 +7311,26 @@ function buildParams(options, properties) {
|
|
|
7304
7311
|
}
|
|
7305
7312
|
function convertValue(value, propInfo) {
|
|
7306
7313
|
const lowerType = propInfo.type.toLowerCase();
|
|
7314
|
+
if (lowerType === "boolean" && typeof value === "string") {
|
|
7315
|
+
const lower = value.toLowerCase();
|
|
7316
|
+
if (lower === "true") {
|
|
7317
|
+
return true;
|
|
7318
|
+
}
|
|
7319
|
+
if (lower === "false") {
|
|
7320
|
+
return false;
|
|
7321
|
+
}
|
|
7322
|
+
throw new Error(`Invalid boolean value: ${value}. Use 'true' or 'false'.`);
|
|
7323
|
+
}
|
|
7307
7324
|
if (lowerType === "array" && typeof value === "string") {
|
|
7325
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
7326
|
+
try {
|
|
7327
|
+
const parsed = JSON.parse(value);
|
|
7328
|
+
if (Array.isArray(parsed)) {
|
|
7329
|
+
return parsed;
|
|
7330
|
+
}
|
|
7331
|
+
} catch {
|
|
7332
|
+
}
|
|
7333
|
+
}
|
|
7308
7334
|
return value.split(",").map((s) => s.trim());
|
|
7309
7335
|
}
|
|
7310
7336
|
if (lowerType === "integer" && typeof value === "string") {
|