Skip to content

Commit

Permalink
chore(package): up deps
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jun 26, 2020
1 parent ff89b47 commit a0329a8
Show file tree
Hide file tree
Showing 5 changed files with 595 additions and 698 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,28 @@
"lodash": "^4.17.15",
"meow": "^7.0.1",
"promise-events": "^0.1.8",
"semantic-release": "^17.0.8",
"semantic-release": "^17.1.1",
"semver": "^7.3.2",
"signale": "^1.4.0",
"stream-buffers": "^3.0.2",
"tempy": "^0.5.0",
"execa": "^4.0.2"
},
"devDependencies": {
"@commitlint/config-conventional": "^8.3.4",
"@commitlint/config-conventional": "^9.0.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.0.7",
"@semantic-release/npm": "^7.0.5",
"codeclimate-test-reporter": "^0.5.1",
"commitlint": "^8.3.5",
"commitlint": "^9.0.1",
"coveralls": "^3.1.0",
"eslint": "^7.1.0",
"eslint": "^7.3.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-prettier": "^3.1.4",
"file-url": "^3.0.0",
"husky": "^4.2.5",
"jest": "^26.0.1",
"jest": "^26.1.0",
"prettier": "^2.0.5"
},
"release": {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/yarnWorkspaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
],
"noCi": true
}
}
}
24 changes: 24 additions & 0 deletions test/helpers/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const execa = require("execa");
const fileUrl = require("file-url");
const gitLogParser = require("git-log-parser");
const { array: getStreamArray } = require("get-stream");
const envCi = require("env-ci");

/**
* @typedef {Object} Commit
Expand Down Expand Up @@ -76,6 +77,7 @@ function gitInitOrigin(cwd) {

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

// Return URL for remote.
return url;
Expand Down Expand Up @@ -163,6 +165,26 @@ function gitPush(cwd, remote = "origin", branch = "master") {

// Branches.

/**
* Return current git branch.
* @param {string} cwd The CWD of the Git repository.
* @returns {execa.ExecaSyncReturnValue} Branch name
*/
function gitReleaseBranch() {
const ciCxt = envCi();
const { prBranch, isPr } = ciCxt;

return isPr ? prBranch : "master";
}

/**
* Return the list of release branches.
* @returns {string[]} Branch name
*/
function gitReleaseBranches() {
return ["master"];
}

/**
* Create a branch in a local Git repository.
*
Expand Down Expand Up @@ -314,4 +336,6 @@ module.exports = {
gitGetTagHash,
gitConfig,
gitGetConfig,
gitReleaseBranch,
gitReleaseBranches,
};
17 changes: 13 additions & 4 deletions test/lib/multiSemanticRelease.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
gitPush,
gitTag,
gitGetTags,
gitReleaseBranches,
} = require("../helpers/git");

// Clear mocks before tests.
Expand All @@ -25,6 +26,7 @@ describe("multiSemanticRelease()", () => {
test("Initial commit (changes in all packages)", async () => {
// Create Git repo with copy of Yarn workspaces fixture.
const cwd = gitInit();
const branches = gitReleaseBranches();
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
const sha = gitCommitAll(cwd, "feat: Initial release");
const url = gitInitOrigin(cwd);
Expand All @@ -44,7 +46,7 @@ describe("multiSemanticRelease()", () => {
`packages/c/package.json`,
`packages/d/package.json`,
],
{},
{ branches },
{ cwd, stdout, stderr }
);

Expand Down Expand Up @@ -145,6 +147,7 @@ describe("multiSemanticRelease()", () => {
test("No changes in any packages", async () => {
// Create Git repo with copy of Yarn workspaces fixture.
const cwd = gitInit();
const branches = gitReleaseBranches();
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
const sha = gitCommitAll(cwd, "feat: Initial release");
// Creating the four tags so there are no changes in any packages.
Expand All @@ -169,7 +172,7 @@ describe("multiSemanticRelease()", () => {
`packages/d/package.json`,
`packages/b/package.json`,
],
{},
{ branches },
{ cwd, stdout, stderr }
);

Expand Down Expand Up @@ -197,6 +200,7 @@ describe("multiSemanticRelease()", () => {
test("Changes in some packages", async () => {
// Create Git repo.
const cwd = gitInit();
const branches = gitReleaseBranches();
// Initial commit.
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
const sha1 = gitCommitAll(cwd, "feat: Initial release");
Expand Down Expand Up @@ -224,7 +228,7 @@ describe("multiSemanticRelease()", () => {
`packages/b/package.json`,
`packages/a/package.json`,
],
{},
{ branches },
{ cwd, stdout, stderr }
);

Expand Down Expand Up @@ -332,6 +336,7 @@ describe("multiSemanticRelease()", () => {
test("Error if release's local deps have no version number", async () => {
// Create Git repo with copy of Yarn workspaces fixture.
const cwd = gitInit();
const branches = gitReleaseBranches();
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
gitAdd(cwd, "packages/a/package.json");
const sha = gitCommit(cwd, "feat: Commit first package only");
Expand All @@ -347,7 +352,7 @@ describe("multiSemanticRelease()", () => {
const multiSemanticRelease = require("../../");
const result = await multiSemanticRelease(
[`packages/a/package.json`, `packages/c/package.json`],
{},
{ branches },
{ cwd, stdout, stderr }
);

Expand All @@ -360,6 +365,7 @@ describe("multiSemanticRelease()", () => {
test("Configured plugins are called as normal", async () => {
// Create Git repo with copy of Yarn workspaces fixture.
const cwd = gitInit();
const branches = gitReleaseBranches();
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
const sha = gitCommitAll(cwd, "feat: Initial release");
const url = gitInitOrigin(cwd);
Expand Down Expand Up @@ -388,6 +394,7 @@ describe("multiSemanticRelease()", () => {
// Override to add our own plugins.
plugins: ["@semantic-release/release-notes-generator", plugin],
analyzeCommits: ["@semantic-release/commit-analyzer"],
branches,
},
{ cwd, stdout, stderr }
);
Expand All @@ -404,6 +411,7 @@ describe("multiSemanticRelease()", () => {
test("Deep errors (e.g. in plugins) bubble up and out", async () => {
// Create Git repo with copy of Yarn workspaces fixture.
const cwd = gitInit();
const branches = gitReleaseBranches();
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
const sha = gitCommitAll(cwd, "feat: Initial release");
const url = gitInitOrigin(cwd);
Expand All @@ -430,6 +438,7 @@ describe("multiSemanticRelease()", () => {
},
},
],
branches,
},
{ cwd, stdout, stderr }
);
Expand Down
Loading

0 comments on commit a0329a8

Please sign in to comment.