@delta-infra/cli 1.0.47 → 1.0.49

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/checksums.txt CHANGED
@@ -1,5 +1,5 @@
1
- abfbd8a22e5fb5e193d6ef63f4f49db195ceb635bb08a19ae550555f4d8da1ed delta-cli-darwin-amd64.tar.gz
2
- 90e3b9e1b7784b3e84a8e34adb7be975cf84a768ec01c2d6c11de0c6bca2ff8d delta-cli-darwin-arm64.tar.gz
3
- 7897fcec1be3468ec15e3d2f2771cd1e7837fe148ff1fbae4ca3dbb0f733b838 delta-cli-linux-amd64.tar.gz
4
- 6d69f17806ff1a6a42d530fa6ef78c7fbc49aa88242cc95482708a6097b9d13e delta-cli-linux-arm64.tar.gz
5
- 0f6b1274ed8cf3113d1f49b3c526a756bed0e343aa186af623ab5aecf993619f delta-cli-windows-amd64.zip
1
+ 1a787c38b5feae0ba3fe3f72e6dd024f1c0c43ad7a381e0022ac447c07fd268b delta-cli-darwin-amd64.tar.gz
2
+ c062b3c0405e1ec4fc63203084f4d08a4094f8e955610c5c3ede3283c707f44b delta-cli-darwin-arm64.tar.gz
3
+ aec9a78da205afbe48ef6bdc3d910c9b772388d8a1dfccbc736dd811c444472f delta-cli-linux-amd64.tar.gz
4
+ 3fdf4011b2461e7f709fbbed6427397a783d1d63a543a57bb1f9a629459f55a7 delta-cli-linux-arm64.tar.gz
5
+ 0ebee9db15821b7b0ef802262bcf50443fffb223f062942ab2fd8169e9ffad5f delta-cli-windows-amd64.zip
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-infra/cli",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "Delta Sandbox CLI",
5
5
  "bin": {
6
6
  "delta-cli": "scripts/run.js"
@@ -9,6 +9,8 @@ const p = require("@clack/prompts");
9
9
 
10
10
  const PKG = "@delta-infra/cli";
11
11
  const SKILLS_REPO = "yzailab/delta-infra-cli";
12
+ const NPM_REGISTRIES = ["https://registry.npmmirror.com", "https://registry.npmjs.org"];
13
+ const GH_MIRRORS = ["https://gh-proxy.com", "https://gh.llkk.cc"];
12
14
  const CONFIG_DIR = path.join(osHomedir(), ".delta-infra");
13
15
  const isWindows = process.platform === "win32";
14
16
 
@@ -211,17 +213,31 @@ async function stepInstallGlobally(msg) {
211
213
  s.start(fmt(msg.step1, PKG));
212
214
  }
213
215
  try {
214
- // Install the npm package (which triggers postinstall → install.js),
215
- // then explicitly download the correct version binary in case the
216
- // npx cache has stale package.json that misleads install.js.
217
- await runSilentAsync("npm", ["install", "-g", PKG], { timeout: 120000 });
216
+ let installed = false;
217
+ for (const registry of NPM_REGISTRIES) {
218
+ try {
219
+ await runSilentAsync("npm", ["install", "-g", PKG, "--registry", registry], {
220
+ timeout: 300000,
221
+ env: { ...process.env, DELTA_CLI_MIRROR: GH_MIRRORS[0] },
222
+ });
223
+ installed = true;
224
+ break;
225
+ } catch { }
226
+ }
227
+ if (!installed) throw new Error("all npm registries failed");
228
+
218
229
  if (targetVer) {
219
- await runSilentAsync(process.execPath, [
220
- path.join(__dirname, "install.js"),
221
- ], {
222
- timeout: 120000,
223
- env: { ...process.env, DELTA_CLI_RUN: "true", DELTA_CLI_VERSION: targetVer },
224
- });
230
+ for (const mirror of GH_MIRRORS) {
231
+ try {
232
+ await runSilentAsync(process.execPath, [
233
+ path.join(__dirname, "install.js"),
234
+ ], {
235
+ timeout: 300000,
236
+ env: { ...process.env, DELTA_CLI_RUN: "true", DELTA_CLI_VERSION: targetVer, DELTA_CLI_MIRROR: mirror },
237
+ });
238
+ break;
239
+ } catch { }
240
+ }
225
241
  }
226
242
  s.stop(needsUpgrade ? fmt(msg.step1Upgraded, latestVer) : msg.step1Done);
227
243
  return needsUpgrade;
@@ -289,9 +305,9 @@ async function stepInstallSkills(msg) {
289
305
  }
290
306
  } catch { }
291
307
 
292
- const GH_PROXY = "https://gh-proxy.com/https://github.com";
293
308
  const urls = [
294
- `${GH_PROXY}/${SKILLS_REPO}`,
309
+ `https://gh-proxy.com/https://github.com/${SKILLS_REPO}`,
310
+ `https://gh.llkk.cc/https://github.com/${SKILLS_REPO}`,
295
311
  `https://github.com/${SKILLS_REPO}`,
296
312
  ];
297
313
  let lastErr;
@@ -130,7 +130,7 @@ function probeMirrors(version, cb) {
130
130
  ];
131
131
  var child;
132
132
  try {
133
- child = require("child_process").spawn("curl", args, { stdio: ["ignore", "pipe", "pipe"], timeout: 8000 });
133
+ child = require("child_process").spawn("curl", args, { stdio: ["ignore", "pipe", "pipe"], timeout: 5000 });
134
134
  var stdout = "";
135
135
  var stderr = "";
136
136
  child.stdout.on("data", function(d) { stdout += d; });
@@ -153,7 +153,7 @@ function probeMirrors(version, cb) {
153
153
  })(i);
154
154
  }
155
155
  // Safety timeout: if probes hang, continue without mirrors after 10s
156
- setTimeout(finish, 10000);
156
+ setTimeout(finish, 5000);
157
157
  }
158
158
 
159
159
  function releaseAssetUrls(version, assetName, cb) {
@@ -225,7 +225,9 @@ function download(url, destPath) {
225
225
  assertAllowedHost(url);
226
226
  const args = [
227
227
  "--fail", "--location", "--silent", "--show-error",
228
- "--connect-timeout", "10", "--max-time", "120",
228
+ "--connect-timeout", "10",
229
+ "--max-time", "45",
230
+ "--speed-limit", "50000", "--speed-time", "10",
229
231
  "--max-redirs", "3",
230
232
  "--output", destPath,
231
233
  ];