Skip to content

Conversation

dxh9845
Copy link
Contributor

@dxh9845 dxh9845 commented Jul 26, 2025

Context

As of PNPM version 10, postinstall scripts are no longer run by default. All language packages contain postinstall scripts that will place the relevant language parsing library in the correct location for the targeted platform. You must explicitly allowlist the postinstall script to run for your desired language package.

For each language package installed, you can run pnpm --allow-build=@ast-grep/lang-{lang} add @ast-grep/lang-{lang} (eg, for the yaml package: pnpm --allow-build=@ast-grep/lang-yaml add @ast-grep/lang-yaml). If you forget this step, you can approve the build interactively by pnpm approve-builds and pnpm rebuild to force the post-install script to run.

Changes

  • Adds documentation for pnpm v10 commands for language packages
  • Fixes incorrect package name for tree-sitter-cli

Summary by CodeRabbit

  • Documentation
    • Updated installation instructions to clarify PNPM v10 behavior changes regarding postinstall scripts.
    • Provided separate example commands for PNPM versions before and after v10.
    • Corrected the package name for installing the tree-sitter CLI.
    • Improved clarity with minor punctuation adjustments.

Copy link

coderabbitai bot commented Jul 26, 2025

Walkthrough

The README has been updated to clarify installation instructions for language packages, specifically addressing changes in PNPM v10 regarding postinstall scripts. The guide now explains the need to allowlist postinstall scripts in PNPM v10+, corrects the tree-sitter CLI package name, and adds minor punctuation for clarity.

Changes

File(s) Change Summary
README.md Updated installation instructions for PNPM v10+ postinstall script behavior, corrected CLI name, and clarified steps with punctuation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • HerringtonDarkholme

Poem

In README fields where guidance grows,
New PNPM rules the rabbit knows.
Allowlist scripts, let parsing flow,
Tree-sitter’s name, now set to go!
With clearer steps and dots in tow,
The burrow’s build will surely glow.
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (1)
README.md (1)

20-20: Typo: “Explictly” → “Explicitly”

-# PNPM v10 and above: Explictly allow the postinstall script to run for this language package
+# PNPM v10 and above: Explicitly allow the postinstall script to run for this language package
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9b463f and 7ffc6c0.

📒 Files selected for processing (1)
  • README.md (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: HerringtonDarkholme
PR: ast-grep/langs#73
File: packages/yaml/package.json:13-20
Timestamp: 2025-04-22T18:00:42.287Z
Learning: In ast-grep language packages, type.d.ts is a generated file that should be included in the package.json files array even though it's not directly committed to the repository.
Learnt from: pelikhan
PR: ast-grep/langs#38
File: packages/python/package.json:22-22
Timestamp: 2025-03-27T03:50:42.436Z
Learning: Most packages in the ast-grep/langs repository use an empty author field in package.json files. Don't assume authorship information without clear evidence from the repository.
README.md (6)

Learnt from: HerringtonDarkholme
PR: #73
File: packages/yaml/package.json:13-20
Timestamp: 2025-04-22T18:00:42.287Z
Learning: In ast-grep language packages, type.d.ts is a generated file that should be included in the package.json files array even though it's not directly committed to the repository.

Learnt from: HerringtonDarkholme
PR: #65
File: packages/typescript/index.js:6-6
Timestamp: 2025-04-10T19:47:06.210Z
Learning: In ast-grep, TypeScript and TSX are treated as two separate languages, each with their own language package, rather than TypeScript supporting both .ts and .tsx extensions in a single package.

Learnt from: HerringtonDarkholme
PR: #74
File: packages/all/src/langs.test.ts:0-0
Timestamp: 2025-04-25T19:31:36.345Z
Learning: The @ast-grep/all-langs package uses ESM modules (has "type": "module" in package.json). In ESM, file extensions should be included in imports and should consistently use .js extensions (not .ts) since TypeScript transpiles to JavaScript.

Learnt from: HerringtonDarkholme
PR: #43
File: packages/go/nursery.js:10-17
Timestamp: 2025-04-01T18:31:28.544Z
Learning: For ast-grep/lang packages, minimal test coverage that verifies basic functionality (like a simple function declaration test for Go) is considered sufficient, and extensive test coverage of language constructs is not required.

Learnt from: pelikhan
PR: #38
File: packages/python/package.json:22-22
Timestamp: 2025-03-27T03:50:42.436Z
Learning: Most packages in the ast-grep/langs repository use an empty author field in package.json files. Don't assume authorship information without clear evidence from the repository.

Learnt from: HerringtonDarkholme
PR: #65
File: packages/typescript/package.json:17-17
Timestamp: 2025-04-10T19:46:48.394Z
Learning: In the ast-grep/langs repository, type.d.ts files are generated at build time and are intentionally ignored in git version control.

🔇 Additional comments (1)
README.md (1)

17-21: No change needed: --allow-build is the correct PNPM v10 flag

In PNPM v10 lifecycle scripts are blocked by default, and the --allow-build flag is used to opt specific packages in for their postinstall scripts. The suggested --allow-scripts flag does not exist in PNPM v10, so the example in README.md is already accurate.

Citations:
https://socket.dev/blog/pnpm-10-0-0-blocks-lifecycle-scripts-by-default
https://newreleases.io/project/github/pnpm/pnpm/release/v10.4.0

Likely an incorrect or invalid review comment.

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.

thanks

@HerringtonDarkholme HerringtonDarkholme merged commit f776b81 into ast-grep:main Jul 26, 2025
3 checks passed
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