uloop-cli 0.62.1 → 0.62.3
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 +52 -29
- package/dist/cli.bundle.cjs.map +2 -2
- package/package.json +1 -1
- package/src/__tests__/port-resolver.test.ts +63 -0
- package/src/cli.ts +27 -22
- package/src/default-tools.json +1 -1
- package/src/port-resolver.ts +37 -9
- package/src/version.ts +1 -1
package/dist/cli.bundle.cjs
CHANGED
|
@@ -5717,6 +5717,32 @@ function findUnityProjectInParentsWithoutUloop(startPath) {
|
|
|
5717
5717
|
|
|
5718
5718
|
// src/port-resolver.ts
|
|
5719
5719
|
var DEFAULT_PORT = 8700;
|
|
5720
|
+
function normalizePort(port) {
|
|
5721
|
+
if (typeof port !== "number") {
|
|
5722
|
+
return null;
|
|
5723
|
+
}
|
|
5724
|
+
if (!Number.isInteger(port)) {
|
|
5725
|
+
return null;
|
|
5726
|
+
}
|
|
5727
|
+
if (port < 1 || port > 65535) {
|
|
5728
|
+
return null;
|
|
5729
|
+
}
|
|
5730
|
+
return port;
|
|
5731
|
+
}
|
|
5732
|
+
function resolvePortFromUnitySettings(settings) {
|
|
5733
|
+
const serverPort = normalizePort(settings.serverPort);
|
|
5734
|
+
const customPort = normalizePort(settings.customPort);
|
|
5735
|
+
if (settings.isServerRunning === true && serverPort !== null) {
|
|
5736
|
+
return serverPort;
|
|
5737
|
+
}
|
|
5738
|
+
if (customPort !== null) {
|
|
5739
|
+
return customPort;
|
|
5740
|
+
}
|
|
5741
|
+
if (serverPort !== null) {
|
|
5742
|
+
return serverPort;
|
|
5743
|
+
}
|
|
5744
|
+
return null;
|
|
5745
|
+
}
|
|
5720
5746
|
async function resolveUnityPort(explicitPort) {
|
|
5721
5747
|
if (explicitPort !== void 0) {
|
|
5722
5748
|
return explicitPort;
|
|
@@ -5748,13 +5774,7 @@ async function readPortFromSettings(projectRoot) {
|
|
|
5748
5774
|
} catch {
|
|
5749
5775
|
return null;
|
|
5750
5776
|
}
|
|
5751
|
-
|
|
5752
|
-
return settings.serverPort;
|
|
5753
|
-
}
|
|
5754
|
-
if (typeof settings.customPort === "number") {
|
|
5755
|
-
return settings.customPort;
|
|
5756
|
-
}
|
|
5757
|
-
return null;
|
|
5777
|
+
return resolvePortFromUnitySettings(settings);
|
|
5758
5778
|
}
|
|
5759
5779
|
|
|
5760
5780
|
// src/tool-cache.ts
|
|
@@ -5763,7 +5783,7 @@ var import_path3 = require("path");
|
|
|
5763
5783
|
|
|
5764
5784
|
// src/default-tools.json
|
|
5765
5785
|
var default_tools_default = {
|
|
5766
|
-
version: "0.62.
|
|
5786
|
+
version: "0.62.3",
|
|
5767
5787
|
tools: [
|
|
5768
5788
|
{
|
|
5769
5789
|
name: "compile",
|
|
@@ -6207,7 +6227,7 @@ function getCachedServerVersion() {
|
|
|
6207
6227
|
}
|
|
6208
6228
|
|
|
6209
6229
|
// src/version.ts
|
|
6210
|
-
var VERSION = "0.62.
|
|
6230
|
+
var VERSION = "0.62.3";
|
|
6211
6231
|
|
|
6212
6232
|
// src/spinner.ts
|
|
6213
6233
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -8163,6 +8183,7 @@ function registerFocusWindowCommand(program3) {
|
|
|
8163
8183
|
}
|
|
8164
8184
|
|
|
8165
8185
|
// src/cli.ts
|
|
8186
|
+
var LAUNCH_COMMAND = "launch";
|
|
8166
8187
|
var BUILTIN_COMMANDS = [
|
|
8167
8188
|
"list",
|
|
8168
8189
|
"sync",
|
|
@@ -8170,7 +8191,7 @@ var BUILTIN_COMMANDS = [
|
|
|
8170
8191
|
"update",
|
|
8171
8192
|
"fix",
|
|
8172
8193
|
"skills",
|
|
8173
|
-
|
|
8194
|
+
LAUNCH_COMMAND,
|
|
8174
8195
|
"focus-window"
|
|
8175
8196
|
];
|
|
8176
8197
|
var program2 = new Command();
|
|
@@ -8680,23 +8701,27 @@ async function main() {
|
|
|
8680
8701
|
if (handleCompletionOptions()) {
|
|
8681
8702
|
return;
|
|
8682
8703
|
}
|
|
8683
|
-
const
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
)
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8704
|
+
const args = process.argv.slice(2);
|
|
8705
|
+
const cmdName = args.find((arg) => !arg.startsWith("-"));
|
|
8706
|
+
if (cmdName !== LAUNCH_COMMAND) {
|
|
8707
|
+
const cachedVersion = loadToolsCache().version;
|
|
8708
|
+
if (hasCacheFile() && cachedVersion !== VERSION) {
|
|
8709
|
+
console.log(
|
|
8710
|
+
`\x1B[33mCache outdated (${cachedVersion} \u2192 ${VERSION}). Syncing tools from Unity...\x1B[0m`
|
|
8711
|
+
);
|
|
8712
|
+
try {
|
|
8713
|
+
await syncTools({});
|
|
8714
|
+
console.log("\x1B[32m\u2713 Tools synced successfully.\x1B[0m\n");
|
|
8715
|
+
} catch (error) {
|
|
8716
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
8717
|
+
if (isConnectionError(message)) {
|
|
8718
|
+
console.error("\x1B[33mWarning: Failed to sync tools. Using cached definitions.\x1B[0m");
|
|
8719
|
+
console.error("\x1B[33mRun 'uloop sync' manually when Unity is available.\x1B[0m\n");
|
|
8720
|
+
} else {
|
|
8721
|
+
console.error("\x1B[33mWarning: Failed to sync tools. Using cached definitions.\x1B[0m");
|
|
8722
|
+
console.error(`\x1B[33mError: ${message}\x1B[0m`);
|
|
8723
|
+
console.error("\x1B[33mRun 'uloop sync' manually when Unity is available.\x1B[0m\n");
|
|
8724
|
+
}
|
|
8700
8725
|
}
|
|
8701
8726
|
}
|
|
8702
8727
|
}
|
|
@@ -8704,8 +8729,6 @@ async function main() {
|
|
|
8704
8729
|
for (const tool of toolsCache.tools) {
|
|
8705
8730
|
registerToolCommand(tool);
|
|
8706
8731
|
}
|
|
8707
|
-
const args = process.argv.slice(2);
|
|
8708
|
-
const cmdName = args.find((arg) => !arg.startsWith("-"));
|
|
8709
8732
|
if (cmdName && !commandExists(cmdName)) {
|
|
8710
8733
|
console.log(`\x1B[33mUnknown command '${cmdName}'. Syncing tools from Unity...\x1B[0m`);
|
|
8711
8734
|
try {
|