added Codespaces support (#2290)

This commit is contained in:
ArnoldSmith86 2024-09-07 00:04:54 +02:00 committed by GitHub
parent f4f9e7771d
commit 2c5433196a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,28 @@
{
"name": "VirtualTabletop.io",
"forwardPorts": [
9229,
8272
],
"portsAttributes": {
"9229": {
"label": "Node.js Debugger",
"onAutoForward": "ignore"
},
"8272": {
"label": "VirtualTabletop.io",
"onAutoForward": "notify",
"visibility": "public"
}
},
"postCreateCommand": "bash .devcontainer/setup.sh",
"postStartCommand": "npm run debug",
"customizations": {
"vscode": {
"settings": {
"debug.node.autoAttach": "on"
},
"extensions": []
}
}
}

4
.devcontainer/setup.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
sed -r "s/http:\/\/localhost:([0-9]+)/https:\/\/${CODESPACE_NAME}-\\1.app.github.dev/;s/VirtualTabletop.io/Codespaces VTT/;s/(allowPublicLibraryEdits.: )false/\\1true/" config.template.json > config.json
npm install
gh codespace ports visibility 8272:public -c $CODESPACE_NAME

15
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "VirtualTabletop.io",
"address": "localhost",
"port": 9229,
"restart": true,
"skipFiles": ["<node_internals>/**"]
}
]
}