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
import { useCallback } from 'react'; | |
import { MemoryRouter as Router, Routes, Route } from 'react-router-dom'; | |
import icon from '../../assets/icon.svg'; | |
import './App.css'; | |
const Hello = () => { | |
const openSettingsWindow = useCallback(() => { | |
window.electron.ipcRenderer.openSettingsWindow(); | |
}, []); |
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
/* eslint global-require: off, no-console: off, promise/always-return: off */ | |
/** | |
* This module executes inside of electron's main process. You can start | |
* electron renderer process from here and communicate with the other processes | |
* through IPC. | |
* | |
* When running `npm run build` or `npm run build:main`, this file is compiled to | |
* `./src/main.js` using webpack. This gives us some performance wins. | |
*/ |
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
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron'; | |
export type Channels = 'ipc-example'; | |
contextBridge.exposeInMainWorld('electron', { | |
ipcRenderer: { | |
openSettingsWindow() { | |
ipcRenderer.send('open-settings-window'); | |
}, | |
sendMessage(channel: Channels, args: unknown[]) { |
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
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'; |
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
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 srcSettingsMainPath = path.join(srcPath, 'settings-main'); |
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
import { createRoot } from 'react-dom/client'; | |
const App = () => <div>Settings window!</div>; | |
const container = document.getElementById('root')!; | |
const root = createRoot(container); | |
root.render(<App />); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta | |
http-equiv="Content-Security-Policy" | |
content="script-src 'self' 'unsafe-inline'" | |
/> | |
<title>Settings Renderer</title> | |
</head> |
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
/* eslint global-require: off, no-console: off, promise/always-return: off, import/prefer-default-export: off */ | |
import path from 'path'; | |
import { app, BrowserWindow, shell } from 'electron'; | |
import { resolveHtmlPath } from '../main/util'; | |
let settingsWindow: BrowserWindow | null = null; | |
const isDebug = | |
process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === '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
#!/usr/bin/env python | |
# | |
# Copyright 2008 Brett Slatkin | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
NewerOlder