-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: convert to typescript and upgrade Node.js versions #178
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
eec8137
refactor: convert to typescript
MarshallOfSound 48a0291
Merge remote-tracking branch 'origin' into ts-installer-dmg
erickzhao 39b6def
Apply suggestions from code review
erickzhao 3a24ca8
comment fixes
erickzhao 9d43f67
drop node 12 and 14 support
erickzhao e3b627e
upgrade typescript deps
erickzhao 001ed46
remove debug option from docs
erickzhao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ coverage/ | |
npm-debug.log | ||
package-lock.json | ||
test/fixture* | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,47 +2,58 @@ | |
"name": "electron-installer-dmg", | ||
"description": "Create DMG installers for your electron apps.", | ||
"version": "4.0.0", | ||
"main": "./src/index.js", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"author": "Lucas Hrabovsky <[email protected]> (http://imlucas.com)", | ||
"homepage": "http://github.com/electron-userland/electron-installer-dmg", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/electron-userland/electron-installer-dmg.git" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"coverage": "nyc --reporter=lcov --reporter=text npm run spec", | ||
"lint": "eslint src test bin", | ||
"spec": "mocha", | ||
"test": "npm run lint && npm run spec" | ||
"lint": "eslint src test --ext js,ts", | ||
"spec": "ts-mocha test/*.test.ts", | ||
"test": "tsc && npm run lint && npm run spec", | ||
"prepublishOnly": "tsc" | ||
}, | ||
"bin": { | ||
"electron-installer-dmg": "bin/electron-installer-dmg.js" | ||
"electron-installer-dmg": "dist/electron-installer-dmg-bin.js" | ||
}, | ||
"engines": { | ||
"node": ">= 12.13.0" | ||
"node": ">= 16" | ||
}, | ||
"files": [ | ||
"bin", | ||
"dist", | ||
"resources", | ||
"src", | ||
"usage.txt" | ||
], | ||
"dependencies": { | ||
"debug": "^4.3.2", | ||
"minimist": "^1.1.1" | ||
"minimist": "^1.2.7" | ||
}, | ||
"optionalDependencies": { | ||
"appdmg": "^0.6.4" | ||
}, | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@electron/get": "^1.1.0", | ||
"eslint": "^7.32.0", | ||
"@electron/get": "^2.0.2", | ||
"@types/appdmg": "^0.5.2", | ||
"@types/debug": "^4.1.7", | ||
"@types/minimist": "^1.2.2", | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "^18.11.7", | ||
"@typescript-eslint/eslint-plugin": "6.21.0", | ||
"@typescript-eslint/parser": "6.21.0", | ||
"eslint": "^8.26.0", | ||
"eslint-config-airbnb-base": "^15.0.0", | ||
"eslint-plugin-import": "^2.23.4", | ||
"extract-zip": "^2.0.1", | ||
"mocha": "^9.0.3", | ||
"nyc": "^15.1.0" | ||
"nyc": "^15.1.0", | ||
"ts-mocha": "^10.0.0", | ||
"typescript": "5.5.2" | ||
}, | ||
"keywords": [ | ||
"mongodb.js", | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env node | ||
|
||
/* eslint no-console:0 no-sync:0 */ | ||
import * as fs from 'fs'; | ||
import * as minimist from 'minimist'; | ||
import * as path from 'path'; | ||
|
||
import { createDMG, ElectronInstallerDMGOptions } from '.'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const pkg: { version: string } = require('../package.json'); | ||
|
||
const usage = fs.readFileSync(path.resolve(__dirname, '../usage.txt')).toString(); | ||
const args = minimist<Pick<ElectronInstallerDMGOptions, 'overwrite' | 'icon' | 'background' | 'title' | 'format'> & { | ||
out?: string; | ||
'icon-size'?: string; | ||
}>(process.argv.slice(2), { | ||
boolean: ['overwrite'], | ||
string: ['out', 'icon', 'icon-size', 'background', 'title', 'format'], | ||
}); | ||
|
||
const [appPath, name] = args._; | ||
|
||
const options: ElectronInstallerDMGOptions = { | ||
appPath, | ||
name, | ||
overwrite: args.overwrite, | ||
icon: args.icon, | ||
iconSize: args['icon-size'] ? parseInt(args['icon-size'], 10) : undefined, | ||
background: args.background, | ||
title: args.title, | ||
format: args.format, | ||
out: args.out, | ||
}; | ||
|
||
if (args.help || args.h || !options.appPath || !options.name) { | ||
console.error(usage); | ||
process.exit(1); | ||
} | ||
|
||
if (args.version) { | ||
console.error(pkg.version); | ||
process.exit(1); | ||
} | ||
|
||
createDMG(options) | ||
.then(() => { | ||
console.log(`Wrote DMG to:\n${args.dmgPath}`); | ||
}) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we shouldn't change this in a TS refactor but this seems like an odd choice,
—help
usually ends in code 0