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 8, 2024
1 parent 6fe714f commit e9c10a9
Show file tree
Hide file tree
Showing 46 changed files with 4,360 additions and 3,444 deletions.
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
root = true

[*]
charset = utf-8

[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

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

[*.rs]
indent_style = space
indent_size = 4

[*.{py,pyi}]
indent_style = space
indent_size = 4

[*.swift]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab
indent_size = 8

[Makefile]
indent_style = tab
indent_size = 8

[parser.c]
indent_size = 2
34 changes: 0 additions & 34 deletions .eslintrc.js

This file was deleted.

15 changes: 8 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/src/** linguist-vendored
/examples/* linguist-vendored
* text=auto eol=lf

src/grammar.json linguist-generated
src/node-types.json linguist-generated
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

src/grammar.json -diff
src/node-types.json -diff
src/parser.c -diff
bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated
38 changes: 4 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
uses: tree-sitter/parser-test-action@v2
with:
test-rust: ${{runner.os == 'Linux'}}
test-node: true
test-python: true
test-go: true
test-swift: ${{runner.os == 'macOS'}}
- name: Parse examples
uses: tree-sitter/parse-action@v4
with:
Expand Down Expand Up @@ -76,37 +80,3 @@ jobs:
examples/svelte/packages/svelte/tests/validator/samples/logic-block-in-attribute/input.svelte
examples/svelte/packages/svelte/tests/runtime-runes/samples/each-updates-6/main.svelte
examples/svelte/packages/svelte/tests/runtime-runes/samples/each-updates-7/main.svelte
fuzz:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for scanner changes
id: scanner-changes
run: |-
if git diff --quiet HEAD^ -- src/scanner.c; then
printf 'changed=false\n' >> "$GITHUB_OUTPUT"
else
printf 'changed=true\n' >> "$GITHUB_OUTPUT"
fi
- name: Fuzz parser
uses: tree-sitter/fuzz-action@v4
if: steps.scanner-changes.outputs.changed == 'true'

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run ESLint
run: npm run lint
3 changes: 3 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ jobs:
node-version: ${{vars.NODE_VERSION}}
- name: Update dependencies
uses: tree-sitter/[email protected]
with:
parent-name: html
language-name: svelte
21 changes: 21 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Fuzz Parser

on:
push:
branches: [master]
paths:
- src/scanner.c
- src/tag.h
pull_request:
paths:
- src/scanner.c
- src/tag.h

jobs:
fuzz:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run fuzzer
uses: tree-sitter/fuzz-action@v4
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
push:
branches: [master]
paths:
- grammar.js
pull_request:
paths:
- grammar.js

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Install modules
run: npm ci --legacy-peer-deps
- name: Run ESLint
run: npm run lint
41 changes: 36 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
.DS_Store
Cargo.lock
node_modules
build
/target/
# 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.

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.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tree-sitter-svelte"
name = "tree-sitter-svelte-ng"
description = "Svelte grammar for tree-sitter"
version = "0.0.1"
version = "1.0.0"
authors = ["Amaan Qureshi <[email protected]>"]
license = "MIT"
readme = "bindings/rust/README.md"
Expand All @@ -18,7 +18,10 @@ include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "~0.20.10"
tree-sitter-language = "0.1.0"

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

[dev-dependencies]
tree-sitter = "0.23"
Loading

0 comments on commit e9c10a9

Please sign in to comment.