Skip to content

Commit a6f8e0f

Browse files
committed
Merge branch 'master' into generate-without-tree-sitter-dep
2 parents ce351b3 + 9515be4 commit a6f8e0f

File tree

155 files changed

+13812
-5872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+13812
-5872
lines changed

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: tree-sitter
4+
patreon: # Replace with a single Patreon username
5+
open_collective: tree-sitter # Replace with a single Open Collective username
6+
ko_fi: amaanq
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/cliff.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ body = """
1616
{% for commit in commits%}\
1717
{% if not commit.scope %}\
1818
- {{ commit.message | upper_first }}\
19-
{% if commit.github.pr_number %} (<https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.github.pr_number }}>){%- endif %}
19+
{% if commit.remote.pr_number %} (<https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.remote.pr_number }}>){%- endif %}
2020
{% endif %}\
2121
{% endfor %}\
2222
{% for group, commits in commits | group_by(attribute="scope") %}\
2323
{% for commit in commits %}\
2424
- **{{commit.scope}}**: {{ commit.message | upper_first }}\
25-
{% if commit.github.pr_number %} (<https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.github.pr_number }}>){%- endif %}
25+
{% if commit.remote.pr_number %} (<https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ commit.remote.pr_number }}>){%- endif %}
2626
{% endfor %}\
2727
{% endfor %}
2828
{% endfor %}

.github/workflows/build.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ jobs:
3636
# When adding a new `target`:
3737
# 1. Define a new platform alias above
3838
# 2. Add a new record to the matrix map in `cli/npm/install.js`
39-
- { platform: linux-arm64 , target: aarch64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
40-
- { platform: linux-arm , target: arm-unknown-linux-gnueabi , os: ubuntu-latest , use-cross: true }
41-
- { platform: linux-x64 , target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 , features: wasm } # See #2272
42-
- { platform: linux-x86 , target: i686-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
43-
- { platform: linux-powerpc64 , target: powerpc64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
44-
- { platform: windows-arm64 , target: aarch64-pc-windows-msvc , os: windows-latest }
45-
- { platform: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest , features: wasm }
46-
- { platform: windows-x86 , target: i686-pc-windows-msvc , os: windows-latest }
47-
- { platform: macos-arm64 , target: aarch64-apple-darwin , os: macos-14 , features: wasm }
48-
- { platform: macos-x64 , target: x86_64-apple-darwin , os: macos-13 , features: wasm }
39+
- { platform: linux-arm64 , target: aarch64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
40+
- { platform: linux-arm , target: arm-unknown-linux-gnueabi , os: ubuntu-latest , use-cross: true }
41+
- { platform: linux-x64 , target: x86_64-unknown-linux-gnu , os: ubuntu-latest , features: wasm }
42+
- { platform: linux-x86 , target: i686-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
43+
- { platform: linux-powerpc64 , target: powerpc64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
44+
- { platform: windows-arm64 , target: aarch64-pc-windows-msvc , os: windows-latest }
45+
- { platform: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest , features: wasm }
46+
- { platform: windows-x86 , target: i686-pc-windows-msvc , os: windows-latest }
47+
- { platform: macos-arm64 , target: aarch64-apple-darwin , os: macos-latest , features: wasm }
48+
- { platform: macos-x64 , target: x86_64-apple-darwin , os: macos-13 , features: wasm }
4949

5050
# Cross compilers for C library
5151
- { platform: linux-arm64 , cc: aarch64-linux-gnu-gcc , ar: aarch64-linux-gnu-ar }
@@ -186,7 +186,14 @@ jobs:
186186
- name: Build wasm library
187187
# No reason to build on the same Github runner hosts many times
188188
if: ${{ !matrix.no-run && !matrix.use-cross }}
189-
run: $BUILD_CMD run -p xtask -- build-wasm
189+
shell: bash
190+
run: |
191+
cd lib/binding_web
192+
npm ci
193+
CJS=true npm run build
194+
CJS=true npm run build:debug
195+
npm run build
196+
npm run build:debug
190197
191198
- name: Build target
192199
run: $BUILD_CMD build --release --target=${{ matrix.target }} --features=${{ matrix.features }}
@@ -236,6 +243,16 @@ jobs:
236243
name: tree-sitter.wasm
237244
path: |
238245
lib/binding_web/tree-sitter.js
246+
lib/binding_web/tree-sitter.js.map
247+
lib/binding_web/tree-sitter.cjs
248+
lib/binding_web/tree-sitter.cjs.map
239249
lib/binding_web/tree-sitter.wasm
250+
lib/binding_web/tree-sitter.wasm.map
251+
lib/binding_web/debug/tree-sitter.cjs
252+
lib/binding_web/debug/tree-sitter.cjs.map
253+
lib/binding_web/debug/tree-sitter.js
254+
lib/binding_web/debug/tree-sitter.js.map
255+
lib/binding_web/debug/tree-sitter.wasm
256+
lib/binding_web/debug/tree-sitter.wasm.map
240257
if-no-files-found: error
241258
retention-days: 7

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040
components: clippy, rustfmt
4141

4242
- name: Lint files
43-
run: make lint
43+
run: |
44+
make lint
45+
make lint-web
4446
4547
sanitize:
4648
uses: ./.github/workflows/sanitize.yml

.github/workflows/release.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ jobs:
3535
run: |
3636
mkdir -p target
3737
mv artifacts/tree-sitter.wasm/* target/
38+
39+
# Rename files
40+
mv target/tree-sitter.js target/web-tree-sitter.js
41+
mv target/tree-sitter.js.map target/web-tree-sitter.js.map
42+
mv target/tree-sitter.cjs target/web-tree-sitter.cjs
43+
mv target/tree-sitter.cjs.map target/web-tree-sitter.cjs.map
44+
mv target/tree-sitter.wasm target/web-tree-sitter.wasm
45+
mv target/tree-sitter.wasm.map target/web-tree-sitter.wasm.map
46+
47+
mv target/debug/tree-sitter.js target/web-tree-sitter-debug.js
48+
mv target/debug/tree-sitter.js.map target/web-tree-sitter-debug.js.map
49+
mv target/debug/tree-sitter.cjs target/web-tree-sitter-debug.cjs
50+
mv target/debug/tree-sitter.cjs.map target/web-tree-sitter-debug.cjs.map
51+
mv target/debug/tree-sitter.wasm target/web-tree-sitter-debug.wasm
52+
mv target/debug/tree-sitter.wasm.map target/web-tree-sitter-debug.wasm.map
53+
rm -rf target/debug
54+
3855
rm -r artifacts/tree-sitter.wasm
3956
for platform in $(cd artifacts; ls | sed 's/^tree-sitter\.//'); do
4057
exe=$(ls artifacts/tree-sitter.$platform/tree-sitter*)
@@ -45,10 +62,20 @@ jobs:
4562
4663
- name: Create release
4764
run: |-
48-
gh release create \
65+
gh release create ${{ github.ref_name }} \
4966
target/tree-sitter-*.gz \
50-
target/tree-sitter.wasm \
51-
target/tree-sitter.js
67+
target/web-tree-sitter.js \
68+
target/web-tree-sitter.js.map \
69+
target/web-tree-sitter.cjs \
70+
target/web-tree-sitter.cjs.map \
71+
target/web-tree-sitter.wasm \
72+
target/web-tree-sitter.wasm.map \
73+
target/web-tree-sitter-debug.js \
74+
target/web-tree-sitter-debug.js.map \
75+
target/web-tree-sitter-debug.cjs \
76+
target/web-tree-sitter-debug.cjs.map \
77+
target/web-tree-sitter-debug.wasm \
78+
target/web-tree-sitter-debug.wasm.map
5279
env:
5380
GH_TOKEN: ${{ github.token }}
5481

@@ -91,7 +118,13 @@ jobs:
91118

92119
- name: Build wasm
93120
if: matrix.directory == 'lib/binding_web'
94-
run: cargo xtask build-wasm
121+
run: |
122+
cd ${{ matrix.directory }}
123+
npm ci
124+
npm run build
125+
npm run build:debug
126+
CJS=true npm run build
127+
CJS=true npm run build:debug
95128
96129
- name: Publish to npmjs.com
97130
working-directory: ${{ matrix.directory }}

.github/workflows/wasm_exports.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,9 @@ jobs:
3232
env:
3333
CFLAGS: -g -Werror -Wall -Wextra -Wshadow -Wpedantic -Werror=incompatible-pointer-types
3434

35+
- name: Build WASM Library
36+
working-directory: lib/binding_web
37+
run: npm ci && npm run build:debug
38+
3539
- name: Check WASM exports
3640
run: cargo xtask check-wasm-exports

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ test/fuzz/out
1212
test/fixtures/grammars/*
1313
!test/fixtures/grammars/.gitkeep
1414

15-
package-lock.json
1615
node_modules
1716

1817
docs/assets/js/tree-sitter.js

0 commit comments

Comments
 (0)