Skip to content

Commit 15cddc2

Browse files
committed
Refactor
Refactor Refactor Refactor Refactor
1 parent 12f0338 commit 15cddc2

12 files changed

Lines changed: 1888 additions & 1666 deletions

File tree

.github/workflows/build.yml

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,58 @@ name: Build
66
on: ["push", "pull_request"]
77

88
jobs:
9-
build:
9+
test-node:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [16.x, 18.x, 20.x, 22.x]
13+
node-version: [18.x, 20.x, 22.x] # Node 24 is not an LTS version yet, can be added later if needed.
1414
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v2
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
1720
with:
1821
node-version: ${{ matrix.node-version }}
19-
- run: npm i
20-
- run: npm run build
21-
- run: npm test
22-
- uses: coverallsapp/github-action@master
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Run build
27+
run: npm run build
28+
29+
- name: Run tests
30+
run: npm run test
31+
32+
- name: Generate and upload coverage report
33+
if: matrix.node-version == '22.x' # Only run coverage on the latest LTS version
34+
run: npm run coverage
35+
36+
- name: Upload coverage to Coveralls
37+
if: matrix.node-version == '22.x'
38+
uses: coverallsapp/github-action@v2
2339
with:
2440
github-token: ${{ secrets.GITHUB_TOKEN }}
25-
- uses: codecov/codecov-action@v1
41+
42+
- name: Upload coverage to Codecov
43+
if: matrix.node-version == '22.x'
44+
uses: codecov/codecov-action@v4
45+
with:
46+
token: ${{ secrets.CODECOV_TOKEN }} # It's recommended to use a repository upload token
47+
48+
49+
# --- New Job for Bun ---
50+
test-bun:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
56+
- name: Set up Bun
57+
uses: oven-sh/setup-bun@v1
58+
59+
- name: Install dependencies
60+
run: bun install
61+
62+
- name: Run tests with Bun
63+
run: bun run test

.github/workflows/npm-publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node-version: [16.x, 18.x, 20.x, 22.x]
15+
node-version: [18.x, 20.x, 22.x, 22.x]
1616
steps:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-node@v2
1919
with:
2020
node-version: ${{ matrix.node-version }}
2121
- run: npm i
2222
- run: npm run build
23-
- run: npm test
24-
- uses: coverallsapp/github-action@master
23+
- run: npm run test
24+
- run: npm run coverage
25+
- uses: coverallsapp/github-action@main
2526
with:
2627
github-token: ${{ secrets.GITHUB_TOKEN }}
2728
- uses: codecov/codecov-action@v1

.mocharc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"loader": "ts-node/esm",
3+
"extensions": ["ts"],
4+
"spec": ["test/*.ts"],
5+
"timeout": "4000ms"
6+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Use NPM to install:
9292
- `links` : All links on this page.
9393
- `meta` : All the meta tags that with a `property` or `name` attribute. e.g `<meta property="author" content="Example">`, `<meta name="description" content="Example.">`
9494
- `headers` : HTTP headers, lowercasing field names much like node does.
95-
- `language` : Content language (ISO 639-1) based on meta data/headers, falling back to detection by [franc](https://www.npmjs.com/package/franc).
95+
- `language` : Content language (ISO 639-1) based on meta data/headers.
9696

9797
## License
9898

0 commit comments

Comments
 (0)