xshell 1.0.131 → 1.0.132

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/builder.d.ts CHANGED
@@ -54,13 +54,6 @@ export declare class Bundler {
54
54
  - sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本
55
55
  - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt */
56
56
  constructor(name: string, target: 'web' | 'nodejs', fpd_root: string, fpd_out: string, fpdt_cache: string, entry: Record<string, string>, { source_map, globals, external_dayjs, externals, commonjs2, single_chunk, dynamic_import, resolve_alias, assets_stats, analyzer, dts, exclude_modules, cache_version, production, sass, license, }?: BundlerOptions);
57
- /** 获取构建时 git 仓库的最新提交、分支信息 */
58
- get_git_info(version?: string): Promise<{
59
- version: string;
60
- branch: string;
61
- time: string;
62
- commit: string;
63
- }>;
64
57
  build(print?: boolean): Promise<void>;
65
58
  close(): Promise<void>;
66
59
  build_and_close(print?: boolean): Promise<void>;
package/builder.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { fileURLToPath } from 'url';
2
2
  import Webpack from 'webpack';
3
3
  import { Lock, Timer, filter_values } from './utils.js';
4
- import { Git } from './git.js';
5
4
  export class Bundler {
6
5
  name;
7
6
  fpd_root;
@@ -262,21 +261,6 @@ export class Bundler {
262
261
  }
263
262
  };
264
263
  }
265
- /** 获取构建时 git 仓库的最新提交、分支信息 */
266
- async get_git_info(version) {
267
- let git = new Git(this.fpd_root);
268
- const branch = await git.get_branch();
269
- const { hash, time } = (await git.get_last_commits(1))[0];
270
- version ||= branch;
271
- const timestr = time.to_formal_str();
272
- const commit = hash.slice(0, 6);
273
- return {
274
- version: version,
275
- branch,
276
- time: timestr,
277
- commit
278
- };
279
- }
280
264
  async build(print = true) {
281
265
  let timer = new Timer();
282
266
  if (!this.lcompiler) {
package/git.d.ts CHANGED
@@ -33,4 +33,12 @@ export declare class Git {
33
33
  checkout(branch?: 'main'): Promise<void>;
34
34
  checkout(branch?: string): Promise<void>;
35
35
  _checkout(branch?: string): Promise<void>;
36
+ get_version_info(version?: string): Promise<{
37
+ version: string;
38
+ branch: string;
39
+ time: string;
40
+ hash: string;
41
+ commiter: string;
42
+ message: string;
43
+ }>;
36
44
  }
package/git.js CHANGED
@@ -120,5 +120,19 @@ export class Git {
120
120
  throw error;
121
121
  }
122
122
  }
123
+ async get_version_info(version) {
124
+ const branch = await this.get_branch();
125
+ const { hash, time, commiter, message } = (await this.get_last_commits(1))[0];
126
+ version ||= branch;
127
+ const timestr = time.to_formal_str();
128
+ return {
129
+ version,
130
+ branch,
131
+ time: timestr,
132
+ hash: hash.slice(0, 6),
133
+ commiter,
134
+ message
135
+ };
136
+ }
123
137
  }
124
138
  //# sourceMappingURL=git.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.131",
3
+ "version": "1.0.132",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
package/path.d.ts CHANGED
@@ -54,7 +54,7 @@ export declare function extname(path: string): string;
54
54
  /** `/` */
55
55
  export declare const sep = "/";
56
56
  /** The platform-specific file delimiter. ';' or ':'. */
57
- export declare const delimiter: ";" | ":";
57
+ export declare const delimiter: ":" | ";";
58
58
  /** Returns an object from a path string - the opposite of format().
59
59
  @param path path to evaluate.
60
60
  @throws {TypeError} if `path` is not a string. */
@@ -81,7 +81,7 @@ export declare let path: {
81
81
  basename: typeof basename;
82
82
  extname: typeof extname;
83
83
  sep: string;
84
- delimiter: ";" | ":";
84
+ delimiter: ":" | ";";
85
85
  parse: typeof parse;
86
86
  format: typeof format;
87
87
  toNamespacedPath: typeof toNamespacedPath;
@@ -65,7 +65,7 @@ export declare function encode(str: string): Uint8Array;
65
65
  在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
66
66
  export declare function decode(buffer: Uint8Array): string;
67
67
  /** 字符串字典序比较 */
68
- export declare function strcmp(l: string, r: string): 1 | 0 | -1;
68
+ export declare function strcmp(l: string, r: string): 0 | 1 | -1;
69
69
  /** 比较 1.10.02 这种版本号 */
70
70
  export declare function vercmp(l: string, r: string): number;
71
71
  export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
package/utils.d.ts CHANGED
@@ -41,7 +41,7 @@ export declare function filter_values<TObj extends Record<string, any>>(obj: TOb
41
41
  /** 忽略对象中的 keys, 返回新对象 */
42
42
  export declare function omit<TObj>(obj: TObj, omit_keys: string[]): TObj;
43
43
  /** 字符串字典序比较 */
44
- export declare function strcmp(l: string, r: string): 1 | 0 | -1;
44
+ export declare function strcmp(l: string, r: string): 0 | 1 | -1;
45
45
  /** 比较 1.10.02 这种版本号 */
46
46
  export declare function vercmp(l: string, r: string): number;
47
47
  export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;