@swiftmr/electron-builder
Advanced tools
Comparing version 23.1.2 to 24.6.3
#!/usr/bin/env node | ||
// https://github.com/pnpm/pnpm/issues/1801 | ||
require("./out/cli/cli") | ||
require("./out/cli/cli") |
#!/usr/bin/env node | ||
// https://github.com/pnpm/pnpm/issues/1801 | ||
require("./out/cli/install-app-deps") | ||
require("./out/cli/install-app-deps") |
@@ -38,3 +38,3 @@ "use strict"; | ||
} | ||
return result.length === 0 && currentIfNotSpecified ? [builder_util_1.archFromString(process.arch)] : result; | ||
return result.length === 0 && currentIfNotSpecified ? [(0, builder_util_1.archFromString)(process.arch)] : result; | ||
} | ||
@@ -56,7 +56,7 @@ let archToType = targets.get(platform); | ||
if (suffixPos > 0) { | ||
builder_util_1.addValue(archToType, builder_util_1.archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos)); | ||
(0, builder_util_1.addValue)(archToType, (0, builder_util_1.archFromString)(type.substring(suffixPos + 1)), type.substring(0, suffixPos)); | ||
} | ||
else { | ||
for (const arch of commonArch(true)) { | ||
builder_util_1.addValue(archToType, arch, type); | ||
(0, builder_util_1.addValue)(archToType, arch, type); | ||
} | ||
@@ -110,3 +110,3 @@ } | ||
if (typeof configItem === "object") { | ||
builder_util_1.deepAssign(newConfig, configItem); | ||
(0, builder_util_1.deepAssign)(newConfig, configItem); | ||
} | ||
@@ -173,3 +173,3 @@ else if (typeof configItem === "string") { | ||
for (const platform of platforms) { | ||
const archs = arch === "all" ? (platform === app_builder_lib_1.Platform.MAC ? [builder_util_1.Arch.x64, builder_util_1.Arch.arm64, builder_util_1.Arch.universal] : [builder_util_1.Arch.x64, builder_util_1.Arch.ia32]) : [builder_util_1.archFromString(arch == null ? process.arch : arch)]; | ||
const archs = arch === "all" ? (platform === app_builder_lib_1.Platform.MAC ? [builder_util_1.Arch.x64, builder_util_1.Arch.arm64, builder_util_1.Arch.universal] : [builder_util_1.Arch.x64, builder_util_1.Arch.ia32]) : [(0, builder_util_1.archFromString)(arch == null ? process.arch : arch)]; | ||
const archToType = new Map(); | ||
@@ -186,3 +186,3 @@ targets.set(platform, archToType); | ||
const buildOptions = normalizeOptions(rawOptions || {}); | ||
return app_builder_lib_1.build(buildOptions, new app_builder_lib_1.Packager(buildOptions)); | ||
return (0, app_builder_lib_1.build)(buildOptions, new app_builder_lib_1.Packager(buildOptions)); | ||
} | ||
@@ -264,3 +264,3 @@ exports.build = build; | ||
group: buildGroup, | ||
description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`), see " + chalk.underline("https://goo.gl/YFRJOM"), | ||
description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see " + chalk.underline("https://goo.gl/YFRJOM"), | ||
}) | ||
@@ -267,0 +267,0 @@ .group(["help", "version"], "Other:") |
@@ -6,3 +6,2 @@ #! /usr/bin/env node | ||
const chalk = require("chalk"); | ||
const electronVersion_1 = require("app-builder-lib/out/electron/electronVersion"); | ||
const fs_extra_1 = require("fs-extra"); | ||
@@ -12,3 +11,2 @@ const isCi = require("is-ci"); | ||
const read_config_file_1 = require("read-config-file"); | ||
const updateNotifier = require("update-notifier"); | ||
const util_1 = require("builder-util/out/util"); | ||
@@ -20,4 +18,5 @@ const builder_1 = require("../builder"); | ||
const yarn_1 = require("app-builder-lib/out/util/yarn"); | ||
const electronVersion_1 = require("app-builder-lib/out/electron/electronVersion"); | ||
// tslint:disable:no-unused-expression | ||
void builder_1.createYargs() | ||
void (0, builder_1.createYargs)() | ||
.command(["build", "*"], "Build", builder_1.configureBuildCommand, wrap(builder_1.build)) | ||
@@ -33,4 +32,4 @@ .command("install-app-deps", "Install app deps", install_app_deps_1.configureInstallAppDepsCommand, wrap(install_app_deps_1.installAppDeps)) | ||
}) | ||
.demandOption("publisher"), wrap(argv => create_self_signed_cert_1.createSelfSignedCert(argv.publisher))) | ||
.command("start", "Run application in a development mode using electron-webpack", yargs => yargs, wrap(() => start_1.start())) | ||
.demandOption("publisher"), wrap(argv => (0, create_self_signed_cert_1.createSelfSignedCert)(argv.publisher))) | ||
.command("start", "Run application in a development mode using electron-webpack", yargs => yargs, wrap(() => (0, start_1.start)())) | ||
.help() | ||
@@ -42,4 +41,4 @@ .epilog(`See ${chalk.underline("https://electron.build")} for more documentation.`) | ||
return (args) => { | ||
checkIsOutdated(); | ||
read_config_file_1.loadEnv(path.join(process.cwd(), "electron-builder.env")) | ||
checkIsOutdated().catch((e) => builder_util_1.log.warn({ error: e }, "cannot check updates")); | ||
(0, read_config_file_1.loadEnv)(path.join(process.cwd(), "electron-builder.env")) | ||
.then(() => task(args)) | ||
@@ -59,20 +58,12 @@ .catch(error => { | ||
} | ||
function checkIsOutdated() { | ||
async function checkIsOutdated() { | ||
if (isCi || process.env.NO_UPDATE_NOTIFIER != null) { | ||
return; | ||
} | ||
fs_extra_1.readJson(path.join(__dirname, "..", "..", "package.json")) | ||
.then(async (it) => { | ||
if (it.version === "0.0.0-semantic-release") { | ||
return; | ||
} | ||
const packageManager = (await fs_extra_1.pathExists(path.join(__dirname, "..", "..", "package-lock.json"))) ? "npm" : "yarn"; | ||
const notifier = updateNotifier({ pkg: it }); | ||
if (notifier.update != null) { | ||
notifier.notify({ | ||
message: `Update available ${chalk.dim(notifier.update.current)}${chalk.reset(" → ")}${chalk.green(notifier.update.latest)} \nRun ${chalk.cyan(`${packageManager} upgrade electron-builder`)} to update`, | ||
}); | ||
} | ||
}) | ||
.catch(e => builder_util_1.log.warn({ error: e }, "cannot check updates")); | ||
const pkg = await (0, fs_extra_1.readJson)(path.join(__dirname, "..", "..", "package.json")); | ||
if (pkg.version === "0.0.0-semantic-release") { | ||
return; | ||
} | ||
const UpdateNotifier = require("simple-update-notifier"); | ||
await UpdateNotifier({ pkg }); | ||
} | ||
@@ -82,4 +73,4 @@ async function rebuildAppNativeCode(args) { | ||
// this script must be used only for electron | ||
return yarn_1.nodeGypRebuild(args.platform, args.arch, { version: await electronVersion_1.getElectronVersion(projectDir), useCustomDist: true }); | ||
return (0, yarn_1.nodeGypRebuild)(args.platform, args.arch, { version: await (0, electronVersion_1.getElectronVersion)(projectDir), useCustomDist: true }); | ||
} | ||
//# sourceMappingURL=cli.js.map |
@@ -15,3 +15,3 @@ "use strict"; | ||
const targetDir = process.cwd(); | ||
const tempPrefix = path.join(await tmpDir.getTempDir({ prefix: "self-signed-cert-creator" }), filename_1.sanitizeFileName(publisher)); | ||
const tempPrefix = path.join(await tmpDir.getTempDir({ prefix: "self-signed-cert-creator" }), (0, filename_1.sanitizeFileName)(publisher)); | ||
const cer = `${tempPrefix}.cer`; | ||
@@ -21,12 +21,12 @@ const pvk = `${tempPrefix}.pvk`; | ||
try { | ||
await promises_1.mkdir(path.dirname(tempPrefix), { recursive: true }); | ||
const vendorPath = path.join(await windowsCodeSign_1.getSignVendorPath(), "windows-10", process.arch); | ||
await builder_util_1.exec(path.join(vendorPath, "makecert.exe"), ["-r", "-h", "0", "-n", `CN=${quoteString(publisher)}`, "-eku", "1.3.6.1.5.5.7.3.3", "-pe", "-sv", pvk, cer]); | ||
const pfx = path.join(targetDir, `${filename_1.sanitizeFileName(publisher)}.pfx`); | ||
await fs_1.unlinkIfExists(pfx); | ||
await builder_util_1.exec(path.join(vendorPath, "pvk2pfx.exe"), ["-pvk", pvk, "-spc", cer, "-pfx", pfx]); | ||
await (0, promises_1.mkdir)(path.dirname(tempPrefix), { recursive: true }); | ||
const vendorPath = path.join(await (0, windowsCodeSign_1.getSignVendorPath)(), "windows-10", process.arch); | ||
await (0, builder_util_1.exec)(path.join(vendorPath, "makecert.exe"), ["-r", "-h", "0", "-n", `CN=${quoteString(publisher)}`, "-eku", "1.3.6.1.5.5.7.3.3", "-pe", "-sv", pvk, cer]); | ||
const pfx = path.join(targetDir, `${(0, filename_1.sanitizeFileName)(publisher)}.pfx`); | ||
await (0, fs_1.unlinkIfExists)(pfx); | ||
await (0, builder_util_1.exec)(path.join(vendorPath, "pvk2pfx.exe"), ["-pvk", pvk, "-spc", cer, "-pfx", pfx]); | ||
builder_util_1.log.info({ file: pfx }, `created. Please see https://electron.build/code-signing how to use it to sign.`); | ||
const certLocation = "Cert:\\LocalMachine\\TrustedPeople"; | ||
builder_util_1.log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`); | ||
await builder_util_1.spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", certLocation]); | ||
await (0, builder_util_1.spawn)("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", certLocation]); | ||
} | ||
@@ -33,0 +33,0 @@ finally { |
@@ -5,9 +5,9 @@ #! /usr/bin/env node | ||
exports.installAppDeps = exports.configureInstallAppDepsCommand = void 0; | ||
const electronVersion_1 = require("@swiftmr/app-builder-lib/out/electron/electronVersion"); | ||
const config_1 = require("@swiftmr/app-builder-lib/out/util/config"); | ||
const yarn_1 = require("@swiftmr/app-builder-lib/out/util/yarn"); | ||
const version_1 = require("@swiftmr/app-builder-lib/out/version"); | ||
const packageDependencies_1 = require("@swiftmr/app-builder-lib/out/util/packageDependencies"); | ||
const builder_util_1 = require("builder-util"); | ||
const promise_1 = require("builder-util/out/promise"); | ||
const config_1 = require("@swiftmr/app-builder-lib/out/util/config"); | ||
const electronVersion_1 = require("@swiftmr/app-builder-lib/out/electron/electronVersion"); | ||
const packageDependencies_1 = require("@swiftmr/app-builder-lib/out/util/packageDependencies"); | ||
const yarn_1 = require("@swiftmr/app-builder-lib/out/util/yarn"); | ||
const fs_extra_1 = require("fs-extra"); | ||
@@ -32,3 +32,3 @@ const lazy_val_1 = require("lazy-val"); | ||
.option("arch", { | ||
choices: builder_util_1.getArchCliNames().concat("all"), | ||
choices: (0, builder_util_1.getArchCliNames)().concat("all"), | ||
default: process.arch === "arm" ? "armv7l" : process.arch, | ||
@@ -51,14 +51,14 @@ description: "The target arch", | ||
const projectDir = process.cwd(); | ||
const packageMetadata = new lazy_val_1.Lazy(() => read_config_file_1.orNullIfFileNotExist(fs_extra_1.readJson(path.join(projectDir, "package.json")))); | ||
const config = await config_1.getConfig(projectDir, null, null, packageMetadata); | ||
const packageMetadata = new lazy_val_1.Lazy(() => (0, read_config_file_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(projectDir, "package.json")))); | ||
const config = await (0, config_1.getConfig)(projectDir, null, null, packageMetadata); | ||
const [appDir, version] = await Promise.all([ | ||
config_1.computeDefaultAppDirectory(projectDir, builder_util_1.use(config.directories, it => it.app)), | ||
electronVersion_1.getElectronVersion(projectDir, config, packageMetadata), | ||
(0, config_1.computeDefaultAppDirectory)(projectDir, (0, builder_util_1.use)(config.directories, it => it.app)), | ||
(0, electronVersion_1.getElectronVersion)(projectDir, config), | ||
]); | ||
// if two package.json — force full install (user wants to install/update app deps in addition to dev) | ||
await yarn_1.installOrRebuild(config, appDir, { | ||
await (0, yarn_1.installOrRebuild)(config, appDir, { | ||
frameworkInfo: { version, useCustomDist: true }, | ||
platform: args.platform, | ||
arch: args.arch, | ||
productionDeps: packageDependencies_1.createLazyProductionDeps(appDir, null), | ||
productionDeps: (0, packageDependencies_1.createLazyProductionDeps)(appDir, null), | ||
}, appDir !== projectDir); | ||
@@ -65,0 +65,0 @@ } |
{ | ||
"name": "@swiftmr/electron-builder", | ||
"description": "A complete solution to package and build a ready for distribution Electron app for MacOS, Windows and Linux with “auto update” support out of the box", | ||
"version": "23.1.2", | ||
"version": "24.6.3", | ||
"main": "out/index.js", | ||
@@ -53,14 +53,13 @@ "files": [ | ||
"dependencies": { | ||
"@types/yargs": "^17.0.1", | ||
"@swiftmr/app-builder-lib": "23.1.2", | ||
"builder-util": "23.0.9", | ||
"builder-util-runtime": "9.0.2", | ||
"chalk": "^4.1.1", | ||
"dmg-builder": "23.1.0", | ||
"fs-extra": "^10.0.0", | ||
"chalk": "^4.1.2", | ||
"fs-extra": "^10.1.0", | ||
"is-ci": "^3.0.0", | ||
"lazy-val": "^1.0.5", | ||
"read-config-file": "6.2.0", | ||
"update-notifier": "^5.1.0", | ||
"yargs": "^17.0.1" | ||
"read-config-file": "6.3.2", | ||
"simple-update-notifier": "2.0.0", | ||
"yargs": "^17.6.2", | ||
"@swiftmr/app-builder-lib": "24.6.3", | ||
"builder-util-runtime": "9.2.1", | ||
"builder-util": "24.5.0", | ||
"dmg-builder": "24.6.3" | ||
}, | ||
@@ -70,3 +69,3 @@ "devDependencies": { | ||
"@types/is-ci": "3.0.0", | ||
"@types/update-notifier": "5.1.0" | ||
"@types/yargs": "^17.0.16" | ||
}, | ||
@@ -77,2 +76,2 @@ "typings": "./out/index.d.ts", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11
61328
526
2
0
+ Addedsimple-update-notifier@2.0.0
+ Added@electron/asar@3.2.13(transitive)
+ Added@electron/notarize@1.2.42.1.0(transitive)
+ Added@electron/osx-sign@1.0.4(transitive)
+ Added@electron/universal@1.3.41.4.1(transitive)
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Added@swiftmr/app-builder-lib@24.6.3(transitive)
+ Addedansi-regex@6.1.0(transitive)
+ Addedansi-styles@6.2.1(transitive)
+ Addedapp-builder-lib@24.6.3(transitive)
+ Addedbuffer-equal@1.0.1(transitive)
+ Addedbuilder-util@24.5.0(transitive)
+ Addedbuilder-util-runtime@9.2.1(transitive)
+ Addedconfig-file-ts@0.2.6(transitive)
+ Addeddir-compare@3.3.0(transitive)
+ Addeddmg-builder@24.6.3(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedelectron-publish@24.5.0(transitive)
+ Addedemoji-regex@9.2.2(transitive)
+ Addederr-code@2.0.3(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedisbinaryfile@5.0.2(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.0(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpromise-retry@2.0.1(transitive)
+ Addedread-config-file@6.3.2(transitive)
+ Addedretry@0.12.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedsimple-update-notifier@2.0.0(transitive)
+ Addedstring-width@5.1.2(transitive)
+ Addedstrip-ansi@7.1.0(transitive)
+ Addedtypescript@5.6.2(transitive)
+ Addedwrap-ansi@8.1.0(transitive)
- Removed@types/yargs@^17.0.1
- Removedupdate-notifier@^5.1.0
- Removed@electron/universal@1.2.1(transitive)
- Removed@sindresorhus/is@0.14.0(transitive)
- Removed@swiftmr/app-builder-lib@23.1.2(transitive)
- Removed@szmarczak/http-timer@1.1.2(transitive)
- Removed@types/yargs@17.0.33(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-align@3.0.1(transitive)
- Removedapp-builder-lib@23.1.0(transitive)
- Removedasar@3.2.0(transitive)
- Removedboxen@5.1.2(transitive)
- Removedbuffer-alloc@1.2.0(transitive)
- Removedbuffer-alloc-unsafe@1.1.0(transitive)
- Removedbuffer-equal@1.0.0(transitive)
- Removedbuffer-fill@1.0.0(transitive)
- Removedcacheable-request@6.1.0(transitive)
- Removedcamelcase@6.3.0(transitive)
- Removedci-info@2.0.0(transitive)
- Removedcli-boxes@2.2.1(transitive)
- Removedclone-response@1.0.3(transitive)
- Removedcolors@1.0.3(transitive)
- Removedcommander@2.9.0(transitive)
- Removedconfigstore@5.0.1(transitive)
- Removedcrypto-random-string@2.0.0(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecompress-response@3.3.0(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddefer-to-connect@1.1.3(transitive)
- Removeddir-compare@2.4.0(transitive)
- Removeddmg-builder@23.1.0(transitive)
- Removeddot-prop@5.3.0(transitive)
- Removedduplexer3@0.1.5(transitive)
- Removedelectron-osx-sign@0.6.0(transitive)
- Removedelectron-publish@23.0.9(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedescape-goat@2.1.1(transitive)
- Removedget-stream@4.1.05.2.0(transitive)
- Removedglobal-dirs@3.0.1(transitive)
- Removedgot@9.6.0(transitive)
- Removedgraceful-readlink@1.0.1(transitive)
- Removedhas-yarn@2.1.0(transitive)
- Removedhttp-cache-semantics@4.1.1(transitive)
- Removedimport-lazy@2.1.0(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedini@1.3.82.0.0(transitive)
- Removedis-ci@2.0.0(transitive)
- Removedis-installed-globally@0.4.0(transitive)
- Removedis-npm@5.0.0(transitive)
- Removedis-obj@2.0.0(transitive)
- Removedis-path-inside@3.0.3(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedis-yarn-global@0.3.0(transitive)
- Removedisbinaryfile@3.0.3(transitive)
- Removedjson-buffer@3.0.0(transitive)
- Removedkeyv@3.1.0(transitive)
- Removedlatest-version@5.1.0(transitive)
- Removedlowercase-keys@1.0.12.0.0(transitive)
- Removedmake-dir@3.1.0(transitive)
- Removedmimic-response@1.0.1(transitive)
- Removedminimatch@3.0.4(transitive)
- Removedms@2.0.0(transitive)
- Removednormalize-url@4.5.1(transitive)
- Removedp-cancelable@1.1.0(transitive)
- Removedpackage-json@6.5.0(transitive)
- Removedprepend-http@2.0.0(transitive)
- Removedpump@3.0.2(transitive)
- Removedpupa@2.1.1(transitive)
- Removedrc@1.2.8(transitive)
- Removedread-config-file@6.2.0(transitive)
- Removedregistry-auth-token@4.2.2(transitive)
- Removedregistry-url@5.1.0(transitive)
- Removedresponselike@1.0.2(transitive)
- Removedsemver@6.3.1(transitive)
- Removedsemver-diff@3.1.1(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedto-readable-stream@1.0.0(transitive)
- Removedtype-fest@0.20.2(transitive)
- Removedtypedarray-to-buffer@3.1.5(transitive)
- Removedunique-string@2.0.0(transitive)
- Removedupdate-notifier@5.1.0(transitive)
- Removedurl-parse-lax@3.0.0(transitive)
- Removedwidest-line@3.1.0(transitive)
- Removedwrite-file-atomic@3.0.3(transitive)
- Removedxdg-basedir@4.0.0(transitive)
Updatedbuilder-util@24.5.0
Updatedbuilder-util-runtime@9.2.1
Updatedchalk@^4.1.2
Updateddmg-builder@24.6.3
Updatedfs-extra@^10.1.0
Updatedread-config-file@6.3.2
Updatedyargs@^17.6.2