Skip to content

Conversation

@BobrImperator
Copy link

@BobrImperator BobrImperator commented Jan 17, 2026

  • Adds support for .gts and .gjs code
    They're Ember.js component authoring and templating format.

Summary by CodeRabbit

  • New Features

    • Glimmer JavaScript (.gjs) language support with bundled parser integration
    • Glimmer TypeScript (.gts and .gjs) language support with bundled parser integration
  • Tests

    • Added integration test harnesses validating parsing of Glimmer component snippets
  • Chores

    • Added two new language packages with install-time setup and a changeset for release

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 17, 2026

Warning

Rate limit exceeded

@BobrImperator has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 37653c6 and d18e8d9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .changeset/fair-lions-know.md
  • packages/glimmer-javascript/index.d.ts
  • packages/glimmer-javascript/index.js
  • packages/glimmer-javascript/nursery.js
  • packages/glimmer-javascript/package.json
  • packages/glimmer-javascript/postinstall.js
  • packages/glimmer-typescript/index.d.ts
  • packages/glimmer-typescript/index.js
  • packages/glimmer-typescript/nursery.js
  • packages/glimmer-typescript/package.json
  • packages/glimmer-typescript/postinstall.js
📝 Walkthrough

Walkthrough

Adds two new language packages: @ast-grep/lang-glimmer-javascript and @ast-grep/lang-glimmer-typescript. Each package includes TypeScript declarations, a CommonJS runtime that resolves a native parser library, nursery test harnesses, postinstall wiring, and package manifests.

Changes

Cohort / File(s) Summary
Glimmer JavaScript package
packages/glimmer-javascript/index.js, packages/glimmer-javascript/index.d.ts, packages/glimmer-javascript/nursery.js, packages/glimmer-javascript/package.json, packages/glimmer-javascript/postinstall.js
New package implementing Glimmer JS language binding: adds TypeScript declarations (LanguageRegistration + registration), runtime that lazily resolves a native parser (libraryPath) with fallbacks, exports extensions (["gjs"]), languageSymbol, and expandoChar, nursery tests exercising AST queries, postinstall hookup, and package manifest.
Glimmer TypeScript package
packages/glimmer-typescript/index.js, packages/glimmer-typescript/index.d.ts, packages/glimmer-typescript/nursery.js, packages/glimmer-typescript/package.json, packages/glimmer-typescript/postinstall.js
New package implementing Glimmer TypeScript binding: same shape as JS package but extensions includes ["gjs","gts"], adds TypeScript declarations, runtime parser resolution, nursery tests, postinstall hookup, and package manifest.
Changeset
.changeset/fair-lions-know.md
Adds changeset entry that bumps/introduces both packages and documents added file extensions (.gjs, .gts).

Sequence Diagram(s)

