Skip to content

build: keep node_modules out of the Go module - #185

Merged
josealekhine merged 1 commit into
mainfrom
build/exclude-node-modules
Oct 6, 2026
Merged

josealekhine merged 1 commit into
mainfrom
build/exclude-node-modules

Conversation

@josealekhine

@josealekhine josealekhine commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

npm dependencies may ship Go sources: flatted, pulled in by eslint,
carries flatted/golang/pkg/flatted/flatted.go. After npm install in
editors/vscode, go list ./... reported it as a package of this
module, so go build/vet/test compiled it, make lint failed with two
govet findings in it, and make test failed in TestGolangciLint. CI
never ran npm install in the Go jobs, so only contributors hit it.

Add ignore node_modules to go.mod. The bare form matches the
directory at any depth (./node_modules matches only the root), and
removes it from ./... for every go command, golangci-lint included.
Also list node_modules in .golangci.yml exclusions.paths, beside
vendor/dist/site, so the linter config states the same scope.

TestGoModIgnoresNodeModules reads go.mod through go mod edit -json
and fails if the directive goes missing.

Spec: specs/go-ignore-node-modules.md

npm dependencies may ship Go sources: flatted, pulled in by eslint,
carries flatted/golang/pkg/flatted/flatted.go. After npm install in
editors/vscode, go list ./... reported it as a package of this
module, so go build/vet/test compiled it, make lint failed with two
govet findings in it, and make test failed in TestGolangciLint. CI
never ran npm install in the Go jobs, so only contributors hit it.

Add `ignore node_modules` to go.mod. The bare form matches the
directory at any depth (./node_modules matches only the root), and
removes it from ./... for every go command, golangci-lint included.
Also list node_modules in .golangci.yml exclusions.paths, beside
vendor/dist/site, so the linter config states the same scope.

TestGoModIgnoresNodeModules reads go.mod through go mod edit -json
and fails if the directive goes missing.

Spec: specs/go-ignore-node-modules.md
Signed-off-by: Jose Alekhinne <jose@ctx.ist>
@josealekhine
josealekhine requested a review from bilersan as a code owner October 6, 2026 02:45
@josealekhine josealekhine self-assigned this Oct 6, 2026
@josealekhine
josealekhine merged commit 945ed64 into main Oct 6, 2026
34 checks passed
@josealekhine
josealekhine deleted the build/exclude-node-modules branch October 6, 2026 02:57
bilersan added a commit to bilersan/ctx that referenced this pull request Oct 8, 2026
Brings in ActiveMemory#184 (vitest 5, Node 22, vitest.config.ts -> .mts), ActiveMemory#185-ActiveMemory#189
and PR ActiveMemory#177. Git applied the branch's md-as-text plugin to the renamed
vitest.config.mts; no conflicts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Ersan Bilik <ersanbilik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant