Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Closes #410
  • Loading branch information
sindresorhus committed Jun 28, 2019
1 parent ff5e21a commit 1c9d05f
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 25 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,41 @@
],
"dependencies": {
"@samverschueren/stream-to-observable": "^0.3.0",
"any-observable": "^0.3.0",
"any-observable": "^0.4.0",
"async-exit-hook": "^2.0.1",
"chalk": "^2.3.0",
"cosmiconfig": "^5.2.1",
"del": "^4.1.0",
"escape-string-regexp": "^2.0.0",
"execa": "^1.0.0",
"execa": "^2.0.1",
"github-url-from-git": "^1.5.0",
"has-yarn": "^2.1.0",
"hosted-git-info": "^2.7.1",
"inquirer": "^6.2.1",
"is-installed-globally": "^0.1.0",
"inquirer": "^6.4.1",
"is-installed-globally": "^0.2.0",
"is-scoped": "^2.1.0",
"issue-regex": "^2.0.0",
"listr": "^0.14.3",
"listr-input": "^0.1.3",
"log-symbols": "^3.0.0",
"meow": "^5.0.0",
"npm-name": "^5.0.1",
"npm-name": "^5.4.0",
"onetime": "^5.1.0",
"open": "^6.1.0",
"ow": "^0.12.0",
"ow": "^0.13.2",
"p-memoize": "^3.1.0",
"p-timeout": "^3.1.0",
"pkg-dir": "^4.1.0",
"read-pkg-up": "^5.0.0",
"read-pkg-up": "^6.0.0",
"rxjs": "^6.3.3",
"semver": "^6.0.0",
"semver": "^6.1.2",
"split": "^1.0.0",
"symbol-observable": "^1.2.0",
"terminal-link": "^1.2.0",
"update-notifier": "^2.1.0"
"update-notifier": "^3.0.0"
},
"devDependencies": {
"ava": "^1.1.0",
"ava": "^2.1.0",
"xo": "^0.24.0"
}
}
31 changes: 24 additions & 7 deletions source/git-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ const execa = require('execa');
const escapeStringRegexp = require('escape-string-regexp');
const {verifyRequirementSatisfied} = require('./version');

exports.latestTag = () => execa.stdout('git', ['describe', '--abbrev=0', '--tags']);
exports.latestTag = async () => {
const {stdout} = await execa('git', ['describe', '--abbrev=0', '--tags']);
return stdout;
};

const firstCommit = () => execa.stdout('git', ['rev-list', '--max-parents=0', 'HEAD']);
const firstCommit = async () => {
const {stdout} = await execa('git', ['rev-list', '--max-parents=0', 'HEAD']);
return stdout;
};