(Skipped — changes are package additions with localized runtime resolution and tests; no multi-component control flow requiring sequence diagrams.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ✨ Tsx #66: Adds new language packages with the same registration pattern and exported API surface (libraryPath, extensions, languageSymbol, expandoChar).
  • ✨ JavaScript #53: Adds language packages following identical TypeScript declaration and runtime export conventions.

Suggested reviewers

  • HerringtonDarkholme

Poem

🐰 New parsers hop into the fold,
gjs and gts in stories told,
native libs found, then shared with care,
templates hum in open air,
small paws tap tests to make it fair. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding support for Ember Glimmer language parser with .gjs and .gts file extensions, which aligns directly with all the changes in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@BobrImperator BobrImperator force-pushed the main branch 2 times, most recently from 0de3438 to 1e97ac4 Compare January 17, 2026 12:14
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@packages/glimmer-javascript/README.md`:
- Around line 16-24: The example uses an invalid identifier name
"glimmer-javascript"; rename the import to a valid identifier (e.g.,
glimmerJavascript), update the object key passed to registerDynamicLanguage to
use that identifier (registerDynamicLanguage({ glimmerJavascript })), and ensure
the parse() call uses the matching language string/identifier
(parse('glimmerJavascript', `your code`)) so the import, registration, and parse
invocation all reference the same valid identifier and string.

In `@packages/glimmer-typescript/index.js`:
- Around line 21-30: The extensions list in module.exports currently registers
both "gjs" and "gts", which overlaps with glimmer-javascript; update the
extensions property in the module.exports object so this package only registers
TypeScript files (change extensions to include only "gts") to avoid ambiguous
language resolution; ensure you only modify the extensions array (referenced as
the extensions property on the exported object) and leave libraryPath,
languageSymbol, and expandoChar unchanged.

In `@packages/glimmer-typescript/README.md`:
- Around line 16-24: The example uses an invalid identifier
"glimmer-typescript"; change the import to a valid identifier (e.g.,
glimmerTypescript) and pass it into registerDynamicLanguage under the original
string key "glimmer-typescript" (use registerDynamicLanguage({
'glimmer-typescript': glimmerTypescript })); also update the parse call sample
to include non-empty example code (e.g., parse('glimmer-typescript', `your code
here`)). Ensure the unique symbols to change are the import line (currently
referencing glimmer-typescript), the registerDynamicLanguage call, and the parse
invocation.
- Around line 10-12: Update the README install command to reference the correct
NPM package name: replace the string "@tree-sitter/cli" with "tree-sitter-cli"
so the command becomes "pnpm install tree-sitter-cli --save-dev"; look for the
install line containing "@tree-sitter/cli" in README.md and change that token
only.
🧹 Nitpick comments (2)
packages/glimmer-javascript/nursery.js (1)

14-17: Incorrect regex pattern in test fixture.

The regex /^d+.d+.d+$/ appears to intend matching semantic versions but is missing backslashes. d matches literal 'd' and . matches any character.

📝 Suggested fix
 function isLatestVersion() {
-  const stableRegex = /^d+.d+.d+$/;
+  const stableRegex = /^\\d+\\.\\d+\\.\\d+$/;
   return !stableRegex.test(VERSION);
 }

Note: Since this is test fixture code (not production logic), the incorrect regex doesn't affect actual functionality—just the realism of the test snippet.

packages/glimmer-typescript/nursery.js (1)

14-17: Same regex pattern issue as in glimmer-javascript.

The regex /^d+.d+.d+$/ is missing backslashes for digit and dot escapes. Same fix as suggested for the JavaScript version.

📝 Suggested fix
 function isLatestVersion(): boolean {
-  const stableRegex = /^d+.d+.d+$/;
+  const stableRegex = /^\\d+\\.\\d+\\.\\d+$/;
   return !stableRegex.test(VERSION);
 }

Comment on lines 16 to 24
```js
import glimmer-javascript from '@ast-grep/lang-glimmer-javascript'
import { registerDynamicLanguage, parse } from '@ast-grep/napi'

registerDynamicLanguage({ glimmer-javascript })

const sg = parse('glimmer-javascript', `your code`)
sg.root().kind()
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Invalid JavaScript identifier in usage example.

The identifier glimmer-javascript contains a hyphen, which is not valid JavaScript syntax. Hyphens are interpreted as the subtraction operator.

📝 Suggested fix
 ```js
-import glimmer-javascript from '@ast-grep/lang-glimmer-javascript'
+import glimmerJavascript from '@ast-grep/lang-glimmer-javascript'
 import { registerDynamicLanguage, parse } from '@ast-grep/napi'

-registerDynamicLanguage({ glimmer-javascript })
+registerDynamicLanguage({ glimmerJavascript })

-const sg = parse('glimmer-javascript', `your code`)
+const sg = parse('glimmerJavascript', `your code`)
 sg.root().kind()
 ```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```js
import glimmer-javascript from '@ast-grep/lang-glimmer-javascript'
import { registerDynamicLanguage, parse } from '@ast-grep/napi'
registerDynamicLanguage({ glimmer-javascript })
const sg = parse('glimmer-javascript', `your code`)
sg.root().kind()
```
🤖 Prompt for AI Agents
In `@packages/glimmer-javascript/README.md` around lines 16 - 24, The example uses
an invalid identifier name "glimmer-javascript"; rename the import to a valid
identifier (e.g., glimmerJavascript), update the object key passed to
registerDynamicLanguage to use that identifier (registerDynamicLanguage({
glimmerJavascript })), and ensure the parse() call uses the matching language
string/identifier (parse('glimmerJavascript', `your code`)) so the import,
registration, and parse invocation all reference the same valid identifier and
string.

Comment on lines 10 to 12
# install the tree-sitter-cli if no prebuild is available
pnpm install @tree-sitter/cli --save-dev
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Find and check the package.json in glimmer-typescript directory
find . -path "*/glimmer-typescript/package.json" -type f

Repository: ast-grep/langs

Length of output: 100


🏁 Script executed:

# Once we find package.json, let's check its contents related to tree-sitter
if [ -f "packages/glimmer-typescript/package.json" ]; then
  echo "=== package.json devDependencies ===" 
  cat packages/glimmer-typescript/package.json | jq '.devDependencies // empty'
fi

Repository: ast-grep/langs

Length of output: 205


🏁 Script executed:

# Check the README to confirm the reference mentioned in the review
if [ -f "packages/glimmer-typescript/README.md" ]; then
  echo "=== README.md lines 10-12 ==="
  sed -n '10,12p' packages/glimmer-typescript/README.md
  echo ""
  echo "=== Broader context around tree-sitter ==="
  grep -n "tree-sitter" packages/glimmer-typescript/README.md
fi

Repository: ast-grep/langs

Length of output: 341


🌐 Web query:

@tree-sitter/cli npm package registry

💡 Result:

There is no published scoped package named @tree-sitter/cli. The Tree-sitter CLI is published on npm as tree-sitter-cli (latest shown v0.25.0). Install with npm i tree-sitter-cli or use the GitHub releases/binary. [1][2]

Sources:

  • npm package page for tree-sitter-cli. [1]
  • tree-sitter project / CLI source on GitHub. [2]

🌐 Web query:

tree-sitter-cli npm package registry

💡 Result:

Summary for the npm package "tree-sitter-cli":

  • Package: tree-sitter-cli.
  • Latest published npm version (as shown on npm): 0.22.5. Install: npm install tree-sitter-cli (or npm i [email protected]). [1]
  • Repository / homepage: github.com/tree-sitter/tree-sitter (official Tree-sitter project). [1]
  • Install alternatives: cargo install tree-sitter-cli (Rust crate) or download prebuilt binaries from GitHub Releases. [2]
  • License: MIT. Common commands: tree-sitter generate, test, build, parse, etc.; docs on usage available in the Tree-sitter docs. [1][2]

Sources: npm package page for tree-sitter-cli [1]; official Tree-sitter docs (install/CLI usage) [2].


Update README.md line 11 to use correct package name tree-sitter-cli instead of @tree-sitter/cli.

The README references the non-existent scoped package @tree-sitter/cli, while package.json correctly uses tree-sitter-cli. The official Tree-sitter CLI package on NPM is published as tree-sitter-cli (unscoped).

Suggested fix for line 11:
- pnpm install `@tree-sitter/cli` --save-dev
+ pnpm install tree-sitter-cli --save-dev
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# install the tree-sitter-cli if no prebuild is available
pnpm install @tree-sitter/cli --save-dev
```
# install the tree-sitter-cli if no prebuild is available
pnpm install tree-sitter-cli --save-dev
🤖 Prompt for AI Agents
In `@packages/glimmer-typescript/README.md` around lines 10 - 12, Update the
README install command to reference the correct NPM package name: replace the
string "@tree-sitter/cli" with "tree-sitter-cli" so the command becomes "pnpm
install tree-sitter-cli --save-dev"; look for the install line containing
"@tree-sitter/cli" in README.md and change that token only.

Copy link
Member

@HerringtonDarkholme HerringtonDarkholme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add README and fix linting? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants