Skip to content

Commit d53e17f

Browse files
committed
feat: re-writing in TS + fix all reported bugs + add all effective enhancments + rock to v15
1 parent e64b164 commit d53e17f

File tree

77 files changed

+12507
-2167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+12507
-2167
lines changed

.commitlintrc.js

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

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.editorconfig

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

.github/workflows/ci.yml

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,76 @@ jobs:
1010
os:
1111
- ubuntu-latest
1212
node_version:
13-
- 20
14-
- 22
15-
- 24
13+
- '20'
14+
- '22'
15+
- '24'
16+
- '25'
1617
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920
- name: Setup node
20-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2122
with:
2223
node-version: ${{ matrix.node_version }}
24+
cache: 'yarn'
2325
- name: Install dependencies
24-
run: npm install
25-
- name: Run tests
26-
run: npm run test
26+
run: yarn install --frozen-lockfile
27+
- name: Run lint
28+
run: yarn run lint
29+
- name: Run test coverage
30+
run: yarn run test:coverage
2731

2832
benchmarks:
2933
runs-on: ubuntu-latest
3034
env:
3135
THRESHOLD: 50000
3236
steps:
33-
- name: Setup node
34-
uses: actions/setup-node@v3
35-
with:
36-
node-version: 20
37+
- name: Install wrk
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y wrk
41+
- name: Verify wrk installation
42+
run: |
43+
if ! command -v wrk &> /dev/null; then
44+
echo "Error: wrk installation failed"
45+
exit 1
46+
fi
47+
echo "wrk installed successfully: $(wrk --version 2>&1 | head -1)"
3748
# First checkout master and run benchmarks
3849
- name: Checkout master branch
39-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
4051
with:
4152
ref: master
42-
53+
- name: Check if yarn.lock exists
54+
id: check-yarn-lock
55+
run: |
56+
if [ -f yarn.lock ]; then
57+
echo "exists=true" >> $GITHUB_OUTPUT
58+
echo "yarn.lock found: $(wc -l < yarn.lock) lines"
59+
else
60+
echo "exists=false" >> $GITHUB_OUTPUT
61+
echo "yarn.lock not found on master branch"
62+
fi
63+
- name: Setup node
64+
if: steps.check-yarn-lock.outputs.exists == 'true'
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version: '24'
68+
cache: 'yarn'
69+
- name: Setup node without cache
70+
if: steps.check-yarn-lock.outputs.exists == 'false'
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: '24'
4374
- name: Install dependencies
44-
run: npm install
75+
run: |
76+
if [ -f yarn.lock ]; then
77+
yarn install --frozen-lockfile
78+
else
79+
yarn install
80+
fi
4581
- name: Run benchmarks
46-
run: npm run benchmark || echo "0" > bench-result.txt
82+
run: yarn run benchmark || echo "0" > bench-result.txt
4783
# Store output of bench-result.txt to workflow output
4884
- name: Store benchmark result
4985
id: main_benchmark
@@ -52,12 +88,16 @@ jobs:
5288
5389
# Now checkout the PR branch and run benchmarks
5490
- name: Checkout PR branch
55-
uses: actions/checkout@v3
56-
91+
uses: actions/checkout@v4
92+
- name: Setup node for PR branch
93+
uses: actions/setup-node@v4
94+
with:
95+
node-version: '24'
96+
cache: 'yarn'
5797
- name: Install dependencies
58-
run: npm install
98+
run: yarn install --frozen-lockfile
5999
- name: Run benchmarks
60-
run: npm run benchmark
100+
run: yarn run benchmark
61101
# Store output of bench-result.txt to workflow output
62102
- name: Store benchmark result
63103
id: branch_benchmark
@@ -79,4 +119,3 @@ jobs:
79119
else
80120
echo "Benchmark difference is within acceptable limit (< $THRESHOLD)."
81121
fi
82-

.gitignore

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
1+
# OS #
2+
###################
13
.DS_Store
2-
*.log
34
.idea
4-
node_modules
5-
coverage
6-
.nyc_output
7-
locales/
8-
package-lock.json
9-
yarn.lock
10-
115
Thumbs.db
126
tmp/
137
temp/
8+
bench-result.txt
9+
docs/
10+
11+
# Node.js #
12+
###################
13+
node_modules
14+
15+
16+
# Build #
17+
###################
18+
dist
19+
build
20+
21+
# NYC #
22+
###################
23+
coverage
1424
*.lcov
15-
.env
16-
bench-result.txt
25+
.nyc_output

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx --no-install lint-staged && npm test
4+
npx --no-install lint-staged && npm run test:all

.lintstagedrc.js

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

.lintstagedrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"*.{ts}": ["prettier --write", "eslint --fix"],
3+
"*.{js}": ["prettier --write", "eslint --fix"],
4+
"*.{json,md,yml,yaml}": ["prettier --write"]
5+
}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v24.6.0

.prettierignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
coverage/
7+
8+
# Lock files
9+
yarn.lock
10+
package-lock.json
11+
12+
# Logs
13+
*.log
14+
15+
# OS files
16+
.DS_Store
17+
Thumbs.db
18+
19+
# IDE
20+
.vscode/
21+
.idea/
22+
23+
# Git
24+
.git/
25+
26+
# Temporary files
27+
*.tmp
28+
*.temp
29+

0 commit comments

Comments
 (0)