-
Notifications
You must be signed in to change notification settings - Fork 5
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: platformatic/vfs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: platformatic/vfs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 14 commits
- 11 files changed
- 5 contributors
Commits on Apr 20, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 39e21be - Browse repository at this point
Copy the full SHA 39e21beView commit details -
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Configuration menu - View commit details
-
Copy full SHA for 29797c3 - Browse repository at this point
Copy the full SHA 29797c3View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb34306 - Browse repository at this point
Copy the full SHA cb34306View commit details -
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Configuration menu - View commit details
-
Copy full SHA for 633891a - Browse repository at this point
Copy the full SHA 633891aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e66ae33 - Browse repository at this point
Copy the full SHA e66ae33View commit details -
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Configuration menu - View commit details
-
Copy full SHA for eb84963 - Browse repository at this point
Copy the full SHA eb84963View commit details -
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Configuration menu - View commit details
-
Copy full SHA for 36000c5 - Browse repository at this point
Copy the full SHA 36000c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2e3bd3 - Browse repository at this point
Copy the full SHA e2e3bd3View commit details -
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Configuration menu - View commit details
-
Copy full SHA for 160e9f8 - Browse repository at this point
Copy the full SHA 160e9f8View commit details -
fix: handle Windows backslash separators in isUnderMountPoint (#7)
isUnderMountPoint hardcoded / as the path separator, so Windows paths produced by path.normalize (which uses \) never matched their mount point. Check for both / and \ after the mount-point prefix, and handle roots that already end with a separator (e.g. C:\ or /).
Configuration menu - View commit details
-
Copy full SHA for 2a4ea7d - Browse repository at this point
Copy the full SHA 2a4ea7dView commit details -
fix: resolve multiple module resolution issues in VFS hooks (#9)
* fix: resolve multiple module resolution issues in VFS hooks This fixes several module resolution issues found when using VFS with real-world applications (e.g., mongoose, pino, got): 1. **Built-in module shadowing**: Bare specifiers like `require('buffer')` were resolved to userland polyfills in node_modules instead of Node.js built-ins. Added `isNodeBuiltin()` check before VFS resolution for both ESM and CJS hooks. 2. **File-before-directory resolution order**: When both `schema.js` and `schema/` directory exist, `require('./schema')` incorrectly resolved to `schema/index.js` instead of `schema.js`. Reordered to try file extensions before directory entry resolution, matching Node.js CJS resolution order. 3. **require.resolve() not intercepted**: `Module.registerHooks()` in Node.js 22 does not intercept `require.resolve()` calls. The `_resolveFilename` patch is now always installed alongside `registerHooks`, not as a mutually exclusive fallback. 4. **Trailing slash in specifiers**: `require('process/')` produced `packageSubpath: './'` which didn't match the `=== '.'` check, preventing entry point resolution. 5. **Main pointing to directory**: When `package.json` has `"main": "dist/source"` and that path is a directory, the resolver now tries `index.js` inside it (matching Node.js behavior). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: DRY module resolution helpers and add tests - Extract CJS_INDEX_FILES constant and tryCJSIndexFiles() helper to eliminate 4 duplicated inline index-file loops - Extract makeResolveResult() helper to replace ~15 repeated { url, format, shortCircuit } object constructions - Cache NodeModule reference and use Set for O(1) builtin lookups in isNodeBuiltin() instead of require() + indexOf on every call - Remove unnecessary bare block in resolveVFSPath - Document double-resolution trade-off when registerHooks and _resolveFilename coexist, and ESM vs CJS index file divergence - Add test/module_resolution.test.js covering all 5 fixes: built-in shadowing, file-before-directory, require.resolve(), trailing slash, and main-points-to-directory Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add wildcard exports, #imports, CJS exports field, and CJS subpath directory support - Wildcard pattern support in package.json exports (e.g. "./bindings/*") for both ESM and CJS resolution, per Node.js subpath patterns spec. - Package #imports (subpath imports) with wildcard and bare specifier re-resolution support via new resolveHashImport() function. - CJS exports field resolution with dedicated resolveCJSExportsPath, resolveCJSConditions, and resolveCJSPackageExports helpers. Exports field is now checked before main/index fallback in CJS resolution. - CJS subpath directory resolution: require('pkg/subdir') now checks subdir/package.json main and subdir/index.js when subpath is a dir. - Extracted matchWildcardPattern() shared helper to eliminate 3x duplicate wildcard matching logic. - Single package.json read in resolveCJSPackageInVFS (was reading twice). - Fixed dirname() -> dirnameVFS() bug in resolveBareSpecifier for correct Windows VFS path handling. - 16 new tests covering all new resolution features. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: unify ESM/CJS resolution helpers and fix bugs - Fix dirname() → dirnameVFS() in getVFSPackageType for Windows VFS paths - Fix resolveHashImport nested conditions (now properly recursive) - Fix .mjs/.cjs extensions leaking into CJS resolution (parameterized) - Add CJS #imports support in _resolveFilename patch - Fix double internalModuleStat calls via resolveMainField helper - Unify resolvePackageExports/resolveCJSPackageExports into resolveExportsToPath - Unify resolveConditionsWithPattern/resolveCJSConditions into resolveConditionsToPath - Extract expandPattern, findVFSForPath, resolveMainField shared helpers - Consistent use of joinVFSParts/dirnameVFS in ESM paths - Move isNodeBuiltin to utility section, remove redundant node: check Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>Configuration menu - View commit details
-
Copy full SHA for 3e576f7 - Browse repository at this point
Copy the full SHA 3e576f7View commit details -
fix: patch all async fs methods (callback + promises) for VFS interce…
…ption (#10) * fix: add fs.promises and fs.access/accessSync patches to module hooks The VFS module hooks only patched synchronous fs methods, leaving async operations (fs.promises.*, fs.access) unpatched. This caused ENOENT errors when application code used: - `await fs.promises.access(path)` (e.g., file existence checks) - `await fs.promises.readFile(path)` (e.g., loading templates) - `await fs.promises.stat(path)`, `lstat`, `readdir`, `readlink`, `realpath` - `fs.accessSync(path)` or `fs.access(path, callback)` Since `require('fs/promises')` returns the same object as `fs.promises`, patching directly on `fs.promises` covers both import patterns. Fixes: #8 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add callback fs.stat, fs.lstat, fs.readFile, and fs.createReadStream patches The VFS module hooks only patched sync and promise-based fs methods, leaving callback versions unpatched. This caused ENOENT errors when libraries like express.static (via send) use fs.stat(path, callback). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: add callback fs.readdir, fs.readlink, and fs.realpath patches Libraries like glob, graceful-fs, and enhanced-resolve use the callback forms of these methods. Without patches they bypass the VFS entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 02d2624 - Browse repository at this point
Copy the full SHA 02d2624View commit details -
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Configuration menu - View commit details
-
Copy full SHA for c1dd49d - Browse repository at this point
Copy the full SHA c1dd49dView commit details -
Signed-off-by: Matteo Collina <hello@matteocollina.com>
Configuration menu - View commit details
-
Copy full SHA for ea07b45 - Browse repository at this point
Copy the full SHA ea07b45View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.3.0...v0.4.0