Skip to content

fix(next-iron-session): modernize App Router examples for Next.js 16#30

Closed
riceharvest wants to merge 59 commits intomainfrom
fix/next-iron-session-examples
Closed

fix(next-iron-session): modernize App Router examples for Next.js 16#30
riceharvest wants to merge 59 commits intomainfrom
fix/next-iron-session-examples

Conversation

@riceharvest
Copy link
Owner

Closes #27.

  • Updated protected-middleware and protected-server examples to use modern Next.js 16 patterns.
  • Replaced broken revalidate = 0 and dynamic flags with proper force-dynamic and cookies() handling.
  • Correctly awaited cookies() as required by Next.js 16 async APIs.
  • Verified core package with full test suite (24/24 passed).

- Upgraded multiple packages to modern standards (Next.js, Next-auth, PWA, SEO).
- Added new utility packages: critters, next-circuit-breaker, next-csrf, next-images, next-json-ld.
- Integrated Changesets for versioning.
- Updated CI/CD workflows and linting configurations.
- Fixed numerous linting and type-checking issues across the monorepo.
- Remove legacy NextAuth adapters and resolve workspace version conflicts
- Clean up test warning noise and fix tsconfig/jest setups for next-auth
- Update Workbox/Terser dependencies in next-pwa to align with workspace
- Synchronize root lockfile to reflect nested package resolutions
Fixes `JWT_AUTO_GENERATED_SIGNING_KEY` and `JWT_AUTO_GENERATED_ENCRYPTION_KEY`
warnings properly by supplying JWKs directly in the test suite rather
than mocking the logger.
@qodo-code-review
Copy link

Review Summary by Qodo

Comprehensive modernization of test infrastructure, security enhancements, and new MDX/Auth systems with improved type safety

✨ Enhancement 🧪 Tests 🐞 Bug fix

Grey Divider

Walkthroughs

Description
• **Comprehensive modernization of test infrastructure**: Migrated multiple test suites from
  Jest/Vitest to Node.js native test runner (node:test) and updated Vitest assertions to modern
  syntax across next-iron-session, next-images, next-csrf, next-cookies, and
  react-virtualized packages
• **CSRF security enhancements**: Added flexible token extraction with getRequestToken() helper,
  implemented App Router CSRF verification for Server Actions, separated cookie security policies for
  secrets vs tokens, and added new error codes for token validation
• **MDX content system**: Created complete MDX module with file discovery (get-files.ts), node
  retrieval with caching (get-nodes.ts), configuration loading (get-config.ts), table of contents
  generation, and client-side hydration utilities
• **React Query Auth example**: Implemented full authentication system with mock database (user
  management, password hashing), MSW API handlers, authentication configuration, and comprehensive API
  client
• **Session utilities enhancement**: Added duration unit parsing (s, m, h, d) to parseTime(),
  improved cookie serialization, and enhanced type safety with explicit type exports
• **Build and configuration improvements**: Updated tsup configurations for multiple packages,
  simplified Vitest setups, added Next.js 13+ native transpilePackages support detection, and
  refactored plugin composition logic
• **Type safety improvements**: Added explicit type imports and exports, improved TypeScript
  compatibility with type casting, created comprehensive type definitions for PWA and
  react-virtualized
• **Security fixes**: Fixed CSS inlining robustness in Critters with proper stylesheet handling and
  URL sanitization, improved container detection with fallback logic
• **Plugin system enhancements**: Implemented core plugin composition with phase-based filtering,
  optional plugin resolution, and configuration merging for next-compose-plugins
• **Image optimization**: Created complete image optimization system with loader detection, resource
  query configuration, webpack integration, and support for multiple image formats
• **NextAuth improvements**: Migrated JWT tests to Vitest with cryptographic key fixtures,
  implemented Prisma legacy adapter, added OAuth client cleanup, and created build configuration with
  auto-generated provider exports
• **Cookie optimization**: Added singleton browser cookie instance caching to reduce unnecessary
  instantiation
• **Iron-session compatibility**: Improved type flexibility for crypto handling with broader
  compatibility
• **Test coverage additions**: Added comprehensive test suites for CSRF middleware, optional
  plugins, phase-based configuration, plugin composition, MDX functionality, and image optimization
  loaders
Diagram
flowchart LR
  A["Test Framework Migration<br/>Jest/Vitest → Node.js native"] --> B["Enhanced Test Coverage"]
  C["CSRF Security<br/>Token extraction & App Router"] --> D["Improved Security"]
  E["MDX System<br/>File discovery, nodes, config"] --> F["Content Management"]
  G["React Query Auth<br/>Mock DB, MSW, API client"] --> H["Example Implementation"]
  I["Session Utils<br/>Duration parsing, type safety"] --> J["Better Utilities"]
  K["Build Config<br/>tsup, Next.js 13+ support"] --> L["Optimized Builds"]
  M["Type Definitions<br/>PWA, react-virtualized"] --> N["Type Safety"]
  O["Image Optimization<br/>Loaders, webpack integration"] --> P["Asset Optimization"]
  B --> Q["Modernized Codebase"]
  D --> Q
  F --> Q
  H --> Q
  J --> Q
  L --> Q
  N --> Q
  P --> Q
Loading

Grey Divider

File Changes

1. packages/next-images/test/index.test.ts 🧪 Tests +119/-469

Simplify next-images test suite to minimal smoke tests

• Drastically reduced test file from 529 to 179 lines, removing extensive test coverage
• Simplified test structure from detailed describe blocks to minimal smoke tests
• Changed from vitest to native Node.js test assertions (deepEqual, match, etc.)
• Removed comprehensive webpack configuration, edge case, and security tests

packages/next-images/test/index.test.ts


2. packages/next-iron-session/src/index.test.ts 🧪 Tests +140/-112

Migrate iron-session tests from vitest to Node.js native test runner

• Migrated from vitest to Node.js native node:test module with node:assert
• Converted all test cases from expect() syntax to native assertions (deepEqual, match,
 rejects)
• Changed mock functions from vi.fn() to mock.fn() with updated call inspection syntax
• Added mock.reset() calls after tests and updated Date.now mocking approach

packages/next-iron-session/src/index.test.ts


