diff --git a/.erb/configs/webpack.config.renderer.web.ts b/.erb/configs/webpack.config.renderer.web.ts index 319523a14..39fca511f 100644 --- a/.erb/configs/webpack.config.renderer.web.ts +++ b/.erb/configs/webpack.config.renderer.web.ts @@ -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 // at the dev webpack config is not accidentally run in a production environment if (process.env.NODE_ENV === 'production') { - checkNodeEnv('development'); + checkNodeEnv('development'); } const port = process.env.PORT || 4343; 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: [ - `webpack-dev-server/client?http://localhost:${port}/dist`, - 'webpack/hot/only-dev-server', - path.join(webpackPaths.srcRendererPath, 'index.tsx'), - ], + entry: [ + `webpack-dev-server/client?http://localhost:${port}/dist`, + 'webpack/hot/only-dev-server', + path.join(webpackPaths.srcRendererPath, 'index.tsx'), + ], - output: { - path: webpackPaths.distRendererPath, - publicPath: '/', - filename: 'renderer.dev.js', - library: { - type: 'umd', + 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, + + 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', }, - }, - '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(), - - /** - * 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'), - 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, + plugins: [ + 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, }, - setupMiddlewares(middlewares) { - return middlewares; + + 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); diff --git a/.erb/configs/webpack.config.web.prod.ts b/.erb/configs/webpack.config.web.prod.ts index f0a633a6b..4a493acb7 100644 --- a/.erb/configs/webpack.config.web.prod.ts +++ b/.erb/configs/webpack.config.web.prod.ts @@ -120,6 +120,7 @@ const configuration: webpack.Configuration = { new HtmlWebpackPlugin({ filename: 'index.html', template: path.join(webpackPaths.srcRendererPath, 'index.ejs'), + favicon: path.join(webpackPaths.assetsPath, 'icons', 'favicon.ico'), minify: { collapseWhitespace: true, removeAttributeQuotes: true, diff --git a/.erb/configs/webpack.paths.ts b/.erb/configs/webpack.paths.ts index eceb5ea9c..cb1db0cba 100644 --- a/.erb/configs/webpack.paths.ts +++ b/.erb/configs/webpack.paths.ts @@ -5,6 +5,7 @@ const rootPath = path.join(__dirname, '../..'); const dllPath = path.join(__dirname, '../dll'); const srcPath = path.join(rootPath, 'src'); +const assetsPath = path.join(rootPath, 'assets'); const srcMainPath = path.join(srcPath, 'main'); const srcRemotePath = path.join(srcPath, 'remote'); const srcRendererPath = path.join(srcPath, 'renderer'); @@ -24,21 +25,22 @@ const distWebPath = path.join(distPath, 'web'); const buildPath = path.join(releasePath, 'build'); export default { - rootPath, - dllPath, - srcPath, - srcMainPath, - srcRemotePath, - srcRendererPath, - releasePath, - appPath, - appPackagePath, - appNodeModulesPath, - srcNodeModulesPath, - distPath, - distMainPath, - distRemotePath, - distRendererPath, - distWebPath, - buildPath, + assetsPath, + rootPath, + dllPath, + srcPath, + srcMainPath, + srcRemotePath, + srcRendererPath, + releasePath, + appPath, + appPackagePath, + appNodeModulesPath, + srcNodeModulesPath, + distPath, + distMainPath, + distRemotePath, + distRendererPath, + distWebPath, + buildPath, }; diff --git a/README.md b/README.md index a5a41e946..7f1eb4180 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ + + # Feishin
diff --git a/assets/icon.ico b/assets/icon.ico deleted file mode 100644 index 4e406ebdd..000000000 Binary files a/assets/icon.ico and /dev/null differ diff --git a/assets/icon.png b/assets/icon.png deleted file mode 100644 index 6a5500069..000000000 Binary files a/assets/icon.png and /dev/null differ diff --git a/assets/icons/1024x1024.png b/assets/icons/1024x1024.png index 04e4180da..62563d85b 100644 Binary files a/assets/icons/1024x1024.png and b/assets/icons/1024x1024.png differ diff --git a/assets/icons/128x128.png b/assets/icons/128x128.png index 35d9d6b8b..6bb49a9b6 100644 Binary files a/assets/icons/128x128.png and b/assets/icons/128x128.png differ diff --git a/assets/icons/256x256.png b/assets/icons/256x256.png index 88fb098cb..932f7d339 100644 Binary files a/assets/icons/256x256.png and b/assets/icons/256x256.png differ diff --git a/assets/icons/32x32.png b/assets/icons/32x32.png index d98260207..ecdac26b0 100644 Binary files a/assets/icons/32x32.png and b/assets/icons/32x32.png differ diff --git a/assets/icons/512x512.png b/assets/icons/512x512.png index 5ea35d978..f364f2c17 100644 Binary files a/assets/icons/512x512.png and b/assets/icons/512x512.png differ diff --git a/assets/icons/64x64.png b/assets/icons/64x64.png index 602b2115d..7534b9f51 100644 Binary files a/assets/icons/64x64.png and b/assets/icons/64x64.png differ diff --git a/assets/icons/favicon.ico b/assets/icons/favicon.ico new file mode 100644 index 000000000..50d1d2364 Binary files /dev/null and b/assets/icons/favicon.ico differ diff --git a/assets/icons/icon.icns b/assets/icons/icon.icns new file mode 100644 index 000000000..93da87711 Binary files /dev/null and b/assets/icons/icon.icns differ diff --git a/assets/icons/icon.ico b/assets/icons/icon.ico new file mode 100644 index 000000000..1e9d1e045 Binary files /dev/null and b/assets/icons/icon.ico differ diff --git a/assets/icons/icon.png b/assets/icons/icon.png new file mode 100644 index 000000000..f364f2c17 Binary files /dev/null and b/assets/icons/icon.png differ diff --git a/media/feishin-alt.pdn b/media/feishin-alt.pdn new file mode 100644 index 000000000..a46febfdf Binary files /dev/null and b/media/feishin-alt.pdn differ diff --git a/media/feishin-alt.png b/media/feishin-alt.png new file mode 100644 index 000000000..49b34ec86 Binary files /dev/null and b/media/feishin-alt.png differ diff --git a/media/feishin.pdn b/media/feishin.pdn new file mode 100644 index 000000000..f0ad31874 Binary files /dev/null and b/media/feishin.pdn differ diff --git a/media/feishin.png b/media/feishin.png new file mode 100644 index 000000000..8239963f8 Binary files /dev/null and b/media/feishin.png differ diff --git a/package.json b/package.json index 7ef8cbf12..428ee29a5 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "x64" ] }, + "icon": "assets/icons/icon.icns", "type": "distribution", "hardenedRuntime": true, "entitlements": "assets/entitlements.mac.plist", @@ -89,14 +90,15 @@ "target": [ "nsis", "zip" - ] + ], + "icon": "assets/icons/icon.ico" }, "linux": { "target": [ "AppImage", "tar.xz" ], - "icon": "assets/icons/placeholder.png", + "icon": "assets/icons/icon.png", "category": "Development" }, "directories": { diff --git a/src/main/main.ts b/src/main/main.ts index dd2de9159..2979a1af9 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -129,7 +129,9 @@ const createTray = () => { 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([ { click: () => { @@ -212,7 +214,7 @@ const createWindow = async () => { autoHideMenuBar: true, frame: false, height: 900, - icon: getAssetPath('icon.png'), + icon: getAssetPath('icons/icon.png'), minHeight: 640, minWidth: 480, show: false,