Skip to content

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Jan 19, 2025

BREAKING CHANGE: drop Node.js < 18.19.0 support

part of eggjs/egg#3644

eggjs/egg#5257

Summary by CodeRabbit

Release Notes

  • Package Upgrade

    • Renamed package from egg-session to @eggjs/session
    • Updated Node.js compatibility to version 18.19.0+
  • New Features

    • Enhanced session configuration with improved type safety
    • Added support for more granular session management
    • Improved logging and security configurations
  • Breaking Changes

    • Dropped support for Node.js versions below 18.19.0
    • Migrated from generator functions to async/await syntax
    • Updated session middleware and configuration structure
  • Performance

    • Updated dependencies, including koa-session to version 7.0.2
    • Optimized session store handling
  • Security

    • Strengthened default session configurations
    • Added warnings for potential security risks in session settings

BREAKING CHANGE: drop Node.js < 18.19.0 support

part of eggjs/egg#3644

eggjs/egg#5257
@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2025

Warning

Rate limit exceeded

@fengmk2 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e963508 and 89d70d3.

📒 Files selected for processing (1)
  • .github/workflows/nodejs.yml (1 hunks)

Walkthrough

The pull request introduces a comprehensive overhaul of the @eggjs/session package, transitioning from a CommonJS-based implementation to a modern TypeScript-based module. The changes include renaming the package, updating dependencies, modernizing the codebase with async/await syntax, enhancing type safety, and improving the overall project structure. The modifications span configuration files, source code, and test fixtures, reflecting a significant architectural update to the session management library.

Changes

File Change Summary
.eslintignore Added test/fixtures and __snapshots__ to ignored directories
.eslintrc Updated ESLint configuration to use multiple specific configurations
.github/workflows/nodejs.yml Updated Node.js versions and workflow file
.github/workflows/pkg.pr.new.yml New workflow for package publishing
.gitignore Added new entries like .DS_Store, .tshy*, .eslintcache, dist
README.md Renamed package, updated badges and installation instructions
package.json Major updates to package name, dependencies, scripts, and configuration
src/ Comprehensive rewrite with TypeScript implementation
test/ Updated test fixtures to use async/await and modern syntax
tsconfig.json New TypeScript configuration file

Poem

🐰 Hop, hop, hurray! A session's new way!
Code transformed with TypeScript's might
Async functions dancing bright
From CommonJS to modern's embrace
Our session library runs with grace! 🍪


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@socket-security
Copy link

socket-security bot commented Jan 19, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@arethetypeswrong/cli@0.17.3 Transitive: environment, filesystem, network, shell, unsafe +49 31.4 MB andrewbranch
npm/@eggjs/bin@7.0.2 environment Transitive: eval, filesystem, network, shell, unsafe +237 21.6 MB fengmk2
npm/@eggjs/core@6.2.13 environment Transitive: eval, filesystem, network, unsafe +95 4.65 MB fengmk2
npm/@eggjs/mock@6.0.5 environment Transitive: eval, filesystem, network, shell, unsafe +171 13.7 MB fengmk2
npm/@eggjs/supertest@8.2.0 Transitive: environment, eval, filesystem, network +42 2.06 MB fengmk2
npm/@eggjs/tsconfig@1.3.3 None 0 4.23 kB fengmk2
npm/@types/mocha@10.0.10 None 0 96.1 kB types
npm/@types/node@22.10.7 None +1 2.37 MB types
npm/egg-redis@2.6.0 🔁 npm/egg-redis@1.0.2 Transitive: environment, network +16 648 kB fengmk2
npm/egg@4.0.1 🔁 npm/egg@3.30.0 Transitive: environment, eval, shell +200 19.8 MB fengmk2
npm/eslint-config-egg@14.0.0 🔁 npm/eslint-config-egg@12.3.1 Transitive: environment, eval, filesystem, unsafe +175 18.9 MB fengmk2
npm/koa-session@7.0.2 environment +5 464 kB fengmk2
npm/rimraf@6.0.1 environment, filesystem Transitive: shell +30 2.55 MB isaacs
npm/snap-shot-it@7.9.10 environment, filesystem Transitive: network, unsafe +40 3.92 MB bahmutov
npm/tshy-after@1.4.0 None 0 27.6 kB fengmk2
npm/tshy@3.0.2 environment, filesystem, shell Transitive: unsafe +50 3.2 MB isaacs
npm/typescript@5.7.3 None 0 22.7 MB typescript-bot
npm/zod@3.24.1 None 0 0 B

