Commit b8b5eaf 1 parent 8f331da commit b8b5eaf Copy full SHA for b8b5eaf
File tree 8 files changed +31878
-2856
lines changed
8 files changed +31878
-2856
lines changed Original file line number Diff line number Diff line change 4
4
{
5
5
"isBackground" : true ,
6
6
"type" : " npm" ,
7
- "script" : " build :react" ,
7
+ "script" : " dev :react" ,
8
8
"label" : " Run:vite-dev-server" ,
9
9
},
10
10
{
11
11
"isBackground" : true ,
12
12
"type" : " npm" ,
13
- "script" : " build :electron" ,
13
+ "script" : " dev :electron" ,
14
14
"label" : " Run:electron-watcher" ,
15
15
}
16
16
]
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { ARK_FOLDER_PATH } from "./utils/constants";
9
9
10
10
( async function main ( ) {
11
11
try {
12
- app . allowRendererProcessReuse = true ;
13
12
14
13
await app . whenReady ( ) ;
15
14
@@ -33,11 +32,11 @@ import { ARK_FOLDER_PATH } from "./utils/constants";
33
32
} ) ;
34
33
35
34
if ( process . env . ARK_ENABLE_DEV_TOOLS && process . env . ARK_DEV_TOOLS_PATH )
36
- await enableDevTools ( process . env . ARK_DEV_TOOLS_PATH ) ;
35
+ await enableDevTools ( window , process . env . ARK_DEV_TOOLS_PATH ) ;
37
36
38
37
const loadURL =
39
38
process . env . ARK_ENTRY_URL ||
40
- `file://${ path . join ( __dirname , "../index.html" ) } ` ;
39
+ `file://${ path . join ( __dirname , "../../ index.html" ) } ` ;
41
40
42
41
await window . loadURL ( loadURL ) ;
43
42
} catch ( e ) {
Original file line number Diff line number Diff line change @@ -350,7 +350,7 @@ function IPC() {
350
350
351
351
const { fullpath } = storedScript ;
352
352
353
- await fs . promises . writeFile ( fullpath , code ) ;
353
+ await fs . promises . writeFile ( fullpath , code || '' ) ;
354
354
355
355
return storedScript ;
356
356
} else if ( data . action === "save_as" ) {
@@ -366,7 +366,7 @@ function IPC() {
366
366
: 'untitled-ark-script.js'
367
367
) ;
368
368
369
- await fs . promises . writeFile ( fullpath , code ) ;
369
+ await fs . promises . writeFile ( fullpath , code || '' ) ;
370
370
371
371
372
372
const id = nanoid ( ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ function createWindow(
7
7
) {
8
8
const window = new BrowserWindow ( windowOptions ) ;
9
9
window . removeMenu ( ) ;
10
- window . webContents . openDevTools ( ) ;
11
10
return window ;
12
11
}
13
12
Original file line number Diff line number Diff line change 1
- import { session } from "electron" ;
1
+ import { session , BrowserWindow } from "electron" ;
2
2
import path from "path" ;
3
3
import os from "os" ;
4
4
5
- export const enableDevTools = async ( extensionPath : string ) : Promise < void > => {
5
+ export const enableDevTools = async ( window : BrowserWindow , extensionPath : string ) : Promise < void > => {
6
6
const reactDevToolsPath = path . join ( os . homedir ( ) , extensionPath ) ;
7
7
8
8
await session . defaultSession . loadExtension ( reactDevToolsPath ) ;
9
+
10
+ window . webContents . openDevTools ( ) ;
9
11
} ;
You can’t perform that action at this time.
0 commit comments