Skip to content

Commit dba9359

Browse files
authored
feat!(maker-pkg): upgrade to @electron/osx-sign (electron#2959)
* build(deps): upgrade to `@electron/osx-sign` * feat!(maker-pkg): upgrade to `@electron/osx-sign` * fixups * ???? * fix * rename
1 parent 6e2e0d4 commit dba9359

File tree

6 files changed

+42
-13
lines changed

6 files changed

+42
-13
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"@aws-sdk/types": "^3.25.0",
4141
"@doyensec/electronegativity": "^1.9.1",
4242
"@electron/get": "^2.0.0",
43+
"@electron/osx-sign": "^1.0.1",
4344
"@malept/cross-spawn-promise": "^2.0.0",
4445
"@octokit/core": "^3.2.4",
4546
"@octokit/plugin-retry": "^3.0.9",

packages/maker/pkg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"dependencies": {
2121
"@electron-forge/maker-base": "6.0.0-beta.67",
2222
"@electron-forge/shared-types": "6.0.0-beta.67",
23-
"electron-osx-sign": "^0.5.0"
23+
"@electron/osx-sign": "^1.0.1"
2424
}
2525
}

packages/maker/pkg/src/Config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface MakerPKGConfig {
1212
*
1313
* Default: `true`.
1414
*/
15-
'identity-validation'?: boolean;
15+
identityValidation?: boolean;
1616
/**
1717
* Path to install the bundle. Default to `/Applications`.
1818
*/

packages/maker/pkg/src/MakerPKG.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
22
import { ForgePlatform } from '@electron-forge/shared-types';
3-
import { flatAsync } from 'electron-osx-sign';
3+
import { flatAsync } from '@electron/osx-sign';
44

55
import path from 'path';
66
import { MakerPKGConfig } from './Config';
77

8-
export default class MakerDMG extends MakerBase<MakerPKGConfig> {
8+
export default class MakerPKG extends MakerBase<MakerPKGConfig> {
99
name = 'pkg';
1010

1111
defaultPlatforms: ForgePlatform[] = ['darwin', 'mas'];
@@ -15,8 +15,8 @@ export default class MakerDMG extends MakerBase<MakerPKGConfig> {
1515
}
1616

1717
async make({ dir, makeDir, appName, packageJSON, targetPlatform }: MakerOptions): Promise<string[]> {
18-
if (!['darwin', 'mas'].includes(targetPlatform)) {
19-
throw new Error(`The pkg maker only supports targetting "mas" and "darwin" builds. You provided "${targetPlatform}"`);
18+
if (!this.isValidTargetPlatform(targetPlatform)) {
19+
throw new Error(`The pkg maker only supports targeting "mas" and "darwin" builds. You provided "${targetPlatform}".`);
2020
}
2121

2222
const outPath = path.resolve(makeDir, `${appName}-${packageJSON.version}.pkg`);
@@ -33,6 +33,10 @@ export default class MakerDMG extends MakerBase<MakerPKGConfig> {
3333

3434
return [outPath];
3535
}
36+
37+
private isValidTargetPlatform(platform: string): platform is 'darwin' | 'mas' {
38+
return this.defaultPlatforms.includes(platform);
39+
}
3640
}
3741

3842
export { MakerPKGConfig };

packages/maker/pkg/test/MakerPKG_spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class MakerImpl extends MakerBase<MakerPKGConfig> {
1919
describe('MakerPKG', () => {
2020
let MakerDMG: typeof MakerImpl;
2121
let ensureFileStub: SinonStub;
22-
let eosStub: SinonStub;
22+
let osxSignStub: SinonStub;
2323
let renameStub: SinonStub;
2424
let config: MakerPKGConfig;
2525
let maker: MakerImpl;
@@ -33,7 +33,7 @@ describe('MakerPKG', () => {
3333

3434
beforeEach(() => {
3535
ensureFileStub = stub().returns(Promise.resolve());
36-
eosStub = stub();
36+
osxSignStub = stub();
3737
renameStub = stub().returns(Promise.resolve());
3838
config = {};
3939

@@ -42,8 +42,8 @@ describe('MakerPKG', () => {
4242
.noCallThru()
4343
.load('../src/MakerPKG', {
4444
'../../util/ensure-output': { ensureFile: ensureFileStub },
45-
'electron-osx-sign': {
46-
flatAsync: eosStub,
45+
'@electron/osx-sign': {
46+
flatAsync: osxSignStub,
4747
},
4848
'fs-extra': {
4949
rename: renameStub,
@@ -66,7 +66,7 @@ describe('MakerPKG', () => {
6666
targetArch,
6767
targetPlatform: 'mas',
6868
});
69-
const opts = eosStub.firstCall.args[0];
69+
const opts = osxSignStub.firstCall.args[0];
7070
expect(opts).to.deep.equal({
7171
app: path.resolve(`${dir}/My Test App.app`),
7272
pkg: path.resolve(`${dir.substr(0, dir.length - 4)}/make/My Test App-1.2.3.pkg`),
@@ -84,6 +84,6 @@ describe('MakerPKG', () => {
8484
targetArch,
8585
targetPlatform: 'win32',
8686
})
87-
).to.eventually.be.rejectedWith('The pkg maker only supports targetting "mas" and "darwin" builds. You provided "win32"');
87+
).to.eventually.be.rejectedWith('The pkg maker only supports targeting "mas" and "darwin" builds. You provided "win32".');
8888
});
8989
});

yarn.lock

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,18 @@
11121112
global-agent "^3.0.0"
11131113
global-tunnel-ng "^2.7.1"
11141114

1115+
"@electron/osx-sign@^1.0.1":
1116+
version "1.0.1"
1117+
resolved "https://registry.yarnpkg.com/@electron/osx-sign/-/osx-sign-1.0.1.tgz#ab4fceded7fed9f2f18c25650f46c1e3a6f17054"
1118+
integrity sha512-WkUcva+qkt809bI6uxxEG/uOWfl8HAw0m8aPijpKmGMIpZ1CWWB808YG6aY3wckUO86xZdmiOsUJTM4keLhY8A==
1119+
dependencies:
1120+
compare-version "^0.1.2"
1121+
debug "^4.3.4"
1122+
fs-extra "^10.0.0"
1123+
isbinaryfile "^4.0.8"
1124+
minimist "^1.2.6"
1125+
plist "^3.0.5"
1126+
11151127
"@electron/universal@^1.2.1":
11161128
version "1.3.0"
11171129
resolved "https://registry.yarnpkg.com/@electron/universal/-/universal-1.3.0.tgz#5854e41cf5bac03f4a78b9282358661fd0a66d4e"
@@ -3463,6 +3475,13 @@ debug@^3.1.0, debug@^3.1.1, debug@^3.2.7:
34633475
dependencies:
34643476
ms "^2.1.1"
34653477

3478+
debug@^4.3.4:
3479+
version "4.3.4"
3480+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
3481+
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
3482+
dependencies:
3483+
ms "2.1.2"
3484+
34663485
debuglog@^1.0.1:
34673486
version "1.0.1"
34683487
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
@@ -5942,6 +5961,11 @@ isbinaryfile@^3.0.2:
59425961
dependencies:
59435962
buffer-alloc "^1.2.0"
59445963

5964+
isbinaryfile@^4.0.8:
5965+
version "4.0.10"
5966+
resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.10.tgz#0c5b5e30c2557a2f06febd37b7322946aaee42b3"
5967+
integrity sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==
5968+
59455969
isexe@^2.0.0:
59465970
version "2.0.0"
59475971
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
@@ -7540,7 +7564,7 @@ plist@^3.0.0, plist@^3.0.1:
75407564
base64-js "^1.5.1"
75417565
xmlbuilder "^9.0.7"
75427566

7543-
plist@^3.0.4:
7567+
plist@^3.0.4, plist@^3.0.5:
75447568
version "3.0.6"
75457569
resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.6.tgz#7cfb68a856a7834bca6dbfe3218eb9c7740145d3"
75467570
integrity sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA==

0 commit comments

Comments
 (0)