Skip to content

Commit a0329a8

Browse files
committed
chore(package): up deps
1 parent ff89b47 commit a0329a8

File tree

5 files changed

+595
-698
lines changed

5 files changed

+595
-698
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,28 @@
5757
"lodash": "^4.17.15",
5858
"meow": "^7.0.1",
5959
"promise-events": "^0.1.8",
60-
"semantic-release": "^17.0.8",
60+
"semantic-release": "^17.1.1",
6161
"semver": "^7.3.2",
6262
"signale": "^1.4.0",
6363
"stream-buffers": "^3.0.2",
6464
"tempy": "^0.5.0",
6565
"execa": "^4.0.2"
6666
},
6767
"devDependencies": {
68-
"@commitlint/config-conventional": "^8.3.4",
68+
"@commitlint/config-conventional": "^9.0.1",
6969
"@semantic-release/changelog": "^5.0.1",
7070
"@semantic-release/git": "^9.0.0",
7171
"@semantic-release/github": "^7.0.7",
7272
"@semantic-release/npm": "^7.0.5",
7373
"codeclimate-test-reporter": "^0.5.1",
74-
"commitlint": "^8.3.5",
74+
"commitlint": "^9.0.1",
7575
"coveralls": "^3.1.0",
76-
"eslint": "^7.1.0",
76+
"eslint": "^7.3.1",
7777
"eslint-config-prettier": "^6.11.0",
78-
"eslint-plugin-prettier": "^3.1.3",
78+
"eslint-plugin-prettier": "^3.1.4",
7979
"file-url": "^3.0.0",
8080
"husky": "^4.2.5",
81-
"jest": "^26.0.1",
81+
"jest": "^26.1.0",
8282
"prettier": "^2.0.5"
8383
},
8484
"release": {

test/fixtures/yarnWorkspaces/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
],
1818
"noCi": true
1919
}
20-
}
20+
}

test/helpers/git.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const execa = require("execa");
99
const fileUrl = require("file-url");
1010
const gitLogParser = require("git-log-parser");
1111
const { array: getStreamArray } = require("get-stream");
12+
const envCi = require("env-ci");
1213

1314
/**
1415
* @typedef {Object} Commit
@@ -76,6 +77,7 @@ function gitInitOrigin(cwd) {
7677

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

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

164166
// Branches.
165167

168+
/**
169+
* Return current git branch.
170+
* @param {string} cwd The CWD of the Git repository.
171+
* @returns {execa.ExecaSyncReturnValue} Branch name
172+
*/
173+
function gitReleaseBranch() {
174+
const ciCxt = envCi();
175+
const { prBranch, isPr } = ciCxt;
176+
177+
return isPr ? prBranch : "master";
178+
}
179+
180+
/**
181+
* Return the list of release branches.
182+
* @returns {string[]} Branch name
183+
*/
184+
function gitReleaseBranches() {
185+
return ["master"];
186+
}
187+
166188
/**
167189
* Create a branch in a local Git repository.
168190
*
@@ -314,4 +336,6 @@ module.exports = {
314336
gitGetTagHash,
315337
gitConfig,
316338
gitGetConfig,
339+
gitReleaseBranch,
340+
gitReleaseBranches,
317341
};

test/lib/multiSemanticRelease.test.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const {
1212
gitPush,
1313
gitTag,
1414
gitGetTags,
15+
gitReleaseBranches,
1516
} = require("../helpers/git");
1617

1718
// Clear mocks before tests.
@@ -25,6 +26,7 @@ describe("multiSemanticRelease()", () => {
2526
test("Initial commit (changes in all packages)", async () => {
2627
// Create Git repo with copy of Yarn workspaces fixture.
2728
const cwd = gitInit();
29+
const branches = gitReleaseBranches();
2830
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
2931
const sha = gitCommitAll(cwd, "feat: Initial release");
3032
const url = gitInitOrigin(cwd);
@@ -44,7 +46,7 @@ describe("multiSemanticRelease()", () => {
4446
`packages/c/package.json`,
4547
`packages/d/package.json`,
4648
],
47-
{},
49+
{ branches },
4850
{ cwd, stdout, stderr }
4951
);
5052

@@ -145,6 +147,7 @@ describe("multiSemanticRelease()", () => {
145147
test("No changes in any packages", async () => {
146148
// Create Git repo with copy of Yarn workspaces fixture.
147149
const cwd = gitInit();
150+
const branches = gitReleaseBranches();
148151
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
149152
const sha = gitCommitAll(cwd, "feat: Initial release");
150153
// Creating the four tags so there are no changes in any packages.
@@ -169,7 +172,7 @@ describe("multiSemanticRelease()", () => {
169172
`packages/d/package.json`,
170173
`packages/b/package.json`,
171174
],
172-
{},
175+
{ branches },
173176
{ cwd, stdout, stderr }
174177
);
175178

@@ -197,6 +200,7 @@ describe("multiSemanticRelease()", () => {
197200
test("Changes in some packages", async () => {
198201
// Create Git repo.
199202
const cwd = gitInit();
203+
const branches = gitReleaseBranches();
200204
// Initial commit.
201205
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
202206
const sha1 = gitCommitAll(cwd, "feat: Initial release");
@@ -224,7 +228,7 @@ describe("multiSemanticRelease()", () => {
224228
`packages/b/package.json`,
225229
`packages/a/package.json`,
226230
],
227-
{},
231+
{ branches },
228232
{ cwd, stdout, stderr }
229233
);
230234

@@ -332,6 +336,7 @@ describe("multiSemanticRelease()", () => {
332336
test("Error if release's local deps have no version number", async () => {
333337
// Create Git repo with copy of Yarn workspaces fixture.
334338
const cwd = gitInit();
339+
const branches = gitReleaseBranches();
335340
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
336341
gitAdd(cwd, "packages/a/package.json");
337342
const sha = gitCommit(cwd, "feat: Commit first package only");
@@ -347,7 +352,7 @@ describe("multiSemanticRelease()", () => {
347352
const multiSemanticRelease = require("../../");
348353
const result = await multiSemanticRelease(
349354
[`packages/a/package.json`, `packages/c/package.json`],
350-
{},
355+
{ branches },
351356
{ cwd, stdout, stderr }
352357
);
353358

@@ -360,6 +365,7 @@ describe("multiSemanticRelease()", () => {
360365
test("Configured plugins are called as normal", async () => {
361366
// Create Git repo with copy of Yarn workspaces fixture.
362367
const cwd = gitInit();
368+
const branches = gitReleaseBranches();
363369
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
364370
const sha = gitCommitAll(cwd, "feat: Initial release");
365371
const url = gitInitOrigin(cwd);
@@ -388,6 +394,7 @@ describe("multiSemanticRelease()", () => {
388394
// Override to add our own plugins.
389395
plugins: ["@semantic-release/release-notes-generator", plugin],
390396
analyzeCommits: ["@semantic-release/commit-analyzer"],
397+
branches,
391398
},
392399
{ cwd, stdout, stderr }
393400
);
@@ -404,6 +411,7 @@ describe("multiSemanticRelease()", () => {
404411
test("Deep errors (e.g. in plugins) bubble up and out", async () => {
405412
// Create Git repo with copy of Yarn workspaces fixture.
406413
const cwd = gitInit();
414+
const branches = gitReleaseBranches();
407415
copyDirectory(`test/fixtures/yarnWorkspaces/`, cwd);
408416
const sha = gitCommitAll(cwd, "feat: Initial release");
409417
const url = gitInitOrigin(cwd);
@@ -430,6 +438,7 @@ describe("multiSemanticRelease()", () => {
430438
},
431439
},
432440
],
441+
branches,
433442
},
434443
{ cwd, stdout, stderr }
435444
);

0 commit comments

Comments
 (0)