Skip to content

Commit f776b81

Browse files
dxh9845Daniel Herzig
andauthored
chore(docs): Add specific information about postinstall scripts for PNPM v10 (#98)
Co-authored-by: Daniel Herzig <[email protected]>
1 parent d9b463f commit f776b81

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ Packages contain a list of prebuild tree-sitter grammars to use with the `@ast-g
88

99
Typical usage:
1010

11-
1. Install the language package in your project
11+
1. Install the language package in your project.
12+
13+
> [!NOTE]
14+
> As of [PNPM version 10](https://socket.dev/blog/pnpm-10-0-0-blocks-lifecycle-scripts-by-default), postinstall scripts are no longer run by default. All language packages contain [postinstall](https://github.com/ast-grep/langs/blob/main/scripts/setup/index.ts#L20) 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.
1215
1316
```bash
17+
# PNPM <v10 - postinstall scripts run by default.
1418
pnpm install @ast-grep/lang-{name}
19+
# PNPM v10 and above: Explictly allow the postinstall script to run for this language package
20+
pnpm install --allow-build=@ast-grep/lang-{name} @ast-grep/lang-{name}
1521
pnpm install @ast-grep/napi
1622
# install the tree-sitter-cli if no prebuild is available
17-
pnpm install @tree-sitter/cli --save-dev
23+
pnpm install tree-sitter-cli --save-dev
1824
```
1925

2026
2. Use the language package in your project

0 commit comments

Comments
 (0)