@componentor/fs 3.0.49 → 3.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@componentor/fs",
3
- "version": "3.0.49",
3
+ "version": "3.0.51",
4
4
  "description": "High-performance OPFS-based Node.js fs polyfill with true sync API, VFS binary format, and bidirectional OPFS mirroring",
5
5
  "license": "MIT",
6
6
  "author": "Componentor",
package/readme.md CHANGED
@@ -604,6 +604,18 @@ Make sure `opfsSync` is enabled (it's `true` by default). Files are mirrored to
604
604
 
605
605
  See [CHANGELOG.md](./CHANGELOG.md) for the full version history.
606
606
 
607
+ ### v3.0.51 (2026)
608
+
609
+ **Fixes:**
610
+ - Fix O(N²) regression introduced in 3.0.49. The implicit-directory guard added then (`isImplicitDirectory(path)` in `write`, `symlink`, `link`, `copy`, plus several stat-side methods) called `rebuildImplicitDirs` — O(N×depth) over all pathIndex entries — on every invocation, and `pathIndexGen` was bumped on every mutation, so the cache was always invalid by the next call. Batch workloads (Vite optimize, pnpm install, Strapi unpacks of thousands of files) went quadratic. Measured on a 5000-file write benchmark: **3.0.48 baseline 26 ms → 3.0.50 1725 ms (66× slower) → 3.0.51 23 ms (back to baseline)**
611
+ - Replace the on-demand rebuild with an incrementally maintained `descCount` map. `isImplicitDirectory(P)` is now O(1): `!pathIndex.has(P) && descCount[P] > 0`. Maintenance is O(depth) per pathIndex mutation, behind two helpers (`setPathIndex`, `deletePathIndex`) that wrap the 12 mutation sites
612
+
613
+ ### v3.0.50 (2026)
614
+
615
+ **Fixes:**
616
+ - OPFS mirror no longer diverges from VFS state when the rename source is a directory. `renameInOPFS` previously hard-coded `getFileHandle`, which throws `TypeMismatchError` for directories — so the VFS rename fix in 3.0.49 (e.g. Vite's `deps_temp_<hash>` → `deps`) succeeded in-memory but the on-disk OPFS mirror silently warned-and-skipped, leaving the two diverged until the next full reconcile
617
+ - On `TypeMismatchError`/`NotFoundError`, falls through to a directory-aware path: recursively `removeEntry` the destination (matching the engine's "rm-then-rename" semantics), recreate as an empty dir, walk the source tree copying every file via two sync access handles in 2 MB chunks (peak memory bounded by `RENAME_CHUNK` regardless of subtree size), then `removeEntry` the source
618
+
607
619
  ### v3.0.49 (2026)
608
620
 
609
621
  **Fixes:**