Skip to content

Commit

Permalink
upgrade electron #543
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Nov 29, 2024
1 parent 2a6f6c5 commit 99d1c37
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ export default defineConfig({
// However, until we use ESM for electron main, we need to include ESM-only deps in the bundle: (exclude from externalize)
plugins: [externalizeDepsPlugin({ exclude: ['p-map', 'execa', 'nanoid', 'file-type'] })],
build: {
target: 'node20.14',
target: 'node20.18',
sourcemap: true,
},
},
preload: {
// https://electron-vite.org/guide/dev#dependencies-vs-devdependencies
plugins: [externalizeDepsPlugin({ exclude: [] })],
build: {
target: 'node20.14',
target: 'node20.18',
sourcemap: true,
},
},
renderer: {
plugins: [react()],
build: {
target: 'chrome126',
target: 'chrome130',
sourcemap: true,
chunkSizeWarningLimit: 3e6,
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"csv-parse": "^4.15.3",
"csv-stringify": "^5.6.2",
"data-uri-to-buffer": "^4.0.0",
"electron": "^31.3.1",
"electron": "^33.2.1",
"electron-builder": "^24.13.3",
"electron-devtools-installer": "^3.2.0",
"electron-vite": "^2.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,7 @@ function App() {
ev.preventDefault();
if (!ev.dataTransfer) return;
const { files } = ev.dataTransfer;
const filePaths = [...files].map((f) => f.path);
const filePaths = [...files].map((f) => electron.webUtils.getPathForFile(f));

focusWindow();

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/TopMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { InverseCutSegment } from './types';


const { stat } = window.require('fs/promises');
const { webUtils } = window.require('electron');

const outFmtStyle = { height: 20, maxWidth: 100 };
const exportModeStyle = { flexGrow: 0, flexBasis: 140 };
Expand Down Expand Up @@ -63,7 +64,7 @@ function TopMenu({
async function onDrop(ev: DragEvent) {
ev.preventDefault();
if (!ev.dataTransfer) return;
const paths = [...ev.dataTransfer.files].map((f) => f.path);
const paths = [...ev.dataTransfer.files].map((f) => webUtils.getPathForFile(f));
const [firstPath] = paths;
if (paths.length === 1 && firstPath && (await stat(firstPath)).isDirectory()) {
setCustomOutDir(firstPath);
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4534,16 +4534,16 @@ __metadata:
languageName: node
linkType: hard

"electron@npm:^31.3.1":
version: 31.3.1
resolution: "electron@npm:31.3.1"
"electron@npm:^33.2.1":
version: 33.2.1
resolution: "electron@npm:33.2.1"
dependencies:
"@electron/get": "npm:^2.0.0"
"@types/node": "npm:^20.9.0"
extract-zip: "npm:^2.0.1"
bin:
electron: cli.js
checksum: 10/bc6e582c2a6ad9a95eeff71a24b2f798b88ce33dae1cae9e02fcb81f058463c502210a8eb0b9a061c82223060159ac69c141386f689ce2f52818f96fefc827c9
checksum: 10/1f7e4e61fe949503a79e08c91fc6a914216868176907b0586c4d47a720f0d16c42cb0594f30efa0608c316e992426befc0b6b214702bf1c4e2bd77115959efec
languageName: node
linkType: hard

Expand Down Expand Up @@ -7633,7 +7633,7 @@ __metadata:
csv-stringify: "npm:^5.6.2"
cue-parser: "npm:^0.3.0"
data-uri-to-buffer: "npm:^4.0.0"
electron: "npm:^31.3.1"
electron: "npm:^33.2.1"
electron-builder: "npm:^24.13.3"
electron-devtools-installer: "npm:^3.2.0"
electron-store: "npm:5.1.1"
Expand Down

0 comments on commit 99d1c37

Please sign in to comment.