xshell 1.0.120 → 1.0.124
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 +5 -3
- package/builder.js +15 -10
- package/file.d.ts +1 -0
- package/file.js +1 -0
- package/package.json +1 -5
- package/path.d.ts +2 -2
- package/process.d.ts +3 -0
- package/process.js +1 -0
- package/utils.browser.d.ts +1 -1
- package/utils.d.ts +1 -1
package/builder.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface BundlerOptions {
|
|
|
5
5
|
production?: boolean;
|
|
6
6
|
externals?: Record<string, string>;
|
|
7
7
|
sass?: typeof import('sass');
|
|
8
|
-
|
|
8
|
+
dynamic_import?: boolean;
|
|
9
9
|
commonjs2?: boolean;
|
|
10
10
|
assets_stats?: boolean;
|
|
11
11
|
globals?: Record<string, string>;
|
|
@@ -13,6 +13,7 @@ export interface BundlerOptions {
|
|
|
13
13
|
dts?: boolean;
|
|
14
14
|
cache_version?: string;
|
|
15
15
|
single_chunk?: boolean;
|
|
16
|
+
exclude_modules?: RegExp;
|
|
16
17
|
}
|
|
17
18
|
export declare class Bundler {
|
|
18
19
|
name: string;
|
|
@@ -33,14 +34,15 @@ export declare class Bundler {
|
|
|
33
34
|
- externals?: 配置外部模块
|
|
34
35
|
- commonjs2?: `false` 打包为 commonjs2 (.cjs) 的文件
|
|
35
36
|
- single_chunk?: `true` 输出为单个文件,将依赖也打包到其中,不要生成多个 chunk
|
|
36
|
-
-
|
|
37
|
+
- dynamic_import: `true` 对于 await import('...') 要不要打包外部模块到输出文件中
|
|
37
38
|
- assets_stats?: `true` 打印输出的文件信息
|
|
38
39
|
- analyzer?: `false` 启用 WebpackBundleAnalyzer 插件分析构建产物大小
|
|
39
40
|
- dts?: `false` 生成 .d.ts 文件
|
|
41
|
+
- exclude_modules?: 传入正则表达式 ,匹配时使用 IgnorePlugin 强制不打包这个模块,但是一旦导入就会报错
|
|
40
42
|
- cache_version?: webpack cache version, 用于区分同一个 name 的不同版本
|
|
41
43
|
- production?: `true` webpack mode 设置为 'production'
|
|
42
44
|
- sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本 */
|
|
43
|
-
constructor(name: string, target: 'web' | 'nodejs', fpd_root: string, fpd_out: string, fpdt_cache: string, entry: Record<string, string>, { source_map, globals, externals, commonjs2, single_chunk,
|
|
45
|
+
constructor(name: string, target: 'web' | 'nodejs', fpd_root: string, fpd_out: string, fpdt_cache: string, entry: Record<string, string>, { source_map, globals, externals, commonjs2, single_chunk, dynamic_import, assets_stats, analyzer, dts, exclude_modules, cache_version, production, sass, }?: BundlerOptions);
|
|
44
46
|
build(print?: boolean): Promise<void>;
|
|
45
47
|
close(): Promise<void>;
|
|
46
48
|
}
|
package/builder.js
CHANGED
|
@@ -19,14 +19,15 @@ export class Bundler {
|
|
|
19
19
|
- externals?: 配置外部模块
|
|
20
20
|
- commonjs2?: `false` 打包为 commonjs2 (.cjs) 的文件
|
|
21
21
|
- single_chunk?: `true` 输出为单个文件,将依赖也打包到其中,不要生成多个 chunk
|
|
22
|
-
-
|
|
22
|
+
- dynamic_import: `true` 对于 await import('...') 要不要打包外部模块到输出文件中
|
|
23
23
|
- assets_stats?: `true` 打印输出的文件信息
|
|
24
24
|
- analyzer?: `false` 启用 WebpackBundleAnalyzer 插件分析构建产物大小
|
|
25
25
|
- dts?: `false` 生成 .d.ts 文件
|
|
26
|
+
- exclude_modules?: 传入正则表达式 ,匹配时使用 IgnorePlugin 强制不打包这个模块,但是一旦导入就会报错
|
|
26
27
|
- cache_version?: webpack cache version, 用于区分同一个 name 的不同版本
|
|
27
28
|
- production?: `true` webpack mode 设置为 'production'
|
|
28
29
|
- sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本 */
|
|
29
|
-
constructor(name, target, fpd_root, fpd_out, fpdt_cache, entry, { source_map = true, globals, externals, commonjs2 = false, single_chunk = true,
|
|
30
|
+
constructor(name, target, fpd_root, fpd_out, fpdt_cache, entry, { source_map = true, globals, externals, commonjs2 = false, single_chunk = true, dynamic_import = true, assets_stats = true, analyzer = false, dts = false, exclude_modules, cache_version, production = true, sass, } = {}) {
|
|
30
31
|
this.name = name;
|
|
31
32
|
this.analyzer = analyzer;
|
|
32
33
|
// let smp = new SpeedMeasurePlugin()
|
|
@@ -98,7 +99,7 @@ export class Bundler {
|
|
|
98
99
|
loader: { sass }
|
|
99
100
|
} : {},
|
|
100
101
|
module: {
|
|
101
|
-
...
|
|
102
|
+
...dynamic_import === false ? {
|
|
102
103
|
parser: {
|
|
103
104
|
javascript: {
|
|
104
105
|
// 保留 await import() 这样的引用
|
|
@@ -197,12 +198,15 @@ export class Bundler {
|
|
|
197
198
|
...globals
|
|
198
199
|
// process: { env: { }, argv: [] }
|
|
199
200
|
})
|
|
200
|
-
] : []
|
|
201
|
+
] : [],
|
|
201
202
|
// 使用 IgnorePlugin 能够不打包,但是一旦导入就会报错
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
...exclude_modules ? [
|
|
204
|
+
new Webpack.IgnorePlugin({
|
|
205
|
+
resourceRegExp: exclude_modules,
|
|
206
|
+
// checkResource: (resource, context) =>
|
|
207
|
+
// resource.startsWith('./vendors/') && !context.fp.startsWith(fpd_node_modules) ,
|
|
208
|
+
})
|
|
209
|
+
] : [],
|
|
206
210
|
],
|
|
207
211
|
optimization: {
|
|
208
212
|
minimize: false
|
|
@@ -220,8 +224,9 @@ export class Bundler {
|
|
|
220
224
|
...target === 'nodejs' ? [
|
|
221
225
|
/Can't resolve '(bufferutil|utf-8-validate)'/
|
|
222
226
|
] : [],
|
|
223
|
-
//
|
|
224
|
-
|
|
227
|
+
// 打包 ali-oss 时可能的报错
|
|
228
|
+
warning => warning.message.includes('the request of a dependency is an expression') &&
|
|
229
|
+
warning.module?.context?.endsWith('any-promise')
|
|
225
230
|
],
|
|
226
231
|
performance: {
|
|
227
232
|
hints: false,
|
package/file.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ type FileHandle = fsp.FileHandle & {
|
|
|
8
8
|
export { fsp };
|
|
9
9
|
export type Encoding = 'utf-8' | 'gb18030' | 'shift-jis' | 'utf-16le';
|
|
10
10
|
export declare const encodings: readonly ["utf-8", "gb18030", "shift-jis", "utf-16le"];
|
|
11
|
+
export declare const ramdisk: boolean;
|
|
11
12
|
/** fp 所指向的 文件/ 文件夹 是否存在
|
|
12
13
|
Does the file/folder pointed to by fp exist? */
|
|
13
14
|
export declare function fexists(fp: string, { print }?: {
|
package/file.js
CHANGED
|
@@ -6,6 +6,7 @@ import { to_json } from './prototype.js';
|
|
|
6
6
|
import { assert, Lock, WritableMemoryStream } from './utils.js';
|
|
7
7
|
export { fsp };
|
|
8
8
|
export const encodings = ['utf-8', 'gb18030', 'shift-jis', 'utf-16le'];
|
|
9
|
+
export const ramdisk = fexists('T:/TEMP/', { print: false });
|
|
9
10
|
/** fp 所指向的 文件/ 文件夹 是否存在
|
|
10
11
|
Does the file/folder pointed to by fp exist? */
|
|
11
12
|
export function fexists(fp, { print = true } = {}) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.124",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
"i18n",
|
|
16
16
|
"interactive programming"
|
|
17
17
|
],
|
|
18
|
-
"engines": {
|
|
19
|
-
"node": ">=22.2.0",
|
|
20
|
-
"vscode": ">=1.81.0"
|
|
21
|
-
},
|
|
22
18
|
"scripts": {
|
|
23
19
|
"start": "node --title=xshell --inspect=0.0.0.0:8420 ./xshell.js",
|
|
24
20
|
"typecheck": "tsc --noEmit",
|
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;
|
package/process.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { inspect } from './utils.js';
|
|
|
8
8
|
export declare const exe_nodejs: string;
|
|
9
9
|
export declare const platform: NodeJS.Platform;
|
|
10
10
|
export declare const username: string;
|
|
11
|
+
export declare const noprint: {
|
|
12
|
+
readonly print: false;
|
|
13
|
+
};
|
|
11
14
|
interface StartOptions {
|
|
12
15
|
/** `继承当前工作目录 process.cwd()` 子进程的工作目录 `inherit the cwd` cwd of the child process. */
|
|
13
16
|
cwd?: string;
|
package/process.js
CHANGED
|
@@ -6,6 +6,7 @@ import { inspect, DecoderStream } from './utils.js';
|
|
|
6
6
|
export const exe_nodejs = process.execPath.fp;
|
|
7
7
|
export const platform = os.platform();
|
|
8
8
|
export const username = os.userInfo().username;
|
|
9
|
+
export const noprint = { print: false };
|
|
9
10
|
/** start process
|
|
10
11
|
- exe: .exe 路径或文件名 (建议使用完整路径,跳过 path 搜索,性能更高) path or filename (full path is recommanded to skip path searching for better perf)
|
|
11
12
|
- args: `[]` 参数列表 arguments list
|
package/utils.browser.d.ts
CHANGED
|
@@ -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):
|
|
68
|
+
export declare function strcmp(l: string, r: string): 1 | 0 | -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):
|
|
44
|
+
export declare function strcmp(l: string, r: string): 1 | 0 | -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;
|