Skip to content

Commit

Permalink
Temporarily bypassing pre-commit hook to push changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jshea2 committed Jul 23, 2024
1 parent 3678275 commit bce837c
Show file tree
Hide file tree
Showing 18 changed files with 856 additions and 18,723 deletions.
3 changes: 0 additions & 3 deletions .erb/configs/webpack.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const configuration: webpack.Configuration = {
options: {
// Remove this line to enable type checking in webpack builds
transpileOnly: true,
compilerOptions: {
module: 'esnext',
},
},
},
},
Expand Down
18 changes: 9 additions & 9 deletions .erb/configs/webpack.config.main.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,28 @@ import deleteSourceMaps from '../scripts/delete-source-maps';
checkNodeEnv('production');
deleteSourceMaps();

const devtoolsConfig =
process.env.DEBUG_PROD === 'true'
? {
devtool: 'source-map',
}
: {};

const configuration: webpack.Configuration = {
devtool: 'source-map',
...devtoolsConfig,

mode: 'production',

target: 'electron-main',

entry: {
main: path.join(webpackPaths.srcMainPath, 'main.ts'),
preload: path.join(webpackPaths.srcMainPath, 'preload.ts'),
preload: path.join(webpackPaths.srcMainPath, 'preload.js'),
},

output: {
path: webpackPaths.distMainPath,
filename: '[name].js',
library: {
type: 'umd',
},
},

optimization: {
Expand Down Expand Up @@ -62,10 +66,6 @@ const configuration: webpack.Configuration = {
DEBUG_PROD: false,
START_MINIMIZED: false,
}),

new webpack.DefinePlugin({
'process.type': '"main"',
}),
],

/**
Expand Down
71 changes: 0 additions & 71 deletions .erb/configs/webpack.config.preload.dev.ts

This file was deleted.

60 changes: 12 additions & 48 deletions .erb/configs/webpack.config.renderer.dev.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
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 { spawn, execSync } from 'child_process';
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
import baseConfig from './webpack.config.base';
import webpackPaths from './webpack.paths';
Expand All @@ -19,15 +18,15 @@ if (process.env.NODE_ENV === 'production') {

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');
const requiredByDLLConfig = module.parent!.filename.includes(
'webpack.config.renderer.dev.dll'
);

/**
* Warn if the DLL is not built
*/
if (
!skipDLLs &&
!requiredByDLLConfig &&
!(fs.existsSync(webpackPaths.dllPath) && fs.existsSync(manifest))
) {
console.log(
Expand Down Expand Up @@ -90,32 +89,13 @@ const configuration: webpack.Configuration = {
},
// Images
{
test: /\.(png|jpg|jpeg|gif)$/i,
test: /\.(png|svg|jpg|jpeg|gif)$/i,
type: 'asset/resource',
},
// SVG
{
test: /\.svg$/,
use: [
{
loader: '@svgr/webpack',
options: {
prettier: false,
svgo: false,
svgoConfig: {
plugins: [{ removeViewBox: false }],
},
titleProp: true,
ref: true,
},
},
'file-loader',
],
},
],
},
plugins: [
...(skipDLLs
...(requiredByDLLConfig
? []
: [
new webpack.DllReferencePlugin({
Expand Down Expand Up @@ -169,6 +149,7 @@ const configuration: webpack.Configuration = {
__filename: false,
},

// @ts-ignore
devServer: {
port,
compress: true,
Expand All @@ -180,32 +161,15 @@ const configuration: webpack.Configuration = {
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));

onBeforeSetupMiddleware() {
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, {
spawn('npm', ['run', 'start:main'], {
shell: true,
env: process.env,
stdio: 'inherit',
})
.on('close', (code: number) => {
preloadProcess.kill();
process.exit(code!);
})
.on('close', (code: number) => process.exit(code!))
.on('error', (spawnError) => console.error(spawnError));
return middlewares;
},
},
};
Expand Down
6 changes: 0 additions & 6 deletions .erb/img/palette-sponsor-banner.svg

This file was deleted.

21 changes: 13 additions & 8 deletions .erb/scripts/clean.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import rimraf from 'rimraf';
import webpackPaths from '../configs/webpack.paths';
import process from 'process';
import webpackPaths from '../configs/webpack.paths.ts';

const foldersToRemove = [
webpackPaths.distPath,
webpackPaths.buildPath,
webpackPaths.dllPath,
];
const args = process.argv.slice(2);
const commandMap = {
dist: webpackPaths.distPath,
release: webpackPaths.releasePath,
dll: webpackPaths.dllPath,
};

foldersToRemove.forEach((folder) => {
rimraf.sync(folder);
args.forEach((x) => {
const pathToRemove = commandMap[x];
if (pathToRemove !== undefined) {
rimraf.sync(pathToRemove);
}
});
3 changes: 2 additions & 1 deletion .erb/scripts/electron-rebuild.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import path from 'path';
import { execSync } from 'child_process';
import fs from 'fs';
import { dependencies } from '../../release/app/package.json';
Expand All @@ -8,7 +9,7 @@ if (
fs.existsSync(webpackPaths.appNodeModulesPath)
) {
const electronRebuildCmd =
'../../node_modules/.bin/electron-rebuild --force --types prod,dev,optional --module-dir .';
'../../node_modules/.bin/electron-rebuild --parallel --force --types prod,dev,optional --module-dir .';
const cmd =
process.platform === 'win32'
? electronRebuildCmd.replace(/\//g, '\\')
Expand Down
Loading

0 comments on commit bce837c

Please sign in to comment.