Repository navigation
fix: resolve directory and extensionless client paths - #54
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
Note
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #54 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 83 89 +6
Branches 15 15
=========================================
+ Hits 83 89 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Follow-up to #53. Addresses both CodeRabbit comments on it.
require()resolved aclientPathlike/abs/node_modules/.prisma/clientor./generated/clientto its entry file.import()refuses directories (ERR_UNSUPPORTED_DIR_IMPORT). File paths now go throughrequire.resolve()first. If that fails, for example for a.tsfilerequire()can't handle, the path goes toimport()unchanged.client.tsnatively also needs"type": "module"in the nearestpackage.json. Otherwise Node loads it as CommonJS and itsimportstatements fail.Verification
distin plain Node: an absolute path to a CommonJS client directory (package.json+index.js, shaped like.prisma/client) loads, and a.tsclient still loads.