@hot-updater/cli-tools 0.29.3 → 0.29.5
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/index.cjs +2 -2
- package/dist/index.mjs +34 -34
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -59,12 +59,12 @@ node_path = __toESM(node_path);
|
|
|
59
59
|
let node_util = require("node:util");
|
|
60
60
|
let node_os = require("node:os");
|
|
61
61
|
node_os = __toESM(node_os);
|
|
62
|
+
let zlib = require("zlib");
|
|
63
|
+
zlib = __toESM(zlib);
|
|
62
64
|
let node_events = require("node:events");
|
|
63
65
|
let node_stream = require("node:stream");
|
|
64
66
|
node_stream = __toESM(node_stream);
|
|
65
67
|
let node_string_decoder = require("node:string_decoder");
|
|
66
|
-
let zlib = require("zlib");
|
|
67
|
-
zlib = __toESM(zlib);
|
|
68
68
|
let node_assert = require("node:assert");
|
|
69
69
|
node_assert = __toESM(node_assert);
|
|
70
70
|
let node_crypto = require("node:crypto");
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import fs$1 from "fs/promises";
|
|
|
9
9
|
import assert from "assert";
|
|
10
10
|
import crypto from "crypto";
|
|
11
11
|
import { Buffer as Buffer$1 } from "buffer";
|
|
12
|
-
import
|
|
12
|
+
import N, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
13
13
|
import * as k from "node:readline";
|
|
14
14
|
import ot from "node:readline";
|
|
15
15
|
import tty, { ReadStream } from "node:tty";
|
|
@@ -17,14 +17,14 @@ import fs$2, { appendFileSync, createReadStream, createWriteStream, existsSync,
|
|
|
17
17
|
import path$1, { basename, dirname as dirname$1, join, posix, win32 } from "node:path";
|
|
18
18
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
19
19
|
import os, { constants } from "node:os";
|
|
20
|
+
import * as realZlib$1 from "zlib";
|
|
21
|
+
import realZlib, { brotliCompressSync, constants as constants$1 } from "zlib";
|
|
20
22
|
import { EventEmitter as EventEmitter$1, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
21
23
|
import Stream, { Duplex, PassThrough as PassThrough$1, Readable as Readable$1, Transform, Writable, getDefaultHighWaterMark } from "node:stream";
|
|
22
24
|
import { StringDecoder } from "node:string_decoder";
|
|
23
|
-
import * as realZlib$1 from "zlib";
|
|
24
|
-
import realZlib, { brotliCompressSync, constants as constants$1 } from "zlib";
|
|
25
25
|
import assert$1 from "node:assert";
|
|
26
26
|
import { randomBytes } from "node:crypto";
|
|
27
|
-
import
|
|
27
|
+
import fsp from "node:fs/promises";
|
|
28
28
|
import { fileURLToPath } from "node:url";
|
|
29
29
|
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
30
30
|
import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
@@ -19279,7 +19279,7 @@ var dist_exports = /* @__PURE__ */ __exportAll({
|
|
|
19279
19279
|
updateSettings: () => It$1
|
|
19280
19280
|
});
|
|
19281
19281
|
function me() {
|
|
19282
|
-
return
|
|
19282
|
+
return N.platform !== "win32" ? N.env.TERM !== "linux" : !!N.env.CI || !!N.env.WT_SESSION || !!N.env.TERMINUS_SUBLIME || N.env.ConEmuTask === "{cmd::Cmder}" || N.env.TERM_PROGRAM === "Terminus-Sublime" || N.env.TERM_PROGRAM === "vscode" || N.env.TERM === "xterm-256color" || N.env.TERM === "alacritty" || N.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
19283
19283
|
}
|
|
19284
19284
|
const et = me(), ct = () => process.env.CI === "true", Mt = (t) => t.isTTY === !0, C = (t, r) => et ? t : r, Rt = C("◆", "*"), dt = C("■", "x"), $t = C("▲", "x"), V = C("◇", "o"), ht = C("┌", "T"), d = C("│", "|"), x = C("└", "—"), Ot = C("┐", "T"), Pt = C("┘", "—"), Q = C("●", ">"), H = C("○", " "), st = C("◻", "[•]"), U = C("◼", "[+]"), q = C("◻", "[ ]"), Nt = C("▪", "•"), rt = C("─", "-"), mt = C("╮", "+"), Wt = C("├", "+"), pt = C("╯", "+"), gt = C("╰", "+"), Lt = C("╭", "+"), ft = C("●", "•"), Ft = C("◆", "*"), yt = C("▲", "!"), Et = C("■", "x"), W = (t) => {
|
|
19285
19285
|
switch (t) {
|
|
@@ -19919,7 +19919,7 @@ ${import_picocolors.default.cyan(x)}
|
|
|
19919
19919
|
`), o = a.reduce((n, c) => Math.max(M(c), n), 0);
|
|
19920
19920
|
return J(t, r - (a.map(s).reduce((n, c) => Math.max(M(c), n), 0) - o), i);
|
|
19921
19921
|
}, Ve = (t = "", r = "", s) => {
|
|
19922
|
-
const i = s?.output ??
|
|
19922
|
+
const i = s?.output ?? N.stdout, a = s?.withGuide ?? _.withGuide, o = s?.format ?? Ge, u = [
|
|
19923
19923
|
"",
|
|
19924
19924
|
...ke(t, rt$1(i) - 6, o).split(`
|
|
19925
19925
|
`).map(o),
|
|
@@ -20849,13 +20849,13 @@ function assembleStyles$1() {
|
|
|
20849
20849
|
const ansiStyles$1 = assembleStyles$1();
|
|
20850
20850
|
//#endregion
|
|
20851
20851
|
//#region ../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/vendor/supports-color/index.js
|
|
20852
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
20852
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : N.argv) {
|
|
20853
20853
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
20854
20854
|
const position = argv.indexOf(prefix + flag);
|
|
20855
20855
|
const terminatorPosition = argv.indexOf("--");
|
|
20856
20856
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
20857
20857
|
}
|
|
20858
|
-
const { env } =
|
|
20858
|
+
const { env } = N;
|
|
20859
20859
|
let flagForceColor;
|
|
20860
20860
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
20861
20861
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
@@ -20888,7 +20888,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
20888
20888
|
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
20889
20889
|
const min = forceColor || 0;
|
|
20890
20890
|
if (env.TERM === "dumb") return min;
|
|
20891
|
-
if (
|
|
20891
|
+
if (N.platform === "win32") {
|
|
20892
20892
|
const osRelease = os.release().split(".");
|
|
20893
20893
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
20894
20894
|
return 1;
|
|
@@ -21645,7 +21645,7 @@ const NEWLINE = "\n";
|
|
|
21645
21645
|
const PAD = " ";
|
|
21646
21646
|
const NONE = "none";
|
|
21647
21647
|
const terminalColumns = () => {
|
|
21648
|
-
const { env, stdout, stderr } =
|
|
21648
|
+
const { env, stdout, stderr } = N;
|
|
21649
21649
|
if (stdout?.columns) return stdout.columns;
|
|
21650
21650
|
if (stderr?.columns) return stderr.columns;
|
|
21651
21651
|
if (env.COLUMNS) return Number.parseInt(env.COLUMNS, 10);
|
|
@@ -21788,8 +21788,8 @@ const boxContent = (content, contentWidth, options) => {
|
|
|
21788
21788
|
return result;
|
|
21789
21789
|
};
|
|
21790
21790
|
const sanitizeOptions = (options) => {
|
|
21791
|
-
if (options.fullscreen &&
|
|
21792
|
-
let newDimensions = [
|
|
21791
|
+
if (options.fullscreen && N?.stdout) {
|
|
21792
|
+
let newDimensions = [N.stdout.columns, N.stdout.rows];
|
|
21793
21793
|
if (typeof options.fullscreen === "function") newDimensions = options.fullscreen(...newDimensions);
|
|
21794
21794
|
options.width ||= newDimensions[0];
|
|
21795
21795
|
options.height ||= newDimensions[1];
|
|
@@ -25943,7 +25943,7 @@ const mkdir = (dir, opt, cb) => {
|
|
|
25943
25943
|
else cb();
|
|
25944
25944
|
};
|
|
25945
25945
|
if (dir === cwd) return checkCwd(dir, done);
|
|
25946
|
-
if (preserve) return
|
|
25946
|
+
if (preserve) return fsp.mkdir(dir, {
|
|
25947
25947
|
mode,
|
|
25948
25948
|
recursive: true
|
|
25949
25949
|
}).then((made) => done(null, made ?? void 0), done);
|
|
@@ -36006,9 +36006,9 @@ const getSubprocessResult = ({ stdout }) => {
|
|
|
36006
36006
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/utils/standard-stream.js
|
|
36007
36007
|
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
36008
36008
|
const STANDARD_STREAMS = [
|
|
36009
|
-
|
|
36010
|
-
|
|
36011
|
-
|
|
36009
|
+
N.stdin,
|
|
36010
|
+
N.stdout,
|
|
36011
|
+
N.stderr
|
|
36012
36012
|
];
|
|
36013
36013
|
const STANDARD_STREAMS_ALIASES = [
|
|
36014
36014
|
"stdin",
|
|
@@ -36129,9 +36129,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
36129
36129
|
//#endregion
|
|
36130
36130
|
//#region ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
|
|
36131
36131
|
function isUnicodeSupported() {
|
|
36132
|
-
const { env } =
|
|
36132
|
+
const { env } = N;
|
|
36133
36133
|
const { TERM, TERM_PROGRAM } = env;
|
|
36134
|
-
if (
|
|
36134
|
+
if (N.platform !== "win32") return TERM !== "linux";
|
|
36135
36135
|
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
36136
36136
|
}
|
|
36137
36137
|
//#endregion
|
|
@@ -37024,7 +37024,7 @@ function traversePathUp(startPath) {
|
|
|
37024
37024
|
}
|
|
37025
37025
|
//#endregion
|
|
37026
37026
|
//#region ../../node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
|
|
37027
|
-
const npmRunPath = ({ cwd =
|
|
37027
|
+
const npmRunPath = ({ cwd = N.cwd(), path: pathOption = N.env[pathKey()], preferLocal = true, execPath = N.execPath, addExecPath = true } = {}) => {
|
|
37028
37028
|
const cwdPath = path$1.resolve(toPath$2(cwd));
|
|
37029
37029
|
const result = [];
|
|
37030
37030
|
const pathParts = pathOption.split(path$1.delimiter);
|
|
@@ -37042,7 +37042,7 @@ const applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
|
37042
37042
|
const pathPart = path$1.resolve(cwdPath, toPath$2(execPath), "..");
|
|
37043
37043
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
37044
37044
|
};
|
|
37045
|
-
const npmRunPathEnv = ({ env =
|
|
37045
|
+
const npmRunPathEnv = ({ env = N.env, ...options } = {}) => {
|
|
37046
37046
|
env = { ...env };
|
|
37047
37047
|
const pathName = pathKey({ env });
|
|
37048
37048
|
options.path = env[pathName];
|
|
@@ -38149,7 +38149,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
|
38149
38149
|
};
|
|
38150
38150
|
const getDefaultCwd = () => {
|
|
38151
38151
|
try {
|
|
38152
|
-
return
|
|
38152
|
+
return N.cwd();
|
|
38153
38153
|
} catch (error) {
|
|
38154
38154
|
error.message = `The current directory does not exist.\n${error.message}`;
|
|
38155
38155
|
throw error;
|
|
@@ -38183,7 +38183,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
38183
38183
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
38184
38184
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
38185
38185
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
38186
|
-
if (
|
|
38186
|
+
if (N.platform === "win32" && path$1.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
38187
38187
|
return {
|
|
38188
38188
|
file,
|
|
38189
38189
|
commandArguments,
|
|
@@ -38210,7 +38210,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
|
|
|
38210
38210
|
});
|
|
38211
38211
|
const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
38212
38212
|
const env = extendEnv ? {
|
|
38213
|
-
...
|
|
38213
|
+
...N.env,
|
|
38214
38214
|
...envOption
|
|
38215
38215
|
} : envOption;
|
|
38216
38216
|
if (preferLocal || node) return npmRunPathEnv({
|
|
@@ -39177,12 +39177,12 @@ const guessStreamDirection = {
|
|
|
39177
39177
|
}
|
|
39178
39178
|
};
|
|
39179
39179
|
const getStandardStreamDirection = (value) => {
|
|
39180
|
-
if ([0,
|
|
39180
|
+
if ([0, N.stdin].includes(value)) return "input";
|
|
39181
39181
|
if ([
|
|
39182
39182
|
1,
|
|
39183
39183
|
2,
|
|
39184
|
-
|
|
39185
|
-
|
|
39184
|
+
N.stdout,
|
|
39185
|
+
N.stderr
|
|
39186
39186
|
].includes(value)) return "output";
|
|
39187
39187
|
};
|
|
39188
39188
|
const DEFAULT_DIRECTION = "output";
|
|
@@ -40222,9 +40222,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
|
|
|
40222
40222
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
40223
40223
|
};
|
|
40224
40224
|
const getIpcExport = () => {
|
|
40225
|
-
const anyProcess =
|
|
40225
|
+
const anyProcess = N;
|
|
40226
40226
|
const isSubprocess = true;
|
|
40227
|
-
const ipc =
|
|
40227
|
+
const ipc = N.channel !== void 0;
|
|
40228
40228
|
return {
|
|
40229
40229
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
40230
40230
|
getCancelSignal: getCancelSignal$1.bind(void 0, {
|
|
@@ -40694,7 +40694,7 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
40694
40694
|
};
|
|
40695
40695
|
var SignalExit = class extends SignalExitBase {
|
|
40696
40696
|
/* c8 ignore start */
|
|
40697
|
-
#hupSig = process$
|
|
40697
|
+
#hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
40698
40698
|
/* c8 ignore stop */
|
|
40699
40699
|
#emitter = new Emitter();
|
|
40700
40700
|
#process;
|
|
@@ -40789,8 +40789,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
40789
40789
|
} else return og.call(this.#process, ev, ...args);
|
|
40790
40790
|
}
|
|
40791
40791
|
};
|
|
40792
|
-
const process$
|
|
40793
|
-
const { onExit, load, unload } = signalExitWrap(processOk(process$
|
|
40792
|
+
const process$1 = globalThis.process;
|
|
40793
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
|
|
40794
40794
|
//#endregion
|
|
40795
40795
|
//#region ../../node_modules/.pnpm/execa@9.5.2/node_modules/execa/lib/terminate/cleanup.js
|
|
40796
40796
|
const cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => {
|
|
@@ -42002,7 +42002,7 @@ const { sendMessage, getOneMessage, getEachMessage, getCancelSignal } = getIpcEx
|
|
|
42002
42002
|
//#endregion
|
|
42003
42003
|
//#region ../../node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.js
|
|
42004
42004
|
const toPath$1 = (urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
|
|
42005
|
-
async function findUp(name, { cwd =
|
|
42005
|
+
async function findUp(name, { cwd = N.cwd(), type = "file", stopAt } = {}) {
|
|
42006
42006
|
let directory = path$1.resolve(toPath$1(cwd) ?? "");
|
|
42007
42007
|
const { root } = path$1.parse(directory);
|
|
42008
42008
|
stopAt = path$1.resolve(directory, toPath$1(stopAt ?? root));
|
|
@@ -42010,7 +42010,7 @@ async function findUp(name, { cwd = process$1.cwd(), type = "file", stopAt } = {
|
|
|
42010
42010
|
while (directory) {
|
|
42011
42011
|
const filePath = isAbsoluteName ? name : path$1.join(directory, name);
|
|
42012
42012
|
try {
|
|
42013
|
-
const stats = await
|
|
42013
|
+
const stats = await fsp.stat(filePath);
|
|
42014
42014
|
if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
|
|
42015
42015
|
} catch {}
|
|
42016
42016
|
if (directory === stopAt || directory === root) break;
|
|
@@ -47079,7 +47079,7 @@ const _readPackage = (file, normalize) => {
|
|
|
47079
47079
|
return json;
|
|
47080
47080
|
};
|
|
47081
47081
|
async function readPackage({ cwd, normalize = true } = {}) {
|
|
47082
|
-
return _readPackage(await
|
|
47082
|
+
return _readPackage(await fsp.readFile(getPackagePath(cwd), "utf8"), normalize);
|
|
47083
47083
|
}
|
|
47084
47084
|
//#endregion
|
|
47085
47085
|
//#region ../../node_modules/.pnpm/read-package-up@11.0.0/node_modules/read-package-up/index.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/cli-tools",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI utilities for Hot Updater",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"oxc-transform": "0.121.0",
|
|
43
43
|
"unconfig": "7.5.0",
|
|
44
|
-
"@hot-updater/plugin-core": "0.29.
|
|
44
|
+
"@hot-updater/plugin-core": "0.29.5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@clack/prompts": "1.0.1",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"read-package-up": "^11.0.0",
|
|
57
57
|
"semver": "^7.6.3",
|
|
58
58
|
"tar": "^7.5.1",
|
|
59
|
-
"typescript": "
|
|
59
|
+
"typescript": "6.0.2",
|
|
60
60
|
"workspace-tools": "^0.36.4",
|
|
61
|
-
"@hot-updater/test-utils": "0.29.
|
|
61
|
+
"@hot-updater/test-utils": "0.29.5"
|
|
62
62
|
},
|
|
63
63
|
"inlinedDependencies": {
|
|
64
64
|
"@babel/code-frame": "7.29.0",
|