Files
kjol/.vscode/tasks.json

114 lines
4.2 KiB
JSON

{
// Tasks for the kjol repo. The gowasm example is a nested module at
// go/cmd/examples/go-wasm-web, so its tasks set cwd there; the module-wide
// Go tasks run in go/.
//
// The example's build pipeline is Go, not a shell script — see
// go/cmd/examples/go-wasm-web/buildsteps. The dev server calls the same steps on every
// save, and a bash script would not run for anyone on Windows. "gowasm: prebuild" is
// codegen + Tailwind, and everything that runs the app depends on it; the two steps are
// also exposed on their own so you can rerun just the one you need.
"version": "2.0.0",
"tasks": [
{
"label": "gowasm: prebuild",
"detail": "Codegen (pages/layouts/server components) then Tailwind. Dependency of the run + debug configs.",
"dependsOrder": "sequence",
"dependsOn": ["gowasm: codegen", "gowasm: tailwind"],
"problemMatcher": [],
"group": "build"
},
{
"label": "gowasm: codegen",
"detail": "Regenerate app/*.gen.go from the //gowasm: directives (pages, layouts, server components)",
"type": "shell",
"command": "go",
"args": ["run", "kjol/cmd/wasmgen", "./app"],
"options": { "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web" },
"problemMatcher": ["$go"],
"presentation": { "reveal": "silent", "panel": "shared" },
"group": "build"
},
{
"label": "gowasm: tailwind",
"detail": "Compile css/app.css -> wwwroot/app.css, scanning the webui kit + the example's Go markup",
"type": "shell",
"command": "go",
"args": [
"run", "./cmd/twcss",
"-entry", "cmd/examples/go-wasm-web/css/app.css",
"-out", "cmd/examples/go-wasm-web/wwwroot/app.css",
"-base", ".",
"webui/**/*.go",
"cmd/examples/go-wasm-web/app/**/*.go",
"cmd/examples/go-wasm-web/server/**/*.go"
],
// Run from the kjol module root so the Tailwind engine's deps resolve in kjol's
// go.mod, not the example's.
"options": { "cwd": "${workspaceFolder}/go" },
"problemMatcher": ["$go"],
"presentation": { "reveal": "silent", "panel": "shared" },
"group": "build"
},
{
"label": "gowasm: dev server (hot reload)",
"detail": "SSR + hot reload on :8085. Rebuilds Go on save; a .css save recompiles Tailwind only and swaps the stylesheet in place.",
"type": "shell",
"command": "go",
"args": ["run", "./server"],
"options": { "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web" },
"dependsOn": ["gowasm: prebuild"],
"isBackground": true,
"problemMatcher": {
"owner": "go",
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(.*)$",
"file": 1, "line": 2, "column": 3, "message": 4
},
"background": {
"activeOnStart": true,
"beginsPattern": "rebuilding|recompiling",
"endsPattern": "serving|reloading clients|stylesheet updated"
}
},
"presentation": { "reveal": "always", "panel": "dedicated", "clear": true },
"group": { "kind": "build", "isDefault": true }
},
{
"label": "gowasm: build",
"detail": "One-off cold build of the example: codegen + Tailwind + wasm + stage wasm_exec.js",
"type": "shell",
"command": "go",
"args": ["run", "./build"],
"options": { "cwd": "${workspaceFolder}/go/cmd/examples/go-wasm-web" },
"problemMatcher": ["$go"],
"group": "build"
},
{
"label": "kjol: build ./...",
"detail": "Build the whole kjol module (excludes the nested example)",
"type": "shell",
"command": "go build ./...",
"options": { "cwd": "${workspaceFolder}/go" },
"problemMatcher": ["$go"],
"group": "build"
},
{
"label": "kjol: vet ./...",
"type": "shell",
"command": "go vet ./...",
"options": { "cwd": "${workspaceFolder}/go" },
"problemMatcher": ["$go"],
"group": "test"
},
{
"label": "kjol: test ./...",
"type": "shell",
"command": "go test ./...",
"options": { "cwd": "${workspaceFolder}/go" },
"problemMatcher": ["$go"],
"group": { "kind": "test", "isDefault": true }
}
]
}