Skip to content

Commit

Permalink
feat: support cjs and esm both by tshy (#67)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop Node.js < 18.19.0 support

part of eggjs/egg#3644

eggjs/egg#5257

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
  - Introduced a new middleware for handling multipart requests.
  - Added improved error handling for oversized file uploads.

- **Refactor**
- Streamlined configuration and context enhancements for better
stability and TypeScript support.
- Modernized the codebase by transitioning to ES modules and updating
type definitions.

- **Chores**
- Updated package metadata, dependencies, and continuous integration
settings to support newer Node.js versions.
- Introduced a new TypeScript configuration for stricter type-checking.

- **Tests**
- Added unit tests to validate application behavior under incorrect
configurations.
- Established comprehensive tests for multipart form handling to ensure
correct processing of file uploads.
- Transitioned existing tests to TypeScript and updated assertions for
consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
fengmk2 authored Feb 3, 2025
1 parent fa296f0 commit ccefb3e
Show file tree
Hide file tree
Showing 37 changed files with 955 additions and 822 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
test/fixtures
node_modules
coverage
__snapshots__
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "eslint-config-egg"
"extends": [
"eslint-config-egg/typescript",
"eslint-config-egg/lib/rules/enforce-node-prefix"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
with:
os: 'ubuntu-latest, macos-latest, windows-latest'
version: '16, 18, 20, 22'
version: '18, 20, 22'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ test/fixtures/**/run
*-lock.yaml
test/fixtures/apps/ts/tsconfig.tsbuildinfo
test/fixtures/apps/ts/**/*.d.ts
.tshy*
.eslintcache
dist
22 changes: 0 additions & 22 deletions app.js

This file was deleted.

17 changes: 0 additions & 17 deletions app/middleware/multipart.js

This file was deleted.

52 changes: 0 additions & 52 deletions config/config.default.js

This file was deleted.

119 changes: 0 additions & 119 deletions index.d.ts

This file was deleted.

79 changes: 0 additions & 79 deletions lib/utils.js

This file was deleted.

Loading

0 comments on commit ccefb3e

Please sign in to comment.