Add new app icon (#232)
@ -13,131 +13,132 @@ import webpackPaths from './webpack.paths';
|
|||||||
// When an ESLint server is running, we can't set the NODE_ENV so we'll check if it's
|
// When an ESLint server is running, we can't set the NODE_ENV so we'll check if it's
|
||||||
// at the dev webpack config is not accidentally run in a production environment
|
// at the dev webpack config is not accidentally run in a production environment
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
checkNodeEnv('development');
|
checkNodeEnv('development');
|
||||||
}
|
}
|
||||||
|
|
||||||
const port = process.env.PORT || 4343;
|
const port = process.env.PORT || 4343;
|
||||||
|
|
||||||
const configuration: webpack.Configuration = {
|
const configuration: webpack.Configuration = {
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
|
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
|
|
||||||
target: ['web', 'electron-renderer'],
|
target: ['web', 'electron-renderer'],
|
||||||
|
|
||||||
entry: [
|
entry: [
|
||||||
`webpack-dev-server/client?http://localhost:${port}/dist`,
|
`webpack-dev-server/client?http://localhost:${port}/dist`,
|
||||||
'webpack/hot/only-dev-server',
|
'webpack/hot/only-dev-server',
|
||||||
path.join(webpackPaths.srcRendererPath, 'index.tsx'),
|
path.join(webpackPaths.srcRendererPath, 'index.tsx'),
|
||||||
],
|
|
||||||
|
|
||||||
output: {
|
|
||||||
path: webpackPaths.distRendererPath,
|
|
||||||
publicPath: '/',
|
|
||||||
filename: 'renderer.dev.js',
|
|
||||||
library: {
|
|
||||||
type: 'umd',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.s?css$/,
|
|
||||||
use: [
|
|
||||||
'style-loader',
|
|
||||||
{
|
|
||||||
loader: 'css-loader',
|
|
||||||
options: {
|
|
||||||
modules: {
|
|
||||||
localIdentName: '[name]__[local]--[hash:base64:5]',
|
|
||||||
exportLocalsConvention: 'camelCaseOnly',
|
|
||||||
},
|
|
||||||
sourceMap: true,
|
|
||||||
importLoaders: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'sass-loader',
|
|
||||||
],
|
|
||||||
include: /\.module\.s?(c|a)ss$/,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.s?css$/,
|
|
||||||
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
||||||
exclude: /\.module\.s?(c|a)ss$/,
|
|
||||||
},
|
|
||||||
// Fonts
|
|
||||||
{
|
|
||||||
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
||||||
type: 'asset/resource',
|
|
||||||
},
|
|
||||||
// Images
|
|
||||||
{
|
|
||||||
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
|
||||||
type: 'asset/resource',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new webpack.NoEmitOnErrorsPlugin(),
|
|
||||||
|
|
||||||
/**
|
output: {
|
||||||
* Create global constants which can be configured at compile time.
|
path: webpackPaths.distRendererPath,
|
||||||
*
|
publicPath: '/',
|
||||||
* Useful for allowing different behaviour between development builds and
|
filename: 'renderer.dev.js',
|
||||||
* release builds
|
library: {
|
||||||
*
|
type: 'umd',
|
||||||
* NODE_ENV should be production so that modules do not perform certain
|
},
|
||||||
* development checks
|
|
||||||
*
|
|
||||||
* By default, use 'development' as NODE_ENV. This can be overriden with
|
|
||||||
* 'staging', for example, by changing the ENV variables in the npm scripts
|
|
||||||
*/
|
|
||||||
new webpack.EnvironmentPlugin({
|
|
||||||
NODE_ENV: 'development',
|
|
||||||
}),
|
|
||||||
|
|
||||||
new webpack.LoaderOptionsPlugin({
|
|
||||||
debug: true,
|
|
||||||
}),
|
|
||||||
|
|
||||||
new ReactRefreshWebpackPlugin(),
|
|
||||||
|
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
filename: path.join('index.html'),
|
|
||||||
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
|
|
||||||
minify: {
|
|
||||||
collapseWhitespace: true,
|
|
||||||
removeAttributeQuotes: true,
|
|
||||||
removeComments: true,
|
|
||||||
},
|
|
||||||
isBrowser: false,
|
|
||||||
env: process.env.NODE_ENV,
|
|
||||||
isDevelopment: process.env.NODE_ENV !== 'production',
|
|
||||||
nodeModules: webpackPaths.appNodeModulesPath,
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
|
|
||||||
node: {
|
|
||||||
__dirname: false,
|
|
||||||
__filename: false,
|
|
||||||
},
|
|
||||||
|
|
||||||
devServer: {
|
|
||||||
port,
|
|
||||||
compress: true,
|
|
||||||
hot: true,
|
|
||||||
headers: { 'Access-Control-Allow-Origin': '*' },
|
|
||||||
static: {
|
|
||||||
publicPath: '/',
|
|
||||||
},
|
},
|
||||||
historyApiFallback: {
|
|
||||||
verbose: true,
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.s?css$/,
|
||||||
|
use: [
|
||||||
|
'style-loader',
|
||||||
|
{
|
||||||
|
loader: 'css-loader',
|
||||||
|
options: {
|
||||||
|
modules: {
|
||||||
|
localIdentName: '[name]__[local]--[hash:base64:5]',
|
||||||
|
exportLocalsConvention: 'camelCaseOnly',
|
||||||
|
},
|
||||||
|
sourceMap: true,
|
||||||
|
importLoaders: 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'sass-loader',
|
||||||
|
],
|
||||||
|
include: /\.module\.s?(c|a)ss$/,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.s?css$/,
|
||||||
|
use: ['style-loader', 'css-loader', 'sass-loader'],
|
||||||
|
exclude: /\.module\.s?(c|a)ss$/,
|
||||||
|
},
|
||||||
|
// Fonts
|
||||||
|
{
|
||||||
|
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
||||||
|
type: 'asset/resource',
|
||||||
|
},
|
||||||
|
// Images
|
||||||
|
{
|
||||||
|
test: /\.(png|svg|jpg|jpeg|gif)$/i,
|
||||||
|
type: 'asset/resource',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
setupMiddlewares(middlewares) {
|
plugins: [
|
||||||
return middlewares;
|
new webpack.NoEmitOnErrorsPlugin(),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create global constants which can be configured at compile time.
|
||||||
|
*
|
||||||
|
* Useful for allowing different behaviour between development builds and
|
||||||
|
* release builds
|
||||||
|
*
|
||||||
|
* NODE_ENV should be production so that modules do not perform certain
|
||||||
|
* development checks
|
||||||
|
*
|
||||||
|
* By default, use 'development' as NODE_ENV. This can be overriden with
|
||||||
|
* 'staging', for example, by changing the ENV variables in the npm scripts
|
||||||
|
*/
|
||||||
|
new webpack.EnvironmentPlugin({
|
||||||
|
NODE_ENV: 'development',
|
||||||
|
}),
|
||||||
|
|
||||||
|
new webpack.LoaderOptionsPlugin({
|
||||||
|
debug: true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
new ReactRefreshWebpackPlugin(),
|
||||||
|
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
filename: path.join('index.html'),
|
||||||
|
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
|
||||||
|
favicon: path.join(webpackPaths.assetsPath, 'icons', 'favicon.ico'),
|
||||||
|
minify: {
|
||||||
|
collapseWhitespace: true,
|
||||||
|
removeAttributeQuotes: true,
|
||||||
|
removeComments: true,
|
||||||
|
},
|
||||||
|
isBrowser: false,
|
||||||
|
env: process.env.NODE_ENV,
|
||||||
|
isDevelopment: process.env.NODE_ENV !== 'production',
|
||||||
|
nodeModules: webpackPaths.appNodeModulesPath,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
|
||||||
|
node: {
|
||||||
|
__dirname: false,
|
||||||
|
__filename: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
devServer: {
|
||||||
|
port,
|
||||||
|
compress: true,
|
||||||
|
hot: true,
|
||||||
|
headers: { 'Access-Control-Allow-Origin': '*' },
|
||||||
|
static: {
|
||||||
|
publicPath: '/',
|
||||||
|
},
|
||||||
|
historyApiFallback: {
|
||||||
|
verbose: true,
|
||||||
|
},
|
||||||
|
setupMiddlewares(middlewares) {
|
||||||
|
return middlewares;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default merge(baseConfig, configuration);
|
export default merge(baseConfig, configuration);
|
||||||
|
@ -120,6 +120,7 @@ const configuration: webpack.Configuration = {
|
|||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
|
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
|
||||||
|
favicon: path.join(webpackPaths.assetsPath, 'icons', 'favicon.ico'),
|
||||||
minify: {
|
minify: {
|
||||||
collapseWhitespace: true,
|
collapseWhitespace: true,
|
||||||
removeAttributeQuotes: true,
|
removeAttributeQuotes: true,
|
||||||
|
@ -5,6 +5,7 @@ const rootPath = path.join(__dirname, '../..');
|
|||||||
const dllPath = path.join(__dirname, '../dll');
|
const dllPath = path.join(__dirname, '../dll');
|
||||||
|
|
||||||
const srcPath = path.join(rootPath, 'src');
|
const srcPath = path.join(rootPath, 'src');
|
||||||
|
const assetsPath = path.join(rootPath, 'assets');
|
||||||
const srcMainPath = path.join(srcPath, 'main');
|
const srcMainPath = path.join(srcPath, 'main');
|
||||||
const srcRemotePath = path.join(srcPath, 'remote');
|
const srcRemotePath = path.join(srcPath, 'remote');
|
||||||
const srcRendererPath = path.join(srcPath, 'renderer');
|
const srcRendererPath = path.join(srcPath, 'renderer');
|
||||||
@ -24,21 +25,22 @@ const distWebPath = path.join(distPath, 'web');
|
|||||||
const buildPath = path.join(releasePath, 'build');
|
const buildPath = path.join(releasePath, 'build');
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
rootPath,
|
assetsPath,
|
||||||
dllPath,
|
rootPath,
|
||||||
srcPath,
|
dllPath,
|
||||||
srcMainPath,
|
srcPath,
|
||||||
srcRemotePath,
|
srcMainPath,
|
||||||
srcRendererPath,
|
srcRemotePath,
|
||||||
releasePath,
|
srcRendererPath,
|
||||||
appPath,
|
releasePath,
|
||||||
appPackagePath,
|
appPath,
|
||||||
appNodeModulesPath,
|
appPackagePath,
|
||||||
srcNodeModulesPath,
|
appNodeModulesPath,
|
||||||
distPath,
|
srcNodeModulesPath,
|
||||||
distMainPath,
|
distPath,
|
||||||
distRemotePath,
|
distMainPath,
|
||||||
distRendererPath,
|
distRemotePath,
|
||||||
distWebPath,
|
distRendererPath,
|
||||||
buildPath,
|
distWebPath,
|
||||||
|
buildPath,
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
<img src="assets/feishin.png" alt="logo" title="feishin" align="right" height="60px" />
|
||||||
|
|
||||||
# Feishin
|
# Feishin
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
BIN
assets/icon.ico
Before Width: | Height: | Size: 3.3 KiB |
BIN
assets/icon.png
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 2.8 KiB |
BIN
assets/icons/favicon.ico
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/icons/icon.icns
Normal file
BIN
assets/icons/icon.ico
Normal file
After Width: | Height: | Size: 176 KiB |
BIN
assets/icons/icon.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
media/feishin-alt.pdn
Normal file
BIN
media/feishin-alt.png
Normal file
After Width: | Height: | Size: 118 KiB |
BIN
media/feishin.pdn
Normal file
BIN
media/feishin.png
Normal file
After Width: | Height: | Size: 101 KiB |
@ -65,6 +65,7 @@
|
|||||||
"x64"
|
"x64"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"icon": "assets/icons/icon.icns",
|
||||||
"type": "distribution",
|
"type": "distribution",
|
||||||
"hardenedRuntime": true,
|
"hardenedRuntime": true,
|
||||||
"entitlements": "assets/entitlements.mac.plist",
|
"entitlements": "assets/entitlements.mac.plist",
|
||||||
@ -89,14 +90,15 @@
|
|||||||
"target": [
|
"target": [
|
||||||
"nsis",
|
"nsis",
|
||||||
"zip"
|
"zip"
|
||||||
]
|
],
|
||||||
|
"icon": "assets/icons/icon.ico"
|
||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
"target": [
|
"target": [
|
||||||
"AppImage",
|
"AppImage",
|
||||||
"tar.xz"
|
"tar.xz"
|
||||||
],
|
],
|
||||||
"icon": "assets/icons/placeholder.png",
|
"icon": "assets/icons/icon.png",
|
||||||
"category": "Development"
|
"category": "Development"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -129,7 +129,9 @@ const createTray = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tray = isLinux() ? new Tray(getAssetPath('icon.png')) : new Tray(getAssetPath('icon.ico'));
|
tray = isLinux()
|
||||||
|
? new Tray(getAssetPath('icons/icon.png'))
|
||||||
|
: new Tray(getAssetPath('icons/icon.ico'));
|
||||||
const contextMenu = Menu.buildFromTemplate([
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
click: () => {
|
click: () => {
|
||||||
@ -212,7 +214,7 @@ const createWindow = async () => {
|
|||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
frame: false,
|
frame: false,
|
||||||
height: 900,
|
height: 900,
|
||||||
icon: getAssetPath('icon.png'),
|
icon: getAssetPath('icons/icon.png'),
|
||||||
minHeight: 640,
|
minHeight: 640,
|
||||||
minWidth: 480,
|
minWidth: 480,
|
||||||
show: false,
|
show: false,
|
||||||
|