refactor/consolidate-shared-go-modules #1
Loading…
Reference in a new issue
No description provided.
Delete branch "refactor/consolidate-shared-go-modules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/infrastructure/http was unreferenced: the live HTTP layer is services/api/pkg/http, wired in services/api/cmd/server/main.go. The deleted copy was a strict subset of the live one, not a divergence: it lacked the GetJobs and ApplyForJob handlers and their route registrations, and its CORS middleware hardcoded Access-Control-Allow-Origin: * where the live version reflects the request Origin. Removing it also drops the only internal/ -> libs/ import edge, so dependencies between the two shared roots now point one way (libs/{ports,repo} -> internal/{domain,dto}). go mod tidy consequently dropped libs/ports, libs/repo, internal/utils and gorilla/mux from internal/infrastructure, whose orphaned replace directives are removed here too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>internal/ and libs/ were both shared-code roots with no rule for which one a package belonged in, so the split carried no information. Adopt a rule the language answers by itself: shared Go -> internal/ shared TypeScript -> libs/ (npm workspace packages) libs/{ports,repo,server} move to internal/, leaving libs/ holding only the two TypeScript packages (@jobs-scraper/rabbitmq-ts and @jobs-scraper/browser-automation), which matches npm workspace convention. internal/ is also Go's marker for code not importable from outside the repo, which is accurate here since none of it is published. Import paths are rewritten mechanically (jobs-scraper/libs/ -> jobs-scraper/internal/) across 15 lines in 10 files. The 6 moved files are pure renames with no content change. Doing this after the module collapse in the previous commit meant no go.mod or replace-directive edits were needed. gofmt is applied to services/api/pkg/http/job.go, whose import group the rewrite left out of order. Three files were already unformatted before this refactor (internal/openai/interface.go, internal/ports/job-queries.go, internal/repo/job-analysis-result.go) and are deliberately left alone to keep this diff limited to the move. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>