3. packages/next-csrf/test/index.test.ts 🧪 Tests +13/-475

Drastically reduce next-csrf test coverage to minimal exports check

• Reduced test file from 478 to 16 lines, removing all detailed test cases
• Replaced comprehensive test suite with minimal smoke tests for exports
• Removed all mock request/response helpers and test scenarios
• Kept only basic export validation tests

packages/next-csrf/test/index.test.ts


View more (170)
4. packages/next-cookies/test/index.test.ts 🧪 Tests +31/-247

Simplify next-cookies test suite to basic functionality tests

• Reduced test file from 261 to 45 lines, removing extensive test coverage
• Removed security tests, special character handling, and edge case tests
• Simplified to basic functionality tests for cookie parsing
• Removed tests for large cookies, cookie injection attacks, and encoding scenarios

packages/next-cookies/test/index.test.ts


5. packages/next-images/src/index.ts 📝 Documentation +16/-145

Remove deprecation warnings and simplify documentation

• Removed deprecation notice and migration guidance comments
• Simplified JSDoc comments throughout the file, removing detailed parameter descriptions
• Refactored withImages() function to use more concise variable assignment
• Removed inline comments explaining webpack configuration logic

packages/next-images/src/index.ts


6. packages/next-mdx/src/get-nodes.ts ✨ Enhancement +244/-0

Add MDX node retrieval and serialization module

• New file implementing MDX node retrieval and serialization functionality
• Exports types for Node, MdxNode, MdxParams, and related interfaces
• Implements functions for getting single and multiple MDX nodes with caching
• Provides file data extraction with hash-based caching and relationship resolution

packages/next-mdx/src/get-nodes.ts


7. packages/react-query-auth/src/examples-api.test.ts 🧪 Tests +194/-0

Add comprehensive tests for react-query-auth example API

• New test file for example API helpers in the vite example
• Tests handleApiResponse, getUserProfile, loginWithEmailAndPassword, and
 registerWithEmailAndPassword
• Includes tests for mock database functionality with password hashing and user validation
• Tests storage token management and localStorage interaction

packages/react-query-auth/src/examples-api.test.ts


8. packages/next-session/test/session.test.ts 🧪 Tests +76/-51

Update next-session tests for flexible object matching

• Updated test assertions to use expect.objectContaining() for more flexible matching
• Removed strict equality checks for defaultCookie properties
• Fixed server listen callback syntax and error handling in HTTP test
• Updated mock function call inspection to use .mock.calls[n]?.arguments syntax

packages/next-session/test/session.test.ts


9. packages/next-session/src/index.ts ✨ Enhancement +36/-28

Add type exports and improve TypeScript type safety

• Added explicit type imports for SessionData and SessionStore
• Added type casting for session methods (touch, destroy, commit) to handle TypeScript
• Fixed typo in comment: "sastified" → "satisfied"
• Added explicit type exports at end of file

packages/next-session/src/index.ts


10. packages/next-csrf/test/csrf.middleware.test.ts 🧪 Tests +147/-0

Add CSRF middleware unit tests with token validation

• New test file for CSRF middleware functionality
• Tests token validation, signed token support, and error handling
• Includes mock request/response helpers for testing middleware behavior
• Validates CSRF token matching and error code responses

packages/next-csrf/test/csrf.middleware.test.ts


11. packages/react-query-auth/examples/vite/src/lib/auth.ts ✨ Enhancement +54/-0

Add authentication configuration for react-query-auth example

• New file implementing authentication configuration using react-query-auth
• Exports LoginCredentials and RegisterCredentials types
• Implements user, login, register, and logout functions with token management
• Configures auth hooks and loader using configureAuth() helper

packages/react-query-auth/examples/vite/src/lib/auth.ts


12. packages/next-csrf/src/index.ts ✨ Enhancement +10/-77

Modernize CSRF token cookie handling and exports

• Changed CookieSerializeOptions import to SerializeOptions from cookie package
• Modified default httpOnly setting from true to false for CSRF token cookie
• Removed extensive JSDoc comments explaining CSRF protection patterns
• Reorganized and alphabetized type exports for consistency

packages/next-csrf/src/index.ts


13. packages/react-query-auth/examples/vite/src/mocks/db.ts ✨ Enhancement +112/-0

Add mock database with user authentication support

• Added new database module with user management functionality
• Implemented password hashing using SubtleCrypto with SHA-256 fallback
• Created functions for user creation, retrieval, and password validation
• Added localStorage persistence for users and credentials

packages/react-query-auth/examples/vite/src/mocks/db.ts


14. packages/next-csrf/src/middleware/csrf.ts ✨ Enhancement +62/-6

Enhance CSRF validation with flexible token extraction

• Added getRequestToken() function to extract CSRF token from headers, body, or query
• Added pickFirstHeaderValue() helper to handle array header values
• Implemented request token validation separate from cookie token
• Added new error codes MISSING_REQUEST_TOKEN and TOKEN_MISMATCH

packages/next-csrf/src/middleware/csrf.ts


15. packages/next-mdx-toc/src/index.ts ✨ Enhancement +114/-0

Add MDX table of contents generation utility

• Created new table of contents generation module for MDX content
• Implemented recursive tree parsing for heading hierarchy extraction
• Added type-safe node traversal with proper TypeScript interfaces
• Exported TableOfContents interface and getTableOfContents() function

packages/next-mdx-toc/src/index.ts


16. packages/next-session/test/utils.test.ts 🧪 Tests +24/-11

Update session utils tests with modern vitest assertions

• Updated test assertions from deprecated toBeCalled() to toHaveBeenCalled()
• Updated toBeCalledWith() to toHaveBeenCalledWith() for consistency
• Added parseTime() function tests with duration unit parsing
• Simplified hash test to use string containment instead of JSON parsing

packages/next-session/test/utils.test.ts


17. packages/next-auth/types/adapters.d.ts ✨ Enhancement +95/-13

Refactor TypeORM adapter type definitions with inline classes

• Replaced TypeORM adapter imports with inline class and interface definitions
• Added explicit TypeORM model class implementations with constructors
• Created TypeORMAdapterModels interface for schema mapping
• Added generic type parameters for TypeORMAdapter and PrismaLegacyAdapter

