Skip to content
Permalink

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
Choose a base ref
...
head repository: platformatic/vfs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.0
Choose a head ref
  • 14 commits
  • 11 files changed
  • 5 contributors

Commits on Apr 20, 2026

  1. Configuration menu
    Copy the full SHA
    39e21be View commit details
    Browse the repository at this point in the history
  2. chore: Bumped v0.3.1.

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    29797c3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cb34306 View commit details
    Browse the repository at this point in the history
  4. chore: Bumped v0.3.2.

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    633891a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e66ae33 View commit details
    Browse the repository at this point in the history
  6. chore: Bumped v0.3.3-alpha.0.

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    eb84963 View commit details
    Browse the repository at this point in the history
  7. chore: Bumped v0.3.3.

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    36000c5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e2e3bd3 View commit details
    Browse the repository at this point in the history
  9. chore: Bumped v0.3.4.

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    160e9f8 View commit details
    Browse the repository at this point in the history
  10. 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 /).
    collinstevens authored Apr 20, 2026
    Configuration menu
    Copy the full SHA
    2a4ea7d View commit details
    Browse the repository at this point in the history
  11. 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>
    robertsLando and claude authored Apr 20, 2026
    Configuration menu
    Copy the full SHA
    3e576f7 View commit details
    Browse the repository at this point in the history
  12. 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>
    robertsLando and claude authored Apr 20, 2026
    Configuration menu
    Copy the full SHA
    02d2624 View commit details
    Browse the repository at this point in the history
  13. add renovate.json

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    c1dd49d View commit details
    Browse the repository at this point in the history
  14. chore: Bumped v0.4.0.

    Signed-off-by: Matteo Collina <hello@matteocollina.com>
    mcollina committed Apr 20, 2026
    Configuration menu
    Copy the full SHA
    ea07b45 View commit details
    Browse the repository at this point in the history
Loading