Socket
Socket
Sign inDemoInstall

@swiftmr/electron-builder

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swiftmr/electron-builder - npm Package Compare versions

Comparing version 23.1.2 to 24.6.3

LICENSE

2

cli.js
#!/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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc