@npmcli/git
Advanced tools
Comparing version 2.1.0 to 3.0.0
@@ -18,3 +18,3 @@ // The goal here is to minimize both git workload and | ||
'bitbucket.com', | ||
'bitbucket.org' | ||
'bitbucket.org', | ||
]) | ||
@@ -117,6 +117,10 @@ // we have to use url.parse until we add the same shim that hosted-git-info has | ||
target, | ||
'--recurse-submodules' | ||
'--recurse-submodules', | ||
] | ||
if (maybeShallow(repo, opts)) { args.push('--depth=1') } | ||
if (isWindows(opts)) { args.push('--config', 'core.longpaths=true') } | ||
if (maybeShallow(repo, opts)) { | ||
args.push('--depth=1') | ||
} | ||
if (isWindows(opts)) { | ||
args.push('--config', 'core.longpaths=true') | ||
} | ||
return spawn(args, opts).then(() => revDoc.sha) | ||
@@ -131,6 +135,10 @@ } | ||
target, | ||
'--recurse-submodules' | ||
'--recurse-submodules', | ||
] | ||
if (maybeShallow(repo, opts)) { args.push('--depth=1') } | ||
if (isWindows(opts)) { args.push('--config', 'core.longpaths=true') } | ||
if (maybeShallow(repo, opts)) { | ||
args.push('--depth=1') | ||
} | ||
if (isWindows(opts)) { | ||
args.push('--config', 'core.longpaths=true') | ||
} | ||
return spawn(args, opts).then(() => revDoc.sha) | ||
@@ -149,3 +157,3 @@ } | ||
'--init', | ||
'--recursive' | ||
'--recursive', | ||
], { ...opts, cwd: target })) | ||
@@ -152,0 +160,0 @@ })) |
@@ -35,3 +35,3 @@ | ||
GitPathspecError, | ||
GitUnknownError | ||
GitUnknownError, | ||
} |
@@ -8,3 +8,3 @@ module.exports = { | ||
isClean: require('./is-clean.js'), | ||
errors: require('./errors.js') | ||
errors: require('./errors.js'), | ||
} |
@@ -10,3 +10,3 @@ // turn an array of lines from `git ls-remote` into a thing | ||
refs: {}, | ||
shas: {} | ||
shas: {}, | ||
})) | ||
@@ -56,3 +56,5 @@ | ||
revs['dist-tags'].HEAD = v | ||
if (!revs.refs.latest) { revs['dist-tags'].latest = v } | ||
if (!revs.refs.latest) { | ||
revs['dist-tags'].latest = v | ||
} | ||
} | ||
@@ -84,3 +86,5 @@ }) | ||
const split = line.trim().split(/\s+/, 2) | ||
if (split.length < 2) { return null } | ||
if (split.length < 2) { | ||
return null | ||
} | ||
@@ -128,3 +132,5 @@ const sha = split[0].trim() | ||
if (!doc) { return revs } | ||
if (!doc) { | ||
return revs | ||
} | ||
@@ -131,0 +137,0 @@ revs.refs[doc.ref] = doc |
const { | ||
GitConnectionError, | ||
GitPathspecError, | ||
GitUnknownError | ||
GitUnknownError, | ||
} = require('./errors.js') | ||
@@ -15,3 +15,3 @@ | ||
'SSL_ERROR_SYSCALL', | ||
'The requested URL returned error: 503' | ||
'The requested URL returned error: 503', | ||
].join('|')) | ||
@@ -18,0 +18,0 @@ |
@@ -5,3 +5,3 @@ // Values we want to set if they're not already defined by the end user | ||
GIT_ASKPASS: 'echo', | ||
GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new' | ||
GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new', | ||
} | ||
@@ -12,3 +12,3 @@ module.exports = (opts = {}) => ({ | ||
shell: false, | ||
env: opts.env || { ...gitEnv, ...process.env } | ||
env: opts.env || { ...gitEnv, ...process.env }, | ||
}) |
@@ -7,3 +7,3 @@ const pinflight = require('promise-inflight') | ||
max: 100, | ||
maxAge: 5 * 60 * 1000 | ||
ttl: 5 * 60 * 1000, | ||
}) | ||
@@ -10,0 +10,0 @@ |
const spawn = require('@npmcli/promise-spawn') | ||
const promiseRetry = require('promise-retry') | ||
const log = require('proc-log') | ||
const makeError = require('./make-error.js') | ||
const whichGit = require('./which.js') | ||
const makeOpts = require('./opts.js') | ||
const procLog = require('./proc-log.js') | ||
@@ -11,3 +11,5 @@ module.exports = (gitArgs, opts = {}) => { | ||
if (gitPath instanceof Error) { return Promise.reject(gitPath) } | ||
if (gitPath instanceof Error) { | ||
return Promise.reject(gitPath) | ||
} | ||
@@ -19,3 +21,2 @@ // undocumented option, mostly only here for tests | ||
const log = opts.log || procLog | ||
let retry = opts.retry | ||
@@ -27,3 +28,3 @@ if (retry === null || retry === undefined) { | ||
maxTimeout: opts.fetchRetryMaxtimeout || 60000, | ||
minTimeout: opts.fetchRetryMintimeout || 1000 | ||
minTimeout: opts.fetchRetryMintimeout || 1000, | ||
} | ||
@@ -30,0 +31,0 @@ } |
{ | ||
"name": "@npmcli/git", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"main": "lib/index.js", | ||
"files": [ | ||
"lib/*.js" | ||
"bin", | ||
"lib" | ||
], | ||
@@ -13,6 +14,6 @@ "description": "a util for spawning git from npm CLI contexts", | ||
}, | ||
"author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", | ||
"author": "GitHub Inc.", | ||
"license": "ISC", | ||
"scripts": { | ||
"lint": "standard", | ||
"lint": "eslint '**/*.js'", | ||
"lint:fix": "standard --fix", | ||
@@ -24,3 +25,6 @@ "postversion": "npm publish", | ||
"test": "tap", | ||
"posttest": "npm run lint" | ||
"posttest": "npm run lint", | ||
"postlint": "npm-template-check", | ||
"template-copy": "npm-template-copy --force", | ||
"lintfix": "npm run lint -- --fix" | ||
}, | ||
@@ -32,11 +36,13 @@ "tap": { | ||
"devDependencies": { | ||
"@npmcli/template-oss": "^2.7.1", | ||
"slash": "^3.0.0", | ||
"standard": "^16.0.3", | ||
"tap": "^15.0.6" | ||
"tap": "^15.1.6" | ||
}, | ||
"dependencies": { | ||
"@npmcli/promise-spawn": "^1.3.2", | ||
"lru-cache": "^6.0.0", | ||
"lru-cache": "^7.3.1", | ||
"mkdirp": "^1.0.4", | ||
"npm-pick-manifest": "^6.1.1", | ||
"npm-pick-manifest": "^7.0.0", | ||
"proc-log": "^2.0.0", | ||
"promise-inflight": "^1.0.1", | ||
@@ -46,3 +52,10 @@ "promise-retry": "^2.0.1", | ||
"which": "^2.0.2" | ||
}, | ||
"engines": { | ||
"node": "^12.13.0 || ^14.15.0 || >=16" | ||
}, | ||
"templateOSS": { | ||
"windowsCI": false, | ||
"version": "2.7.1" | ||
} | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
21640
9
4
16
467
+ Addedproc-log@^2.0.0
+ Addedbuiltins@5.1.0(transitive)
+ Addedhosted-git-info@5.2.1(transitive)
+ Addedlru-cache@7.18.3(transitive)
+ Addednpm-install-checks@5.0.0(transitive)
+ Addednpm-normalize-package-bin@2.0.0(transitive)
+ Addednpm-package-arg@9.1.2(transitive)
+ Addednpm-pick-manifest@7.0.2(transitive)
+ Addedproc-log@2.0.1(transitive)
+ Addedvalidate-npm-package-name@4.0.0(transitive)
- Removedbuiltins@1.0.3(transitive)
- Removedhosted-git-info@4.1.0(transitive)
- Removedlru-cache@6.0.0(transitive)
- Removednpm-install-checks@4.0.0(transitive)
- Removednpm-normalize-package-bin@1.0.1(transitive)
- Removednpm-package-arg@8.1.5(transitive)
- Removednpm-pick-manifest@6.1.1(transitive)
- Removedvalidate-npm-package-name@3.0.0(transitive)
- Removedyallist@4.0.0(transitive)
Updatedlru-cache@^7.3.1
Updatednpm-pick-manifest@^7.0.0