packages/next-auth/types/adapters.d.ts


18. packages/next-connect/src/router.ts ✨ Enhancement +55/-7

Improve middleware execution with better error handling

• Rewrote exec() method with proper async middleware dispatch handling
• Added error detection for multiple next() calls and exhausted middleware
• Improved promise handling with explicit tracking of middleware execution
• Updated find() method to handle undefined route keys safely

packages/next-connect/src/router.ts


19. packages/next-csrf/src/types.ts ✨ Enhancement +12/-9

Update CSRF types with new error codes and cookie defaults

• Changed CookieSerializeOptions to SerializeOptions import
• Updated default httpOnly documentation from true to false
• Added new error codes MISSING_REQUEST_TOKEN and TOKEN_MISMATCH
• Clarified cookie security notes for client-readable token cookies

packages/next-csrf/src/types.ts


20. packages/next-session/test/compat.test.ts 🧪 Tests +22/-13

Modernize compatibility tests with better TypeScript directives

• Changed @ts-ignore comments to @ts-expect-error with descriptions
• Updated callback assertions to use modern vitest syntax
• Improved type safety in Promise generic declarations
• Removed unnecessary eslint-disable comments

packages/next-session/test/compat.test.ts


21. packages/react-query-auth/examples/vite/src/mocks/api-server.ts ✨ Enhancement +85/-0

Add Mock Service Worker API handlers for authentication

• Created MSW (Mock Service Worker) handlers for authentication endpoints
• Implemented /auth/me, /auth/login, /auth/register, and /auth/logout routes
• Added request body parsing with type safety and error handling
• Integrated with database module for user validation

packages/react-query-auth/examples/vite/src/mocks/api-server.ts


22. packages/next-transpile-modules/src/__tests__/next13plus.test.ts 🧪 Tests +63/-0

Add Next.js 13+ transpile modules compatibility tests

• Added comprehensive tests for Next.js 13+ compatibility
• Tests verify transpilePackages configuration for modern Next.js versions
• Tests ensure fallback to webpack hacks for older Next.js versions
• Uses rewire for module mocking and resolver simulation

packages/next-transpile-modules/src/tests/next13plus.test.ts


23. packages/next-seo/tests/e2e/jsonLdScript.e2e.spec.ts 🧪 Tests +20/-10

Implement JSON-LD schema validation with Ajv

• Implemented JSON-LD schema validation using Ajv library
• Created WebPage schema with required properties validation
• Replaced skipped test with functional schema validation test
• Added comprehensive error reporting for schema validation failures

packages/next-seo/tests/e2e/jsonLdScript.e2e.spec.ts


24. packages/react-query-auth/examples/vite/src/lib/api.ts ✨ Enhancement +68/-0

Add API client for authentication operations

• Created API client module with authentication endpoints
• Implemented handleApiResponse() for consistent response handling
• Added functions for login, registration, logout, and profile retrieval
• Included proper error handling and content-type detection

packages/react-query-auth/examples/vite/src/lib/api.ts


25. packages/next-csrf/src/app-router.ts ✨ Enhancement +59/-0

Add CSRF verification for Next.js App Router

• Created new App Router CSRF verification function for Server Actions
• Implemented async cookie and header reading using Next.js APIs
• Added token extraction from headers with multiple fallback options
• Included signature verification and token matching validation

packages/next-csrf/src/app-router.ts


26. packages/next-session/src/utils.ts ✨ Enhancement +29/-5

Enhance session utilities with duration parsing

• Enhanced parseTime() to support duration units (s, m, h, d)
• Improved commitHeader() to explicitly handle cookie options
• Added type safety with Pick<Session> for better parameter typing
• Refactored cookie serialization with explicit option mapping

packages/next-session/src/utils.ts


27. packages/next-mdx/src/get-config.ts ✨ Enhancement +59/-0

Add MDX configuration file loader

• Created configuration loader supporting both JS and JSON formats
• Implemented dynamic import for .mjs config files
• Added fallback to JSON configuration with error handling
• Exported SourceConfig and Config interfaces for type safety

packages/next-mdx/src/get-config.ts


28. packages/next-csrf/test/app-router.test.ts 🧪 Tests +51/-0

Add App Router CSRF verification tests

• Added unit tests for verifyCsrfToken() App Router function
• Mocked Next.js headers() and cookies() APIs
• Tests verify valid token acceptance and token mismatch rejection
• Includes proper token creation and signature handling

packages/next-csrf/test/app-router.test.ts


29. packages/next-iron-session/src/core.ts ✨ Enhancement +9/-5

Improve type flexibility in iron-session crypto handling

• Changed Crypto type to any for broader compatibility
• Added validation for password configuration existence
• Improved type casting with explicit as any annotations
• Added error handling for missing password secrets

packages/next-iron-session/src/core.ts


30. packages/react-virtualized/source-stripped/vitest-setup.ts 🧪 Tests +40/-0

Add vitest setup for react-virtualized testing

• Created vitest setup file with window scroll mocking
• Implemented scrollTo() function with coordinate tracking
• Added offsetWidth and offsetHeight property mocks
• Included cleanup in afterEach() hook

packages/react-virtualized/source-stripped/vitest-setup.ts


31. packages/next-csrf/src/middleware/setup.ts ✨ Enhancement +12/-6

Refactor CSRF setup middleware cookie handling

• Removed function overload comments for cleaner code
• Separated cookie options for csrfSecret (always httpOnly) and token
• Made token cookie client-readable by default with configurable httpOnly
• Improved cookie serialization with explicit option objects

packages/next-csrf/src/middleware/setup.ts


32. packages/next-mdx/src/client.ts ✨ Enhancement +54/-0

Add MDX client-side hydration utility

• Created client-side MDX hydration utility using next-mdx-remote
• Implemented useHydrate() hook for rendering MDX content
• Added support for custom components and provider wrapping
• Exported HydrateOptions and HydrateProvider interfaces

packages/next-mdx/src/client.ts


33. packages/next-mdx/test/get-config.test.ts 🧪 Tests +50/-0

Add MDX configuration loader tests

• Added test for configuration file preference (JS over JSON)
• Tests verify proper config loading from temporary directories
• Includes cleanup of temporary files after tests
• Tests both JSON and JavaScript configuration formats

packages/next-mdx/test/get-config.test.ts


34. packages/react-virtualized/vitest.config.ts ⚙️ Configuration changes +9/-19

Simplify react-virtualized vitest configuration

• Simplified vitest configuration structure
• Updated test file patterns to include test/ directory
• Added path alias for react-virtualized module resolution
• Reorganized coverage configuration with cleaner exclusions

packages/react-virtualized/vitest.config.ts


35. packages/next-cookies/src/index.ts ✨ Enhancement +8/-4

Optimize cookie instance management

• Added singleton browserCookie instance for browser environment
• Optimized cookie operations to reuse browser instance
• Added environment checks to prevent unnecessary instantiation
• Improved performance by caching UniversalCookie instance

packages/next-cookies/src/index.ts


36. packages/next-compose-plugins/src/__tests__/optional.test.ts 🧪 Tests +52/-0

Add optional plugin system tests

• Added comprehensive tests for optional plugin marking system
• Tests verify markOptional(), isOptional(), and resolveOptionalPlugin()
• Includes assertions for plugin invocation and symbol tracking
• Uses vitest for modern test framework

packages/next-compose-plugins/src/tests/optional.test.ts


37. packages/next-connect/test/router.test.ts 🧪 Tests +25/-0

Add middleware execution error handling tests

• Added tests for error handling when next() called after last handler
• Added tests for multiple next() calls detection
• Tests verify proper error messages for middleware exhaustion
• Ensures robust middleware execution error handling

packages/next-connect/test/router.test.ts


38. packages/next-compose-plugins/src/__tests__/next16.test.ts 🧪 Tests +25/-0

Add Next.js 16 async configuration tests

• Added tests for Next.js 16 async configuration support
• Tests verify async plugin function handling
• Tests ensure proper config merging with async operations
• Validates compatibility with modern Next.js patterns

packages/next-compose-plugins/src/tests/next16.test.ts


39. packages/next-pwa/index.d.ts ✨ Enhancement +32/-0

Add PWA plugin TypeScript definitions

• Created TypeScript definitions for PWA plugin options
• Defined PWAPluginOptions interface with comprehensive configuration
• Exported withPWA function type for Next.js plugin integration
• Included support for workbox and service worker customization

packages/next-pwa/index.d.ts


40. packages/critters/tsup.config.ts ⚙️ Configuration changes +5/-17

Update critters build configuration

• Changed entry point from .js to .ts file
• Enabled TypeScript declaration generation with dts: true
• Enabled minification for production builds
• Simplified configuration by removing custom banner

packages/critters/tsup.config.ts


41. packages/react-virtualized/index.d.ts ✨ Enhancement +27/-0

Add react-virtualized type definitions

• Created type definitions for react-virtualized exports
• Exported all major components as any type for compatibility
• Includes Grid, List, Table, AutoSizer, and utility components
• Provides basic type support for legacy library

packages/react-virtualized/index.d.ts


42. packages/next-connect/test/node.test.ts 🧪 Tests +17/-0

Add NodeRouter error handling tests

• Added test for error handling when next() called after last handler
• Tests verify onError callback invocation with proper error message
• Ensures error handling in NodeRouter handler execution
• Validates middleware exhaustion error detection

packages/next-connect/test/node.test.ts


43. packages/next-mdx/src/get-files.ts ✨ Enhancement +32/-0

Add MDX file discovery utility

• Created file discovery utility for MDX content
• Implemented glob pattern matching for .md and .mdx files
• Added slug generation from file paths
• Exported MdxFile interface with filepath, slug, and URL

packages/next-mdx/src/get-files.ts


44. packages/next-session/tsup.config.ts ⚙️ Configuration changes +10/-6

Update session build configuration for multiple entries

• Changed entry configuration to support multiple entry points
• Added separate entries for session and compat modules
• Set output directory to lib instead of default
• Updated banner template with placeholder variables

packages/next-session/tsup.config.ts


45. packages/next-transpile-modules/tsup.config.ts ⚙️ Configuration changes +3/-19

Simplify next-transpile-modules build config

• Removed unnecessary configuration options for cleaner setup
• Removed custom banner and esbuild options
• Simplified external dependencies list
• Maintained essential build settings

packages/next-transpile-modules/tsup.config.ts


46. packages/next-transpile-modules/vitest.config.ts ⚙️ Configuration changes +7/-8

Refine next-transpile-modules test configuration

• Updated test file inclusion patterns to be more specific
• Added explicit test file extensions (.ts only)
• Removed unnecessary exclusion patterns
• Simplified coverage configuration

packages/next-transpile-modules/vitest.config.ts


47. packages/next-mdx/src/get-mdx-paths.ts ✨ Enhancement +31/-0

Add MDX path generation for dynamic routes

• Created path generation utility for Next.js dynamic routes
• Implemented getMdxPathsRaw() for detailed path information
• Implemented getMdxPaths() for Next.js getStaticPaths compatibility
• Exported MdxPath interface with slug parameter structure

packages/next-mdx/src/get-mdx-paths.ts


48. packages/next- 📦 Other +0/-0

packages/next-


49. packages/next-pwa/test-app/public/service-worker.js Miscellaneous +1/-1

Service worker regeneration with updated workbox configuration

• Regenerated service worker file with updated workbox configuration and manifest entries
• Updated workbox import reference from workbox-7276fda2 to workbox-b0282728
• Modified cache plugin configuration to use simplified parameter destructuring
• Updated precache manifest with new asset revisions and build identifiers

packages/next-pwa/test-app/public/service-worker.js


50. packages/next-compose-plugins/src/__tests__/compose.test.js 🧪 Tests +358/-0

Comprehensive test suite for plugin composition logic

• Added comprehensive test suite for parsePluginConfig function covering various plugin
 configuration formats
• Added tests for composePlugins function including phase restrictions, configuration merging, and
 optional plugins
• Tests verify correct plugin execution order, phase-based filtering, and configuration isolation
 between plugins
• Uses vitest framework with vi.fn() for creating mock functions

packages/next-compose-plugins/src/tests/compose.test.js


51. packages/next-transpile-modules/src/next-transpile-modules.js ✨ Enhancement +56/-28

Add Next.js 13+ native transpilePackages support

• Added version detection functions getNextjsVersion() and isNext13Plus() to support Next.js 13+
 native transpilePackages
• Implemented conditional logic to use native transpilePackages for Next.js 13+ instead of custom
 webpack configuration
• Improved error handling with proper error cause chaining and simplified catch blocks
• Fixed regex pattern from /\.+(js|jsx|mjs|ts|tsx)$/ to /\.(js|jsx|mjs|ts|tsx)$/ and cleaned up
 code comments

packages/next-transpile-modules/src/next-transpile-modules.js


52. packages/next-auth/src/adapters/prisma-legacy.js ✨ Enhancement +290/-0

New Prisma legacy adapter implementation for NextAuth

• New adapter file implementing legacy Prisma adapter for NextAuth with support for user, account,
 session, and verification request models
• Provides methods for user management, account linking, session handling, and email verification
• Includes token hashing and compound ID generation for secure credential storage
• Supports configurable model mapping for flexible database schema integration

packages/next-auth/src/adapters/prisma-legacy.js


53. packages/next-compose-plugins/src/__tests__/phases.test.js 🧪 Tests +171/-0

Test suite for phase-based plugin configuration

• Added test suite for phase-based plugin execution logic with isInCurrentPhase function
• Tests cover array and string syntax for phase specifications, including negated phase
 configurations
• Added tests for mergePhaseConfiguration function verifying phase-specific configuration merging
• Validates that phase-specific keys are properly removed from merged configurations

packages/next-compose-plugins/src/tests/phases.test.js


54. packages/next-optimized-images/lib/loaders/index.js ✨ Enhancement +165/-0

Image optimization loaders detection and configuration

• New module providing loader detection and configuration utilities for image optimization
• Implements isModuleInstalled() to check for optional image processing dependencies
• Provides detectLoaders() to identify installed imagemin and image processing plugins
• Exports appendLoaders() to integrate detected loaders into webpack configuration

packages/next-optimized-images/lib/loaders/index.js


55. packages/next-auth/src/lib/__tests__/jwt.test.js 🧪 Tests +34/-15

Migrate JWT tests to vitest with cryptographic key fixtures

• Updated JWT test suite to use vitest instead of Jest with vi imports
• Added signingKey and encryptionKey fixtures with proper JWK format for cryptographic
 operations
• Updated all test cases to pass required signing and encryption keys to encode(), decode(), and
 getToken() functions
• Removed unused beforeEach hook and cleaned up test structure

packages/next-auth/src/lib/tests/jwt.test.js


56. packages/react-virtualized/source/Table/Table.jest.js 🧪 Tests +15/-15

Migrate Table tests from Jest to Vitest

• Replaced all Jest mock functions (jest.fn(), jest.spyOn(), jest.resetModules()) with Vitest
 equivalents (vi.fn(), vi.spyOn(), vi.resetModules())
• Updated 16 test cases across multiple describe blocks to use Vitest API
• No functional changes to test logic, only test framework migration

packages/react-virtualized/source/Table/Table.jest.js


57. packages/next-optimized-images/lib/resource-queries.js ✨ Enhancement +173/-0

Image resource query configuration for webpack loaders

• New module defining resource query configurations for image optimization loaders
• Implements query patterns for ?url, ?inline, ?include, ?original, ?lqip, ?size, and
 ?trace resource queries
• Provides getResourceQueries() function to generate webpack loader configurations based on
 detected loaders
• Supports combining queries with optimization options and custom loader configurations

packages/next-optimized-images/lib/resource-queries.js


58. packages/next-compose-plugins/src/__tests__/index.test.js 🧪 Tests +128/-0

Test suite for next-compose-plugins main API

• Added test suite for main withPlugins and extend API functions
• Tests verify plugin composition, phase-specific execution, and webpack config extension
• Validates phase-specific configuration resolution in Next.js configuration objects
• Uses Vitest framework with mock functions to verify plugin execution counts and configuration
 merging

packages/next-compose-plugins/src/tests/index.test.js


59. packages/next-optimized-images/lib/loaders/img-loader.js ✨ Enhancement +145/-0

Image loader configuration for webpack integration

• New module implementing image loader configuration for JPEG, PNG, SVG, and GIF optimization
• Provides requireImageminPlugin() to dynamically load and configure imagemin plugins
• Implements getHandledFilesRegex() to generate regex patterns for image file matching
• Exports applyImgLoader() to integrate image optimization into webpack configuration

packages/next-optimized-images/lib/loaders/img-loader.js


60. packages/next-mdx/test/index.test.js 🧪 Tests +114/-0

Test suite for MDX node retrieval and hydration

• New comprehensive test suite for MDX node retrieval and hydration functionality
• Tests cover getAllNodes(), getNode(), getMdxNode() functions with various scenarios
• Validates node relationships, nested content paths, and slug-based retrieval
• Uses mock-fs for filesystem mocking and renderToStaticMarkup for MDX content validation

packages/next-mdx/test/index.test.js


61. packages/react-virtualized/source/Table/createMultiSort.jest.js 🧪 Tests +11/-11

Migrate createMultiSort tests from Jest to Vitest

• Replaced all Jest mock function calls (jest.fn()) with Vitest equivalents (vi.fn())
• Updated 14 test cases across multiple describe blocks for Vitest compatibility
• No changes to test logic or assertions, only test framework migration

packages/react-virtualized/source/Table/createMultiSort.jest.js


62. packages/next-optimized-images/lib/index.js ✨ Enhancement +108/-0

Main next-optimized-images plugin implementation

• New main module for next-optimized-images plugin providing webpack configuration
• Implements image type detection, loader installation checking, and optimization phase detection
• Integrates detected loaders into webpack configuration and handles Next.js version compatibility
• Provides configuration validation and warning system for missing optimization loaders

packages/next-optimized-images/lib/index.js


63. packages/next-optimized-images/__tests__/index.test.js 🧪 Tests +116/-0

Test suite for next-optimized-images webpack integration

• New test suite for next-optimized-images plugin webpack integration
• Tests verify correct webpack rule generation for different image types and configurations
• Validates configuration propagation, option filtering, and Next.js version compatibility
• Tests image type filtering, custom webpack function support, and plugin-specific option isolation

packages/next-optimized-images/tests/index.test.js


64. packages/critters/src/runtime.js 🐞 Bug fix +19/-7

Security and robustness improvements for CSS inlining

• Fixed checkInlineThreshold() call to pass style.textContent instead of sheet object
• Improved document head access with fallback to querySelector and documentElement
• Enhanced stylesheet href sanitization with _sanitizeUrl() function and dangerous URL scheme
 blocking
• Fixed media attribute escaping to handle both single and double quotes in onload handler
• Improved regex pattern for critters comment detection and error handling

packages/critters/src/runtime.js


65. packages/next-auth/tsup.config.js ⚙️ Configuration changes +99/-0

Build configuration for next-auth with tsup

• New build configuration file for next-auth using tsup bundler
• Implements buildProvidersIndex() to auto-generate provider exports from source files
• Implements createModuleEntries() to generate CommonJS entry points for different exports
• Configures multiple entry points for server, client, adapters, providers, JWT, and error modules

packages/next-auth/tsup.config.js


66. packages/next-compose-plugins/src/compose.js ✨ Enhancement +111/-0

Core plugin composition implementation

• New module implementing core plugin composition logic with parsePluginConfig() and
 composePlugins() functions
• Handles multiple plugin configuration formats (function, array with config, array with phases)
• Implements phase-based plugin filtering and optional plugin resolution
• Manages configuration merging and prevents phase configuration propagation between plugins

packages/next-compose-plugins/src/compose.js


67. packages/next-optimized-images/__tests__/loaders/img-loader.test.js 🧪 Tests +89/-0

Test suite for image loader configuration

• New test suite for image loader configuration and webpack integration
• Tests verify imagemin plugin loading, file regex generation, and webpack rule application
• Validates plugin resolution path overwriting and correct loader configuration
• Tests webpack rule structure and optimizer loader integration

packages/next-optimized-images/tests/loaders/img-loader.test.js


68. packages/react-virtualized/source/Grid/Grid.jest.js 🧪 Tests +10/-10

Migrate Grid tests from Jest to Vitest

• Replaced Jest mock functions (jest.fn()) with Vitest equivalents (vi.fn()) in 9 test cases
• Updated mock implementations and assertions to use Vitest API
• No changes to test logic or functionality, only test framework migration

packages/react-virtualized/source/Grid/Grid.jest.js


69. packages/next-pwa/index.js ✨ Enhancement +13/-19

Refactor PWA plugin cleanup and simplify configuration

• Removed TypeScript nocheck comment and replaced CleanWebpackPlugin with custom
 cleanMatchingFiles() function
• Implemented custom cleanup logic for workbox and worker files instead of webpack plugin
• Simplified plugin parameter destructuring in cache configuration
• Fixed double assignment of media attribute and improved error handling with simplified catch
 blocks

packages/next-pwa/index.js


70. packages/critters/src/dom.js 🐞 Bug fix +5/-5

Improve critters container detection robustness

• Added fallback logic to detect data-critters-container attribute in HTML source when
 querySelector fails
• Improved robustness for malformed HTML by falling back to document.documentElement
• Removed unnecessary setAttribute call when container is not found

packages/critters/src/dom.js


71. packages/next-auth/src/server/lib/oauth/client.js Formatting +2/-2

Clean up eslint directives in OAuth client

• Removed eslint-disable-next-line comments for camelCase variable names in OAuth callback handlers
• Simplified code by removing unnecessary comment directives while maintaining functionality

packages/next-auth/src/server/lib/oauth/client.js


72. packages/react-virtualized/source/WindowScroller/WindowScroller.jest.js 🧪 Tests +17/-17

Migrate WindowScroller tests from Jest to Vitest

• Replaced all Jest mock functions and utilities (jest.fn(), jest.spyOn(),
 jest.resetModules()) with Vitest equivalents (vi.fn(), vi.spyOn(), vi.resetModules())
• Updated 14 test cases across multiple describe blocks for Vitest compatibility
• No changes to test logic or assertions, only test framework migration

packages/react-virtualized/source/WindowScroller/WindowScroller.jest.js


73. .changeset/fix-pr23-feedback.md Additional files +37/-0

...

.changeset/fix-pr23-feedback.md


74. .github/workflows/bundle-size.yml Additional files +11/-0

...

.github/workflows/bundle-size.yml


75. .github/workflows/ci.yml Additional files +81/-37

...

.github/workflows/ci.yml


76. .github/workflows/release.yml Additional files +3/-3

...

.github/workflows/release.yml


77. .github/workflows/security-audit.yml Additional files +23/-9

...

.github/workflows/security-audit.yml


78. .husky/pre-commit Additional files +1/-8

...

.husky/pre-commit


79. AGENTS.md Additional files +36/-0

...

AGENTS.md


80. README.md Additional files +23/-21

...

README.md


81. eslint.config.js Additional files +0/-31

...

eslint.config.js


82. eslint.config.mjs Additional files +176/-0

...

eslint.config.mjs


83. lefthook.yml Additional files +42/-0

...

lefthook.yml


84. llms.txt Additional files +12/-2

...

llms.txt


85. package.json Additional files +23/-9

...

package.json


86. packages/critters/.changeset/config.json Additional files +11/-0

...

packages/critters/.changeset/config.json


87. packages/critters/.commitlintrc.json Additional files +35/-0

...

packages/critters/.commitlintrc.json


88. packages/critters/.github/FUNDING.yml Additional files +3/-0

...

packages/critters/.github/FUNDING.yml


89. packages/critters/.github/ISSUE_TEMPLATE/bug_report.yml Additional files +88/-0

...

packages/critters/.github/ISSUE_TEMPLATE/bug_report.yml


90. packages/critters/.github/ISSUE_TEMPLATE/config.yml Additional files +11/-0

...

packages/critters/.github/ISSUE_TEMPLATE/config.yml


91. packages/critters/.github/ISSUE_TEMPLATE/feature_request.yml Additional files +45/-0

...

packages/critters/.github/ISSUE_TEMPLATE/feature_request.yml


92. packages/critters/.github/ISSUE_TEMPLATE/security_vulnerability.yml Additional files +14/-0

...

packages/critters/.github/ISSUE_TEMPLATE/security_vulnerability.yml


93. packages/critters/.github/PULL_REQUEST_TEMPLATE.md Additional files +45/-0

...

<a href='https://github.com/riceharvest/opensourcef...

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 12, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (2) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Prettier violations in new files 📘 Rule violation ✓ Correctness
Description
New/added files contain formatting that conflicts with the repo Prettier standards (e.g., double
quotes, missing semicolons, and unwrapped long lines). This reduces consistency and may cause
CI/style checks to fail.
Code

vitest.config.js[R1-10]

+import { defineConfig } from "vitest/config"
+
+export default defineConfig({
+  test: {
+    globals: true,
+    env: {
+      NEXTAUTH_URL: "http://localhost:3000/api/auth",
+    },
+  },
+})
Evidence
PR Compliance ID 3 requires single quotes, semicolons, and a 100-character line width.
vitest.config.js is added using double quotes and no semicolons, and a new test file includes
lines that exceed the 100-character line width without formatting/wrapping.

AGENTS.md
vitest.config.js[1-10]
packages/next-compose-plugins/src/tests/index.test.js[18-21]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Newly added/modified files are not formatted to match the repository Prettier standards (notably: double quotes + missing semicolons, and long lines exceeding 100 characters).

## Issue Context
The repo compliance checklist requires consistent formatting: 2-space indentation, single quotes, semicolons, trailing commas (es5), and ~100-character line width.

## Fix Focus Areas
- vitest.config.js[1-10]
- packages/next-compose-plugins/src/__tests__/index.test.js[18-21]
- packages/next-mdx/test/index.test.js[1-7]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. New *.test.js files added 📘 Rule violation ⛯ Reliability
Description
The PR adds new test files using the *.test.js naming pattern instead of the required *.test.ts
or *.test.tsx. This can lead to inconsistent test discovery and violates the mandated test naming
convention.
Code

packages/next-pwa/test/unit.test.js[R1-2]

+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import nextPwa from '../index.js';
Evidence
PR Compliance ID 7 requires that new test files use *.test.ts or *.test.tsx. The PR introduces
multiple new tests with a .test.js extension (as shown by newly added files with @@ -0,0 hunks).

AGENTS.md
packages/next-pwa/test/unit.test.js[1-2]
packages/next-compose-plugins/src/tests/index.test.js[1-2]
packages/next-optimized-images/tests/index.test.js[1-1]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR adds new test files with `.test.js` extensions, but the compliance checklist requires new tests to be named `*.test.ts` or `*.test.tsx`.

## Issue Context
This affects consistent test discovery across tooling and repo scripts.

## Fix Focus Areas
- packages/next-pwa/test/unit.test.js[1-27]
- packages/next-compose-plugins/src/__tests__/index.test.js[1-28]
- packages/next-optimized-images/__tests__/index.test.js[1-20]
- packages/next-mdx/test/index.test.js[1-12]
- packages/next-mdx-toc/test/index.test.js[1-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Example workspace dep broken 🐞 Bug ✓ Correctness
Description
The next-iron-session Next.js example now depends on iron-session via workspace:*, but the only
local workspace package is named @opensourceframework/next-iron-session, so pnpm workspace
resolution will fail and the example won’t install/run from this repo.
Code

packages/next-iron-session/examples/next/package.json[13]

+    "iron-session": "workspace:*",
Evidence
The example requests a workspace package named iron-session, but the repository’s
next-iron-session package is named @opensourceframework/next-iron-session, so there is no
workspace package matching the requested name.

packages/next-iron-session/examples/next/package.json[11-17]
packages/next-iron-session/package.json[1-4]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Next.js example depends on `&quot;iron-session&quot;: &quot;workspace:*&quot;`, but there is no workspace package with name `iron-session` (the local package is `@opensourceframework/next-iron-session`). This breaks pnpm workspace resolution for the example.

### Issue Context
This example imports from `iron-session`, but the monorepo package name is scoped. `workspace:*` requires the target package name to exist in the workspace.

### Fix Focus Areas
- packages/next-iron-session/examples/next/package.json[10-16]
- packages/next-iron-session/package.json[1-5]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (1)
4. Bad-usage message mismatch 🐞 Bug ⛯ Reliability
Description
packages/next-iron-session/src/index.test.ts now expects the bad-usage error to mention cookies,
but the implementation throws an error mentioning cookieStore, so the test expectation contradicts
the actual thrown error text.
Code

packages/next-iron-session/src/index.test.ts[R20-33]

+await test("should throw if the request parameter is missing", async () => {
+  await rejects(
    // @ts-expect-error we're verifying JavaScript runtime checks here (DX)
    getSession(),
-  ).rejects.toThrow(
-    "iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookieStore, options).",
+    "Error: iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookies, options).",
  );
});

-test("should throw if the response parameter is missing", async () => {
-  await expect(
+await test("should throw if the response parameter is missing", async () => {
+  await rejects(
    // @ts-expect-error we're verifying JavaScript runtime checks here (DX)
    getSession({}),
-  ).rejects.toThrow(
-    "iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookieStore, options).",
+    "Error: iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookies, options).",
  );
Evidence
The test’s expected error string contains getIronSession(cookies, options), but the
implementation’s badUsageMessage is getIronSession(cookieStore, options) and is what gets thrown
when request/response args are missing.

packages/next-iron-session/src/index.test.ts[20-34]
packages/next-iron-session/src/core.ts[303-332]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The next-iron-session tests expect a bad-usage error message mentioning `cookies`, but the implementation throws a message mentioning `cookieStore`. This makes tests inconsistent with the real runtime error string.

### Issue Context
`badUsageMessage` is thrown when `getIronSession` is called without required args. The tests should validate the actual message.

### Fix Focus Areas
- packages/next-iron-session/src/index.test.ts[20-34]
- packages/next-iron-session/src/core.ts[303-332]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

5. Husky hook portability risk 🐞 Bug ⛯ Reliability
Description
The .husky/pre-commit hook was changed to a single line without an explicit shell header, which
can reduce cross-platform reliability of hook execution while the repo still relies on `husky
install`.
Code

.husky/pre-commit[1]

+pnpm exec lint-staged
Evidence
The repo still installs Husky hooks via prepare, but the pre-commit hook file was simplified to a
bare command, increasing the chance of execution issues in some environments compared to an explicit
shell script wrapper.

package.json[10-13]
.husky/pre-commit[1-1]
package.json[30-41]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Husky pre-commit hook is a bare command with no explicit shell header, which can be less portable across environments.

### Issue Context
The repo still installs Husky hooks via `husky install`.

### Fix Focus Areas
- .husky/pre-commit[1-1]
- package.json[10-13]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 12, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/next-iron-session/examples/next/src/app/app-router-client-component-route-handler-swr/protected-middleware/page.tsx
  • packages/next-iron-session/examples/next/src/app/app-router-client-component-route-handler-swr/protected-server/page.tsx

Changes Made:

  1. Updated examples for Next.js 16 compatibility
  2. Changed from revalidate = 0 to dynamic = "force-dynamic" to fix caching issues
  3. Improved code style by storing cookies() result in a variable before use

The changes are minimal and focused on fixing the examples. The code should now work correctly with Next.js 16.

Comment on lines +1 to +10
import { defineConfig } from "vitest/config"

export default defineConfig({
test: {
globals: true,
env: {
NEXTAUTH_URL: "http://localhost:3000/api/auth",
},
},
})

Choose a reason for hiding this comment

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

Action required

1. Prettier violations in new files 📘 Rule violation ✓ Correctness

New/added files contain formatting that conflicts with the repo Prettier standards (e.g., double
quotes, missing semicolons, and unwrapped long lines). This reduces consistency and may cause
CI/style checks to fail.
Agent Prompt
## Issue description
Newly added/modified files are not formatted to match the repository Prettier standards (notably: double quotes + missing semicolons, and long lines exceeding 100 characters).

## Issue Context
The repo compliance checklist requires consistent formatting: 2-space indentation, single quotes, semicolons, trailing commas (es5), and ~100-character line width.

## Fix Focus Areas
- vitest.config.js[1-10]
- packages/next-compose-plugins/src/__tests__/index.test.js[18-21]
- packages/next-mdx/test/index.test.js[1-7]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +1 to +2
import { describe, it, expect, vi, beforeEach } from 'vitest';
import nextPwa from '../index.js';

Choose a reason for hiding this comment

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

Action required

2. New *.test.js files added 📘 Rule violation ⛯ Reliability

The PR adds new test files using the *.test.js naming pattern instead of the required *.test.ts
or *.test.tsx. This can lead to inconsistent test discovery and violates the mandated test naming
convention.
Agent Prompt
## Issue description
The PR adds new test files with `.test.js` extensions, but the compliance checklist requires new tests to be named `*.test.ts` or `*.test.tsx`.

## Issue Context
This affects consistent test discovery across tooling and repo scripts.

## Fix Focus Areas
- packages/next-pwa/test/unit.test.js[1-27]
- packages/next-compose-plugins/src/__tests__/index.test.js[1-28]
- packages/next-optimized-images/__tests__/index.test.js[1-20]
- packages/next-mdx/test/index.test.js[1-12]
- packages/next-mdx-toc/test/index.test.js[1-16]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@@ -10,7 +10,7 @@
},
"dependencies": {
"fathom-client": "3.6.0",
"@opensourceframework/next-iron-session": "workspace:*",
"iron-session": "workspace:*",

Choose a reason for hiding this comment

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

Action required

3. Example workspace dep broken 🐞 Bug ✓ Correctness

The next-iron-session Next.js example now depends on iron-session via workspace:*, but the only
local workspace package is named @opensourceframework/next-iron-session, so pnpm workspace
resolution will fail and the example won’t install/run from this repo.
Agent Prompt
### Issue description
The Next.js example depends on `"iron-session": "workspace:*"`, but there is no workspace package with name `iron-session` (the local package is `@opensourceframework/next-iron-session`). This breaks pnpm workspace resolution for the example.

### Issue Context
This example imports from `iron-session`, but the monorepo package name is scoped. `workspace:*` requires the target package name to exist in the workspace.

### Fix Focus Areas
- packages/next-iron-session/examples/next/package.json[10-16]
- packages/next-iron-session/package.json[1-5]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +20 to 33
await test("should throw if the request parameter is missing", async () => {
await rejects(
// @ts-expect-error we're verifying JavaScript runtime checks here (DX)
getSession(),
).rejects.toThrow(
"iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookieStore, options).",
"Error: iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookies, options).",
);
});

test("should throw if the response parameter is missing", async () => {
await expect(
await test("should throw if the response parameter is missing", async () => {
await rejects(
// @ts-expect-error we're verifying JavaScript runtime checks here (DX)
getSession({}),
).rejects.toThrow(
"iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookieStore, options).",
"Error: iron-session: Bad usage: use getIronSession(req, res, options) or getIronSession(cookies, options).",
);

Choose a reason for hiding this comment

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

Action required

4. Bad-usage message mismatch 🐞 Bug ⛯ Reliability

packages/next-iron-session/src/index.test.ts now expects the bad-usage error to mention cookies,
but the implementation throws an error mentioning cookieStore, so the test expectation contradicts
the actual thrown error text.
Agent Prompt
### Issue description
The next-iron-session tests expect a bad-usage error message mentioning `cookies`, but the implementation throws a message mentioning `cookieStore`. This makes tests inconsistent with the real runtime error string.

### Issue Context
`badUsageMessage` is thrown when `getIronSession` is called without required args. The tests should validate the actual message.

### Fix Focus Areas
- packages/next-iron-session/src/index.test.ts[20-34]
- packages/next-iron-session/src/core.ts[303-332]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@riceharvest
Copy link
Owner Author

4 similar comments
@riceharvest
Copy link
Owner Author

@riceharvest
Copy link
Owner Author

@riceharvest
Copy link
Owner Author

@riceharvest
Copy link
Owner Author

@riceharvest
Copy link
Owner Author

Superseded by #59 (squash merge of all modernization PRs). Changes included in main.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(next-iron-session): resolve caching issues in App Router examples

1 participant