Skip to content

Commit b79dd68

Browse files
authored
fix(go): move package root from packages/go/v1/ to packages/go/ (#97)
* fix(go): move package root from packages/go/v1/ to packages/go/ The Go proxy expected go.mod at packages/go/go.mod but it was nested at packages/go/v1/go.mod. The /v1 suffix is also rejected by the proxy as invalid (only v2+ major version suffixes are allowed). Closes #96 * docs: add unreleased changelog entry for Go module path fix (#97) * fix(publish): extract Go module tagging to robust script, align with kreuzberg pattern * fix(ci): resolve Go e2e generator path and all-grammars registry test failures - Fix Go e2e generator template: replace directive pointed to packages/go/v1 (stale path), causing conflicting replacements when CI regenerates go.mod - Add TSLP_LANGUAGES=all support to build.rs selected_languages() so the all-grammars task can compile every language without per-language listing - Set TSLP_LANGUAGES=all in the rust:e2e:all-grammars task to replace the removed lang-* cargo feature mechanism * fix(test): use valid RTF source in smoke_rtf fixture Parsing bare 'x' with the RTF grammar produces a root node with 0 children. Use a minimal valid RTF document so the root_child_count_min assertion passes. * fix(ci): use curated language subset for all-grammars static test Compiling all 305 parsers statically causes malloc heap corruption from scanner symbol collisions. Use the same representative subset approach as the Go e2e test. Reverts the unsafe TSLP_LANGUAGES=all shortcut.
1 parent b472f17 commit b79dd68

46 files changed

Lines changed: 128 additions & 84 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ updates:
5151
interval: "weekly"
5252

5353
- package-ecosystem: "gomod"
54-
directory: "/packages/go/v1"
54+
directory: "/packages/go"
5555
schedule:
5656
interval: "weekly"
5757

.github/workflows/ci-go.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- 'Cargo.lock'
1212
- 'crates/ts-pack-core/**'
1313
- 'crates/ts-pack-ffi/**'
14-
- 'packages/go/v1/**'
14+
- 'packages/go/**'
1515
- 'e2e/go/**'
1616
- 'fixtures/**'
1717
- 'tools/e2e-generator/**'
@@ -28,7 +28,7 @@ on:
2828
- 'Cargo.lock'
2929
- 'crates/ts-pack-core/**'
3030
- 'crates/ts-pack-ffi/**'
31-
- 'packages/go/v1/**'
31+
- 'packages/go/**'
3232
- 'e2e/go/**'
3333
- 'fixtures/**'
3434
- 'tools/e2e-generator/**'
@@ -174,15 +174,22 @@ jobs:
174174
cp ffi-artifacts/target/release/libts_pack_ffi.* target/release/ 2>/dev/null || true
175175
mkdir -p crates/ts-pack-ffi/include
176176
cp -r ffi-artifacts/crates/ts-pack-ffi/include/* crates/ts-pack-ffi/include/ 2>/dev/null || true
177-
# Place in path CGO expects (relative to packages/go/v1/)
177+
# Place in path CGO expects (relative to packages/go/)
178178
mkdir -p crates/ts-pack-ffi/target/release
179179
cp target/release/libts_pack_ffi.* crates/ts-pack-ffi/target/release/ 2>/dev/null || true
180180
181+
- name: Verify go.mod placement and module path
182+
run: |
183+
test -f packages/go/go.mod || (echo "ERROR: go.mod missing at packages/go/go.mod" && exit 1)
184+
grep -q 'module github.com/kreuzberg-dev/tree-sitter-language-pack/packages/go$' packages/go/go.mod \
185+
|| (echo "ERROR: module path in go.mod is wrong" && exit 1)
186+
test ! -d packages/go/v1 || (echo "ERROR: stale v1/ directory still exists" && exit 1)
187+
181188
- name: Setup Go
182189
uses: actions/setup-go@v6
183190
with:
184191
go-version: "1.26"
185-
cache-dependency-path: packages/go/v1/go.sum
192+
cache-dependency-path: packages/go/go.sum
186193

187194
- name: Install Task
188195
uses: kreuzberg-dev/actions/install-task@v1
@@ -228,7 +235,7 @@ jobs:
228235
cp ffi-artifacts/target/release/libts_pack_ffi.* target/release/ 2>/dev/null || true
229236
mkdir -p crates/ts-pack-ffi/include
230237
cp -r ffi-artifacts/crates/ts-pack-ffi/include/* crates/ts-pack-ffi/include/ 2>/dev/null || true
231-
# Place in path CGO expects (relative to packages/go/v1/)
238+
# Place in path CGO expects (relative to packages/go/)
232239
mkdir -p crates/ts-pack-ffi/target/release
233240
cp target/release/libts_pack_ffi.* crates/ts-pack-ffi/target/release/ 2>/dev/null || true
234241
@@ -243,7 +250,7 @@ jobs:
243250
uses: actions/setup-go@v6
244251
with:
245252
go-version: "1.26"
246-
cache-dependency-path: packages/go/v1/go.sum
253+
cache-dependency-path: packages/go/go.sum
247254

248255
- name: Install Task
249256
uses: kreuzberg-dev/actions/install-task@v1

.github/workflows/ci-validate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
uses: actions/setup-go@v6
116116
with:
117117
go-version: "1.26"
118-
cache-dependency-path: packages/go/v1/go.sum
118+
cache-dependency-path: packages/go/go.sum
119119

120120
- name: Install golangci-lint
121121
run: |

.github/workflows/publish.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2624,12 +2624,9 @@ jobs:
26242624
26252625
- name: Create Go module tag
26262626
if: ${{ needs.prepare.outputs.release_go == 'true' && needs.prepare.outputs.dry_run != 'true' }}
2627-
run: |
2628-
VERSION="${{ needs.prepare.outputs.version }}"
2629-
GO_TAG="packages/go/v${VERSION}"
2630-
echo "Creating Go module tag: $GO_TAG"
2631-
git tag "$GO_TAG" || echo "Tag already exists"
2632-
git push origin "$GO_TAG" 2>/dev/null || echo "Tag already pushed"
2627+
env:
2628+
GH_TOKEN: ${{ github.token }}
2629+
run: bash scripts/publish/go/tag-and-push-go-module.sh "${{ needs.prepare.outputs.tag }}"
26332630

26342631
- name: Publish release from draft state
26352632
if: ${{ needs.prepare.outputs.dry_run != 'true' }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ packages/csharp/**/obj/
3636
packages/csharp/**/runtimes/
3737

3838
# Go vendored FFI artifacts
39-
packages/go/v1/include/
40-
packages/go/v1/lib/
39+
packages/go/include/
40+
packages/go/lib/
4141

4242
# Elixir build artifacts
4343
crates/ts-pack-elixir/deps/

.task/go.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ tasks:
1111
build:
1212
desc: Build Go bindings (requires FFI built first)
1313
deps: [build:ffi]
14-
dir: packages/go/v1
14+
dir: packages/go
1515
cmds:
1616
- go build -tags tspack_dev ./...
1717

1818
test:
1919
desc: Run Go unit tests
2020
deps: [build:ffi]
21-
dir: packages/go/v1
21+
dir: packages/go
2222
env:
2323
PROJECT_ROOT: "{{.PROJECT_ROOT}}"
2424
cmds:
@@ -27,26 +27,26 @@ tasks:
2727
lint:
2828
desc: Lint and vet Go code (requires FFI built first)
2929
deps: [build:ffi]
30-
dir: packages/go/v1
30+
dir: packages/go
3131
cmds:
3232
- go vet -tags tspack_dev ./...
3333

3434
lint:check:
3535
desc: Check Go linting without modifications (CI)
3636
deps: [build:ffi]
37-
dir: packages/go/v1
37+
dir: packages/go
3838
cmds:
3939
- go vet -tags tspack_dev ./...
4040

4141
format:
4242
desc: Format Go code
43-
dir: packages/go/v1
43+
dir: packages/go
4444
cmds:
4545
- gofmt -w .
4646

4747
format:check:
4848
desc: Check Go formatting
49-
dir: packages/go/v1
49+
dir: packages/go
5050
cmds:
5151
- test -z "$(gofmt -l .)"
5252

@@ -67,7 +67,7 @@ tasks:
6767

6868
update:
6969
desc: Update Go dependencies and linters
70-
dir: packages/go/v1
70+
dir: packages/go
7171
cmds:
7272
- echo "Updating Go dependencies and linters..."
7373
- go get -u ./...
@@ -77,7 +77,7 @@ tasks:
7777

7878
clean:
7979
desc: Clean Go build cache
80-
dir: packages/go/v1
80+
dir: packages/go
8181
cmds:
8282
- go clean -cache
8383

.task/rust.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ tasks:
145145
- cargo test --manifest-path e2e/rust/Cargo.toml
146146

147147
e2e:all-grammars:
148-
desc: Run Rust E2E tests with all grammars (no TSLP_LANGUAGES filter)
148+
desc: Run Rust E2E tests with a representative set of grammars compiled statically
149149
env:
150150
PROJECT_ROOT: "{{.PROJECT_ROOT}}"
151151
TSLP_LINK_MODE: static
152+
TSLP_LANGUAGES: "python,rust,javascript,typescript,go,html,css,json,bash,c,cpp,java,ruby,swift,kotlin"
152153
cmds:
153154
- cargo test --manifest-path e2e/rust/Cargo.toml
154155

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Go: move package root from `packages/go/v1/` to `packages/go/` so the Go module proxy can resolve `go.mod` at the correct path — `go get github.com/kreuzberg-dev/tree-sitter-language-pack/packages/go` now works (#97)
13+
- Go: fix CGO `SRCDIR`-relative include/lib paths (one fewer `../` after directory restructure)
14+
1015
## [1.6.0] - 2026-04-14
1116

1217
### Added

Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
[workspace]
22
members = ["crates/*", "tools/e2e-generator", "tools/snippet-runner"]
3-
exclude = [
4-
"crates/ts-pack-elixir",
5-
"crates/ts-pack-java",
6-
"packages/go/v1",
7-
"tests/test_apps/rust",
8-
]
3+
exclude = ["crates/ts-pack-elixir", "crates/ts-pack-java", "tests/test_apps/rust"]
94
resolver = "2"
105

116
[workspace.package]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<img src="https://img.shields.io/npm/v/@kreuzberg/tree-sitter-language-pack-wasm?label=WASM&color=007ec6" alt="Wasm">
1414
</a> <a href="https://central.sonatype.com/artifact/dev.kreuzberg/tree-sitter-language-pack">
1515
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg/tree-sitter-language-pack?label=Java&color=007ec6" alt="Java">
16-
</a> <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/packages/go/v1">
16+
</a> <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/packages/go">
1717
<img src="https://img.shields.io/github/v/tag/kreuzberg-dev/tree-sitter-language-pack?label=Go&color=007ec6" alt="Go">
1818
</a> <a href="https://www.nuget.org/packages/TreeSitterLanguagePack">
1919
<img src="https://img.shields.io/nuget/v/TreeSitterLanguagePack?label=C%23&color=007ec6" alt="Csharp">
@@ -118,10 +118,10 @@ See [Node.js README](crates/ts-pack-node/README.md) for full documentation.
118118
### Go
119119

120120
```sh
121-
go get github.com/kreuzberg-dev/tree-sitter-language-pack/packages/go/v1
121+
go get github.com/kreuzberg-dev/tree-sitter-language-pack/packages/go
122122
```
123123

124-
See [Go README](packages/go/v1/README.md) for full documentation.
124+
See [Go README](packages/go/README.md) for full documentation.
125125

126126
### Java
127127

@@ -239,7 +239,7 @@ This pack includes 305+ languages. See the [full language list](docs/supported-l
239239
- [Rust](crates/ts-pack-core/README.md) -- Rust core library providing access to 305 tree-sitter parsers with on-demand download and caching support.
240240
- [Python](crates/ts-pack-python/README.md) -- Python bindings for tree-sitter-language-pack, providing access to 305 pre-compiled tree-sitter parsers with on-demand downloads.
241241
- [Node.js](crates/ts-pack-node/README.md) -- Node.js NAPI bindings for tree-sitter-language-pack with on-demand parser downloads.
242-
- [Go](packages/go/v1/README.md) -- Go bindings for tree-sitter-language-pack with on-demand parser caching.
242+
- [Go](packages/go/README.md) -- Go bindings for tree-sitter-language-pack with on-demand parser caching.
243243
- [Java](crates/ts-pack-java/README.md) -- Java bindings for tree-sitter-language-pack with on-demand parser downloads (JDK 22+).
244244
- [Elixir](crates/ts-pack-elixir/README.md) -- Elixir bindings for tree-sitter-language-pack with on-demand parser downloads.
245245
- [Ruby](crates/ts-pack-ruby/README.md) -- Ruby bindings for tree-sitter-language-pack with on-demand parser downloads.

0 commit comments

Comments
 (0)