[READ-ONLY] Mirror of https://github.com/probablykasper/embler. Turn binaries into applications npmjs.com/package/embler
app builder cli dmg macos node package packager
0

Configure Feed

Select the types of activity you want to include in your feed.

Fixed handling mac.category and mac.darkModeSupport

Kasper (Aug 17, 2020, 3:33 PM +0200) 2d6938a6 41ed50ef

+57 -12
+29
README.md
··· 1 1 # Pakager 2 + 3 + Turn a binary into an application. 4 + 5 + ## Installation 6 + 7 + ## Supported formats 8 + - macOS: `app` 9 + 10 + ## Basic usage 11 + 1. Specify options in your `package.json` like so: 12 + ```json 13 + { 14 + "name": "firefox", 15 + "author": "Mozilla", 16 + "version": "79.0.0", 17 + "scripts": { 18 + "build": "", 19 + }, 20 + "pakager": { 21 + "realName": "Firefox", 22 + "appId": "org.mozilla.firefox", 23 + "mac": { 24 + "binary": "dist/firefox-mac-bin", 25 + "icon": "icon.png", 26 + "formats": ["app"], 27 + } 28 + } 29 + } 30 + ```
+2 -4
src/build.js
··· 35 35 binary: Joi.path().existingFile().required(), 36 36 category: Joi.string(), 37 37 icon: Joi.path().existingFile().endsWith('png', 'icns'), 38 - // icon: Joi.path().existingFile().pattern(/\.(zip|png)$/).message('{{#}}'), 39 38 formats: Joi.array().items('app').default(['app']), 40 - backgroundApp: Joi.bool().default(false), 41 39 darkModeSupport: Joi.bool().default(true), 42 40 customInfo: Joi.object().default({}), 43 41 }) ··· 110 108 CFBundleVersion: options.version, 111 109 NSHumanReadableCopyright: options.copyright, 112 110 LSUIElement: options.backgroundApp, 113 - NSRequiresAquaSystemAppearance: !options.darkModeSupport, 111 + NSRequiresAquaSystemAppearance: !options.mac.darkModeSupport, 114 112 } 115 - if (options.category) data.LSApplicationCategoryType = options.category 113 + if (options.mac.category) data.LSApplicationCategoryType = options.mac.category 116 114 for (const [key, value] of Object.entries(options.mac.customInfo)) { 117 115 console.log(key, value) 118 116 data[key] = value
+6 -1
test/package-lock.json
··· 1 1 { 2 - "name": "test", 2 + "name": "menubartest", 3 3 "requires": true, 4 4 "lockfileVersion": 1, 5 5 "dependencies": { 6 + "7zip-bin": { 7 + "version": "5.0.3", 8 + "resolved": "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.0.3.tgz", 9 + "integrity": "sha512-GLyWIFBbGvpKPGo55JyRZAo4lVbnBiD52cKlw/0Vt+wnmKvWJkpZvsjVoaIolyBXDeAQKSicRtqFNPem9w0WYA==" 10 + }, 6 11 "@babel/parser": { 7 12 "version": "7.11.3", 8 13 "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.3.tgz",
+20 -7
test/package.json
··· 1 1 { 2 - "name": "test", 3 - "description": "", 2 + "name": "menubartest", 4 3 "bin": "index.js", 5 4 "scripts": { 6 5 "build": "pkg . --target macos --output dist/test-bin-macos && pakager", ··· 9 8 }, 10 9 "license": "ISC", 11 10 "pakager": { 12 - "author": "kasper.space", 11 + "name": "menubar-test", 13 12 "version": "1.0.0", 13 + "author": "kasper.space", 14 + "realName": "Menubar Test", 15 + "appId": "com.example.menubar-test", 16 + "copyright": "Copyright © 2020 kasper.space", 17 + "outputDir": "dist", 18 + "backgroundApp": true, 14 19 "mac": { 15 20 "binary": "dist/test-bin-macos", 16 21 "icon": "icon.png", 17 - "category": "public.app-category.utilities" 22 + "category": "public.app-category.utilities", 23 + "formats": [ 24 + "app" 25 + ], 26 + "darkModeSupport": true, 27 + "customInfo": { 28 + "CFBundleDevelopmentRegion": "en" 29 + } 18 30 } 19 31 }, 32 + "dependencies": { 33 + "7zip-bin": "^5.0.3", 34 + "systray": "^1.0.5" 35 + }, 20 36 "devDependencies": { 21 37 "pakager": "file:..", 22 38 "pkg": "^4.4.9" 23 - }, 24 - "dependencies": { 25 - "systray": "^1.0.5" 26 39 } 27 40 }