xshell 1.2.20 → 1.2.22

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
@@ -90,6 +90,7 @@ export interface BundlerOptions {
90
90
  js: string;
91
91
  entry: string;
92
92
  };
93
+ plugins?: Webpack.Configuration['plugins'];
93
94
  }
94
95
  export declare class Bundler {
95
96
  name: string;
@@ -108,6 +109,7 @@ export declare class Bundler {
108
109
  single_js?: BundlerOptions['single_js'];
109
110
  globals?: BundlerOptions['globals'];
110
111
  exclude_modules?: BundlerOptions['exclude_modules'];
112
+ plugins?: BundlerOptions['plugins'];
111
113
  license?: boolean;
112
114
  lcompiler: Lock<Webpack.Compiler>;
113
115
  /** 通过 webpack 从入口文件打包所有依赖生成单个 index.{mjs,cjs} 文件
@@ -147,8 +149,9 @@ export declare class Bundler {
147
149
  - cache_version?: webpack cache version, 用于区分同一个 name 的不同版本
148
150
  - production?: `true` webpack mode 设置为 'production'
149
151
  - sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本
152
+ - plugins?: 可选传入的额外的 webpack 插件
150
153
  - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt */
151
- 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, htmls, assets, assets_root, template, single_js, commonjs2, expose, single_chunk, dynamic_import, resolve_alias, resolve_fallback, assets_stats, analyzer, dts, exclude_modules, cache_version, production, sass, dependencies, license, }?: BundlerOptions);
154
+ 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, htmls, assets, assets_root, template, single_js, commonjs2, expose, single_chunk, dynamic_import, resolve_alias, resolve_fallback, assets_stats, analyzer, dts, exclude_modules, cache_version, production, sass, dependencies, plugins, license, }?: BundlerOptions);
152
155
  build(print?: boolean): Promise<void>;
153
156
  close(): Promise<void>;
154
157
  build_all(print?: boolean): Promise<void>;
package/builder.js CHANGED
@@ -140,6 +140,7 @@ export class Bundler {
140
140
  single_js;
141
141
  globals;
142
142
  exclude_modules;
143
+ plugins;
143
144
  license;
144
145
  lcompiler;
145
146
  /** 通过 webpack 从入口文件打包所有依赖生成单个 index.{mjs,cjs} 文件
@@ -179,8 +180,9 @@ export class Bundler {
179
180
  - cache_version?: webpack cache version, 用于区分同一个 name 的不同版本
180
181
  - production?: `true` webpack mode 设置为 'production'
181
182
  - sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本
183
+ - plugins?: 可选传入的额外的 webpack 插件
182
184
  - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt */
183
- constructor(name, target, fpd_root, fpd_out, fpdt_cache, entry, { source_map = true, globals, external_dayjs = false, externals, htmls, assets, assets_root = '/', template = false, single_js, commonjs2 = false, expose = false, single_chunk = true, dynamic_import = true, resolve_alias, resolve_fallback, assets_stats = true, analyzer = false, dts = false, exclude_modules, cache_version, production = true, sass, dependencies, license, } = {}) {
185
+ constructor(name, target, fpd_root, fpd_out, fpdt_cache, entry, { source_map = true, globals, external_dayjs = false, externals, htmls, assets, assets_root = '/', template = false, single_js, commonjs2 = false, expose = false, single_chunk = true, dynamic_import = true, resolve_alias, resolve_fallback, assets_stats = true, analyzer = false, dts = false, exclude_modules, cache_version, production = true, sass, dependencies, plugins, license, } = {}) {
184
186
  this.name = name;
185
187
  this.analyzer = analyzer;
186
188
  this.production = production;
@@ -195,6 +197,7 @@ export class Bundler {
195
197
  this.single_js = single_js;
196
198
  this.globals = globals;
197
199
  this.exclude_modules = exclude_modules;
200
+ this.plugins = plugins;
198
201
  if (dependencies) {
199
202
  check(target === 'web');
200
203
  this.dependencies = dependencies;
@@ -358,6 +361,10 @@ export class Bundler {
358
361
  loader: get_loader('@svgr/webpack'),
359
362
  options: { icon: true }
360
363
  },
364
+ {
365
+ test: /\.raw\.svg$/,
366
+ type: 'asset/source',
367
+ },
361
368
  {
362
369
  test: /\.(svg|ico|png|jpe?g|gif|woff2?|ttf|eot|otf|mp4|webm|ogg|mp3|wav|flac|aac)$/,
363
370
  type: 'asset/inline',
@@ -468,6 +475,7 @@ export class Bundler {
468
475
  })
469
476
  ];
470
477
  })() : [],
478
+ ...this.plugins || [],
471
479
  ];
472
480
  this.lcompiler = new Lock(Webpack(this.config));
473
481
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.2.20",
3
+ "version": "1.2.22",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -53,13 +53,13 @@
53
53
  "@babel/parser": "^7.26.9",
54
54
  "@babel/traverse": "^7.26.9",
55
55
  "@koa/cors": "^5.0.0",
56
- "@stylistic/eslint-plugin": "^4.0.1",
56
+ "@stylistic/eslint-plugin": "^4.2.0",
57
57
  "@svgr/webpack": "^8.1.0",
58
58
  "@types/sass-loader": "^8.0.9",
59
- "@types/ws": "^8.5.14",
60
- "@typescript-eslint/eslint-plugin": "^8.25.0",
61
- "@typescript-eslint/parser": "^8.25.0",
62
- "@typescript-eslint/utils": "^8.25.0",
59
+ "@types/ws": "^8.18.0",
60
+ "@typescript-eslint/eslint-plugin": "^8.26.0",
61
+ "@typescript-eslint/parser": "^8.26.0",
62
+ "@typescript-eslint/utils": "^8.26.0",
63
63
  "archiver": "^7.0.1",
64
64
  "chalk": "^5.4.1",
65
65
  "cli-table3": "^0.6.5",
@@ -74,7 +74,7 @@
74
74
  "https-proxy-agent": "^7.0.6",
75
75
  "i18next": "^24.2.2",
76
76
  "i18next-scanner": "^4.6.0",
77
- "koa": "^2.15.4",
77
+ "koa": "^2.16.0",
78
78
  "koa-compress": "^5.1.1",
79
79
  "license-webpack-plugin": "^4.0.2",
80
80
  "map-stream": "^0.0.7",
@@ -90,12 +90,12 @@
90
90
  "strip-ansi": "^7.1.0",
91
91
  "style-loader": "^4.0.0",
92
92
  "through2": "^4.0.2",
93
- "tough-cookie": "^5.1.1",
93
+ "tough-cookie": "^5.1.2",
94
94
  "ts-loader": "^9.5.2",
95
95
  "tslib": "^2.8.1",
96
- "typescript": "^5.7.3",
96
+ "typescript": "^5.8.2",
97
97
  "ua-parser-js": "^2.0.2",
98
- "undici": "^7.3.0",
98
+ "undici": "^7.4.0",
99
99
  "vinyl": "^3.0.0",
100
100
  "vinyl-fs": "^4.0.0",
101
101
  "webpack": "^5.98.0",
@@ -112,18 +112,18 @@
112
112
  "@types/koa": "^2.15.0",
113
113
  "@types/koa-compress": "^4.0.6",
114
114
  "@types/mime-types": "^2.1.4",
115
- "@types/node": "^22.13.5",
115
+ "@types/node": "^22.13.9",
116
116
  "@types/react": "^19.0.10",
117
117
  "@types/through2": "^2.0.41",
118
118
  "@types/tough-cookie": "^4.0.5",
119
119
  "@types/ua-parser-js": "^0.7.39",
120
120
  "@types/vinyl-fs": "^3.0.5",
121
- "@types/vscode": "^1.97.0",
121
+ "@types/vscode": "^1.98.0",
122
122
  "@types/webpack-bundle-analyzer": "^4.7.0"
123
123
  },
124
124
  "pnpm": {
125
125
  "patchedDependencies": {
126
- "koa@2.15.4": "patches/koa@2.15.4.patch"
126
+ "koa@2.16.0": "patches/koa@2.16.0.patch"
127
127
  }
128
128
  }
129
129
  }
package/repl.js CHANGED
@@ -1,3 +1,11 @@
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
1
9
  import repl from 'repl';
2
10
  import process from 'process';
3
11
  import { fileURLToPath } from 'url';
@@ -28,7 +36,7 @@ export async function start_repl() {
28
36
  pollute_global(),
29
37
  (async () => {
30
38
  // --- http server
31
- let { Server } = await import('./server.ts');
39
+ let { Server } = await import("./server.js");
32
40
  server = new Server({
33
41
  name: 'repl',
34
42
  http: true,
@@ -78,9 +86,9 @@ export async function pollute_global() {
78
86
  ]);
79
87
  }
80
88
  export async function pollute_module_exports(fp_mod) {
81
- Object.assign(globalThis, await import(fp_mod));
89
+ Object.assign(globalThis, await import(__rewriteRelativeImportExtension(fp_mod)));
82
90
  }
83
91
  export async function pollute_module_default_export(fp_mod, name) {
84
- globalThis[name] = (await import(fp_mod)).default;
92
+ globalThis[name] = (await import(__rewriteRelativeImportExtension(fp_mod))).default;
85
93
  }
86
94
  //# sourceMappingURL=repl.js.map
package/server.js CHANGED
@@ -37,7 +37,7 @@ export class Server {
37
37
  /** sea 下最后修改时间,用于 http 资源缓存 */
38
38
  last_modified_str;
39
39
  static js_exts = new Set(['js', 'mjs', 'cjs']);
40
- static logger_ignore_fexts = new Set(['js', 'css', 'map', 'png', 'jpg', 'svg', 'ico', 'json', 'woff2', 'ttf', 'php']);
40
+ static logger_ignore_fexts = new Set(['js', 'css', 'wasm', 'map', 'png', 'jpg', 'svg', 'ico', 'json', 'woff2', 'ttf', 'php']);
41
41
  static empty_body_statuses = new Set([304, 204, 205]);
42
42
  static empty_body_methods = new Set(['HEAD', 'OPTIONS']);
43
43
  app;
File without changes