Skip to content

Latest commit

 

History

History
88 lines (63 loc) · 1.59 KB

File metadata and controls

88 lines (63 loc) · 1.59 KB

Scripts

Install dependencies:

go mod download
npm install
cd e2e && npm install && npx playwright install chromium

Upkeep dependencies:

go mod tidy

Build the stylesheet:

npm run css

public/app.css is generated from src/styles/app.css and is committed, so the binary, the container, and go run never need Node. Rebuild it whenever a template or a script gains a class the sheet does not already carry, and commit the result; CI fails if the committed file differs from a fresh build. During design work, npm run css:watch regenerates on save.

Run project:

go run ./src

Lint the page scripts and the Playwright suite:

npm run lint
npm run lint:fix

The Playwright suite is linted with type information, so e2e needs its own dependencies installed. The Go application is checked by go vet instead.

Run unit tests:

go vet ./src/...
go test ./src/...

Every Go package lives under src. ./... also walks node_modules, which ships a stray Go package once the npm tooling is installed.

Run E2E tests (Playwright auto-starts the binary; build it first):

CGO_ENABLED=0 go build -o ./bin/httphq ./src
cd e2e && npx playwright test

View test coverage:

go test ./src/... -coverprofile=coverage.out
go tool cover -html=coverage.out

Format project:

go fmt ./src && npx prettier --write .

Build and run binary:

CGO_ENABLED=0 go build -o ./bin/httphq ./src
./bin/httphq

Build and run container:

docker build . -t httphq
docker run -dp 8080:8080 httphq
docker container ls -s