isomorphic-git / lightning-fs

A lean and fast 'fs' for the browser
MIT License
477 stars 47 forks source link

feat: add 'rename' function #1

Closed billiegoose closed 5 years ago

billiegoose commented 5 years ago

feat: add 'rename' function

BREAKING CHANGE: The IndexedDB database format changed - the primary key is now an inode number rather than a filepath string. Adding this layer of indirection make renaming files and directories fast. (Before, renaming a directory would have required recursively copying all the files to a new location.) Rather than bloat the code with a migration script, I recommend simply creating a fresh filesystem or blowing the old filesystem away with the wipe argument. Maybe you can load v2 and v3 at the same time, and recursively read from the v2 instance and write to the v3 instance? Database migrations are hard, and I apologize. But this should be the first and last backwards incompatible change to the database format.

BREAKING CHANGE: the stat function now returns mtimeMs rather than mtimeSeconds and mtimeNanoseconds to match what Node's stat function returns instead of catering to an implementation detail of isomorphic-git.

isomorphic-git-bot commented 5 years ago

:tada: This PR is included in version 3.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: