@willbooster/tree-sitter-embedded-template 7.0.0 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Test](https://github.com/WillBooster/tree-sitter-embedded-template/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-embedded-template/actions/workflows/test.yml)
6
6
  [![Test rust](https://github.com/WillBooster/tree-sitter-embedded-template/actions/workflows/test-rust.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-embedded-template/actions/workflows/test-rust.yml)
7
7
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
8
- [![wbfy](https://img.shields.io/badge/wbfy-20.51.1-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
8
+ [![wbfy](https://img.shields.io/badge/wbfy-21.3.0-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
9
9
  [![crates.io](https://img.shields.io/crates/v/willbooster-tree-sitter-embedded-template.svg)](https://crates.io/crates/willbooster-tree-sitter-embedded-template)
10
10
 
11
11
  Embedded template grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
@@ -13,10 +13,11 @@ Embedded template grammar for [tree-sitter](https://github.com/tree-sitter/tree-
13
13
  to its authors and contributors. This is not an official release of that project.
14
14
 
15
15
  It parses templating languages such as ERB and EJS, in which scripting code is embedded in text with the delimiters
16
- `<%` and `%>`. This fork extends upstream's version 0.25.0 grammar with EJS output-tag whitespace slurping.
16
+ `<%` and `%>`. This fork extends upstream's version 0.25.0 grammar with EJS output-tag whitespace slurping,
17
+ trimming closers on comments, and the `=%>` closer on statements.
17
18
  It generates the parser with the
18
19
  [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter) generator. The parser loads only with that
19
- fork's runtime, version 15.0.0 or later in the 15.x series
20
+ fork's runtime, version 15.0.0 or later in the 15.x or 16.x series
20
21
  ([willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter),
21
22
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter)); upstream's runtime rejects it.
22
23
 
@@ -30,7 +31,7 @@ the trees that error recovery produces may change; such changes are released as
30
31
  ## Usage
31
32
 
32
33
  The npm package ships `tree-sitter-embedded_template.wasm` for
33
- [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 15.0.0 or later in the 15.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
34
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) version 15.0.0 or later in the 15.x or 16.x series, which runs in Node.js, Bun, browsers, and Cloudflare Workers.
34
35
  In Node.js and Bun, load the grammar from its path:
35
36
 
36
37
  ```js
@@ -78,10 +79,9 @@ In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-
78
79
  [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
79
80
  fuzzed with:
80
81
 
81
- ```toml
82
- [dependencies]
83
- tree-sitter = { package = "willbooster-tree-sitter", version = "15.0.0" }
84
- tree-sitter-embedded-template = { package = "willbooster-tree-sitter-embedded-template", version = "7" }
82
+ ```sh
83
+ cargo add willbooster-tree-sitter@16.0.0 --rename tree-sitter
84
+ cargo add willbooster-tree-sitter-embedded-template --rename tree-sitter-embedded-template
85
85
  ```
86
86
 
87
87
  ```rust
package/grammar.js CHANGED
@@ -28,7 +28,7 @@ module.exports = grammar({
28
28
  directive: $ => seq(
29
29
  choice('<%', '<%_', '<%|', '<%~'),
30
30
  optional($.code),
31
- choice('%>', '-%>', '_%>'),
31
+ choice('%>', '-%>', '=%>', '_%>'),
32
32
  ),
33
33
 
34
34
  output_directive: $ => seq(
@@ -40,7 +40,7 @@ module.exports = grammar({
40
40
  comment_directive: $ => seq(
41
41
  '<%#',
42
42
  optional(alias($.code, $.comment)),
43
- '%>',
43
+ choice('%>', '-%>', '=%>', '_%>'),
44
44
  ),
45
45
 
46
46
  graphql_directive: $ => seq(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-embedded-template",
3
- "version": "7.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "Embedded template (ERB, EJS) grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "embedded-template",
@@ -48,8 +48,8 @@
48
48
  "@types/bun": "1.4.4",
49
49
  "@vitest/browser-playwright": "5.0.5",
50
50
  "@willbooster/oxlint-config": "1.4.9",
51
- "@willbooster/wb": "22.32.3",
52
- "@willbooster/web-tree-sitter": "15.0.0",
51
+ "@willbooster/wb": "23.0.2",
52
+ "@willbooster/web-tree-sitter": "16.0.2",
53
53
  "conventional-changelog-conventionalcommits": "10.4.1",
54
54
  "lefthook": "2.2.2",
55
55
  "oxlint": "1.89.0",
@@ -57,10 +57,10 @@
57
57
  "playwright": "1.64.1",
58
58
  "semantic-release": "25.0.9",
59
59
  "vitest": "5.0.5",
60
- "wrangler": "4.151.1"
60
+ "wrangler": "4.152.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@willbooster/web-tree-sitter": "^15.0.0"
63
+ "@willbooster/web-tree-sitter": "^15.0.0 || ^16.0.0"
64
64
  },
65
65
  "peerDependenciesMeta": {
66
66
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -43,7 +43,7 @@
43
43
  }
44
44
  ],
45
45
  "metadata": {
46
- "version": "7.0.0",
46
+ "version": "8.0.1",
47
47
  "license": "MIT",
48
48
  "description": "Embedded template (ERB, EJS) grammar for tree-sitter",
49
49
  "authors": [