Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728#!/usr/bin/env bash# Build the deployable release directory. The native executable embeds the JS# and npm dependencies; the web SPA and Tree-sitter grammars remain data files.set -euo pipefail
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)cd "$ROOT"
bun run web:buildbun run build:native
rm -rf releasemkdir -p release/shardcp dist/shard release/shard/shardcp -R build release/shard/buildmkdir -p release/shard/tree-sitterfind node_modules/tree-sitter-wasms/out -maxdepth 1 -type f -name '*.wasm' -exec cp {} release/shard/tree-sitter/ \;# The web-tree-sitter RUNTIME wasm (emscripten glue) is distinct from the# tree-sitter-<lang>.wasm grammars above. Ship it beside the binary so# Parser.init()'s locateFile can read it on a host without node_modules;# otherwise a bun --compile binary's baked-in __dirname makes agents ENOENT.cp node_modules/web-tree-sitter/tree-sitter.wasm release/shard/tree-sitter/tree-sitter.wasm
# Keep release layout deterministic and make the artifact self-describing.printf '%s\n' "$(bun -e "console.log(require('./package.json').version)")" > release/shard/VERSION( cd release && tar -czf "shard-$(cat shard/VERSION)-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m).tar.gz" shard )echo "release written to release/"