Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
3,260 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/errors", | ||
"plugin:import/warnings" | ||
], | ||
"parser": "@typescript-eslint/parser" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { app, BrowserWindow } from 'electron'; | ||
declare const MAIN_WINDOW_WEBPACK_ENTRY: any; | ||
|
||
// Handle creating/removing shortcuts on Windows when installing/uninstalling. | ||
if (require('electron-squirrel-startup')) { // eslint-disable-line global-require | ||
app.quit(); | ||
} | ||
|
||
const createWindow = (): void => { | ||
// Create the browser window. | ||
const mainWindow = new BrowserWindow({ | ||
height: 600, | ||
width: 800, | ||
}); | ||
|
||
// and load the index.html of the app. | ||
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY); | ||
|
||
// Open the DevTools. | ||
mainWindow.webContents.openDevTools(); | ||
}; | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on('ready', createWindow); | ||
|
||
// Quit when all windows are closed, except on macOS. There, it's common | ||
// for applications and their menu bar to stay active until the user quits | ||
// explicitly with Cmd + Q. | ||
app.on('window-all-closed', () => { | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on('activate', () => { | ||
// On OS X it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (BrowserWindow.getAllWindows().length === 0) { | ||
createWindow(); | ||
} | ||
}); | ||
|
||
// In this file you can include the rest of your app's specific main process | ||
// code. You can also put them in separate files and import them here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* This file will automatically be loaded by webpack and run in the "renderer" context. | ||
* To learn more about the differences between the "main" and the "renderer" context in | ||
* Electron, visit: | ||
* | ||
* https://electronjs.org/docs/tutorial/application-architecture#main-and-renderer-processes | ||
* | ||
* By default, Node.js integration in this file is disabled. When enabling Node.js integration | ||
* in a renderer process, please be aware of potential security implications. You can read | ||
* more about security risks here: | ||
* | ||
* https://electronjs.org/docs/tutorial/security | ||
* | ||
* To enable Node.js integration in this file, open up `main.js` and enable the `nodeIntegration` | ||
* flag: | ||
* | ||
* ``` | ||
* // Create the browser window. | ||
* mainWindow = new BrowserWindow({ | ||
* width: 800, | ||
* height: 600, | ||
* webPreferences: { | ||
* nodeIntegration: true | ||
* } | ||
* }); | ||
* ``` | ||
*/ | ||
|
||
import './index.css'; | ||
|
||
console.log('👋 This message is being logged by "renderer.js", included via webpack'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"module": "commonjs", | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"noImplicitAny": true, | ||
"sourceMap": true, | ||
"baseUrl": ".", | ||
"outDir": "dist", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"paths": { | ||
"*": ["node_modules/*"] | ||
} | ||
}, | ||
"include": [ | ||
"src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
/** | ||
* This is the main entry point for your application, it's the first file | ||
* that runs in the main process. | ||
*/ | ||
entry: './src/index.ts', | ||
// Put your normal webpack config below here | ||
module: { | ||
rules: require('./webpack.rules'), | ||
}, | ||
resolve: { | ||
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'] | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | ||
|
||
module.exports = [ | ||
new ForkTsCheckerWebpackPlugin() | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const rules = require('./webpack.rules'); | ||
const plugins = require('./webpack.plugins'); | ||
|
||
rules.push({ | ||
test: /\.css$/, | ||
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }], | ||
}); | ||
|
||
module.exports = { | ||
module: { | ||
rules, | ||
}, | ||
plugins: plugins, | ||
resolve: { | ||
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css'] | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = [ | ||
// Add support for native node modules | ||
{ | ||
test: /\.node$/, | ||
use: 'node-loader', | ||
}, | ||
{ | ||
test: /\.(m?js|node)$/, | ||
parser: { amd: false }, | ||
use: { | ||
loader: '@marshallofsound/webpack-asset-relocator-loader', | ||
options: { | ||
outputAssetBase: 'native_modules', | ||
}, | ||
}, | ||
}, | ||
{ | ||
test: /\.tsx?$/, | ||
exclude: /(node_modules|\.webpack)/, | ||
use: { | ||
loader: 'ts-loader', | ||
options: { | ||
transpileOnly: true | ||
} | ||
} | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.