Skip to content

Commit

Permalink
setup local debugging env at vscode.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabyday committed Aug 17, 2024
1 parent fae2436 commit c233ac3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"start:electron" : "concurrently \"yarn compile:remote\" \"cross-env-shell IS_DEV=true electron .\"",
"compile:remote": "tsc",
"start:local": "yarn compile:local && electron .",
"start:local_debug": "yarn compile:local && electron . --inspect=9222 --remote-debugging-port=9223",
"compile:local": "tsc && cd react_src && yarn web-build",
"debug": "electron --inspect=8888 .",
"build": "yarn compile:local && electron-builder ",
Expand Down
2 changes: 0 additions & 2 deletions package_local_only.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
"start:remote": "concurrently \"yarn compile:remote\" \"yarn web\" \"cross-env-shell IS_DEV=true electron .\"",
"compile:remote": "tsc",
"start:local": "yarn compile:local && electron .",
"start:local_debug": "yarn compile:local && electron . --inspect=9222 --remote-debugging-port=9223",
"compile:local": "tsc && cd react_src && yarn web-build",
"debug": "electron --inspect=8888 .",
"build": "yarn compile:local && electron-builder ",
"release": "electron-builder --publish always",
"make-cert": "electron-builder create-self-signed-cert -p fabyday & mkdir private & mv fabyday.pfx private/fabyday.pfx"
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": false
"noEmit": false,
"sourceMap": true,
},
"include": [ "typescript_src/**/*.ts" ],

Expand Down
13 changes: 9 additions & 4 deletions typescript_src/electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ import { attach_menu } from './component/menu';
import { setup_menu_funtionality } from './definitions/data';
import { main_session, script_root_path } from './component/constants';
import * as fs_p from 'node:fs/promises';
const logger = require('electron-log')

import log from 'electron-log/main';


log.initialize();

let global_object : GlobalObject | null = null;

let root_path = process.env.IS_DEV ? path.join(__dirname, "../tmp") : app.getPath("appData")

function read_configure(){
let jsonData : Configure;
console.log(app.getPath("appData"))
// console.log(app.getPath("appData"))

log.info("read_configure"+app.getPath("appData"))
try {

let rawData = fs.readFileSync(path.join(root_path, config_name), 'utf8');
Expand Down Expand Up @@ -252,10 +257,10 @@ app.whenReady().then(async () => {

await components.whenReady();
session_initialize()
logger.info('components ready:', components.status());
log.info('components ready:', components.status());
initialize();
console.log(__dirname)
logger.info("app initialized...")
log.info("app initialized...")
await extension_initialize(session.fromPartition(main_session))

});

0 comments on commit c233ac3

Please sign in to comment.