xshell 1.0.154 → 1.0.155
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/Terminal.js +1 -1
- package/builder.js +4 -0
- package/file.d.ts +11 -6
- package/file.js +12 -2
- package/package.json +6 -6
- package/process.js +2 -0
- package/utils.browser.d.ts +1 -1
- package/utils.d.ts +1 -1
package/Terminal.js
CHANGED
|
@@ -6,7 +6,7 @@ import { FitAddon } from '@xterm/addon-fit';
|
|
|
6
6
|
import { WebglAddon } from '@xterm/addon-webgl';
|
|
7
7
|
import { WebLinksAddon } from '@xterm/addon-web-links';
|
|
8
8
|
// 没有 ui
|
|
9
|
-
// import { SearchAddon } from 'xterm
|
|
9
|
+
// import { SearchAddon } from '@xterm/addon-search'
|
|
10
10
|
import { Model } from 'react-object-model';
|
|
11
11
|
import { assert, genid } from './utils.browser.js';
|
|
12
12
|
export function Terminal({ font }) {
|
package/builder.js
CHANGED
package/file.d.ts
CHANGED
|
@@ -114,6 +114,11 @@ export declare function fdelete(fp: string, { print }?: {
|
|
|
114
114
|
export declare function fdclear(fpd: string, { print }?: {
|
|
115
115
|
print?: boolean;
|
|
116
116
|
}): Promise<void>;
|
|
117
|
+
export interface FCopyOptions {
|
|
118
|
+
print?: boolean;
|
|
119
|
+
overwrite?: boolean;
|
|
120
|
+
filter?: (fp: string) => true | false | 'filter';
|
|
121
|
+
}
|
|
117
122
|
/** 复制文件或文件夹
|
|
118
123
|
会在因不存在父文件夹导致复制失败时,自动创建父文件夹,并再次尝试复制
|
|
119
124
|
最好预先创建父文件夹,减少文件系统操作,提升性能
|
|
@@ -122,15 +127,15 @@ export declare function fdclear(fpd: string, { print }?: {
|
|
|
122
127
|
- options?:
|
|
123
128
|
- print?: `true`
|
|
124
129
|
- overwrite?: `true`
|
|
125
|
-
- filter?: 当 fp_src
|
|
130
|
+
- filter?: 当 fp_src 为文件夹时选择性复制里面的部分内容,
|
|
131
|
+
和 flist 的 filter 选项不同,只支持函数,且函数返回值决定是否要继续进行过滤
|
|
132
|
+
- true: 复制文件夹的所有文件,交给 fsp.cp
|
|
133
|
+
- false 或不返回任何值: 不复制
|
|
134
|
+
- 'partial': 进一步进行过滤复制(先 flist with filter 再 fcopy),只有文件夹能返回这个值
|
|
126
135
|
|
|
127
136
|
@example
|
|
128
137
|
fcopy('D:/temp/camera/', 'D:/camera/') */
|
|
129
|
-
export declare function fcopy(fp_src: string, fp_dst: string, { print, overwrite, filter, }?:
|
|
130
|
-
print?: boolean;
|
|
131
|
-
overwrite?: boolean;
|
|
132
|
-
filter?: FListOptions['filter'];
|
|
133
|
-
}): Promise<void>;
|
|
138
|
+
export declare function fcopy(fp_src: string, fp_dst: string, { print, overwrite, filter, }?: FCopyOptions): Promise<void>;
|
|
134
139
|
/** 移动文件或文件夹
|
|
135
140
|
相同分区 / 文件系统下使用 rename, 否则 fallback 到复制后删除源文件
|
|
136
141
|
- src: 源 文件/文件夹 完整路径
|
package/file.js
CHANGED
|
@@ -238,7 +238,11 @@ export async function fdclear(fpd, { print = true } = {}) {
|
|
|
238
238
|
- options?:
|
|
239
239
|
- print?: `true`
|
|
240
240
|
- overwrite?: `true`
|
|
241
|
-
- filter?: 当 fp_src
|
|
241
|
+
- filter?: 当 fp_src 为文件夹时选择性复制里面的部分内容,
|
|
242
|
+
和 flist 的 filter 选项不同,只支持函数,且函数返回值决定是否要继续进行过滤
|
|
243
|
+
- true: 复制文件夹的所有文件,交给 fsp.cp
|
|
244
|
+
- false 或不返回任何值: 不复制
|
|
245
|
+
- 'partial': 进一步进行过滤复制(先 flist with filter 再 fcopy),只有文件夹能返回这个值
|
|
242
246
|
|
|
243
247
|
@example
|
|
244
248
|
fcopy('D:/temp/camera/', 'D:/camera/') */
|
|
@@ -254,7 +258,13 @@ export async function fcopy(fp_src, fp_dst, { print = true, overwrite = true, fi
|
|
|
254
258
|
if (filter) {
|
|
255
259
|
await fmkdir(fp_dst, { print });
|
|
256
260
|
await Promise.all((await flist(fp_src, { filter, print: false }))
|
|
257
|
-
.map(async (fname) => fcopy(fp_src
|
|
261
|
+
.map(async (fname) => fcopy(`${fp_src}${fname}`, `${fp_dst}${fname}`, {
|
|
262
|
+
print,
|
|
263
|
+
overwrite,
|
|
264
|
+
...fname.isdir && filter(fname) === 'filter' ? {
|
|
265
|
+
filter: fp => filter(`${fname}${fp}`),
|
|
266
|
+
} : {}
|
|
267
|
+
})));
|
|
258
268
|
}
|
|
259
269
|
else
|
|
260
270
|
await fsp.cp(fp_src, fp_dst, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.155",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"@svgr/webpack": "^8.1.0",
|
|
57
57
|
"@types/sass-loader": "^8.0.8",
|
|
58
58
|
"@types/ws": "^8.5.10",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
60
|
-
"@typescript-eslint/parser": "^7.
|
|
61
|
-
"@typescript-eslint/utils": "^7.
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
|
60
|
+
"@typescript-eslint/parser": "^7.14.1",
|
|
61
|
+
"@typescript-eslint/utils": "^7.14.1",
|
|
62
62
|
"@xterm/addon-fit": "^0.10.0",
|
|
63
63
|
"@xterm/addon-web-links": "^0.11.0",
|
|
64
64
|
"@xterm/addon-webgl": "^0.18.0",
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
"@types/gulp-sort": "^2.0.4",
|
|
124
124
|
"@types/koa": "^2.15.0",
|
|
125
125
|
"@types/koa-compress": "^4.0.6",
|
|
126
|
-
"@types/lodash": "^4.17.
|
|
126
|
+
"@types/lodash": "^4.17.6",
|
|
127
127
|
"@types/mime-types": "^2.1.4",
|
|
128
|
-
"@types/node": "^20.14.
|
|
128
|
+
"@types/node": "^20.14.9",
|
|
129
129
|
"@types/react": "^18.3.3",
|
|
130
130
|
"@types/through2": "^2.0.41",
|
|
131
131
|
"@types/tough-cookie": "^4.0.5",
|
package/process.js
CHANGED
|
@@ -188,6 +188,7 @@ export async function call(exe, args = [], options = {}) {
|
|
|
188
188
|
- break?: break at first line */
|
|
189
189
|
export async function call_nodejs(js, args = [], { inspect, break: _break, ...options } = {}) {
|
|
190
190
|
return call(exe_nodejs, [
|
|
191
|
+
'--enable-source-maps',
|
|
191
192
|
...inspect ? [`--inspect${_break ? '-brk' : ''}=localhost:${inspect}`] : [],
|
|
192
193
|
js,
|
|
193
194
|
...args
|
|
@@ -215,6 +216,7 @@ export async function term(exe, args = [], { cwd = process.cwd().fpd, print = tr
|
|
|
215
216
|
/** 在 term tab 中创建 node.exe 进程 */
|
|
216
217
|
export async function term_nodejs(fp_js, args = [], { title, inspect, tsnode = false, break: _break, resolve = false, trace_warnings = false, ...options } = {}) {
|
|
217
218
|
return term(exe_nodejs, [
|
|
219
|
+
'--enable-source-maps',
|
|
218
220
|
...trace_warnings ? ['--trace-warnings'] : [],
|
|
219
221
|
...resolve ? ['--experimental-specifier-resolution=node'] : [],
|
|
220
222
|
...title ? [`--title=${title}`] : [],
|
package/utils.browser.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export declare function encode(str: string): Uint8Array;
|
|
|
68
68
|
在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
|
|
69
69
|
export declare function decode(buffer: Uint8Array): string;
|
|
70
70
|
/** 字符串字典序比较 */
|
|
71
|
-
export declare function strcmp(l: string, r: string):
|
|
71
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
72
72
|
/** 比较 1.10.02 这种版本号 */
|
|
73
73
|
export declare function vercmp(l: string, r: string): number;
|
|
74
74
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|
package/utils.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare function filter_values<TObj extends Record<string, any>>(obj: TOb
|
|
|
37
37
|
/** 忽略对象中的 keys, 返回新对象 */
|
|
38
38
|
export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
|
|
39
39
|
/** 字符串字典序比较 */
|
|
40
|
-
export declare function strcmp(l: string, r: string):
|
|
40
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
41
41
|
/** 比较 1.10.02 这种版本号 */
|
|
42
42
|
export declare function vercmp(l: string, r: string): number;
|
|
43
43
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|