uloop-cli 0.54.7 → 0.55.1
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 +49 -6
- package/dist/cli.bundle.cjs.map +2 -2
- package/package.json +1 -1
- package/src/__tests__/cli-e2e.test.ts +17 -0
- package/src/cli.ts +51 -7
- package/src/default-tools.json +1 -1
- 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.
|
|
5762
|
+
version: "0.55.1",
|
|
5763
5763
|
tools: [
|
|
5764
5764
|
{
|
|
5765
5765
|
name: "compile",
|
|
@@ -6185,12 +6185,15 @@ function saveToolsCache(cache) {
|
|
|
6185
6185
|
const content = JSON.stringify(cache, null, 2);
|
|
6186
6186
|
(0, import_fs3.writeFileSync)(cachePath, content, "utf-8");
|
|
6187
6187
|
}
|
|
6188
|
+
function hasCacheFile() {
|
|
6189
|
+
return (0, import_fs3.existsSync)(getCachePath());
|
|
6190
|
+
}
|
|
6188
6191
|
function getCacheFilePath() {
|
|
6189
6192
|
return getCachePath();
|
|
6190
6193
|
}
|
|
6191
6194
|
|
|
6192
6195
|
// src/version.ts
|
|
6193
|
-
var VERSION = "0.
|
|
6196
|
+
var VERSION = "0.55.1";
|
|
6194
6197
|
|
|
6195
6198
|
// src/spinner.ts
|
|
6196
6199
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -7246,10 +7249,6 @@ program2.command("fix").description("Clean up stale lock files that may prevent
|
|
|
7246
7249
|
cleanupLockFiles();
|
|
7247
7250
|
});
|
|
7248
7251
|
registerSkillsCommand(program2);
|
|
7249
|
-
var toolsCache = loadToolsCache();
|
|
7250
|
-
for (const tool of toolsCache.tools) {
|
|
7251
|
-
registerToolCommand(tool);
|
|
7252
|
-
}
|
|
7253
7252
|
function registerToolCommand(tool) {
|
|
7254
7253
|
const cmd = program2.command(tool.name).description(tool.description);
|
|
7255
7254
|
const properties = tool.inputSchema.properties;
|
|
@@ -7347,6 +7346,26 @@ function convertValue(value, propInfo) {
|
|
|
7347
7346
|
}
|
|
7348
7347
|
return parsed;
|
|
7349
7348
|
}
|
|
7349
|
+
if (lowerType === "object") {
|
|
7350
|
+
if (typeof value === "string") {
|
|
7351
|
+
const trimmed = value.trim();
|
|
7352
|
+
if (!trimmed.startsWith("{") || !trimmed.endsWith("}")) {
|
|
7353
|
+
throw new Error(`Invalid object value: ${value}. Use JSON object syntax.`);
|
|
7354
|
+
}
|
|
7355
|
+
try {
|
|
7356
|
+
const parsed = JSON.parse(trimmed);
|
|
7357
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
7358
|
+
return parsed;
|
|
7359
|
+
}
|
|
7360
|
+
} catch {
|
|
7361
|
+
}
|
|
7362
|
+
throw new Error(`Invalid object value: ${value}. Use JSON object syntax.`);
|
|
7363
|
+
}
|
|
7364
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
7365
|
+
return value;
|
|
7366
|
+
}
|
|
7367
|
+
throw new Error(`Invalid object value: ${String(value)}. Use JSON object syntax.`);
|
|
7368
|
+
}
|
|
7350
7369
|
return value;
|
|
7351
7370
|
}
|
|
7352
7371
|
function extractGlobalOptions(options) {
|
|
@@ -7675,6 +7694,30 @@ async function main() {
|
|
|
7675
7694
|
if (handleCompletionOptions()) {
|
|
7676
7695
|
return;
|
|
7677
7696
|
}
|
|
7697
|
+
const cachedVersion = loadToolsCache().version;
|
|
7698
|
+
if (hasCacheFile() && cachedVersion !== VERSION) {
|
|
7699
|
+
console.log(
|
|
7700
|
+
`\x1B[33mCache outdated (${cachedVersion} \u2192 ${VERSION}). Syncing tools from Unity...\x1B[0m`
|
|
7701
|
+
);
|
|
7702
|
+
try {
|
|
7703
|
+
await syncTools({});
|
|
7704
|
+
console.log("\x1B[32m\u2713 Tools synced successfully.\x1B[0m\n");
|
|
7705
|
+
} catch (error) {
|
|
7706
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
7707
|
+
if (isConnectionError(message)) {
|
|
7708
|
+
console.error("\x1B[33mWarning: Failed to sync tools. Using cached definitions.\x1B[0m");
|
|
7709
|
+
console.error("\x1B[33mRun 'uloop sync' manually when Unity is available.\x1B[0m\n");
|
|
7710
|
+
} else {
|
|
7711
|
+
console.error("\x1B[33mWarning: Failed to sync tools. Using cached definitions.\x1B[0m");
|
|
7712
|
+
console.error(`\x1B[33mError: ${message}\x1B[0m`);
|
|
7713
|
+
console.error("\x1B[33mRun 'uloop sync' manually when Unity is available.\x1B[0m\n");
|
|
7714
|
+
}
|
|
7715
|
+
}
|
|
7716
|
+
}
|
|
7717
|
+
const toolsCache = loadToolsCache();
|
|
7718
|
+
for (const tool of toolsCache.tools) {
|
|
7719
|
+
registerToolCommand(tool);
|
|
7720
|
+
}
|
|
7678
7721
|
const args = process.argv.slice(2);
|
|
7679
7722
|
const cmdName = args.find((arg) => !arg.startsWith("-"));
|
|
7680
7723
|
if (cmdName && !commandExists(cmdName)) {
|