Move to the layout REPO_POLICIES.md gives (closes #30) #127

Merged
clawbot merged 1 commits from issue-30-canonical-layout into next 2026-10-14 12:01:33 +02:00
Collaborator

Moves netwatch to the layout REPO_POLICIES.md gives, as settled on #30: the Go module at the root (go.mod, go.sum, .golangci.yml, cmd/, internal/), the page's source in web/, nginx.conf and security-headers.conf in configs/. Every move is a git mv. backend/ is gone; its README.md is folded into the root one, under Backend and Deployment.

Where each backend script went:

  • build: the root script/build, which now builds the server binary after the frontend
  • run: moved to script/run (make run)
  • clean: moved to script/clean (make clean)
  • test: make test, which already ran the Go tests in Docker
  • lint: make lint, which it only called
  • fmt, fmt-check: folded into the root script/fmt and script/fmt-check

What the diff does not show:

  • The builder stage of Dockerfile runs go build itself, since script/build needs node for the frontend.
  • go.mod ignores node_modules/, where npm packages can ship .go files (flatted does) that make tidy would read; gofmt does not read go.mod, so it still runs over cmd and internal only.
  • Vite's root is web/, so Tailwind scans only web/. The built CSS loses six utilities the page never uses (.visible, .fixed, .relative, .contents, .inline, .table), which came from words in Go and test files. The built JS is byte-identical.

Disclosures:

  • Judgement call: script/bootstrap no longer installs gcc; only the host Go tests, now make test, needed it.
  • Judgement call: script/clean also removes dist/, which script/build writes.
  • Judgement call: the dated entries in TODO.md keep the paths they were written with.

Model: opus-5-5

Moves netwatch to the layout `REPO_POLICIES.md` gives, as settled on https://git.eeqj.de/sneak/netwatch/issues/30: the Go module at the root (`go.mod`, `go.sum`, `.golangci.yml`, `cmd/`, `internal/`), the page's source in `web/`, `nginx.conf` and `security-headers.conf` in `configs/`. Every move is a `git mv`. `backend/` is gone; its `README.md` is folded into the root one, under Backend and Deployment. Where each backend script went: - `build`: the root `script/build`, which now builds the server binary after the frontend - `run`: moved to `script/run` (`make run`) - `clean`: moved to `script/clean` (`make clean`) - `test`: `make test`, which already ran the Go tests in Docker - `lint`: `make lint`, which it only called - `fmt`, `fmt-check`: folded into the root `script/fmt` and `script/fmt-check` What the diff does not show: - The `builder` stage of `Dockerfile` runs `go build` itself, since `script/build` needs node for the frontend. - `go.mod` ignores `node_modules/`, where npm packages can ship `.go` files (`flatted` does) that `make tidy` would read; gofmt does not read `go.mod`, so it still runs over `cmd` and `internal` only. - Vite's root is `web/`, so Tailwind scans only `web/`. The built CSS loses six utilities the page never uses (`.visible`, `.fixed`, `.relative`, `.contents`, `.inline`, `.table`), which came from words in Go and test files. The built JS is byte-identical. Disclosures: - Judgement call: `script/bootstrap` no longer installs gcc; only the host Go tests, now `make test`, needed it. - Judgement call: `script/clean` also removes `dist/`, which `script/build` writes. - Judgement call: the dated entries in `TODO.md` keep the paths they were written with. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 11:02:52 +02:00
clawbot self-assigned this 2026-10-14 11:02:52 +02:00
Author
Collaborator

FAIL (needs-rework)

  • go.mod, line 3: make tidy still reads Go code under node_modules/. With the module at the root, go mod tidy takes node_modules/flatted/golang/pkg/flatted as one of this module's packages. So any .go file an npm package ships can make make tidy fail, or add what that file imports to go.mod and go.sum. Running gofmt over cmd and internal only in script/fmt and script/fmt-check fixes the formatter and nothing else. Acceptable: an ignore ./node_modules line in go.mod, which its go 1.25.5 already allows, so that no ./... or all pattern includes that directory. The two fmt scripts can keep naming cmd and internal, because gofmt does not read go.mod.

Model: opus-5-5

FAIL (needs-rework) - `go.mod`, line 3: `make tidy` still reads Go code under `node_modules/`. With the module at the root, `go mod tidy` takes `node_modules/flatted/golang/pkg/flatted` as one of this module's packages. So any `.go` file an npm package ships can make `make tidy` fail, or add what that file imports to `go.mod` and `go.sum`. Running gofmt over `cmd` and `internal` only in `script/fmt` and `script/fmt-check` fixes the formatter and nothing else. Acceptable: an `ignore ./node_modules` line in `go.mod`, which its `go 1.25.5` already allows, so that no `./...` or `all` pattern includes that directory. The two fmt scripts can keep naming `cmd` and `internal`, because gofmt does not read `go.mod`. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-14 11:30:35 +02:00
clawbot added 1 commit 2026-10-14 11:34:53 +02:00
The Go module moves from backend/ to the root (go.mod, go.sum,
.golangci.yml, cmd/, internal/), the page's source to web/, and nginx's
two files to configs/. backend/ is gone: its LICENSE and .dockerignore
are deleted, and its .gitignore entries, README and scripts are folded
into the root ones. script/build builds the server binary after the
frontend; script/run and script/clean move up from backend/script/;
make test, lint, fmt and fmt-check do what the backend's did. Vite's
root is web/ and it still builds into dist/. go.mod ignores
node_modules/, whose npm packages can ship .go files. script/bootstrap
no longer installs gcc, which only the host Go tests needed.

Model: opus-5-5
clawbot force-pushed issue-30-canonical-layout from 0f78f19a9d to d44c9b60bd 2026-10-14 11:34:53 +02:00 Compare
Author
Collaborator
  • go.mod, line 3: added ignore ./node_modules, with a one-line comment above it; the PR body and the TODO.md entry say why. The fmt scripts still name cmd and internal.

Model: opus-5-5

- `go.mod`, line 3: added `ignore ./node_modules`, with a one-line comment above it; the PR body and the `TODO.md` entry say why. The fmt scripts still name `cmd` and `internal`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-14 11:47:07 +02:00
Author
Collaborator

PASS: the repo now has the layout settled on #30, and the earlier finding is fixed, as go.mod keeps make tidy and every other Go command out of node_modules/.

Model: opus-5-5

PASS: the repo now has the layout settled on https://git.eeqj.de/sneak/netwatch/issues/30, and the earlier finding is fixed, as `go.mod` keeps `make tidy` and every other Go command out of `node_modules/`. Model: opus-5-5
clawbot merged commit 406e073aee into next 2026-10-14 12:01:33 +02:00
clawbot deleted branch issue-30-canonical-layout 2026-10-14 12:01:34 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#127