Skip to content

Commit e6d8ee8

Browse files
authored
Modernise (#186)
* build: move to NodeJS 20. Update deps * replace mocha test suite with jest * style: update eslintrc. Add prettierrc * build: update husky hooks * chore: bump action and nvmrc to nodejs20 * feat: modernise action * chore: remove old implementation * test: add tests * chore: compile latest version of action * build: bump vercel/ncc * ci: update coverage test name
1 parent b3f7348 commit e6d8ee8

34 files changed

+8514
-9820
lines changed

.eslintrc.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
module.exports = {
2-
root: true,
32
parser: '@typescript-eslint/parser',
4-
plugins: [
5-
'@typescript-eslint',
6-
],
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
tsconfigRootDir: __dirname,
6+
sourceType: 'module',
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
79
extends: [
8-
'eslint:recommended',
9-
'plugin:@typescript-eslint/eslint-recommended',
1010
'plugin:@typescript-eslint/recommended',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: [
19+
'.eslintrc.js',
20+
'test/**/*.spec.ts',
1121
],
1222
rules: {
13-
// disable semicolon
14-
'@typescript-eslint/member-delimiter-style': 'off',
15-
// allow use of 'any'
23+
semi: ['error', 'never'],
1624
'@typescript-eslint/no-explicit-any': 'off',
17-
// allow explicit type declarations
18-
'@typescript-eslint/no-inferrable-types': 'off'
19-
}
25+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', ignoreRestSiblings: true }]
26+
},
2027
}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
strategy:
4747
matrix:
4848
# Creates jobs for each element in the matrix
49-
test: ['unit', 'lint', 'typecheck', 'cover']
49+
test: ['unit', 'lint', 'typecheck', 'coverage']
5050
# Let individual jobs in the matrix fail without canceling all jobs
5151
fail-fast: false
5252
name: ${{ matrix.test }} tests

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
yarn test:lint
1+
npm run test:lint && npm run test:typecheck

.husky/prepare-commit-msg

Lines changed: 0 additions & 4 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16.20.2
1+
v20.16.0

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"semi": false,
5+
"singleQuote": true,
6+
"printWidth": 100
7+
}

CHANGELOG.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
![CI](https://github.com/iniva/action-repository-dispatch/workflows/CI/badge.svg)
33

44
# Action: Repository Dispatch <!-- omit in toc -->
5+
Send customized `repository_dispatch` events
56

67
- [Usage](#usage)
78
- [Inputs](#inputs)
89
- [PAT requirements](#pat-requirements)
910
- [DEBUG](#debug)
1011

1112
# Usage
12-
> :information_source: Check the [ci workflow](.github/workflows/ci.yml) in this repo to see a live example on how to use this action in your own workflow
13+
:information_source: Check the [ci workflow](.github/workflows/ci.yml) in this repo to see a live example on how to use this action in your own workflow
1314

1415
## Inputs
1516
| Input | Description | Required | Default | Comments |

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ inputs:
3939

4040

4141
runs:
42-
using: 'node16'
42+
using: 'node20'
4343
main: 'dist/index.js'

dist/PayloadResolver.js

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)