Skip to content

Commit 875ee54

Browse files
authored
build: upgrade electron-installer-dmg@5 (#3649)
1 parent 3daacd3 commit 875ee54

File tree

6 files changed

+28
-57
lines changed

6 files changed

+28
-57
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"optionalDependencies": {
151151
"@malept/electron-installer-flatpak": "^0.11.4",
152152
"electron-installer-debian": "^3.2.0",
153-
"electron-installer-dmg": "^4.0.0",
153+
"electron-installer-dmg": "^5.0.1",
154154
"electron-installer-redhat": "^3.2.0",
155155
"electron-installer-snap": "^5.2.0",
156156
"electron-windows-store": "^2.1.0",

Diff for: packages/maker/dmg/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"fs-extra": "^10.0.0"
2828
},
2929
"optionalDependencies": {
30-
"electron-installer-dmg": "^4.0.0"
30+
"electron-installer-dmg": "^5.0.1"
3131
},
3232
"publishConfig": {
3333
"access": "public"

Diff for: packages/maker/dmg/src/Config.ts

+3-42
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { ElectronInstallerDMGOptions } from 'electron-installer-dmg';
2+
13
export interface CodeSignOptions {
24
'signing-identity': string;
35
identifier?: string;
@@ -33,45 +35,4 @@ export interface AdditionalDMGOptions {
3335
'code-sign'?: CodeSignOptions;
3436
}
3537

36-
export interface MakerDMGConfig {
37-
/**
38-
* The application name
39-
*/
40-
name?: string;
41-
/**
42-
* Path to the background for the DMG window
43-
*/
44-
background?: string;
45-
/**
46-
* Path to the icon to use for the app in the DMG window
47-
*/
48-
icon?: string;
49-
/**
50-
* Overwrite an existing DMG file if if already exists
51-
*/
52-
overwrite?: boolean;
53-
/**
54-
* Enable debug message output
55-
*/
56-
debug?: boolean;
57-
/**
58-
* How big to make the icon for the app in the DMG
59-
*/
60-
iconSize?: number;
61-
/**
62-
* Disk image format
63-
*
64-
* Default: UDZO
65-
*/
66-
format?: 'UDRW' | 'UDRO' | 'UDCO' | 'UDZO' | 'UDBZ' | 'ULFO';
67-
/**
68-
* Override the contents of the DMG, has a reasonable default
69-
*/
70-
contents?: DMGContents[] | ((opts: MakerDMGConfig & AdditionalDMGOptions) => DMGContents[]);
71-
/**
72-
* Additional options to pass through to node-appdmg
73-
*
74-
* All available options are available in the [`appdmg` docs](https://github.com/LinusU/node-appdmg)
75-
*/
76-
additionalDMGOptions?: AdditionalDMGOptions;
77-
}
38+
export type MakerDMGConfig = Omit<ElectronInstallerDMGOptions, 'name'> & { name?: string };

Diff for: packages/maker/dmg/src/MakerDMG.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class MakerDMG extends MakerBase<MakerDMGConfig> {
1616
}
1717

1818
async make({ dir, makeDir, appName, packageJSON, targetArch }: MakerOptions): Promise<string[]> {
19-
const electronDMG = require('electron-installer-dmg');
19+
const { createDMG } = require('electron-installer-dmg');
2020

2121
const outPath = path.resolve(makeDir, `${this.config.name || appName}.dmg`);
2222
const forgeDefaultOutPath = path.resolve(makeDir, `${appName}-${packageJSON.version}-${targetArch}.dmg`);
@@ -29,14 +29,14 @@ export default class MakerDMG extends MakerBase<MakerDMGConfig> {
2929
appPath: path.resolve(dir, `${appName}.app`),
3030
out: path.dirname(outPath),
3131
};
32-
const opts = await electronDMG(dmgConfig);
32+
await createDMG(dmgConfig);
3333
if (!this.config.name) {
3434
await this.ensureFile(forgeDefaultOutPath);
3535
await fs.rename(outPath, forgeDefaultOutPath);
3636
return [forgeDefaultOutPath];
3737
}
3838

39-
return [opts.dmgPath];
39+
return [outPath];
4040
}
4141
}
4242

Diff for: packages/maker/dmg/test/MakerDMG_spec.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ describe('MakerDMG', () => {
3232

3333
beforeEach(async () => {
3434
ensureFileStub = stub().returns(Promise.resolve());
35-
eidStub = stub().returns(Promise.resolve({ dmgPath: '/path/to/dmg' }));
35+
eidStub = stub().returns(Promise.resolve());
3636
renameStub = stub().returns(Promise.resolve());
37-
config = {};
37+
config = {
38+
appPath: 'fake',
39+
};
3840

3941
MakerDMG = proxyquire
4042
.noPreserveCache()
4143
.noCallThru()
4244
.load('../src/MakerDMG', {
4345
'../../util/ensure-output': { ensureFile: ensureFileStub },
44-
'electron-installer-dmg': eidStub,
46+
'electron-installer-dmg': { createDMG: eidStub },
4547
'fs-extra': {
4648
rename: renameStub,
4749
},

Diff for: yarn.lock

+15-7
Original file line numberDiff line numberDiff line change
@@ -2814,6 +2814,13 @@
28142814
"@tufjs/canonical-json" "1.0.0"
28152815
minimatch "^9.0.0"
28162816

2817+
"@types/appdmg@^0.5.5":
2818+
version "0.5.5"
2819+
resolved "https://registry.yarnpkg.com/@types/appdmg/-/appdmg-0.5.5.tgz#141a4f565395acf587c3f35642a021aea97deea2"
2820+
integrity sha512-G+n6DgZTZFOteITE30LnWj+HRVIGr7wMlAiLWOO02uJFWVEitaPU9JVXm9wJokkgshBawb2O1OykdcsmkkZfgg==
2821+
dependencies:
2822+
"@types/node" "*"
2823+
28172824
"@types/body-parser@*":
28182825
version "1.19.2"
28192826
resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0"
@@ -5449,13 +5456,14 @@ electron-installer-debian@^3.2.0:
54495456
word-wrap "^1.2.3"
54505457
yargs "^16.0.2"
54515458

5452-
electron-installer-dmg@^4.0.0:
5453-
version "4.0.0"
5454-
resolved "https://registry.yarnpkg.com/electron-installer-dmg/-/electron-installer-dmg-4.0.0.tgz#0520bcc8a928e559b3f16fc5cbc12b182a66ea1c"
5455-
integrity sha512-g3W6XnyUa7QGrAF7ViewHdt6bXV2KYU1Pm1CY3pZpp+H6mOjCHHAhf/iZAxtaX1ERCb+SQHz7xSsAHuNH9I8ZQ==
5459+
electron-installer-dmg@^5.0.1:
5460+
version "5.0.1"
5461+
resolved "https://registry.yarnpkg.com/electron-installer-dmg/-/electron-installer-dmg-5.0.1.tgz#309662eccce4a8585a79fe4bce79c23976a950f0"
5462+
integrity sha512-qOa1aAQdX57C+vzhDk3549dd/PRlNL4F8y736MTD1a43qptD+PvHY97Bo9gSf+OZ8iUWE7BrYSpk/FgLUe40EA==
54565463
dependencies:
5464+
"@types/appdmg" "^0.5.5"
54575465
debug "^4.3.2"
5458-
minimist "^1.1.1"
5466+
minimist "^1.2.7"
54595467
optionalDependencies:
54605468
appdmg "^0.6.4"
54615469

@@ -9532,12 +9540,12 @@ [email protected]:
95329540
is-plain-obj "^1.1.0"
95339541
kind-of "^6.0.3"
95349542

9535-
minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
9543+
minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
95369544
version "1.2.7"
95379545
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18"
95389546
integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==
95399547

9540-
minimist@^1.2.8:
9548+
minimist@^1.2.7, minimist@^1.2.8:
95419549
version "1.2.8"
95429550
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
95439551
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==

0 commit comments

Comments
 (0)