summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/fstream-npm/fstream-npm.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/fstream-npm/fstream-npm.js')
-rw-r--r--deps/npm/node_modules/fstream-npm/fstream-npm.js36
1 files changed, 34 insertions, 2 deletions
diff --git a/deps/npm/node_modules/fstream-npm/fstream-npm.js b/deps/npm/node_modules/fstream-npm/fstream-npm.js
index c3b93214dc..6214666427 100644
--- a/deps/npm/node_modules/fstream-npm/fstream-npm.js
+++ b/deps/npm/node_modules/fstream-npm/fstream-npm.js
@@ -78,6 +78,29 @@ Packer.prototype.readBundledLinks = function () {
list.forEach(function (pkg) {
if (pkg.charAt(0) === '.') return then()
var pd = this.path + '/node_modules/' + pkg
+
+ // scoped packages
+ if (pkg.charAt(0) === '@') {
+ fs.readdir(pd, function (er, slist) {
+ var sl = slist && slist.length
+ if (er || sl === 0) return then(er)
+
+ l += sl
+ slist.forEach(function (spkg) {
+ if (spkg.charAt(0) === '.') return then()
+ var spd = pd + '/' + spkg
+ fs.realpath(spd, function (er, rp) {
+ if (er) return then()
+ this.bundleLinks = this.bundleLinks || {}
+ this.bundleLinks[pkg + '/' + spkg] = rp
+ then()
+ }.bind(this))
+ }, this)
+ then()
+ }.bind(this))
+ return
+ }
+
fs.realpath(pd, function (er, rp) {
if (er) return then()
this.bundleLinks = this.bundleLinks || {}
@@ -127,7 +150,8 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) {
entry === '.npmrc' ||
entry.match(/^\..*\.swp$/) ||
entry === '.DS_Store' ||
- entry.match(/^\._/)
+ entry.match(/^\._/) ||
+ entry.match(/^.*\.orig$/)
) {
return false
}
@@ -141,8 +165,16 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) {
// linked with npm link, even in a bundle, deps are only bundled
// if they're not already present at a higher level.
if (this.bundleMagic) {
+ if (entry.charAt(0) === '@') {
+ var firstSlash = entry.indexOf('/')
+ // continue to list the packages in this scope
+ if (firstSlash === -1) return true
+
+ // bubbling up. stop here and allow anything the bundled pkg allows
+ if (entry.indexOf('/', firstSlash + 1) !== -1) return true
+ }
// bubbling up. stop here and allow anything the bundled pkg allows
- if (entry.indexOf('/') !== -1) return true
+ else if (entry.indexOf('/') !== -1) return true
// never include the .bin. It's typically full of platform-specific
// stuff like symlinks and .cmd files anyway.