app-builder-lib 24.13.4-alpha.0 → 25.0.0-alpha.1

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.
@@ -121,6 +121,11 @@ export interface Configuration extends PlatformSpecificBuildOptions {
121
121
  * @default true
122
122
  */
123
123
  readonly npmRebuild?: boolean;
124
+ /**
125
+ * Use `legacy` app-builder binary for installing native dependencies, or @electron/rebuild in `sequential` or `parallel` compilation modes.
126
+ * @default legacy
127
+ */
128
+ readonly nativeRebuilder?: "legacy" | "sequential" | "parallel" | null;
124
129
  /**
125
130
  * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.
126
131
  * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions, ElectronDownloadOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface Configuration extends PlatformSpecificBuildOptions {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n readonly directories?: MetadataDirectories | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n readonly nsis?: NsisOptions | null\n readonly nsisWeb?: NsisWebOptions | null\n readonly portable?: PortableOptions | null\n readonly appx?: AppXOptions | null\n /** @private */\n readonly msi?: MsiOptions | null\n /** @private */\n readonly msiWrapped?: MsiWrappedOptions | null\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n\n /**\n * Options related to how build Linux targets.\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n */\n readonly deb?: DebOptions | null\n /**\n * Snap options.\n */\n readonly snap?: SnapOptions | null\n /**\n * AppImage options.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n */\n readonly flatpak?: FlatpakOptions | null\n readonly pacman?: LinuxTargetSpecificOptions | null\n readonly rpm?: LinuxTargetSpecificOptions | null\n readonly freebsd?: LinuxTargetSpecificOptions | null\n readonly p5p?: LinuxTargetSpecificOptions | null\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to include *all* of the submodules node_modules directories\n * @default false\n */\n includeSubNodeModules?: boolean\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n\n /**\n * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\n * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.\n */\n readonly buildNumber?: string | null\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n */\n readonly electronCompile?: boolean\n\n /**\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`). Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: string | ((options: PrepareApplicationStageDirectoryOptions) => string)\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options.\n */\n readonly electronDownload?: ElectronDownloadOptions\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n */\n readonly framework?: string | null\n\n /**\n * The function (or path to file or module id) to be [run before pack](#beforepack)\n */\n readonly beforePack?: ((context: BeforePackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).\n */\n readonly afterPack?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).\n */\n readonly afterSign?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be run on artifact build start.\n */\n readonly artifactBuildStarted?: ((context: ArtifactBuildStarted) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be run on artifact build completed.\n */\n readonly artifactBuildCompleted?: ((context: ArtifactCreated) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild).\n */\n readonly afterAllArtifactBuild?: ((context: BuildResult) => Promise<Array<string>> | Array<string>) | string | null\n /**\n * MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic\n */\n readonly onNodeModuleFile?: ((path: string) => void | boolean) | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: ((context: BeforeBuildContext) => Promise<any>) | string | null\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n}\n\ninterface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](/file-patterns#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n"]}
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions, ElectronDownloadOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface Configuration extends PlatformSpecificBuildOptions {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n readonly directories?: MetadataDirectories | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n readonly nsis?: NsisOptions | null\n readonly nsisWeb?: NsisWebOptions | null\n readonly portable?: PortableOptions | null\n readonly appx?: AppXOptions | null\n /** @private */\n readonly msi?: MsiOptions | null\n /** @private */\n readonly msiWrapped?: MsiWrappedOptions | null\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n\n /**\n * Options related to how build Linux targets.\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n */\n readonly deb?: DebOptions | null\n /**\n * Snap options.\n */\n readonly snap?: SnapOptions | null\n /**\n * AppImage options.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n */\n readonly flatpak?: FlatpakOptions | null\n readonly pacman?: LinuxTargetSpecificOptions | null\n readonly rpm?: LinuxTargetSpecificOptions | null\n readonly freebsd?: LinuxTargetSpecificOptions | null\n readonly p5p?: LinuxTargetSpecificOptions | null\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to include *all* of the submodules node_modules directories\n * @default false\n */\n includeSubNodeModules?: boolean\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n /**\n * Use `legacy` app-builder binary for installing native dependencies, or @electron/rebuild in `sequential` or `parallel` compilation modes.\n * @default legacy\n */\n readonly nativeRebuilder?: \"legacy\" | \"sequential\" | \"parallel\" | null\n\n /**\n * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\n * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.\n */\n readonly buildNumber?: string | null\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n */\n readonly electronCompile?: boolean\n\n /**\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`). Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: string | ((options: PrepareApplicationStageDirectoryOptions) => string)\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options.\n */\n readonly electronDownload?: ElectronDownloadOptions\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n */\n readonly framework?: string | null\n\n /**\n * The function (or path to file or module id) to be [run before pack](#beforepack)\n */\n readonly beforePack?: ((context: BeforePackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).\n */\n readonly afterPack?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).\n */\n readonly afterSign?: ((context: AfterPackContext) => Promise<any> | any) | string | null\n\n /**\n * The function (or path to file or module id) to be run on artifact build start.\n */\n readonly artifactBuildStarted?: ((context: ArtifactBuildStarted) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be run on artifact build completed.\n */\n readonly artifactBuildCompleted?: ((context: ArtifactCreated) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild).\n */\n readonly afterAllArtifactBuild?: ((context: BuildResult) => Promise<Array<string>> | Array<string>) | string | null\n /**\n * MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: ((path: string) => Promise<any> | any) | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic\n */\n readonly onNodeModuleFile?: ((path: string) => void | boolean) | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: ((context: BeforeBuildContext) => Promise<any>) | string | null\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n}\n\ninterface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](/file-patterns#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.computeElectronVersion = exports.getElectronPackage = exports.getElectronVersionFromInstalled = exports.getElectronVersion = void 0;
4
+ const search_module_1 = require("@electron/rebuild/lib/search-module");
4
5
  const builder_util_1 = require("builder-util");
5
6
  const builder_util_runtime_1 = require("builder-util-runtime");
6
7
  const nodeHttpExecutor_1 = require("builder-util/out/nodeHttpExecutor");
@@ -54,8 +55,15 @@ async function computeElectronVersion(projectDir) {
54
55
  if (result != null) {
55
56
  return result;
56
57
  }
57
- const metadata = await (0, read_config_file_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(projectDir, "package.json")));
58
- const dependency = metadata ? findFromPackageMetadata(metadata) : null;
58
+ const potentialRootDirs = [projectDir, await (0, search_module_1.getProjectRootPath)(projectDir)];
59
+ let dependency = null;
60
+ for await (const dir of potentialRootDirs) {
61
+ const metadata = await (0, read_config_file_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(dir, "package.json")));
62
+ dependency = metadata ? findFromPackageMetadata(metadata) : null;
63
+ if (dependency) {
64
+ break;
65
+ }
66
+ }
59
67
  if ((dependency === null || dependency === void 0 ? void 0 : dependency.name) === "electron-nightly") {
60
68
  builder_util_1.log.info("You are using a nightly version of electron, be warned that those builds are highly unstable.");
61
69
  const feedXml = await nodeHttpExecutor_1.httpExecutor.request({
@@ -1 +1 @@
1
- {"version":3,"file":"electronVersion.js","sourceRoot":"","sources":["../../src/electron/electronVersion.ts"],"names":[],"mappings":";;;AAAA,+CAA6D;AAC7D,+DAA+C;AAC/C,wEAAgE;AAChE,uCAAmC;AAEnC,6BAA4B;AAC5B,uDAAuD;AACvD,iCAAgC;AAEhC,2CAA0C;AAI1C,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,kBAAkB,CAAC,CAAA;AAEpG,KAAK,UAAU,kBAAkB,CAAC,UAAkB,EAAE,MAAsB;IACjF,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC;IACD,IAAI,MAAM,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC,eAAe,CAAA;IAC/B,CAAC;IACD,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAA;AAC3C,CAAC;AARD,gDAQC;AAEM,KAAK,UAAU,+BAA+B,CAAC,UAAkB;IACtE,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QAC9F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AAC,CAAA;QAChE,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;YAC7C,GAAG,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACxD,CAAC;QACD,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { InvalidConfigurationError, log } from \"builder-util\"\nimport { parseXml } from \"builder-util-runtime\"\nimport { httpExecutor } from \"builder-util/out/nodeHttpExecutor\"\nimport { readJson } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { orNullIfFileNotExist } from \"read-config-file\"\nimport * as semver from \"semver\"\nimport { Configuration } from \"../configuration\"\nimport { getConfig } from \"../util/config\"\n\nexport type MetadataValue = Lazy<{ [key: string]: any } | null>\n\nconst electronPackages = [\"electron\", \"electron-prebuilt\", \"electron-prebuilt-compile\", \"electron-nightly\"]\n\nexport async function getElectronVersion(projectDir: string, config?: Configuration): Promise<string> {\n if (config == null) {\n config = await getConfig(projectDir, null, null)\n }\n if (config.electronVersion != null) {\n return config.electronVersion\n }\n return computeElectronVersion(projectDir)\n}\n\nexport async function getElectronVersionFromInstalled(projectDir: string): Promise<string | null> {\n for (const name of electronPackages) {\n try {\n return (await readJson(path.join(projectDir, \"node_modules\", name, \"package.json\"))).version\n } catch (e: any) {\n if (e.code !== \"ENOENT\") {\n log.warn({ name, error: e }, `cannot read electron version package.json`)\n }\n }\n }\n return null\n}\n\nexport async function getElectronPackage(projectDir: string) {\n for (const name of electronPackages) {\n try {\n return await readJson(path.join(projectDir, \"node_modules\", name, \"package.json\"))\n } catch (e: any) {\n if (e.code !== \"ENOENT\") {\n log.warn({ name, error: e }, `cannot find electron in package.json`)\n }\n }\n }\n return null\n}\n\n/** @internal */\nexport async function computeElectronVersion(projectDir: string): Promise<string> {\n const result = await getElectronVersionFromInstalled(projectDir)\n if (result != null) {\n return result\n }\n\n const metadata = await orNullIfFileNotExist(readJson(path.join(projectDir, \"package.json\")))\n const dependency = metadata ? findFromPackageMetadata(metadata) : null\n if (dependency?.name === \"electron-nightly\") {\n log.info(\"You are using a nightly version of electron, be warned that those builds are highly unstable.\")\n const feedXml = await httpExecutor.request({\n hostname: \"github.com\",\n path: `/electron/nightlies/releases.atom`,\n headers: {\n accept: \"application/xml, application/atom+xml, text/xml, */*\",\n },\n })\n const feed = parseXml(feedXml!)\n const latestRelease = feed.element(\"entry\", false, `No published versions on GitHub`)\n const v = /\\/tag\\/v?([^/]+)$/.exec(latestRelease.element(\"link\").attribute(\"href\"))![1]\n return v.startsWith(\"v\") ? v.substring(1) : v\n } else if (dependency?.version === \"latest\") {\n log.warn('Electron version is set to \"latest\", but it is recommended to set it to some more restricted version range.')\n try {\n const releaseInfo = JSON.parse(\n (await httpExecutor.request({\n hostname: \"github.com\",\n path: `/electron/${dependency.name === \"electron-nightly\" ? \"nightlies\" : \"electron\"}/releases/latest`,\n headers: {\n accept: \"application/json\",\n },\n }))!\n )\n const version = releaseInfo.tag_name.startsWith(\"v\") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name\n log.info({ version }, `resolve ${dependency.name}@${dependency.version}`)\n return version\n } catch (e: any) {\n log.warn(e)\n }\n\n throw new InvalidConfigurationError(`Cannot find electron dependency to get electron version in the '${path.join(projectDir, \"package.json\")}'`)\n }\n const version = dependency?.version\n if (version == null || !/^\\d/.test(version)) {\n const versionMessage = version == null ? \"\" : ` and version (\"${version}\") is not fixed in project`\n throw new InvalidConfigurationError(\n `Cannot compute electron version from installed node modules - none of the possible electron modules are installed${versionMessage}.\\nSee https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-504968246`\n )\n }\n\n return semver.coerce(version)!.format()\n}\n\ninterface NameAndVersion {\n readonly name: string\n readonly version: string\n}\n\nfunction findFromPackageMetadata(packageData: any): NameAndVersion | null {\n for (const name of electronPackages) {\n const devDependencies = packageData.devDependencies\n let dep = devDependencies == null ? null : devDependencies[name]\n if (dep == null) {\n const dependencies = packageData.dependencies\n dep = dependencies == null ? null : dependencies[name]\n }\n if (dep != null) {\n return { name, version: dep }\n }\n }\n return null\n}\n"]}
1
+ {"version":3,"file":"electronVersion.js","sourceRoot":"","sources":["../../src/electron/electronVersion.ts"],"names":[],"mappings":";;;AAAA,uEAAwE;AAExE,+CAA6D;AAC7D,+DAA+C;AAC/C,wEAAgE;AAChE,uCAAmC;AAEnC,6BAA4B;AAC5B,uDAAuD;AACvD,iCAAgC;AAEhC,2CAA0C;AAI1C,MAAM,gBAAgB,GAAG,CAAC,UAAU,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,kBAAkB,CAAC,CAAA;AAEpG,KAAK,UAAU,kBAAkB,CAAC,UAAkB,EAAE,MAAsB;IACjF,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC;IACD,IAAI,MAAM,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC,eAAe,CAAA;IAC/B,CAAC;IACD,OAAO,sBAAsB,CAAC,UAAU,CAAC,CAAA;AAC3C,CAAC;AARD,gDAQC;AAEM,KAAK,UAAU,+BAA+B,CAAC,UAAkB;IACtE,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QAC9F,CAAC;QAAC,OAAO,CAAM,EAAE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AAuB,CAAC,WAAgB;IAC/C,KAAK,MAAM,IAAI,IAAI,gBAAgB,EAAE,CAAC;QACpC,MAAM,eAAe,GAAG,WAAW,CAAC,eAAe,CAAA;QACnD,IAAI,GAAG,GAAG,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;QAChE,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAAA;YAC7C,GAAG,GAAG,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACxD,CAAC;QACD,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YAChB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;QAC/B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { getProjectRootPath } from \"@electron/rebuild/lib/search-module\"\n\nimport { InvalidConfigurationError, log } from \"builder-util\"\nimport { parseXml } from \"builder-util-runtime\"\nimport { httpExecutor } from \"builder-util/out/nodeHttpExecutor\"\nimport { readJson } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { orNullIfFileNotExist } from \"read-config-file\"\nimport * as semver from \"semver\"\nimport { Configuration } from \"../configuration\"\nimport { getConfig } from \"../util/config\"\n\nexport type MetadataValue = Lazy<{ [key: string]: any } | null>\n\nconst electronPackages = [\"electron\", \"electron-prebuilt\", \"electron-prebuilt-compile\", \"electron-nightly\"]\n\nexport async function getElectronVersion(projectDir: string, config?: Configuration): Promise<string> {\n if (config == null) {\n config = await getConfig(projectDir, null, null)\n }\n if (config.electronVersion != null) {\n return config.electronVersion\n }\n return computeElectronVersion(projectDir)\n}\n\nexport async function getElectronVersionFromInstalled(projectDir: string): Promise<string | null> {\n for (const name of electronPackages) {\n try {\n return (await readJson(path.join(projectDir, \"node_modules\", name, \"package.json\"))).version\n } catch (e: any) {\n if (e.code !== \"ENOENT\") {\n log.warn({ name, error: e }, `cannot read electron version package.json`)\n }\n }\n }\n return null\n}\n\nexport async function getElectronPackage(projectDir: string) {\n for (const name of electronPackages) {\n try {\n return await readJson(path.join(projectDir, \"node_modules\", name, \"package.json\"))\n } catch (e: any) {\n if (e.code !== \"ENOENT\") {\n log.warn({ name, error: e }, `cannot find electron in package.json`)\n }\n }\n }\n return null\n}\n\n/** @internal */\nexport async function computeElectronVersion(projectDir: string): Promise<string> {\n const result = await getElectronVersionFromInstalled(projectDir)\n if (result != null) {\n return result\n }\n\n const potentialRootDirs = [projectDir, await getProjectRootPath(projectDir)]\n let dependency: NameAndVersion | null = null\n for await (const dir of potentialRootDirs) {\n const metadata = await orNullIfFileNotExist(readJson(path.join(dir, \"package.json\")))\n dependency = metadata ? findFromPackageMetadata(metadata) : null\n if (dependency) {\n break\n }\n }\n if (dependency?.name === \"electron-nightly\") {\n log.info(\"You are using a nightly version of electron, be warned that those builds are highly unstable.\")\n const feedXml = await httpExecutor.request({\n hostname: \"github.com\",\n path: `/electron/nightlies/releases.atom`,\n headers: {\n accept: \"application/xml, application/atom+xml, text/xml, */*\",\n },\n })\n const feed = parseXml(feedXml!)\n const latestRelease = feed.element(\"entry\", false, `No published versions on GitHub`)\n const v = /\\/tag\\/v?([^/]+)$/.exec(latestRelease.element(\"link\").attribute(\"href\"))![1]\n return v.startsWith(\"v\") ? v.substring(1) : v\n } else if (dependency?.version === \"latest\") {\n log.warn('Electron version is set to \"latest\", but it is recommended to set it to some more restricted version range.')\n try {\n const releaseInfo = JSON.parse(\n (await httpExecutor.request({\n hostname: \"github.com\",\n path: `/electron/${dependency.name === \"electron-nightly\" ? \"nightlies\" : \"electron\"}/releases/latest`,\n headers: {\n accept: \"application/json\",\n },\n }))!\n )\n const version = releaseInfo.tag_name.startsWith(\"v\") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name\n log.info({ version }, `resolve ${dependency.name}@${dependency.version}`)\n return version\n } catch (e: any) {\n log.warn(e)\n }\n\n throw new InvalidConfigurationError(`Cannot find electron dependency to get electron version in the '${path.join(projectDir, \"package.json\")}'`)\n }\n const version = dependency?.version\n if (version == null || !/^\\d/.test(version)) {\n const versionMessage = version == null ? \"\" : ` and version (\"${version}\") is not fixed in project`\n throw new InvalidConfigurationError(\n `Cannot compute electron version from installed node modules - none of the possible electron modules are installed${versionMessage}.\\nSee https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-504968246`\n )\n }\n\n return semver.coerce(version)!.format()\n}\n\ninterface NameAndVersion {\n readonly name: string\n readonly version: string\n}\n\nfunction findFromPackageMetadata(packageData: any): NameAndVersion | null {\n for (const name of electronPackages) {\n const devDependencies = packageData.devDependencies\n let dep = devDependencies == null ? null : devDependencies[name]\n if (dep == null) {\n const dependencies = packageData.dependencies\n dep = dependencies == null ? null : dependencies[name]\n }\n if (dep != null) {\n return { name, version: dep }\n }\n }\n return null\n}\n"]}
@@ -60,7 +60,7 @@ function checkMetadata(metadata, devMetadata, appPackageFile, devAppPackageFile)
60
60
  }
61
61
  const devDependencies = metadata.devDependencies;
62
62
  if (devDependencies != null && ("electron-rebuild" in devDependencies || "@electron/rebuild" in devDependencies)) {
63
- builder_util_1.log.info('@electron/rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies\n\nTo ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`');
63
+ builder_util_1.log.info('@electron/rebuild already used by electron-builder, please consider to remove excess dependency from devDependencies\n\nTo ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`');
64
64
  }
65
65
  if (errors.length > 0) {
66
66
  throw new builder_util_1.InvalidConfigurationError(errors.join("\n"));
@@ -1 +1 @@
1
- {"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":";;;AAAA,+CAA8E;A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CAAA;IAClE,IAAI,OAAO,CAAC,GAAG,CAAC,+CAA+C,KAAK,MAAM,EAAE,CAAC;QAC3E,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC/B,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,IAAI,YAAY,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,0CAA0C,GAAG,wEAAwE,CAAC,CAAA;QACpJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { isEmptyOrSpaces, log, InvalidConfigurationError } from \"builder-util\"\nimport { readFile, readJson } from \"fs-extra\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata\"\nimport { normalizePackageData } from \"./normalizePackageData\"\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await readJson(file)\n await authors(file, data)\n // remove not required fields because can be used for remote build\n delete data.scripts\n delete data.readme\n normalizePackageData(data)\n return data\n}\n\nasync function authors(file: string, data: any) {\n if (data.contributors != null) {\n return\n }\n\n let authorData\n try {\n authorData = await readFile(path.resolve(path.dirname(file), \"AUTHORS\"), \"utf8\")\n } catch (ignored) {\n return\n }\n\n data.contributors = authorData.split(/\\r?\\n/g).map(it => it.replace(/^\\s*#.*$/, \"\").trim())\n}\n\n/** @internal */\nexport function checkMetadata(metadata: Metadata, devMetadata: any | null, appPackageFile: string, devAppPackageFile: string): void {\n const errors: Array<string> = []\n const reportError = (missedFieldName: string) => {\n errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)\n }\n\n const checkNotEmpty = (name: string, value: string | null | undefined) => {\n if (isEmptyOrSpaces(value)) {\n reportError(name)\n }\n }\n\n if ((metadata as any).directories != null) {\n errors.push(`\"directories\" in the root is deprecated, please specify in the \"build\"`)\n }\n\n checkNotEmpty(\"name\", metadata.name)\n\n if (isEmptyOrSpaces(metadata.description)) {\n log.warn({ appPackageFile }, `description is missed in the package.json`)\n }\n if (metadata.author == null) {\n log.warn({ appPackageFile }, `author is missed in the package.json`)\n }\n checkNotEmpty(\"version\", metadata.version)\n\n checkDependencies(metadata.dependencies, errors)\n if (metadata !== devMetadata) {\n if (metadata.build != null) {\n errors.push(\n `'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`\n )\n }\n }\n\n const devDependencies = (metadata as any).devDependencies\n if (devDependencies != null && (\"electron-rebuild\" in devDependencies || \"@electron/rebuild\" in devDependencies)) {\n log.info(\n '@electron/rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies\\n\\nTo ensure your native dependencies are always matched electron version, simply add script `\"postinstall\": \"electron-builder install-app-deps\" to your `package.json`'\n )\n }\n\n if (errors.length > 0) {\n throw new InvalidConfigurationError(errors.join(\"\\n\"))\n }\n}\n\nfunction versionSatisfies(version: string | semver.SemVer | null, range: string | semver.Range, loose?: boolean): boolean {\n if (version == null) {\n return false\n }\n\n const coerced = semver.coerce(version)\n if (coerced == null) {\n return false\n }\n\n return semver.satisfies(coerced, range, loose)\n}\n\nfunction checkDependencies(dependencies: { [key: string]: string } | null | undefined, errors: Array<string>) {\n if (dependencies == null) {\n return\n }\n\n const updaterVersion = dependencies[\"electron-updater\"]\n const requiredElectronUpdaterVersion = \"4.0.0\"\n if (updaterVersion != null && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {\n errors.push(\n `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to \"^${requiredElectronUpdaterVersion}\"`\n )\n }\n\n const swVersion = dependencies[\"electron-builder-squirrel-windows\"]\n if (swVersion != null && !versionSatisfies(swVersion, \">=20.32.0\")) {\n errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to \"^20.32.0\"`)\n }\n\n const deps = [\"electron\", \"electron-prebuilt\", \"electron-rebuild\"]\n if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== \"true\") {\n deps.push(\"electron-builder\")\n }\n for (const name of deps) {\n if (name in dependencies) {\n errors.push(`Package \"${name}\" is only allowed in \"devDependencies\". ` + `Please remove it from the \"dependencies\" section in your package.json.`)\n }\n }\n}\n"]}
1
+ {"version":3,"file":"packageMetadata.js","sourceRoot":"","sources":["../../src/util/packageMetadata.ts"],"names":[],"mappings":";;;AAAA,+CAA8E;AAC9E,uCAA6C;AAC7C,6BAA4B;AAC5B,iCAAgC;AAEhC,iEAA6D;AAE7D,gBAAgB;AACT,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,CAAA;IACjC,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACzB,kEAAkE;IAClE,OAAO,IAAI,CAAC,OAAO,CAAA;IACnB,OAAO,IAAI,CAAC,MAAM,CAAA;IAClB,IAAA,2CAAoB,EAAC,IAAI,CAAC,CAAA;IAC1B,OAAO,IAAI,CAAA;AACb,CAAC;AARD,0CAQC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,IAAS;IAC5C,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAC9B,OAAM;IACR,CAAC;IAED,IAAI,UAAU,CAAA;IACd,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAA;IAClF,CAAC;IAAC,OAAO,OAAO,EAAE,CAAC;QACjB,OAAM;IACR,CAAC;IAED,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAA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,CAAC;IAED,MAAM,SAAS,GAAG,YAAY,CAAC,mCAAmC,CAAC,CAAA;IACnE,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,IAAI,CAAC,gKAAgK,CAAC,CAAA;IAC/K,CAAC;IAED,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAA;IAClE,IAAI,OAAO,CAAC,GAAG,CAAC,+CAA+C,KAAK,MAAM,EAAE,CAAC;QAC3E,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC/B,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,IAAI,IAAI,YAAY,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,0CAA0C,GAAG,wEAAwE,CAAC,CAAA;QACpJ,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { isEmptyOrSpaces, log, InvalidConfigurationError } from \"builder-util\"\nimport { readFile, readJson } from \"fs-extra\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { Metadata } from \"../options/metadata\"\nimport { normalizePackageData } from \"./normalizePackageData\"\n\n/** @internal */\nexport async function readPackageJson(file: string): Promise<any> {\n const data = await readJson(file)\n await authors(file, data)\n // remove not required fields because can be used for remote build\n delete data.scripts\n delete data.readme\n normalizePackageData(data)\n return data\n}\n\nasync function authors(file: string, data: any) {\n if (data.contributors != null) {\n return\n }\n\n let authorData\n try {\n authorData = await readFile(path.resolve(path.dirname(file), \"AUTHORS\"), \"utf8\")\n } catch (ignored) {\n return\n }\n\n data.contributors = authorData.split(/\\r?\\n/g).map(it => it.replace(/^\\s*#.*$/, \"\").trim())\n}\n\n/** @internal */\nexport function checkMetadata(metadata: Metadata, devMetadata: any | null, appPackageFile: string, devAppPackageFile: string): void {\n const errors: Array<string> = []\n const reportError = (missedFieldName: string) => {\n errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)\n }\n\n const checkNotEmpty = (name: string, value: string | null | undefined) => {\n if (isEmptyOrSpaces(value)) {\n reportError(name)\n }\n }\n\n if ((metadata as any).directories != null) {\n errors.push(`\"directories\" in the root is deprecated, please specify in the \"build\"`)\n }\n\n checkNotEmpty(\"name\", metadata.name)\n\n if (isEmptyOrSpaces(metadata.description)) {\n log.warn({ appPackageFile }, `description is missed in the package.json`)\n }\n if (metadata.author == null) {\n log.warn({ appPackageFile }, `author is missed in the package.json`)\n }\n checkNotEmpty(\"version\", metadata.version)\n\n checkDependencies(metadata.dependencies, errors)\n if (metadata !== devMetadata) {\n if (metadata.build != null) {\n errors.push(\n `'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`\n )\n }\n }\n\n const devDependencies = (metadata as any).devDependencies\n if (devDependencies != null && (\"electron-rebuild\" in devDependencies || \"@electron/rebuild\" in devDependencies)) {\n log.info(\n '@electron/rebuild already used by electron-builder, please consider to remove excess dependency from devDependencies\\n\\nTo ensure your native dependencies are always matched electron version, simply add script `\"postinstall\": \"electron-builder install-app-deps\" to your `package.json`'\n )\n }\n\n if (errors.length > 0) {\n throw new InvalidConfigurationError(errors.join(\"\\n\"))\n }\n}\n\nfunction versionSatisfies(version: string | semver.SemVer | null, range: string | semver.Range, loose?: boolean): boolean {\n if (version == null) {\n return false\n }\n\n const coerced = semver.coerce(version)\n if (coerced == null) {\n return false\n }\n\n return semver.satisfies(coerced, range, loose)\n}\n\nfunction checkDependencies(dependencies: { [key: string]: string } | null | undefined, errors: Array<string>) {\n if (dependencies == null) {\n return\n }\n\n const updaterVersion = dependencies[\"electron-updater\"]\n const requiredElectronUpdaterVersion = \"4.0.0\"\n if (updaterVersion != null && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {\n errors.push(\n `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to \"^${requiredElectronUpdaterVersion}\"`\n )\n }\n\n const swVersion = dependencies[\"electron-builder-squirrel-windows\"]\n if (swVersion != null && !versionSatisfies(swVersion, \">=20.32.0\")) {\n errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to \"^20.32.0\"`)\n }\n\n const deps = [\"electron\", \"electron-prebuilt\", \"electron-rebuild\"]\n if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== \"true\") {\n deps.push(\"electron-builder\")\n }\n for (const name of deps) {\n if (name in dependencies) {\n errors.push(`Package \"${name}\" is only allowed in \"devDependencies\". ` + `Please remove it from the \"dependencies\" section in your package.json.`)\n }\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { RebuildOptions } from "@electron/rebuild";
2
+ export declare const rebuild: (options: RebuildOptions) => Promise<void>;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rebuild = void 0;
4
+ const cp = require("child_process");
5
+ const path = require("path");
6
+ const builder_util_1 = require("builder-util");
7
+ const rebuild = async (options) => {
8
+ var _a, _b;
9
+ const { arch } = options;
10
+ builder_util_1.log.info({ arch }, `installing native dependencies`);
11
+ const child = cp.fork(path.resolve(__dirname, "remote-rebuild.js"), [JSON.stringify(options)], {
12
+ stdio: ["pipe", "pipe", "pipe", "ipc"],
13
+ });
14
+ let pendingError;
15
+ (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on("data", chunk => {
16
+ builder_util_1.log.info(chunk.toString());
17
+ });
18
+ (_b = child.stderr) === null || _b === void 0 ? void 0 : _b.on("data", chunk => {
19
+ builder_util_1.log.error(chunk.toString());
20
+ });
21
+ child.on("message", (message) => {
22
+ var _a;
23
+ const { moduleName, msg } = message;
24
+ switch (msg) {
25
+ case "module-found": {
26
+ builder_util_1.log.info({ moduleName, arch }, "preparing");
27
+ break;
28
+ }
29
+ case "module-done": {
30
+ builder_util_1.log.info({ moduleName, arch }, "finished");
31
+ break;
32
+ }
33
+ case "module-skip": {
34
+ (_a = builder_util_1.log.debug) === null || _a === void 0 ? void 0 : _a.call(builder_util_1.log, { moduleName, arch }, "skipped. set ENV=electron-rebuild to determine why");
35
+ break;
36
+ }
37
+ case "rebuild-error": {
38
+ pendingError = new Error(message.err.message);
39
+ pendingError.stack = message.err.stack;
40
+ break;
41
+ }
42
+ case "rebuild-done": {
43
+ builder_util_1.log.info("completed installing native dependencies");
44
+ break;
45
+ }
46
+ }
47
+ });
48
+ await new Promise((resolve, reject) => {
49
+ child.on("exit", code => {
50
+ if (code === 0 && !pendingError) {
51
+ resolve();
52
+ }
53
+ else {
54
+ reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`));
55
+ }
56
+ });
57
+ });
58
+ };
59
+ exports.rebuild = rebuild;
60
+ //# sourceMappingURL=rebuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rebuild.js","sourceRoot":"","sources":["../../../src/util/rebuild/rebuild.ts"],"names":[],"mappings":";;;AAAA,oCAAmC;AACnC,6BAA4B;AAE5B,+CAAkC;AAE3B,MAAM,OAAO,GAAG,KAAK,EAAE,OAAuB,EAAiB,EAAE;;IACtE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,gCAAgC,CAAC,CAAA;IAEpD,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;QAC7F,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;KACvC,CAAC,CAAA;IAEF,IAAI,YAAmB,CAAA;IAEvB,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,CAAC,MAAM,E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IACH,CAAC,CAAC,CAAA;IAEF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;YACtB,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBAChC,OAAO,EAAE,CAAA;YACX,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,YAAY,IAAI,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC,CAAA;YAC/E,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AArDY,QAAA,OAAO,WAqDnB","sourcesContent":["import * as cp from \"child_process\"\nimport * as path from \"path\"\nimport { RebuildOptions } from \"@electron/rebuild\"\nimport { log } from \"builder-util\"\n\nexport const rebuild = async (options: RebuildOptions): Promise<void> => {\n const { arch } = options\n log.info({ arch }, `installing native dependencies`)\n\n const child = cp.fork(path.resolve(__dirname, \"remote-rebuild.js\"), [JSON.stringify(options)], {\n stdio: [\"pipe\", \"pipe\", \"pipe\", \"ipc\"],\n })\n\n let pendingError: Error\n\n child.stdout?.on(\"data\", chunk => {\n log.info(chunk.toString())\n })\n child.stderr?.on(\"data\", chunk => {\n log.error(chunk.toString())\n })\n\n child.on(\"message\", (message: { msg: string; moduleName: string; err: { message: string; stack: string } }) => {\n const { moduleName, msg } = message\n switch (msg) {\n case \"module-found\": {\n log.info({ moduleName, arch }, \"preparing\")\n break\n }\n case \"module-done\": {\n log.info({ moduleName, arch }, \"finished\")\n break\n }\n case \"module-skip\": {\n log.debug?.({ moduleName, arch }, \"skipped. set ENV=electron-rebuild to determine why\")\n break\n }\n case \"rebuild-error\": {\n pendingError = new Error(message.err.message)\n pendingError.stack = message.err.stack\n break\n }\n case \"rebuild-done\": {\n log.info(\"completed installing native dependencies\")\n break\n }\n }\n })\n\n await new Promise<void>((resolve, reject) => {\n child.on(\"exit\", code => {\n if (code === 0 && !pendingError) {\n resolve()\n } else {\n reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`))\n }\n })\n })\n}\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rebuild_1 = require("@electron/rebuild");
4
+ if (!process.send) {
5
+ console.error("The remote rebuilder expects to be spawned with an IPC channel");
6
+ process.exit(1);
7
+ }
8
+ const options = JSON.parse(process.argv[2]);
9
+ const rebuilder = (0, rebuild_1.rebuild)(options);
10
+ rebuilder.lifecycle.on("module-found", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-found", moduleName }); });
11
+ rebuilder.lifecycle.on("module-done", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-done", moduleName }); });
12
+ rebuilder.lifecycle.on("module-skip", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-skip", moduleName }); });
13
+ rebuilder
14
+ .then(() => {
15
+ var _a;
16
+ (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "rebuild-done" });
17
+ return process.exit(0);
18
+ })
19
+ .catch(err => {
20
+ var _a;
21
+ (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, {
22
+ msg: "rebuild-error",
23
+ err: {
24
+ message: err.message,
25
+ stack: err.stack,
26
+ },
27
+ });
28
+ process.exit(0);
29
+ });
30
+ //# sourceMappingURL=remote-rebuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-rebuild.js","sourceRoot":"","sources":["../../../src/util/rebuild/remote-rebuild.ts"],"names":[],"mappings":";;AAAA,+CAA2D;AAE3D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAClB,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;IAC/E,OAAO,CAAC,IA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ACjB,CAAC,CAAC,CAAA","sourcesContent":["import { rebuild, RebuildOptions } from \"@electron/rebuild\"\n\nif (!process.send) {\n console.error(\"The remote rebuilder expects to be spawned with an IPC channel\")\n process.exit(1)\n}\n\nconst options: RebuildOptions = JSON.parse(process.argv[2])\n\nconst rebuilder = rebuild(options)\n\nrebuilder.lifecycle.on(\"module-found\", (moduleName: string) => process.send?.({ msg: \"module-found\", moduleName }))\nrebuilder.lifecycle.on(\"module-done\", (moduleName: string) => process.send?.({ msg: \"module-done\", moduleName }))\nrebuilder.lifecycle.on(\"module-skip\", (moduleName: string) => process.send?.({ msg: \"module-skip\", moduleName }))\n\nrebuilder\n .then(() => {\n process.send?.({ msg: \"rebuild-done\" })\n return process.exit(0)\n })\n .catch(err => {\n process.send?.({\n msg: \"rebuild-error\",\n err: {\n message: err.message,\n stack: err.stack,\n },\n })\n process.exit(0)\n })\n"]}
package/out/util/yarn.js CHANGED
@@ -5,6 +5,8 @@ const builder_util_1 = require("builder-util");
5
5
  const fs_extra_1 = require("fs-extra");
6
6
  const os_1 = require("os");
7
7
  const path = require("path");
8
+ const search_module_1 = require("@electron/rebuild/lib/search-module");
9
+ const rebuild_1 = require("./rebuild/rebuild");
8
10
  const appBuilder_1 = require("./appBuilder");
9
11
  async function installOrRebuild(config, appDir, options, forceInstall = false) {
10
12
  const effectiveOptions = {
@@ -20,10 +22,10 @@ async function installOrRebuild(config, appDir, options, forceInstall = false) {
20
22
  }
21
23
  }
22
24
  if (forceInstall || !isDependenciesInstalled) {
23
- await installDependencies(appDir, effectiveOptions);
25
+ await installDependencies(config, appDir, effectiveOptions);
24
26
  }
25
27
  else {
26
- await rebuild(appDir, effectiveOptions);
28
+ await rebuild(config, appDir, effectiveOptions);
27
29
  }
28
30
  }
29
31
  exports.installOrRebuild = installOrRebuild;
@@ -70,7 +72,7 @@ function checkYarnBerry() {
70
72
  const yarnMajorVersion = Number((_a = yarnVersionMatch === null || yarnVersionMatch === void 0 ? void 0 : yarnVersionMatch[1]) !== null && _a !== void 0 ? _a : 0);
71
73
  return yarnMajorVersion >= 2;
72
74
  }
73
- function installDependencies(appDir, options) {
75
+ async function installDependencies(config, appDir, options) {
74
76
  const platform = options.platform || process.platform;
75
77
  const arch = options.arch || process.arch;
76
78
  const additionalArgs = options.additionalArgs;
@@ -97,10 +99,13 @@ function installDependencies(appDir, options) {
97
99
  if (additionalArgs != null) {
98
100
  execArgs.push(...additionalArgs);
99
101
  }
100
- return (0, builder_util_1.spawn)(execPath, execArgs, {
102
+ await (0, builder_util_1.spawn)(execPath, execArgs, {
101
103
  cwd: appDir,
102
104
  env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),
103
105
  });
106
+ // Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)
107
+ // https://github.com/electron-userland/electron-builder/issues/8024
108
+ return rebuild(config, appDir, options);
104
109
  }
105
110
  async function nodeGypRebuild(platform, arch, frameworkInfo) {
106
111
  builder_util_1.log.info({ platform, arch }, "executing node-gyp rebuild");
@@ -134,7 +139,7 @@ function isRunningYarn(execPath) {
134
139
  return process.env.FORCE_YARN === "true" || (execPath != null && path.basename(execPath).startsWith("yarn")) || (userAgent != null && /\byarn\b/.test(userAgent));
135
140
  }
136
141
  /** @internal */
137
- async function rebuild(appDir, options) {
142
+ async function rebuild(config, appDir, options) {
138
143
  const configuration = {
139
144
  dependencies: await options.productionDeps.value,
140
145
  nodeExecPath: process.execPath,
@@ -144,8 +149,31 @@ async function rebuild(appDir, options) {
144
149
  execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,
145
150
  buildFromSource: options.buildFromSource === true,
146
151
  };
147
- const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true);
148
- await (0, appBuilder_1.executeAppBuilderAndWriteJson)(["rebuild-node-modules"], configuration, { env, cwd: appDir });
152
+ if ([undefined, null, "legacy"].includes(config.nativeRebuilder)) {
153
+ const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true);
154
+ return (0, appBuilder_1.executeAppBuilderAndWriteJson)(["rebuild-node-modules"], configuration, { env, cwd: appDir });
155
+ }
156
+ const { frameworkInfo: { version: electronVersion }, } = options;
157
+ const { arch, buildFromSource } = configuration;
158
+ const logInfo = {
159
+ electronVersion,
160
+ arch,
161
+ buildFromSource,
162
+ appDir: builder_util_1.log.filePath(appDir) || "./",
163
+ };
164
+ builder_util_1.log.info(logInfo, "executing @electron/rebuild");
165
+ const rebuildOptions = {
166
+ buildPath: appDir,
167
+ electronVersion,
168
+ arch,
169
+ debug: builder_util_1.log.isDebugEnabled,
170
+ projectRootPath: await (0, search_module_1.getProjectRootPath)(appDir),
171
+ mode: config.nativeRebuilder,
172
+ };
173
+ if (buildFromSource) {
174
+ rebuildOptions.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild";
175
+ }
176
+ return (0, rebuild_1.rebuild)(rebuildOptions);
149
177
  }
150
178
  exports.rebuild = rebuild;
151
179
  //# sourceMappingURL=yarn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,uCAAqC;AAErC,2BAA4B;AAC5B,6BAA4B;AAE5B,6CAA4D;AAGrD,KAAK,UAAU,gBAAgB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAAuB,EAAE,YAAY,GAAG,KAAK;IACzH,MAAM,gBAAgB,GAAG;QACvB,eAAe,EAAE,MAAM,CAAC,2BAA2B,KAAK,IAAI;QAC5D,cAAc,EAAE,IAAA,sBAAO,EAAC,MAAM,CAAC,OAAO,CAAC;QACvC,GAAG,OAAO;KACX,CAAA;IACD,IAAI,uBAAuB,GAAG,KAAK,CAAA;IAEnC,KAAK,MAAM,SAAS,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,CAAC;QACpD,IAAI,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,IAAI,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AU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;AACnK,CAAC;AAcD,gBAAgB;AACT,KAAK,UAAU,OAAO,CAAC,MAAc,EAAE,OAAuB;IACnE,MAAM,aAAa,GAAQ;QACzB,YAAY,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,KAAK;QAChD,YAAY,EAAE,OAAO,CAAC,QAAQ;QAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ;QAC9C,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI;QAClC,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5D,eAAe,EAAE,OAAO,CAAC,eAAe,KAAK,IAAI;KAClD,CAAA;IAED,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,CAAA;IAC1H,MAAM,IAAA,0CAA6B,EAAC,CAAC,sBAAsB,CAAC,EAAE,aAAa,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAA;AACpG,CAAC;AAbD,0BAaC","sourcesContent":["import { asArray, log, spawn } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { executeAppBuilderAndWriteJson } from \"./appBuilder\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\n\nexport async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {\n const effectiveOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if (await pathExists(path.join(appDir, fileOrDir))) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(appDir, effectiveOptions)\n } else {\n await rebuild(appDir, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nfunction checkYarnBerry() {\n const npmUserAgent = process.env[\"npm_config_user_agent\"] || \"\"\n const regex = /yarn\\/(\\d+)\\./gm\n\n const yarnVersionMatch = regex.exec(npmUserAgent)\n const yarnMajorVersion = Number(yarnVersionMatch?.[1] ?? 0)\n return yarnMajorVersion >= 2\n}\n\nfunction installDependencies(appDir: string, options: RebuildOptions): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n log.info({ platform, arch, appDir }, `installing production dependencies`)\n let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS\n const execArgs = [\"install\"]\n const isYarnBerry = checkYarnBerry()\n if (!isYarnBerry) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n execArgs.push(\"--production\")\n }\n\n if (!isRunningYarn(execPath)) {\n execArgs.push(\"--prefer-offline\")\n }\n\n if (execPath == null) {\n execPath = getPackageToolPath()\n } else if (!isYarnBerry) {\n execArgs.unshift(execPath)\n execPath = process.env.npm_node_execpath || process.env.NODE_EXE || \"node\"\n }\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n return spawn(execPath, execArgs, {\n cwd: appDir,\n env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n })\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = `node-gyp${process.platform === \"win32\" ? \".cmd\" : \"\"}`\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\n\nfunction getPackageToolPath() {\n if (process.env.FORCE_YARN === \"true\") {\n return process.platform === \"win32\" ? \"yarn.cmd\" : \"yarn\"\n } else {\n return process.platform === \"win32\" ? \"npm.cmd\" : \"npm\"\n }\n}\n\nfunction isRunningYarn(execPath: string | null | undefined) {\n const userAgent = process.env.npm_config_user_agent\n return process.env.FORCE_YARN === \"true\" || (execPath != null && path.basename(execPath).startsWith(\"yarn\")) || (userAgent != null && /\\byarn\\b/.test(userAgent))\n}\n\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\n/** @internal */\nexport async function rebuild(appDir: string, options: RebuildOptions) {\n const configuration: any = {\n dependencies: await options.productionDeps.value,\n nodeExecPath: process.execPath,\n platform: options.platform || process.platform,\n arch: options.arch || process.arch,\n additionalArgs: options.additionalArgs,\n execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,\n buildFromSource: options.buildFromSource === true,\n }\n\n const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true)\n await executeAppBuilderAndWriteJson([\"rebuild-node-modules\"], configuration, { env, cwd: appDir })\n}\n"]}
1
+ {"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,uCAAqC;AAErC,2BAA4B;AAC5B,6BAA4B;AAI5B,uEAAwE;AACxE,+CAA4D;AAC5D,6CAA4D;AAGrD,KAAK,UAAU,gBAAgB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAAuB,EAAE,YAAY,GAAG,KAAK;IACzH,MAAM,gBAAgB,GAAmB;QACvC,eAAe,EAAE,MAAM,CAAC,2BAA2B,KAAK,IAAI;QAC5D,cAAc,EAAE,IAAA,sBAAO,EAAC,MAAM,CAAC,OAAO,CAAC;QACvC,GAAG,OAAO;KACX,CAAA;IACD,IAAI,uBAAuB,GAAG,KAAK,CAAA;IAEnC,KAAK,MAAM,SAAS,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,CAAC;QACpD,IAAI,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EAA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I,EAAE,eAAe,EAAE,GAAG,aAAa,CAAA;IAC/C,MAAM,OAAO,GAAG;QACd,eAAe;QACf,IAAI;QACJ,eAAe;QACf,MAAM,EAAE,kBAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI;KACrC,CAAA;IACD,kBAAG,CAAC,IAAI,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAA;IAEhD,MAAM,cAAc,GAAmC;QACrD,SAAS,EAAE,MAAM;QACjB,eAAe;QACf,IAAI;QACJ,KAAK,EAAE,kBAAG,CAAC,cAAc;QACzB,eAAe,EAAE,MAAM,IAAA,kCAAkB,EAAC,MAAM,CAAC;QACjD,IAAI,EAAE,MAAM,CAAC,eAA8B;KAC5C,CAAA;IACD,IAAI,eAAe,EAAE,CAAC;QACpB,cAAc,CAAC,iBAAiB,GAAG,4CAA4C,CAAA;IACjF,CAAC;IACD,OAAO,IAAA,iBAAa,EAAC,cAAc,CAAC,CAAA;AACtC,CAAC;AAvCD,0BAuCC","sourcesContent":["import { asArray, log, spawn } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\nimport * as electronRebuild from \"@electron/rebuild\"\nimport { getProjectRootPath } from \"@electron/rebuild/lib/search-module\"\nimport { rebuild as remoteRebuild } from \"./rebuild/rebuild\"\nimport { executeAppBuilderAndWriteJson } from \"./appBuilder\"\nimport { RebuildMode } from \"@electron/rebuild/lib/types\"\n\nexport async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {\n const effectiveOptions: RebuildOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if (await pathExists(path.join(appDir, fileOrDir))) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(config, appDir, effectiveOptions)\n } else {\n await rebuild(config, appDir, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nfunction checkYarnBerry() {\n const npmUserAgent = process.env[\"npm_config_user_agent\"] || \"\"\n const regex = /yarn\\/(\\d+)\\./gm\n\n const yarnVersionMatch = regex.exec(npmUserAgent)\n const yarnMajorVersion = Number(yarnVersionMatch?.[1] ?? 0)\n return yarnMajorVersion >= 2\n}\n\nasync function installDependencies(config: Configuration, appDir: string, options: RebuildOptions): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n log.info({ platform, arch, appDir }, `installing production dependencies`)\n let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS\n const execArgs = [\"install\"]\n const isYarnBerry = checkYarnBerry()\n if (!isYarnBerry) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n execArgs.push(\"--production\")\n }\n\n if (!isRunningYarn(execPath)) {\n execArgs.push(\"--prefer-offline\")\n }\n\n if (execPath == null) {\n execPath = getPackageToolPath()\n } else if (!isYarnBerry) {\n execArgs.unshift(execPath)\n execPath = process.env.npm_node_execpath || process.env.NODE_EXE || \"node\"\n }\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n await spawn(execPath, execArgs, {\n cwd: appDir,\n env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n })\n\n // Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)\n // https://github.com/electron-userland/electron-builder/issues/8024\n return rebuild(config, appDir, options)\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = `node-gyp${process.platform === \"win32\" ? \".cmd\" : \"\"}`\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\n\nfunction getPackageToolPath() {\n if (process.env.FORCE_YARN === \"true\") {\n return process.platform === \"win32\" ? \"yarn.cmd\" : \"yarn\"\n } else {\n return process.platform === \"win32\" ? \"npm.cmd\" : \"npm\"\n }\n}\n\nfunction isRunningYarn(execPath: string | null | undefined) {\n const userAgent = process.env.npm_config_user_agent\n return process.env.FORCE_YARN === \"true\" || (execPath != null && path.basename(execPath).startsWith(\"yarn\")) || (userAgent != null && /\\byarn\\b/.test(userAgent))\n}\n\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\n/** @internal */\nexport async function rebuild(config: Configuration, appDir: string, options: RebuildOptions) {\n const configuration = {\n dependencies: await options.productionDeps.value,\n nodeExecPath: process.execPath,\n platform: options.platform || process.platform,\n arch: options.arch || process.arch,\n additionalArgs: options.additionalArgs,\n execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,\n buildFromSource: options.buildFromSource === true,\n }\n if ([undefined, null, \"legacy\"].includes(config.nativeRebuilder)) {\n const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true)\n return executeAppBuilderAndWriteJson([\"rebuild-node-modules\"], configuration, { env, cwd: appDir })\n }\n\n const {\n frameworkInfo: { version: electronVersion },\n } = options\n const { arch, buildFromSource } = configuration\n const logInfo = {\n electronVersion,\n arch,\n buildFromSource,\n appDir: log.filePath(appDir) || \"./\",\n }\n log.info(logInfo, \"executing @electron/rebuild\")\n\n const rebuildOptions: electronRebuild.RebuildOptions = {\n buildPath: appDir,\n electronVersion,\n arch,\n debug: log.isDebugEnabled,\n projectRootPath: await getProjectRootPath(appDir),\n mode: config.nativeRebuilder as RebuildMode,\n }\n if (buildFromSource) {\n rebuildOptions.prebuildTagPrefix = \"totally-not-a-real-prefix-to-force-rebuild\"\n }\n return remoteRebuild(rebuildOptions)\n}\n"]}
package/out/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "24.13.4-alpha.0";
1
+ export declare const PACKAGE_VERSION = "25.0.0-alpha.1";
package/out/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PACKAGE_VERSION = void 0;
4
- exports.PACKAGE_VERSION = "24.13.4-alpha.0";
4
+ exports.PACKAGE_VERSION = "25.0.0-alpha.1";
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,iBAAiB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"24.13.4-alpha.0\"\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,gBAAgB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"25.0.0-alpha.1\"\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "app-builder-lib",
3
3
  "description": "electron-builder lib",
4
- "version": "24.13.4-alpha.0",
4
+ "version": "25.0.0-alpha.1",
5
5
  "main": "out/index.js",
6
6
  "files": [
7
7
  "out",
@@ -49,6 +49,7 @@
49
49
  "@develar/schema-utils": "~2.6.5",
50
50
  "@electron/notarize": "2.2.1",
51
51
  "@electron/osx-sign": "1.0.5",
52
+ "@electron/rebuild": "3.6.0",
52
53
  "@electron/universal": "1.5.1",
53
54
  "@malept/flatpak-bundler": "^0.4.0",
54
55
  "@types/fs-extra": "9.0.13",
@@ -70,9 +71,9 @@
70
71
  "semver": "^7.3.8",
71
72
  "tar": "^6.1.12",
72
73
  "temp-file": "^3.4.0",
73
- "builder-util": "24.13.4-alpha.0",
74
- "builder-util-runtime": "9.2.5-alpha.0",
75
- "electron-publish": "24.13.4-alpha.0"
74
+ "builder-util": "25.0.0-alpha.1",
75
+ "builder-util-runtime": "9.2.5-alpha.1",
76
+ "electron-publish": "25.0.0-alpha.1"
76
77
  },
77
78
  "///": "babel in devDependencies for proton tests",
78
79
  "devDependencies": {
@@ -102,12 +103,12 @@
102
103
  "@types/js-yaml": "4.0.3",
103
104
  "@types/semver": "7.3.8",
104
105
  "@types/tar": "^6.1.3",
105
- "dmg-builder": "24.13.4-alpha.0",
106
- "electron-builder-squirrel-windows": "24.13.4-alpha.0"
106
+ "electron-builder-squirrel-windows": "25.0.0-alpha.1",
107
+ "dmg-builder": "25.0.0-alpha.1"
107
108
  },
108
109
  "peerDependencies": {
109
- "electron-builder-squirrel-windows": "24.13.4-alpha.0",
110
- "dmg-builder": "24.13.4-alpha.0"
110
+ "dmg-builder": "25.0.0-alpha.1",
111
+ "electron-builder-squirrel-windows": "25.0.0-alpha.1"
111
112
  },
112
113
  "//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)",
113
114
  "typings": "./out/index.d.ts"
package/scheme.json CHANGED
@@ -7463,6 +7463,23 @@
7463
7463
  }
7464
7464
  ]
7465
7465
  },
7466
+ "nativeRebuilder": {
7467
+ "anyOf": [
7468
+ {
7469
+ "enum": [
7470
+ "legacy",
7471
+ "parallel",
7472
+ "sequential"
7473
+ ],
7474
+ "type": "string"
7475
+ },
7476
+ {
7477
+ "type": "null"
7478
+ }
7479
+ ],
7480
+ "default": "legacy",
7481
+ "description": "Use `legacy` app-builder binary for installing native dependencies, or @electron/rebuild in `sequential` or `parallel` compilation modes."
7482
+ },
7466
7483
  "nodeGypRebuild": {
7467
7484
  "default": false,
7468
7485
  "description": "Whether to execute `node-gyp rebuild` before starting to package the app.\n\nDon't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.",