xshell 1.0.165 → 1.0.167

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 CHANGED
@@ -3,7 +3,7 @@ import type OSS from 'ali-oss';
3
3
  import { type CallOptions } from './process.js';
4
4
  export declare let npm: {
5
5
  bin: string;
6
- call(cwd: string, bin: string, args: string[], options?: CallOptions): Promise<import("./process.js").CallResult<string>>;
6
+ call(cwd: string, bin: string, args: string[], options?: CallOptions): Promise<import("./process.ts").CallResult<string>>;
7
7
  /** node.exe E:/sdk/nodejs/node_modules/corepack/dist/pnpm.js install
8
8
  - cwd
9
9
  - pkgs?: `[ ]` */
@@ -25,7 +25,7 @@ export declare let npm: {
25
25
  export declare function tsc(fpd: string, { tsconfig, typecheck, }?: {
26
26
  tsconfig?: string;
27
27
  typecheck?: boolean;
28
- }): Promise<import("./process.js").CallResult<string>>;
28
+ }): Promise<import("./process.ts").CallResult<string>>;
29
29
  export declare let oss: {
30
30
  client: OSS;
31
31
  bucket: string;
package/git.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare class Git {
9
9
  color?: boolean;
10
10
  print?: CallOptions['print'];
11
11
  printers?: CallOptions['printers'];
12
- }): Promise<import("./process.js").CallResult<string>>;
12
+ }): Promise<import("./process.ts").CallResult<string>>;
13
13
  get_branch(): Promise<string>;
14
14
  /** - print: `true` */
15
15
  get_branches(print?: boolean): Promise<string[]>;
@@ -19,7 +19,7 @@ export declare class Git {
19
19
  n?: number;
20
20
  graph?: boolean;
21
21
  format?: string;
22
- }): Promise<import("./process.js").CallResult<string>>;
22
+ }): Promise<import("./process.ts").CallResult<string>>;
23
23
  get_last_commits(n?: number): Promise<{
24
24
  time: Date;
25
25
  commiter: string;
@@ -1,9 +1,9 @@
1
1
  import { I18N } from './index.js';
2
2
  export declare let i18n: I18N;
3
3
  declare const t: (text: string, options?: {
4
- language?: import("./index.js").Language;
4
+ language?: import("./index.ts").Language;
5
5
  context?: string;
6
6
  count?: number;
7
7
  [key: string]: any;
8
- }) => string, language: import("./index.js").Language;
8
+ }) => string, language: import("./index.ts").Language;
9
9
  export { t, language };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.165",
3
+ "version": "1.0.167",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -53,13 +53,13 @@
53
53
  "@babel/parser": "^7.25.6",
54
54
  "@babel/traverse": "^7.25.6",
55
55
  "@koa/cors": "^5.0.0",
56
- "@stylistic/eslint-plugin": "^2.7.2",
56
+ "@stylistic/eslint-plugin": "^2.8.0",
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.3.0",
61
- "@typescript-eslint/parser": "^8.3.0",
62
- "@typescript-eslint/utils": "^8.3.0",
60
+ "@typescript-eslint/eslint-plugin": "^8.5.0",
61
+ "@typescript-eslint/parser": "^8.5.0",
62
+ "@typescript-eslint/utils": "^8.5.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",
@@ -75,13 +75,13 @@
75
75
  "commander": "^12.1.0",
76
76
  "css-loader": "^7.1.2",
77
77
  "emoji-regex": "^10.4.0",
78
- "eslint": "^9.9.1",
79
- "eslint-plugin-import": "^2.29.1",
80
- "eslint-plugin-react": "^7.35.0",
78
+ "eslint": "^9.10.0",
79
+ "eslint-plugin-import": "^2.30.0",
80
+ "eslint-plugin-react": "^7.35.2",
81
81
  "gulp-sort": "^2.0.0",
82
82
  "hash-string": "^1.0.0",
83
83
  "https-proxy-agent": "^7.0.5",
84
- "i18next": "^23.14.0",
84
+ "i18next": "^23.15.1",
85
85
  "i18next-scanner": "^4.5.0",
86
86
  "koa": "^2.15.3",
87
87
  "koa-compress": "^5.1.1",
@@ -94,7 +94,7 @@
94
94
  "react-i18next": "^15.0.1",
95
95
  "react-object-model": "^1.2.13",
96
96
  "resolve-path": "^1.4.0",
97
- "sass": "^1.77.8",
97
+ "sass": "^1.78.0",
98
98
  "sass-loader": "^16.0.1",
99
99
  "source-map-loader": "^5.0.0",
100
100
  "strip-ansi": "^7.1.0",
@@ -103,7 +103,7 @@
103
103
  "tough-cookie": "^5.0.0-rc.4",
104
104
  "ts-loader": "^9.5.1",
105
105
  "tslib": "^2.7.0",
106
- "typescript": "^5.5.4",
106
+ "typescript": "^5.6.2",
107
107
  "ua-parser-js": "^2.0.0-beta.3",
108
108
  "undici": "^6.19.8",
109
109
  "vinyl": "^3.0.0",
@@ -126,13 +126,13 @@
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.2",
129
+ "@types/node": "^22.5.4",
130
130
  "@types/react": "^18.3.5",
131
131
  "@types/through2": "^2.0.41",
132
132
  "@types/tough-cookie": "^4.0.5",
133
133
  "@types/ua-parser-js": "^0.7.39",
134
134
  "@types/vinyl-fs": "^3.0.5",
135
- "@types/vscode": "^1.92.0",
135
+ "@types/vscode": "^1.93.0",
136
136
  "@types/webpack-bundle-analyzer": "^4.7.0"
137
137
  },
138
138
  "pnpm": {
@@ -449,8 +449,9 @@ Object.defineProperties(Array.prototype, {
449
449
  }
450
450
  return lines;
451
451
  },
452
- indent(width, character = ' ') {
453
- return this.map(line => character.repeat(width) + line);
452
+ indent(width = 4, character = ' ') {
453
+ const indent = character.repeat(width);
454
+ return this.map(line => indent + line);
454
455
  },
455
456
  join_lines(append = true) {
456
457
  return `${this.join('\n')}${append ? '\n' : ''}`;
package/prototype.js CHANGED
@@ -498,8 +498,9 @@ if (!globalThis.my_prototype_defined) {
498
498
  split_indents() {
499
499
  return this.map(line => line.split_indent());
500
500
  },
501
- indent(width, character = ' ') {
502
- return this.map(line => character.repeat(width) + line);
501
+ indent(width = 4, character = ' ') {
502
+ const indent = character.repeat(width);
503
+ return this.map(line => indent + line);
503
504
  },
504
505
  indent2to4() {
505
506
  return this.split_indents()
@@ -92,7 +92,13 @@ export declare class Timer {
92
92
  /** 如果秒表未停止,获取当前秒表读数;
93
93
  如果秒表已停止,获取停止时的秒表读数; */
94
94
  get(): number;
95
- getstr(): string;
95
+ /** 获取时间表示字符串,如 1.2 s
96
+ - parenthesis?: `true` 字符串前后加上括号,如 (1.2 s) */
97
+ getstr(parenthesis?: boolean): string;
96
98
  print(): void;
99
+ /** 重置 started */
100
+ reset(): void;
101
+ get_and_reset(): number;
102
+ getstr_and_reset(parenthesis?: boolean): string;
97
103
  }
98
104
  export declare function lowercase_first_letter(str: string): string;
package/utils.browser.js CHANGED
@@ -270,11 +270,32 @@ export class Timer {
270
270
  get() {
271
271
  return (this.ended || new Date().getTime()) - this.started;
272
272
  }
273
- getstr() {
274
- return `(${delta2str(this.get())})`;
273
+ /** 获取时间表示字符串,如 1.2 s
274
+ - parenthesis?: `true` 字符串前后加上括号,如 (1.2 s) */
275
+ getstr(parenthesis = false) {
276
+ let s = delta2str(this.get());
277
+ if (parenthesis)
278
+ return s.bracket();
279
+ else
280
+ return s;
275
281
  }
276
282
  print() {
277
- console.log(this.getstr());
283
+ console.log(this.getstr(true));
284
+ }
285
+ /** 重置 started */
286
+ reset() {
287
+ this.started = new Date().getTime();
288
+ this.ended = null;
289
+ }
290
+ get_and_reset() {
291
+ const result = this.get();
292
+ this.reset();
293
+ return result;
294
+ }
295
+ getstr_and_reset(parenthesis) {
296
+ const result = this.getstr(parenthesis);
297
+ this.reset();
298
+ return result;
278
299
  }
279
300
  }
280
301
  export function lowercase_first_letter(str) {
package/utils.d.ts CHANGED
@@ -61,9 +61,13 @@ export declare class Timer {
61
61
  如果秒表已停止,获取停止时的秒表读数; */
62
62
  get(): number;
63
63
  /** 获取时间表示字符串,如 1.2 s
64
- - bracket?: `true` 字符串前后加上括号,如 (1.2 s) */
65
- getstr(bracket?: boolean): string;
64
+ - parenthesis?: `true` 字符串前后加上括号,如 (1.2 s) */
65
+ getstr(parenthesis?: boolean): string;
66
66
  print(): void;
67
+ /** 重置 started */
68
+ reset(): void;
69
+ get_and_reset(): number;
70
+ getstr_and_reset(parenthesis?: boolean): string;
67
71
  }
68
72
  export declare function log_line(): void;
69
73
  export declare function delay(milliseconds: number, options?: TimerOptions): Promise<void>;
package/utils.js CHANGED
@@ -189,10 +189,10 @@ export class Timer {
189
189
  return (this.ended || new Date().getTime()) - this.started;
190
190
  }
191
191
  /** 获取时间表示字符串,如 1.2 s
192
- - bracket?: `true` 字符串前后加上括号,如 (1.2 s) */
193
- getstr(bracket = false) {
192
+ - parenthesis?: `true` 字符串前后加上括号,如 (1.2 s) */
193
+ getstr(parenthesis = false) {
194
194
  let s = delta2str(this.get());
195
- if (bracket)
195
+ if (parenthesis)
196
196
  return s.bracket();
197
197
  else
198
198
  return s;
@@ -200,6 +200,21 @@ export class Timer {
200
200
  print() {
201
201
  console.log(this.getstr(true));
202
202
  }
203
+ /** 重置 started */
204
+ reset() {
205
+ this.started = new Date().getTime();
206
+ this.ended = null;
207
+ }
208
+ get_and_reset() {
209
+ const result = this.get();
210
+ this.reset();
211
+ return result;
212
+ }
213
+ getstr_and_reset(parenthesis) {
214
+ const result = this.getstr(parenthesis);
215
+ this.reset();
216
+ return result;
217
+ }
203
218
  }
204
219
  export function log_line() {
205
220
  console.log('---');