chore: create separate run config for vite dev (#4221)

This commit is contained in:
Nicolas Giard 2022-07-18 09:40:32 -04:00 committed by GitHub
parent 18bf87ea5e
commit dde5ed4650
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 81 additions and 11 deletions

34
.vscode/launch.json vendored
View file

@ -15,7 +15,30 @@
"0.0.0.0:8000",
"--settings=settings_local"
],
"django": true
"django": true,
"presentation": {
"hidden": false,
"group": "main",
"order": 1
}
},
{
"name": "Run Server in Vite Dev Mode",
"type": "python",
"request": "launch",
"python": "/usr/local/bin/python",
"program": "${workspaceFolder}/ietf/manage.py",
"args": [
"runserver",
"0.0.0.0:8000",
"--settings=settings_local_vite"
],
"django": true,
"presentation": {
"hidden": false,
"group": "main",
"order": 1
}
},
{
"name": "Run Server with Debug Toolbar",
@ -28,7 +51,12 @@
"0.0.0.0:8000",
"--settings=settings_local_debug"
],
"django": true
"django": true,
"presentation": {
"hidden": false,
"group": "main",
"order": 1
}
}
]
}
}

33
.vscode/tasks.json vendored
View file

@ -69,7 +69,7 @@
"${workspaceFolder}/ietf/manage.py",
"test",
"--settings=settings_local_sqlitetest",
"--pattern=tests_js.py",
"--pattern=tests_js.py"
],
"group": "test",
"presentation": {
@ -103,7 +103,14 @@
"label": "Run SMTP Debugging Server",
"type": "shell",
"command": "/usr/local/bin/python",
"args": ["-m", "smtpd", "-n", "-c", "DebuggingServer", "localhost:2025"],
"args": [
"-m",
"smtpd",
"-n",
"-c",
"DebuggingServer",
"localhost:2025"
],
"presentation": {
"echo": true,
"reveal": "always",
@ -165,6 +172,28 @@
"clear": false
},
"problemMatcher": []
},
{
"label": "Run Vite Dev Server",
"type": "shell",
"command": "yarn",
"args": [
"dev"
],
"isBackground": true,
"presentation": {
"group": "main",
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
},
"runOptions": {
"instanceLimit": 1
},
"problemMatcher": []
}
]
}

View file

@ -74,5 +74,3 @@ NOMCOM_PUBLIC_KEYS_DIR = 'data/nomcom_keys/public_keys/'
SLIDE_STAGING_PATH = 'test/staging/'
DE_GFM_BINARY = '/usr/local/bin/de-gfm'
DJANGO_VITE_DEV_MODE = True

View file

@ -0,0 +1,6 @@
# Copyright The IETF Trust 2007-2019, All Rights Reserved
# -*- coding: utf-8 -*-
from ietf.settings_local import * # pyflakes:ignore
DJANGO_VITE_DEV_MODE = True

View file

@ -59,6 +59,17 @@ else
fi
fi
if [ ! -f "$WORKSPACEDIR/ietf/settings_local_vite.py" ]; then
echo "Setting up a default settings_local_vite.py ..."
cp $WORKSPACEDIR/docker/configs/settings_local_vite.py $WORKSPACEDIR/ietf/settings_local_vite.py
else
echo "Using existing ietf/settings_local_vite.py file"
if ! cmp -s $WORKSPACEDIR/docker/configs/settings_local_vite.py $WORKSPACEDIR/ietf/settings_local_vite.py; then
echo "NOTE: Differences detected compared to docker/configs/settings_local_vite.py!"
echo "We'll assume you made these deliberately."
fi
fi
# Create data directories
echo "Creating data directories..."

1
ietf/.gitignore vendored
View file

@ -2,4 +2,5 @@
/settings_local.py
/settings_local_debug.py
/settings_local_sqlitetest.py
/settings_local_vite.py
/ietfdb.sql.gz

View file

@ -19,9 +19,6 @@ export default defineConfig({
],
publicDir: 'ietf/static/public',
server: {
host: true,
watch: {
usePolling: true
}
host: true
}
})