xshell 1.2.19 → 1.2.21

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
@@ -172,7 +172,7 @@ export declare class Bundler {
172
172
  production?: boolean;
173
173
  source_map?: BundlerOptions['source_map'];
174
174
  }): (string | AssetOption)[];
175
- copy_files({ dependencies, production, assets, fpd_root, fpd_out, print }?: {
175
+ copy_files({ dependencies: _dependencies, production, assets, fpd_root, fpd_out, print }?: {
176
176
  dependencies?: DependencyId[];
177
177
  production?: boolean;
178
178
  assets?: Assets;
package/builder.js CHANGED
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'url';
2
2
  import { not_empty } from "./prototype.js";
3
3
  import { noprint } from "./process.js";
4
4
  import { Lock, check, filter_values } from "./utils.js";
5
- import { fcopy, fmkdir, fwrite } from "./file.js";
5
+ import { fcopy, fmkdir, fwrite, fread } from "./file.js";
6
6
  import { path } from "./path.js";
7
7
  const monaco_files = [
8
8
  'loader.js',
@@ -358,6 +358,10 @@ export class Bundler {
358
358
  loader: get_loader('@svgr/webpack'),
359
359
  options: { icon: true }
360
360
  },
361
+ {
362
+ test: /\.raw\.svg$/,
363
+ type: 'asset/source',
364
+ },
361
365
  {
362
366
  test: /\.(svg|ico|png|jpe?g|gif|woff2?|ttf|eot|otf|mp4|webm|ogg|mp3|wav|flac|aac)$/,
363
367
  type: 'asset/inline',
@@ -602,10 +606,10 @@ export class Bundler {
602
606
  ];
603
607
  }).flat();
604
608
  }
605
- async copy_files({ dependencies = this.dependencies, production = this.production, assets = this.assets, fpd_root = this.fpd_root, fpd_out = this.fpd_out, print = { info: true, files: false } } = {}) {
609
+ async copy_files({ dependencies: _dependencies = this.dependencies, production = this.production, assets = this.assets, fpd_root = this.fpd_root, fpd_out = this.fpd_out, print = { info: true, files: false } } = {}) {
606
610
  if (print.files)
607
611
  console.log(`复制 ${this.name} 的依赖文件到 ${this.fpd_out}`);
608
- if (dependencies.length)
612
+ if (_dependencies.length)
609
613
  await fmkdir(`${fpd_out}vendors/`, noprint);
610
614
  // 输出路径 -> 原路径,用来保证只复制一次且是同样的映射
611
615
  let records = new Map();
@@ -633,7 +637,7 @@ export class Bundler {
633
637
  }
634
638
  }
635
639
  await Promise.all([
636
- ...this.resolve_dependency_assets(dependencies, true, { production })
640
+ ...this.resolve_dependency_assets(_dependencies, true, { production })
637
641
  .map(async (asset) => typeof asset === 'string'
638
642
  ? fcopy_record(`${fpd_root}node_modules/${asset}`, `${fpd_out}vendors/${asset}`)
639
643
  : fcopy_record(path.resolve_with_slash(fpd_root, asset.src), path.resolve_with_slash(fpd_out, asset.out || asset.src))),
@@ -649,6 +653,12 @@ export class Bundler {
649
653
  ].filter(not_empty)
650
654
  .map(fcopy_asset))) : []
651
655
  ]);
656
+ // antd 需要修复 this, 才能在 module 下正常加载
657
+ if (this.single_js && (_dependencies.includes('antd') || _dependencies.includes('antd-icons'))) {
658
+ const fp_out = `${fpd_out}vendors/${dependencies.antd[production ? 'productions' : 'devs'][0]}`;
659
+ await fwrite(fp_out, (await fread(fp_out, noprint))
660
+ .replace(')(this,', ')(globalThis,'), noprint);
661
+ }
652
662
  }
653
663
  /** 为空时返回空数组 */
654
664
  resolve_config(config, production) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.2.19",
3
+ "version": "1.2.21",
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.24.1",
61
- "@typescript-eslint/parser": "^8.24.1",
62
- "@typescript-eslint/utils": "^8.24.1",
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",
@@ -84,18 +84,18 @@
84
84
  "react-i18next": "^15.4.1",
85
85
  "react-object-model": "^1.2.23",
86
86
  "resolve-path": "^1.4.0",
87
- "sass": "^1.85.0",
87
+ "sass": "^1.85.1",
88
88
  "sass-loader": "^16.0.5",
89
89
  "source-map-loader": "^5.0.0",
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