xshell 1.3.60 → 1.3.63
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/antd.development.js +4105 -4328
- package/antd.development.js.map +1 -1
- package/antd.production.js +973 -1149
- package/antd.production.js.map +1 -1
- package/antd.sass +7 -0
- package/apps.js +1 -1
- package/builder.js +5 -5
- package/development.js +2 -2
- package/fflate.js +1 -1
- package/file.d.ts +4 -4
- package/file.js +7 -7
- package/fzip.js +4 -4
- package/git.d.ts +2 -2
- package/git.js +3 -3
- package/i18n/i18n-scan.js +2 -2
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +1 -1
- package/i18n/instance.js +1 -1
- package/i18n/rwdict.d.ts +9 -9
- package/i18n/rwdict.js +2 -2
- package/i18n/scanner/index.d.ts +3 -3
- package/i18n/scanner/index.js +8 -8
- package/i18n/scanner/parser.js +1 -1
- package/index.js +7 -7
- package/io.common.js +2 -2
- package/net.browser.js +4 -4
- package/net.common.d.ts +2 -2
- package/net.common.js +5 -5
- package/net.d.ts +12 -9
- package/net.js +17 -10
- package/package.json +11 -11
- package/platform.browser.js +4 -4
- package/platform.common.d.ts +2 -2
- package/platform.js +2 -2
- package/process.d.ts +3 -2
- package/process.js +4 -4
- package/prototype.browser.js +2 -2
- package/prototype.common.d.ts +8 -8
- package/prototype.common.js +2 -2
- package/prototype.js +3 -3
- package/react.development.js +35 -35
- package/react.development.js.map +1 -1
- package/react.production.js +34 -34
- package/react.production.js.map +1 -1
- package/repl.js +6 -13
- package/server.d.ts +2 -2
- package/server.js +5 -5
- package/storage.d.ts +1 -1
- package/toaster.browser.d.ts +2 -2
- package/toaster.browser.js +1 -1
- package/utils.browser.js +4 -4
- package/utils.common.d.ts +9 -8
- package/utils.common.js +15 -4
- package/utils.d.ts +6 -4
- package/utils.js +4 -4
- package/xlint.js +2 -2
- package/xshell.js +1 -1
package/repl.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
-
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
-
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
return path;
|
|
8
|
-
};
|
|
1
|
+
import { __rewriteRelativeImportExtension } from "tslib";
|
|
9
2
|
import repl from 'node:repl';
|
|
10
3
|
import process from 'node:process';
|
|
11
4
|
import { fileURLToPath } from 'url';
|
|
12
|
-
import { path } from
|
|
13
|
-
import { t } from
|
|
14
|
-
import
|
|
15
|
-
import { delay, set_inspect_options } from
|
|
5
|
+
import { path } from './path.js';
|
|
6
|
+
import { t } from './i18n/instance.js';
|
|
7
|
+
import './prototype.js';
|
|
8
|
+
import { delay, set_inspect_options } from './utils.js';
|
|
16
9
|
set_inspect_options();
|
|
17
10
|
let server;
|
|
18
11
|
/** 谨慎使用,webpack 打包后可能会变成 /d:/1/mod/node_modules/xshell/ 这样的编译期路径 */
|
|
@@ -36,7 +29,7 @@ export async function start_repl() {
|
|
|
36
29
|
pollute_global(),
|
|
37
30
|
(async () => {
|
|
38
31
|
// --- http server
|
|
39
|
-
let { Server } = await import(
|
|
32
|
+
let { Server } = await import('./server.js');
|
|
40
33
|
server = new Server({
|
|
41
34
|
name: 'repl',
|
|
42
35
|
http: true,
|
package/server.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export declare class Server {
|
|
|
145
145
|
)
|
|
146
146
|
return
|
|
147
147
|
} */
|
|
148
|
-
try_send(ctx: Context, fp: string, { fpd_root, assets_root, sea: _sea, log_404
|
|
148
|
+
try_send(ctx: Context, fp: string, { fpd_root, assets_root, sea: _sea, log_404 }?: {
|
|
149
149
|
fpd_root?: string;
|
|
150
150
|
assets_root?: string;
|
|
151
151
|
sea?: boolean;
|
|
@@ -188,5 +188,5 @@ export interface ServerRequestOptions {
|
|
|
188
188
|
throw_error?: boolean;
|
|
189
189
|
proxy?: RequestOptions['proxy'];
|
|
190
190
|
}
|
|
191
|
-
export declare const text_plain:
|
|
191
|
+
export declare const text_plain: 'text/plain; charset=utf-8';
|
|
192
192
|
export {};
|
package/server.js
CHANGED
|
@@ -11,11 +11,11 @@ import KoaCompress from 'koa-compress';
|
|
|
11
11
|
import resolve_safely from 'resolve-path';
|
|
12
12
|
import { contentType as get_content_type } from 'mime-types';
|
|
13
13
|
// --- my libs
|
|
14
|
-
import { t } from
|
|
15
|
-
import { request as _request, Remote, get_socket_ip } from
|
|
16
|
-
import { inspect, check, range_to_numbers, encode, filter_keys, filter_values, consume_stream, colored, url_width, defer2 } from
|
|
17
|
-
import { flist, fread, fstat } from
|
|
18
|
-
import { exe_nodejs, sea } from
|
|
14
|
+
import { t } from './i18n/instance.js';
|
|
15
|
+
import { request as _request, Remote, get_socket_ip } from './net.js';
|
|
16
|
+
import { inspect, check, range_to_numbers, encode, filter_keys, filter_values, consume_stream, colored, url_width, defer2 } from './utils.js';
|
|
17
|
+
import { flist, fread, fstat } from './file.js';
|
|
18
|
+
import { exe_nodejs, sea } from './process.js';
|
|
19
19
|
// ------------ my server
|
|
20
20
|
export class Server {
|
|
21
21
|
/** proxy 时需要丢弃的 resposne headers */
|
package/storage.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare let storage: {
|
|
|
13
13
|
get_bool(key: string): boolean | undefined;
|
|
14
14
|
};
|
|
15
15
|
export declare let db: {
|
|
16
|
-
store_name:
|
|
16
|
+
store_name: 'kv-store';
|
|
17
17
|
db: IDBDatabase;
|
|
18
18
|
wait_request<TResult>(request: IDBOpenDBRequest | IDBRequest): Promise<TResult>;
|
|
19
19
|
open(): Promise<void>;
|
package/toaster.browser.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './toaster.sass';
|
|
2
2
|
export declare let toaster: {
|
|
3
3
|
messages: string[];
|
|
4
|
-
state:
|
|
4
|
+
state: 'IDLE' | 'SHOW';
|
|
5
5
|
toast(message: string): Promise<void>;
|
|
6
6
|
show(): Promise<void>;
|
|
7
7
|
};
|
|
8
|
-
export declare const toast: (typeof toaster)[
|
|
8
|
+
export declare const toast: (typeof toaster)['toast'];
|
package/toaster.browser.js
CHANGED
package/utils.browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { delay } from
|
|
4
|
-
export * from
|
|
1
|
+
import './prototype.browser.js';
|
|
2
|
+
import './platform.browser.js';
|
|
3
|
+
import { delay } from './utils.common.js';
|
|
4
|
+
export * from './utils.common.js';
|
|
5
5
|
export async function pause(milliseconds = 3000) {
|
|
6
6
|
await delay(milliseconds);
|
|
7
7
|
debugger;
|
package/utils.common.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare function seq<T = number>(n: number, generator?: (index: number) =
|
|
|
21
21
|
- mapper?: 可以是 key (string, number, symbol) 或 (obj: any) => any */
|
|
22
22
|
export declare function unique<TObj>(iterable: TObj[] | Iterable<TObj>, mapper?: keyof TObj | Mapper<TObj>): TObj[];
|
|
23
23
|
/** 字符串字典序比较 */
|
|
24
|
-
export declare function strcmp(l: string, r: string):
|
|
24
|
+
export declare function strcmp(l: string, r: string): -1 | 0 | 1;
|
|
25
25
|
/** 排序对象中 keys 的顺序,返回新的对象 */
|
|
26
26
|
export declare function sort_keys<TObj>(obj: TObj): TObj;
|
|
27
27
|
/** 比较 1.10.02 这种版本号
|
|
@@ -50,14 +50,14 @@ export declare function filter_keys<TObj>(obj: TObj, filter: (key: string) => an
|
|
|
50
50
|
- filter?: `not_empty` */
|
|
51
51
|
export declare function filter_values<TObj extends Record<string, any>>(obj: TObj, filter?: (value: TObj[string]) => any): TObj;
|
|
52
52
|
/** 简单选择对象中的部分 keys, 返回新对象 */
|
|
53
|
-
export declare function pick<TObject = any>(obj: TObject, keys: (keyof TObject)[]):
|
|
53
|
+
export declare function pick<TObject = any>(obj: TObject, keys: (keyof TObject)[]): TObject;
|
|
54
54
|
/** 忽略对象中的 keys, 返回新对象 */
|
|
55
55
|
export declare function omit<TObj>(obj: TObj, omit_keys: string[] | Set<string>): TObj;
|
|
56
56
|
/** 拼接 TypedArrays 生成一个完整的 Uint8Array */
|
|
57
|
-
export declare function concat(arrays: ArrayBufferView[]): Uint8Array<
|
|
57
|
+
export declare function concat(arrays: ArrayBufferView[]): Uint8Array<ArrayBuffer>;
|
|
58
58
|
export declare let encoder: TextEncoder;
|
|
59
59
|
/** 将字符串简单的编码为 utf-8 的 buffer (Uint8Array)。高频使用或者在流式处理时,考虑使用 TextEncoder 的 encodeInto 方法 */
|
|
60
|
-
export declare function encode(str: string): Uint8Array<
|
|
60
|
+
export declare function encode(str: string): Uint8Array<ArrayBuffer>;
|
|
61
61
|
export declare function encode_into(str: string, buf: Uint8Array): TextEncoderEncodeIntoResult;
|
|
62
62
|
/** 将 utf-8 buffer (Uint8Array) 简单的解码为 string。
|
|
63
63
|
在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
|
|
@@ -101,11 +101,11 @@ export declare function invoke<TReturn = any>(obj: any, funcpath: string, args:
|
|
|
101
101
|
/** 时间间隔 (milliseconds) 格式化 */
|
|
102
102
|
export declare function delta2str(delta: number): string;
|
|
103
103
|
/** 默认日期时间格式 */
|
|
104
|
-
export declare const datetime_format:
|
|
104
|
+
export declare const datetime_format: 'YYYY.MM.DD HH:mm:ss';
|
|
105
105
|
/** 默认日期格式 */
|
|
106
|
-
export declare const date_format:
|
|
106
|
+
export declare const date_format: 'YYYY.MM.DD';
|
|
107
107
|
/** 默认时间格式 */
|
|
108
|
-
export declare const time_format:
|
|
108
|
+
export declare const time_format: 'HH:mm:ss';
|
|
109
109
|
export declare class Timer {
|
|
110
110
|
started: number;
|
|
111
111
|
ended: number;
|
|
@@ -124,7 +124,7 @@ export declare class Timer {
|
|
|
124
124
|
getstr_and_reset(parenthesis?: boolean): string;
|
|
125
125
|
}
|
|
126
126
|
export declare class TimeoutError extends Error {
|
|
127
|
-
name:
|
|
127
|
+
name: 'TimeoutError';
|
|
128
128
|
}
|
|
129
129
|
/** https://stackoverflow.com/questions/63297164/how-to-only-accept-arraybuffer-as-parameter */
|
|
130
130
|
export type StrictArrayBuffer = ArrayBuffer & {
|
|
@@ -192,6 +192,7 @@ export declare function to_csv_field(str: string): string;
|
|
|
192
192
|
export declare function set_error_message(error: Error, message: string): Error;
|
|
193
193
|
/** 比较两个数组中的元素完全相同,数组元素用引用比较 */
|
|
194
194
|
export declare function array_equals(a: any[], b: any[]): boolean;
|
|
195
|
+
/** - with_date?: `false` */
|
|
195
196
|
export declare function nowstr(with_date?: boolean): string;
|
|
196
197
|
export declare function has_chinese(str: string): boolean;
|
|
197
198
|
export declare function fold_spaces(str: string): string;
|
package/utils.common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t } from
|
|
2
|
-
import { is_key_type, noop, not_empty, select, to_snake_case } from
|
|
3
|
-
import { platform } from
|
|
1
|
+
import { t } from './i18n/instance.js';
|
|
2
|
+
import { is_key_type, noop, not_empty, select, to_snake_case } from './prototype.common.js';
|
|
3
|
+
import { platform } from './platform.common.js';
|
|
4
4
|
export async function delay(milliseconds, options) {
|
|
5
5
|
return platform.delay(milliseconds, options);
|
|
6
6
|
}
|
|
@@ -542,8 +542,18 @@ export function lowercase_first_letter(str) {
|
|
|
542
542
|
}
|
|
543
543
|
/** 大于 n 的最小的 2 的幂次 */
|
|
544
544
|
export function ceil2(n) {
|
|
545
|
-
|
|
545
|
+
// 位运算基于 32 位有符号整数,有效范围 [0, 2^31)
|
|
546
|
+
if (n < 2 ** 31) {
|
|
547
|
+
n |= n >> 1;
|
|
548
|
+
n |= n >> 2;
|
|
549
|
+
n |= n >> 4;
|
|
550
|
+
n |= n >> 8;
|
|
551
|
+
n |= n >> 16;
|
|
552
|
+
return n + 1;
|
|
553
|
+
}
|
|
554
|
+
// 超过 32 位范围,退化到翻倍法
|
|
546
555
|
// 不能用 power <<= 1, 结果可能会超过 32 bit 整数导致位运算溢出为 0,死循环
|
|
556
|
+
let power = 1;
|
|
547
557
|
for (; power <= n; power += power)
|
|
548
558
|
;
|
|
549
559
|
return power;
|
|
@@ -638,6 +648,7 @@ export function array_equals(a, b) {
|
|
|
638
648
|
return false;
|
|
639
649
|
return a.every((x, i) => x === b[i]);
|
|
640
650
|
}
|
|
651
|
+
/** - with_date?: `false` */
|
|
641
652
|
export function nowstr(with_date = false) {
|
|
642
653
|
const date = new Date();
|
|
643
654
|
return with_date ? date.to_str() : date.to_time_str();
|
package/utils.d.ts
CHANGED
|
@@ -21,14 +21,16 @@ export declare function inspect(obj: any, options?: util.InspectOptions & {
|
|
|
21
21
|
limit?: number;
|
|
22
22
|
omit?: string[];
|
|
23
23
|
}): string;
|
|
24
|
-
export declare namespace inspect {
|
|
25
|
-
var custom: typeof util.inspect.custom;
|
|
26
|
-
var defaultOptions: util.InspectOptions;
|
|
27
|
-
}
|
|
28
24
|
export interface inspect {
|
|
29
25
|
custom: typeof util.inspect.custom;
|
|
30
26
|
defaultOptions: typeof util.inspect.defaultOptions;
|
|
31
27
|
}
|
|
28
|
+
export declare namespace inspect {
|
|
29
|
+
var custom: symbol;
|
|
30
|
+
}
|
|
31
|
+
export declare namespace inspect {
|
|
32
|
+
var defaultOptions: util.InspectOptions;
|
|
33
|
+
}
|
|
32
34
|
/** 根据 enabled 选项返回有 / 无颜色的字符串 (str) */
|
|
33
35
|
export declare function colored(str: string, color: string, enabled?: boolean): any;
|
|
34
36
|
/** 消费一个可读流 */
|
package/utils.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Writable, Transform } from 'node:stream';
|
|
2
2
|
import util from 'node:util';
|
|
3
3
|
import ncrypto from 'node:crypto';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { assert, check, decode, defer } from
|
|
7
|
-
export * from
|
|
4
|
+
import './prototype.js';
|
|
5
|
+
import './platform.js';
|
|
6
|
+
import { assert, check, decode, defer } from './utils.common.js';
|
|
7
|
+
export * from './utils.common.js';
|
|
8
8
|
/** `180` 输出字符宽度 */
|
|
9
9
|
export const output_width = 180;
|
|
10
10
|
export const url_width = 52;
|
package/xlint.js
CHANGED
|
@@ -5,8 +5,8 @@ import TSParser from '@typescript-eslint/parser';
|
|
|
5
5
|
import ts_plugin from '@typescript-eslint/eslint-plugin';
|
|
6
6
|
import react_plugin from 'eslint-plugin-react';
|
|
7
7
|
import stylistic_plugin from '@stylistic/eslint-plugin';
|
|
8
|
-
import { array_equals, check } from
|
|
9
|
-
import { path } from
|
|
8
|
+
import { array_equals, check } from './utils.js';
|
|
9
|
+
import { path } from './path.js';
|
|
10
10
|
// 用 ast explorer 选 esprima 来看
|
|
11
11
|
// 或者 https://explorer.eslint.org/
|
|
12
12
|
// node.loc.start.line 下标从 1 开始
|
package/xshell.js
CHANGED