View full report↗︎

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 19, 2025

Open in Stackblitz

npm i https://pkg.pr.new/eggjs/session/@eggjs/session@20

commit: 89d70d3

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (9)
src/app/extend/application.ts (1)

34-34: Typo in log message: 'overwrite' should be 'overwritten'

The log message on line 34 should read 'will be overwritten' instead of 'will be overwrite'.

Apply this diff to fix the typo:

- this.coreLogger.warn('[@eggjs/session] sessionStore already exists and will be overwrite');
+ this.coreLogger.warn('[@eggjs/session] sessionStore already exists and will be overwritten');
test/fixtures/samesite-none-session/app/controller/home.js (1)

1-3: Consider migrating test fixtures to TypeScript.

While the async/await changes are good, consider migrating test fixtures to TypeScript to maintain consistency with the project's TypeScript migration. This would provide better type safety and IDE support.

The async function changes look good and align with modern JavaScript practices.

Also applies to: 5-8

src/config/config.default.ts (1)

10-17: Consider documenting security implications of configuration options.

While the default values are reasonable, it would be helpful to add JSDoc comments explaining:

  • The security implications of httpOnly and encrypt
  • The impact of maxAge on session lifetime
  • The purpose of logValue and when to disable it
test/fixtures/memory-session-generator/app/controller/home.js (1)

1-23: Consider removing unnecessary async keywords.

Since none of these functions perform any asynchronous operations, the async keyword is unnecessary and adds overhead. Consider removing it from all the functions unless there are plans to add async operations in the future.

