Releases: iambumblehead/resolvewithplus
improve typescript resolution
this PR changes the location of isTypescript detection to occur in one place that is more widely used so that it can be engaged more frequently to improve typescript resolution.
- improve resolution of typescript moduleIds
detect typescript parent to apply typescript condtions
When the resolver detects a typescript parent it can apply typescript conditions to resolve the moduleId. New conditions can be added for typescript situations as needed, this new behaviour is a starting point,
- pin node 20.4 at unit-test pipeline, last version of node before import.meta.resolve was reduced
- add workspaces unit-tests
- add detection of ".ts" parent extension for applying typescript conditions
- use moduleId and parent as internal names, following nodejs
v2.0.2 use node v20 ci, increment dependencies
v2.0.2 use node v20 ci, increment dependencies
@mshima windows drive letter patch
resolve windows modules with correct drive letter using patch from @mshima
return encoded url same as import.meta.resolve
return encoded url same as import.meta.resolve ,
- this, 'file:///path/to/indexfile/file%20name%20with%20spaces.js'
- rather than, 'file:///path/to/indexfile/file name with spaces.js'
add test and changes to support import.meta.url parent
Add test and changes to support import.meta.url parent. While exploring changes at esmock, it was discovered that esmock slightly modifies import.meta.url from the callee before passing along when calling resolvewithplus,
resolvewithplus('../../index.js', import.meta.url)
reduce install size 1kB
minified resolvewithplus.js is 50% smaller and total install size becomes 5.78kB, from 6.79kB
return fileurl-formatted paths, eg file:///path/to/module.js
Returning fileurl-formatted paths allows esmock to be simplified, where esmock previously needed to detect and convert resolvewithplus paths to fileurl-formatted paths. Returning fileurl-formatted paths also makes resolvewithplus more interchangeable with import.meta.resolve, which also returns fileurl-formatted paths,
- return fileurl paths, following the behaviour of import.meta.resolve
- added tests around export sugar esm patterns
parse esm patterns from nodejs' documentation
completed esm pattern parsing (big improvement)
resolve "pg" package's cjs package.main
resolve "pg" package's cjs "main": "./lib"