Commit 3614828
fix: bundle WASM dependency for Python formatting support (#426)
- Add @wasm-fmt/ruff_fmt as devDependency for build-time bundling
- Add static import hint in main.ts so ncc can detect the package
- Bundle WASM binary (ruff_fmt_bg.wasm) to dist for runtime usage
- Add Jest mock to prevent test failures with ESM-only package
This fixes the "Cannot find package '@wasm-fmt/ruff_fmt'" error that
occurred when gitstream-core 2.1.216+ tried to initialize Python formatting.
The solution works for both environments:
- GitHub Actions: WASM bundled by ncc, loaded via dynamic import
- Lambda: WASM loaded from node_modules via dynamic import
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent b04bf7e commit 3614828
File tree
7 files changed
+55
-10
lines changed- __mocks__/@wasm-fmt
- dist
- src
7 files changed
+55
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
0 commit comments