Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CodSpeed

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
benchmarks:
name: Run benchmarks
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4

- name: Set up Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
with:
node-version: '22'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run benchmarks
uses: CodSpeedHQ/action@v4
with:
mode: simulation
run: pnpm vitest bench --run
2 changes: 1 addition & 1 deletion .github/workflows/nodejs-16.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
node-version: 16
- run: npm install
- run: npm run ci
- run: npm run ci:node16
- run: npm run prepublishOnly
- run: node -v
- run: npm run test-node16
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
3 changes: 2 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@
"id-length": "allow",
"arrow-body-style": "allow",
"prefer-destructuring": "allow"
}
},
"ignorePatterns": ["test/fixtures/ts*"]
}
21 changes: 17 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "git://github.com/node-modules/urllib.git"
},
"scripts": {
"lint": "oxlint src test",
"lint": "oxlint src test --type-aware --type-check",
"fmt": "oxfmt",
"typecheck": "tsc --noEmit && tsgo --noEmit",
"fmtcheck": "oxfmt --check .",
Expand All @@ -40,12 +40,15 @@
"test-tsc:cjs:es2021": "cd test/fixtures/ts-cjs-es2021 && rm -rf node_modules && npm link ../../.. && npm run build",
"test-tsc:esm": "cd test/fixtures/ts-esm && rm -rf node_modules && npm link ../../.. && npm run build",
"test": "npm run lint -- --fix && vitest run",
"bench": "vitest bench",
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vitest run --test-timeout 180000 keep-alive-header.test.ts",
"test-node16": "node examples/httpclient.cjs && node examples/search_github.cjs && node examples/timing.cjs",
"cov": "cross-env NODE_OPTIONS=\"--require ./test/patch-for-node16-18.cjs\" vitest run --coverage",
"cov": "vitest run --coverage",
"ci": "npm run cov && npm run prepublishOnly && npm pack && attw --pack",
"ci:node16": "cross-env NODE_OPTIONS=\"--require ./test/patch-for-node16-18.cjs\" vitest run && npm run prepublishOnly && npm pack && attw --pack",
"clean": "rm -rf dist && tsc -b --clean",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build",
"prepare": "husky"
},
"dependencies": {
"form-data": "^4.0.1",
Expand All @@ -58,6 +61,7 @@
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.0",
"@codspeed/vitest-plugin": "^5.0.1",
"@eggjs/oxlint-config": "^1.0.0",
"@eggjs/tsconfig": "^2.0.0",
"@tsconfig/node18": "^18.2.1",
Expand All @@ -74,9 +78,12 @@
"@vitest/coverage-v8": "^3.0.2",
"busboy": "^1.6.0",
"cross-env": "^10.0.0",
"husky": "^9.1.7",
"iconv-lite": "^0.6.3",
"lint-staged": "^16.2.7",
"oxfmt": "^0.17.0",
"oxlint": "^1.11.0",
"oxlint-tsgolint": "^0.10.0",
"proxy": "^1.0.2",
"selfsigned": "^3.0.0",
"string.prototype.towellformed": "^1.0.2",
Expand Down Expand Up @@ -117,5 +124,11 @@
"types": "./dist/commonjs/index.d.ts",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
"packageManager": "pnpm@10.25.0"
"packageManager": "pnpm@10.25.0",
"lint-staged": {
"*": [
"npm run lint -- --fix",
"oxfmt"
]
}
}
Loading
Loading