Skip to content

Commit bf4fddf

Browse files
committed
chore: separate task update (within-major) from task upgrade (latest)
1 parent c1d8c8b commit bf4fddf

11 files changed

Lines changed: 2421 additions & 1725 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ repos:
8080

8181
# Markdown: linting
8282
- repo: https://github.com/rvben/rumdl-pre-commit
83-
rev: "v0.1.81"
83+
rev: "v0.1.82"
8484
hooks:
8585
- id: rumdl-fmt
8686
exclude: "^.ai-rulez/"
@@ -278,7 +278,7 @@ repos:
278278

279279
# Alef: polyglot binding generation and version sync
280280
- repo: https://github.com/kreuzberg-dev/alef
281-
rev: v0.7.10
281+
rev: v0.7.11
282282
hooks:
283283
- id: alef-verify
284284
- id: alef-sync-versions

Taskfile.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,26 @@ tasks:
115115
- alef clean
116116

117117
update:
118-
desc: Update all dependencies to latest versions
118+
desc: Update all dependencies within current major versions
119119
cmds:
120-
- echo "Updating Rust dependencies..."
121-
- task: rust:update
122-
- echo "Updating binding language dependencies..."
120+
- echo "Updating binding language dependencies (within-major)..."
123121
- alef update
124122
- echo "Updating language grammar revisions..."
125123
- uv run --no-sync scripts/pin_vendors.py
126124
- echo "Updating prek dependencies..."
127125
- prek autoupdate
128-
- echo "All dependencies updated"
126+
- echo "Within-major update complete"
127+
128+
upgrade:
129+
desc: Upgrade all dependencies to latest versions (cross-major)
130+
cmds:
131+
- echo "Upgrading binding language dependencies (cross-major)..."
132+
- alef update --latest
133+
- echo "Updating language grammar revisions..."
134+
- uv run --no-sync scripts/pin_vendors.py
135+
- echo "Updating prek dependencies..."
136+
- prek autoupdate
137+
- echo "Cross-major upgrade complete"
129138

130139
update:grammars:
131140
desc: Update language grammar revisions

alef.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "0.7.10"
1+
version = "0.7.11"
22
languages = ["python", "node", "ruby", "php", "ffi", "go", "java", "csharp", "elixir", "wasm"]
33

44
[crate]

packages/elixir/lib/tree_sitter_language_pack/native.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ defmodule TreeSitterLanguagePack.Native do
1212
base_url:
1313
"https://github.com/kreuzberg-dev/tree-sitter-language-pack/releases/download/v#{Mix.Project.config()[:version]}",
1414
version: Mix.Project.config()[:version],
15-
force_build:
16-
System.get_env("TREE_SITTER_LANGUAGE_PACK_BUILD") in ["1", "true"] or
17-
Mix.env() in [:test, :dev],
15+
force_build: System.get_env("TREE_SITTER_LANGUAGE_PACK_BUILD") in ["1", "true"] or Mix.env() in [:test, :dev],
1816
targets:
1917
~w(aarch64-apple-darwin aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu x86_64-pc-windows-gnu),
2018
nif_versions: ["2.16", "2.17"]

packages/php/src/TreeSitterLanguagePack.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ final class TreeSitterLanguagePack
2323
* assert_eq!(detect_language_from_extension("xyz"), None);
2424
* ```
2525
*
26+
* @param string $ext
27+
* @return ?string
2628
*/
2729
public static function detectLanguageFromExtension(string $ext): ?string
2830
{
@@ -42,6 +44,8 @@ public static function detectLanguageFromExtension(string $ext): ?string
4244
* assert_eq!(detect_language_from_path("Makefile"), None);
4345
* ```
4446
*
47+
* @param string $path
48+
* @return ?string
4549
*/
4650
public static function detectLanguageFromPath(string $path): ?string
4751
{
@@ -72,6 +76,8 @@ public static function detectLanguageFromPath(string $path): ?string
7276
* assert_eq!(detect_language_from_content("no shebang here"), None);
7377
* ```
7478
*
79+
* @param string $content
80+
* @return ?string
7581
*/
7682
public static function detectLanguageFromContent(string $content): ?string
7783
{
@@ -81,6 +87,8 @@ public static function detectLanguageFromContent(string $content): ?string
8187
/**
8288
* Get a `NodeInfo` snapshot of the root node.
8389
*
90+
* @param Tree $tree
91+
* @return NodeInfo
8492
*/
8593
public static function rootNodeInfo(Tree $tree): NodeInfo
8694
{
@@ -92,6 +100,8 @@ public static function rootNodeInfo(Tree $tree): NodeInfo
92100
*
93101
* Performs a depth-first traversal. Returns an empty vec if no matches.
94102
*
103+
* @param Tree $tree
104+
* @param string $node_type
95105
* @return array<NodeInfo>
96106
*/
97107
public static function findNodesByType(Tree $tree, string $node_type): array
@@ -105,6 +115,7 @@ public static function findNodesByType(Tree $tree, string $node_type): array
105115
* Useful for understanding the top-level structure of a file
106116
* (e.g., list of function definitions, class declarations, imports).
107117
*
118+
* @param Tree $tree
108119
* @return array<NodeInfo>
109120
*/
110121
public static function namedChildrenInfo(Tree $tree): array
@@ -126,6 +137,9 @@ public static function namedChildrenInfo(Tree $tree): array
126137
* assert_eq!(tree.root_node().kind(), "module");
127138
* ```
128139
*
140+
* @param string $language
141+
* @param string $source
142+
* @return Tree
129143
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
130144
*/
131145
public static function parseString(string $language, string $source): Tree
@@ -138,6 +152,9 @@ public static function parseString(string $language, string $source): Tree
138152
*
139153
* Performs a depth-first traversal using `TreeCursor`.
140154
*
155+
* @param Tree $tree
156+
* @param string $node_type
157+
* @return bool
141158
*/
142159
public static function treeContainsNodeType(Tree $tree, string $node_type): bool
143160
{
@@ -149,6 +166,8 @@ public static function treeContainsNodeType(Tree $tree, string $node_type): bool
149166
*
150167
* Useful for determining if the parse was clean or had syntax errors.
151168
*
169+
* @param Tree $tree
170+
* @return bool
152171
*/
153172
public static function treeHasErrorNodes(Tree $tree): bool
154173
{
@@ -161,6 +180,8 @@ public static function treeHasErrorNodes(Tree $tree): bool
161180
* This is the standard tree-sitter debug format, useful for logging,
162181
* snapshot testing, and debugging grammars.
163182
*
183+
* @param Tree $tree
184+
* @return string
164185
*/
165186
public static function treeToSexp(Tree $tree): string
166187
{
@@ -172,6 +193,8 @@ public static function treeToSexp(Tree $tree): string
172193
*
173194
* Returns 0 for a clean parse.
174195
*
196+
* @param Tree $tree
197+
* @return int
175198
*/
176199
public static function treeErrorCount(Tree $tree): int
177200
{
@@ -196,6 +219,8 @@ public static function treeErrorCount(Tree $tree): int
196219
* assert!(missing.is_none());
197220
* ```
198221
*
222+
* @param string $language
223+
* @return ?string
199224
*/
200225
public static function getHighlightsQuery(string $language): ?string
201226
{
@@ -219,6 +244,8 @@ public static function getHighlightsQuery(string $language): ?string
219244
* assert!(missing.is_none());
220245
* ```
221246
*
247+
* @param string $language
248+
* @return ?string
222249
*/
223250
public static function getInjectionsQuery(string $language): ?string
224251
{
@@ -242,6 +269,8 @@ public static function getInjectionsQuery(string $language): ?string
242269
* assert!(missing.is_none());
243270
* ```
244271
*
272+
* @param string $language
273+
* @return ?string
245274
*/
246275
public static function getLocalsQuery(string $language): ?string
247276
{
@@ -278,6 +307,10 @@ public static function getLocalsQuery(string $language): ?string
278307
* assert!(!matches.is_empty());
279308
* ```
280309
*
310+
* @param Tree $tree
311+
* @param string $language
312+
* @param string $query_source
313+
* @param string $source
281314
* @return array<QueryMatch>
282315
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
283316
*/
@@ -311,6 +344,8 @@ public static function runQuery(Tree $tree, string $language, string $query_sour
311344
* assert_eq!(tree.root_node().kind(), "module");
312345
* ```
313346
*
347+
* @param string $name
348+
* @return Language
314349
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
315350
*/
316351
public static function getLanguage(string $name): Language
@@ -339,6 +374,8 @@ public static function getLanguage(string $name): Language
339374
* assert!(!tree.root_node().has_error());
340375
* ```
341376
*
377+
* @param string $name
378+
* @return Parser
342379
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
343380
*/
344381
public static function getParser(string $name): Parser
@@ -386,6 +423,8 @@ public static function availableLanguages(): array
386423
* assert!(!has_language("nonexistent_language"));
387424
* ```
388425
*
426+
* @param string $name
427+
* @return bool
389428
*/
390429
public static function hasLanguage(string $name): bool
391430
{
@@ -407,6 +446,7 @@ public static function hasLanguage(string $name): bool
407446
* println!("{} languages available", count);
408447
* ```
409448
*
449+
* @return int
410450
*/
411451
public static function languageCount(): int
412452
{
@@ -436,6 +476,9 @@ public static function languageCount(): int
436476
* println!("Structures: {}", result.structure.len());
437477
* ```
438478
*
479+
* @param string $source
480+
* @param ProcessConfig $config
481+
* @return ProcessResult
439482
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
440483
*/
441484
public static function process(string $source, ProcessConfig $config): ProcessResult
@@ -471,6 +514,9 @@ public static function process(string $source, ProcessConfig $config): ProcessRe
471514
* let result = extract_patterns("def hello(): pass", &config).unwrap();
472515
* ```
473516
*
517+
* @param string $source
518+
* @param ExtractionConfig $config
519+
* @return ExtractionResult
474520
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
475521
*/
476522
public static function extractPatterns(string $source, ExtractionConfig $config): ExtractionResult
@@ -487,6 +533,8 @@ public static function extractPatterns(string $source, ExtractionConfig $config)
487533
*
488534
* Returns an error if the language cannot be loaded.
489535
*
536+
* @param ExtractionConfig $config
537+
* @return ValidationResult
490538
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
491539
*/
492540
public static function validateExtraction(ExtractionConfig $config): ValidationResult
@@ -518,6 +566,8 @@ public static function validateExtraction(ExtractionConfig $config): ValidationR
518566
* init(&config).unwrap();
519567
* ```
520568
*
569+
* @param PackConfig $config
570+
* @return void
521571
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
522572
*/
523573
public static function init(PackConfig $config): void
@@ -551,6 +601,8 @@ public static function init(PackConfig $config): void
551601
* configure(&config).unwrap();
552602
* ```
553603
*
604+
* @param PackConfig $config
605+
* @return void
554606
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
555607
*/
556608
public static function configure(PackConfig $config): void
@@ -579,6 +631,7 @@ public static function configure(PackConfig $config): void
579631
* ```
580632
*
581633
* @param array<string> $names
634+
* @return int
582635
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
583636
*/
584637
public static function download(array $names): int
@@ -604,6 +657,7 @@ public static function download(array $names): int
604657
* println!("Downloaded {} languages", count);
605658
* ```
606659
*
660+
* @return int
607661
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
608662
*/
609663
public static function downloadAll(): int
@@ -680,6 +734,7 @@ public static function downloadedLanguages(): array
680734
* println!("Cache cleared");
681735
* ```
682736
*
737+
* @return void
683738
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
684739
*/
685740
public static function cleanCache(): void
@@ -706,6 +761,7 @@ public static function cleanCache(): void
706761
* println!("Cache directory: {}", dir.display());
707762
* ```
708763
*
764+
* @return string
709765
* @throws \Tree\Sitter\Language\Pack\TreeSitterLanguagePackException
710766
*/
711767
public static function cacheDir(): string

packages/python/tree_sitter_language_pack/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is auto-generated by alef — DO NOT EDIT.
2-
# alef:hash:504b96d7798003da8ae795c751e53e44b9f3cae2d085fae078829563e944e02b
2+
# alef:hash:3862982424042d4ec0393b25954b4b44ead86f5956cb2b0b68ab90385114a17a
33
# To regenerate: alef generate
44
# To verify freshness: alef verify --exit-code
55
# Issues & docs: https://github.com/kreuzberg-dev/alef

0 commit comments

Comments
 (0)