diff --git a/.gitignore b/.gitignore index bcdc82600..472cea686 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules/ src/dist +dist/ cache/ build/dist diff --git a/build.js b/build.js deleted file mode 100644 index 7fa8a5fd0..000000000 --- a/build.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -process.env.NODE_ENV = 'production'; - - -/* -|-------------------------------------------------------------------------- -| Modules -|-------------------------------------------------------------------------- -*/ - -const fs = require('fs'); -const path = require('path'); - -const packager = require('electron-packager'); -const rimraf = require('rimraf'); -const app = require('./package.json'); - - -/* -|-------------------------------------------------------------------------- -| Helpers -|-------------------------------------------------------------------------- -*/ - -function getDirectories(srcpath) { - return fs.readdirSync(srcpath).filter((file) => { - return fs.statSync(path.join(srcpath, file)).isDirectory(); - }); -} - - -/* -|-------------------------------------------------------------------------- -| Build config -|-------------------------------------------------------------------------- -*/ - -const options = { - // required - 'dir' : './', - 'name' : 'Museeks', - 'platform' : ['darwin', 'win32', 'linux'], - 'arch' : ['ia32', 'x64'], - 'electronVersion' : '1.6.1', - 'icon' : path.join('src', 'images', 'logos', 'museeks'), - 'build-version' : app.version, - 'app-version' : app.version, - - // optional - 'prune' : true, - 'ignore' : /(build|node_modules\/+?(?!teeny).+)/, - 'out' : path.join('build', 'dist', app.version), - 'overwrite' : true, -}; - - -/* -|-------------------------------------------------------------------------- -| Main stuff -|-------------------------------------------------------------------------- -*/ - -console.info(`Starting Museeks ${app.version} build`); - -packager(options, (err) => { - if(err) throw err; - else { - console.info('Builds cleanup'); - - const versionPath = path.join(__dirname, 'build', 'dist', app.version); - const buildsPathes = getDirectories(versionPath); - - buildsPathes.forEach((folder) => { - const appPath = path.join(versionPath, folder, 'resources', 'app'); - rimraf(`${appPath}/src/js`, {}, () => {}); - rimraf(`${appPath}/src/styles`, {}, () => {}); - }); - } -}); diff --git a/build/icon.icns b/build/icon.icns new file mode 100644 index 000000000..b0e069e6b Binary files /dev/null and b/build/icon.icns differ diff --git a/build/museeks.desktop b/build/museeks.desktop deleted file mode 100644 index 9a6517b5d..000000000 --- a/build/museeks.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Version=0.8.1 -Name=Museeks -Comment=a free, lightweight and cross-platform music player -Exec=/opt/museeks/museeks -Icon=/opt/museeks/resources/app/src/images/logos/museeks.png -Terminal=false -Type=Application -Categories=Application;Music;Player;Audio; diff --git a/package.json b/package.json index 2ee82954d..3bf75f142 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "museeks", + "productName": "Museeks", "version": "0.8.1", "description": "A simple, clean and cross-platform music player, written with Node.js, Electron and React.js.", "main": "./src/main-process/main.js", @@ -7,7 +8,7 @@ "type": "git", "url": "https://github.com/KeitIG/museeks" }, - "author": "Pierre de la Martinière", + "author": "Pierre de la Martinière ", "license": "MIT", "bugs": { "url": "https://github.com/KeitIG/museeks/issues" @@ -20,7 +21,54 @@ "compile": "webpack --config webpack.config.js --progress --colors", "lint": "eslint . --config .eslintrc --cache", "dev": "webpack --config webpack.config.js --progress --colors --watch", - "build": "npm run build:eslint && npm run build:compile && node build.js" + "package:lw": "build -lw --ia32 --x64", + "package:l": "build -l --ia32 --x64", + "package:w": "build -w --ia32 --x64", + "package:m": "build -m" + }, + "build": { + "appId": "io.museeks.app", + "electronVersion": "1.6.8", + "files": [ + "src/*", + "src/dist/**/*", + "src/images/**/*", + "src/main-process/**/*", + "node_modules/teeny-conf/**/*" + ], + "mac": { + "category": "public.app-category.music", + "target": [ + "dmg" + ] + }, + "dmg": { + "contents": [ + { + "x": 110, + "y": 150 + }, + { + "x": 240, + "y": 150, + "type": "link", + "path": "/Applications" + } + ] + }, + "linux": { + "category": "AudioVideo", + "target": [ + "deb", + "rpm", + "AppImage" + ], + "executableName": "museeks" + }, + "win": { + "target": "nsis", + "icon": "src/images/logos/museeks.ico" + } }, "dependencies": { "bluebird": "3.5.0", @@ -58,7 +106,7 @@ "babel-preset-react": "6.24.1", "babili-webpack-plugin": "0.0.11", "css-loader": "0.28.0", - "electron-packager": "8.6.0", + "electron-builder": "^17.10.0", "eslint": "3.19.0", "eslint-plugin-import": "2.2.0", "eslint-plugin-react": "6.10.3", @@ -68,7 +116,6 @@ "json-loader": "0.5.4", "minimist": "1.2.0", "node-sass": "4.5.2", - "rimraf": "2.6.1", "sass-loader": "6.0.3", "style-loader": "0.16.1", "svg-inline-loader": "0.7.1",