Skip to content
Beskid Beskid

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Integrate Tree-sitter

The published package is @cyber-nomad-collective/beskid-tree-sitter. A consumer can keep the shorter @beskid/tree-sitter import through an npm alias.

Use Node.js 22 for the pinned package workflow. Complete the shared web package credential setup with read:packages access before installation.

Use pnpm as the normal package manager. The pinned Tree-sitter publication workflow uses Bun 1.3.0 and a Bun lockfile. Use Bun only to reproduce that pinned component workflow.

Version 0.1.3 is a component-specific exception to the superrepo @beskid/* version convention. It is the version in the pinned Tree-sitter package manifest.

BoundaryOwned source or output
Handwritten declarationsscripts/lib/declaration-rules.mjs
Handwritten expressions and conflictsscripts/lib/manual-grammar.mjs
Generated grammargrammar.js; generated output, so do not hand-edit it.
Generated parsersrc/parser.c and generated node metadata.
Corpus inputs and expected treestest/corpus/*.txt
Drift reportnode scripts/check-pest-drift.mjs
  1. Put "@beskid/tree-sitter": "npm:@cyber-nomad-collective/beskid-tree-sitter@^0.1.3" in the consumer dependency map.
  2. Run pnpm install in the consumer repository.
  3. Change scripts/lib/declaration-rules.mjs or scripts/lib/manual-grammar.mjs only when you own a grammar update.
  4. Run ./scripts/sync-from-pest.sh from beskid_treesitter/ after a grammar-source change.
  5. Run node scripts/check-pest-drift.mjs to check rule-name drift.
  6. Run bunx tree-sitter test to verify the generated parser against the corpus.

The consumer resolves the published package through the alias. For a grammar change, the sync updates generated outputs, the corpus tests pass, and the drift check reports no unreviewed rule-name difference.

If grammar.js differs without an owned handwritten rule change, regenerate it; do not patch it by hand. If corpus output changes, review the related handwritten rule source and each changed expected tree. Stop when the syntax authority and generated result disagree.

Use the VS Code project workflow to verify editor behavior that consumes Beskid language tooling.