diff --git a/package.json b/package.json index 207a109..9018f41 100644 --- a/package.json +++ b/package.json @@ -8,16 +8,16 @@ "test": "eslint ./src/**/*.{js,jsx} && stylelint ./src/**/*.css", "start": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js", "build": "webpack --mode production --config webpack.common.config.js", - "package": "npm-run-all --parallel package:mac package:win package:linux && open ./dist", - "package:mac": "electron-packager . --overwrite --asar --platform=darwin --arch=x64 --icon=src/app/images/icon.icns --prune --out=./dist", - "package:linux": "electron-packager . --overwrite --asar --platform=linux --arch=x64 --icon=src/app/images/iconset/icon1024.png --prune --out=./dist", - "package:win": "electron-packager . --overwrite --asar --platform=win32 --arch=ia32 --icon=src/app/images/icon.ico --prune --out=./dist --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Ocean\"", - "create-installer-mac": "electron-installer-dmg ./dist/Ocean-darwin-x64/Ocean.app Ocean --out=./dist --overwrite --icon=src/app/images/icon.icns", + "package": "electron-builder build -mwl && open ./dist", "dist": "npm run build && npm run package" }, "repository": "https://github.com/kremalicious/ocean-balance.git", "homepage": "https://github.com/kremalicious/ocean-balance", - "author": "Matthias Kretschmann", + "author": { + "name": "Matthias Kretschmann", + "email": "m@kretschmann.io", + "url": "https://matthiaskretschmann.com" + }, "license": "MIT", "dependencies": { "@coingecko/cryptoformat": "^0.3.1", @@ -40,11 +40,11 @@ "@svgr/webpack": "^4.2.0", "babel-eslint": "^10.0.1", "babel-loader": "^8.0.5", + "copy-webpack-plugin": "^5.0.3", "css-loader": "^2.1.1", "electron": "^5.0.1", + "electron-builder": "^20.40.2", "electron-devtools-installer": "^2.2.4", - "electron-installer-dmg": "^2.0.0", - "electron-packager": "^13.1.1", "electron-store": "^3.2.0", "eslint": "^5.16.0", "eslint-config-prettier": "^4.2.0", @@ -60,5 +60,27 @@ "webpack": "^4.31.0", "webpack-cli": "^3.3.2", "webpack-dev-server": "^3.3.1" + }, + "browserslist": "electron >= 5.0", + "build": { + "productName": "Ocean Balance", + "appId": "com.kremalicious.ocean-balance", + "files": [ + "./build/**/*", + "./src/*.js", + "package.json" + ], + "mac": { + "category": "public.app-category.finance" + }, + "linux": { + "target": [ + "deb", + "rpm", + "snap", + "AppImage" + ], + "category": "Office" + } } } diff --git a/src/app/components/Account.jsx b/src/app/components/Account.jsx index 9ca4efb..b4751b4 100644 --- a/src/app/components/Account.jsx +++ b/src/app/components/Account.jsx @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' -import { openUrl } from '../util/openUrl' +import { openUrl } from '../../utils' import Balance from './Balance' export default class Account extends PureComponent { diff --git a/src/main.js b/src/main.js index 8a5aa63..b4471c3 100644 --- a/src/main.js +++ b/src/main.js @@ -32,7 +32,7 @@ const createWindow = async () => { backgroundColor: isDarkMode ? '#141414' : '#fff', frame: false, show: false, - title: 'Ocean', + title: 'Ocean Balance', webPreferences: { nodeIntegration: true, scrollBounce: true diff --git a/src/menu.js b/src/menu.js index d9204f9..c9fdd1e 100644 --- a/src/menu.js +++ b/src/menu.js @@ -1,5 +1,5 @@ const { app, Menu } = require('electron') -const { openUrl } = require('./app/util/openUrl') +const { openUrl } = require('./utils') const { homepage } = require('../package.json') const buildMenu = mainWindow => { diff --git a/src/app/util/openUrl.js b/src/utils.js similarity index 100% rename from src/app/util/openUrl.js rename to src/utils.js diff --git a/webpack.common.config.js b/webpack.common.config.js index 14dcfaa..cd7c789 100644 --- a/webpack.common.config.js +++ b/webpack.common.config.js @@ -1,5 +1,6 @@ const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') +const CopyPlugin = require('copy-webpack-plugin') // Any directories you will be adding code/files into, need to be added to this array so webpack will pick them up const defaultInclude = [path.resolve(__dirname, 'src')] @@ -44,5 +45,10 @@ module.exports = { extensions: ['*', '.js', '.jsx'] }, target: 'electron-renderer', - plugins: [new HtmlWebpackPlugin()] + plugins: [ + new HtmlWebpackPlugin(), + new CopyPlugin([ + { from: './src/app/images/icon.*', to: './', flatten: true } + ]) + ] }