[codex] Avoid docs-site generated output embed#597
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d49a7b117
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| go run ./cmd/syncdocs | ||
| rm -rf dist/site | ||
| go run github.com/cssbruno/gowdk/cmd/gowdk build | ||
| go run ../cmd/gowdk build |
There was a problem hiding this comment.
Use a module-aware GOWDK invocation in Render build
go help run says module-aware go run runs in the context of the main module; with this service's rootDir: docs-site and no go.work, the main module is docs-site, so go run ../cmd/gowdk build fails before generating dist/site with directory ../cmd/gowdk outside main module or its selected dependencies. This breaks the documented Render/manual deployment path; run the CLI from the repo module/workspace or restore an import-path invocation that resolves to the in-tree command.
Useful? React with 👍 / 👎.
Summary
//go:embed dist/sitedependency.dist/sitefiles from the runtime filesystem instead.replace github.com/cssbruno/gowdk => ../fromdocs-site/go.modand usego run ../cmd/gowdkfor in-tree compiler commands.Why
docs-site/main.goembedded a generated, gitignored directory. A clean Render checkout runninggo build -tags netgo -ldflags '-s -w' -o app .fromdocs-sitefailed at compile time with:That is a code issue: generated output should not be required to compile the server. The server now compiles cleanly and fails at runtime with an explicit message only if
dist/site/index.htmlis missing.The docs-site module also no longer depends on a parent-directory
replacefor normal server compilation. Build/dev commands that need the repository HEAD call../cmd/gowdkdirectly.Verification
rm -rf dist/site app && go build -tags netgo -ldflags '-s -w' -o app .fromdocs-siteexits 0.go test ./...fromdocs-site../appwithoutdist/sitenow exits with a clear runtime message instead of failing compilation.git diff --check.Note: I did not run the full docs-site production build locally because the downloaded Tailwind standalone binary is killed by this macOS environment before GOWDK can run the CSS processor.