Skip to content

Commit 216bb94

Browse files
authored
feat: update deps and node version on CI (#15)
1 parent bfd575d commit 216bb94

File tree

12 files changed

+3229
-3053
lines changed

12 files changed

+3229
-3053
lines changed

.eslintrc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
],
1010
"parser": "@typescript-eslint/parser",
1111
"parserOptions": {
12-
"ecmaVersion": 9,
13-
"sourceType": "module",
1412
"project": "./tsconfig.json"
1513
},
1614
"rules": {
@@ -24,4 +22,4 @@
2422
"node": true,
2523
"es6": true
2624
}
27-
}
25+
}

.github/workflows/ciPR.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-node@v2
1818
with:
19-
node-version: '14'
19+
node-version: '18'
2020
- run: yarn install --frozen-lockfile
2121
- run: yarn lint
2222
- run: yarn test

.github/workflows/ciPush.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-node@v2
1818
with:
19-
node-version: '14'
19+
node-version: '18'
2020
- run: yarn
2121
- run: yarn lint
2222
- run: yarn test
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup Node.js
3232
uses: actions/setup-node@v2
3333
with:
34-
node-version: '14'
34+
node-version: '18'
3535
- name: Install dependencies
3636
run: yarn install --frozen-lockfile
3737
- name: Release

lib/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@
1717
"lint": "eslint src/**/*.ts"
1818
},
1919
"devDependencies": {
20-
"@commitlint/cli": "^16.2.3",
21-
"@commitlint/config-conventional": "^16.2.1",
22-
"@semantic-release/changelog": "^6.0.1",
20+
"@commitlint/cli": "^17.6.1",
21+
"@commitlint/config-conventional": "^17.6.1",
22+
"@semantic-release/changelog": "^6.0.3",
2323
"@semantic-release/git": "^10.0.1",
24-
"@spotify/eslint-config": "^13.0.0",
25-
"@types/jest": "^27.4.1",
26-
"@types/node": "^17.0.23",
27-
"@typescript-eslint/eslint-plugin": "^5.18.0",
28-
"@typescript-eslint/parser": "^5.18.0",
29-
"@vercel/ncc": "^0.33.3",
30-
"eslint": "^8.12.0",
31-
"eslint-config-prettier": "^8.5.0",
32-
"eslint-plugin-jest": "^26.1.4",
33-
"eslint-plugin-prettier": "^4.0.0",
34-
"husky": "^7.0.4",
35-
"jest": "^27.5.1",
36-
"prettier": "^2.6.2",
37-
"semantic-release": "^19.0.2",
38-
"ts-jest": "^27.1.4",
39-
"typescript": "^4.6.3"
24+
"@spotify/eslint-config": "^14.1.6",
25+
"@types/jest": "^29.5.0",
26+
"@types/node": "^18.15.11",
27+
"@typescript-eslint/eslint-plugin": "^5.58.0",
28+
"@typescript-eslint/parser": "^5.58.0",
29+
"@vercel/ncc": "^0.36.1",
30+
"eslint": "^8.38.0",
31+
"eslint-config-prettier": "^8.8.0",
32+
"eslint-plugin-jest": "^27.2.1",
33+
"eslint-plugin-prettier": "^4.2.1",
34+
"husky": "^8.0.3",
35+
"jest": "^29.5.0",
36+
"prettier": "^2.8.7",
37+
"semantic-release": "^21.0.1",
38+
"ts-jest": "^29.1.0",
39+
"typescript": "^5.0.4"
4040
},
4141
"dependencies": {
42-
"@actions/core": "^1.6.0",
43-
"@actions/github": "^5.0.1"
42+
"@actions/core": "^1.10.0",
43+
"@actions/github": "^5.1.1"
4444
},
4545
"jest": {
4646
"globals": {
47-
"ts-jest": {
48-
"diagnostics": false
47+
"transform": {
48+
"^.+\\.ts$": ["ts-jest"]
4949
}
5050
},
5151
"verbose": true,

src/pr-files.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ export async function getFiles({
2424
});
2525

2626
const untracked = ['removed', 'unchanged'];
27-
let matcher = (file: typeof prFiles[number]) =>
27+
let matcher = (file: (typeof prFiles)[number]) =>
2828
!untracked.includes(file.status) && Boolean(file.additions);
2929

3030
if (ignoreFilesPattern) {
3131
const regex = new RegExp(ignoreFilesPattern);
32-
matcher = (file: typeof prFiles[number]) =>
32+
matcher = (file: (typeof prFiles)[number]) =>
3333
!untracked.includes(file.status) &&
3434
Boolean(file.additions) &&
3535
!file.filename.match(regex);

tests/__snapshots__/action-paramaters.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`getActionParameters should return action parameters 1`] = `
4-
Object {
4+
{
55
"actor": "mock-actor",
66
"base": "master",
77
"head": "pr",
@@ -12,11 +12,11 @@ Object {
1212
`;
1313

1414
exports[`getInputs should return all inputs 1`] = `
15-
Object {
15+
{
1616
"commentTitle": "my title",
1717
"ignoreFilesPattern": "mock-pattern",
1818
"reviewMsg": "hello world",
19-
"tags": Array [
19+
"tags": [
2020
"test:",
2121
"data:",
2222
"more",

tests/__snapshots__/file-analyzer.spec.ts.snap

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`FileAnalyzer should return all comments if no patch provided 1`] = `
4-
Array [
5-
Object {
6-
"comments": Object {
7-
"FIXME:": Array [
8-
Object {
4+
[
5+
{
6+
"comments": {
7+
"FIXME:": [
8+
{
99
"comment": ":add implementation",
1010
"line": 6,
1111
},
1212
],
13-
"NOTE": Array [
14-
Object {
13+
"NOTE": [
14+
{
1515
"comment": "Please don't forget review",
1616
"line": 12,
1717
},
18-
Object {
18+
{
1919
"comment": "another note",
2020
"line": 13,
2121
},
2222
],
23-
"tODo:": Array [
24-
Object {
23+
"tODo:": [
24+
{
2525
"comment": "this is an old comment",
2626
"line": 8,
2727
},
28-
Object {
28+
{
2929
"comment": "this should present",
3030
"line": 11,
3131
},
32-
Object {
32+
{
3333
"comment": "placeholder function",
3434
"line": 16,
3535
},
@@ -41,27 +41,27 @@ Array [
4141
`;
4242

4343
exports[`FileAnalyzer should return all identified comments 1`] = `
44-
Array [
45-
Object {
46-
"comments": Object {
47-
"FIXME:": Array [
48-
Object {
44+
[
45+
{
46+
"comments": {
47+
"FIXME:": [
48+
{
4949
"comment": ":add implementation",
5050
"line": 6,
5151
},
5252
],
53-
"NOTE": Array [
54-
Object {
53+
"NOTE": [
54+
{
5555
"comment": "Please don't forget review",
5656
"line": 12,
5757
},
5858
],
59-
"tODo:": Array [
60-
Object {
59+
"tODo:": [
60+
{
6161
"comment": "this should present",
6262
"line": 11,
6363
},
64-
Object {
64+
{
6565
"comment": "placeholder function",
6666
"line": 16,
6767
},
@@ -73,21 +73,21 @@ Array [
7373
`;
7474

7575
exports[`FileAnalyzer should skip comments not included on the pr 1`] = `
76-
Array [
77-
Object {
78-
"comments": Object {
79-
"NOTE": Array [
80-
Object {
76+
[
77+
{
78+
"comments": {
79+
"NOTE": [
80+
{
8181
"comment": "another note",
8282
"line": 13,
8383
},
8484
],
85-
"tODo:": Array [
86-
Object {
85+
"tODo:": [
86+
{
8787
"comment": "this should present",
8888
"line": 11,
8989
},
90-
Object {
90+
{
9191
"comment": "placeholder function",
9292
"line": 16,
9393
},
@@ -99,11 +99,11 @@ Array [
9999
`;
100100

101101
exports[`FileAnalyzer should skip files with no matches 1`] = `
102-
Array [
103-
Object {
104-
"comments": Object {
105-
"TODO:": Array [
106-
Object {
102+
[
103+
{
104+
"comments": {
105+
"TODO:": [
106+
{
107107
"comment": "we should write tests",
108108
"line": 5,
109109
},

tests/action-paramaters.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('getActionParameters', () => {
3535
payload: {}
3636
} as Context;
3737

38-
expect(() => getActionParameters(ctx)).toThrowError(
38+
expect(() => getActionParameters(ctx)).toThrow(
3939
'Action only supports pull requests'
4040
);
4141
});
@@ -49,7 +49,7 @@ describe('getActionParameters', () => {
4949
}
5050
} as Context;
5151

52-
expect(() => getActionParameters(ctx)).toThrowError(
52+
expect(() => getActionParameters(ctx)).toThrow(
5353
'Action cannot identify pull request number'
5454
);
5555
});

tests/pr-files.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const execSpy = jest.fn();
77
const diffCMD = 'git diff origin/master...origin/pr -- src/data.ts';
88

99
jest.mock('util', () => {
10+
const original = jest.requireActual('util');
11+
1012
return {
13+
...original,
1114
promisify: () => async (command: string) => {
1215
await sleep(2000);
1316
execSpy(command);

0 commit comments

Comments
 (0)