exports.latestTagOrFirstCommit = async () => {
let latest;
Expand All @@ -27,7 +33,10 @@ exports.hasUpstream = async () => {
return new RegExp(String.raw`^## ${escapedCurrentBranch}\.\.\..+\/${escapedCurrentBranch}`).test(stdout);
};

exports.currentBranch = () => execa.stdout('git', ['symbolic-ref', '--short', 'HEAD']);
exports.currentBranch = async () => {
const {stdout} = await execa('git', ['symbolic-ref', '--short', 'HEAD']);
return stdout;
};

exports.verifyCurrentBranchIsMaster = async () => {
if (await exports.currentBranch() !== 'master') {
Expand Down Expand Up @@ -57,7 +66,8 @@ exports.verifyWorkingTreeIsClean = async () => {
exports.isRemoteHistoryClean = async () => {
let history;
try { // Gracefully handle no remote set up.
history = await execa.stdout('git', ['rev-list', '--count', '--left-only', '@{u}...HEAD']);
const {stdout} = await execa('git', ['rev-list', '--count', '--left-only', '@{u}...HEAD']);
history = stdout;
} catch (_) {}

if (history && history !== '0') {
Expand All @@ -81,7 +91,9 @@ exports.verifyRemoteIsValid = async () => {
}
};

exports.fetch = () => execa('git', ['fetch']);
exports.fetch = async () => {
await execa('git', ['fetch']);
};

exports.tagExistsOnRemote = async tagName => {
try {
Expand Down Expand Up @@ -109,9 +121,14 @@ exports.verifyTagDoesNotExistOnRemote = async tagName => {
}
};

exports.commitLogFromRevision = revision => execa.stdout('git', ['log', '--format=%s %h', `${revision}..HEAD`]);
exports.commitLogFromRevision = async revision => {
const {stdout} = await execa('git', ['log', '--format=%s %h', `${revision}..HEAD`]);
return stdout;
};

exports.push = () => execa('git', ['push', '--follow-tags']);
exports.push = async () => {
await execa('git', ['push', '--follow-tags']);
};

exports.deleteTag = async tagName => {
await execa('git', ['tag', '--delete', tagName]);
Expand Down
2 changes: 1 addition & 1 deletion source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,6 @@ module.exports = async (input = 'patch', options) => {

await tasks.run();

const {pkg: newPkg} = await readPkgUp();
const {package: newPkg} = await readPkgUp();
return newPkg;
};
11 changes: 8 additions & 3 deletions source/npm/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ exports.username = async ({externalRegistry}) => {
}

try {
return await execa.stdout('npm', args);
const {stdout} = await execa('npm', args);
return stdout;
} catch (error) {
throw new Error(/ENEEDAUTH/.test(error.stderr) ?
'You must be logged in. Use `npm login` and try again.' :
Expand All @@ -38,7 +39,8 @@ exports.collaborators = async packageName => {
ow(packageName, ow.string);

try {
return await execa.stdout('npm', ['access', 'ls-collaborators', packageName]);
const {stdout} = await execa('npm', ['access', 'ls-collaborators', packageName]);
return stdout;
} catch (error) {
// Ignore non-existing package error
if (error.stderr.includes('code E404')) {
Expand Down Expand Up @@ -81,7 +83,10 @@ exports.isPackageNameAvailable = async pkg => {

exports.isExternalRegistry = pkg => typeof pkg.publishConfig === 'object' && typeof pkg.publishConfig.registry === 'string';

exports.version = () => execa.stdout('npm', ['--version']);
exports.version = async () => {
const {stdout} = await execa('npm', ['--version']);
return stdout;
};

exports.verifyRecentNpmVersion = async () => {
const npmVersion = await exports.version();
Expand Down
2 changes: 1 addition & 1 deletion source/prerequisite-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = (input, pkg, options) => {
title: 'Check yarn version',
enabled: () => options.yarn === true,
task: async () => {
const yarnVersion = await execa.stdout('yarn', ['--version']);
const {stdout: yarnVersion} = await execa('yarn', ['--version']);
version.verifyRequirementSatisfied('yarn', yarnVersion);
}
},
Expand Down
8 changes: 5 additions & 3 deletions source/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const pMemoize = require('p-memoize');
const ow = require('ow');

exports.readPkg = () => {
const {pkg} = readPkgUp.sync();
const {package: pkg} = readPkgUp.sync();

if (!pkg) {
throw new Error('No package.json found. Make sure you\'re in the correct project.');
Expand Down Expand Up @@ -53,10 +53,12 @@ exports.getTagVersionPrefix = pMemoize(async options => {

try {
if (options.yarn) {
return await execa.stdout('yarn', ['config', 'get', 'version-tag-prefix']);
const {stdout} = await execa('yarn', ['config', 'get', 'version-tag-prefix']);
return stdout;
}

return await execa.stdout('npm', ['config', 'get', 'tag-version-prefix']);
const {stdout} = await execa('npm', ['config', 'get', 'tag-version-prefix']);
return stdout;
} catch (_) {
return 'v';
}
Expand Down

0 comments on commit 1c9d05f

Please sign in to comment.