From 835048132c389b9a5398db97eff6850705e4a1ad Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Tue, 9 Aug 2016 22:08:46 -0700 Subject: [PATCH] adjustments to electron app --- .gitignore | 1 + clients/electron/main.js | 16 ++++++++++++++-- clients/electron/package.json | 5 +++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 747f8ade..e294893b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ clients/win10/app/bld clients/win10/*.opendb clients/**/bin/** clients/**/obj/** +clients/electron/projects *.user *.sw? diff --git a/clients/electron/main.js b/clients/electron/main.js index b7507632..e93a653b 100644 --- a/clients/electron/main.js +++ b/clients/electron/main.js @@ -3,14 +3,26 @@ const electron = require('electron') const app = electron.app // Module to create native browser window. const BrowserWindow = electron.BrowserWindow +// pxt toolchain +const pxt = require('pxt-core') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let mainWindow -function createWindow () { +function createWindow() { + console.log('starting app...') // Create the browser window. - mainWindow = new BrowserWindow({width: 800, height: 600}) + mainWindow = new BrowserWindow({ + width: 800, height: 600, + webPreferences: { + nodeIntegration: false, + } + }) + + ts.pxt.Util.debug = true; + pxt.mainCli("C:/gh/pxt-microbit/clients/electron/node_modules/pxt-microbit", ["serve", "-just"]); + // no menu mainWindow.setMenu(null); diff --git a/clients/electron/package.json b/clients/electron/package.json index 52a99f77..c5e949fe 100644 --- a/clients/electron/package.json +++ b/clients/electron/package.json @@ -10,5 +10,10 @@ "license": "MIT", "devDependencies": { "electron-prebuilt": "^1.2.0" + }, + "dependencies": { + "typescript": "1.8.7", + "pxt-core": "*", + "pxt-microbit": "*" } } \ No newline at end of file