xshell 1.2.28 → 1.2.30
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/apps.d.ts +1 -3
- package/apps.js +2 -2
- package/file.d.ts +20 -15
- package/file.js +61 -29
- package/git.d.ts +1 -0
- package/git.js +6 -1
- package/net.js +1 -1
- package/package.json +10 -10
- package/process.d.ts +4 -1
- package/process.js +4 -3
- package/react.development.js +23161 -23464
- package/react.development.js.map +1 -1
- package/react.production.js +15417 -15198
- package/react.production.js.map +1 -1
package/apps.d.ts
CHANGED
|
@@ -5,13 +5,11 @@ export declare let npm: {
|
|
|
5
5
|
/** node.exe E:/sdk/nodejs/node_modules/corepack/dist/pnpm.js install
|
|
6
6
|
- cwd
|
|
7
7
|
- pkgs?: `[ ]` */
|
|
8
|
-
install(cwd: string, pkgs?: string[], { save_dev, save_peer, legacy, force,
|
|
8
|
+
install(cwd: string, pkgs?: string[], { save_dev, save_peer, legacy, force, break: _break, }?: {
|
|
9
9
|
save_dev?: boolean;
|
|
10
10
|
save_peer?: boolean;
|
|
11
11
|
legacy?: boolean;
|
|
12
12
|
force?: boolean;
|
|
13
|
-
term?: boolean;
|
|
14
|
-
inspect?: boolean;
|
|
15
13
|
break?: boolean;
|
|
16
14
|
}): Promise<void>;
|
|
17
15
|
};
|
package/apps.js
CHANGED
|
@@ -8,7 +8,7 @@ export let npm = {
|
|
|
8
8
|
/** node.exe E:/sdk/nodejs/node_modules/corepack/dist/pnpm.js install
|
|
9
9
|
- cwd
|
|
10
10
|
- pkgs?: `[ ]` */
|
|
11
|
-
async install(cwd, pkgs = [], { save_dev = false, save_peer = false, legacy = false, force = false,
|
|
11
|
+
async install(cwd, pkgs = [], { save_dev = false, save_peer = false, legacy = false, force = false, break: _break = false, } = {}) {
|
|
12
12
|
const args = [
|
|
13
13
|
'install',
|
|
14
14
|
...util.inspect.defaultOptions.colors ? ['--color'] : [],
|
|
@@ -19,6 +19,6 @@ export let npm = {
|
|
|
19
19
|
...pkgs || []
|
|
20
20
|
];
|
|
21
21
|
await this.call(cwd, this.bin, args);
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=apps.js.map
|
package/file.d.ts
CHANGED
|
@@ -27,14 +27,16 @@ export declare function fopen(fp: string, flags?: string | number, { mode, print
|
|
|
27
27
|
flags: string | number;
|
|
28
28
|
mode: fs.Mode;
|
|
29
29
|
}>;
|
|
30
|
-
export
|
|
31
|
-
|
|
32
|
-
encoding: 'binary';
|
|
30
|
+
export interface FReadOptions {
|
|
31
|
+
encoding?: Encoding | 'binary';
|
|
33
32
|
print?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function fread(fp: string | FileHandle): Promise<string>;
|
|
35
|
+
export declare function fread(fp: string | FileHandle, options?: FReadOptions & {
|
|
36
|
+
encoding: 'binary';
|
|
34
37
|
}): Promise<Buffer>;
|
|
35
|
-
export declare function fread(fp: string, options?: {
|
|
38
|
+
export declare function fread(fp: string | FileHandle, options?: FReadOptions & {
|
|
36
39
|
encoding?: Encoding;
|
|
37
|
-
print?: boolean;
|
|
38
40
|
}): Promise<string>;
|
|
39
41
|
/** 读取文件,划分为行,并去掉最后一个 \n 之后的 '' */
|
|
40
42
|
export declare function fread_lines(fp: string, options?: {
|
|
@@ -56,6 +58,7 @@ export declare function fequals(fp_left: string, fp_right: string, { print }?: {
|
|
|
56
58
|
}): Promise<boolean>;
|
|
57
59
|
export interface FWriteOptions {
|
|
58
60
|
print?: boolean;
|
|
61
|
+
mtime?: number;
|
|
59
62
|
}
|
|
60
63
|
/** 写入 data 到 fp 路径所指的文件
|
|
61
64
|
会在因不存在父文件夹导致写入失败时,自动创建父文件夹,并再次尝试写入
|
|
@@ -67,8 +70,8 @@ export interface FWriteOptions {
|
|
|
67
70
|
- Uint8Array, Buffer: 写入二进制 buffer
|
|
68
71
|
- any: 通过 JSON.stringify 转为文本后写入文件
|
|
69
72
|
- options?:
|
|
70
|
-
-
|
|
71
|
-
-
|
|
73
|
+
- print?: `true`
|
|
74
|
+
- mtime?: 在写入后设置修改时间 (utc 毫秒数) */
|
|
72
75
|
export declare function fwrite(fp: string, data: string | Uint8Array | any, options?: FWriteOptions): Promise<string>;
|
|
73
76
|
export declare function fwrite(fp: FileHandle, data: string | Uint8Array | any, options?: FWriteOptions): Promise<FileHandle>;
|
|
74
77
|
export declare function fwrite(fp: string | FileHandle, data: string | Uint8Array | any, options?: FWriteOptions): Promise<string | FileHandle>;
|
|
@@ -104,7 +107,7 @@ export declare function flist(fpd: string, options?: FListOptions & {
|
|
|
104
107
|
stats: true;
|
|
105
108
|
}): Promise<FStats[]>;
|
|
106
109
|
export declare function flist(fpd: string, options?: FListOptions): Promise<string[]>;
|
|
107
|
-
export declare function fstat(fp: string): Promise<FStats>;
|
|
110
|
+
export declare function fstat(fp: string | FileHandle): Promise<FStats>;
|
|
108
111
|
export declare function flstat(fp: string): Promise<FStats>;
|
|
109
112
|
export declare function ffstat(handle: fsp.FileHandle): Promise<fs.BigIntStats>;
|
|
110
113
|
/** 删除文件或文件夹,返回是否实际进行了删除操作
|
|
@@ -140,7 +143,7 @@ export interface FCopyOptions {
|
|
|
140
143
|
|
|
141
144
|
@example
|
|
142
145
|
fcopy('D:/temp/camera/', 'D:/camera/') */
|
|
143
|
-
export declare function fcopy(fp_src: string, fp_dst: string, { print, overwrite, filter, }?: FCopyOptions): Promise<
|
|
146
|
+
export declare function fcopy(fp_src: string, fp_dst: string, { print, overwrite, filter, }?: FCopyOptions): Promise<string>;
|
|
144
147
|
export interface FMoveOptions {
|
|
145
148
|
overwrite?: boolean;
|
|
146
149
|
print?: boolean;
|
|
@@ -155,7 +158,7 @@ export interface FMoveOptions {
|
|
|
155
158
|
|
|
156
159
|
@example
|
|
157
160
|
fmove('D:/temp/camera/', 'D:/camera/') */
|
|
158
|
-
export declare function fmove(fp_src: string, fp_dst: string, { overwrite, print }?: FMoveOptions): Promise<
|
|
161
|
+
export declare function fmove(fp_src: string, fp_dst: string, { overwrite, print }?: FMoveOptions): Promise<string>;
|
|
159
162
|
/** 重命名文件 rename file
|
|
160
163
|
- fp: 当前文件名/路径 current filename/path
|
|
161
164
|
- fp_: 新的文件名/路径 new filename/path
|
|
@@ -168,6 +171,11 @@ export declare function frename(fp: string, fp_: string, { fpd, print, overwrite
|
|
|
168
171
|
print?: boolean;
|
|
169
172
|
overwrite?: boolean;
|
|
170
173
|
}): Promise<void>;
|
|
174
|
+
export interface FMkdirOptions {
|
|
175
|
+
print?: boolean;
|
|
176
|
+
/** `0o777` A file mode. If a string is passed, it is parsed as an octal integer. */
|
|
177
|
+
mode?: string | number;
|
|
178
|
+
}
|
|
171
179
|
/**
|
|
172
180
|
递归创建文件夹,确保 fpd 指向的文件夹存在 Create folders recursively, make sure the folder pointed to by fpd exists
|
|
173
181
|
返回首个创建的文件夹或 undefined Returns the first created folder or undefined
|
|
@@ -176,11 +184,7 @@ export declare function frename(fp: string, fp_: string, { fpd, print, overwrite
|
|
|
176
184
|
- options?:
|
|
177
185
|
- print?: `true`
|
|
178
186
|
- mode?: `'0o777'` */
|
|
179
|
-
export declare function fmkdir(fpd: string, { print, mode
|
|
180
|
-
print?: boolean;
|
|
181
|
-
/** `0o777` A file mode. If a string is passed, it is parsed as an octal integer. */
|
|
182
|
-
mode?: string | number;
|
|
183
|
-
}): Promise<string>;
|
|
187
|
+
export declare function fmkdir(fpd: string, { print, mode }?: FMkdirOptions): Promise<string>;
|
|
184
188
|
/** 创建软链接
|
|
185
189
|
- fp_real: 现在真实文件/文件夹的路径
|
|
186
190
|
- fp_link: 目标链接文件/文件夹的路径 */
|
|
@@ -225,3 +229,4 @@ export declare function ftail(fp: string, handler: (lines: string[]) => void | P
|
|
|
225
229
|
export declare function freplace(fp: string, pattern: string | RegExp, replacement: string, { print }?: {
|
|
226
230
|
print?: boolean;
|
|
227
231
|
}): Promise<void>;
|
|
232
|
+
export declare function log_action(action: string, fp_src: string, fp_dst: string, sep?: string): void;
|
package/file.js
CHANGED
|
@@ -5,9 +5,10 @@ import { to_json } from "./prototype.js";
|
|
|
5
5
|
import { pack, parse } from "./io.js";
|
|
6
6
|
import { path } from "./path.js";
|
|
7
7
|
import { check, Lock, WritableMemoryStream, url_width, throttle } from "./utils.js";
|
|
8
|
+
import { noprint } from "./process.js";
|
|
8
9
|
export { fsp };
|
|
9
10
|
export const encodings = ['utf-8', 'gb18030', 'shift-jis', 'utf-16le'];
|
|
10
|
-
export const ramdisk = fexists('T:/TEMP/',
|
|
11
|
+
export const ramdisk = fexists('T:/TEMP/', noprint);
|
|
11
12
|
/** fp 所指向的 文件/ 文件夹 是否存在
|
|
12
13
|
Does the file/folder pointed to by fp exist? */
|
|
13
14
|
export function fexists(fp, { print = true } = {}) {
|
|
@@ -27,15 +28,21 @@ export function fexists(fp, { print = true } = {}) {
|
|
|
27
28
|
export async function fopen(fp, flags = 'r', { mode, print } = {}) {
|
|
28
29
|
if (print)
|
|
29
30
|
console.log(t('打开文件'), fp);
|
|
30
|
-
await fmkdir(fp.fdir,
|
|
31
|
+
await fmkdir(fp.fdir, noprint);
|
|
31
32
|
return Object.assign(await fsp.open(fp, flags, mode), { fp, flags, mode });
|
|
32
33
|
}
|
|
33
34
|
export async function fread(fp, { encoding = 'utf-8', print = true } = {}) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const is_handle = typeof fp === 'object' && fp && 'fd' in fp;
|
|
36
|
+
if (is_handle) {
|
|
37
|
+
if (print && fp.fp)
|
|
38
|
+
console.log('读取', fp);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
check(!fp.isdir, 'fp 必须是文件,不能以 / 结尾');
|
|
42
|
+
check(path.isAbsolute(fp), `fp 必须是绝对路径: ${fp}`);
|
|
43
|
+
if (print)
|
|
44
|
+
console.log('读取', fp);
|
|
45
|
+
}
|
|
39
46
|
switch (encoding) {
|
|
40
47
|
case 'utf-8':
|
|
41
48
|
return fsp.readFile(fp, { encoding: 'utf-8' });
|
|
@@ -75,30 +82,45 @@ export async function fequals(fp_left, fp_right, { print = true } = {}) {
|
|
|
75
82
|
return false;
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
|
-
export async function fwrite(fp, data, { print = true } = {}) {
|
|
85
|
+
export async function fwrite(fp, data, { print = true, mtime } = {}) {
|
|
79
86
|
const is_handle = typeof fp === 'object' && fp && 'fd' in fp;
|
|
80
87
|
if (is_handle) {
|
|
81
88
|
if (print)
|
|
82
|
-
console.log(
|
|
89
|
+
console.log('写入', fp.fp);
|
|
83
90
|
}
|
|
84
91
|
else {
|
|
85
|
-
check(path.isAbsolute(fp),
|
|
92
|
+
check(path.isAbsolute(fp), `fp 必须是绝对路径,当前为: ${fp}`);
|
|
86
93
|
if (print)
|
|
87
|
-
console.log(
|
|
94
|
+
console.log('写入', fp);
|
|
88
95
|
}
|
|
89
96
|
if (!isUint8Array(data) && typeof data !== 'string')
|
|
90
97
|
data = to_json(data);
|
|
98
|
+
// 需要设置修改时间,先打开文件再写入
|
|
99
|
+
if (mtime !== undefined && !is_handle) {
|
|
100
|
+
let handle = await fopen(fp, 'w', noprint);
|
|
101
|
+
try {
|
|
102
|
+
await handle.write(data, 0);
|
|
103
|
+
const mseconds = mtime / 1000;
|
|
104
|
+
await handle.utimes(mseconds, mseconds);
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
await handle.close();
|
|
108
|
+
}
|
|
109
|
+
return fp;
|
|
110
|
+
}
|
|
91
111
|
try {
|
|
92
112
|
await fsp.writeFile(fp, data);
|
|
93
113
|
}
|
|
94
114
|
catch (error) {
|
|
95
115
|
if (error.code === 'ENOENT' && !is_handle) {
|
|
96
|
-
await fmkdir(fp.fdir,
|
|
116
|
+
await fmkdir(fp.fdir, noprint);
|
|
97
117
|
await fsp.writeFile(fp, data);
|
|
98
118
|
}
|
|
99
119
|
else
|
|
100
120
|
throw error;
|
|
101
121
|
}
|
|
122
|
+
if (mtime !== undefined)
|
|
123
|
+
await fp.utimes(mtime, mtime);
|
|
102
124
|
return fp;
|
|
103
125
|
}
|
|
104
126
|
export async function fpack(fp, data, options) {
|
|
@@ -115,7 +137,7 @@ export async function fappend(fp, data, { print = true } = {}) {
|
|
|
115
137
|
}
|
|
116
138
|
catch (error) {
|
|
117
139
|
if (error.code === 'ENOENT') {
|
|
118
|
-
await fmkdir(fp.fdir,
|
|
140
|
+
await fmkdir(fp.fdir, noprint);
|
|
119
141
|
await fsp.appendFile(fp, data);
|
|
120
142
|
}
|
|
121
143
|
else
|
|
@@ -213,9 +235,17 @@ export async function flist(fpd, options = {}) {
|
|
|
213
235
|
return fps;
|
|
214
236
|
}
|
|
215
237
|
export async function fstat(fp) {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
238
|
+
let stat;
|
|
239
|
+
if (typeof fp === 'object' && fp && 'fd' in fp) {
|
|
240
|
+
stat = await fp.stat({ bigint: true });
|
|
241
|
+
if (fp.fp)
|
|
242
|
+
stat.fp = fp.fp;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
check(path.isAbsolute(fp), `fstat: 参数 fp: '${fp}' 必须是绝对路径`);
|
|
246
|
+
stat = await fsp.stat(fp, { bigint: true });
|
|
247
|
+
stat.fp = fp;
|
|
248
|
+
}
|
|
219
249
|
return stat;
|
|
220
250
|
}
|
|
221
251
|
export async function flstat(fp) {
|
|
@@ -259,8 +289,8 @@ export async function fdelete(fp, { print = true } = {}) {
|
|
|
259
289
|
}
|
|
260
290
|
/** 清空文件夹中的内容,实际为删除该文件夹后新建 */
|
|
261
291
|
export async function fdclear(fpd, { print = true } = {}) {
|
|
262
|
-
await fdelete(fpd,
|
|
263
|
-
await fmkdir(fpd,
|
|
292
|
+
await fdelete(fpd, noprint);
|
|
293
|
+
await fmkdir(fpd, noprint);
|
|
264
294
|
if (print)
|
|
265
295
|
console.log(`清空了文件夹 ${fpd}`);
|
|
266
296
|
}
|
|
@@ -319,6 +349,7 @@ export async function fcopy(fp_src, fp_dst, { print = true, overwrite = true, fi
|
|
|
319
349
|
else
|
|
320
350
|
throw error;
|
|
321
351
|
}
|
|
352
|
+
return fp_dst;
|
|
322
353
|
}
|
|
323
354
|
/** 移动文件或文件夹
|
|
324
355
|
相同分区 / 文件系统下使用 rename, 否则 fallback 到复制后删除源文件
|
|
@@ -335,12 +366,12 @@ export async function fmove(fp_src, fp_dst, { overwrite = false, print = true }
|
|
|
335
366
|
check(path.isAbsolute(fp_src) && path.isAbsolute(fp_dst), t('fp_src 和 fp_dst 必须为完整路径'));
|
|
336
367
|
if (print)
|
|
337
368
|
log_action('移动', fp_src, fp_dst);
|
|
338
|
-
if (!overwrite && fexists(fp_dst,
|
|
369
|
+
if (!overwrite && fexists(fp_dst, noprint))
|
|
339
370
|
throw new Error(`${t('已存在')} ${fp_dst}`);
|
|
340
|
-
await fmkdir(fp_dst.fdir,
|
|
371
|
+
await fmkdir(fp_dst.fdir, noprint);
|
|
341
372
|
async function copy_and_delete() {
|
|
342
373
|
await fcopy(fp_src, fp_dst, { overwrite, print: false });
|
|
343
|
-
await fdelete(fp_src,
|
|
374
|
+
await fdelete(fp_src, noprint);
|
|
344
375
|
}
|
|
345
376
|
if (fp_src[0] !== fp_dst[0] || overwrite)
|
|
346
377
|
await copy_and_delete();
|
|
@@ -354,6 +385,7 @@ export async function fmove(fp_src, fp_dst, { overwrite = false, print = true }
|
|
|
354
385
|
else
|
|
355
386
|
throw error;
|
|
356
387
|
}
|
|
388
|
+
return fp_dst;
|
|
357
389
|
}
|
|
358
390
|
/** 重命名文件 rename file
|
|
359
391
|
- fp: 当前文件名/路径 current filename/path
|
|
@@ -371,7 +403,7 @@ export async function frename(fp, fp_, { fpd, print = true, overwrite = true } =
|
|
|
371
403
|
check(path.isAbsolute(fp) && path.isAbsolute(fp_), t('fp 和 fp_ 必须是绝对路径'));
|
|
372
404
|
if (print)
|
|
373
405
|
log_action('重命名', fp, fp_);
|
|
374
|
-
if (!overwrite && fexists(fp_,
|
|
406
|
+
if (!overwrite && fexists(fp_, noprint))
|
|
375
407
|
throw new Error(`${t('已存在')} ${fp}`);
|
|
376
408
|
await fsp.rename(fp, fp_);
|
|
377
409
|
}
|
|
@@ -383,13 +415,13 @@ export async function frename(fp, fp_, { fpd, print = true, overwrite = true } =
|
|
|
383
415
|
- options?:
|
|
384
416
|
- print?: `true`
|
|
385
417
|
- mode?: `'0o777'` */
|
|
386
|
-
export async function fmkdir(fpd, { print = true, mode
|
|
387
|
-
check(path.isAbsolute(fpd),
|
|
388
|
-
check(fpd.isdir,
|
|
418
|
+
export async function fmkdir(fpd, { print = true, mode } = {}) {
|
|
419
|
+
check(path.isAbsolute(fpd), `fpd 必须是绝对路径: ${fpd}`);
|
|
420
|
+
check(fpd.isdir, `fpd 必须以 / 结尾: ${fpd}`);
|
|
389
421
|
// 类似 D:/ 这样的根路径,调用 fsp.mkdir 会报错无权限
|
|
390
422
|
if (fpd.length === 3 &&
|
|
391
423
|
'A' <= fpd[0] && fpd[0] <= 'Z' && fpd[1] === ':' && fpd[2] === '/')
|
|
392
|
-
if (fexists(fpd)) {
|
|
424
|
+
if (fexists(fpd, noprint)) {
|
|
393
425
|
if (print)
|
|
394
426
|
console.log(t('已存在文件夹'), fpd);
|
|
395
427
|
return fpd;
|
|
@@ -414,7 +446,7 @@ export async function flink(fp_real, fp_link, { junction = false, print = true,
|
|
|
414
446
|
const is_fpd_real = fp_real.isdir;
|
|
415
447
|
const is_fpd_link = fp_link.isdir;
|
|
416
448
|
check(is_fpd_real === is_fpd_link, 'fp_real 和 fp_link 必须同为文件路径或文件夹路径');
|
|
417
|
-
if (fexists(fp_link,
|
|
449
|
+
if (fexists(fp_link, noprint))
|
|
418
450
|
if (!skip_existing)
|
|
419
451
|
throw new Error(`存在同名${is_fpd_link ? '文件夹' : '文件'}: ${fp_link},无法创建链接`);
|
|
420
452
|
else {
|
|
@@ -464,7 +496,7 @@ async function _zip(data, fp_zip, { dirname, print = { files: true, info: true }
|
|
|
464
496
|
dirname = fpd_src.fname;
|
|
465
497
|
if (!dirname.isdir)
|
|
466
498
|
throw new Error('dirname 需要以 / 结尾');
|
|
467
|
-
entries = Object.fromEntries((await flist(fpd_src,
|
|
499
|
+
entries = Object.fromEntries((await flist(fpd_src, noprint))
|
|
468
500
|
.map(fp => ([dirname + fp, fpd_src + fp])));
|
|
469
501
|
}
|
|
470
502
|
else {
|
|
@@ -565,7 +597,7 @@ export async function freplace(fp, pattern, replacement, { print = true } = {})
|
|
|
565
597
|
await fwrite(fp, (await fread(fp, { print }))
|
|
566
598
|
.replaceAll(pattern, replacement), { print });
|
|
567
599
|
}
|
|
568
|
-
function log_action(action, fp_src, fp_dst, sep = '->') {
|
|
600
|
+
export function log_action(action, fp_src, fp_dst, sep = '->') {
|
|
569
601
|
console.log(`${`${action} ${fp_src}`.pad(url_width)} ${sep} ${fp_dst}`);
|
|
570
602
|
}
|
|
571
603
|
//# sourceMappingURL=file.js.map
|
package/git.d.ts
CHANGED
package/git.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { call, print_no_command } from "./process.js";
|
|
1
|
+
import { call, noprint, print_no_command } from "./process.js";
|
|
2
2
|
import { fread, fmkdir } from "./file.js";
|
|
3
3
|
export class Git {
|
|
4
4
|
static exe = 'git';
|
|
@@ -86,6 +86,11 @@ export class Git {
|
|
|
86
86
|
};
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
+
async get_last_commit_hash(short = true) {
|
|
90
|
+
const hash = (await fread(`${this.cwd}.git/refs/heads/${await this.get_branch()}`, noprint))
|
|
91
|
+
.trim();
|
|
92
|
+
return short ? hash.slice(0, 6) : hash;
|
|
93
|
+
}
|
|
89
94
|
async fetch({ print = true, remote } = {}) {
|
|
90
95
|
await this.call([
|
|
91
96
|
'fetch',
|
package/net.js
CHANGED
|
@@ -108,7 +108,7 @@ export async function request(url, options = {}) {
|
|
|
108
108
|
let headers = {
|
|
109
109
|
'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja-JP;q=0.6,ja;q=0.5',
|
|
110
110
|
'accept-encoding': 'gzip, deflate, br',
|
|
111
|
-
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
111
|
+
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36',
|
|
112
112
|
'sec-ch-ua-platform': '"Windows"',
|
|
113
113
|
'sec-ch-ua-platform-version': '"15.0.0"',
|
|
114
114
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"@stylistic/eslint-plugin": "^4.2.0",
|
|
57
57
|
"@svgr/webpack": "^8.1.0",
|
|
58
58
|
"@types/sass-loader": "^8.0.9",
|
|
59
|
-
"@types/ws": "^8.18.
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
61
|
-
"@typescript-eslint/parser": "^8.
|
|
62
|
-
"@typescript-eslint/utils": "^8.
|
|
59
|
+
"@types/ws": "^8.18.1",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
61
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
62
|
+
"@typescript-eslint/utils": "^8.29.0",
|
|
63
63
|
"archiver": "^7.0.1",
|
|
64
64
|
"chalk": "^5.4.1",
|
|
65
65
|
"cli-table3": "^0.6.5",
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
"map-stream": "^0.0.7",
|
|
81
81
|
"mime-types": "^3.0.1",
|
|
82
82
|
"ora": "^8.2.0",
|
|
83
|
-
"react": "^19.
|
|
83
|
+
"react": "^19.1.0",
|
|
84
84
|
"react-i18next": "^15.4.1",
|
|
85
85
|
"react-object-model": "^1.2.23",
|
|
86
86
|
"resolve-path": "^1.4.0",
|
|
87
|
-
"sass": "^1.86.
|
|
87
|
+
"sass": "^1.86.2",
|
|
88
88
|
"sass-loader": "^16.0.5",
|
|
89
89
|
"source-map-loader": "^5.0.0",
|
|
90
90
|
"strip-ansi": "^7.1.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"tslib": "^2.8.1",
|
|
96
96
|
"typescript": "^5.8.2",
|
|
97
97
|
"ua-parser-js": "^2.0.3",
|
|
98
|
-
"undici": "^7.
|
|
98
|
+
"undici": "^7.7.0",
|
|
99
99
|
"vinyl": "^3.0.0",
|
|
100
100
|
"vinyl-fs": "^4.0.0",
|
|
101
101
|
"webpack": "^5.98.0",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
"@types/koa": "^2.15.0",
|
|
113
113
|
"@types/koa-compress": "^4.0.6",
|
|
114
114
|
"@types/mime-types": "^2.1.4",
|
|
115
|
-
"@types/node": "^22.
|
|
116
|
-
"@types/react": "^19.0
|
|
115
|
+
"@types/node": "^22.14.0",
|
|
116
|
+
"@types/react": "^19.1.0",
|
|
117
117
|
"@types/through2": "^2.0.41",
|
|
118
118
|
"@types/tough-cookie": "^4.0.5",
|
|
119
119
|
"@types/ua-parser-js": "^0.7.39",
|
package/process.d.ts
CHANGED
|
@@ -189,6 +189,7 @@ export declare function launch(exe: string, args?: string[], options?: CallOptio
|
|
|
189
189
|
export interface NodeJsOptions {
|
|
190
190
|
inspect?: number | true;
|
|
191
191
|
break?: boolean;
|
|
192
|
+
host?: string;
|
|
192
193
|
}
|
|
193
194
|
export interface CallNodeJsOptions extends CallOptions, NodeJsOptions {
|
|
194
195
|
}
|
|
@@ -203,7 +204,8 @@ export interface CallNodeJsOptions extends CallOptions, NodeJsOptions {
|
|
|
203
204
|
- stdio?: `'pipe'` 设置为 'ignore' 时忽略 stdio 处理
|
|
204
205
|
- throw_code?: `true` code 不为 0 时是否抛出异常
|
|
205
206
|
- inspect?: nodejs debugger port, 填 9229 端口 (或者传 true) 可以用临时配置来调试
|
|
206
|
-
- break?: break at first line
|
|
207
|
+
- break?: break at first line
|
|
208
|
+
- host?: 指定 inspect 监听的 host (默认监听 localhost) */
|
|
207
209
|
export declare function call_nodejs(js: string, args?: string[], options?: CallNodeJsOptions): Promise<CallResult<string>>;
|
|
208
210
|
export interface StartNodeJsOptions extends StartOptions, NodeJsOptions {
|
|
209
211
|
}
|
|
@@ -222,6 +224,7 @@ export declare function start_nodejs(js: string, args?: string[], options?: Star
|
|
|
222
224
|
- inspect?: nodejs debugger port, 填 9229 端口 (或者传 true) 可以用临时配置来调试
|
|
223
225
|
- break?: 在第一行停止 */
|
|
224
226
|
export declare function launch_nodejs(js: string, args?: string[], options?: CallNodeJsOptions): Promise<SubProcess<string>>;
|
|
227
|
+
export declare function get_nodejs_args(js: string, args?: string[], { inspect, break: _break, host }?: NodeJsOptions): string[];
|
|
225
228
|
/** 可选的向子进程输入内容,并等待子进程输出特定的内容,类似一次无返回值,仅有完成状态的 rpc 调用
|
|
226
229
|
根据文本内容匹配其实不太好,实在是没有别的 rpc 方法再使用吧
|
|
227
230
|
- ps: 子进程
|
package/process.js
CHANGED
|
@@ -310,7 +310,8 @@ export async function launch(exe, args, options) {
|
|
|
310
310
|
- stdio?: `'pipe'` 设置为 'ignore' 时忽略 stdio 处理
|
|
311
311
|
- throw_code?: `true` code 不为 0 时是否抛出异常
|
|
312
312
|
- inspect?: nodejs debugger port, 填 9229 端口 (或者传 true) 可以用临时配置来调试
|
|
313
|
-
- break?: break at first line
|
|
313
|
+
- break?: break at first line
|
|
314
|
+
- host?: 指定 inspect 监听的 host (默认监听 localhost) */
|
|
314
315
|
export async function call_nodejs(js, args, options) {
|
|
315
316
|
return call(exe_nodejs, get_nodejs_args(js, args, options), options);
|
|
316
317
|
}
|
|
@@ -333,10 +334,10 @@ export async function start_nodejs(js, args, options) {
|
|
|
333
334
|
export async function launch_nodejs(js, args, options) {
|
|
334
335
|
return launch(exe_nodejs, get_nodejs_args(js, args, options), options);
|
|
335
336
|
}
|
|
336
|
-
function get_nodejs_args(js, args = [], { inspect, break: _break } = {}) {
|
|
337
|
+
export function get_nodejs_args(js, args = [], { inspect, break: _break, host = 'localhost' } = {}) {
|
|
337
338
|
return [
|
|
338
339
|
'--enable-source-maps',
|
|
339
|
-
...inspect ? [`--inspect${_break ? '-brk' : ''}
|
|
340
|
+
...inspect ? [`--inspect${_break ? '-brk' : ''}=${host}:${inspect === true ? 9229 : inspect}`] : [],
|
|
340
341
|
js,
|
|
341
342
|
...args
|
|
342
343
|
];
|