diff --git a/package.json b/package.json index d1fd2e4331..91a5ce2ce4 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,13 @@ "version": "3.5.0-beta.1", "main": "dist/main.js", "scripts": { - "dev": "yarn compile:dll && concurrently yarn:dev:* && yarn dev-run", - "dev-run": "electron .", + "dev": "yarn compile:dll && concurrently yarn:dev:*", + "dev-run": "electron --inspect .", "dev:main": "DEBUG=true webpack --watch --config webpack.main.ts", "dev:renderer": "DEBUG=true webpack --watch --config webpack.renderer.ts", - "compile": "concurrently 'yarn download-bins' 'yarn i18n:compile' 'yarn compile:dll' && concurrently yarn:compile:*", - "compile:main": "webpack -p --progress --config webpack.main.ts", - "compile:renderer": "webpack -p --progress --config webpack.renderer.ts", + "compile": "NODE_ENV=production concurrently 'yarn download-bins' 'yarn i18n:compile' 'yarn compile:dll' && concurrently yarn:compile:*", + "compile:main": "NODE_ENV=production webpack -p --progress --config webpack.main.ts", + "compile:renderer": "NODE_ENV=production webpack -p --progress --config webpack.renderer.ts", "compile:dll": "webpack --config webpack.dll.ts", "build:linux": "yarn compile && electron-builder --linux --dir -c.productName=LensDev", "build:mac": "yarn compile && electron-builder --mac --dir -c.productName=LensDev", @@ -21,7 +21,7 @@ "dist": "yarn compile && electron-builder -p onTag", "dist:win": "yarn compile && electron-builder -p onTag --x64 --ia32", "dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null", - "postinstall": "patch-package && concurrently 'electron-builder install-app-deps' 'yarn compile:dll'", + "postinstall": "patch-package && concurrently 'electron-builder install-app-deps'", "i18n:extract": "lingui extract", "i18n:compile": "lingui compile", "download-bins": "concurrently yarn:download:*", diff --git a/src/common/system-ca.ts b/src/common/system-ca.ts index ec8cd2f7ec..05b464ec35 100644 --- a/src/common/system-ca.ts +++ b/src/common/system-ca.ts @@ -1,7 +1,8 @@ import { isMac, isWindows } from "./vars"; if (isMac) { - // require("mac-ca"); // fixme: crashes + console.warn("//FIXME: MAC-CA IMPORT ERROR!"); + // require("mac-ca"); } if (isWindows) { require("win-ca").inject("+") // see: https://github.com/ukoloff/win-ca#caveats diff --git a/src/common/vars.ts b/src/common/vars.ts index 657610cefb..ff1d06cede 100644 --- a/src/common/vars.ts +++ b/src/common/vars.ts @@ -8,10 +8,11 @@ export const isDevelopment = !isProduction; export const buildVersion = process.env.BUILD_VERSION; // Paths -export const staticDir = path.resolve(__dirname, "../../static"); -export const outDir = path.resolve(__dirname, "../../dist"); -export const mainDir = path.resolve(__dirname, "../main"); -export const rendererDir = path.resolve(__dirname, "../renderer"); +export const contextDir = process.cwd(); +export const staticDir = path.join(contextDir, "static"); +export const outDir = path.join(contextDir, "dist"); +export const mainDir = path.join(contextDir, "src/main"); +export const rendererDir = path.join(contextDir, "src/renderer"); // Apis export const staticProto = "static://" diff --git a/src/main/index.ts b/src/main/index.ts index 25e7b2fc2c..922a2e4253 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -4,19 +4,20 @@ import "../common/system-ca" import { app, BrowserWindow } from "electron" console.log('MAIN', process.resourcesPath) +console.log('userData', app.getPath("userData")) -app.whenReady().then(function start() { - console.log('APP READY') - - var window = new BrowserWindow({ - width: 600, - height: 500, +app.whenReady().then(async function start() { + var mainWindow = new BrowserWindow({ + width: 1024, + height: 768, + show: false, webPreferences: { devTools: true, nodeIntegration: true, } }); - window.loadFile("index.html"); - window.show(); + await mainWindow.loadFile("dist/index.html"); + mainWindow.show(); + mainWindow.focus(); }); diff --git a/src/renderer/index.html b/src/renderer/index.html index 34e72ece0d..ce9ac67964 100755 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -3,7 +3,7 @@