diff --git a/.gitignore b/.gitignore index cc12328..1f66ccf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ .Trashes +build +build/** + node_modules node_modules/** diff --git a/icons/app.icns b/icons/app.icns new file mode 100644 index 0000000..bd3980d Binary files /dev/null and b/icons/app.icns differ diff --git a/src/images/app.png b/icons/app.png similarity index 100% rename from src/images/app.png rename to icons/app.png diff --git a/package.json b/package.json index 27da779..c790744 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,60 @@ { - "name": "sonist", - "version": "0.1.0", + "name": "Sonist", + "version": "0.9.0", "description": "Music Player", "main": "src/main.js", "scripts": { - "start": "electron ." + "start": "electron .", + "pack": "electron-builder" }, "author": "yutent", "license": "MIT", "dependencies": { - "crypto.js": "^1.1.6", + "crypto.js": "^1.2.0", "iofs": "^1.1.0" }, "devDependencies": { - "electron": "^4.0.0" + "electron": "^4.0.0", + "electron-builder": "^20.38.5" + }, + "build": { + "appId": "cc.doui.sonist", + "productName": "Sonist", + "copyright": "Copyright © year ${author}", + "directories": { + "output": "build" + }, + "files": ["src/**/*", "node_modules/iofs/*", "node_modules/crypto.js/*"], + "mac": { + "category": "public.app-category.music", + "target": "dmg", + "icon": "icons/app.icns" + }, + "linux": { + "category": "AudioVideo;Audio;Player;Music", + "target": [ + { + "target": "deb", + "arch": "x64" + }, + { + "target": "AppImage", + "arch": "x64" + } + ], + "icon": "icons/app.png" + }, + "deb": { + "depends": [ + "gconf2", + "gconf-service", + "libnotify4", + "libappindicator1", + "libxtst6", + "libnss3", + "ffprobe", + "ffmpeg" + ] + } } } diff --git a/src/main.js b/src/main.js index 04e228d..0b97475 100644 --- a/src/main.js +++ b/src/main.js @@ -57,7 +57,7 @@ function createWindow() { height: 640, frame: false, resizable: false, - icon: './src/images/app.png', + icon: path.resolve(ROOT, './images/app.png'), webPreferences: { webSecurity: false, experimentalFeatures: true @@ -88,7 +88,7 @@ app.on('ready', () => { cb({ data: buf, mimeType: MIME_TYPES[ext] }) }) - tray = new Tray('./src/images/trays/trayTemplate.png') + tray = new Tray(path.resolve(ROOT, './images/trays/trayTemplate.png')) tray.on('click', _ => { win.show()