Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deps] use resolve.isCore instead of is-builtin-module for better data/compat #99

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fixer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var semver = require("semver")
var validateLicense = require('validate-npm-package-license');
var hostedGitInfo = require("hosted-git-info")
var isBuiltinModule = require("is-builtin-module")
var isBuiltinModule = require("resolve").isCore
var depTypes = ["dependencies","devDependencies","optionalDependencies"]
var extractDescription = require("./extract_description")
var url = require("url")
Expand Down
30 changes: 14 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"hosted-git-info": "^2.1.4",
"is-builtin-module": "^1.0.0",
"resolve": "^1.10.0",
"semver": "2 || 3 || 4 || 5",
"validate-npm-package-license": "^3.0.1"
},
Expand Down
24 changes: 14 additions & 10 deletions test/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,26 @@ tap.test("core module name", function(t) {
function warn(m) {
warnings.push(m)
}
var coreModules = ["http", "_stream_writable"]
var a
normalize(a={
name: "http",
readme: "read yourself how about",
homepage: 123,
bugs: "what is this i don't even",
repository: "Hello."
}, warn)
var expect = []
for (var i = 0; i < coreModules.length; ++i) {
normalize(a={
name: coreModules[i],
readme: "read yourself how about",
homepage: 123,
bugs: "what is this i don't even",
repository: "Hello."
}, warn)

var expect = [
safeFormat(warningMessages.conflictingName, 'http'),
expect = expect.concat([
safeFormat(warningMessages.conflictingName, coreModules[i]),
warningMessages.nonEmailUrlBugsString,
warningMessages.emptyNormalizedBugs,
warningMessages.nonUrlHomepage,
warningMessages.missingLicense
]
])
}
t.same(warnings, expect)
t.end()
})
Expand Down