Commit 484cc2b
committed
fix(docs): make shiki patch resilient to bundler param name changes
The dependency update in #490 caused the Turbopack bundler to rename the
externalImport function parameter from `id` to `id2`. The hardcoded regex
in patch-worker.mjs silently failed to match, leaving shiki modules
unresolvable at runtime on Cloudflare Workers (500 Internal Server Error).
- Use `(\w+)` capture group instead of literal `id` in the regex
- Dynamically reference the captured param name in the replacement
- Add validation that exits with error if the patch fails to match1 parent cdd47ed commit 484cc2b
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | | - | |
47 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
50 | 61 | | |
51 | 62 | | |
52 | 63 | | |
| |||
0 commit comments