Skip to content

Commit 0be5f8e

Browse files
fengmk2claude
andcommitted
feat: merge @eggjs/supertest repository into monorepo
- Add packages/supertest directory with complete @eggjs/supertest v8.2.0 codebase - Merge @eggjs/supertest repository from master branch into packages/supertest - Update supertest package.json for monorepo integration: * Change repository URLs to monorepo structure * Convert npm scripts to pnpm commands and tsdown build system * Update Node.js engine requirement to >= 20.19.0 (from >= 18.19.0) * Convert all dependencies to use pnpm catalog references * Replace tshy build system with tsdown unbundle mode * Add vitest testing support for modern testing - Add supertest-specific dependencies to pnpm workspace catalog: * HTTP testing: @types/superagent, superagent, express, body-parser * Testing utilities: nock, nyc, should, cookie-parser * Type definitions: @types/body-parser, @types/express, etc. - Update workspace dependencies in other packages: * packages/core: @eggjs/supertest → workspace:* - Update tsconfig.json with packages/supertest project reference - Create tsdown.config.ts and vitest.config.ts for consistent tooling - Update CLAUDE.md with packages/supertest documentation This brings the HTTP testing utilities directly into the monorepo for better integration and unified development workflow. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b0328c6 commit 0be5f8e

26 files changed

+2832
-1
lines changed

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ This is the **Eggjs** framework - a progressive Node.js framework for building e
3030
- **`packages/koa/`** - Koa web framework (merged from @eggjs/koa)
3131
- `src/` - Koa TypeScript source code
3232
- `test/` - Koa test suite
33+
- **`packages/supertest/`** - HTTP testing utilities (merged from @eggjs/supertest)
34+
- `src/` - Supertest TypeScript source code
35+
- `test/` - Supertest test suite
3336
- **`examples/`** - Example applications
3437
- `helloworld-commonjs/` - CommonJS example
3538
- `helloworld-typescript/` - TypeScript example

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"devDependencies": {
6464
"@eggjs/mock": "workspace:*",
65-
"@eggjs/supertest": "catalog:",
65+
"@eggjs/supertest": "workspace:*",
6666
"@eggjs/tsconfig": "catalog:",
6767
"@types/js-yaml": "catalog:",
6868
"@types/node": "catalog:",

packages/supertest/.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"eslint-config-egg/typescript",
4+
"eslint-config-egg/lib/rules/enforce-node-prefix"
5+
]
6+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
Job:
11+
name: Node.js
12+
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
13+
with:
14+
version: '18.19.0, 18, 20, 22, 23'
15+
secrets:
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish Any Commit
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- run: corepack enable
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
17+
- name: Install dependencies
18+
run: npm install
19+
20+
- name: Build
21+
run: npm run prepublishOnly --if-present
22+
23+
- run: npx pkg-pr-new publish
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
release:
9+
name: Node.js
10+
uses: eggjs/github-actions/.github/workflows/node-release.yml@master
11+
secrets:
12+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
13+
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}

packages/supertest/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# OS #
2+
###################
3+
.DS_Store
4+
.idea
5+
Thumbs.db
6+
tmp/
7+
temp/
8+
9+
10+
# Node.js #
11+
###################
12+
node_modules
13+
14+
15+
# NYC #
16+
###################
17+
coverage
18+
*.lcov
19+
.nyc_output
20+
21+
22+
# Files #
23+
###################
24+
*.log
25+
.tshy*
26+
.eslintcache
27+
dist
28+
coverage

packages/supertest/CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Changelog
2+
3+
## [8.2.0](https://github.com/eggjs/supertest/compare/v8.1.1...v8.2.0) (2025-01-17)
4+
5+
6+
### Features
7+
8+
* support trace method request ([#4](https://github.com/eggjs/supertest/issues/4)) ([1e3d92b](https://github.com/eggjs/supertest/commit/1e3d92bc194b2391e4be9bb0a38ed263255e8f46))
9+
10+
## [8.1.1](https://github.com/eggjs/supertest/compare/v8.1.0...v8.1.1) (2024-12-22)
11+
12+
13+
### Bug Fixes
14+
15+
* add @types/superagent to dependencies ([#3](https://github.com/eggjs/supertest/issues/3)) ([ec0a012](https://github.com/eggjs/supertest/commit/ec0a012345f397258ceb6ed72df0887b34ad9566))
16+
17+
## [8.1.0](https://github.com/eggjs/supertest/compare/v8.0.0...v8.1.0) (2024-12-21)
18+
19+
20+
### Features
21+
22+
* expect header exists or not ([#2](https://github.com/eggjs/supertest/issues/2)) ([e5060b0](https://github.com/eggjs/supertest/commit/e5060b05c7d35830f9baa2e59324bf5ce446db27))
23+
24+
## [8.0.0](https://github.com/eggjs/supertest/compare/v7.0.0...v8.0.0) (2024-12-21)
25+
26+
27+
### ⚠ BREAKING CHANGES
28+
29+
* drop Node.js < 18.19.0 support
30+
31+
part of https://github.com/eggjs/egg/issues/3644
32+
33+
https://github.com/eggjs/egg/issues/5257
34+
35+
<!-- This is an auto-generated comment: release notes by coderabbit.ai
36+
-->
37+
38+
## Summary by CodeRabbit
39+
40+
- **New Features**
41+
- Introduced a new `TestAgent` class for enhanced HTTP and HTTP/2
42+
requests.
43+
- Added a new `Request` class to facilitate server requests.
44+
- Implemented a new `AssertError` class for improved error handling.
45+
- Created new GitHub Actions workflows for CI and package publishing.
46+
47+
- **Documentation**
48+
- Updated the `README.md` to reflect rebranding to `@eggjs/supertest`
49+
and revised installation instructions.
50+
51+
- **Bug Fixes**
52+
- Enhanced error handling and type safety in tests.
53+
54+
- **Chores**
55+
- Removed outdated configuration files and unnecessary dependencies.
56+
- Updated TypeScript configuration for stricter type checking.
57+
58+
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
59+
60+
### Features
61+
62+
* support cjs and esm both by tshy ([#1](https://github.com/eggjs/supertest/issues/1)) ([09fb755](https://github.com/eggjs/supertest/commit/09fb7555aecebc2047cd68efafe0f54dc17b6108))

packages/supertest/LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(The MIT License)
2+
3+
Copyright (c) 2014 TJ Holowaychuk <[email protected]>
4+
Copyright (c) 2024-present eggjs and the contributors.
5+
6+
Permission is hereby granted, free of charge, to any person obtaining
7+
a copy of this software and associated documentation files (the
8+
'Software'), to deal in the Software without restriction, including
9+
without limitation the rights to use, copy, modify, merge, publish,
10+
distribute, sublicense, and/or sell copies of the Software, and to
11+
permit persons to whom the Software is furnished to do so, subject to
12+
the following conditions:
13+
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)