Skip to content

Commit

Permalink
Also normalize GitHub URL's inside dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertkowalski authored and myrne committed Feb 11, 2014
1 parent 43e0a70 commit 005d0b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/fixer.js
Expand Up @@ -138,6 +138,11 @@ var fixer = module.exports = {
this.warn(format(nonStringDependency, d, JSON.stringify(r))) this.warn(format(nonStringDependency, d, JSON.stringify(r)))
delete data[deps][d] delete data[deps][d]
} }
// "/" is not allowed as packagename for publishing, but for git-urls
// normalize shorthand-urls
if (githubUserRepo(data[deps][d])) {
data[deps][d] = githubUserRepo(data[deps][d])
}
}, this) }, this)
}, this) }, this)
} }
Expand Down
7 changes: 7 additions & 0 deletions test/normalize.js
Expand Up @@ -196,6 +196,13 @@ tap.test("homepage field will set to github gist url if repository is a shorthan
t.end() t.end()
}) })


tap.test("treat isaacs/node-graceful-fs as github repo in dependencies", function(t) {
var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}}
normalize(d)
t.same(d.dependencies, {"node-graceful-fs": "git://github.com/isaacs/node-graceful-fs" })
t.end()
});

tap.test("deprecation warning for array in dependencies fields", function(t) { tap.test("deprecation warning for array in dependencies fields", function(t) {
var a var a
var warnings = [] var warnings = []
Expand Down

0 comments on commit 005d0b6

Please sign in to comment.