Skip to content

Commit e9944e9

Browse files
authored
RC 1.2.0 (#180)
* Polish CHANGELOG * Do version bumps everywhere Except R, where usethis will handle it * More contributing tweaks * Accept `npm pkg fix` edits * Add `publish.yaml` CI * More contributing tweaks
1 parent 42e26b7 commit e9944e9

File tree

12 files changed

+87
-25
lines changed

12 files changed

+87
-25
lines changed

.github/workflows/publish.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
tags: ["*"]
6+
7+
permissions:
8+
contents: write
9+
id-token: write
10+
attestations: write
11+
12+
jobs:
13+
github:
14+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
15+
with:
16+
generate: false
17+
attestations: true
18+
abi-version: "14"
19+
npm:
20+
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
21+
secrets:
22+
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
23+
with:
24+
generate: false
25+
abi-version: "14"
26+
crates:
27+
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
28+
secrets:
29+
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
30+
with:
31+
generate: false
32+
abi-version: "14"

CHANGELOG.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,17 @@
22

33
## devel
44

5-
- `highlights.scm` now includes `!` as an `@operator`.
6-
7-
- `tags.scm` now tags function definitions with a string name as `@definition.function` (#147, @MichaelChirico).
8-
9-
- Binary exponents are now supported in hexadecimal constants (#159).
10-
11-
- `NULL` is now allowed as a function call argument name (#164).
5+
## 1.2.0
126

137
- Added `"open"` and `"close"` fields to single and double quoted `string`s (#139).
148

15-
- Removed an unnecessary `optional()` from `_parameter_with_default` (#161).
16-
179
- Fixed an issue related to closing brackets in raw strings (#162).
1810

19-
- Changed a number of internal files to match tree-sitter v0.24.7 recommendations (#169).
11+
- Binary exponents are now supported in hexadecimal constants (#159).
2012

21-
- `...` and `..1` are now supported in more places, such as `x$...` and `x@..1` (#148).
13+
- `NULL` is now allowed as a function call argument name (#164).
2214

23-
- `parenthesized_expression` has been simplified to better align with R's parser. Specifically, it now expects exactly 1 required `body` expression, rather than allowing zero or more optional expressions (#144).
15+
- `...` and `..1` are now supported in more places, such as `x$...` and `x@..1` (#148).
2416

2517
- `fn(a b)` is now correctly parsed as an error rather than as two sequential arguments (#140).
2618

@@ -30,8 +22,18 @@
3022

3123
- Newlines are now allowed after an `else` but before the `alternative` (#141).
3224

25+
- `parenthesized_expression` has been simplified to better align with R's parser. Specifically, it now expects exactly 1 required `body` expression, rather than allowing zero or more optional expressions (#144).
26+
27+
- `highlights.scm` now includes `!` as an `@operator`.
28+
29+
- `tags.scm` now tags function definitions with a string name as `@definition.function` (#147, @MichaelChirico).
30+
31+
- Removed an unnecessary `optional()` from `_parameter_with_default` (#161).
32+
3333
- The internal `_hex_literal` rule was simplified slightly (#138).
3434

35+
- Changed a number of internal files to match tree-sitter v0.24.7 recommendations (#169).
36+
3537
## 1.1.0
3638

3739
- Switched to using `tree-sitter-language` in the Rust bindings to remove a dependency on a specific `tree-sitter` crate version (#133).

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.13)
22

33
project(tree-sitter-r
4-
VERSION "1.1.0"
4+
VERSION "1.2.0"
55
DESCRIPTION "R grammar for tree-sitter"
66
HOMEPAGE_URL "https://github.com/r-lib/tree-sitter-r"
77
LANGUAGES C)

CONTRIBUTING.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@
44

55
Unlike some other tree-sitter grammars, the R grammar's release version is not tied to the tree-sitter version. Instead, we just use standard semantic versioning. We released 1.0.0 when we merged the longstanding `next` branch into `main`, and then we froze `main-old` for people to pin to if they are slow to update.
66

7+
## Flow
8+
9+
- Create an `rc/x-y-z` branch
10+
11+
- Update all binding versions to the new version
12+
13+
- Polish CHANGELOG
14+
15+
- Update CHANGELOG's `## devel` to the new version, go ahead and add a new `## devel` header
16+
17+
- Push and open a PR
18+
19+
- Follow the release procedure for R, as it is manual
20+
21+
- Merge the PR
22+
23+
- After merging, do NOT call `usethis::use_github_release()`. We are going to create our own git tag
24+
25+
- Create an push a git tag for the version, i.e. `git push origin tag vX.Y.Z` where the leading `v` does matter
26+
27+
- This will kick off `publish.yaml` for the GitHub Release, the npm package release, and the Rust crate release
28+
729
## R package
830

931
<https://cran.r-project.org/web/packages/treesitter.r/index.html>
@@ -14,6 +36,7 @@ The {treesitter.r} package is relatively simple. It just provides `language()` a
1436

1537
- Decide if you also need to release [{treesitter}](https://github.com/DavisVaughan/r-tree-sitter).
1638
- Ensure you `devtools::load_all()` twice to ensure that `bootstrap.R` runs and pulls updated files into `src/` and updates any ABI changes.
39+
- Update `NEWS.md` to mention the update and point to the changelog.
1740
- Run `devtools::check()` to ensure tests are still passing.
1841
- Run `devtools::release()` to do a standard R package release if all looks good.
1942
- Use the same version as the Rust crate and the npm package.
@@ -38,7 +61,7 @@ Davis is the main owner of the crate, but Kevin also has publish rights.
3861

3962
- `cargo publish --dry-run` will do a dry run before submitting
4063

41-
- `cargo publish` to actually release
64+
- The `publish.yaml` CI will actually run `cargo publish` for you. It runs <https://github.com/tree-sitter/workflows/blob/main/.github/workflows/package-crates.yml>. Note that we have a `CARGO_REGISTRY_TOKEN` token that expires after 1 year and may need to be refreshed.
4265

4366
## Npm package
4467

@@ -65,8 +88,8 @@ We use [nvm](https://github.com/nvm-sh/nvm) for npm version management. The npm
6588
6689
- `npm publish --dry-run` will do a dry run
6790
68-
- `npm publish` will actually publish
91+
- The `publish.yaml` CI will actually run `npm publish` for you. It runs <https://github.com/tree-sitter/workflows/blob/main/.github/workflows/package-npm.yml>. Note that we have a `NODE_AUTH_TOKEN` token that expires after 1 year and may need to be refreshed.
6992
70-
You may need to login to npm through the command line first, use `npm login` for that.
93+
- Note that this builds the WASM binary along with "prebuilds" for each platform, so it does more than just `npm publish`.
7194
7295
We publish as an [unscoped public package](https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages) because that seems to be what other tree-sitter grammars do as well.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tree-sitter-r"
33
description = "R grammar for tree-sitter"
4-
version = "1.1.0"
4+
version = "1.2.0"
55
license = "MIT"
66
readme = "README.md"
77
keywords = ["incremental", "parsing", "tree-sitter", "r"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ endif
44

55
LANGUAGE_NAME := tree-sitter-r
66
HOMEPAGE_URL := https://github.com/r-lib/tree-sitter-r
7-
VERSION := 1.1.0
7+
VERSION := 1.2.0
88

99
# repository
1010
SRC_DIR := src

bindings/r/NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# treesitter.r (development version)
22

3+
* Updated to [tree-sitter-r v1.2.0](https://github.com/r-lib/tree-sitter-r/blob/main/CHANGELOG.md) (#136).
4+
35
# treesitter.r 1.1.0
46

57
* Updated to [tree-sitter-r v1.1.0](https://github.com/r-lib/tree-sitter-r/blob/main/CHANGELOG.md) (#136).

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "tree-sitter-r",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "R grammar for tree-sitter",
5-
"repository": "https://github.com/r-lib/tree-sitter-r",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/r-lib/tree-sitter-r.git"
8+
},
69
"license": "MIT",
710
"author": {
811
"name": "Davis Vaughan",

0 commit comments

Comments
 (0)