xshell 1.0.167 → 1.0.169
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 +1 -0
- package/git.d.ts +1 -1
- package/git.js +2 -0
- package/package.json +10 -10
- package/process.js +2 -2
- package/prototype.browser.d.ts +1 -1
- package/prototype.d.ts +1 -1
- package/utils.browser.d.ts +12 -1
- package/utils.browser.js +17 -3
- package/utils.d.ts +12 -1
- package/utils.js +17 -3
package/file.d.ts
CHANGED
package/git.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare class Git {
|
|
|
4
4
|
cwd: string;
|
|
5
5
|
constructor(cwd: string);
|
|
6
6
|
static init(cwd: string, print?: boolean): Promise<Git>;
|
|
7
|
-
static clone(repo: string, fpd: string, shallow?: boolean): Promise<void>;
|
|
7
|
+
static clone(repo: string, fpd: string, shallow?: boolean | string): Promise<void>;
|
|
8
8
|
call(args?: any[], { color, print, printers }?: {
|
|
9
9
|
color?: boolean;
|
|
10
10
|
print?: CallOptions['print'];
|
package/git.js
CHANGED
|
@@ -16,6 +16,7 @@ export class Git {
|
|
|
16
16
|
await new this(fpd)
|
|
17
17
|
.call([
|
|
18
18
|
'clone',
|
|
19
|
+
...typeof shallow === 'string' ? ['--branch', shallow, '--single-branch'] : [],
|
|
19
20
|
...shallow ? ['--depth', '1'] : [],
|
|
20
21
|
repo,
|
|
21
22
|
'.'
|
|
@@ -27,6 +28,7 @@ export class Git {
|
|
|
27
28
|
'-c', 'color.status=false',
|
|
28
29
|
'-c', 'color.ui=false',
|
|
29
30
|
'-c', 'color.branch=false',
|
|
31
|
+
'-c', 'color.diff=false',
|
|
30
32
|
],
|
|
31
33
|
...args,
|
|
32
34
|
], {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.169",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@svgr/webpack": "^8.1.0",
|
|
58
58
|
"@types/sass-loader": "^8.0.9",
|
|
59
59
|
"@types/ws": "^8.5.12",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
61
|
-
"@typescript-eslint/parser": "^8.
|
|
62
|
-
"@typescript-eslint/utils": "^8.
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^8.6.0",
|
|
61
|
+
"@typescript-eslint/parser": "^8.6.0",
|
|
62
|
+
"@typescript-eslint/utils": "^8.6.0",
|
|
63
63
|
"@xterm/addon-fit": "^0.10.0",
|
|
64
64
|
"@xterm/addon-web-links": "^0.11.0",
|
|
65
65
|
"@xterm/addon-webgl": "^0.18.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"emoji-regex": "^10.4.0",
|
|
78
78
|
"eslint": "^9.10.0",
|
|
79
79
|
"eslint-plugin-import": "^2.30.0",
|
|
80
|
-
"eslint-plugin-react": "^7.
|
|
80
|
+
"eslint-plugin-react": "^7.36.1",
|
|
81
81
|
"gulp-sort": "^2.0.0",
|
|
82
82
|
"hash-string": "^1.0.0",
|
|
83
83
|
"https-proxy-agent": "^7.0.5",
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
"mime-types": "^2.1.35",
|
|
92
92
|
"ora": "^8.1.0",
|
|
93
93
|
"react": "^18.3.1",
|
|
94
|
-
"react-i18next": "^15.0.
|
|
94
|
+
"react-i18next": "^15.0.2",
|
|
95
95
|
"react-object-model": "^1.2.13",
|
|
96
96
|
"resolve-path": "^1.4.0",
|
|
97
|
-
"sass": "^1.
|
|
97
|
+
"sass": "^1.79.1",
|
|
98
98
|
"sass-loader": "^16.0.1",
|
|
99
99
|
"source-map-loader": "^5.0.0",
|
|
100
100
|
"strip-ansi": "^7.1.0",
|
|
@@ -120,14 +120,14 @@
|
|
|
120
120
|
"@types/byte-size": "^8.1.2",
|
|
121
121
|
"@types/chardet": "^0.8.3",
|
|
122
122
|
"@types/eslint": "^9.6.1",
|
|
123
|
-
"@types/estree": "^1.0.
|
|
123
|
+
"@types/estree": "^1.0.6",
|
|
124
124
|
"@types/gulp-sort": "^2.0.4",
|
|
125
125
|
"@types/koa": "^2.15.0",
|
|
126
126
|
"@types/koa-compress": "^4.0.6",
|
|
127
127
|
"@types/lodash": "^4.17.7",
|
|
128
128
|
"@types/mime-types": "^2.1.4",
|
|
129
|
-
"@types/node": "^22.5.
|
|
130
|
-
"@types/react": "^18.3.
|
|
129
|
+
"@types/node": "^22.5.5",
|
|
130
|
+
"@types/react": "^18.3.7",
|
|
131
131
|
"@types/through2": "^2.0.41",
|
|
132
132
|
"@types/tough-cookie": "^4.0.5",
|
|
133
133
|
"@types/ua-parser-js": "^0.7.39",
|
package/process.js
CHANGED
|
@@ -226,10 +226,10 @@ export async function term(exe, args = [], { cwd = process.cwd().fpd, print = tr
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
/** 在 term tab 中创建 node.exe 进程 */
|
|
229
|
-
export async function term_nodejs(fp_js, args = [], { title, inspect, tsnode = false, break: _break, resolve = false, trace_warnings
|
|
229
|
+
export async function term_nodejs(fp_js, args = [], { title, inspect, tsnode = false, break: _break, resolve = false, trace_warnings, ...options } = {}) {
|
|
230
230
|
return term(exe_nodejs, [
|
|
231
231
|
'--enable-source-maps',
|
|
232
|
-
...trace_warnings ? ['--trace-warnings'] : [],
|
|
232
|
+
...trace_warnings ?? inspect ? ['--trace-warnings'] : [],
|
|
233
233
|
...resolve ? ['--experimental-specifier-resolution=node'] : [],
|
|
234
234
|
...title ? [`--title=${title}`] : [],
|
|
235
235
|
...inspect ? [`--inspect${_break ? '-brk' : ''}=localhost:${inspect}`] : [],
|
package/prototype.browser.d.ts
CHANGED
|
@@ -137,7 +137,7 @@ declare global {
|
|
|
137
137
|
interface Array<T> {
|
|
138
138
|
/** 等价于 .at(-1) */
|
|
139
139
|
last: T;
|
|
140
|
-
indent(this: string[], width
|
|
140
|
+
indent(this: string[], width?: number, c?: string): string[];
|
|
141
141
|
/**
|
|
142
142
|
- trim_line?: `true`
|
|
143
143
|
- rm_empty_lines?: `true`
|
package/prototype.d.ts
CHANGED
|
@@ -161,7 +161,7 @@ declare global {
|
|
|
161
161
|
/** 等价于 .at(-1) */
|
|
162
162
|
last: T;
|
|
163
163
|
log(this: string[], limit?: number): void;
|
|
164
|
-
indent(this: string[], width
|
|
164
|
+
indent(this: string[], width?: number, c?: string): string[];
|
|
165
165
|
indent2to4(this: string[]): string[];
|
|
166
166
|
/**
|
|
167
167
|
- trim_line?: `true`
|
package/utils.browser.d.ts
CHANGED
|
@@ -2,7 +2,12 @@ export declare const noop: () => void;
|
|
|
2
2
|
/** value 不为 null 或 undefined */
|
|
3
3
|
export declare const not_empty: (value: any) => boolean;
|
|
4
4
|
export declare function assert(assertion: any, message?: string): never | void;
|
|
5
|
-
|
|
5
|
+
/** 通过 console.log 打印对象并返回
|
|
6
|
+
@example
|
|
7
|
+
log('label', obj)
|
|
8
|
+
log(obj) */
|
|
9
|
+
export declare function log<TObj>(obj: TObj): TObj;
|
|
10
|
+
export declare function log<TObj>(label: string, obj: TObj): TObj;
|
|
6
11
|
/** 数组或 iterable 去重(可按 selector 去重),重复值保留最后出现的那个
|
|
7
12
|
- selector?: 可以是 key (string) 或 (obj: any) => any */
|
|
8
13
|
export declare function unique<TObj>(iterable: TObj[] | Iterable<TObj>, selector?: string | ((obj: TObj) => any)): TObj[];
|
|
@@ -84,6 +89,12 @@ export declare function concat(arrays: ArrayBufferView[]): Uint8Array;
|
|
|
84
89
|
export declare function delta2str(delta: number): string;
|
|
85
90
|
/** generate random id */
|
|
86
91
|
export declare function genid(): number;
|
|
92
|
+
/** 默认日期时间格式 */
|
|
93
|
+
export declare const datetime_format: "YYYY.MM.DD HH:mm:ss";
|
|
94
|
+
/** 默认日期格式 */
|
|
95
|
+
export declare const date_format: "YYYY.MM.DD";
|
|
96
|
+
/** 默认时间格式 */
|
|
97
|
+
export declare const time_format: "HH:mm:ss";
|
|
87
98
|
export declare class Timer {
|
|
88
99
|
started: number;
|
|
89
100
|
ended: number;
|
package/utils.browser.js
CHANGED
|
@@ -8,9 +8,17 @@ export function assert(assertion, message) {
|
|
|
8
8
|
throw Object.assign(new Error(`断言失败: ${message ? `${message}: ` : ''}${assertion}`), { assertion });
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
export function log(
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export function log(...args) {
|
|
12
|
+
if (args.length === 2) {
|
|
13
|
+
const [label, obj] = args;
|
|
14
|
+
console.log(`${label}:`, obj);
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
const obj = args[0];
|
|
19
|
+
console.log(obj);
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
14
22
|
}
|
|
15
23
|
/** 数组或 iterable 去重(可按 selector 去重),重复值保留最后出现的那个
|
|
16
24
|
- selector?: 可以是 key (string) 或 (obj: any) => any */
|
|
@@ -258,6 +266,12 @@ export function delta2str(delta) {
|
|
|
258
266
|
export function genid() {
|
|
259
267
|
return Math.random() * 2 ** 53;
|
|
260
268
|
}
|
|
269
|
+
/** 默认日期时间格式 */
|
|
270
|
+
export const datetime_format = 'YYYY.MM.DD HH:mm:ss';
|
|
271
|
+
/** 默认日期格式 */
|
|
272
|
+
export const date_format = 'YYYY.MM.DD';
|
|
273
|
+
/** 默认时间格式 */
|
|
274
|
+
export const time_format = 'HH:mm:ss';
|
|
261
275
|
export class Timer {
|
|
262
276
|
started = new Date().getTime();
|
|
263
277
|
ended;
|
package/utils.d.ts
CHANGED
|
@@ -10,7 +10,12 @@ export declare const not_empty: (value: any) => boolean;
|
|
|
10
10
|
export declare const output_width = 230;
|
|
11
11
|
export declare function set_inspect_options(colors?: boolean): void;
|
|
12
12
|
export declare function assert(assertion: any, message?: string): never | void;
|
|
13
|
-
|
|
13
|
+
/** 通过 console.log 打印对象并返回
|
|
14
|
+
@example
|
|
15
|
+
log('label', obj)
|
|
16
|
+
log(obj) */
|
|
17
|
+
export declare function log<TObj>(obj: TObj): TObj;
|
|
18
|
+
export declare function log<TObj>(label: string, obj: TObj): TObj;
|
|
14
19
|
/** 生成 0, 1, ..., n - 1 (不包括 n) 的数组,支持传入 generator 函数,通过 index 生成各个元素
|
|
15
20
|
@example seq(10, i => `item-${i}`) */
|
|
16
21
|
export declare function seq<T = number>(n: number, generator?: (index: number) => T): T[];
|
|
@@ -52,6 +57,12 @@ export declare function typed_array_to_buffer(view: ArrayBufferView): Buffer;
|
|
|
52
57
|
export declare function delta2str(delta: number): string;
|
|
53
58
|
/** generate random id */
|
|
54
59
|
export declare function genid(): number;
|
|
60
|
+
/** 默认日期时间格式 */
|
|
61
|
+
export declare const datetime_format: "YYYY.MM.DD HH:mm:ss";
|
|
62
|
+
/** 默认日期格式 */
|
|
63
|
+
export declare const date_format: "YYYY.MM.DD";
|
|
64
|
+
/** 默认时间格式 */
|
|
65
|
+
export declare const time_format: "HH:mm:ss";
|
|
55
66
|
export declare class Timer {
|
|
56
67
|
started: number;
|
|
57
68
|
ended: number;
|
package/utils.js
CHANGED
|
@@ -30,9 +30,17 @@ export function assert(assertion, message) {
|
|
|
30
30
|
throw Object.assign(new Error(`${t('断言失败')}: ${message ? `${message}: ` : ''}${inspect(assertion, { colors: false, compact: true })}`), { assertion });
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
export function log(
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
export function log(...args) {
|
|
34
|
+
if (args.length === 2) {
|
|
35
|
+
const [label, obj] = args;
|
|
36
|
+
console.log(`${label}:`, obj);
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const obj = args[0];
|
|
41
|
+
console.log(obj);
|
|
42
|
+
return obj;
|
|
43
|
+
}
|
|
36
44
|
}
|
|
37
45
|
/** 生成 0, 1, ..., n - 1 (不包括 n) 的数组,支持传入 generator 函数,通过 index 生成各个元素
|
|
38
46
|
@example seq(10, i => `item-${i}`) */
|
|
@@ -176,6 +184,12 @@ export function delta2str(delta) {
|
|
|
176
184
|
export function genid() {
|
|
177
185
|
return Math.random() * 2 ** 53;
|
|
178
186
|
}
|
|
187
|
+
/** 默认日期时间格式 */
|
|
188
|
+
export const datetime_format = 'YYYY.MM.DD HH:mm:ss';
|
|
189
|
+
/** 默认日期格式 */
|
|
190
|
+
export const date_format = 'YYYY.MM.DD';
|
|
191
|
+
/** 默认时间格式 */
|
|
192
|
+
export const time_format = 'HH:mm:ss';
|
|
179
193
|
export class Timer {
|
|
180
194
|
started = new Date().getTime();
|
|
181
195
|
ended;
|