added so many files
12
.editorconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
7
.erb/configs/.eslintrc
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"global-require": "off",
|
||||
"import/no-dynamic-require": "off"
|
||||
}
|
||||
}
|
||||
59
.erb/configs/webpack.config.base.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Base webpack config used across other specific configs
|
||||
*/
|
||||
|
||||
import webpack from 'webpack';
|
||||
import TsconfigPathsPlugins from 'tsconfig-paths-webpack-plugin';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import { dependencies as externals } from '../../release/app/package.json';
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
externals: [...Object.keys(externals || {})],
|
||||
|
||||
stats: 'errors-only',
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.[jt]sx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
// Remove this line to enable type checking in webpack builds
|
||||
transpileOnly: true,
|
||||
compilerOptions: {
|
||||
module: 'esnext',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
output: {
|
||||
path: webpackPaths.srcPath,
|
||||
// https://github.com/webpack/webpack/issues/1114
|
||||
library: {
|
||||
type: 'commonjs2',
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine the array of extensions that should be used to resolve modules.
|
||||
*/
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'],
|
||||
modules: [webpackPaths.srcPath, 'node_modules'],
|
||||
// There is no need to add aliases here, the paths in tsconfig get mirrored
|
||||
plugins: [new TsconfigPathsPlugins()],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'production',
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
export default configuration;
|
||||
3
.erb/configs/webpack.config.eslint.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
/* eslint import/no-unresolved: off, import/no-self-import: off */
|
||||
|
||||
module.exports = require('./webpack.config.renderer.dev').default;
|
||||
83
.erb/configs/webpack.config.main.prod.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* Webpack config for production electron main process
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import webpack from 'webpack';
|
||||
import { merge } from 'webpack-merge';
|
||||
import TerserPlugin from 'terser-webpack-plugin';
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
||||
import baseConfig from './webpack.config.base';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import checkNodeEnv from '../scripts/check-node-env';
|
||||
import deleteSourceMaps from '../scripts/delete-source-maps';
|
||||
|
||||
checkNodeEnv('production');
|
||||
deleteSourceMaps();
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
devtool: 'source-map',
|
||||
|
||||
mode: 'production',
|
||||
|
||||
target: 'electron-main',
|
||||
|
||||
entry: {
|
||||
main: path.join(webpackPaths.srcMainPath, 'main.ts'),
|
||||
preload: path.join(webpackPaths.srcMainPath, 'preload.ts'),
|
||||
},
|
||||
|
||||
output: {
|
||||
path: webpackPaths.distMainPath,
|
||||
filename: '[name].js',
|
||||
library: {
|
||||
type: 'umd',
|
||||
},
|
||||
},
|
||||
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
parallel: true,
|
||||
}),
|
||||
],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
|
||||
analyzerPort: 8888,
|
||||
}),
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'production',
|
||||
DEBUG_PROD: false,
|
||||
START_MINIMIZED: false,
|
||||
}),
|
||||
|
||||
new webpack.DefinePlugin({
|
||||
'process.type': '"browser"',
|
||||
}),
|
||||
],
|
||||
|
||||
/**
|
||||
* Disables webpack processing of __dirname and __filename.
|
||||
* If you run the bundle in node.js it falls back to these values of node.js.
|
||||
* https://github.com/webpack/webpack/issues/2010
|
||||
*/
|
||||
node: {
|
||||
__dirname: false,
|
||||
__filename: false,
|
||||
},
|
||||
};
|
||||
|
||||
export default merge(baseConfig, configuration);
|
||||
71
.erb/configs/webpack.config.preload.dev.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import path from 'path';
|
||||
import webpack from 'webpack';
|
||||
import { merge } from 'webpack-merge';
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
||||
import baseConfig from './webpack.config.base';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import checkNodeEnv from '../scripts/check-node-env';
|
||||
|
||||
// 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');
|
||||
}
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
mode: 'development',
|
||||
|
||||
target: 'electron-preload',
|
||||
|
||||
entry: path.join(webpackPaths.srcMainPath, 'preload.ts'),
|
||||
|
||||
output: {
|
||||
path: webpackPaths.dllPath,
|
||||
filename: 'preload.js',
|
||||
library: {
|
||||
type: 'umd',
|
||||
},
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
|
||||
}),
|
||||
|
||||
/**
|
||||
* 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,
|
||||
}),
|
||||
],
|
||||
|
||||
/**
|
||||
* Disables webpack processing of __dirname and __filename.
|
||||
* If you run the bundle in node.js it falls back to these values of node.js.
|
||||
* https://github.com/webpack/webpack/issues/2010
|
||||
*/
|
||||
node: {
|
||||
__dirname: false,
|
||||
__filename: false,
|
||||
},
|
||||
|
||||
watch: true,
|
||||
};
|
||||
|
||||
export default merge(baseConfig, configuration);
|
||||
77
.erb/configs/webpack.config.renderer.dev.dll.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Builds the DLL for development electron renderer process
|
||||
*/
|
||||
|
||||
import webpack from 'webpack';
|
||||
import path from 'path';
|
||||
import { merge } from 'webpack-merge';
|
||||
import baseConfig from './webpack.config.base';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import { dependencies } from '../../package.json';
|
||||
import checkNodeEnv from '../scripts/check-node-env';
|
||||
|
||||
checkNodeEnv('development');
|
||||
|
||||
const dist = webpackPaths.dllPath;
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
context: webpackPaths.rootPath,
|
||||
|
||||
devtool: 'eval',
|
||||
|
||||
mode: 'development',
|
||||
|
||||
target: 'electron-renderer',
|
||||
|
||||
externals: ['fsevents', 'crypto-browserify'],
|
||||
|
||||
/**
|
||||
* Use `module` from `webpack.config.renderer.dev.js`
|
||||
*/
|
||||
module: require('./webpack.config.renderer.dev').default.module,
|
||||
|
||||
entry: {
|
||||
renderer: Object.keys(dependencies || {}),
|
||||
},
|
||||
|
||||
output: {
|
||||
path: dist,
|
||||
filename: '[name].dev.dll.js',
|
||||
library: {
|
||||
name: 'renderer',
|
||||
type: 'var',
|
||||
},
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.DllPlugin({
|
||||
path: path.join(dist, '[name].json'),
|
||||
name: '[name]',
|
||||
}),
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'development',
|
||||
}),
|
||||
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
debug: true,
|
||||
options: {
|
||||
context: webpackPaths.srcPath,
|
||||
output: {
|
||||
path: webpackPaths.dllPath,
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
export default merge(baseConfig, configuration);
|
||||
218
.erb/configs/webpack.config.renderer.dev.ts
Normal file
@@ -0,0 +1,218 @@
|
||||
import 'webpack-dev-server';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import webpack from 'webpack';
|
||||
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||
import chalk from 'chalk';
|
||||
import { merge } from 'webpack-merge';
|
||||
import { execSync, spawn } from 'child_process';
|
||||
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
|
||||
import baseConfig from './webpack.config.base';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import checkNodeEnv from '../scripts/check-node-env';
|
||||
|
||||
// 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');
|
||||
}
|
||||
|
||||
const port = process.env.PORT || 1212;
|
||||
const manifest = path.resolve(webpackPaths.dllPath, 'renderer.json');
|
||||
const skipDLLs =
|
||||
module.parent?.filename.includes('webpack.config.renderer.dev.dll') ||
|
||||
module.parent?.filename.includes('webpack.config.eslint');
|
||||
|
||||
/**
|
||||
* Warn if the DLL is not built
|
||||
*/
|
||||
if (
|
||||
!skipDLLs &&
|
||||
!(fs.existsSync(webpackPaths.dllPath) && fs.existsSync(manifest))
|
||||
) {
|
||||
console.log(
|
||||
chalk.black.bgYellow.bold(
|
||||
'The DLL files are missing. Sit back while we build them for you with "npm run build-dll"'
|
||||
)
|
||||
);
|
||||
execSync('npm run postinstall');
|
||||
}
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
mode: 'development',
|
||||
|
||||
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?(c|a)ss$/,
|
||||
use: [
|
||||
'style-loader',
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
modules: true,
|
||||
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|jpg|jpeg|gif)$/i,
|
||||
type: 'asset/resource',
|
||||
},
|
||||
// MP3
|
||||
{
|
||||
test: /\.mp3$/,
|
||||
use: 'file-loader',
|
||||
},
|
||||
// SVG
|
||||
{
|
||||
test: /\.svg$/,
|
||||
use: [
|
||||
{
|
||||
loader: '@svgr/webpack',
|
||||
options: {
|
||||
prettier: false,
|
||||
svgo: false,
|
||||
svgoConfig: {
|
||||
plugins: [{ removeViewBox: false }],
|
||||
},
|
||||
titleProp: true,
|
||||
ref: true,
|
||||
},
|
||||
},
|
||||
'file-loader',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
...(skipDLLs
|
||||
? []
|
||||
: [
|
||||
new webpack.DllReferencePlugin({
|
||||
context: webpackPaths.dllPath,
|
||||
manifest: require(manifest),
|
||||
sourceType: 'var',
|
||||
}),
|
||||
]),
|
||||
|
||||
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,
|
||||
},
|
||||
setupMiddlewares(middlewares) {
|
||||
console.log('Starting preload.js builder...');
|
||||
const preloadProcess = spawn('npm', ['run', 'start:preload'], {
|
||||
shell: true,
|
||||
stdio: 'inherit',
|
||||
})
|
||||
.on('close', (code: number) => process.exit(code!))
|
||||
.on('error', (spawnError) => console.error(spawnError));
|
||||
|
||||
console.log('Starting Main Process...');
|
||||
let args = ['run', 'start:main'];
|
||||
if (process.env.MAIN_ARGS) {
|
||||
args = args.concat(
|
||||
['--', ...process.env.MAIN_ARGS.matchAll(/"[^"]+"|[^\s"]+/g)].flat()
|
||||
);
|
||||
}
|
||||
spawn('npm', args, {
|
||||
shell: true,
|
||||
stdio: 'inherit',
|
||||
})
|
||||
.on('close', (code: number) => {
|
||||
preloadProcess.kill();
|
||||
process.exit(code!);
|
||||
})
|
||||
.on('error', (spawnError) => console.error(spawnError));
|
||||
return middlewares;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default merge(baseConfig, configuration);
|
||||
145
.erb/configs/webpack.config.renderer.prod.ts
Normal file
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* Build config for electron renderer process
|
||||
*/
|
||||
|
||||
import path from 'path';
|
||||
import webpack from 'webpack';
|
||||
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
||||
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
||||
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
||||
import { merge } from 'webpack-merge';
|
||||
import TerserPlugin from 'terser-webpack-plugin';
|
||||
import baseConfig from './webpack.config.base';
|
||||
import webpackPaths from './webpack.paths';
|
||||
import checkNodeEnv from '../scripts/check-node-env';
|
||||
import deleteSourceMaps from '../scripts/delete-source-maps';
|
||||
|
||||
checkNodeEnv('production');
|
||||
deleteSourceMaps();
|
||||
|
||||
const configuration: webpack.Configuration = {
|
||||
devtool: 'source-map',
|
||||
|
||||
mode: 'production',
|
||||
|
||||
target: ['web', 'electron-renderer'],
|
||||
|
||||
entry: [path.join(webpackPaths.srcRendererPath, 'index.tsx')],
|
||||
|
||||
output: {
|
||||
path: webpackPaths.distRendererPath,
|
||||
publicPath: './',
|
||||
filename: 'renderer.js',
|
||||
library: {
|
||||
type: 'umd',
|
||||
},
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.s?(a|c)ss$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
modules: true,
|
||||
sourceMap: true,
|
||||
importLoaders: 1,
|
||||
},
|
||||
},
|
||||
'sass-loader',
|
||||
],
|
||||
include: /\.module\.s?(c|a)ss$/,
|
||||
},
|
||||
{
|
||||
test: /\.s?(a|c)ss$/,
|
||||
use: [MiniCssExtractPlugin.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|jpg|jpeg|gif)$/i,
|
||||
type: 'asset/resource',
|
||||
},
|
||||
{
|
||||
test: /\.mp3$/,
|
||||
use: 'file-loader',
|
||||
},
|
||||
// SVG
|
||||
{
|
||||
test: /\.svg$/,
|
||||
use: [
|
||||
{
|
||||
loader: '@svgr/webpack',
|
||||
options: {
|
||||
prettier: false,
|
||||
svgo: false,
|
||||
svgoConfig: {
|
||||
plugins: [{ removeViewBox: false }],
|
||||
},
|
||||
titleProp: true,
|
||||
ref: true,
|
||||
},
|
||||
},
|
||||
'file-loader',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [new TerserPlugin(), new CssMinimizerPlugin()],
|
||||
},
|
||||
|
||||
plugins: [
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'production',
|
||||
DEBUG_PROD: false,
|
||||
}),
|
||||
|
||||
new MiniCssExtractPlugin({
|
||||
filename: 'style.css',
|
||||
}),
|
||||
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: process.env.ANALYZE === 'true' ? 'server' : 'disabled',
|
||||
analyzerPort: 8889,
|
||||
}),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: path.join(webpackPaths.srcRendererPath, 'index.ejs'),
|
||||
minify: {
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true,
|
||||
removeComments: true,
|
||||
},
|
||||
isBrowser: false,
|
||||
isDevelopment: false,
|
||||
}),
|
||||
|
||||
new webpack.DefinePlugin({
|
||||
'process.type': '"renderer"',
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
export default merge(baseConfig, configuration);
|
||||
38
.erb/configs/webpack.paths.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
const path = require('path');
|
||||
|
||||
const rootPath = path.join(__dirname, '../..');
|
||||
|
||||
const dllPath = path.join(__dirname, '../dll');
|
||||
|
||||
const srcPath = path.join(rootPath, 'src');
|
||||
const srcMainPath = path.join(srcPath, 'main');
|
||||
const srcRendererPath = path.join(srcPath, 'renderer');
|
||||
|
||||
const releasePath = path.join(rootPath, 'release');
|
||||
const appPath = path.join(releasePath, 'app');
|
||||
const appPackagePath = path.join(appPath, 'package.json');
|
||||
const appNodeModulesPath = path.join(appPath, 'node_modules');
|
||||
const srcNodeModulesPath = path.join(srcPath, 'node_modules');
|
||||
|
||||
const distPath = path.join(appPath, 'dist');
|
||||
const distMainPath = path.join(distPath, 'main');
|
||||
const distRendererPath = path.join(distPath, 'renderer');
|
||||
|
||||
const buildPath = path.join(releasePath, 'build');
|
||||
|
||||
export default {
|
||||
rootPath,
|
||||
dllPath,
|
||||
srcPath,
|
||||
srcMainPath,
|
||||
srcRendererPath,
|
||||
releasePath,
|
||||
appPath,
|
||||
appPackagePath,
|
||||
appNodeModulesPath,
|
||||
srcNodeModulesPath,
|
||||
distPath,
|
||||
distMainPath,
|
||||
distRendererPath,
|
||||
buildPath,
|
||||
};
|
||||
32
.erb/img/erb-banner.svg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
.erb/img/erb-logo.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
6
.erb/img/palette-sponsor-banner.svg
Normal file
|
After Width: | Height: | Size: 33 KiB |
1
.erb/mocks/fileMock.js
Normal file
@@ -0,0 +1 @@
|
||||
export default 'test-file-stub';
|
||||
8
.erb/scripts/.eslintrc
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"global-require": "off",
|
||||
"import/no-dynamic-require": "off",
|
||||
"import/no-extraneous-dependencies": "off"
|
||||
}
|
||||
}
|
||||
24
.erb/scripts/check-build-exists.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// Check if the renderer and main bundles are built
|
||||
import path from 'path';
|
||||
import chalk from 'chalk';
|
||||
import fs from 'fs';
|
||||
import webpackPaths from '../configs/webpack.paths';
|
||||
|
||||
const mainPath = path.join(webpackPaths.distMainPath, 'main.js');
|
||||
const rendererPath = path.join(webpackPaths.distRendererPath, 'renderer.js');
|
||||
|
||||
if (!fs.existsSync(mainPath)) {
|
||||
throw new Error(
|
||||
chalk.whiteBright.bgRed.bold(
|
||||
'The main process is not built yet. Build it by running "npm run build:main"'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (!fs.existsSync(rendererPath)) {
|
||||
throw new Error(
|
||||
chalk.whiteBright.bgRed.bold(
|
||||
'The renderer process is not built yet. Build it by running "npm run build:renderer"'
|
||||
)
|
||||
);
|
||||
}
|
||||
54
.erb/scripts/check-native-dep.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import fs from 'fs';
|
||||
import chalk from 'chalk';
|
||||
import { execSync } from 'child_process';
|
||||
import { dependencies } from '../../package.json';
|
||||
|
||||
if (dependencies) {
|
||||
const dependenciesKeys = Object.keys(dependencies);
|
||||
const nativeDeps = fs
|
||||
.readdirSync('node_modules')
|
||||
.filter((folder) => fs.existsSync(`node_modules/${folder}/binding.gyp`));
|
||||
if (nativeDeps.length === 0) {
|
||||
process.exit(0);
|
||||
}
|
||||
try {
|
||||
// Find the reason for why the dependency is installed. If it is installed
|
||||
// because of a devDependency then that is okay. Warn when it is installed
|
||||
// because of a dependency
|
||||
const { dependencies: dependenciesObject } = JSON.parse(
|
||||
execSync(`npm ls ${nativeDeps.join(' ')} --json`).toString()
|
||||
);
|
||||
const rootDependencies = Object.keys(dependenciesObject);
|
||||
const filteredRootDependencies = rootDependencies.filter((rootDependency) =>
|
||||
dependenciesKeys.includes(rootDependency)
|
||||
);
|
||||
if (filteredRootDependencies.length > 0) {
|
||||
const plural = filteredRootDependencies.length > 1;
|
||||
console.log(`
|
||||
${chalk.whiteBright.bgYellow.bold(
|
||||
'Webpack does not work with native dependencies.'
|
||||
)}
|
||||
${chalk.bold(filteredRootDependencies.join(', '))} ${
|
||||
plural ? 'are native dependencies' : 'is a native dependency'
|
||||
} and should be installed inside of the "./release/app" folder.
|
||||
First, uninstall the packages from "./package.json":
|
||||
${chalk.whiteBright.bgGreen.bold('npm uninstall your-package')}
|
||||
${chalk.bold(
|
||||
'Then, instead of installing the package to the root "./package.json":'
|
||||
)}
|
||||
${chalk.whiteBright.bgRed.bold('npm install your-package')}
|
||||
${chalk.bold('Install the package to "./release/app/package.json"')}
|
||||
${chalk.whiteBright.bgGreen.bold(
|
||||
'cd ./release/app && npm install your-package'
|
||||
)}
|
||||
Read more about native dependencies at:
|
||||
${chalk.bold(
|
||||
'https://electron-react-boilerplate.js.org/docs/adding-dependencies/#module-structure'
|
||||
)}
|
||||
`);
|
||||
process.exit(1);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Native dependencies could not be checked');
|
||||
}
|
||||
}
|
||||
16
.erb/scripts/check-node-env.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import chalk from 'chalk';
|
||||
|
||||
export default function checkNodeEnv(expectedEnv) {
|
||||
if (!expectedEnv) {
|
||||
throw new Error('"expectedEnv" not set');
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== expectedEnv) {
|
||||
console.log(
|
||||
chalk.whiteBright.bgRed.bold(
|
||||
`"process.env.NODE_ENV" must be "${expectedEnv}" to use this webpack config`
|
||||
)
|
||||
);
|
||||
process.exit(2);
|
||||
}
|
||||
}
|
||||
16
.erb/scripts/check-port-in-use.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import chalk from 'chalk';
|
||||
import detectPort from 'detect-port';
|
||||
|
||||
const port = process.env.PORT || '1212';
|
||||
|
||||
detectPort(port, (err, availablePort) => {
|
||||
if (port !== String(availablePort)) {
|
||||
throw new Error(
|
||||
chalk.whiteBright.bgRed.bold(
|
||||
`Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 npm start`
|
||||
)
|
||||
);
|
||||
} else {
|
||||
process.exit(0);
|
||||
}
|
||||
});
|
||||
13
.erb/scripts/clean.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { rimrafSync } from 'rimraf';
|
||||
import fs from 'fs';
|
||||
import webpackPaths from '../configs/webpack.paths';
|
||||
|
||||
const foldersToRemove = [
|
||||
webpackPaths.distPath,
|
||||
webpackPaths.buildPath,
|
||||
webpackPaths.dllPath,
|
||||
];
|
||||
|
||||
foldersToRemove.forEach((folder) => {
|
||||
if (fs.existsSync(folder)) rimrafSync(folder);
|
||||
});
|
||||
15
.erb/scripts/delete-source-maps.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { rimrafSync } from 'rimraf';
|
||||
import webpackPaths from '../configs/webpack.paths';
|
||||
|
||||
export default function deleteSourceMaps() {
|
||||
if (fs.existsSync(webpackPaths.distMainPath))
|
||||
rimrafSync(path.join(webpackPaths.distMainPath, '*.js.map'), {
|
||||
glob: true,
|
||||
});
|
||||
if (fs.existsSync(webpackPaths.distRendererPath))
|
||||
rimrafSync(path.join(webpackPaths.distRendererPath, '*.js.map'), {
|
||||
glob: true,
|
||||
});
|
||||
}
|
||||
20
.erb/scripts/electron-rebuild.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { execSync } from 'child_process';
|
||||
import fs from 'fs';
|
||||
import { dependencies } from '../../release/app/package.json';
|
||||
import webpackPaths from '../configs/webpack.paths';
|
||||
|
||||
if (
|
||||
Object.keys(dependencies || {}).length > 0 &&
|
||||
fs.existsSync(webpackPaths.appNodeModulesPath)
|
||||
) {
|
||||
const electronRebuildCmd =
|
||||
'../../node_modules/.bin/electron-rebuild --force --types prod,dev,optional --module-dir .';
|
||||
const cmd =
|
||||
process.platform === 'win32'
|
||||
? electronRebuildCmd.replace(/\//g, '\\')
|
||||
: electronRebuildCmd;
|
||||
execSync(cmd, {
|
||||
cwd: webpackPaths.appPath,
|
||||
stdio: 'inherit',
|
||||
});
|
||||
}
|
||||
9
.erb/scripts/link-modules.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import fs from 'fs';
|
||||
import webpackPaths from '../configs/webpack.paths';
|
||||
|
||||
const { srcNodeModulesPath } = webpackPaths;
|
||||
const { appNodeModulesPath } = webpackPaths;
|
||||
|
||||
if (!fs.existsSync(srcNodeModulesPath) && fs.existsSync(appNodeModulesPath)) {
|
||||
fs.symlinkSync(appNodeModulesPath, srcNodeModulesPath, 'junction');
|
||||
}
|
||||
30
.erb/scripts/notarize.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const { notarize } = require('@electron/notarize');
|
||||
const { build } = require('../../package.json');
|
||||
|
||||
exports.default = async function notarizeMacos(context) {
|
||||
const { electronPlatformName, appOutDir } = context;
|
||||
if (electronPlatformName !== 'darwin') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.env.CI !== 'true') {
|
||||
console.warn('Skipping notarizing step. Packaging is not running in CI');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!('APPLE_ID' in process.env && 'APPLE_ID_PASS' in process.env)) {
|
||||
console.warn(
|
||||
'Skipping notarizing step. APPLE_ID and APPLE_ID_PASS env variables must be set'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const appName = context.packager.appInfo.productFilename;
|
||||
|
||||
await notarize({
|
||||
appBundleId: build.appId,
|
||||
appPath: `${appOutDir}/${appName}.app`,
|
||||
appleId: process.env.APPLE_ID,
|
||||
appleIdPassword: process.env.APPLE_ID_PASS,
|
||||
});
|
||||
};
|
||||
33
.eslintignore
Normal file
@@ -0,0 +1,33 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
.eslintcache
|
||||
|
||||
# Dependency directory
|
||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
|
||||
node_modules
|
||||
|
||||
# OSX
|
||||
.DS_Store
|
||||
|
||||
release/app/dist
|
||||
release/build
|
||||
.erb/dll
|
||||
|
||||
.idea
|
||||
npm-debug.log.*
|
||||
*.css.d.ts
|
||||
*.sass.d.ts
|
||||
*.scss.d.ts
|
||||
|
||||
# eslint ignores hidden directories by default:
|
||||
# https://github.com/eslint/eslint/issues/8429
|
||||
!.erb
|
||||
44
.eslintrc.js
Normal file
@@ -0,0 +1,44 @@
|
||||
module.exports = {
|
||||
extends: 'erb',
|
||||
plugins: ['@typescript-eslint'],
|
||||
rules: {
|
||||
// A temporary hack related to IDE not resolving correct package.json
|
||||
'import/no-extraneous-dependencies': 'off',
|
||||
'prettier/prettier': 'off',
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/jsx-filename-extension': 'off',
|
||||
'import/extensions': 'off',
|
||||
'import/no-unresolved': 'off',
|
||||
'import/no-import-module-exports': 'off',
|
||||
'no-shadow': 'off',
|
||||
'@typescript-eslint/no-shadow': 'error',
|
||||
'no-unused-vars': 'off',
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
// turn off no-use-before-define for typescript
|
||||
'no-use-before-define': 'off',
|
||||
// allow blank lines in try catch blocks
|
||||
'object-curly-spacing': 'off',
|
||||
'no-multiple-empty-lines': 'off',
|
||||
'lines-between-class-members': 'off',
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
createDefaultProgram: true,
|
||||
},
|
||||
settings: {
|
||||
'import/resolver': {
|
||||
// See https://github.com/benmosher/eslint-plugin-import/issues/1396#issuecomment-575727774 for line below
|
||||
node: {},
|
||||
webpack: {
|
||||
config: require.resolve('./.erb/configs/webpack.config.eslint.ts'),
|
||||
},
|
||||
typescript: {},
|
||||
},
|
||||
'import/parsers': {
|
||||
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
||||
},
|
||||
},
|
||||
};
|
||||
12
.gitattributes
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
* text eol=lf
|
||||
*.exe binary
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
*.ico binary
|
||||
*.icns binary
|
||||
*.eot binary
|
||||
*.otf binary
|
||||
*.ttf binary
|
||||
*.woff binary
|
||||
*.woff2 binary
|
||||
5
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [electron-react-boilerplate, amilajack]
|
||||
patreon: amilajack
|
||||
open_collective: electron-react-boilerplate-594
|
||||
67
.github/ISSUE_TEMPLATE/1-Bug_report.md
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: You're having technical issues. 🐞
|
||||
labels: 'bug'
|
||||
---
|
||||
|
||||
<!-- Please use the following issue template or your issue will be closed -->
|
||||
|
||||
## Prerequisites
|
||||
|
||||
<!-- If the following boxes are not ALL checked, your issue is likely to be closed -->
|
||||
|
||||
- [ ] Using npm
|
||||
- [ ] Using an up-to-date [`main` branch](https://github.com/electron-react-boilerplate/electron-react-boilerplate/tree/main)
|
||||
- [ ] Using latest version of devtools. [Check the docs for how to update](https://electron-react-boilerplate.js.org/docs/dev-tools/)
|
||||
- [ ] Tried solutions mentioned in [#400](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/400)
|
||||
- [ ] For issue in production release, add devtools output of `DEBUG_PROD=true npm run build && npm start`
|
||||
|
||||
## Expected Behavior
|
||||
|
||||
<!--- What should have happened? -->
|
||||
|
||||
## Current Behavior
|
||||
|
||||
<!--- What went wrong? -->
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
<!-- Add relevant code and/or a live example -->
|
||||
<!-- Add stack traces -->
|
||||
|
||||
1.
|
||||
|
||||
2.
|
||||
|
||||
3.
|
||||
|
||||
4.
|
||||
|
||||
## Possible Solution (Not obligatory)
|
||||
|
||||
<!--- Suggest a reason for the bug or how to fix it. -->
|
||||
|
||||
## Context
|
||||
|
||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||
<!--- Did you make any changes to the boilerplate after cloning it? -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||
|
||||
## Your Environment
|
||||
|
||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||
|
||||
- Node version :
|
||||
- electron-react-boilerplate version or branch :
|
||||
- Operating System and version :
|
||||
- Link to your project :
|
||||
|
||||
<!---
|
||||
❗️❗️ Also, please consider donating (https://opencollective.com/electron-react-boilerplate-594) ❗️❗️
|
||||
|
||||
Donations will ensure the following:
|
||||
|
||||
🔨 Long term maintenance of the project
|
||||
🛣 Progress on the roadmap
|
||||
🐛 Quick responses to bug reports and help requests
|
||||
-->
|
||||
19
.github/ISSUE_TEMPLATE/2-Question.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Question
|
||||
about: Ask a question.❓
|
||||
labels: 'question'
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
<!-- What do you need help with? -->
|
||||
|
||||
<!---
|
||||
❗️❗️ Also, please consider donating (https://opencollective.com/electron-react-boilerplate-594) ❗️❗️
|
||||
|
||||
Donations will ensure the following:
|
||||
|
||||
🔨 Long term maintenance of the project
|
||||
🛣 Progress on the roadmap
|
||||
🐛 Quick responses to bug reports and help requests
|
||||
-->
|
||||
15
.github/ISSUE_TEMPLATE/3-Feature_request.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: You want something added to the boilerplate. 🎉
|
||||
labels: 'enhancement'
|
||||
---
|
||||
|
||||
<!---
|
||||
❗️❗️ Also, please consider donating (https://opencollective.com/electron-react-boilerplate-594) ❗️❗️
|
||||
|
||||
Donations will ensure the following:
|
||||
|
||||
🔨 Long term maintenance of the project
|
||||
🛣 Progress on the roadmap
|
||||
🐛 Quick responses to bug reports and help requests
|
||||
-->
|
||||
6
.github/config.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
requiredHeaders:
|
||||
- Prerequisites
|
||||
- Expected Behavior
|
||||
- Current Behavior
|
||||
- Possible Solution
|
||||
- Your Environment
|
||||
17
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- discussion
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
72
.github/workflows/codeql-analysis.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ "main" ]
|
||||
schedule:
|
||||
- cron: '44 16 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||
|
||||
# - run: |
|
||||
# echo "Run, Build Application using script"
|
||||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
46
.github/workflows/publish.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
# To enable auto publishing to github, update your electron publisher
|
||||
# config in package.json > "build" and remove the conditional below
|
||||
if: ${{ github.repository_owner == 'electron-react-boilerplate' }}
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout git repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node and NPM
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: npm
|
||||
|
||||
- name: Install and build
|
||||
run: |
|
||||
npm install
|
||||
npm run postinstall
|
||||
npm run build
|
||||
|
||||
- name: Publish releases
|
||||
env:
|
||||
# These values are used for auto updates signing
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASS }}
|
||||
CSC_LINK: ${{ secrets.CSC_LINK }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||
# This is used for uploading release assets to github
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
npm exec electron-builder -- --publish always --win --mac --linux
|
||||
34
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Node.js and NPM
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
cache: npm
|
||||
|
||||
- name: npm install
|
||||
run: |
|
||||
npm install
|
||||
|
||||
- name: npm test
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
npm run package
|
||||
npm run lint
|
||||
npm exec tsc
|
||||
npm test
|
||||
31
.gitignore
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
.eslintcache
|
||||
|
||||
# Dependency directory
|
||||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
|
||||
node_modules
|
||||
|
||||
# OSX
|
||||
.DS_Store
|
||||
|
||||
release/app/dist
|
||||
release/build
|
||||
.erb/dll
|
||||
|
||||
.idea
|
||||
npm-debug.log.*
|
||||
*.css.d.ts
|
||||
*.sass.d.ts
|
||||
*.scss.d.ts
|
||||
|
||||
.dist/*
|
||||
3
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["dbaeumer.vscode-eslint", "EditorConfig.EditorConfig"]
|
||||
}
|
||||
30
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Electron: Main",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"protocol": "inspector",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run", "start"],
|
||||
"env": {
|
||||
"MAIN_ARGS": "--inspect=5858 --remote-debugging-port=9223"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Electron: Renderer",
|
||||
"type": "chrome",
|
||||
"request": "attach",
|
||||
"port": 9223,
|
||||
"webRoot": "${workspaceFolder}",
|
||||
"timeout": 15000
|
||||
}
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Electron: All",
|
||||
"configurations": ["Electron: Main", "Electron: Renderer"]
|
||||
}
|
||||
]
|
||||
}
|
||||
30
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"files.associations": {
|
||||
".eslintrc": "jsonc",
|
||||
".prettierrc": "jsonc",
|
||||
".eslintignore": "ignore"
|
||||
},
|
||||
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"html",
|
||||
"typescriptreact"
|
||||
],
|
||||
|
||||
"javascript.validate.enable": false,
|
||||
"javascript.format.enable": false,
|
||||
"typescript.format.enable": false,
|
||||
|
||||
"search.exclude": {
|
||||
".git": true,
|
||||
".eslintcache": true,
|
||||
".erb/dll": true,
|
||||
"release/{build,app/dist}": true,
|
||||
"node_modules": true,
|
||||
"npm-debug.log.*": true,
|
||||
"test/**/__snapshots__": true,
|
||||
"package-lock.json": true,
|
||||
"*.{css,sass,scss}.d.ts": true
|
||||
}
|
||||
}
|
||||
533
CHANGELOG.md
Normal file
@@ -0,0 +1,533 @@
|
||||
# 2.1.0
|
||||
|
||||
- Migrate to `css-minifier-webpack-plugin`
|
||||
|
||||
# 2.0.1
|
||||
|
||||
## Fixes
|
||||
|
||||
- Fix broken css linking in production build
|
||||
|
||||
# 2.0.0
|
||||
|
||||
## Breaking Changes
|
||||
|
||||
- drop redux
|
||||
- remove counter example app
|
||||
- simplify directory structure
|
||||
- move `dll` dir to `.erb` dir
|
||||
- fix icon/font import paths
|
||||
- migrate to `react-refresh` from `react-hot-loader`
|
||||
- migrate to webpack@5
|
||||
- migrate to electron@11
|
||||
- remove e2e tests and testcafe integration
|
||||
- rename `app` dir to more conventional `src` dir
|
||||
- rename `resources` dir to `assets`
|
||||
- simplify npm scripts
|
||||
- drop stylelint
|
||||
- simplify styling of boilerplate app
|
||||
- remove `START_HOT` env variable
|
||||
- notarize support
|
||||
- landing page boilerplate
|
||||
- docs updates
|
||||
- restore removed debugging support
|
||||
|
||||
# 1.4.0
|
||||
|
||||
- Migrate to `eslint-config-erb@2`
|
||||
- Rename `dev` npm script to `start`
|
||||
- GitHub Actions: only publish GitHub releases when on master branch
|
||||
|
||||
# 1.3.1
|
||||
|
||||
- Fix sass building bug ([#2540](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2540))
|
||||
- Fix CI bug related to E2E tests and network timeouts
|
||||
- Move automated dependency PRs to `next` ([#2554](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2554))
|
||||
- Bump dependencies to patch semver
|
||||
|
||||
# 1.3.0
|
||||
|
||||
- Fixes E2E tests ([#2516](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2516))
|
||||
- Fixes preload entrypoint ([#2503](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2503))
|
||||
- Downgrade to `electron@8`
|
||||
- Bump dependencies to latest semver
|
||||
|
||||
# 1.2.0
|
||||
|
||||
- Migrate to redux toolkit
|
||||
- Lazy load routes with react suspense
|
||||
- Drop support for azure-pipelines and use only github actions
|
||||
- Bump all deps to latest semver
|
||||
- Remove `test-e2e` script from tests (blocked on release of https://github.com/DevExpress/testcafe-browser-provider-electron/pull/65)
|
||||
- Swap `typed-css-modules-webpack-plugin` for `typings-for-css-modules-loader`
|
||||
- Use latest version of `eslint-config-erb`
|
||||
- Remove unnecessary file extensions from ts exclude
|
||||
- Add experimental support for vscode debugging
|
||||
- Revert https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2365 as default for users, provide as opt in option
|
||||
|
||||
# 1.1.0
|
||||
|
||||
- Fix #2402
|
||||
- Simplify configs (https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2406)
|
||||
|
||||
# 1.0.0
|
||||
|
||||
- Migrate to TypeScript from Flow ([#2363](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2363))
|
||||
- Use browserslist for `@babel/preset-env` targets ([#2368](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2368))
|
||||
- Use preload script, disable `nodeIntegration` in renderer process for [improved security](https://www.electronjs.org/docs/tutorial/security#2-do-not-enable-nodejs-integration-for-remote-content) ([#2365](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2365))
|
||||
- Add support for azure pipelines ([#2369](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2369))
|
||||
- Disable sourcemaps in production
|
||||
|
||||
# 0.18.1 (2019.12.12)
|
||||
|
||||
- Fix HMR env bug ([#2343](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2343))
|
||||
- Bump all deps to latest semver
|
||||
- Bump to `electron@7`
|
||||
|
||||
# 0.18.0 (2019.11.19)
|
||||
|
||||
- Bump electron to `electron@6` (`electron@7` introduces breaking changes to testcafe end to end tests)
|
||||
- Revert back to [two `package.json` structure](https://www.electron.build/tutorials/two-package-structure)
|
||||
- Bump all deps to latest semver
|
||||
|
||||
# 0.17.1 (2018.11.20)
|
||||
|
||||
- Fix `yarn test-e2e` and testcafe for single package.json structure
|
||||
- Fixes incorrect path in `yarn start` script
|
||||
- Bumped deps
|
||||
- Bump g++ in travis
|
||||
- Change clone arguments to clone only master
|
||||
- Change babel config to target current electron version
|
||||
|
||||
For full change list, see https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/2021
|
||||
|
||||
# 0.17.0 (2018.10.30)
|
||||
|
||||
- upgraded to `babel@7` (thanks to @vikr01 🎉🎉🎉)
|
||||
- migrated from [two `package.json` structure](https://www.electron.build/tutorials/two-package-structure) (thanks to @HyperSprite!)
|
||||
- initial auto update support (experimental)
|
||||
- migrate from greenkeeper to [renovate](https://renovatebot.com)
|
||||
- added issue template
|
||||
- use `babel-preset-env` to target current electron version
|
||||
- add [opencollective](https://opencollective.com/electron-react-boilerplate-594) banner message display in postinstall script (help support ERB 🙏)
|
||||
- fix failing ci issues
|
||||
|
||||
# 0.16.0 (2018.10.3)
|
||||
|
||||
- removed unused dependencies
|
||||
- migrate from `react-redux-router` to `connect-react-router`
|
||||
- move webpack configs to `./webpack` dir
|
||||
- use `g++` on travis when testing linux
|
||||
- migrate from `spectron` to `testcafe` for e2e tests
|
||||
- add linting support for config styles
|
||||
- changed stylelint config
|
||||
- temporarily disabled flow in appveyor to make ci pass
|
||||
- added necessary infra to publish releases from ci
|
||||
|
||||
# 0.15.0 (2018.8.25)
|
||||
|
||||
- Performance: cache webpack uglify results
|
||||
- Feature: add start minimized feature
|
||||
- Feature: lint and fix styles with prettier and stylelint
|
||||
- Feature: add greenkeeper support
|
||||
|
||||
# 0.14.0 (2018.5.24)
|
||||
|
||||
- Improved CI timings
|
||||
- Migrated README commands to yarn from npm
|
||||
- Improved vscode config
|
||||
- Updated all dependencies to latest semver
|
||||
- Fix `electron-rebuild` script bug
|
||||
- Migrated to `mini-css-extract-plugin` from `extract-text-plugin`
|
||||
- Added `optimize-css-assets-webpack-plugin`
|
||||
- Run `prettier` on json, css, scss, and more filetypes
|
||||
|
||||
# 0.13.3 (2018.5.24)
|
||||
|
||||
- Add git precommit hook, when git commit will use `prettier` to format git add code
|
||||
- Add format code function in `lint-fix` npm script which can use `prettier` to format project js code
|
||||
|
||||
# 0.13.2 (2018.1.31)
|
||||
|
||||
- Hot Module Reload (HMR) fixes
|
||||
- Bumped all dependencies to latest semver
|
||||
- Prevent error propagation of `CheckNativeDeps` script
|
||||
|
||||
# 0.13.1 (2018.1.13)
|
||||
|
||||
- Hot Module Reload (HMR) fixes
|
||||
- Bumped all dependencies to latest semver
|
||||
- Fixed electron-rebuild script
|
||||
- Fixed tests scripts to run on all platforms
|
||||
- Skip redux logs in console in test ENV
|
||||
|
||||
# 0.13.0 (2018.1.6)
|
||||
|
||||
#### Additions
|
||||
|
||||
- Add native dependencies check on postinstall
|
||||
- Updated all dependencies to latest semver
|
||||
|
||||
# 0.12.0 (2017.7.8)
|
||||
|
||||
#### Misc
|
||||
|
||||
- Removed `babel-polyfill`
|
||||
- Renamed and alphabetized npm scripts
|
||||
|
||||
#### Breaking
|
||||
|
||||
- Changed node dev `__dirname` and `__filename` to node built in fn's (https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/1035)
|
||||
- Renamed `src/bundle.js` to `src/renderer.prod.js` for consistency
|
||||
- Renamed `dll/vendor.js` to `dll/renderer.dev.dll.js` for consistency
|
||||
|
||||
#### Additions
|
||||
|
||||
- Enable node_modules cache on CI
|
||||
|
||||
# 0.11.2 (2017.5.1)
|
||||
|
||||
Yay! Another patch release. This release mostly includes refactorings and router bug fixes. Huge thanks to @anthonyraymond!
|
||||
|
||||
⚠️ Windows electron builds are failing because of [this issue](https://github.com/electron/electron/issues/9321). This is not an issue with the boilerplate ⚠️
|
||||
|
||||
#### Breaking
|
||||
|
||||
- **Renamed `./src/main.development.js` => `./src/main.{dev,prod}.js`:** [#963](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/963)
|
||||
|
||||
#### Fixes
|
||||
|
||||
- **Fixed reloading when not on `/` path:** [#958](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/958) [#949](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/949)
|
||||
|
||||
#### Additions
|
||||
|
||||
- **Added support for stylefmt:** [#960](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/960)
|
||||
|
||||
# 0.11.1 (2017.4.23)
|
||||
|
||||
You can now debug the production build with devtools like so:
|
||||
|
||||
```
|
||||
DEBUG_PROD=true npm run package
|
||||
```
|
||||
|
||||
🎉🎉🎉
|
||||
|
||||
#### Additions
|
||||
|
||||
- **Added support for debugging production build:** [#fab245a](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/941/commits/fab245a077d02a09630f74270806c0c534a4ff95)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
- **Fixed bug related to importing native dependencies:** [#933](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/933)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Updated all deps to latest semver**
|
||||
|
||||
# 0.11.0 (2017.4.19)
|
||||
|
||||
Here's the most notable changes since `v0.10.0`. Its been about a year since a release has been pushed. Expect a new release to be published every 3-4 weeks.
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- **Dropped support for node < 6**
|
||||
- **Refactored webpack config files**
|
||||
- **Migrate to two-package.json project structure**
|
||||
- **Updated all devDeps to latest semver**
|
||||
- **Migrated to Jest:** [#768](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/768)
|
||||
- **Migrated to `react-router@4`**
|
||||
- **Migrated to `electron-builder@4`**
|
||||
- **Migrated to `webpack@2`**
|
||||
- **Migrated to `react-hot-loader@3`**
|
||||
- **Changed default live reload server PORT to `1212` from `3000`**
|
||||
|
||||
#### Additions
|
||||
|
||||
- **Added support for Yarn:** [#451](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/451)
|
||||
- **Added support for Flow:** [#425](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/425)
|
||||
- **Added support for stylelint:** [#911](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/911)
|
||||
- **Added support for electron-builder:** [#876](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/876)
|
||||
- **Added optional support for SASS:** [#880](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/880)
|
||||
- **Added support for eslint-plugin-flowtype:** [#911](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/911)
|
||||
- **Added support for appveyor:** [#280](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/280)
|
||||
- **Added support for webpack dlls:** [#860](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/860)
|
||||
- **Route based code splitting:** [#884](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/884)
|
||||
- **Added support for Webpack Bundle Analyzer:** [#922](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/922)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Parallelize renderer and main build processes when running `npm run build`**
|
||||
- **Dynamically generate electron app menu**
|
||||
- **Improved vscode integration:** [#856](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/856)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
- **Fixed hot module replacement race condition bug:** [#917](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/917) [#920](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/920)
|
||||
|
||||
# 0.10.0 (2016.4.18)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Use Babel in main process with Webpack build:** [#201](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/201)
|
||||
- **Change targets to built-in support by webpack:** [#197](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/197)
|
||||
- **use es2015 syntax for webpack configs:** [#195](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/195)
|
||||
- **Open application when webcontent is loaded:** [#192](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/192)
|
||||
- **Upgraded dependencies**
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Fix `npm list electron-prebuilt` in package.js:** [#188](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/188)
|
||||
|
||||
# 0.9.0 (2016.3.23)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Added [redux-logger](https://github.com/fcomb/redux-logger)**
|
||||
- **Upgraded [react-router-redux](https://github.com/reactjs/react-router-redux) to v4**
|
||||
- **Upgraded dependencies**
|
||||
- **Added `npm run dev` command:** [#162](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/162)
|
||||
- **electron to v0.37.2**
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- **css module as default:** [#154](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/154).
|
||||
- **set default NODE_ENV to production:** [#140](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/140)
|
||||
|
||||
# 0.8.0 (2016.2.17)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Fix lint errors**
|
||||
- **Fix Webpack publicPath for production builds**: [#119](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/119).
|
||||
- **package script now chooses correct OS icon extension**
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **babel 6**
|
||||
- **Upgrade Dependencies**
|
||||
- **Enable CSS source maps**
|
||||
- **Add json-loader**: [#128](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/128).
|
||||
- **react-router 2.0 and react-router-redux 3.0**
|
||||
|
||||
# 0.7.1 (2015.12.27)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Fixed npm script on windows 10:** [#103](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/103).
|
||||
- **history and react-router version bump**: [#109](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/109), [#110](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/110).
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **electron 0.36**
|
||||
|
||||
# 0.7.0 (2015.12.16)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Fixed process.env.NODE_ENV variable in webpack:** [#74](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/74).
|
||||
- **add missing object-assign**: [#76](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/76).
|
||||
- **packaging in npm@3:** [#77](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/77).
|
||||
- **compatibility in windows:** [#100](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/100).
|
||||
- **disable chrome debugger in production env:** [#102](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/102).
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **redux**
|
||||
- **css-modules**
|
||||
- **upgrade to react-router 1.x**
|
||||
- **unit tests**
|
||||
- **e2e tests**
|
||||
- **travis-ci**
|
||||
- **upgrade to electron 0.35.x**
|
||||
- **use es2015**
|
||||
- **check dev engine for node and npm**
|
||||
|
||||
# 0.6.5 (2015.11.7)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Bump style-loader to 0.13**
|
||||
- **Bump css-loader to 0.22**
|
||||
|
||||
# 0.6.4 (2015.10.27)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Bump electron-debug to 0.3**
|
||||
|
||||
# 0.6.3 (2015.10.26)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Initialize ExtractTextPlugin once:** [#64](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/64).
|
||||
|
||||
# 0.6.2 (2015.10.18)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Babel plugins production env not be set properly:** [#57](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/57).
|
||||
|
||||
# 0.6.1 (2015.10.17)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Bump electron to v0.34.0**
|
||||
|
||||
# 0.6.0 (2015.10.16)
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- **From react-hot-loader to react-transform**
|
||||
|
||||
# 0.5.2 (2015.10.15)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Run tests with babel-register:** [#29](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/29).
|
||||
|
||||
# 0.5.1 (2015.10.12)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Fix #51:** use `path.join(__dirname` instead of `./`.
|
||||
|
||||
# 0.5.0 (2015.10.11)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **Simplify webpack config** see [#50](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/50).
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
- **webpack configs**
|
||||
- **port changed:** changed default port from 2992 to 3000.
|
||||
- **npm scripts:** remove `start-dev` and `dev-server`. rename `hot-dev-server` to `hot-server`.
|
||||
|
||||
# 0.4.3 (2015.9.22)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Fix #45 zeromq crash:** bump version of `electron-prebuilt`.
|
||||
|
||||
# 0.4.2 (2015.9.15)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **run start-hot breaks chrome refresh(CTRL+R) (#42)**: bump `electron-debug` to `0.2.1`
|
||||
|
||||
# 0.4.1 (2015.9.11)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **use electron-prebuilt version for packaging (#33)**
|
||||
|
||||
# 0.4.0 (2015.9.5)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **update dependencies**
|
||||
|
||||
# 0.3.0 (2015.8.31)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **eslint-config-airbnb**
|
||||
|
||||
# 0.2.10 (2015.8.27)
|
||||
|
||||
#### Features
|
||||
|
||||
- **custom placeholder icon**
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **electron-renderer as target:** via [webpack-target-electron-renderer](https://github.com/chentsulin/webpack-target-electron-renderer)
|
||||
|
||||
# 0.2.9 (2015.8.18)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Fix hot-reload**
|
||||
|
||||
# 0.2.8 (2015.8.13)
|
||||
|
||||
#### Improvements
|
||||
|
||||
- **bump electron-debug**
|
||||
- **babelrc**
|
||||
- **organize webpack scripts**
|
||||
|
||||
# 0.2.7 (2015.7.9)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **defaultProps:** fix typos.
|
||||
|
||||
# 0.2.6 (2015.7.3)
|
||||
|
||||
#### Features
|
||||
|
||||
- **menu**
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **package.js:** include webpack build.
|
||||
|
||||
# 0.2.5 (2015.7.1)
|
||||
|
||||
#### Features
|
||||
|
||||
- **NPM Script:** support multi-platform
|
||||
- **package:** `--all` option
|
||||
|
||||
# 0.2.4 (2015.6.9)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Eslint:** typo, [#17](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/17) and improve `.eslintrc`
|
||||
|
||||
# 0.2.3 (2015.6.3)
|
||||
|
||||
#### Features
|
||||
|
||||
- **Package Version:** use latest release electron version as default
|
||||
- **Ignore Large peerDependencies**
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Npm Script:** typo, [#6](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/6)
|
||||
- **Missing css:** [#7](https://github.com/electron-react-boilerplate/electron-react-boilerplate/pull/7)
|
||||
|
||||
# 0.2.2 (2015.6.2)
|
||||
|
||||
#### Features
|
||||
|
||||
- **electron-debug**
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Webpack:** add `.json` and `.node` to extensions for imitating node require.
|
||||
- **Webpack:** set `node_modules` to externals for native module support.
|
||||
|
||||
# 0.2.1 (2015.5.30)
|
||||
|
||||
#### Bug fixed
|
||||
|
||||
- **Webpack:** #1, change build target to `atom`.
|
||||
|
||||
# 0.2.0 (2015.5.30)
|
||||
|
||||
#### Features
|
||||
|
||||
- **Ignore:** `test`, `tools`, `release` folder and devDependencies in `package.json`.
|
||||
- **Support asar**
|
||||
- **Support icon**
|
||||
|
||||
# 0.1.0 (2015.5.27)
|
||||
|
||||
#### Features
|
||||
|
||||
- **Webpack:** babel, react-hot, ...
|
||||
- **Flux:** actions, api, components, containers, stores..
|
||||
- **Package:** darwin (osx), linux and win32 (windows) platform.
|
||||
76
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at electronreactboilerplate@gmail.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-present Electron React Boilerplate
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
159
README.md
Normal file
@@ -0,0 +1,159 @@
|
||||
<img src=".erb/img/erb-banner.svg" width="100%" />
|
||||
|
||||
<br>
|
||||
|
||||
<p>
|
||||
Electron React Boilerplate uses <a href="https://electron.atom.io/">Electron</a>, <a href="https://facebook.github.io/react/">React</a>, <a href="https://github.com/reactjs/react-router">React Router</a>, <a href="https://webpack.js.org/">Webpack</a> and <a href="https://www.npmjs.com/package/react-refresh">React Fast Refresh</a>.
|
||||
</p>
|
||||
|
||||
<br>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[![Build Status][github-actions-status]][github-actions-url]
|
||||
[![Github Tag][github-tag-image]][github-tag-url]
|
||||
[](https://discord.gg/Fjy3vfgy5q)
|
||||
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[![StackOverflow][stackoverflow-img]][stackoverflow-url]
|
||||
|
||||
</div>
|
||||
|
||||
## Install
|
||||
|
||||
Clone the repo and install dependencies:
|
||||
|
||||
```bash
|
||||
git clone --depth 1 --branch main https://github.com/electron-react-boilerplate/electron-react-boilerplate.git your-project-name
|
||||
cd your-project-name
|
||||
npm install
|
||||
```
|
||||
|
||||
**Having issues installing? See our [debugging guide](https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues/400)**
|
||||
|
||||
## Starting Development
|
||||
|
||||
Start the app in the `dev` environment:
|
||||
|
||||
```bash
|
||||
npm start
|
||||
```
|
||||
|
||||
## Packaging for Production
|
||||
|
||||
To package apps for the local platform:
|
||||
|
||||
```bash
|
||||
npm run package
|
||||
```
|
||||
|
||||
## Docs
|
||||
|
||||
See our [docs and guides here](https://electron-react-boilerplate.js.org/docs/installation)
|
||||
|
||||
## Community
|
||||
|
||||
Join our Discord: https://discord.gg/Fjy3vfgy5q
|
||||
|
||||
## Sponsors
|
||||
|
||||
<a href="https://palette.dev">
|
||||
<img src=".erb/img/palette-sponsor-banner.svg" width="100%" />
|
||||
</a>
|
||||
|
||||
## Donations
|
||||
|
||||
**Donations will ensure the following:**
|
||||
|
||||
- 🔨 Long term maintenance of the project
|
||||
- 🛣 Progress on the [roadmap](https://electron-react-boilerplate.js.org/docs/roadmap)
|
||||
- 🐛 Quick responses to bug reports and help requests
|
||||
|
||||
## Backers
|
||||
|
||||
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/electron-react-boilerplate-594#backer)]
|
||||
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/0/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/1/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/2/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/3/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/4/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/5/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/6/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/7/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/8/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/9/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/10/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/11/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/12/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/13/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/14/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/15/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/16/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/17/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/18/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/19/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/20/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/21/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/22/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/23/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/24/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/25/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/26/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/27/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/28/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/backer/29/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/backer/29/avatar.svg"></a>
|
||||
|
||||
## Sponsors
|
||||
|
||||
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/electron-react-boilerplate-594-594#sponsor)]
|
||||
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/0/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/0/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/1/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/1/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/2/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/2/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/3/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/3/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/4/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/4/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/5/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/5/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/6/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/6/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/7/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/7/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/8/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/8/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/9/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/9/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/10/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/10/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/11/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/11/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/12/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/12/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/13/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/13/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/14/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/14/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/15/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/15/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/16/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/16/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/17/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/17/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/18/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/18/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/19/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/19/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/20/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/20/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/21/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/21/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/22/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/22/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/23/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/23/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/24/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/24/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/25/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/25/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/26/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/26/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/27/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/27/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/28/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/28/avatar.svg"></a>
|
||||
<a href="https://opencollective.com/electron-react-boilerplate-594/sponsor/29/website" target="_blank"><img src="https://opencollective.com/electron-react-boilerplate-594/sponsor/29/avatar.svg"></a>
|
||||
|
||||
## Maintainers
|
||||
|
||||
- [Amila Welihinda](https://github.com/amilajack)
|
||||
- [John Tran](https://github.com/jooohhn)
|
||||
- [C. T. Lin](https://github.com/chentsulin)
|
||||
- [Jhen-Jie Hong](https://github.com/jhen0409)
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Electron React Boilerplate](https://github.com/electron-react-boilerplate)
|
||||
|
||||
[github-actions-status]: https://github.com/electron-react-boilerplate/electron-react-boilerplate/workflows/Test/badge.svg
|
||||
[github-actions-url]: https://github.com/electron-react-boilerplate/electron-react-boilerplate/actions
|
||||
[github-tag-image]: https://img.shields.io/github/tag/electron-react-boilerplate/electron-react-boilerplate.svg?label=version
|
||||
[github-tag-url]: https://github.com/electron-react-boilerplate/electron-react-boilerplate/releases/latest
|
||||
[stackoverflow-img]: https://img.shields.io/badge/stackoverflow-electron_react_boilerplate-blue.svg
|
||||
[stackoverflow-url]: https://stackoverflow.com/questions/tagged/electron-react-boilerplate
|
||||
35
assets/assets.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
type Styles = Record<string, string>;
|
||||
|
||||
declare module '*.svg' {
|
||||
import React = require('react');
|
||||
|
||||
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
|
||||
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module '*.png' {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module '*.jpg' {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module '*.scss' {
|
||||
const content: Styles;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module '*.sass' {
|
||||
const content: Styles;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module '*.css' {
|
||||
const content: Styles;
|
||||
export default content;
|
||||
}
|
||||
10
assets/entitlements.mac.plist
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
assets/icon.icns
Normal file
BIN
assets/icon.ico
Normal file
|
After Width: | Height: | Size: 361 KiB |
BIN
assets/icon.png
Executable file
|
After Width: | Height: | Size: 32 KiB |
23
assets/icon.svg
Normal file
@@ -0,0 +1,23 @@
|
||||
<svg width="232" height="232" viewBox="0 0 232 232" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g filter="url(#filter0_b)">
|
||||
<path d="M231.5 1V0.5H231H1H0.5V1V231V231.5H1H231H231.5V231V1ZM40.5 25C40.5 33.0082 34.0082 39.5 26 39.5C17.9918 39.5 11.5 33.0082 11.5 25C11.5 16.9918 17.9918 10.5 26 10.5C34.0082 10.5 40.5 16.9918 40.5 25ZM220.5 25C220.5 33.0082 214.008 39.5 206 39.5C197.992 39.5 191.5 33.0082 191.5 25C191.5 16.9918 197.992 10.5 206 10.5C214.008 10.5 220.5 16.9918 220.5 25ZM40.5 205C40.5 213.008 34.0082 219.5 26 219.5C17.9918 219.5 11.5 213.008 11.5 205C11.5 196.992 17.9918 190.5 26 190.5C34.0082 190.5 40.5 196.992 40.5 205ZM220.5 205C220.5 213.008 214.008 219.5 206 219.5C197.992 219.5 191.5 213.008 191.5 205C191.5 196.992 197.992 190.5 206 190.5C214.008 190.5 220.5 196.992 220.5 205ZM209.5 111C209.5 162.639 167.639 204.5 116 204.5C64.3613 204.5 22.5 162.639 22.5 111C22.5 59.3613 64.3613 17.5 116 17.5C167.639 17.5 209.5 59.3613 209.5 111Z" fill="white" stroke="white"/>
|
||||
<path d="M63.5 146.5C63.5 149.959 60.8969 152.5 58 152.5C55.1031 152.5 52.5 149.959 52.5 146.5C52.5 143.041 55.1031 140.5 58 140.5C60.8969 140.5 63.5 143.041 63.5 146.5Z" stroke="white" stroke-width="5"/>
|
||||
<path d="M54.9856 139.466C54.9856 139.466 51.1973 116.315 83.1874 93.1647C115.178 70.014 133.698 69.5931 133.698 69.5931" stroke="white" stroke-width="5" stroke-linecap="round"/>
|
||||
<path d="M178.902 142.686C177.27 139.853 173.652 138.88 170.819 140.512C167.987 142.144 167.014 145.762 168.646 148.595C170.277 151.427 173.896 152.4 176.728 150.768C179.561 149.137 180.534 145.518 178.902 142.686Z" stroke="white" stroke-width="5"/>
|
||||
<path d="M169.409 151.555C169.409 151.555 151.24 166.394 115.211 150.232C79.182 134.07 69.5718 118.232 69.5718 118.232" stroke="white" stroke-width="5" stroke-linecap="round"/>
|
||||
<path d="M109.577 41.9707C107.966 44.8143 108.964 48.4262 111.808 50.038C114.651 51.6498 118.263 50.6512 119.875 47.8075C121.487 44.9639 120.488 41.3521 117.645 39.7403C114.801 38.1285 111.189 39.1271 109.577 41.9707Z" stroke="white" stroke-width="5"/>
|
||||
<path d="M122.038 45.6467C122.038 45.6467 144.047 53.7668 148.412 93.0129C152.778 132.259 144.012 148.579 144.012 148.579" stroke="white" stroke-width="5" stroke-linecap="round"/>
|
||||
<path d="M59.6334 105C59.6334 105 50.4373 82.1038 61.3054 73.3616C72.1736 64.6194 96 69.1987 96 69.1987" stroke="white" stroke-width="5" stroke-linecap="round"/>
|
||||
<path d="M149.532 66.9784C149.532 66.9784 174.391 68.9134 177.477 82.6384C180.564 96.3634 165.799 115.833 165.799 115.833" stroke="white" stroke-width="5" stroke-linecap="round"/>
|
||||
<path d="M138.248 163.363C138.248 163.363 124.023 183.841 110.618 179.573C97.2129 175.305 87.8662 152.728 87.8662 152.728" stroke="white" stroke-width="5" stroke-linecap="round"/>
|
||||
<path d="M116 119C120.418 119 124 115.642 124 111.5C124 107.358 120.418 104 116 104C111.582 104 108 107.358 108 111.5C108 115.642 111.582 119 116 119Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_b" x="-4" y="-4" width="240" height="240" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feGaussianBlur in="BackgroundImage" stdDeviation="2"/>
|
||||
<feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur" result="shape"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
BIN
assets/icons/1024x1024.png
Executable file
|
After Width: | Height: | Size: 156 KiB |
BIN
assets/icons/128x128.png
Executable file
|
After Width: | Height: | Size: 17 KiB |
BIN
assets/icons/16x16.png
Executable file
|
After Width: | Height: | Size: 954 B |
BIN
assets/icons/24x24.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/icons/256x256.png
Executable file
|
After Width: | Height: | Size: 32 KiB |
BIN
assets/icons/32x32.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
assets/icons/48x48.png
Executable file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
assets/icons/512x512.png
Executable file
|
After Width: | Height: | Size: 77 KiB |
BIN
assets/icons/64x64.png
Executable file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
assets/icons/96x96.png
Executable file
|
After Width: | Height: | Size: 12 KiB |
BIN
assets/sounds/frozen-throne.mp3
Executable file
BIN
assets/tsconfig.avif
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
assets/warcraft-logo.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
assets/wothlk.ico
Executable file
|
After Width: | Height: | Size: 149 KiB |
BIN
assets/wow-lich-bg.jpeg
Normal file
|
After Width: | Height: | Size: 326 KiB |
1
dist/Data
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../src/main/FileManager/testdata/full-install/Data
|
||||
BIN
extraResources/araxiapatch.exe
Normal file
22385
package-lock.json
generated
Normal file
254
package.json
Normal file
@@ -0,0 +1,254 @@
|
||||
{
|
||||
"description": "A WoW Launcher that will patch a client before launching it with latest server updates.",
|
||||
"keywords": [
|
||||
"electron",
|
||||
"boilerplate",
|
||||
"react",
|
||||
"typescript",
|
||||
"ts",
|
||||
"sass",
|
||||
"webpack",
|
||||
"hot",
|
||||
"reload"
|
||||
],
|
||||
"homepage": "https://github.com/electron-react-boilerplate/electron-react-boilerplate#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/electron-react-boilerplate/electron-react-boilerplate/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/electron-react-boilerplate/electron-react-boilerplate.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Ben Carter",
|
||||
"email": "ben.carter.dev@gmail.com"
|
||||
},
|
||||
"main": "./src/main/main.ts",
|
||||
"scripts": {
|
||||
"build": "concurrently \"npm run build:main\" \"npm run build:renderer\"",
|
||||
"build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts",
|
||||
"build:renderer": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.prod.ts",
|
||||
"postinstall": "ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.dll.ts",
|
||||
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
|
||||
"package": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never",
|
||||
"package:win": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --win portable --x64 --publish never",
|
||||
"do:win64": "ts-node ./.erb/scripts/clean.js dist && ts-node ./.erb/scripts/clean.js release && electron-packager ./ WowLauncher --out=dist/ --platform=win32 --arch=x64 --app-version=0.34.1 --icon=assets/wothlk.ico --overwrite",
|
||||
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app",
|
||||
"start": "ts-node ./.erb/scripts/check-port-in-use.js && npm run start:renderer",
|
||||
"start:main": "cross-env NODE_ENV=development electronmon -r ts-node/register/transpile-only .",
|
||||
"start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.preload.dev.ts",
|
||||
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts",
|
||||
"test": "jest"
|
||||
},
|
||||
"browserslist": [],
|
||||
"prettier": {
|
||||
"singleQuote": true,
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
".prettierrc",
|
||||
".eslintrc"
|
||||
],
|
||||
"options": {
|
||||
"parser": "json"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"jest": {
|
||||
"moduleDirectories": [
|
||||
"node_modules",
|
||||
"release/app/node_modules",
|
||||
"src"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"jsx",
|
||||
"ts",
|
||||
"tsx",
|
||||
"json"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/.erb/mocks/fileMock.js",
|
||||
"\\.(css|less|sass|scss)$": "identity-obj-proxy"
|
||||
},
|
||||
"setupFiles": [
|
||||
"./.erb/scripts/check-build-exists.ts"
|
||||
],
|
||||
"testEnvironment": "jsdom",
|
||||
"testEnvironmentOptions": {
|
||||
"url": "http://localhost/"
|
||||
},
|
||||
"testPathIgnorePatterns": [
|
||||
"release/app/dist",
|
||||
".erb/dll"
|
||||
],
|
||||
"transform": {
|
||||
"\\.(ts|tsx|js|jsx)$": "ts-jest"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.5.0",
|
||||
"electron-debug": "^3.2.0",
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-updater": "^5.3.0",
|
||||
"howler": "^2.2.3",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-router-dom": "^6.11.2",
|
||||
"react-snowfall": "^1.2.1",
|
||||
"sound-play": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron/notarize": "^1.2.3",
|
||||
"@electron/rebuild": "^3.2.13",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
||||
"@svgr/webpack": "^8.0.1",
|
||||
"@teamsupercell/typings-for-css-modules-loader": "^2.5.2",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"@types/howler": "^2.2.8",
|
||||
"@types/jest": "^29.5.2",
|
||||
"@types/mock-fs": "^4.13.1",
|
||||
"@types/node": "20.2.5",
|
||||
"@types/react": "^18.2.8",
|
||||
"@types/react-dom": "^18.2.4",
|
||||
"@types/react-test-renderer": "^18.0.0",
|
||||
"@types/sound-play": "^1.1.0",
|
||||
"@types/terser-webpack-plugin": "^5.0.4",
|
||||
"@types/webpack-bundle-analyzer": "^4.6.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
||||
"@typescript-eslint/parser": "^5.59.8",
|
||||
"browserslist-config-erb": "^0.0.3",
|
||||
"chalk": "^4.1.2",
|
||||
"concurrently": "^8.1.0",
|
||||
"core-js": "^3.30.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"css-minimizer-webpack-plugin": "^5.0.0",
|
||||
"detect-port": "^1.5.1",
|
||||
"electron": "^25.0.1",
|
||||
"electron-builder": "^24.6.3",
|
||||
"electron-devtools-installer": "^3.2.0",
|
||||
"electron-packager": "^17.1.2",
|
||||
"electronmon": "^2.0.2",
|
||||
"eslint": "^8.42.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-erb": "^4.0.6",
|
||||
"eslint-import-resolver-typescript": "^3.5.5",
|
||||
"eslint-import-resolver-webpack": "^0.13.2",
|
||||
"eslint-plugin-compat": "^4.1.4",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.7.1",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-react": "^7.32.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-webpack-plugin": "^5.5.1",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"mock-fs": "^5.2.0",
|
||||
"npm": "^10.0.0",
|
||||
"prettier": "^2.8.8",
|
||||
"react-refresh": "^0.14.0",
|
||||
"react-test-renderer": "^18.2.0",
|
||||
"rimraf": "^5.0.1",
|
||||
"sass": "^1.62.1",
|
||||
"sass-loader": "^13.3.1",
|
||||
"start": "^5.1.0",
|
||||
"style-loader": "^3.3.3",
|
||||
"terser-webpack-plugin": "^5.3.9",
|
||||
"ts-jest": "^29.1.0",
|
||||
"ts-loader": "^9.4.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsconfig-paths-webpack-plugin": "^4.0.1",
|
||||
"typescript": "^5.1.3",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.85.0",
|
||||
"webpack-bundle-analyzer": "^4.9.0",
|
||||
"webpack-cli": "^5.1.1",
|
||||
"webpack-dev-server": "^4.15.0",
|
||||
"webpack-merge": "^5.9.0"
|
||||
},
|
||||
"build": {
|
||||
"productName": "AraxiaWoW",
|
||||
"appId": "org.erb.AraxiaWoW",
|
||||
"asar": true,
|
||||
"asarUnpack": "**\\*.{node,dll}",
|
||||
"files": [
|
||||
"dist",
|
||||
"node_modules",
|
||||
"package.json"
|
||||
],
|
||||
"afterSign": ".erb/scripts/notarize.js",
|
||||
"mac": {
|
||||
"target": {
|
||||
"target": "default",
|
||||
"arch": [
|
||||
"arm64",
|
||||
"x64"
|
||||
]
|
||||
},
|
||||
"type": "distribution",
|
||||
"hardenedRuntime": true,
|
||||
"entitlements": "assets/entitlements.mac.plist",
|
||||
"entitlementsInherit": "assets/entitlements.mac.plist",
|
||||
"gatekeeperAssess": false
|
||||
},
|
||||
"dmg": {
|
||||
"contents": [
|
||||
{
|
||||
"x": 130,
|
||||
"y": 220
|
||||
},
|
||||
{
|
||||
"x": 410,
|
||||
"y": 220,
|
||||
"type": "link",
|
||||
"path": "/Applications"
|
||||
}
|
||||
]
|
||||
},
|
||||
"win": {
|
||||
"target": "nsis"
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
"AppImage"
|
||||
],
|
||||
"category": "Development"
|
||||
},
|
||||
"directories": {
|
||||
"app": "release/app",
|
||||
"buildResources": "assets",
|
||||
"output": "release/build"
|
||||
},
|
||||
"extraResources": [
|
||||
"./assets/**",
|
||||
"./extraResources/**"
|
||||
],
|
||||
"publish": {
|
||||
"provider": "github",
|
||||
"owner": "bcarter-araxia-realm-online",
|
||||
"repo": ""
|
||||
}
|
||||
},
|
||||
"collective": {
|
||||
"url": "https://opencollective.com/electron-react-boilerplate-594"
|
||||
},
|
||||
"devEngines": {
|
||||
"node": ">=14.x",
|
||||
"npm": ">=7.x"
|
||||
},
|
||||
"electronmon": {
|
||||
"patterns": [
|
||||
"!**/**",
|
||||
"src/main/**"
|
||||
],
|
||||
"logLevel": "quiet"
|
||||
}
|
||||
}
|
||||
14
release/app/package-lock.json
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "wow-client-updater",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "wow-client-updater",
|
||||
"version": "1.0.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
18
release/app/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "wow-client-updater",
|
||||
"version": "1.0.0",
|
||||
"description": "Custom Wow Client Patcher for Private WoW Servers",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "Ben Carter",
|
||||
"email": "ben.carter.dev@gmail.com",
|
||||
"url": "https://github.com/electron-react-boilerplate"
|
||||
},
|
||||
"main": "./dist/main/main.js",
|
||||
"scripts": {
|
||||
"rebuild": "node -r ts-node/register ../../.erb/scripts/electron-rebuild.js",
|
||||
"postinstall": "npm run rebuild && npm run link-modules",
|
||||
"link-modules": "node -r ts-node/register ../../.erb/scripts/link-modules.ts"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
4
release/app/yarn.lock
Normal file
@@ -0,0 +1,4 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
9
src/__tests__/App.test.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import { render } from '@testing-library/react';
|
||||
import App from '../renderer/App';
|
||||
|
||||
describe('App', () => {
|
||||
it('should render', () => {
|
||||
expect(render(<App />)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
15
src/enums/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
const Channels = {
|
||||
WOW_LAUNCH: 'launch-wow',
|
||||
WOW_LAUNCH_ERROR: 'launch-wow-error',
|
||||
WOW_CLIENT_EXIT: 'launch-wow-exit',
|
||||
APP_INFO: 'app-info',
|
||||
} as const;
|
||||
|
||||
const PLATFORM = {
|
||||
WINDOWS: 'win32',
|
||||
MAC: 'darwin',
|
||||
LINUX: 'linux',
|
||||
} as const
|
||||
|
||||
export default Channels;
|
||||
export { PLATFORM };
|
||||
139
src/main/FileManager/FileManager.test.ts
Normal file
@@ -0,0 +1,139 @@
|
||||
/* eslint-disable prefer-destructuring */
|
||||
/* eslint-disable no-await-in-loop */
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
/* eslint-disable-next-line prefer-destructuring */
|
||||
import path from 'path';
|
||||
import fs from 'fs/promises';
|
||||
import FileManager, {
|
||||
HDPatchList,
|
||||
extraHDList,
|
||||
featuresList,
|
||||
reservedAraxiaList
|
||||
} from './FileManager';
|
||||
|
||||
describe('FileManager', () => {
|
||||
const testDirectories = [
|
||||
'testdata/patched',
|
||||
'testdata/full-install',
|
||||
'testdata/unpatched',
|
||||
'testdata/partial-patch',
|
||||
];
|
||||
|
||||
let basePath:string;
|
||||
let fileManager:FileManager;
|
||||
describe('Test A HD Patched client', () => {
|
||||
|
||||
beforeAll(() => {
|
||||
basePath = testDirectories[0]; // get the HD patched directory
|
||||
fileManager = new FileManager(basePath);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
for(const patch of reservedAraxiaList) {
|
||||
const patchPath = path.join(__dirname, basePath, 'Data', patch.name);
|
||||
|
||||
try {
|
||||
await fs.rmdir(patchPath);
|
||||
// console.log('removed file: ',patchPath);
|
||||
} catch(err) {
|
||||
// DO NOTHING
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
it('should return installed patches', async () => {
|
||||
const result = await fileManager.GetInstalledHDPatches();
|
||||
expect(result).toStrictEqual(HDPatchList);
|
||||
});
|
||||
|
||||
it('should have no missing patches', async () => {
|
||||
const result = await fileManager.GetMissingHDPatches();
|
||||
expect(result).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should be missing extra HD patches', async () => {
|
||||
const result = await fileManager.GetMissingExtraHDPatches();
|
||||
expect(result).toStrictEqual(extraHDList);
|
||||
});
|
||||
|
||||
it('should show HD patches are installed', async () => {
|
||||
const result = await fileManager.IsHDSetup();
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should show HDExtra patches are not installed', async () => {
|
||||
const result = await fileManager.IsHDExtraSetup();
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should show Feature patches are not installed', async () => {
|
||||
const result = await fileManager.IsFeaturesSetup();
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should be missing feature patches', async () => {
|
||||
const result = await fileManager.GetMissingFeaturePatches();
|
||||
expect(result).toStrictEqual(featuresList);
|
||||
});
|
||||
|
||||
it('should not have araxia installed', async () => {
|
||||
let result = await fileManager.GetInstalledAraxiaPatches();
|
||||
expect(result).toHaveLength(0);
|
||||
result = await fileManager.GetMissingAraxiaPatches();
|
||||
expect(result).toStrictEqual(reservedAraxiaList);
|
||||
const installed = await fileManager.IsAraxiaSetup();
|
||||
expect(installed).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should install araxia', async () => {
|
||||
await fileManager.CreateAraxiaPatches();
|
||||
const installed = await fileManager.IsAraxiaSetup();
|
||||
expect(installed).toBeTruthy();
|
||||
});
|
||||
}); // end describe('Test an HD Patched client')
|
||||
|
||||
describe('Test Fully Patched client', () => {
|
||||
|
||||
beforeAll(() => {
|
||||
basePath = testDirectories[1]; // get the HD patched directory
|
||||
fileManager = new FileManager(basePath);
|
||||
});
|
||||
|
||||
it('should return installed patches', async () => {
|
||||
const result = await fileManager.GetInstalledHDPatches();
|
||||
expect(result).toEqual(HDPatchList);
|
||||
});
|
||||
|
||||
it('should have no missing patches', async () => {
|
||||
const result = await fileManager.GetMissingHDPatches();
|
||||
expect(result).toHaveLength(0);
|
||||
});
|
||||
|
||||
|
||||
it('should show HD patches are installed', async () => {
|
||||
const result = await fileManager.IsHDSetup();
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should show HDExtra patches are installed', async () => {
|
||||
const result = await fileManager.IsHDExtraSetup();
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should show Feature patches are installed', async () => {
|
||||
const result = await fileManager.IsFeaturesSetup();
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should be missing feature patches', async () => {
|
||||
const result = await fileManager.GetMissingFeaturePatches();
|
||||
expect(result).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('should have araxia installed', async () => {
|
||||
const installed = await fileManager.IsAraxiaSetup();
|
||||
expect(installed).toBeTruthy();
|
||||
});
|
||||
}); // end describe('Fully Patched client')
|
||||
});
|
||||
229
src/main/FileManager/FileManager.ts
Normal file
@@ -0,0 +1,229 @@
|
||||
import fs from 'fs';
|
||||
import path, { join } from 'path';
|
||||
import { WowLauncher } from 'typings';
|
||||
|
||||
/**
|
||||
* List of patches that are required for the client to run.
|
||||
*/
|
||||
export const vanillaPatchList: WowLauncher.PatchFile[] = [
|
||||
{ name: 'common.MPQ', description: 'Base game files' },
|
||||
{ name: 'common-2.MPQ', description: 'Base game files' },
|
||||
{ name: 'expansion.MPQ', description: 'TBC expansion files' },
|
||||
{ name: 'lichking.MPQ', description: 'WotLK expansion files' },
|
||||
{ name: 'patch.MPQ', description: 'Base game files' },
|
||||
{ name: 'patch-2.MPQ', description: 'Base game files' },
|
||||
{ name: 'patch-3.MPQ', description: 'Base game files' },
|
||||
];
|
||||
|
||||
/**
|
||||
* List of patches that modify the client heavily to add HD textures
|
||||
* to character, environment, creature, and spell effects.
|
||||
*/
|
||||
export const HDPatchList: WowLauncher.PatchFile[] = [
|
||||
{ name: 'patch-9.MPQ', description: 'Added HD music from cataclym expansion'},
|
||||
{ name: 'patch-B.MPQ', description: 'Player models and armor'},
|
||||
{ name: 'patch-C.MPQ', description: 'Trees and Flowers'},
|
||||
{ name: 'patch-E.MPQ', description: 'Creature models'},
|
||||
{ name: 'patch-F.MPQ', description: 'Creature models'},
|
||||
{ name: 'patch-G.MPQ', description: 'Spell effects'},
|
||||
{ name: 'patch-T.MPQ', description: 'Environment textures'},
|
||||
{ name: 'patch-U.MPQ', description: 'Battlegrounds'},
|
||||
];
|
||||
|
||||
/**
|
||||
* These are optional extras that do not change the base game as much
|
||||
* as the HDPatch set does.
|
||||
*/
|
||||
export const extraHDList: WowLauncher.PatchFile[] = [
|
||||
{ name: 'patch-D.MPQ', description: 'Goblin models'},
|
||||
{ name: 'patch-5.MPQ', description: 'Totems'},
|
||||
{ name: 'patch-J.MPQ', description: 'Druids and updated animal forms'},
|
||||
{ name: 'patch-S.MPQ', description: 'Liquid textures and sun rays / lighting effects'},
|
||||
];
|
||||
|
||||
/**
|
||||
* Additional patches that add features to the game.
|
||||
*/
|
||||
export const featuresList: WowLauncher.PatchFile[] = [
|
||||
{ name: 'patch-A.MPQ', description: 'All Races All Classes'},
|
||||
{ name: 'patch-4.MPQ', description: 'Adds all races and classes to character creation'},
|
||||
{ name: 'patch-7.MPQ', description: 'Adds rmember password and HD loading screens'},
|
||||
{ name: 'patch-L.MPQ', description: 'Adds Blood to the game'},
|
||||
];
|
||||
|
||||
/**
|
||||
* These are patches that are reserved for use by Araxia client patcher
|
||||
* to update game files over time with new content.
|
||||
*/
|
||||
export const reservedAraxiaList: WowLauncher.PatchFile[] = [
|
||||
{ name: 'patch-Z.MPQ', description: 'Early load patch for pre letter patched content (use rarely)'},
|
||||
{ name: 'patch-8.MPQ', description: 'Contains custom DBC file updates'},
|
||||
{ name: 'patch-6.MPQ', description: 'Future Store content'},
|
||||
];
|
||||
|
||||
export default class FileManager {
|
||||
basePath: string;
|
||||
dataPath: string;
|
||||
addOnsPath: string;
|
||||
allPatches: WowLauncher.PatchFile[] = [];
|
||||
patchNames: string[] = [];
|
||||
|
||||
constructor(basePath:string) {
|
||||
this.basePath = basePath;
|
||||
this.dataPath = path.join(this.basePath, 'Data');
|
||||
this.addOnsPath = path.join(this.basePath, 'Interface', 'AddOns');
|
||||
|
||||
this.allPatches = [...HDPatchList, ...extraHDList, ...featuresList, ...reservedAraxiaList];
|
||||
this.patchNames = this.allPatches.map((patch) => patch.name);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of installed patches on the host machine.
|
||||
* @returns {Promise<WowLauncher.PatchFile[] | null>} List of all installed patches.
|
||||
*/
|
||||
async GetInstalledPatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
|
||||
const filelist = await fs.promises.readdir(this.dataPath);
|
||||
const installed = filelist
|
||||
.filter((file) => file.endsWith('.MPQ') && this.patchNames.includes(file))
|
||||
.map((file) => this.allPatches.find((patch) => patch.name === file)!)
|
||||
.filter((patch) => !!patch);
|
||||
|
||||
return installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of of which HD patches are installed.
|
||||
* @returns {Promise<WowLauncher.PatchFile[] | null>} List of installed HD patches.
|
||||
*/
|
||||
async GetInstalledHDPatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const hdPatches = installed?.filter((patch) => HDPatchList.includes(patch)) ?? null;
|
||||
return hdPatches;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of HD patches that are not installed.
|
||||
* @returns {Promise<WowLauncher.PatchFile[] | null>} List of HD patches that are not installed.
|
||||
*/
|
||||
async GetMissingHDPatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const missing = HDPatchList.filter((patch) => !installed?.includes(patch)) ?? null;
|
||||
return missing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of extra HD patches that are installed.
|
||||
* @returns {Promise<WowLauncher.PatchFile[] | null>} List of extra HD patches that are installed.
|
||||
*/
|
||||
async GetInstalledExtraHDPatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const extraPatches = installed?.filter((patch) => extraHDList.includes(patch)) ?? null;
|
||||
return extraPatches;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of extra HD patches that are not installed.
|
||||
* @returns {Promise<WowLauncher.PatchFile[] | null>} List of extra HD patches that are not installed.
|
||||
*/
|
||||
async GetMissingExtraHDPatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const missing = extraHDList.filter((patch) => !installed?.includes(patch)) ?? null;
|
||||
return missing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of feature patches that are installed.
|
||||
* @returns {Promise<WowLauncher.PatchFile[] | null>} List of feature patches that are installed.
|
||||
*/
|
||||
async GetInstalledFeaturePatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const features = installed?.filter((patch) => featuresList.includes(patch)) ?? null;
|
||||
return features;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of feature patches that are not installed.
|
||||
* @returns {Promise<WowLauncher.PatchFile[] | null>} List of feature patches that are not installed.
|
||||
*/
|
||||
async GetMissingFeaturePatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const missing = featuresList.filter((patch) => !installed?.includes(patch)) ?? null;
|
||||
return missing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of reserved Araxia patches that are installed.
|
||||
*/
|
||||
async GetInstalledAraxiaPatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const araxia = installed?.filter((patch) => reservedAraxiaList.includes(patch)) ?? null;
|
||||
return araxia;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of reserved Araxia patches that are not installed.
|
||||
*/
|
||||
async GetMissingAraxiaPatches(): Promise<WowLauncher.PatchFile[] | null> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const missing = reservedAraxiaList.filter((patch) => !installed?.includes(patch)) ?? null;
|
||||
return missing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all HD patches are installed.
|
||||
* @return {Promise<boolean>} True if all HD patches are installed.
|
||||
*/
|
||||
async IsHDSetup(): Promise<boolean> {
|
||||
const missing = await this.GetMissingHDPatches();
|
||||
return missing?.length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all extra HD patches are installed.
|
||||
* @returns {Promise<boolean>} True if all extra HD patches are installed.
|
||||
*/
|
||||
async IsHDExtraSetup(): Promise<boolean> {
|
||||
const missing = await this.GetMissingExtraHDPatches();
|
||||
return missing?.length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all feature patches are installed.
|
||||
* @returns {Promise<boolean>} True if all feature patches are installed.
|
||||
*/
|
||||
async IsFeaturesSetup(): Promise<boolean> {
|
||||
const missing = await this.GetMissingFeaturePatches();
|
||||
return missing?.length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all Araxia patches are installed
|
||||
* @returns {Promise<boolean>} True if all Araxia patches are installed.
|
||||
*/
|
||||
async IsAraxiaSetup(): Promise<boolean> {
|
||||
const installed = await this.GetInstalledPatches();
|
||||
const missing = reservedAraxiaList.filter((patch) => !installed?.includes(patch)) ?? null;
|
||||
return missing?.length === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Araxia patch files if they do not exist. IF the patches do not exist we can just
|
||||
* create a blank directory and name it with the correct patch name as a place holder.
|
||||
* @returns {Promise<void>} Promise that resolves when all Araxia patches are created.
|
||||
*/
|
||||
async CreateAraxiaPatches(): Promise<void> {
|
||||
const installed = await this.IsAraxiaSetup();
|
||||
if (installed) return;
|
||||
|
||||
const missing = await this.GetMissingAraxiaPatches();
|
||||
if(!missing) return;
|
||||
|
||||
const addPatches = missing.map(patch => {
|
||||
return fs.promises.mkdir(path.join(this.dataPath, patch.name));
|
||||
});
|
||||
|
||||
await Promise.all(addPatches)
|
||||
}
|
||||
}
|
||||
5
src/main/FileManager/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as FileManager from './FileManager';
|
||||
|
||||
export default FileManager.default;
|
||||
export { FileManager };
|
||||
|
||||
0
src/main/FileManager/testdata/full-install/Data/patch-4.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-5.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-6.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-7.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-8.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-9.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-A.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-B.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-C.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-D.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-E.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-F.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-G.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-J.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-L.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-S.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-T.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-U.MPQ
vendored
Normal file
0
src/main/FileManager/testdata/full-install/Data/patch-Z.MPQ
vendored
Normal file
109
src/main/FileManager/testdata/generate-test-data.js
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Define the list of patch files
|
||||
/**
|
||||
* List of patches that modify the client heavily to add HD textures
|
||||
* to character, environment, creature, and spell effects.
|
||||
*/
|
||||
const HDPatchList = [
|
||||
{ name: 'patch-9.MPQ', description: 'Added HD music from cataclym expansion'},
|
||||
{ name: 'patch-A.MPQ', description: 'Character models and armor'},
|
||||
{ name: 'patch-B.MPQ', description: 'Player models and armor'},
|
||||
{ name: 'patch-C.MPQ', description: 'Trees and Flowers'},
|
||||
{ name: 'patch-E.MPQ', description: 'Creature models'},
|
||||
{ name: 'patch-F.MPQ', description: 'Creature models'},
|
||||
{ name: 'patch-G.MPQ', description: 'Spell effects'},
|
||||
{ name: 'patch-T.MPQ', description: 'Environment textures'},
|
||||
{ name: 'patch-U.MPQ', description: 'Battlegrounds'},
|
||||
];
|
||||
|
||||
/**
|
||||
* These are optional extras that do not change the base game as much
|
||||
* as the HDPatch set does.
|
||||
*/
|
||||
const extraHDList = [
|
||||
{ name: 'patch-D.MPQ', description: 'Goblin models'},
|
||||
{ name: 'patch-5.MPQ', description: 'Totems'},
|
||||
{ name: 'patch-J.MPQ', description: 'Druids and updated animal forms'},
|
||||
{ name: 'patch-S.MPQ', description: 'Liquid textures and sun rays / lighting effects'},
|
||||
];
|
||||
|
||||
/**
|
||||
* Additional patches that add features to the game.
|
||||
*/
|
||||
const featuresList = [
|
||||
{ name: 'patch-A.MPQ', description: 'All Races All Classes'},
|
||||
{ name: 'patch-4.MPQ', description: 'Adds all races and classes to character creation'},
|
||||
{ name: 'patch-7.MPQ', description: 'Adds rmember password and HD loading screens'},
|
||||
{ name: 'patch-L.MPQ', description: 'Adds Blood to the game'},
|
||||
];
|
||||
|
||||
/**
|
||||
* These are patches that are reserved for use by Araxia client patcher
|
||||
* to update game files over time with new content.
|
||||
*/
|
||||
const reservedAraxiaList = [
|
||||
{ name: 'patch-Z.MPQ', description: 'Early load patch for pre letter patched content (use rarely)'},
|
||||
{ name: 'patch-8.MPQ', description: 'Contains custom DBC file updates'},
|
||||
{ name: 'patch-6.MPQ', description: 'Future Store content'},
|
||||
];
|
||||
|
||||
// Define the base directory where the files should be created (current directory)
|
||||
const baseDirectory = process.cwd();
|
||||
|
||||
// Check if the -random argument is passed
|
||||
const excludeRandomFile = process.argv.includes('-random');
|
||||
const allFiles = process.argv.includes('-all');
|
||||
|
||||
if (excludeRandomFile) {
|
||||
// Generate a random index to exclude a file
|
||||
const randomIndex = Math.floor(Math.random() * HDPatchList.length);
|
||||
const excludedFile = HDPatchList[randomIndex];
|
||||
console.log(`Excluding random file: ${excludedFile.name}`);
|
||||
|
||||
// Create empty files for each patch file except the excluded one
|
||||
HDPatchList.forEach((patch) => {
|
||||
if (patch !== excludedFile) {
|
||||
const filePath = path.join(baseDirectory, patch.name);
|
||||
fs.writeFileSync(filePath, ''); // Create an empty file
|
||||
console.log(`Created empty file: ${filePath}`);
|
||||
}
|
||||
});
|
||||
} else if(allFiles) {
|
||||
// Create empty files for each patch file in the list
|
||||
HDPatchList.forEach((patch) => {
|
||||
const filePath = path.join(baseDirectory, patch.name);
|
||||
fs.writeFileSync(filePath, ''); // Create an empty file
|
||||
console.log(`Created empty file: ${filePath}`);
|
||||
});
|
||||
|
||||
extraHDList.forEach((patch) => {
|
||||
const filePath = path.join(baseDirectory, patch.name);
|
||||
fs.writeFileSync(filePath, ''); // Create an empty file
|
||||
console.log(`Created empty file: ${filePath}`);
|
||||
});
|
||||
|
||||
featuresList.forEach((patch) => {
|
||||
const filePath = path.join(baseDirectory, patch.name);
|
||||
fs.writeFileSync(filePath, ''); // Create an empty file
|
||||
console.log(`Created empty file: ${filePath}`);
|
||||
});
|
||||
|
||||
reservedAraxiaList.forEach((patch) => {
|
||||
const filePath = path.join(baseDirectory, patch.name);
|
||||
fs.writeFileSync(filePath, ''); // Create an empty file
|
||||
console.log(`Created empty file: ${filePath}`);
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
// Create empty files for each patch file in the list
|
||||
HDPatchList.forEach((patch) => {
|
||||
const filePath = path.join(baseDirectory, patch.name);
|
||||
fs.writeFileSync(filePath, ''); // Create an empty file
|
||||
console.log(`Created empty file: ${filePath}`);
|
||||
});
|
||||
}
|
||||
|
||||
console.log('Empty files creation completed.')
|
||||