read-package-json
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -221,11 +221,8 @@ var fs = require('fs') | ||
glob('*.gyp', { cwd: dir }, function (er, files) { | ||
if (er) { | ||
return cb(er) | ||
} | ||
if (data.gypfile === false) { | ||
return cb(null, data) | ||
} | ||
gypfile_(file, data, files, cb) | ||
}) | ||
if (data.gypfile === false) { | ||
return cb(null, data) | ||
} | ||
glob('*.gyp', { cwd: dir }) | ||
.then(files => gypfile_(file, data, files, cb)) | ||
.catch(er => cb(er)) | ||
} | ||
@@ -250,20 +247,11 @@ | ||
} | ||
glob('server.js', { cwd: dir }, function (er, files) { | ||
if (er) { | ||
return cb(er) | ||
fs.access(path.join(dir, 'server.js'), (err) => { | ||
if (!err) { | ||
s.start = 'node server.js' | ||
data.scripts = s | ||
} | ||
serverjs_(file, data, files, cb) | ||
return cb(null, data) | ||
}) | ||
} | ||
function serverjs_ (file, data, files, cb) { | ||
if (!files.length) { | ||
return cb(null, data) | ||
} | ||
var s = data.scripts || {} | ||
s.start = 'node server.js' | ||
data.scripts = s | ||
return cb(null, data) | ||
} | ||
function authors (file, data, cb) { | ||
@@ -299,17 +287,16 @@ if (data.contributors) { | ||
var globOpts = { cwd: dir, nocase: true, mark: true } | ||
glob('{README,README.*}', globOpts, function (er, files) { | ||
if (er) { | ||
return cb(er) | ||
} | ||
// don't accept directories. | ||
files = files.filter(function (filtered) { | ||
return !filtered.match(/\/$/) | ||
glob('{README,README.*}', globOpts) | ||
.then(files => { | ||
// don't accept directories. | ||
files = files.filter(function (filtered) { | ||
return !filtered.match(/\/$/) | ||
}) | ||
if (!files.length) { | ||
return cb() | ||
} | ||
var fn = preferMarkdownReadme(files) | ||
var rm = path.resolve(dir, fn) | ||
return readme_(file, data, rm, cb) | ||
}) | ||
if (!files.length) { | ||
return cb() | ||
} | ||
var fn = preferMarkdownReadme(files) | ||
var rm = path.resolve(dir, fn) | ||
readme_(file, data, rm, cb) | ||
}) | ||
.catch(er => cb(er)) | ||
} | ||
@@ -352,11 +339,10 @@ | ||
cwd = path.resolve(path.dirname(file), cwd) | ||
glob('**/*.[0-9]', { cwd }, function (er, mansGlob) { | ||
if (er) { | ||
return cb(er) | ||
} | ||
data.man = mansGlob.map(man => | ||
path.relative(dirname, path.join(cwd, man)).split(path.sep).join('/') | ||
) | ||
return cb(null, data) | ||
}) | ||
glob('**/*.[0-9]', { cwd }) | ||
.then(mansGlob => { | ||
data.man = mansGlob.map(man => | ||
path.relative(dirname, path.join(cwd, man)).split(path.sep).join('/') | ||
) | ||
return cb(null, data) | ||
}) | ||
.catch(er => cb(er)) | ||
} | ||
@@ -373,8 +359,5 @@ | ||
m = path.resolve(path.dirname(file), m) | ||
glob('**', { cwd: m }, function (er, binsGlob) { | ||
if (er) { | ||
return cb(er) | ||
} | ||
bins_(file, data, binsGlob, cb) | ||
}) | ||
glob('**', { cwd: m }) | ||
.then(binsGlob => bins_(file, data, binsGlob, cb)) | ||
.catch(er => cb(er)) | ||
} | ||
@@ -381,0 +364,0 @@ |
{ | ||
"name": "read-package-json", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"author": "GitHub Inc.", | ||
@@ -26,3 +26,3 @@ "description": "The thing npm uses to read package.json files with semantics and defaults and validation", | ||
"dependencies": { | ||
"glob": "^8.0.1", | ||
"glob": "^9.3.0", | ||
"json-parse-even-better-errors": "^3.0.0", | ||
@@ -34,3 +34,3 @@ "normalize-package-data": "^5.0.0", | ||
"@npmcli/eslint-config": "^4.0.0", | ||
"@npmcli/template-oss": "4.5.1", | ||
"@npmcli/template-oss": "4.12.0", | ||
"tap": "^16.0.1" | ||
@@ -48,5 +48,5 @@ }, | ||
"branches": 68, | ||
"functions": 83, | ||
"lines": 76, | ||
"statements": 77, | ||
"functions": 74, | ||
"lines": 74, | ||
"statements": 74, | ||
"nyc-arg": [ | ||
@@ -59,4 +59,4 @@ "--exclude", | ||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", | ||
"version": "4.5.1" | ||
"version": "4.12.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20534
519
+ Addedglob@9.3.5(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@8.0.4(transitive)
+ Addedminipass@4.2.87.1.2(transitive)
+ Addedpath-scurry@1.11.1(transitive)
- Removedglob@8.1.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedminimatch@5.1.6(transitive)
- Removedonce@1.4.0(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedglob@^9.3.0