Skip to content

Commit 2f509d5

Browse files
committed
Converted to ESM module
1 parent 97e50fb commit 2f509d5

29 files changed

+384
-380
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.yml

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

.github/workflows/ci.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
branches:
9+
- main
10+
- master
11+
workflow_dispatch: {}
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
node_current:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: current
28+
29+
- name: Install required dependencies
30+
run: npm install
31+
32+
- name: Audit dependencies
33+
run: npm audit --audit-level high
34+
35+
- name: Run linters
36+
run: npm run lint
37+
38+
- name: Pack
39+
run: npm pack
40+
41+
- name: Run tests with coverage
42+
run: npm run test:coverage:spec
43+
44+
- name: Show coverage report
45+
run: npm run test:coverage:report
46+
47+
- name: Send coverage report
48+
run: npx coveralls < coverage/lcov.info
49+
env:
50+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
51+
52+
- name: Clean after tests
53+
run: npm run clean
54+
55+
- name: Check untracked files
56+
run: for f in $(git ls-files --others --exclude-standard); do git diff --no-index --stat --exit-code /dev/null $f; done
57+
58+
node:
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
node-version:
63+
- "22"
64+
- "20"
65+
- "18"
66+
- "16"
67+
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
74+
- name: Setup node
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: ${{ matrix.node-version }}
78+
79+
- name: Install required dependencies
80+
run: npm install
81+
82+
- name: Run tests
83+
run: npm run test:spec

.github/workflows/release.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch: {}
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
name: Release
15+
16+
permissions:
17+
id-token: write
18+
contents: write
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Check if package version matches
27+
run: test "${GITHUB_REF_NAME}" = "v$(jq -r .version package.json)"
28+
29+
- name: Check if changelog version matches
30+
run: grep "^## ${GITHUB_REF_NAME//./\\.} " CHANGELOG.md
31+
32+
- name: Setup node
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: current
36+
registry-url: https://registry.npmjs.org
37+
38+
- name: Install required dependencies
39+
run: npm install
40+
41+
- name: Publish package
42+
run: npm publish --access public
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
45+
46+
- name: Parse changelog
47+
run: sed -n -e '/^## /{n; :a; /^## /q; p; n; ba}' -e 1d CHANGELOG.md | sed '1d' > ${{ github.workspace }}-CHANGELOG.txt
48+
49+
- name: Create release
50+
uses: softprops/action-gh-release@v2
51+
with:
52+
body_path: ${{ github.workspace }}-CHANGELOG.txt

.github/workflows/trunk.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Trunk Check
2+
3+
on:
4+
- pull_request
5+
- push
6+
- workflow_dispatch
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
trunk:
13+
name: Trunk Check
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: "22"
24+
25+
- name: Install required dependencies
26+
run: npm install
27+
28+
- name: Trunk Check
29+
uses: trunk-io/trunk-action@v1
30+
with:
31+
check-mode: all

.mocharc.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
color: true
22
diff: true
3+
no-warnings: true
4+
node-option:
5+
- experimental-specifier-resolution=node
6+
- no-warnings
7+
- loader=ts-node/esm
38
package: ./package.json
4-
require:
5-
- ts-node/register
6-
- source-map-support/register
7-
- mocha-steps
9+
spec:
10+
- test/*.ts
11+
reporter: dot
812
timeout: 90000
13+
throw-deprecation: true
914
ui: bdd

.nycrc.json

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

.renovaterc.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:base",
5+
"group:definitelyTyped",
6+
"group:linters",
7+
"group:monorepos",
8+
"group:testNonMajor",
9+
"group:typescript-eslintMonorepo",
10+
"group:allNonMajor",
11+
"workarounds:typesNodeVersioning"
12+
],
13+
"rangeStrategy": "bump",
14+
"semanticCommits": "disabled",
15+
"packageRules": [
16+
{
17+
"description": "Don't bump engines field in package.json",
18+
"matchPackageNames": ["node"],
19+
"matchManagers": ["npm"],
20+
"matchDepTypes": ["engines"],
21+
"rangeStrategy": "auto"
22+
}
23+
]
24+
}

0 commit comments

Comments
 (0)