Skip to content

Commit

Permalink
fix: up deps, fix some vuls
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Mar 6, 2022
1 parent ddd1032 commit 2d5cf86
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 70 deletions.
1 change: 1 addition & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const cli = meow(
$ multi-semantic-release --ignore-packages=packages/a/**,packages/b/**
`,
{
importMeta: import.meta,
flags: {
sequentialInit: {
type: "boolean",
Expand Down
2 changes: 1 addition & 1 deletion lib/getCommitsFiltered.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { relative, resolve } from "path";
import gitLogParser from "git-log-parser";
import getStream from "get-stream";
import execa from "execa";
import { execa } from "execa";
import { check, ValueError } from "./blork.js";
import cleanPath from "./cleanPath.js";
import dbg from "debug";
Expand Down
4 changes: 2 additions & 2 deletions lib/git.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import execa from "execa";
import { execaSync } from "execa";

/**
* Get all the tags for a given branch.
Expand All @@ -12,7 +12,7 @@ import execa from "execa";
* @internal
*/
function getTags(branch, execaOptions, filters) {
let tags = execa.sync("git", ["tag", "--merged", branch], execaOptions).stdout;
let tags = execaSync("git", ["tag", "--merged", branch], execaOptions).stdout;
tags = tags
.split("\n")
.map((tag) => tag.trim())
Expand Down
4 changes: 2 additions & 2 deletions lib/glob.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import globby from "globby";
import { globbySync } from "globby";

export default (...args) => {
const [pattern, ...options] = args;

return globby.sync(pattern, ...options);
return globbySync(pattern, ...options);
};
2 changes: 1 addition & 1 deletion lib/recognizeFormat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import detectNewline from "detect-newline";
import { detectNewline } from "detect-newline";
import detectIndent from "detect-indent";

/**
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@
"blork": "^9.3.0",
"cosmiconfig": "^7.0.1",
"debug": "^4.3.3",
"detect-indent": "^6.1.0",
"detect-newline": "^3.1.0",
"execa": "^5.1.1",
"detect-indent": "^7.0.0",
"detect-newline": "^4.0.0",
"execa": "^6.1.0",
"get-stream": "^6.0.1",
"git-log-parser": "^1.2.0",
"globby": "11.0.4",
"globby": "13.1.1",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"meow": "^9.0.0",
"meow": "^10.1.2",
"promise-events": "^0.2.4",
"semantic-release": "^19.0.2",
"semver": "^7.3.5",
"signale": "^1.4.0",
"stream-buffers": "^3.0.2",
"tempy": "^1.0.1"
"tempy": "^2.0.0"
},
"peerDependencies": {
"npm": "8.4.1"
Expand All @@ -89,7 +89,7 @@
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"file-url": "^3.0.0",
"file-url": "^4.0.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"prettier": "^2.5.1"
Expand Down
2 changes: 1 addition & 1 deletion test/bin/cli.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import execa from "execa";
import { execa } from "execa";
import {dirname} from "node:path";
import {fileURLToPath} from "node:url";

Expand Down
40 changes: 20 additions & 20 deletions test/helpers/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { check } from "blork";
import tempy from "tempy";
import execa from "execa";
import { execaSync } from "execa";
import fileUrl from "file-url";
import gitLogParser from "git-log-parser";
import { array as getStreamArray } from "get-stream";
Expand All @@ -32,8 +32,8 @@ function gitInit(branch = "master") {

// Init Git in a temp directory.
const cwd = tempy.directory();
execa.sync("git", ["init"], { cwd });
execa.sync("git", ["checkout", "-b", branch], { cwd });
execaSync("git", ["init"], { cwd });
execaSync("git", ["checkout", "-b", branch], { cwd });

// Disable GPG signing for commits.
gitConfig(cwd, "commit.gpgsign", false);
Expand All @@ -51,7 +51,7 @@ function gitInit(branch = "master") {
function gitInitRemote() {
// Init bare Git repository in a temp directory.
const cwd = tempy.directory();
execa.sync("git", ["init", "--bare"], { cwd });
execaSync("git", ["init", "--bare"], { cwd });

// Turn remote path into a file URL.
const url = fileUrl(cwd);
Expand All @@ -76,15 +76,15 @@ function gitInitOrigin(cwd, releaseBranch = null) {
const url = gitInitRemote();

// Set origin on local repo.
execa.sync("git", ["remote", "add", "origin", url], { cwd });
execaSync("git", ["remote", "add", "origin", url], { cwd });

// Set up a release branch. Return to master afterwards.
if (releaseBranch) {
execa.sync("git", ["checkout", "-b", releaseBranch], { cwd });
execa.sync("git", ["checkout", "master"], { cwd });
execaSync("git", ["checkout", "-b", releaseBranch], { cwd });
execaSync("git", ["checkout", "master"], { cwd });
}

execa.sync("git", ["push", "--all", "origin"], { cwd });
execaSync("git", ["push", "--all", "origin"], { cwd });

// Return URL for remote.
return url;
Expand All @@ -104,7 +104,7 @@ function gitAdd(cwd, file = ".") {
check(cwd, "cwd: absolute");

// Await command.
execa.sync("git", ["add", file], { cwd });
execaSync("git", ["add", file], { cwd });
}

// Commits.
Expand All @@ -123,7 +123,7 @@ function gitCommit(cwd, message) {
check(message, "message: string+");

// Await the command.
execa.sync("git", ["commit", "-m", message, "--no-gpg-sign"], { cwd });
execaSync("git", ["commit", "-m", message, "--no-gpg-sign"], { cwd });

// Return HEAD SHA.
return gitGetHead(cwd);
Expand Down Expand Up @@ -167,7 +167,7 @@ function gitPush(cwd, remote = "origin", branch = "master") {
check(branch, "branch: lower");

// Await command.
execa.sync("git", ["push", "--tags", remote, `HEAD:${branch}`], { cwd });
execaSync("git", ["push", "--tags", remote, `HEAD:${branch}`], { cwd });
}

// Branches.
Expand All @@ -185,7 +185,7 @@ function gitBranch(cwd, branch) {
check(branch, "branch: lower");

// Await command.
execa.sync("git", ["branch", branch], { cwd });
execaSync("git", ["branch", branch], { cwd });
}

/**
Expand All @@ -201,7 +201,7 @@ function gitCheckout(cwd, branch) {
check(branch, "branch: lower");

// Await command.
execa.sync("git", ["checkout", branch], { cwd });
execaSync("git", ["checkout", branch], { cwd });
}

// Hashes.
Expand All @@ -217,7 +217,7 @@ function gitGetHead(cwd) {
check(cwd, "cwd: absolute");

// Await command and return HEAD SHA.
return execa.sync("git", ["rev-parse", "HEAD"], { cwd }).stdout;
return execaSync("git", ["rev-parse", "HEAD"], { cwd }).stdout;
}

// Tags.
Expand All @@ -237,7 +237,7 @@ function gitTag(cwd, tagName, hash = undefined) {
check(hash, "hash: alphanumeric{40}?");

// Run command.
execa.sync("git", hash ? ["tag", "-f", tagName, hash] : ["tag", tagName], { cwd });
execaSync("git", hash ? ["tag", "-f", tagName, hash] : ["tag", tagName], { cwd });
}

/**
Expand All @@ -253,7 +253,7 @@ function gitGetTags(cwd, hash) {
check(hash, "hash: alphanumeric{40}");

// Run command.
return execa.sync("git", ["describe", "--tags", "--exact-match", hash], { cwd }).stdout;
return execaSync("git", ["describe", "--tags", "--exact-match", hash], { cwd }).stdout;
}

/**
Expand All @@ -269,7 +269,7 @@ function gitGetTagHash(cwd, tagName) {
check(tagName, "tagName: string+");

// Run command.
return execa.sync("git", ["rev-list", "-1", tagName], { cwd }).stdout;
return execaSync("git", ["rev-list", "-1", tagName], { cwd }).stdout;
}

// Configs.
Expand All @@ -288,7 +288,7 @@ function gitConfig(cwd, name, value) {
check(name, "name: string+");

// Run command.
execa.sync("git", ["config", "--add", name, value], { cwd });
execaSync("git", ["config", "--add", name, value], { cwd });
}

/**
Expand All @@ -304,7 +304,7 @@ function gitGetConfig(cwd, name) {
check(name, "name: string+");

// Run command.
execa.sync("git", ["config", name], { cwd }).stdout;
execaSync("git", ["config", name], { cwd }).stdout;
}

/**
Expand All @@ -321,7 +321,7 @@ function gitGetLog(cwd, number, hash) {
check(hash, "hash: string+");

// Run command.
return execa.sync("git", ["log", `-${number}`, hash], { cwd }).stdout;
return execaSync("git", ["log", `-${number}`, hash], { cwd }).stdout;
}
// Exports.
export {
Expand Down
Loading

0 comments on commit 2d5cf86

Please sign in to comment.