Permalink
Browse files

Also normalize GitHub URL's inside dependencies.

  • Loading branch information...
1 parent 43e0a70 commit 005d0b637aec1895117fcb4e3b49185eebf9e240 @robertkowalski robertkowalski committed with braveg1rl Feb 11, 2014
Showing with 12 additions and 0 deletions.
  1. +5 −0 lib/fixer.js
  2. +7 −0 test/normalize.js
View
@@ -138,6 +138,11 @@ var fixer = module.exports = {
this.warn(format(nonStringDependency, d, JSON.stringify(r)))
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)
}
View
@@ -196,6 +196,13 @@ tap.test("homepage field will set to github gist url if repository is a shorthan
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) {
var a
var warnings = []

0 comments on commit 005d0b6

Please sign in to comment.