Skip to content

Commit d7a3280

Browse files
authored
feat(2683): nodejs upgrade (#86)
BREAKING CHANGE: Node 18 upgrade && eslint upgrade
1 parent 3acf7a2 commit d7a3280

File tree

4 files changed

+28
-38
lines changed

4 files changed

+28
-38
lines changed

index.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,32 +132,19 @@ class BitbucketScm extends Scm {
132132
joi
133133
.object()
134134
.keys({
135-
username: joi
136-
.string()
137-
.optional()
138-
.default('sd-buildbot'),
139-
email: joi
140-
.string()
141-
.optional()
142-
.default('dev-null@screwdriver.cd'),
135+
username: joi.string().optional().default('sd-buildbot'),
136+
email: joi.string().optional().default('dev-null@screwdriver.cd'),
143137
readOnly: joi
144138
.object()
145139
.keys({
146140
enabled: joi.boolean().optional(),
147141
username: joi.string().optional(),
148142
accessToken: joi.string().optional(),
149-
cloneType: joi
150-
.string()
151-
.valid('https', 'ssh')
152-
.optional()
153-
.default('https')
143+
cloneType: joi.string().valid('https', 'ssh').optional().default('https')
154144
})
155145
.optional()
156146
.default({}),
157-
https: joi
158-
.boolean()
159-
.optional()
160-
.default(false),
147+
https: joi.boolean().optional().default(false),
161148
oauthClientId: joi.string().required(),
162149
oauthClientSecret: joi.string().required(),
163150
fusebox: joi.object().default({})
@@ -336,10 +323,13 @@ class BitbucketScm extends Scm {
336323
* @return {Promise} Resolves to scmUri
337324
*/
338325
async _parseUrl({ checkoutUrl, rootDir }) {
339-
const { branch: branchFromCheckout, username, repo, hostname, rootDir: sourceDir } = getRepoInfo(
340-
checkoutUrl,
341-
rootDir
342-
);
326+
const {
327+
branch: branchFromCheckout,
328+
username,
329+
repo,
330+
hostname,
331+
rootDir: sourceDir
332+
} = getRepoInfo(checkoutUrl, rootDir);
343333
// TODO: add logic to fetch default branch
344334
// See https://jira.atlassian.com/browse/BCLOUD-20212
345335
const branch = branchFromCheckout || DEFAULT_BRANCH;

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "screwdriver-scm-bitbucket",
3-
"version": "4.0.0",
3+
"version": "5.0.0",
44
"description": "This scm plugin extends the [scm-base-class](https://github.com/screwdriver-cd/scm-base), and provides methods to fetch and update data in Bitbucket.",
55
"main": "index.js",
66
"scripts": {
@@ -35,23 +35,23 @@
3535
"debug": false
3636
},
3737
"devDependencies": {
38-
"chai": "^4.3.6",
39-
"eslint": "^7.32.0",
40-
"eslint-config-screwdriver": "^5.0.1",
41-
"mocha": "^8.4.0",
38+
"chai": "^4.3.7",
39+
"eslint": "^8.28.0",
40+
"eslint-config-screwdriver": "^7.0.0",
41+
"mocha": "^10.1.0",
4242
"mocha-multi-reporters": "^1.5.1",
4343
"mocha-sonarqube-reporter": "^1.0.2",
44-
"mockery": "^2.0.0",
45-
"nyc": "^15.0.0",
46-
"sinon": "^9.0.0"
44+
"mockery": "^2.1.0",
45+
"nyc": "^15.1.0",
46+
"sinon": "^15.0.0"
4747
},
4848
"dependencies": {
49-
"@hapi/hoek": "^9.2.1",
50-
"circuit-fuses": "^4.1.2",
51-
"joi": "^17.6.0",
52-
"screwdriver-data-schema": "^21.22.2",
53-
"screwdriver-logger": "^1.1.0",
54-
"screwdriver-request": "^1.0.3",
55-
"screwdriver-scm-base": "^7.4.0"
49+
"@hapi/hoek": "^10.0.1",
50+
"circuit-fuses": "^5.0.0",
51+
"joi": "^17.7.0",
52+
"screwdriver-data-schema": "^22.0.1",
53+
"screwdriver-logger": "^2.0.0",
54+
"screwdriver-request": "^2.0.1",
55+
"screwdriver-scm-base": "^8.0.0"
5656
}
5757
}

screwdriver.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
shared:
2-
image: node:12
2+
image: node:18
33

44
jobs:
55
main:

test/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const API_URL_V2 = 'https://api.bitbucket.org/2.0';
2222

2323
sinon.assert.expose(assert, { prefix: '' });
2424

25-
describe('index', function() {
25+
describe('index', function () {
2626
// Time not important. Only life important.
2727
this.timeout(5000);
2828

0 commit comments

Comments
 (0)