diff --git a/.erb/configs/webpack.config.renderer.web.ts b/.erb/configs/webpack.config.renderer.web.ts
index 319523a1..39fca511 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'),
- ],
-
- 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',
- },
+ entry: [
+ `webpack-dev-server/client?http://localhost:${port}/dist`,
+ 'webpack/hot/only-dev-server',
+ path.join(webpackPaths.srcRendererPath, 'index.tsx'),
],
- },
- 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: '/',
+ output: {
+ path: webpackPaths.distRendererPath,
+ publicPath: '/',
+ filename: 'renderer.dev.js',
+ library: {
+ type: 'umd',
+ },
},
- 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) {
- return middlewares;
+ 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,
+ },
+
+ 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 f0a633a6..4a493acb 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 eceb5ea9..cb1db0cb 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 a5a41e94..7f1eb418 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 4e406ebd..00000000 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 6a550006..00000000 Binary files a/assets/icon.png and /dev/null differ diff --git a/assets/icons/1024x1024.png b/assets/icons/1024x1024.png index 04e4180d..62563d85 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 35d9d6b8..6bb49a9b 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 88fb098c..932f7d33 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 d9826020..ecdac26b 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 5ea35d97..f364f2c1 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 602b2115..7534b9f5 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 00000000..50d1d236 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 00000000..93da8771 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 00000000..1e9d1e04 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 00000000..f364f2c1 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 00000000..a46febfd 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 00000000..49b34ec8 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 00000000..f0ad3187 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 00000000..8239963f Binary files /dev/null and b/media/feishin.png differ diff --git a/package.json b/package.json index 7ef8cbf1..428ee29a 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 dd2de915..2979a1af 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,