diff --git a/.changeset/flat-jars-glow.md b/.changeset/flat-jars-glow.md new file mode 100644 index 00000000000..b645a198c34 --- /dev/null +++ b/.changeset/flat-jars-glow.md @@ -0,0 +1,6 @@ +--- +"app-builder-lib": patch +"electron-builder": patch +--- + +fix: "Can't reconcile two non-macho files" due to `disablePreGypCopy` functionality in new electron/rebuild integration diff --git a/packages/app-builder-lib/src/fileMatcher.ts b/packages/app-builder-lib/src/fileMatcher.ts index d8062778fef..a7e2dfa1671 100644 --- a/packages/app-builder-lib/src/fileMatcher.ts +++ b/packages/app-builder-lib/src/fileMatcher.ts @@ -17,9 +17,12 @@ export const excludedNames = "__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore," + ".idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci," + ".yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log," + - "appveyor.yml,.travis.yml,circle.yml,.nyc_output" + "appveyor.yml,.travis.yml,circle.yml,.nyc_output,.husky,.github" -export const excludedExts = "iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts" +export const excludedExts = + "iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts," + + // https://github.com/electron-userland/electron-builder/issues/7512 + "mk,a,o,forge-meta" function ensureNoEndSlash(file: string): string { if (path.sep !== "/") { diff --git a/packages/app-builder-lib/src/macPackager.ts b/packages/app-builder-lib/src/macPackager.ts index dfbb2632542..677cfb40870 100644 --- a/packages/app-builder-lib/src/macPackager.ts +++ b/packages/app-builder-lib/src/macPackager.ts @@ -106,11 +106,13 @@ export default class MacPackager extends PlatformPackager { return super.doPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets) } case Arch.universal: { + const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp` + const x64Arch = Arch.x64 - const x64AppOutDir = appOutDir + "--" + Arch[x64Arch] + const x64AppOutDir = outDirName(x64Arch) await super.doPack(outDir, x64AppOutDir, platformName, x64Arch, platformSpecificBuildOptions, targets, false, true) const arm64Arch = Arch.arm64 - const arm64AppOutPath = appOutDir + "--" + Arch[arm64Arch] + const arm64AppOutPath = outDirName(arm64Arch) await super.doPack(outDir, arm64AppOutPath, platformName, arm64Arch, platformSpecificBuildOptions, targets, false, true) const framework = this.info.framework log.info( diff --git a/packages/app-builder-lib/src/packager.ts b/packages/app-builder-lib/src/packager.ts index b67b4e8154f..c61e01651d1 100644 --- a/packages/app-builder-lib/src/packager.ts +++ b/packages/app-builder-lib/src/packager.ts @@ -495,7 +495,7 @@ export class Packager { const frameworkInfo = { version: this.framework.version, useCustomDist: true } const config = this.config if (config.nodeGypRebuild === true) { - await nodeGypRebuild(frameworkInfo, Arch[arch]) + await nodeGypRebuild(frameworkInfo, arch) } if (config.npmRebuild === false) { @@ -526,7 +526,6 @@ export class Packager { frameworkInfo, platform: platform.nodeName, arch: Arch[arch], - productionDeps: this.getNodeDependencyInfo(null), }) } } diff --git a/packages/app-builder-lib/src/util/yarn.ts b/packages/app-builder-lib/src/util/yarn.ts index 49e28e6a80b..b3d0751193f 100644 --- a/packages/app-builder-lib/src/util/yarn.ts +++ b/packages/app-builder-lib/src/util/yarn.ts @@ -1,10 +1,8 @@ -import { asArray, log, spawn } from "builder-util" +import { Arch, archFromString, asArray, log, spawn } from "builder-util" import { pathExists } from "fs-extra" -import { Lazy } from "lazy-val" import { homedir } from "os" import * as path from "path" import { Configuration } from "../configuration" -import { NodeModuleDirInfo } from "./packageDependencies" import * as electronRebuild from "@electron/rebuild" import * as searchModule from "@electron/rebuild/lib/src/search-module" @@ -25,7 +23,8 @@ export async function installOrRebuild(config: Configuration, appDir: string, op } await installDependencies(appDir, effectiveOptions) } else { - await rebuild(appDir, config.buildDependenciesFromSource === true, options.frameworkInfo, options.arch) + const arch = archFromString(options.arch || process.arch) + await rebuild(appDir, config.buildDependenciesFromSource === true, options.frameworkInfo, arch) } } @@ -118,7 +117,7 @@ function installDependencies(appDir: string, options: RebuildOptions): Promise> platform?: NodeJS.Platform arch?: string @@ -148,15 +146,15 @@ export interface RebuildOptions { } /** @internal */ -export async function rebuild(appDir: string, buildFromSource: boolean, frameworkInfo: DesktopFrameworkInfo, arch = process.arch) { - log.info({ arch, version: frameworkInfo.version, appDir }, "executing @electron/rebuild") +export async function rebuild(appDir: string, buildFromSource: boolean, frameworkInfo: DesktopFrameworkInfo, arch: Arch) { + log.info({ arch: Arch[arch], version: frameworkInfo.version, appDir }, "executing @electron/rebuild") const rootPath = await searchModule.getProjectRootPath(appDir) const options: electronRebuild.RebuildOptions = { buildPath: appDir, electronVersion: frameworkInfo.version, - arch, - debug: log.isDebugEnabled, + arch: Arch[arch], projectRootPath: rootPath, + disablePreGypCopy: true, } if (buildFromSource) { options.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild" diff --git a/packages/electron-builder/src/cli/install-app-deps.ts b/packages/electron-builder/src/cli/install-app-deps.ts index e6736b68554..a40f0cf6ab0 100644 --- a/packages/electron-builder/src/cli/install-app-deps.ts +++ b/packages/electron-builder/src/cli/install-app-deps.ts @@ -1,12 +1,11 @@ #! /usr/bin/env node -import { PACKAGE_VERSION } from "app-builder-lib/out/version" -import { log, use, getArchCliNames } from "builder-util" -import { printErrorAndExit } from "builder-util/out/promise" -import { computeDefaultAppDirectory, getConfig } from "app-builder-lib/out/util/config" import { getElectronVersion } from "app-builder-lib/out/electron/electronVersion" -import { createLazyProductionDeps } from "app-builder-lib/out/util/packageDependencies" +import { computeDefaultAppDirectory, getConfig } from "app-builder-lib/out/util/config" import { installOrRebuild } from "app-builder-lib/out/util/yarn" +import { PACKAGE_VERSION } from "app-builder-lib/out/version" +import { getArchCliNames, log, use } from "builder-util" +import { printErrorAndExit } from "builder-util/out/promise" import { readJson } from "fs-extra" import { Lazy } from "lazy-val" import * as path from "path" @@ -63,7 +62,6 @@ export async function installAppDeps(args: any) { frameworkInfo: { version, useCustomDist: true }, platform: args.platform, arch: args.arch, - productionDeps: createLazyProductionDeps(appDir, null), }, appDir !== projectDir ) diff --git a/test/fixtures/test-app-two-native-modules/app/package.json b/test/fixtures/test-app-two-native-modules/app/package.json index dca3acae848..7204c4a9c66 100644 --- a/test/fixtures/test-app-two-native-modules/app/package.json +++ b/test/fixtures/test-app-two-native-modules/app/package.json @@ -3,6 +3,9 @@ "main": "index.js", "version": "1.1.1", "dependencies": { - "install": "0.13.0" + "debug": "4.1.1" + }, + "optionalDependencies": { + "node-mac-permissions": "^2.3.0" } } diff --git a/test/snapshots/BuildTest.js.snap b/test/snapshots/BuildTest.js.snap index d3db7ad946a..b1e92489911 100644 --- a/test/snapshots/BuildTest.js.snap +++ b/test/snapshots/BuildTest.js.snap @@ -957,13 +957,6 @@ Object { }, "minimist": Object { "files": Object { - ".github": Object { - "files": Object { - "FUNDING.yml": Object { - "size": "", - }, - }, - }, ".nycrc": Object { "size": "", }, diff --git a/test/snapshots/ExtraBuildTest.js.snap b/test/snapshots/ExtraBuildResourcesTest.js.snap similarity index 100% rename from test/snapshots/ExtraBuildTest.js.snap rename to test/snapshots/ExtraBuildResourcesTest.js.snap diff --git a/test/snapshots/HoistedNodeModuleTest.js.snap b/test/snapshots/HoistedNodeModuleTest.js.snap index 8f8cb5485e9..88a95ef833e 100644 --- a/test/snapshots/HoistedNodeModuleTest.js.snap +++ b/test/snapshots/HoistedNodeModuleTest.js.snap @@ -185,45 +185,67 @@ Object { }, "node_modules": Object { "files": Object { - "install": Object { + "debug": Object { "files": Object { "LICENSE": Object { - "offset": "3479", - "size": 1101, + "offset": "3546", + "size": 1107, }, - "install.js": Object { - "offset": "4580", - "size": 19880, - }, - "install.min.js": Object { - "offset": "24460", - "size": 3663, + "dist": Object { + "files": Object { + "debug.js": Object { + "offset": "22150", + "size": 27572, + }, + }, }, "package.json": Object { - "offset": "28123", - "size": 529, + "offset": "4653", + "size": 947, }, - "scripts": Object { + "src": Object { "files": Object { - "docs.sh": Object { - "executable": true, - "offset": "28652", - "size": 99, + "browser.js": Object { + "offset": "5600", + "size": 5831, }, - "prepublish.sh": Object { - "executable": true, - "offset": "28751", - "size": 83, + "common.js": Object { + "offset": "11431", + "size": 5930, + }, + "index.js": Object { + "offset": "17361", + "size": 314, + }, + "node.js": Object { + "offset": "17675", + "size": 4475, }, }, }, }, }, + "ms": Object { + "files": Object { + "index.js": Object { + "offset": "49722", + "size": 3024, + }, + "license.md": Object { + "offset": "52746", + "size": 1079, + }, + "package.json": Object { + "offset": "53825", + "size": 497, + }, + }, + }, }, }, "package.json": Object { "offset": "3342", - "size": 137, + "size": 204, }, }, } diff --git a/test/snapshots/mac/macPackagerTest.js.snap b/test/snapshots/mac/macPackagerTest.js.snap index 2e53c81d894..15155c1df43 100644 --- a/test/snapshots/mac/macPackagerTest.js.snap +++ b/test/snapshots/mac/macPackagerTest.js.snap @@ -414,3 +414,217 @@ Array [ "icon.icns", ] `; + +exports[`yarn two package.json w/ native module 1`] = ` +Object { + "mac": Array [ + Object { + "arch": "universal", + "file": "test-app-two-native-modules-1.1.1-universal-mac.zip", + "updateInfo": Object { + "sha512": "@sha512", + "size": "@size", + }, + }, + Object { + "file": "test-app-two-native-modules-1.1.1-universal-mac.zip.blockmap", + "safeArtifactName": "test-app-two-native-modules-1.1.1-universal-mac.zip.blockmap", + "updateInfo": Object { + "sha512": "@sha512", + "size": "@size", + }, + }, + ], +} +`; + +exports[`yarn two package.json w/ native module 2`] = ` +Object { + "CFBundleDisplayName": "test-app-two-native-modules", + "CFBundleExecutable": "test-app-two-native-modules", + "CFBundleIconFile": "electron.icns", + "CFBundleIdentifier": "org.electron-builder.testApp2", + "CFBundleInfoDictionaryVersion": "6.0", + "CFBundleName": "test-app-two-native-modules", + "CFBundlePackageType": "APPL", + "CFBundleShortVersionString": "1.1.1", + "LSApplicationCategoryType": "your.app.category.type", + "LSEnvironment": Object { + "MallocNanoZone": "0", + }, + "NSAppTransportSecurity": Object { + "NSAllowsLocalNetworking": true, + "NSExceptionDomains": Object { + "127.0.0.1": Object { + "NSIncludesSubdomains": false, + "NSTemporaryExceptionAllowsInsecureHTTPLoads": true, + "NSTemporaryExceptionAllowsInsecureHTTPSLoads": false, + "NSTemporaryExceptionMinimumTLSVersion": "1.0", + "NSTemporaryExceptionRequiresForwardSecrecy": false, + }, + "localhost": Object { + "NSIncludesSubdomains": false, + "NSTemporaryExceptionAllowsInsecureHTTPLoads": true, + "NSTemporaryExceptionAllowsInsecureHTTPSLoads": false, + "NSTemporaryExceptionMinimumTLSVersion": "1.0", + "NSTemporaryExceptionRequiresForwardSecrecy": false, + }, + }, + }, + "NSBluetoothAlwaysUsageDescription": "This app needs access to Bluetooth", + "NSBluetoothPeripheralUsageDescription": "This app needs access to Bluetooth", + "NSHighResolutionCapable": true, + "NSPrincipalClass": "AtomApplication", + "NSSupportsAutomaticGraphicsSwitching": true, +} +`; + +exports[`yarn two package.json w/ native module 3`] = ` +Object { + "files": Object { + "index.html": Object { + "size": "", + }, + "index.js": Object { + "size": "", + }, + "node_modules": Object { + "files": Object { + "debug": Object { + "files": Object { + "LICENSE": Object { + "size": "", + }, + "dist": Object { + "files": Object { + "debug.js": Object { + "size": "", + }, + }, + }, + "package.json": Object { + "size": "", + }, + "src": Object { + "files": Object { + "browser.js": Object { + "size": "", + }, + "common.js": Object { + "size": "", + }, + "index.js": Object { + "size": "", + }, + "node.js": Object { + "size": "", + }, + }, + }, + }, + }, + "node-mac-permissions": Object { + "files": Object { + ".prettierrc": Object { + "size": "", + "unpacked": true, + }, + "LICENSE": Object { + "size": "", + "unpacked": true, + }, + "build": Object { + "files": Object { + "Release": Object { + "files": Object { + "permissions.node": Object { + "size": "", + "unpacked": true, + }, + }, + }, + "node_gyp_bins": Object { + "files": Object { + "python3": Object { + "size": "", + "unpacked": true, + }, + }, + }, + }, + }, + "index.js": Object { + "size": "", + "unpacked": true, + }, + "package.json": Object { + "size": "", + "unpacked": true, + }, + "permissions.mm": Object { + "size": "", + "unpacked": true, + }, + }, + }, + }, + }, + "package.json": Object { + "size": "", + }, + }, +} +`; + +exports[`yarn two package.json w/ native module 4`] = ` +Array [ + "app.asar", + "electron.icns", + "app.asar.unpacked/node_modules/node-mac-permissions/LICENSE", + "app.asar.unpacked/node_modules/node-mac-permissions/index.js", + Object { + "content": "{ + \\"name\\": \\"node-mac-permissions\\", + \\"version\\": \\"2.3.0\\", + \\"description\\": \\"A native node module to manage system permissions on macOS\\", + \\"main\\": \\"index.js\\", + \\"types\\": \\"index.d.ts\\", + \\"repository\\": { + \\"type\\": \\"git\\", + \\"url\\": \\"git+https://github.com/codebytere/node-mac-permissions.git\\" + }, + \\"author\\": \\"Shelley Vohr \\", + \\"license\\": \\"MIT\\", + \\"homepage\\": \\"https://github.com/codebytere/node-mac-permissions#readme\\", + \\"dependencies\\": { + \\"bindings\\": \\"^1.5.0\\", + \\"node-addon-api\\": \\"^3.0.2\\" + }, + \\"devDependencies\\": { + \\"chai\\": \\"^4.3.6\\", + \\"clang-format\\": \\"1.8.0\\", + \\"husky\\": \\"^8.0.1\\", + \\"lint-staged\\": \\"^12.4.1\\", + \\"mocha\\": \\"^10.0.0\\", + \\"node-gyp\\": \\"^9.0.0\\", + \\"prettier\\": \\"^2.6.2\\" + }, + \\"lint-staged\\": { + \\"*.js\\": [ + \\"prettier --write\\" + ], + \\"*.mm\\": [ + \\"clang-format -i\\" + ] + }, + \\"os\\": [ + \\"darwin\\" + ] +}", + "name": "app.asar.unpacked/node_modules/node-mac-permissions/package.json", + }, + "app.asar.unpacked/node_modules/node-mac-permissions/permissions.mm", + "app.asar.unpacked/node_modules/node-mac-permissions/build/node_gyp_bins/python3", + "app.asar.unpacked/node_modules/node-mac-permissions/build/Release/permissions.node", +] +`; diff --git a/test/src/BuildTest.ts b/test/src/BuildTest.ts index 9acad6de145..eb266f29090 100644 --- a/test/src/BuildTest.ts +++ b/test/src/BuildTest.ts @@ -1,14 +1,13 @@ import { checkBuildRequestOptions } from "app-builder-lib" -import { readAsar } from "app-builder-lib/out/asar/asar" import { doMergeConfigs } from "app-builder-lib/out/util/config" -import { walk } from "builder-util/out/fs" import { Arch, createTargets, DIR_TARGET, Platform } from "electron-builder" -import { promises as fs, readFileSync } from "fs" +import { promises as fs } from "fs" import { outputJson } from "fs-extra" import * as path from "path" import { createYargs } from "electron-builder/out/builder" import { app, appTwo, appTwoThrows, assertPack, linuxDirTarget, modifyPackageJson, packageJson, toSystemIndependentPath } from "./helpers/packTester" import { ELECTRON_VERSION } from "./helpers/testConfig" +import { verifySmartUnpack } from "./helpers/verifySmartUnpack" test("cli", async () => { // because these methods are internal @@ -322,42 +321,6 @@ test.ifDevOrLinuxCi("win smart unpack", () => { )() }) -export function removeUnstableProperties(data: any) { - return JSON.parse( - JSON.stringify(data, (name, value) => { - if (name === "offset") { - return undefined - } - if (value.size != null) { - // size differs on various OS and subdependencies aren't pinned, so this will randomly fail when subdependency resolution versions change - value.size = "" - } - // Keep existing test coverage - if (value.integrity) { - delete value.integrity - } - return value - }) - ) -} - -async function verifySmartUnpack(resourceDir: string) { - const asarFs = await readAsar(path.join(resourceDir, "app.asar")) - expect(await asarFs.readJson(`node_modules${path.sep}debug${path.sep}package.json`)).toMatchObject({ - name: "debug", - }) - expect(removeUnstableProperties(asarFs.header)).toMatchSnapshot() - - const files = (await walk(resourceDir, file => !path.basename(file).startsWith(".") && !file.endsWith(`resources${path.sep}inspector`))).map(it => { - const name = toSystemIndependentPath(it.substring(resourceDir.length + 1)) - if (it.endsWith("package.json")) { - return { name, content: readFileSync(it, "utf-8") } - } - return name - }) - expect(files).toMatchSnapshot() -} - // https://github.com/electron-userland/electron-builder/issues/1738 test.ifDevOrLinuxCi( "posix smart unpack", diff --git a/test/src/ExtraBuildTest.ts b/test/src/ExtraBuildResourcesTest.ts similarity index 100% rename from test/src/ExtraBuildTest.ts rename to test/src/ExtraBuildResourcesTest.ts diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index d2da5065d45..1e7ec159677 100644 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -52,7 +52,7 @@ export interface PackedContext { readonly outDir: string readonly getResources: (platform: Platform, arch?: Arch) => string - readonly getContent: (platform: Platform) => string + readonly getContent: (platform: Platform, arch?: Arch) => string readonly packager: Packager @@ -141,14 +141,18 @@ export async function assertPack(fixtureName: string, packagerOptions: PackagerO if (checkOptions.packed != null) { const base = function (platform: Platform, arch?: Arch): string { - return path.join(outDir, `${platform.buildConfigurationKey}${getArchSuffix(arch == null ? Arch.x64 : arch)}${platform === Platform.MAC ? "" : "-unpacked"}`) + return path.join( + outDir, + `${platform.buildConfigurationKey}${getArchSuffix(arch == null ? Arch.x64 : arch)}${platform === Platform.MAC ? "" : "-unpacked"}`, + platform === Platform.MAC ? `${packager.appInfo.productFilename}.app/Contents` : "" + ) } await checkOptions.packed({ projectDir, outDir, - getResources: (platform, arch) => path.join(base(platform, arch), "resources"), - getContent: platform => base(platform), + getResources: (platform, arch) => path.join(base(platform, arch), platform === Platform.MAC ? "Resources" : "resources"), + getContent: (platform, arch) => base(platform, arch), packager, tmpDir, }) @@ -259,7 +263,8 @@ async function packAndCheck(packagerOptions: PackagerOptions, checkOptions: Asse const nameToTarget = platformToTargets.get(platform)! if (platform === Platform.MAC) { - const packedAppDir = path.join(outDir, nameToTarget.has("mas-dev") ? "mas-dev" : nameToTarget.has("mas") ? "mas" : "mac", `${packager.appInfo.productFilename}.app`) + const subDir = nameToTarget.has("mas-dev") ? "mas-dev" : nameToTarget.has("mas") ? "mas" : "mac" + const packedAppDir = path.join(outDir, `${subDir}${getArchSuffix(arch)}`, `${packager.appInfo.productFilename}.app`) await checkMacResult(packager, packagerOptions, checkOptions, packedAppDir) } else if (platform === Platform.LINUX) { await checkLinuxResult(outDir, packager, arch, nameToTarget) @@ -322,7 +327,8 @@ function parseDebControl(info: string): any { async function checkMacResult(packager: Packager, packagerOptions: PackagerOptions, checkOptions: AssertPackOptions, packedAppDir: string) { const appInfo = packager.appInfo - const info = (await executeAppBuilderAsJson>(["decode-plist", "-f", path.join(packedAppDir, "Contents", "Info.plist")]))[0] + const plistPath = path.join(packedAppDir, "Contents", "Info.plist") + const info = (await executeAppBuilderAsJson>(["decode-plist", "-f", plistPath]))[0] expect(info).toMatchObject({ CFBundleVersion: info.CFBundleVersion === "50" ? "50" : `${appInfo.version}.${process.env.TRAVIS_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM}`, diff --git a/test/src/helpers/verifySmartUnpack.ts b/test/src/helpers/verifySmartUnpack.ts new file mode 100644 index 00000000000..51076516141 --- /dev/null +++ b/test/src/helpers/verifySmartUnpack.ts @@ -0,0 +1,41 @@ +import { readAsar } from "app-builder-lib/out/asar/asar" +import { walk } from "builder-util/out/fs" +import { readFileSync } from "fs" +import * as path from "path" +import { toSystemIndependentPath } from "./packTester" + +export function removeUnstableProperties(data: any) { + return JSON.parse( + JSON.stringify(data, (name, value) => { + if (name === "offset") { + return undefined + } + if (value.size != null) { + // size differs on various OS and subdependencies aren't pinned, so this will randomly fail when subdependency resolution versions change + value.size = "" + } + // Keep existing test coverage + if (value.integrity) { + delete value.integrity + } + return value + }) + ) +} + +export async function verifySmartUnpack(resourceDir: string) { + const asarFs = await readAsar(path.join(resourceDir, "app.asar")) + expect(await asarFs.readJson(`node_modules${path.sep}debug${path.sep}package.json`)).toMatchObject({ + name: "debug", + }) + expect(removeUnstableProperties(asarFs.header)).toMatchSnapshot() + + const files = (await walk(resourceDir, file => !path.basename(file).startsWith(".") && !file.endsWith(`resources${path.sep}inspector`))).map(it => { + const name = toSystemIndependentPath(it.substring(resourceDir.length + 1)) + if (it.endsWith("package.json")) { + return { name, content: readFileSync(it, "utf-8") } + } + return name + }) + expect(files).toMatchSnapshot() +} diff --git a/test/src/mac/macPackagerTest.ts b/test/src/mac/macPackagerTest.ts index f9f090eacbd..70d5c9106cd 100644 --- a/test/src/mac/macPackagerTest.ts +++ b/test/src/mac/macPackagerTest.ts @@ -4,6 +4,7 @@ import * as fs from "fs/promises" import * as path from "path" import { assertThat } from "../helpers/fileAssert" import { app, appThrows, assertPack, platform } from "../helpers/packTester" +import { verifySmartUnpack } from "../helpers/verifySmartUnpack" test.ifMac.ifAll("two-package", () => assertPack( @@ -95,6 +96,22 @@ test.ifMac( ) ) +test.ifMac("yarn two package.json w/ native module", () => + assertPack( + "test-app-two-native-modules", + { + targets: Platform.MAC.createTarget("zip", Arch.universal), + config: { + npmRebuild: true, + }, + }, + { + signed: false, + packed: async context => await verifySmartUnpack(context.getResources(Platform.MAC, Arch.universal)), + } + ) +) + test.ifMac.ifAll( "electronDist", appThrows({