electron-incremental-update 2.3.2 → 2.3.4

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/README.md CHANGED
@@ -920,9 +920,11 @@ export interface BuildEntryOption {
920
920
  */
921
921
  ignoreDynamicRequires?: boolean
922
922
  /**
923
- * `external` option in `build.rollupOptions`, external `.node` by default
923
+ * `external` option in `build.rollupOptions`,
924
+ * default is node built-in modules or native modules.
925
+ * If is in dev, also external `dependencies` in package.json
924
926
  */
925
- external?: string | string[] | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined | void)
927
+ external?: NonNullable<NonNullable<InlineConfig['build']>['rollupOptions']>['external']
926
928
  /**
927
929
  * Custom options for `vite` build
928
930
  * ```ts
package/dist/vite.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Promisable } from '@subframe7536/type-utils';
1
+ import { Promisable, AnyFunction } from '@subframe7536/type-utils';
2
2
  import { InlineConfig, PluginOption } from 'vite';
3
3
  import { ElectronSimpleOptions } from 'vite-plugin-electron/simple';
4
4
  export { isCI } from 'ci-info';
@@ -104,9 +104,11 @@ interface BuildEntryOption {
104
104
  */
105
105
  ignoreDynamicRequires?: boolean;
106
106
  /**
107
- * `external` option in `build.rollupOptions`, external `.node` by default
107
+ * `external` option in `build.rollupOptions`,
108
+ * default is node built-in modules or native modules.
109
+ * If is in dev, also external `dependencies` in package.json
108
110
  */
109
- external?: string | string[] | ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | undefined | void);
111
+ external?: NonNullable<NonNullable<InlineConfig['build']>['rollupOptions']>['external'];
110
112
  /**
111
113
  * Custom options for `vite` build
112
114
  * ```ts
@@ -297,7 +299,8 @@ type ReplaceKey<T, Key extends keyof T, NewKey extends string> = Omit<T, Key> &
297
299
  type MakeRequiredAndReplaceKey<T, K extends keyof T, NewKey extends string> = MakeRequired<ReplaceKey<T, K, NewKey>, NewKey>;
298
300
  type StartupFn = NonNullable<NonNullable<ElectronSimpleOptions['main']>['onstart']>;
299
301
  /**
300
- * Startup function for debug (see {@link https://github.com/electron-vite/electron-vite-vue/blob/main/vite.config.ts electron-vite-vue template})
302
+ * Startup function for debug
303
+ * @see {@link https://github.com/electron-vite/electron-vite-vue/blob/main/vite.config.ts electron-vite-vue template}
301
304
  * @example
302
305
  * import { debugStartup, buildElectronPluginOptions } from 'electron-incremental-update/vite'
303
306
  * const options = buildElectronPluginOptions({
@@ -309,6 +312,24 @@ type StartupFn = NonNullable<NonNullable<ElectronSimpleOptions['main']>['onstart
309
312
  * })
310
313
  */
311
314
  declare const debugStartup: StartupFn;
315
+ /**
316
+ * Startup function to filter unwanted error message
317
+ * @see {@link https://github.com/electron/electron/issues/46903#issuecomment-2848483520 reference}
318
+ * @example
319
+ * import { filterErrorMessageStartup, buildElectronPluginOptions } from 'electron-incremental-update/vite'
320
+ * const options = buildElectronPluginOptions({
321
+ * // ...
322
+ * main: {
323
+ * // ...
324
+ * startup: args => filterErrorMessageStartup(
325
+ * args,
326
+ * // ignore error message when function returns false
327
+ * msg => !/"code":-32601/.test(msg)
328
+ * )
329
+ * },
330
+ * })
331
+ */
332
+ declare function filterErrorMessageStartup(args: Parameters<StartupFn>[0], filter: (msg: string) => boolean): Promise<void>;
312
333
  /**
313
334
  * Startup function util to fix Windows terminal charset
314
335
  * @example
@@ -321,7 +342,7 @@ declare const debugStartup: StartupFn;
321
342
  * },
322
343
  * })
323
344
  */
324
- declare function fixWinCharEncoding(fn: StartupFn): StartupFn;
345
+ declare function fixWinCharEncoding<T extends AnyFunction>(fn: T): T;
325
346
  type ExcludeOutputDirOptions = {
326
347
  vite?: {
327
348
  build?: {
@@ -454,4 +475,4 @@ interface ElectronWithUpdaterOptions {
454
475
  */
455
476
  declare function electronWithUpdater(options: ElectronWithUpdaterOptions): Promise<PluginOption[] | undefined>;
456
477
 
457
- export { type ElectronWithUpdaterOptions, convertLiteral, debugStartup, electronWithUpdater as default, electronWithUpdater, fixWinCharEncoding };
478
+ export { type ElectronWithUpdaterOptions, convertLiteral, debugStartup, electronWithUpdater as default, electronWithUpdater, filterErrorMessageStartup, fixWinCharEncoding };