-exports.get = async function(ctx) {
+exports.get = function(ctx) {
   ctx.body = ctx.session;
 };

-exports.set = async function(ctx) {
+exports.set = function(ctx) {
   ctx.session = ctx.query;
   ctx.body = ctx.session;
 };

-exports.setKey = async function(ctx) {
+exports.setKey = function(ctx) {
   ctx.session.key = ctx.query.key;
   ctx.body = ctx.session;
 };

-exports.remove = async function(ctx) {
+exports.remove = function(ctx) {
   ctx.session = null;
   ctx.body = ctx.session;
 };

-exports.maxAge = async function(ctx) {
+exports.maxAge = function(ctx) {
   ctx.session.maxAge = Number(ctx.query.maxAge);
   ctx.body = ctx.session;
 };
src/app.ts (2)

15-17: Enhance security warning message for httpOnly.

The warning message could be more specific about the security implications. Consider adding details about potential XSS attacks and session hijacking risks.

-      app.coreLogger.warn('[@eggjs/session]: please set `config.session.httpOnly` to true. It is very dangerous if session can read by client JavaScript.');
+      app.coreLogger.warn('[@eggjs/session]: please set `config.session.httpOnly` to true. Setting this to false exposes sessions to XSS attacks and potential session hijacking through client-side JavaScript.');

20-28: Improve type safety and structure of event logging.

The event handlers could benefit from:

  1. Type-safe event names using string literals
  2. Structured logging format for better parsing
+  type SessionEventName = 'session:missed' | 'session:expired' | 'session:invalid';
+  interface SessionEventPayload {
+    ctx: Context;
+    key: string;
+    value?: unknown;
+  }
+
   // listen on session's events
-  app.on('session:missed', ({ ctx, key }) => {
-    ctx.coreLogger.warn('[session][missed] key(%s)', key);
+  app.on<SessionEventName>('session:missed', ({ ctx, key }: SessionEventPayload) => {
+    ctx.coreLogger.warn({ event: 'session:missed', key });
   });
test/app/middleware/session.test.ts (1)

144-144: Improve test reliability by using constants for wait durations.

The hardcoded wait durations (200ms, 1000ms) could make tests flaky. Consider:

  1. Using named constants for better maintainability
  2. Implementing a more reliable way to detect session expiration
+const TEST_DELAYS = {
+  SHORT_EXPIRY: 200,
+  LONG_EXPIRY: 1000,
+} as const;

-await scheduler.wait(200);
+await scheduler.wait(TEST_DELAYS.SHORT_EXPIRY);

Also applies to: 166-166, 174-174, 192-192

README.md (1)

26-26: Add peer dependency information to installation instructions

Since the package now requires Node.js ≥ 18.19.0, this should be clearly documented in the installation section.

Add peer dependency information:

npm i @eggjs/session
+
+## Prerequisites
+
+- Node.js >= 18.19.0
test/fixtures/cookie-session/app/controller/home.js (1)

1-22: Consider implementing a shared test utility.

Given the identical structure across multiple test fixtures, consider implementing a shared test utility that these controllers can extend. This would:

  • Reduce code duplication
  • Ensure consistent behavior across test scenarios
  • Make maintenance easier

Would you like me to propose a design for this shared test utility?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f57f24e and 6a99093.

📒 Files selected for processing (35)
  • .eslintignore (1 hunks)
  • .eslintrc (1 hunks)
  • .github/workflows/nodejs.yml (1 hunks)
  • .github/workflows/pkg.pr.new.yml (1 hunks)
  • .gitignore (1 hunks)
  • README.md (2 hunks)
  • __snapshots__/session.test.ts.js (1 hunks)
  • app.js (0 hunks)
  • app/extend/application.js (0 hunks)
  • app/middleware/session.js (0 hunks)
  • config/config.default.js (0 hunks)
  • package.json (1 hunks)
  • src/app.ts (1 hunks)
  • src/app/extend/application.ts (1 hunks)
  • src/app/middleware/session.ts (1 hunks)
  • src/config/config.default.ts (1 hunks)
  • src/index.ts (1 hunks)
  • src/types.ts (1 hunks)
  • src/typings/index.d.ts (1 hunks)
  • test/app/middleware/session.test.ts (11 hunks)
  • test/fixtures/chips/app/controller/home.js (0 hunks)
  • test/fixtures/chips/app/router.js (0 hunks)
  • test/fixtures/cookie-session/app/controller/home.js (1 hunks)
  • test/fixtures/httponly-false-session/app/controller/home.js (1 hunks)
  • test/fixtures/logValue-false-session/app/controller/home.js (1 hunks)
  • test/fixtures/memory-session-generator/app.js (1 hunks)
  • test/fixtures/memory-session-generator/app/controller/home.js (1 hunks)
  • test/fixtures/memory-session/app.js (1 hunks)
  • test/fixtures/memory-session/app/router.js (0 hunks)
  • test/fixtures/redis-session/app.js (1 hunks)
  • test/fixtures/redis-session/app/controller/home.js (1 hunks)
  • test/fixtures/redis-session/app/router.js (0 hunks)
  • test/fixtures/samesite-none-session/app/controller/home.js (1 hunks)
  • test/fixtures/session-maxage-session/app/controller/home.js (1 hunks)
  • tsconfig.json (1 hunks)
💤 Files with no reviewable changes (8)
  • test/fixtures/chips/app/router.js
  • test/fixtures/memory-session/app/router.js
  • test/fixtures/redis-session/app/router.js
  • test/fixtures/chips/app/controller/home.js
  • app/extend/application.js
  • app/middleware/session.js
  • config/config.default.js
  • app.js
✅ Files skipped from review due to trivial changes (5)
  • tsconfig.json
  • .eslintignore
  • src/index.ts
  • .gitignore
  • src/typings/index.d.ts
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Node.js / Test (windows-latest, 22)
  • GitHub Check: Node.js / Test (windows-latest, 20)
  • GitHub Check: Node.js / Test (windows-latest, 18.19.0)
  • GitHub Check: Node.js / Test (macos-latest, 20)
🔇 Additional comments (19)
test/fixtures/memory-session/app.js (1)

3-23: Correct implementation of AppBootHook for session store setup

The AppBootHook class properly initializes the sessionStore in the willReady lifecycle method. This ensures that the session store is set up before the application is ready, following the appropriate lifecycle hook usage.

src/app/extend/application.ts (1)

32-51: Verify modifying this.config.session.store at runtime

The setter for sessionStore modifies this.config.session.store at runtime. Typically, configuration objects in Egg.js are immutable during runtime. Please verify that changing this.config.session.store dynamically will not cause unexpected behavior in the application.

src/app/middleware/session.ts (1)

1-3: Correctly exporting session middleware

The createSession function from koa-session is correctly imported and exported as the default export. This allows the middleware to be integrated seamlessly into the application.

src/types.ts (1)

1-8: Verify package exports configuration for dual CJS/ESM support.

The relative import with .js extension might cause issues:

  1. TypeScript typically doesn't require .js extensions in imports
  2. For dual CJS/ESM support, package exports need careful configuration

Let's verify the package.json exports configuration:

✅ Verification successful

The .js extension in imports is correct and follows best practices

The current implementation follows the recommended TypeScript practices:

  • Using NodeNext module resolution which requires .js extensions
  • Consistent usage across the codebase
  • Proper package exports configuration for dual CJS/ESM support
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check package.json for proper exports configuration
cat package.json | jq '.exports'

# Verify if config.default.js exists in both CJS and ESM outputs
fd -e js 'config.default.js$'

Length of output: 850


Script:

#!/bin/bash
# Find config.default.ts source file
fd -e ts 'config.default.ts$'

# Check tsconfig for module settings
cat tsconfig.json | jq '.compilerOptions.module,.compilerOptions.moduleResolution'

# Verify if there are any other imports using .js extension
rg "from.*\.js[\"']" --type ts

Length of output: 505

__snapshots__/session.test.ts.js (1)

1-12: Document session configuration and consider snapshot format.

The session configuration looks good with secure defaults:

  • httpOnly: true for XSS protection
  • signed: true for tampering protection
  • maxAge: 86400000 (24 hours) is reasonable

However:

  1. The empty store: {} might need documentation
  2. The snapshot uses CJS exports despite having .ts in the filename

Let's check if this is a Jest snapshot convention:

src/config/config.default.ts (1)

4-8: LGTM! Good use of zod for runtime type safety.

The schema extends SessionOptions and adds type-safe configuration with runtime validation. Exporting both the schema and inferred type is a good practice for TypeScript integration.

test/fixtures/redis-session/app/controller/home.js (1)

1-23: Same feedback as memory-session-generator controller.

The async keywords are unnecessary here as well since no asynchronous operations are performed.

test/fixtures/logValue-false-session/app/controller/home.js (1)

1-23: Same feedback as previous controllers.

The async keywords are unnecessary here as well since no asynchronous operations are performed.

test/fixtures/redis-session/app.js (1)

7-20: LGTM! Proper async/await implementation with Redis operations.

The conversion from generator functions to async/await is well implemented:

  • All Redis operations are properly awaited
  • Error cases are handled (null check in get)
  • JSON serialization is done at the right time (before Redis operations)
.eslintrc (1)

2-5: LGTM! Good ESLint configuration for TypeScript.

The ESLint configuration properly extends TypeScript-specific rules and enforces node prefix conventions.

.github/workflows/nodejs.yml (1)

12-14: LGTM! Node.js version requirements aligned with PR objectives.

The CI configuration correctly enforces the new minimum Node.js version requirement of 18.19.0.

Let's verify that all package.json files in the repository are consistent with this Node.js version requirement:

✅ Verification successful

Node.js version requirements are consistently defined across the repository

The main package.json correctly specifies >= 18.19.0 as the minimum Node.js version requirement, which aligns perfectly with the CI workflow testing against versions 18.19.0, 20, and 22. Test fixture package.json files don't need explicit version requirements as they inherit from the root configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find all package.json files and check their Node.js version requirements
fd package.json --type f --exec sh -c 'echo "Checking {}" && cat {} | jq -r ".engines.node // empty"'

Length of output: 646

package.json (4)

72-84: LGTM: Proper dual module configuration

The exports field is correctly configured for dual CJS/ESM support:

  • Provides separate entry points for import/require
  • Includes proper type definitions
  • Maintains backward compatibility

66-71: LGTM: Proper tshy configuration

The tshy configuration correctly specifies the entry points for building both CJS and ESM formats.


32-34: Verify compatibility with updated dependencies

Major version updates that need verification:

  • koa-session: ^6.0.0 → ^7.0.2
  • Added new dependency: zod ^3.24.1

Let's check for breaking changes:

✅ Verification successful

Dependencies update is compatible

  • Node.js version requirement (>= 18.19.0) matches koa-session v7
  • zod is correctly integrated for session configuration validation
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check changelogs for breaking changes
gh api graphql -f query='
{
  repository(owner: "koajs", name: "session") {
    releases(first: 1, orderBy: {field: CREATED_AT, direction: DESC}) {
      nodes {
        tagName
        description
      }
    }
  }
}'

Length of output: 734


Script:

#!/bin/bash
# Check koa-session v7.0.0 release notes
gh api graphql -f query='
{
  repository(owner: "koajs", name: "session") {
    release(tagName: "v7.0.0") {
      description
    }
  }
}
'

# Search for zod usage
rg -l "zod" --type ts --type js

Length of output: 736


Script:

#!/bin/bash
# Check Node.js version in package.json
cat package.json | jq .engines

# Check zod usage
cat src/config/config.default.ts

Length of output: 483


28-30: Verify Node.js version compatibility

The engine requirement aligns with the PR objective to drop support for Node.js versions earlier than 18.19.0.

Let's verify this doesn't conflict with dependencies:

✅ Verification successful

Node.js version requirement is appropriate

The Node.js engine requirement of >= 18.19.0 is well-aligned with:

  • The modern dependency versions being used
  • The development tooling requirements
  • The @eggjs ecosystem's latest major versions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if any dependencies have conflicting Node.js version requirements
npx ls-engines

Length of output: 110


Script:

#!/bin/bash
# Get all dependencies and their engine requirements
echo "Main package.json dependencies:"
jq -r '.dependencies, .devDependencies | to_entries[] | .key + "@" + .value' package.json

echo -e "\nSearching for Node.js engine requirements in the codebase:"
rg -g "package.json" '"engines":\s*{[^}]*"node":[^}]*}' -A 1

Length of output: 794


Script:

#!/bin/bash
# Search for Node.js engine requirements with fixed regex
echo "Searching for Node.js engine requirements:"
rg -g "package.json" '"engines"' -A 3

Length of output: 249

README.md (1)

8-10: LGTM: Improved repository status visibility

Added helpful badges:

  • Node.js version compatibility
  • PR welcome status
  • CodeRabbit PR reviews
test/fixtures/session-maxage-session/app/controller/home.js (1)

1-3: Consider the necessity of async functions.

While the conversion from generator functions to async functions is syntactically correct, none of these methods contain any await operations. Consider whether these methods truly need to be asynchronous.

Run this script to check if there are any async operations in the session middleware that these controllers interact with:

Also applies to: 5-7, 10-12, 15-17, 20-22

test/fixtures/httponly-false-session/app/controller/home.js (1)

1-22: LGTM! Well-structured implementation.

The code correctly implements session handling with proper type conversion for maxAge values.

test/fixtures/cookie-session/app/controller/home.js (1)

1-22: LGTM! Verify dual module system compatibility.

The implementation is correct and consistent with other fixtures.

Given the PR's objective to support both CJS and ESM, let's verify the module system compatibility:

✅ Verification successful

Module system compatibility verified successfully

The implementation maintains proper separation between ESM (source code) and CJS (test fixtures) with correct dual module system support configured in package.json.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for potential module system compatibility issues
# Look for mixed usage of require/import or module.exports/export
rg -l "require|import|exports|module\.exports" | grep -v "node_modules" | xargs rg "require|import|exports|module\.exports"

Length of output: 7795

@fengmk2 fengmk2 merged commit b1a96e5 into master Jan 19, 2025
11 checks passed
@fengmk2 fengmk2 deleted the egg-v4 branch January 19, 2025 09:53
fengmk2 pushed a commit that referenced this pull request Jan 19, 2025
[skip ci]

## [4.0.0](v3.3.0...v4.0.0) (2025-01-19)

### ⚠ BREAKING CHANGES

* 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

## Release Notes

- **Package Upgrade**
	- Renamed package from `egg-session` to `@eggjs/session`
	- Updated Node.js compatibility to version 18.19.0+

- **New Features**
	- Enhanced session configuration with improved type safety
	- Added support for more granular session management
	- Improved logging and security configurations

- **Breaking Changes**
	- Dropped support for Node.js versions below 18.19.0
	- Migrated from generator functions to async/await syntax
	- Updated session middleware and configuration structure

- **Performance**
	- Updated dependencies, including `koa-session` to version 7.0.2
	- Optimized session store handling

- **Security**
	- Strengthened default session configurations
	- Added warnings for potential security risks in session settings
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

### Features

* support cjs and esm both by tshy ([#20](#20)) ([b1a96e5](b1a96e5))
@codecov
Copy link

codecov bot commented Jul 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f57f24e) to head (89d70d3).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##           master       #20       +/-   ##
============================================
+ Coverage   89.65%   100.00%   +10.34%     
============================================
  Files           4         4               
  Lines          87       109       +22     
  Branches       14        16        +2     
============================================
+ Hits           78       109       +31     
+ Misses          9         0        -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants