Skip to content

Commit 557974c

Browse files
committed
Require Node.js 18
1 parent aee41e8 commit 557974c

File tree

5 files changed

+16
-19
lines changed

5 files changed

+16
-19
lines changed

.github/workflows/main.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
node-version:
13+
- 20
1314
- 18
14-
- 16
15-
- 14
1615
steps:
1716
- uses: actions/checkout@v4
1817
- uses: actions/setup-node@v4

cli.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ async function init() {
8282
appInfo = plist.parse(stdout);
8383
}
8484

85-
const appName = appInfo.CFBundleDisplayName || appInfo.CFBundleName;
85+
const appName = appInfo.CFBundleDisplayName ?? appInfo.CFBundleName;
8686
if (!appName) {
8787
throw new Error('The app must have `CFBundleDisplayName` or `CFBundleName` defined in its `Info.plist`.');
8888
}
8989

90-
const dmgTitle = cli.flags.dmgTitle || appName;
90+
const dmgTitle = cli.flags.dmgTitle ?? appName;
9191
const dmgFilename = `${appName} ${appInfo.CFBundleShortVersionString}.dmg`;
9292
const dmgPath = path.join(destinationPath, dmgFilename);
9393

@@ -110,7 +110,6 @@ async function init() {
110110
composedIconPath = await composeIcon(path.join(appPath, 'Contents/Resources', `${appIconName}.icns`));
111111
}
112112

113-
// Xcode 14+ only supports building apps for macOS 10.13+
114113
const dmgFormat = 'ULFO'; // ULFO requires macOS 10.11+
115114
const dmgFilesystem = 'APFS'; // APFS requires macOS 10.13+
116115

@@ -212,6 +211,6 @@ async function init() {
212211
try {
213212
await init();
214213
} catch (error) {
215-
ora.fail((error && error.stack) || error);
214+
ora.fail(error?.stack || error);
216215
process.exit(1);
217216
}

package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
"bin": {
1515
"create-dmg": "./cli.js"
1616
},
17-
"sideEffects": false,
1817
"engines": {
19-
"node": ">=14.16"
18+
"node": ">=18"
2019
},
2120
"scripts": {
2221
"test": "ava"
@@ -44,16 +43,16 @@
4443
],
4544
"dependencies": {
4645
"appdmg": "^0.6.6",
47-
"execa": "^6.1.0",
46+
"execa": "^8.0.1",
4847
"gm": "^1.25.0",
4948
"icns-lib": "^1.0.1",
50-
"meow": "^11.0.0",
51-
"ora": "^6.1.2",
52-
"plist": "^3.0.6",
53-
"tempy": "^3.0.0"
49+
"meow": "^13.1.0",
50+
"ora": "^8.0.1",
51+
"plist": "^3.1.0",
52+
"tempy": "^3.1.0"
5453
},
5554
"devDependencies": {
56-
"ava": "^5.2.0",
57-
"xo": "^0.53.1"
55+
"ava": "^6.1.1",
56+
"xo": "^0.56.0"
5857
}
5958
}

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Imagine you have finished a macOS app, exported it from Xcode, and now want to d
1010

1111
## Install
1212

13-
Ensure you have [Node.js](https://nodejs.org) 14 or later installed. Then run the following:
13+
Ensure you have [Node.js](https://nodejs.org) 18 or later installed. Then run the following:
1414

1515
```sh
1616
npm install --global create-dmg

test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('main', async t => {
1111
const cwd = temporaryDirectory();
1212

1313
try {
14-
await execa(path.join(__dirname, 'cli.js'), [path.join(__dirname, 'fixtures/Fixture.app')], {cwd});
14+
await execa(path.join(__dirname, 'cli.js'), ['--identity=0', path.join(__dirname, 'fixtures/Fixture.app')], {cwd});
1515
} catch (error) {
1616
// Silence code signing failure
1717
if (!error.message.includes('No suitable code signing')) {
@@ -26,7 +26,7 @@ test('binary plist', async t => {
2626
const cwd = temporaryDirectory();
2727

2828
try {
29-
await execa(path.join(__dirname, 'cli.js'), [path.join(__dirname, 'fixtures/Fixture-with-binary-plist.app')], {cwd});
29+
await execa(path.join(__dirname, 'cli.js'), ['--identity=0', path.join(__dirname, 'fixtures/Fixture-with-binary-plist.app')], {cwd});
3030
} catch (error) {
3131
// Silence code signing failure
3232
if (!error.message.includes('No suitable code signing')) {
@@ -41,7 +41,7 @@ test('app without icon', async t => {
4141
const cwd = temporaryDirectory();
4242

4343
try {
44-
await execa(path.join(__dirname, 'cli.js'), [path.join(__dirname, 'fixtures/Fixture-no-icon.app')], {cwd});
44+
await execa(path.join(__dirname, 'cli.js'), ['--identity=0', path.join(__dirname, 'fixtures/Fixture-no-icon.app')], {cwd});
4545
} catch (error) {
4646
// Silence code signing failure
4747
if (!error.message.includes('No suitable code signing')) {

0 commit comments

Comments
 (0)