xshell 1.2.22 → 1.2.23

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
@@ -91,6 +91,7 @@ export interface BundlerOptions {
91
91
  entry: string;
92
92
  };
93
93
  plugins?: Webpack.Configuration['plugins'];
94
+ polyfill_node_sea?: boolean;
94
95
  }
95
96
  export declare class Bundler {
96
97
  name: string;
@@ -111,6 +112,7 @@ export declare class Bundler {
111
112
  exclude_modules?: BundlerOptions['exclude_modules'];
112
113
  plugins?: BundlerOptions['plugins'];
113
114
  license?: boolean;
115
+ polyfill_node_sea?: boolean;
114
116
  lcompiler: Lock<Webpack.Compiler>;
115
117
  /** 通过 webpack 从入口文件打包所有依赖生成单个 index.{mjs,cjs} 文件
116
118
  - name: 项目名称
@@ -150,8 +152,9 @@ export declare class Bundler {
150
152
  - production?: `true` webpack mode 设置为 'production'
151
153
  - sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本
152
154
  - plugins?: 可选传入的额外的 webpack 插件
153
- - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt */
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);
155
+ - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt
156
+ - polyfill_node_sea?: 避免依赖 node:sea 模块以兼容旧版本 node.js */
157
+ 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, polyfill_node_sea }?: BundlerOptions);
155
158
  build(print?: boolean): Promise<void>;
156
159
  close(): Promise<void>;
157
160
  build_all(print?: boolean): Promise<void>;
package/builder.js CHANGED
@@ -142,6 +142,7 @@ export class Bundler {
142
142
  exclude_modules;
143
143
  plugins;
144
144
  license;
145
+ polyfill_node_sea;
145
146
  lcompiler;
146
147
  /** 通过 webpack 从入口文件打包所有依赖生成单个 index.{mjs,cjs} 文件
147
148
  - name: 项目名称
@@ -181,8 +182,9 @@ export class Bundler {
181
182
  - production?: `true` webpack mode 设置为 'production'
182
183
  - sass?: 传入 sass 实例避免 webpack 重复加载 .cjs 版本
183
184
  - plugins?: 可选传入的额外的 webpack 插件
184
- - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt */
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, } = {}) {
185
+ - license?: 使用 license-webpack-plugin 构建 ThirdPartyNotice.txt
186
+ - polyfill_node_sea?: 避免依赖 node:sea 模块以兼容旧版本 node.js */
187
+ 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, polyfill_node_sea = false } = {}) {
186
188
  this.name = name;
187
189
  this.analyzer = analyzer;
188
190
  this.production = production;
@@ -206,6 +208,7 @@ export class Bundler {
206
208
  throw new Error('expose 和 commonjs2 不能同时启用');
207
209
  const output_module = !commonjs2 && !expose;
208
210
  this.license = license;
211
+ this.polyfill_node_sea = polyfill_node_sea;
209
212
  // let smp = new SpeedMeasurePlugin()
210
213
  // const config: Webpack.Configuration = smp.wrap({
211
214
  let resolve_cache = {};
@@ -475,6 +478,9 @@ export class Bundler {
475
478
  })
476
479
  ];
477
480
  })() : [],
481
+ ...this.polyfill_node_sea ? [
482
+ new Webpack.NormalModuleReplacementPlugin(/^node:sea$/, `${import.meta.dirname.fpd}node-sea.polyfill.js`)
483
+ ] : [],
478
484
  ...this.plugins || [],
479
485
  ];
480
486
  this.lcompiler = new Lock(Webpack(this.config));
@@ -0,0 +1,2 @@
1
+ export declare function isSea(): boolean;
2
+ export declare function getRawAsset(fp: string): void;
@@ -0,0 +1,7 @@
1
+ export function isSea() {
2
+ return false;
3
+ }
4
+ export function getRawAsset(fp) {
5
+ throw new Error('node:sea getRawAsset 未实现');
6
+ }
7
+ //# sourceMappingURL=node-sea.polyfill.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.2.22",
3
+ "version": "1.2.23",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {