feat/ VSCode : add Debugging config for man process (#465) + Karma
This commit is contained in:
36
.vscode/launch.json
vendored
Normal file
36
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Electron Main Renderer",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"protocol": "inspector",
|
||||||
|
// Prelaunch task compiles main.ts for Electron & starts Angular dev server.
|
||||||
|
"preLaunchTask": "Build.All",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
|
||||||
|
"runtimeArgs": [
|
||||||
|
"--serve",
|
||||||
|
".",
|
||||||
|
"--remote-debugging-port=9222"
|
||||||
|
],
|
||||||
|
"windows": {
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"name": "Karma Attach Chrome",
|
||||||
|
"type": "chrome",
|
||||||
|
"request": "attach",
|
||||||
|
"port": 9222,
|
||||||
|
"webRoot": "${workspaceFolder}/",
|
||||||
|
"sourceMaps": true,
|
||||||
|
"timeout": 30000,
|
||||||
|
"trace": true
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
27
.vscode/tasks.json
vendored
Normal file
27
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build.All",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "npm run electron:serve-tsc && ng serve",
|
||||||
|
"isBackground": true,
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": {
|
||||||
|
"owner": "typescript",
|
||||||
|
"source": "ts",
|
||||||
|
"applyTo": "closedDocuments",
|
||||||
|
"fileLocation": ["relative", "${cwd}"],
|
||||||
|
"pattern": "$tsc",
|
||||||
|
"background": {
|
||||||
|
"activeOnStart": true,
|
||||||
|
"beginsPattern": "^.*",
|
||||||
|
"endsPattern": "^.*Compiled successfully.*"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
9
main.ts
9
main.ts
@@ -24,10 +24,15 @@ function createWindow(): BrowserWindow {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (serve) {
|
if (serve) {
|
||||||
|
|
||||||
|
require('devtron').install();
|
||||||
|
win.webContents.openDevTools();
|
||||||
|
|
||||||
require('electron-reload')(__dirname, {
|
require('electron-reload')(__dirname, {
|
||||||
electron: require(`${__dirname}/node_modules/electron`)
|
electron: require(`${__dirname}/node_modules/electron`)
|
||||||
});
|
});
|
||||||
win.loadURL('http://localhost:4200');
|
win.loadURL('http://localhost:4200');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
win.loadURL(url.format({
|
win.loadURL(url.format({
|
||||||
pathname: path.join(__dirname, 'dist/index.html'),
|
pathname: path.join(__dirname, 'dist/index.html'),
|
||||||
@@ -36,10 +41,6 @@ function createWindow(): BrowserWindow {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (serve) {
|
|
||||||
win.webContents.openDevTools();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Emitted when the window is closed.
|
// Emitted when the window is closed.
|
||||||
win.on('closed', () => {
|
win.on('closed', () => {
|
||||||
// Dereference the window object, usually you would store window
|
// Dereference the window object, usually you would store window
|
||||||
|
|||||||
@@ -33,7 +33,8 @@
|
|||||||
"electron:linux": "npm run build:prod && electron-builder build --linux",
|
"electron:linux": "npm run build:prod && electron-builder build --linux",
|
||||||
"electron:windows": "npm run build:prod && electron-builder build --windows",
|
"electron:windows": "npm run build:prod && electron-builder build --windows",
|
||||||
"electron:mac": "npm run build:prod && electron-builder build --mac",
|
"electron:mac": "npm run build:prod && electron-builder build --mac",
|
||||||
"test": "ng test",
|
"test": "ng test --watch=false",
|
||||||
|
"test:watch": "ng test",
|
||||||
"e2e": "npm run build:prod && cross-env TS_NODE_PROJECT='e2e/tsconfig.e2e.json' mocha --timeout 300000 --require ts-node/register e2e/**/*.e2e.ts",
|
"e2e": "npm run build:prod && cross-env TS_NODE_PROJECT='e2e/tsconfig.e2e.json' mocha --timeout 300000 --require ts-node/register e2e/**/*.e2e.ts",
|
||||||
"version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
|
"version": "conventional-changelog -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md",
|
||||||
"lint": "ng lint"
|
"lint": "ng lint"
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
"conventional-changelog-cli": "2.0.32",
|
"conventional-changelog-cli": "2.0.32",
|
||||||
"core-js": "3.6.5",
|
"core-js": "3.6.5",
|
||||||
"cross-env": "7.0.2",
|
"cross-env": "7.0.2",
|
||||||
|
"devtron": "1.4.0",
|
||||||
"electron": "8.2.3",
|
"electron": "8.2.3",
|
||||||
"electron-builder": "22.5.1",
|
"electron-builder": "22.5.1",
|
||||||
"electron-reload": "1.5.0",
|
"electron-reload": "1.5.0",
|
||||||
@@ -81,8 +83,8 @@
|
|||||||
"npm-run-all": "4.1.5",
|
"npm-run-all": "4.1.5",
|
||||||
"rxjs": "6.5.5",
|
"rxjs": "6.5.5",
|
||||||
"spectron": "10.0.1",
|
"spectron": "10.0.1",
|
||||||
"tslib": "1.11.1",
|
|
||||||
"ts-node": "8.9.1",
|
"ts-node": "8.9.1",
|
||||||
|
"tslib": "1.11.1",
|
||||||
"typescript": "3.8.3",
|
"typescript": "3.8.3",
|
||||||
"wait-on": "4.0.2",
|
"wait-on": "4.0.2",
|
||||||
"webdriver-manager": "12.1.7",
|
"webdriver-manager": "12.1.7",
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ module.exports = function (config) {
|
|||||||
port: 9876,
|
port: 9876,
|
||||||
colors: true,
|
colors: true,
|
||||||
logLevel: config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
autoWatch: true,
|
|
||||||
browsers: ['AngularElectron'],
|
browsers: ['AngularElectron'],
|
||||||
singleRun: true,
|
|
||||||
customLaunchers: {
|
customLaunchers: {
|
||||||
AngularElectron: {
|
AngularElectron: {
|
||||||
base: 'Electron',
|
base: 'Electron',
|
||||||
@@ -43,4 +41,4 @@ module.exports = function (config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user