Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Also normalize GitHub URL's inside dependencies.

  • Loading branch information...
commit 005d0b637aec1895117fcb4e3b49185eebf9e240 1 parent 43e0a70
@robertkowalski robertkowalski authored meryn committed
Showing with 12 additions and 0 deletions.
  1. +5 −0 lib/fixer.js
  2. +7 −0 test/normalize.js
View
5 lib/fixer.js
@@ -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
7 test/normalize.js
@@ -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 = []
Please sign in to comment.
Something went wrong with that request. Please try again.