Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

Commit

Permalink
0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 4, 2012
1 parent 88da564 commit 5cbf31f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions fstream-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ function Packer (props) {
this.bundleLinks = props.bundleLinks
this.package = props.package

// only do the magic bundling stuff for the node_modules folder that
// lives right next to a package.json file.
this.bundleMagic = this.parent &&
this.parent.packageRoot &&
this.basename === "node_modules"

// in a node_modules folder, resolve symbolic links to
// bundled dependencies when creating the package.
props.follow = this.follow = this.basename === "node_modules"
props.follow = this.follow = this.bundleMagic
// console.error("follow?", this.path, props.follow)

if (this === this.root ||
this.parent &&
this.parent.basename === "node_modules" &&
this.parent.bundleMagic &&
this.basename.charAt(0) !== ".") {
this.readBundledLinks()
}
Expand Down Expand Up @@ -85,7 +91,7 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) {
if (entry === "package.json") return true

// special rules. see below.
if (entry === "node_modules") return true
if (entry === "node_modules" && this.packageRoot) return true

// some files are *never* allowed under any circumstances
if (entry === ".git" ||
Expand All @@ -110,7 +116,7 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) {
// To prevent infinite cycles in the case of cyclic deps that are
// linked with npm link, even in a bundle, deps are only bundled
// if they're not already present at a higher level.
if (this.basename === "node_modules") {
if (this.bundleMagic) {
// bubbling up. stop here and allow anything the bundled pkg allows
if (entry.indexOf("/") !== -1) return true

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "fstream-npm",
"description": "fstream class for creating npm packages",
"version": "0.0.6",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream-npm.git"
Expand Down

0 comments on commit 5cbf31f

Please sign in to comment.