xshell 1.3.80 → 1.4.2

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/file.d.ts CHANGED
@@ -20,6 +20,10 @@ export declare const print_info_options: {
20
20
  export declare const binary_encoding: {
21
21
  readonly encoding: 'binary';
22
22
  };
23
+ export declare const binary_noprint: {
24
+ readonly encoding: 'binary';
25
+ readonly print: false;
26
+ };
23
27
  export declare const ramdisk: boolean;
24
28
  /** fp 所指向的 文件/ 文件夹 是否存在
25
29
  - print?: `true` */
package/file.js CHANGED
@@ -12,6 +12,7 @@ export const print_files = { info: true, files: true };
12
12
  export const print_info = { info: true, files: false };
13
13
  export const print_info_options = { print: print_info };
14
14
  export const binary_encoding = { encoding: 'binary' };
15
+ export const binary_noprint = { encoding: 'binary', print: false };
15
16
  export const ramdisk = fexists('T:/TEMP/', { print: false });
16
17
  /** fp 所指向的 文件/ 文件夹 是否存在
17
18
  - print?: `true` */
@@ -92,7 +93,7 @@ export async function fequals(fp_left, fp_right, { print = true } = {}) {
92
93
  const fps = [fp_left, fp_right];
93
94
  const [{ size: size_left }, { size: size_right }] = await Promise.all(fps.map(fp => fstat(fp)));
94
95
  if (size_left === size_right) {
95
- const [data_left, data_right] = await Promise.all(fps.map(fp => fread(fp, { encoding: 'binary', print: false })));
96
+ const [data_left, data_right] = await Promise.all(fps.map(fp => fread(fp, binary_noprint)));
96
97
  return data_left.equals(data_right);
97
98
  }
98
99
  else
@@ -283,7 +284,7 @@ export async function ffstat(handle) {
283
284
  - options?:
284
285
  - print?: `true` */
285
286
  export async function fdelete(fp, { print = true } = {}) {
286
- check(fp.length >= 6, `fp: ${fp} ${t('不能太短,防止误删文件')}`);
287
+ check(fp.length >= 6 || fp.startsWith('T:/2/'), `fp: ${fp} ${t('不能太短,防止误删文件')}`);
287
288
  check(path.isAbsolute(fp), t('fp 必须是绝对路径'));
288
289
  const { isdir } = fp;
289
290
  try {
@@ -345,7 +346,7 @@ export async function fcopy(fp_src, fp_dst, { print = true, overwrite = true, fi
345
346
  if (filter) {
346
347
  await fmkdir(fp_dst, { print });
347
348
  await Promise.all((await flist(fp_src, { filter, print: false }))
348
- .map(async (fname) => fcopy(`${fp_src}${fname}`, `${fp_dst}${fname}`, {
349
+ .map(fname => fcopy(`${fp_src}${fname}`, `${fp_dst}${fname}`, {
349
350
  print,
350
351
  overwrite,
351
352
  ...fname.isdir && filter(fname) === 'filter' ? {
@@ -545,7 +546,7 @@ async function _unzip(zip, fpd_out, { encoding = 'utf-8', dryrun = false, print
545
546
  else if (typeof zip === 'string') {
546
547
  check(['zip', 'apk', 'crx', 'vsix'].includes(zip.fext), 'fp_src 应该以 zip 等后缀结尾');
547
548
  fp_zip = zip;
548
- zip = await fread(zip, { encoding: 'binary', print: false });
549
+ zip = await fread(zip, binary_noprint);
549
550
  }
550
551
  if (print.info)
551
552
  log_action(`开始${dryrun ? '测试' : ''}解压`, `${fp_zip} (${zip.length.to_fsize_str()})`, str_out);
package/net.d.ts CHANGED
@@ -8,7 +8,6 @@ import { type BasicAuth, type BearerAuth } from './net.common.ts';
8
8
  export * from './net.common.ts';
9
9
  export declare const MyProxy: {
10
10
  readonly socks5: 'http://127.0.0.1:10080';
11
- readonly whistle: 'http://localhost:8899';
12
11
  readonly work: 'http://localhost:10090';
13
12
  /** 需要先启动 server.start_tunnel_server('ddb.test.proxy') */
14
13
  readonly test: 'http://localhost:10091';
@@ -25,7 +24,6 @@ export type { Cookie };
25
24
  export interface RawResponse {
26
25
  status: number;
27
26
  headers: Record<string, string>;
28
- /** 需要注意返回的 Readable 调用 setEncoding 无效 */
29
27
  body: Readable;
30
28
  }
31
29
  export interface FullResponse<TBody extends Buffer | string> {
@@ -75,7 +73,6 @@ export declare class StatusCodeError extends Error {
75
73
  constructor(status: number, url: string);
76
74
  }
77
75
  /** 发起 http 请求,返回响应
78
- 注意: RawResponse 的 body.setEncoding 无效,总是读取到 Buffer
79
76
  - url: 必须是完整 url
80
77
  - options?:
81
78
  - method?: `有 body 时为 POST, 否则为 GET` 'GET' | 'POST' | ··
package/net.js CHANGED
@@ -8,7 +8,6 @@ import { drop_request_headers } from './net.common.js';
8
8
  export * from './net.common.js';
9
9
  export const MyProxy = {
10
10
  socks5: 'http://127.0.0.1:10080',
11
- whistle: 'http://localhost:8899',
12
11
  work: 'http://localhost:10090',
13
12
  /** 需要先启动 server.start_tunnel_server('ddb.test.proxy') */
14
13
  test: 'http://localhost:10091'
@@ -23,7 +22,7 @@ export const cookies = {
23
22
  return;
24
23
  const { MemoryCookieStore, CookieJar } = await import('tough-cookie');
25
24
  this.jar = new CookieJar(this.store = new MemoryCookieStore());
26
- },
25
+ }
27
26
  };
28
27
  let undici;
29
28
  let dispatchers = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.3.80",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -48,62 +48,53 @@
48
48
  ]
49
49
  },
50
50
  "dependencies": {
51
- "@babel/core": "^7.29.7",
52
- "@babel/parser": "^7.29.7",
53
- "@babel/traverse": "^7.29.7",
51
+ "@babel/core": "7.29.7",
52
+ "@babel/parser": "7.29.7",
53
+ "@babel/traverse": "7.29.7",
54
54
  "@koa/cors": "^5.0.0",
55
55
  "@stylistic/eslint-plugin": "^5.10.0",
56
- "@svgr/webpack": "^8.1.0",
57
- "@types/sass-loader": "^8.0.10",
58
- "@typescript-eslint/eslint-plugin": "^8.61.0",
59
- "@typescript-eslint/parser": "^8.61.0",
60
- "@typescript-eslint/utils": "^8.61.0",
56
+ "@svgr/core": "^8.1.0",
57
+ "@svgr/plugin-jsx": "^8.1.0",
58
+ "@svgr/plugin-svgo": "^8.1.0",
59
+ "@typescript-eslint/eslint-plugin": "^8.61.1",
60
+ "@typescript-eslint/parser": "^8.61.1",
61
+ "@typescript-eslint/utils": "^8.61.1",
61
62
  "archiver": "^8.0.0",
62
63
  "chalk": "^5.6.2",
63
64
  "commander": "^15.0.0",
64
- "css-loader": "^7.1.4",
65
65
  "emoji-regex": "^10.6.0",
66
- "eslint": "^10.4.1",
66
+ "eslint": "^10.5.0",
67
67
  "eslint-plugin-react": "^7.37.5",
68
68
  "https-proxy-agent": "9.0.0",
69
69
  "i18next": "25.8.1",
70
70
  "i18next-scanner": "^4.6.0",
71
71
  "koa": "^3.2.1",
72
- "koa-compress": "^5.2.1",
73
- "license-webpack-plugin": "^4.0.2",
74
- "mime-types": "^3.0.2",
72
+ "koa-compress": "^5.2.2",
73
+ "mrmime": "^2.0.1",
75
74
  "p-map": "^7.0.4",
76
75
  "react": "^19.2.7",
77
76
  "react-i18next": "^17.0.8",
78
77
  "resolve-path": "^1.4.0",
78
+ "rolldown": "^1.1.2",
79
+ "rollup-plugin-visualizer": "^7.0.1",
79
80
  "sass": "^1.101.0",
80
- "sass-loader": "^17.0.0",
81
- "source-map-loader": "^5.0.0",
82
81
  "strip-ansi": "^7.2.0",
83
- "style-loader": "^4.0.0",
84
82
  "tough-cookie": "^6.0.1",
85
- "ts-loader": "^9.6.0",
86
- "tslib": "^2.8.1",
87
83
  "typescript": "^6.0.3",
88
- "undici": "^8.4.1",
89
- "webpack": "5.106.2",
90
- "webpack-bundle-analyzer": "^5.3.0",
84
+ "undici": "^8.5.0",
91
85
  "ws": "^8.21.0"
92
86
  },
93
87
  "devDependencies": {
94
- "@babel/types": "^7.29.7",
88
+ "@babel/types": "7.29.7",
95
89
  "@types/archiver": "^8.0.0",
96
- "@types/babel__traverse": "^7.28.0",
90
+ "@types/babel__traverse": "7.28.0",
97
91
  "@types/eslint": "^9.6.1",
98
92
  "@types/estree": "^1.0.9",
99
93
  "@types/koa": "^3.0.3",
100
94
  "@types/koa-compress": "^4.0.7",
101
- "@types/mime-types": "^3.0.1",
102
- "@types/node": "^25.9.3",
95
+ "@types/node": "^26.0.0",
103
96
  "@types/react": "^19.2.17",
104
- "@types/tough-cookie": "^4.0.5",
105
- "@types/vscode": "^1.120.0",
106
- "@types/webpack-bundle-analyzer": "^4.7.0",
97
+ "@types/vscode": "^1.125.0",
107
98
  "@types/ws": "^8.18.1"
108
99
  }
109
100
  }
@@ -653,7 +653,8 @@ export function byte_size(bytes) {
653
653
  const sign = bytes < 0 ? '-' : '';
654
654
  bytes = Math.abs(bytes);
655
655
  const { unit, start } = bytes_table.find(range => range.start <= bytes && bytes < range.end);
656
- return `${sign}${(start === 0 ? bytes : bytes / start).toFixed()} ${unit}`;
656
+ const v = bytes / (start === 0 ? 1 : start);
657
+ return `${sign}${v.toFixed((unit === 'mb' || unit === 'gb') && v < 10 ? 1 : 0)} ${unit}`;
657
658
  }
658
659
  export function is_codepoint_fullwidth(codepoint) {
659
660
  // code points are derived from:
package/prototype.js CHANGED
@@ -38,7 +38,7 @@ if (!globalThis.my_prototype_defined) {
38
38
  configurable: true,
39
39
  ...util.styleText ? {
40
40
  get() {
41
- return util.styleText(style, this, { validateStream: false });
41
+ return util.styleText(style, String(this), { validateStream: false });
42
42
  }
43
43
  } : {
44
44
  get() {