Skip to content

Commit 76921b8

Browse files
justin808claude
andcommitted
Add patch for rescript-json-combinators to generate .bs.js files
The @glennsl/rescript-json-combinators package ships without compiled .bs.js files and its bsconfig.json lacks package-specs configuration. This causes module resolution failures when Rspack tries to import these files. Add patch-package to apply a fix that: - Removes reference to non-existent examples directory - Adds package-specs for ES module output - Configures .bs.js suffix for compiled files This ensures yarn res:build compiles the dependency correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent fbc5781 commit 76921b8

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"homepage": "https://github.com/shakacode/react-webpack-rails-tutorial",
1919
"scripts": {
20+
"postinstall": "patch-package",
2021
"res:clean": "rescript clean",
2122
"res:format": "rescript format -all",
2223
"res:dev": "yarn res:clean && rescript build -w",
@@ -133,6 +134,8 @@
133134
"jest": "^29.5.0",
134135
"jest-environment-jsdom": "^30.2.0",
135136
"mini-css-extract-plugin": "^2.7.2",
137+
"patch-package": "^8.0.0",
138+
"postinstall-postinstall": "^2.1.0",
136139
"preload-webpack-plugin": "^3.0.0-alpha.1",
137140
"prettier": "^2.2.1",
138141
"prettier-eslint-cli": "^7.1.0",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/node_modules/@glennsl/rescript-json-combinators/bsconfig.json b/node_modules/@glennsl/rescript-json-combinators/bsconfig.json
2+
index 8cc8a16..70a588d 100644
3+
--- a/node_modules/@glennsl/rescript-json-combinators/bsconfig.json
4+
+++ b/node_modules/@glennsl/rescript-json-combinators/bsconfig.json
5+
@@ -2,9 +2,14 @@
6+
"name": "@glennsl/rescript-json-combinators",
7+
"namespace": "JsonCombinators",
8+
"sources": [
9+
- "src",
10+
- {
11+
- "dir": "examples",
12+
- "type": "dev"
13+
- }
14+
+ "src"
15+
+ ],
16+
+ "package-specs": [
17+
+ {
18+
+ "module": "esmodule",
19+
+ "in-source": true
20+
+ }
21+
+ ],
22+
+ "suffix": ".bs.js"
23+
}

0 commit comments

Comments
 (0)