Skip to content

Commit 5be34d6

Browse files
theskyinflamesJaume
andauthored
fix: correct WASM build filename typo (#16)
- Output word2png.wasm instead of world2png.wasm - Copy word2png.wasm → world2png.wasm for backward compatibility - Update AGENTS.md Co-authored-by: Jaume <jaume@example.com>
1 parent 1ec06b7 commit 5be34d6

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- ~~**`make generate` vendor dance:** It runs `go mod vendor` before `go generate ./...`, then removes `./vendor`. This may not work if vendor directory is gitignored or has stale contents.~~ ✅ Fixed — moq is now a `tool` dependency in `go.mod`, `//go:generate` uses `go run`, and `make generate` is just `go generate ./...`.
66
- ~~**No real-crypto e2e test:** `lib/fixtures_test.go` uses generated mocks (`EncrypterMock`/`DecrypterMock`), so encryption/decryption round-trips are never tested with real AES-256. Don't assume integration coverage exists.~~ ✅ Fixed — `TestRealCryptoEncodingDecodingRoundTrip` in `lib/e2e_test.go` exercises full encode→decode pipeline with real AES-256.
77
- **Formatters are enforced:** `gofumpt` + `goimports` run as linters. Run `golangci-lint run` locally (or `make lint`) before pushing — it also verifies `go mod tidy` didn't change anything (`git diff --quiet go.mod go.sum`).
8-
- **WASM build typo:** `make build-wasm` outputs `assets/world2png.wasm` (missing 'd'). Preserve filename for backward compatibility with `word2pngUI`.
8+
- ~~**WASM build typo:** `make build-wasm` outputs `assets/world2png.wasm` (missing 'd'). Preserve filename for backward compatibility with `word2pngUI`.~~ ✅ Fixed — now outputs `word2png.wasm` with a copy as `world2png.wasm` for backward compat.
99
- **`os.Exit()` + non-standard code:** Both CLIs (`cmd/word2png/`, `cmd/png2word/`) call `os.Exit(-1)` on failure, skipping deferred cleanup. Handle with care.
1010
- **`cmd/wasm/` excluded from golangci-lint** (see `.golangci.yml` `build-tags: [infra]` and WASM build constraint).
1111

@@ -15,7 +15,7 @@
1515
make test # go test -v -race ./...
1616
make lint # golangci-lint run + go mod tidy -v && git diff --quiet go.mod go.sum
1717
make install # builds + installs word2png and png2word binaries
18-
make build-wasm # GOOS=js GOARCH=wasm → assets/world2png.wasm
18+
make build-wasm # GOOS=js GOARCH=wasm → assets/word2png.wasm (+ world2png.wasm copy)
1919
make generate # go generate ./... (moq is a tool dep in go.mod)
2020
make tools # install golangci-lint v1.40.1, gofumpt, moq
2121
```

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ install:
66

77
build-wasm:
88
mkdir -p ./assets
9-
GOOS=js GOARCH=wasm go build -tags wasm -o ./assets/world2png.wasm ./cmd/wasm/main.go
9+
GOOS=js GOARCH=wasm go build -tags wasm -o ./assets/word2png.wasm ./cmd/wasm/main.go
10+
cp ./assets/word2png.wasm ./assets/world2png.wasm
1011

1112
test:
1213
go test -v -race ./...

0 commit comments

Comments
 (0)