npm run dev now runs scripts/dev-env.ts first, which creates .dev/site.env with a known dev password and a random session secret, so a fresh clone serves a working admin without anyone hand-building a hash. Adds .vscode launch configurations and tasks for the dev server, one test file, and check-site, and brings scripts/ under typecheck, which it had been missing.
59 lines
1.6 KiB
JSON
59 lines
1.6 KiB
JSON
{
|
|
"version": "0.2.0",
|
|
"configurations": [
|
|
{
|
|
"name": "Dev server (debug)",
|
|
"type": "node",
|
|
"request": "launch",
|
|
"program": "${workspaceFolder}/src/server.ts",
|
|
"cwd": "${workspaceFolder}",
|
|
"console": "integratedTerminal",
|
|
"skipFiles": ["<node_internals>/**"],
|
|
"preLaunchTask": "dev: ensure .dev/site.env",
|
|
"env": {
|
|
"MENU_ROOT": "${workspaceFolder}/.dev",
|
|
"MENU_SITE_CONFIG": "${workspaceFolder}/config/hopsngrains.site.json",
|
|
"SECURE_COOKIES": "false",
|
|
"LOG_LEVEL": "info",
|
|
"PORT": "3000"
|
|
}
|
|
},
|
|
{
|
|
"name": "Dev server (watch, no debugger)",
|
|
"type": "node-terminal",
|
|
"request": "launch",
|
|
"command": "npm run dev",
|
|
"cwd": "${workspaceFolder}"
|
|
},
|
|
{
|
|
"name": "Debug the open test file",
|
|
"type": "node",
|
|
"request": "launch",
|
|
"program": "${file}",
|
|
"cwd": "${workspaceFolder}",
|
|
"console": "integratedTerminal",
|
|
"skipFiles": ["<node_internals>/**"],
|
|
"runtimeArgs": ["--test"],
|
|
"autoAttachChildProcesses": true
|
|
},
|
|
{
|
|
"name": "Check the running site",
|
|
"type": "node",
|
|
"request": "launch",
|
|
"program": "${workspaceFolder}/scripts/check-site.ts",
|
|
"cwd": "${workspaceFolder}",
|
|
"console": "integratedTerminal",
|
|
"skipFiles": ["<node_internals>/**"],
|
|
"args": ["${input:siteUrl}"]
|
|
}
|
|
],
|
|
"inputs": [
|
|
{
|
|
"id": "siteUrl",
|
|
"type": "promptString",
|
|
"description": "Base URL to check",
|
|
"default": "http://127.0.0.1:3000"
|
|
}
|
|
]
|
|
}
|