Skip to content

Commit

Permalink
chore(devcontainer): Update tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Feb 17, 2021
1 parent 29b10a6 commit 163e967
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"context": "..",
"remoteUser": "vscode",
"appPort": ["5000:5000", "9123:8123"],
"postCreateCommand": "yarn install",
"postCreateCommand": "yarn install && sudo container install",
"runArgs": ["-v", "${localWorkspaceFolder}/.devcontainer/www:/config/www"],
"extensions": [
"github.vscode-pull-request-github",
Expand Down
33 changes: 4 additions & 29 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,12 @@
{
"type": "chrome",
"request": "launch",
"name": "Chrome Localhost",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8123",
"webRoot": "${workspaceFolder}/dist",
"sourceMaps": true
// "runtimeExecutable": "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe"
},
{
"type": "browser-preview",
"request": "attach",
"name": "Browser Preview: Attach",
"webRoot": "${workspaceFolder}/dist",
"pathMapping": {
"http://127.0.0.1:5000/": "${workspaceFolder}/dist"
}
// "sourceMapPathOverrides": {
// "http://127.0.0.1:5000": "${workspaceFolder}/dist"
// },
},
{
"type": "browser-preview",
"request": "launch",
"name": "Browser Preview: Launch",
"url": "http://localhost:9123",
"webRoot": "${workspaceFolder}/dist"
// "sourceMapPathOverrides": {
// "http://127.0.0.1:5000": "${workspaceFolder}/dist"
// },
// "pathMapping": {
// "http://127.0.0.1:5000": "${workspaceFolder}/dist"
// },
// "trace": true
"sourceMaps": true,
"preLaunchTask": "debug",
"postDebugTask": "devcontainer: stop debug"
}
]
}
75 changes: 60 additions & 15 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,73 @@
{
"version": "2.0.0",
"tasks": [{
"label": "Run Home Assistant on port 9123",
"type": "shell",
"command": "dc start",
"problemMatcher": []
"tasks": [
{
"type": "npm",
"script": "watch",
"group": "test",
"label": "npm: watch",
"detail": "rollup -c --watch",
"isBackground": true,
"problemMatcher": {
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "^bundles\\s",
"endsPattern": "^.*waiting for changes\\.\\.\\."
}
}
},
{
"label": "Run Home Assistant configuration against /config",
"type": "shell",
"command": "dc check",
"problemMatcher": []
"label": "devcontainer: Start HA",
"command": "sh -c 'sudo --preserve-env=PATH container start'",
"problemMatcher": {
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": "^Start Home Assistant$"
}
},
"group": "test",
"isBackground": true
},
{
"label": "Upgrade Home Assistant to latest dev",
"type": "shell",
"command": "dc install",
"label": "debug",
"group": "test",
"dependsOn": ["devcontainer: Start HA", "npm: watch"],
"problemMatcher": []
},
{
"label": "Install a spesific version of Home Assistant",
"type": "shell",
"command": "dc set-version",
"problemMatcher": []
"label": "devcontainer: stop debug",
"group": "test",
"command": "sh",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"args": [
"-c",
"sudo killall hass; sudo kill $(ps au | grep 'node.*rollup' | grep -v grep | awk {'print $2'}); exit 0;"
]
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"rollup": "rollup -c",
"babel": "babel dist/button-card.js --out-file dist/button-card.js",
"lint": "eslint src/*.ts",
"start": "rollup -c --watch",
"watch": "rollup -c --watch",
"postversion": "npm run build"
},
"repository": {
Expand Down

0 comments on commit 163e967

Please # to comment.