Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
feat(fs): add directory support to fs ops
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Oct 25, 2018
1 parent 3bc6210 commit 2d7bec4
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 163 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ but now it's a package manager runtime!
* [x] add support for auth and .npmrc
* [x] implement fs.readdir* (needed for webpack)
* [x] use spawn-wrap to support child_process calls
* [ ] warn if installing a package that requires run-scripts
* [ ] warn if installing something that requires bin/man linking
* [ ] add support for removing package tarballs from cache
* [x] add directory support to fs ops
* [ ] add fallback where "incompatible" packages get dumped into node_modules (and tagged a such in `package-map.json`)
* [ ] add support for node-gyp build caching to make native packages compatible
* [ ] add support for bin/man linking
* [ ] warn if installing a package that requires run-scripts
* [ ] warn if installing something that requires bin/man linking
* [ ] benchmark wubwub?
* [ ] write tests for fs overrides
* [ ] optimize fs and module load operations (need to analyze)
10 changes: 9 additions & 1 deletion lib/ensure-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,15 @@ class CacacheUnpacker extends tar.Parse {
algorithms: ['sha256']
})
cacacheMemo.put.byDigest(this.cache, integrity, data)
this.metadata.files[entry.path] = integrity.toString()
entry.path.split(/[/\\]+/g).reduce((acc, next, i, sections) => {
if (next === '.') { return acc }
if (i === sections.length - 1) {
acc[next] = integrity.toString()
} else {
acc[next] = acc[next] || {}
}
return acc[next]
}, this.metadata.files)
this[UNPEND]()
} catch (err) {
this[ONERROR](err, entry)
Expand Down
Loading

0 comments on commit 2d7bec4

Please sign in to comment.