diff --git a/package.json b/package.json index 7d4df585ab..178e44ba38 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@types/debug": "^4.1.4", "@types/is-ci": "^2.0.0", "@types/semver": "^6.0.1", - "app-builder-bin": "3.0.1", + "app-builder-bin": "3.0.2", "archiver": "^3.0.0", "async-exit-hook": "^2.0.1", "bluebird-lst": "^1.0.9", diff --git a/packages/app-builder-lib/package.json b/packages/app-builder-lib/package.json index 576750278a..98136ee642 100644 --- a/packages/app-builder-lib/package.json +++ b/packages/app-builder-lib/package.json @@ -42,7 +42,6 @@ "homepage": "https://github.com/electron-userland/electron-builder", "dependencies": { "7zip-bin": "~4.1.0", - "app-builder-bin": "3.0.1", "async-exit-hook": "^2.0.1", "bluebird-lst": "^1.0.9", "chromium-pickle-js": "^0.2.0", diff --git a/packages/app-builder-lib/scheme.json b/packages/app-builder-lib/scheme.json index 2774d14125..9ed54a2ca4 100644 --- a/packages/app-builder-lib/scheme.json +++ b/packages/app-builder-lib/scheme.json @@ -1236,19 +1236,6 @@ "string" ] }, - "depends": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ] - }, "description": { "description": "As [description](/configuration/configuration#Metadata-description) from application package.json, but allows you to specify different for Linux.", "type": [ diff --git a/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts b/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts index 80cc449a7a..85422ae4f0 100644 --- a/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts +++ b/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts @@ -28,7 +28,7 @@ export interface WindowsSignOptions { } export interface WindowsSignTaskConfiguration extends WindowsSignOptions { - // set if output path differs from input (e.g. osslsigncode cannot sign file inplace) + // set if output path differs from input (e.g. osslsigncode cannot sign file in-place) resultOutputPath?: string hash: string diff --git a/packages/app-builder-lib/src/options/linuxOptions.ts b/packages/app-builder-lib/src/options/linuxOptions.ts index 7d00f1f55f..f83d6dd2f4 100644 --- a/packages/app-builder-lib/src/options/linuxOptions.ts +++ b/packages/app-builder-lib/src/options/linuxOptions.ts @@ -21,12 +21,6 @@ export interface LinuxConfiguration extends CommonLinuxOptions, PlatformSpecific */ readonly vendor?: string | null - /** - * @deprecated - * @private - */ - readonly depends?: Array | null - /** * The executable name. Defaults to `productName`. * Cannot be specified per target, allowed only in the `linux`. diff --git a/packages/app-builder-lib/src/packager.ts b/packages/app-builder-lib/src/packager.ts index a1a6cfd793..5c6c2a8d59 100644 --- a/packages/app-builder-lib/src/packager.ts +++ b/packages/app-builder-lib/src/packager.ts @@ -238,7 +238,7 @@ export class Packager { } try { - log.info({version: PACKAGE_VERSION}, "electron-builder") + log.info({version: PACKAGE_VERSION, os: require("os").release()}, "electron-builder") } catch (e) { // error in dev mode without babel diff --git a/packages/app-builder-lib/src/targets/fpm.ts b/packages/app-builder-lib/src/targets/fpm.ts index b9a6d11bbc..db56fc121a 100644 --- a/packages/app-builder-lib/src/targets/fpm.ts +++ b/packages/app-builder-lib/src/targets/fpm.ts @@ -1,20 +1,19 @@ import { path7za } from "7zip-bin" -import { appBuilderPath } from "app-builder-bin" -import { Arch, debug, exec, log, TmpDir, toLinuxArchString, use } from "builder-util" -import { smarten } from "../appInfo" -import { objectToArgs } from "../util/appBuilder" -import { computeEnv } from "../util/bundledTool" +import { Arch, debug, executeAppBuilder, log, TmpDir, toLinuxArchString, use } from "builder-util" import { unlinkIfExists } from "builder-util/out/fs" import { ensureDir, outputFile, readFile } from "fs-extra-p" import * as path from "path" import { DebOptions, LinuxTargetSpecificOptions } from ".." +import { smarten } from "../appInfo" import { Target } from "../core" import * as errorMessages from "../errorMessages" import { LinuxPackager } from "../linuxPackager" +import { objectToArgs } from "../util/appBuilder" +import { computeEnv } from "../util/bundledTool" import { isMacOsSierra } from "../util/macosVersion" import { getTemplatePath } from "../util/pathManager" import { installPrefix, LinuxTargetHelper } from "./LinuxTargetHelper" -import { fpmPath, getLinuxToolsPath } from "./tools" +import { getLinuxToolsPath } from "./tools" interface FpmOptions { maintainer: string | undefined @@ -91,8 +90,6 @@ export default class FpmTarget extends Target { } async build(appOutDir: string, arch: Arch): Promise { - const fpmMetaInfoOptions = await this.computeFpmMetaInfoOptions() - const target = this.name // tslint:disable:no-invalid-template-strings @@ -126,11 +123,8 @@ export default class FpmTarget extends Target { const options = this.options const synopsis = options.synopsis const args = [ - "-s", "dir", - "-t", target, "--architecture", (target === "pacman" && arch === Arch.ia32) ? "i686" : toLinuxArchString(arch), "--name", appInfo.linuxPackageName, - "--force", "--after-install", scripts[0], "--after-remove", scripts[1], "--description", smarten(target === "rpm" ? this.helper.getDescription(options)! : `${synopsis || ""}\n ${this.helper.getDescription(options)}`), @@ -138,12 +132,10 @@ export default class FpmTarget extends Target { "--package", artifactPath, ] - objectToArgs(args, fpmMetaInfoOptions as any) + objectToArgs(args, await this.computeFpmMetaInfoOptions() as any) if (debug.enabled) { - args.push( - "--log", "debug", - "--debug") + args.push("--log", "debug") } const packageCategory = options.packageCategory @@ -151,52 +143,40 @@ export default class FpmTarget extends Target { args.push("--category", packageCategory) } - const compression = options.compression if (target === "deb") { - args.push("--deb-compression", compression || "xz") use((options as DebOptions).priority, it => args.push("--deb-priority", it!)) } else if (target === "rpm") { - args.push("--rpm-compression", (compression === "xz" ? "xzmt" : compression) || "xzmt") - args.push("--rpm-os", "linux") - if (synopsis != null) { args.push("--rpm-summary", smarten(synopsis)) } } - // noinspection JSDeprecatedSymbols - let depends = options.depends || packager.platformSpecificBuildOptions.depends - if (depends == null) { - if (target === "deb") { - depends = ["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3", "libxss1"] - } - else if (target === "pacman") { - // noinspection SpellCheckingInspection - depends = ["c-ares", "ffmpeg", "gtk3", "http-parser", "libevent", "libvpx", "libxslt", "libxss", "minizip", "nss", "re2", "snappy", "libnotify", "libappindicator-gtk2", "libappindicator-gtk3", "libappindicator-sharp"] - } - else if (target === "rpm") { - // noinspection SpellCheckingInspection - depends = ["libnotify", "libappindicator", "libXScrnSaver"] - } - else { - depends = [] - } + const fpmConfiguration: FpmConfiguration = { + args, target, } - else if (!Array.isArray(depends)) { - // noinspection SuspiciousTypeOfGuard - if (typeof depends === "string") { - depends = [depends as string] + + if (options.compression != null) { + fpmConfiguration.compression = options.compression + } + + // noinspection JSDeprecatedSymbols + const depends = options.depends + if (depends != null) { + if (Array.isArray(depends)) { + fpmConfiguration.customDepends = depends } else { - throw new Error(`depends must be Array or String, but specified as: ${depends}`) + // noinspection SuspiciousTypeOfGuard + if (typeof depends === "string") { + fpmConfiguration.customDepends = [depends as string] + } + else { + throw new Error(`depends must be Array or String, but specified as: ${depends}`) + } } } - for (const dep of depends) { - args.push("--depends", dep) - } - use(packager.info.metadata.license, it => args.push("--license", it!)) use(appInfo.buildNumber, it => args.push("--iteration", it!)) @@ -218,10 +198,8 @@ export default class FpmTarget extends Target { const env = { ...process.env, - FPM_COMPRESS_PROGRAM: appBuilderPath, SZA_PATH: path7za, SZA_COMPRESSION_LEVEL: packager.compression === "store" ? "0" : "9", - SZA_ARCHIVE_TYPE: "xz", } // rpmbuild wants directory rpm with some default config files. Even if we can use dylibbundler, path to such config files are not changed (we need to replace in the binary) @@ -233,12 +211,19 @@ export default class FpmTarget extends Target { DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, [path.join(linuxToolsPath, "lib")]), }) } - await exec(await fpmPath.value, args, {env}) + await executeAppBuilder(["fpm", "--configuration", JSON.stringify(fpmConfiguration)], undefined, {env}) await packager.dispatchArtifactCreated(artifactPath, this, arch) } } +interface FpmConfiguration { + target: string + args: Array + customDepends?: Array + compression?: string | null +} + async function writeConfigFile(tmpDir: TmpDir, templatePath: string, options: any): Promise { //noinspection JSUnusedLocalSymbols function replacer(match: string, p1: string) { diff --git a/packages/app-builder-lib/src/targets/tools.ts b/packages/app-builder-lib/src/targets/tools.ts index c12e6d5d9e..b074174d94 100644 --- a/packages/app-builder-lib/src/targets/tools.ts +++ b/packages/app-builder-lib/src/targets/tools.ts @@ -1,23 +1,6 @@ -import { getBin, getBinFromUrl } from "../binDownload" -import { Lazy } from "lazy-val" -import * as path from "path" +import { getBinFromUrl } from "../binDownload" export function getLinuxToolsPath() { //noinspection SpellCheckingInspection return getBinFromUrl("linux-tools", "mac-10.12.3", "SQ8fqIRVXuQVWnVgaMTDWyf2TLAJjJYw3tRSqQJECmgF6qdM7Kogfa6KD49RbGzzMYIFca9Uw3MdsxzOPRWcYw==") -} - -export const fpmPath = new Lazy(() => { - if (process.platform === "win32" || process.env.USE_SYSTEM_FPM === "true") { - return Promise.resolve("fpm") - } - - return getBin("fpm") - .then(it => path.join(it, "fpm")) -}) - -// noinspection JSUnusedGlobalSymbols -export function prefetchBuildTools(): Promise { - // yes, we starting to use native Promise - return fpmPath.value } \ No newline at end of file diff --git a/packages/builder-util/package.json b/packages/builder-util/package.json index 2d5e60d3ea..34ff31457c 100644 --- a/packages/builder-util/package.json +++ b/packages/builder-util/package.json @@ -11,7 +11,7 @@ "out" ], "dependencies": { - "app-builder-bin": "3.0.1", + "app-builder-bin": "3.0.2", "temp-file": "^3.3.3", "fs-extra-p": "^8.0.2", "is-ci": "^2.0.0", diff --git a/packages/builder-util/src/log.ts b/packages/builder-util/src/log.ts index b36bcd866c..d184a205d0 100644 --- a/packages/builder-util/src/log.ts +++ b/packages/builder-util/src/log.ts @@ -82,8 +82,8 @@ export class Logger { return message } - const fieldPadding = " ".repeat(Math.max(1, 16 - message.length)) - let text = message + fieldPadding + const fieldPadding = " ".repeat(Math.max(2, 16 - message.length)) + let text = (level === "error" ? color(message) : message) + fieldPadding const fieldNames = Object.keys(fields) let counter = 0 for (const name of fieldNames) { diff --git a/test/out/linux/__snapshots__/debTest.js.snap b/test/out/linux/__snapshots__/debTest.js.snap index f1ec0f5703..1f371777a3 100644 --- a/test/out/linux/__snapshots__/debTest.js.snap +++ b/test/out/linux/__snapshots__/debTest.js.snap @@ -73,7 +73,7 @@ Array [ exports[`arm 3`] = ` Object { "Architecture": "armv7l", - "Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3, libxss1", + "Depends": "libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator1, libgnome-keyring0, gir1.2-gnomekeyring-1.0", "Homepage": "http://foo.example.com", "License": "MIT", "Maintainer": "Foo Bar ", @@ -144,7 +144,7 @@ Array [ exports[`arm 6`] = ` Object { "Architecture": "armv7l", - "Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3, libxss1", + "Depends": "libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator1, libgnome-keyring0, gir1.2-gnomekeyring-1.0", "Homepage": "http://foo.example.com", "License": "MIT", "Maintainer": "Foo Bar ", @@ -158,19 +158,6 @@ Object { exports[`arm 7`] = `"Test Application (test quite “ #378)"`; exports[`custom depends 1`] = ` -"[Desktop Entry] -Name=Test App ßW -Exec=\\"/opt/Test App ßW/Boo\\" %U -Terminal=false -Type=Application -Icon=Boo -StartupWMClass=Test App ßW -Comment=Test Application (test quite “ #378) -Categories=Development; -" -`; - -exports[`custom depends 2`] = ` Object { "linux": Array [ Object { @@ -181,7 +168,7 @@ Object { } `; -exports[`custom depends 3`] = ` +exports[`custom depends 2`] = ` Array [ "/", "/opt/", @@ -239,7 +226,7 @@ Array [ ] `; -exports[`custom depends 4`] = ` +exports[`custom depends 3`] = ` Object { "Architecture": "amd64", "Depends": "foo", @@ -253,7 +240,7 @@ Object { } `; -exports[`custom depends 5`] = `"Test Application (test quite “ #378)"`; +exports[`custom depends 4`] = `"Test Application (test quite “ #378)"`; exports[`deb 1`] = ` Object { @@ -327,7 +314,7 @@ Array [ exports[`deb 3`] = ` Object { "Architecture": "amd64", - "Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3, libxss1", + "Depends": "libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator1, libgnome-keyring0, gir1.2-gnomekeyring-1.0", "Homepage": "http://foo.example.com", "License": "MIT", "Maintainer": "Foo Bar ", @@ -425,7 +412,7 @@ Array [ exports[`no quotes for safe exec name 4`] = ` Object { "Architecture": "amd64", - "Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3, libxss1", + "Depends": "libgtk-3-0, libnotify4, libnss3, libxss1, libxtst6, xdg-utils, libatspi2.0-0, libuuid1, libappindicator1, libgnome-keyring0, gir1.2-gnomekeyring-1.0", "Homepage": "http://foo.example.com", "License": "MIT", "Maintainer": "Foo Bar ", diff --git a/test/out/updater/__snapshots__/differentialUpdateTest.js.snap b/test/out/updater/__snapshots__/differentialUpdateTest.js.snap index ca33d20e96..b2c4a1f962 100644 --- a/test/out/updater/__snapshots__/differentialUpdateTest.js.snap +++ b/test/out/updater/__snapshots__/differentialUpdateTest.js.snap @@ -39,7 +39,7 @@ Object { "linux": Array [ Object { "arch": "x64", - "file": "Test App ßW 1.0.1.AppImage", + "file": "Test App ßW-1.0.1.AppImage", "safeArtifactName": "TestApp-1.0.1-x86_64.AppImage", "updateInfo": Object { "blockMapSize": "@blockMapSize", @@ -55,10 +55,10 @@ Object { "blockMapSize": "@blockMapSize", "sha512": "@sha512", "size": "@size", - "url": "Test App ßW 1.0.1.AppImage", + "url": "Test App ßW-1.0.1.AppImage", }, ], - "path": "Test App ßW 1.0.1.AppImage", + "path": "Test App ßW-1.0.1.AppImage", "releaseDate": "@releaseDate", "sha512": "@sha512", "version": "1.0.1", diff --git a/test/src/BuildTest.ts b/test/src/BuildTest.ts index 47d524d91b..65f560c065 100644 --- a/test/src/BuildTest.ts +++ b/test/src/BuildTest.ts @@ -3,7 +3,7 @@ import { Arch, createTargets, DIR_TARGET, Platform } from "electron-builder" import { checkBuildRequestOptions } from "app-builder-lib" import { readAsar } from "app-builder-lib/out/asar/asar" import { outputJson } from "fs-extra-p" -import { promises, readFileSync } from "fs" +import { promises as fs, readFileSync } from "fs" import * as path from "path" import { doMergeConfigs } from "app-builder-lib/out/util/config" import { app, appTwo, appTwoThrows, assertPack, linuxDirTarget, modifyPackageJson, packageJson, toSystemIndependentPath } from "./helpers/packTester" @@ -181,7 +181,7 @@ test.ifDevOrLinuxCi("electron version from build", app({ test("www as default dir", appTwo({ targets: Platform.LINUX.createTarget(DIR_TARGET), }, { - projectDirCreated: projectDir => promises.rename(path.join(projectDir, "app"), path.join(projectDir, "www")) + projectDirCreated: projectDir => fs.rename(path.join(projectDir, "app"), path.join(projectDir, "www")) })) test.ifLinuxOrDevMac("afterPack", () => { @@ -285,11 +285,11 @@ export function removeUnstableProperties(data: any) { } async function verifySmartUnpack(resourceDir: string) { - const fs = await readAsar(path.join(resourceDir, "app.asar")) - expect(await fs.readJson(`node_modules${path.sep}debug${path.sep}package.json`)).toMatchObject({ + 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(fs.header)).toMatchSnapshot() + expect(removeUnstableProperties(asarFs.header)).toMatchSnapshot() const files = (await walk(resourceDir, file => !path.basename(file).startsWith(".") && !file.endsWith(`resources${path.sep}inspector`))) .map(it => { diff --git a/test/src/ExtraBuildTest.ts b/test/src/ExtraBuildTest.ts index 237c3c7ac9..0318940cf2 100644 --- a/test/src/ExtraBuildTest.ts +++ b/test/src/ExtraBuildTest.ts @@ -1,5 +1,5 @@ import { Arch, build, PackagerOptions, Platform } from "electron-builder" -import { promises } from "fs" +import { promises as fs } from "fs" import * as path from "path" import { assertThat } from "./helpers/fileAssert" import { app, assertPack, linuxDirTarget, modifyPackageJson } from "./helpers/packTester" @@ -26,7 +26,7 @@ function createBuildResourcesTest(packagerOptions: PackagerOptions) { packed: async context => { await assertThat(path.join(context.projectDir, "customDist", "latest")).isDirectory() }, - projectDirCreated: projectDir => promises.rename(path.join(projectDir, "build"), path.join(projectDir, "custom")) + projectDirCreated: projectDir => fs.rename(path.join(projectDir, "build"), path.join(projectDir, "custom")) }) } diff --git a/test/src/globTest.ts b/test/src/globTest.ts index 13ddd4e997..eeb0788c24 100644 --- a/test/src/globTest.ts +++ b/test/src/globTest.ts @@ -1,7 +1,8 @@ import { DIR_TARGET, Platform } from "electron-builder" import { readAsar } from "app-builder-lib/out/asar/asar" -import { mkdirs, outputFile, symlink, writeFile } from "fs-extra-p" +import { mkdirs, outputFile, writeFile } from "fs-extra-p" import * as path from "path" +import { promises as fs } from "fs" import { assertThat } from "./helpers/fileAssert" import { app, assertPack, modifyPackageJson, PackedContext, verifyAsarFileTree } from "./helpers/packTester" @@ -17,7 +18,7 @@ async function createFiles(appDir: string) { await mkdirs(dir) await writeFile(path.join(dir, "file-in-asar"), "{}") - await symlink(path.join(appDir, "assets", "file"), path.join(appDir, "assets", "file-symlink")) + await fs.symlink(path.join(appDir, "assets", "file"), path.join(appDir, "assets", "file-symlink")) } test.ifNotWindows.ifDevOrLinuxCi("unpackDir one", app({ @@ -84,7 +85,7 @@ test.ifNotWindows("link", app({ targets: Platform.LINUX.createTarget(DIR_TARGET), }, { projectDirCreated: projectDir => { - return symlink(path.join(projectDir, "index.js"), path.join(projectDir, "foo.js")) + return fs.symlink(path.join(projectDir, "index.js"), path.join(projectDir, "foo.js")) }, packed: async context => { expect((await readAsar(path.join(context.getResources(Platform.LINUX), "app.asar"))).getFile("foo.js", false)).toMatchSnapshot() @@ -97,7 +98,7 @@ test.ifNotWindows("outside link", app({ projectDirCreated: async (projectDir, tmpDir) => { const tempDir = await tmpDir.getTempDir() await outputFile(path.join(tempDir, "foo"), "data") - await symlink(tempDir, path.join(projectDir, "o-dir")) + await fs.symlink(tempDir, path.join(projectDir, "o-dir")) }, packed: async context => { expect((await readAsar(path.join(context.getResources(Platform.LINUX), "app.asar"))).getFile("o-dir/foo", false)).toMatchSnapshot() diff --git a/test/src/helpers/packTester.ts b/test/src/helpers/packTester.ts index 84a5f1eb24..0317be1353 100644 --- a/test/src/helpers/packTester.ts +++ b/test/src/helpers/packTester.ts @@ -11,7 +11,8 @@ import { computeArchToTargetNamesMap } from "app-builder-lib/out/targets/targetF import { getLinuxToolsPath } from "app-builder-lib/out/targets/tools" import { convertVersion } from "electron-builder-squirrel-windows/out/squirrelPack" import { PublishPolicy } from "electron-publish" -import { emptyDir, readFile, readJson, unlink, writeJson } from "fs-extra-p" +import { emptyDir, readFile, readJson, writeJson } from "fs-extra-p" +import { promises as fs } from "fs" import { safeLoad } from "js-yaml" import * as path from "path" import pathSorter from "path-sort" @@ -431,7 +432,7 @@ export async function modifyPackageJson(projectDir: string, task: (data: any) => const data = await readJson(file) task(data) // because copied as hard link - await unlink(file) + await fs.unlink(file) return await writeJson(file, data) } diff --git a/test/src/linux/debTest.ts b/test/src/linux/debTest.ts index 8bcb4f85e6..9f68c86631 100644 --- a/test/src/linux/debTest.ts +++ b/test/src/linux/debTest.ts @@ -1,5 +1,5 @@ import { Arch, Platform } from "electron-builder" -import { readFile } from "fs-extra-p" +import { promises as fs } from "fs" import { app } from "../helpers/packTester" test.ifNotWindows("deb", app({ @@ -18,11 +18,6 @@ test.ifNotWindows("custom depends", app({ depends: ["foo"], }, }, - effectiveOptionComputed: async it => { - const content = await readFile(it[1], "utf8") - expect(content).toMatchSnapshot() - return false - } })) test.ifNotWindows("no quotes for safe exec name", app({ @@ -34,7 +29,7 @@ test.ifNotWindows("no quotes for safe exec name", app({ }, }, effectiveOptionComputed: async it => { - const content = await readFile(it[1], "utf8") + const content = await fs.readFile(it[1], "utf8") expect(content).toMatchSnapshot() return false } diff --git a/test/src/linux/linuxPackagerTest.ts b/test/src/linux/linuxPackagerTest.ts index d5f1f36873..b3837429bc 100644 --- a/test/src/linux/linuxPackagerTest.ts +++ b/test/src/linux/linuxPackagerTest.ts @@ -1,10 +1,11 @@ import { Arch, build, Platform } from "electron-builder" -import { copyFile, mkdirs, outputFile, remove, rename } from "fs-extra-p" +import { copyFile, mkdirs, outputFile, remove } from "fs-extra-p" import * as path from "path" import { GenericServerOptions } from "builder-util-runtime" import { assertThat } from "../helpers/fileAssert" import { app, appThrows, copyTestAsset, modifyPackageJson } from "../helpers/packTester" import { ELECTRON_VERSION } from "../helpers/testConfig" +import { promises as fs } from "fs" const appImageTarget = Platform.LINUX.createTarget("appimage") @@ -131,7 +132,7 @@ test.ifNotWindows("icons from ICNS (mac)", app({ }, }, { projectDirCreated: async projectDir => { - await mkdirs(path.join(projectDir, "resources")).then(() => rename(path.join(projectDir, "build", "icon.icns"), path.join(projectDir, "resources", "time.icns"))) + await mkdirs(path.join(projectDir, "resources")).then(() => fs.rename(path.join(projectDir, "build", "icon.icns"), path.join(projectDir, "resources", "time.icns"))) await remove(path.join(projectDir, "build")) }, packed: async context => { @@ -177,9 +178,9 @@ test.ifNotWindows("icons dir with images without size in the filename", app({ }, }, { projectDirCreated: async projectDir => { - await rename(path.join(projectDir, "build", "icons", "256x256.png"), path.join(projectDir, "build", "icon.png")) + await fs.rename(path.join(projectDir, "build", "icons", "256x256.png"), path.join(projectDir, "build", "icon.png")) await remove(path.join(projectDir, "build", "icons")) - await rename(path.join(projectDir, "build"), path.join(projectDir, "icons")) + await fs.rename(path.join(projectDir, "build"), path.join(projectDir, "icons")) }, packed: async context => { const projectDir = context.getResources(Platform.LINUX) @@ -198,7 +199,7 @@ test.ifNotWindows("icons from ICNS", app({ packed: async context => { const projectDir = context.getResources(Platform.LINUX) - await rename(path.join(projectDir, "electron.asar"), path.join(projectDir, "someAsarFile.asar")) + await fs.rename(path.join(projectDir, "electron.asar"), path.join(projectDir, "someAsarFile.asar")) await remove(path.join(projectDir, "inspector")) await build({ diff --git a/test/src/mainEntryTest.ts b/test/src/mainEntryTest.ts index 84658d039e..5ac5eb09dc 100644 --- a/test/src/mainEntryTest.ts +++ b/test/src/mainEntryTest.ts @@ -1,5 +1,5 @@ import { createTargets, DIR_TARGET, Platform } from "electron-builder" -import { rename } from "fs-extra-p" +import { promises as fs } from "fs" import * as path from "path" import { appTwoThrows, assertPack, modifyPackageJson } from "./helpers/packTester" @@ -42,7 +42,7 @@ test.ifLinuxOrDevMac("invalid main in the app package.json (custom asar)", appTw test.ifLinuxOrDevMac("main in the app package.json (no asar)", () => assertPack("test-app", packagerOptions, { projectDirCreated: projectDir => { return Promise.all([ - rename(path.join(projectDir, "app", "index.js"), path.join(projectDir, "app", "main.js")), + fs.rename(path.join(projectDir, "app", "index.js"), path.join(projectDir, "app", "main.js")), modifyPackageJson(projectDir, data => { data.main = "main.js" }, true), diff --git a/test/src/windows/squirrelWindowsTest.ts b/test/src/windows/squirrelWindowsTest.ts index 59af37ba51..b1c7cec767 100644 --- a/test/src/windows/squirrelWindowsTest.ts +++ b/test/src/windows/squirrelWindowsTest.ts @@ -3,6 +3,7 @@ import * as path from "path" import { CheckingWinPackager } from "../helpers/CheckingPackager" import { app, assertPack, copyTestAsset } from "../helpers/packTester" + test.ifAll.ifNotCiMac("Squirrel.Windows", app({ targets: Platform.WINDOWS.createTarget(["squirrel"]), config: { diff --git a/yarn.lock b/yarn.lock index 38d0b7ef50..1207d5421a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1362,10 +1362,10 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -app-builder-bin@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-3.0.1.tgz#08ea930efcd374dfdbe50523c8abe7eee06fdcc9" - integrity sha512-eSC1ZxQIGuvhXKB9m7rRwTbou522FbQuc95XoqOMqMjf50//So1IjNPFOzXd6SDHcMx7f5SYEW5AYSs1Pwovtw== +app-builder-bin@3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-3.0.2.tgz#2843d8790a647c9716a80a72f4ebf753c7bb2509" + integrity sha512-nYARpMlJqqL9n+xGQ/vRo9Bvh4wDffLS0nxnulcEtjgiv0TIqcT8JJWEQlCLfzgyaaJoQnNC8ggM6V1xPh0qXA== aproba@^1.0.3: version "1.2.0" @@ -1811,9 +1811,9 @@ camelcase@^5.0.0, camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30000975: - version "1.0.30000976" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000976.tgz#d30fe12662cb2a21e130d307db9907513ca830a2" - integrity sha512-tleNB1IwPRqZiod6nUNum63xQCMN96BUO2JTeiwuRM7p9d616EHsMBjBWJMudX39qCaPuWY8KEWzMZq7A9XQMQ== + version "1.0.30000978" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000978.tgz#1e3346c27fc46bce9ac1ccd77863153a263dde56" + integrity sha512-H6gK6kxUzG6oAwg/Jal279z8pHw0BzrpZfwo/CA9FFm/vA0l8IhDfkZtepyJNE2Y4V6Dp3P3ubz6czby1/Mgsw== capture-exit@^2.0.0: version "2.0.0" @@ -2399,9 +2399,9 @@ electron-osx-sign@0.4.11: plist "^3.0.1" electron-to-chromium@^1.3.164: - version "1.3.172" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.172.tgz#1eafb3afdc47bcb9c2a2249b2736be352016da4b" - integrity sha512-bHgFvYeHBiQNNuY/WvoX37zLosPgMbR8nKU1r4mylHptLvuMMny/KG/L28DTIlcoOCJjMAhEimy3DHDgDayPbg== + version "1.3.174" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.174.tgz#011c68d4130e995cbb69c533e147d7f4856e9f39" + integrity sha512-OEh3EARo2B07ZRtxB0u9GqWyWmTeNS+diMp5bjw4kqMjgpzqM0w1zUOyErDsyWxTdArbvZ79T/w5n3WsBVHLfA== emoji-regex@^7.0.1: version "7.0.3" @@ -3268,7 +3268,7 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -4317,9 +4317,9 @@ minizlib@^1.2.1: minipass "^2.2.1" mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -5301,20 +5301,10 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" - integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -5628,9 +5618,9 @@ symbol-tree@^3.2.2: integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== table-layout@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-0.4.4.tgz#bc5398b2a05e58b67b05dd9238354b89ef27be0f" - integrity sha512-uNaR3SRMJwfdp9OUr36eyEi6LLsbcTqTO/hfTsNviKsNeyMBPICJCC7QXRF3+07bAP6FRwA8rczJPBqXDc0CkQ== + version "0.4.5" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-0.4.5.tgz#d906de6a25fa09c0c90d1d08ecd833ecedcb7378" + integrity sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw== dependencies: array-back "^2.0.0" deep-extend "~0.6.0" @@ -5955,14 +5945,14 @@ unicode-property-aliases-ecmascript@^1.0.4: integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" - integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" - set-value "^0.4.3" + set-value "^2.0.1" unique-string@^1.0.0: version "1.0.0"