Commit 215b260
authored
fix(deps): declare @babel/generator and @babel/traverse as dependencies (#9873)
## Summary
Fixes #9648. Follow-up to #9511.
The bundled Worklets Babel plugin keeps its Babel imports external
(`packages: 'external'` in `plugin/bundle.js`), so the published bundle
calls `require('@babel/generator')` and `require('@babel/traverse')` at
runtime. Neither package is declared in `dependencies`, so package
managers with an isolated layout (e.g. pnpm 11 with a global virtual
store) fail to load the plugin with:
Error: Cannot find module '@babel/generator'
This PR declares both packages as dependencies, the same way #9511 did
for `@babel/types`. Both ranges resolve to versions already present in
the dependency tree, so no new packages are pulled in.
## Test plan
Used the reproduction from #9648 (pnpm 11, `enableGlobalVirtualStore:
true`, `node repro.js` loading `react-native-worklets/plugin`):
- `react-native-worklets` packed from `main` without this change: fails
with `Cannot find module '@babel/generator'`
- packed with this change: `Plugin loaded successfully.`1 parent 729e634 commit 215b260
2 files changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
| 352 | + | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| |||
28890 | 28890 | | |
28891 | 28891 | | |
28892 | 28892 | | |
| 28893 | + | |
28893 | 28894 | | |
28894 | 28895 | | |
28895 | 28896 | | |
| |||
28899 | 28900 | | |
28900 | 28901 | | |
28901 | 28902 | | |
| 28903 | + | |
28902 | 28904 | | |
28903 | 28905 | | |
28904 | 28906 | | |
| |||
0 commit comments