Skip to content

Commit

Permalink
build: update bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Sep 2, 2024
1 parent 0c60811 commit 4dc0ef8
Show file tree
Hide file tree
Showing 35 changed files with 38,970 additions and 38,436 deletions.
10 changes: 5 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{json,toml,yml,gyp}]
indent_style = space
Expand All @@ -14,11 +11,11 @@ indent_size = 2
indent_style = space
indent_size = 2

[*.rs]
[*.{c,cc,h}]
indent_style = space
indent_size = 4

[*.{c,cc,h}]
[*.rs]
indent_style = space
indent_size = 4

Expand All @@ -37,3 +34,6 @@ indent_size = 8
[Makefile]
indent_style = tab
indent_size = 8

[parser.c]
indent_size = 2
13 changes: 11 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
/src/** linguist-vendored
/examples/* linguist-vendored
* text=auto eol=lf

src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated
54 changes: 40 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
name: Build/test
name: CI

on:
pull_request:
branches:
- "**"
push:
branches:
- "master"
branches: [master]
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp
pull_request:
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up the repo
uses: tree-sitter/setup-action/cli@v1
- name: Set up examples
run: |-
git clone https://github.com/github/codeql examples/codeql --single-branch --depth=1 --filter=blob:none
- name: Run tests
uses: tree-sitter/parser-test-action@v2
with:
test-rust: ${{runner.os == 'Linux'}}
- name: Parse examples
uses: tree-sitter/parse-action@v4
with:
node-version: 21
- run: npm install
- run: npm test
files: |
examples/**/*.ql
23 changes: 23 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish package

on:
push:
tags: ["*"]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
pypi:
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
45 changes: 37 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
/node_modules/
/yarn-error.log
/build
test.ql
.DS_Store
package-lock.json
target
Cargo.lock
# Rust artifacts
target/

# Node artifacts
build/
prebuilds/
node_modules/
*.tgz

# Swift artifacts
.build/
Package.resolved

# Go artifacts
_obj/

# Python artifacts
.venv/
dist/
*.egg-info
*.whl

# C artifacts
*.a
*.so
*.so.*
*.dylib
*.dll
*.pc

# Example dirs
/examples/*/

# Grammar volatiles
*.wasm
*.obj
*.o
5 changes: 0 additions & 5 deletions .npmignore

This file was deleted.

11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

89 changes: 89 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 11 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
[package]
name = "tree-sitter-ql"
description = "ql grammar for the tree-sitter parsing library"
description = "QL grammar for tree-sitter"
version = "0.23.0"
keywords = ["incremental", "parsing", "ql"]
authors = ["Sam Lanning <sam@samlanning.com>"]
license = "MIT"
keywords = ["incremental", "parsing", "tree-sitter", "ql"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-ql"
edition = "2018"
license = "MIT"
authors = ["Sam Lanning <sam@samlanning.com>"]
edition = "2021"
autoexamples = false

build = "bindings/rust/build.rs"
include = [
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
]
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]

[lib]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter-language = "0.1.0"
tree-sitter = "0.23.0"

[build-dependencies]
cc = "1.0"
cc = "1.1.15"

[dev-dependencies]
tree-sitter = "0.23"
30 changes: 16 additions & 14 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4dc0ef8

Please sign in to comment.