Skip to content

Comments

update#37

Merged
khulnasoft-bot merged 26 commits intokhulnasoft:mainfrom
neopilotai:main
Feb 9, 2026
Merged

update#37
khulnasoft-bot merged 26 commits intokhulnasoft:mainfrom
neopilotai:main

Conversation

@neopilotai
Copy link
Contributor

@neopilotai neopilotai commented Feb 9, 2026

Summary by CodeRabbit

  • New Features

    • Enhanced documentation with improved structure and expanded content coverage.
    • Added TypeScript configuration for docs folder.
  • Bug Fixes

    • Updated runtime lifecycle handling and error propagation mechanisms.
  • Breaking Changes

    • Renamed public API: RuntimeEdge class now EdgeRuntime.
    • License changed from MPL-2.0 to MIT.
    • Minimum Node.js requirement increased to 18+.
    • Product terminology standardized to "Edge Runtime."
  • Chores

    • Dependency updates across packages.
    • Removed legacy changelog files.

FortiShield and others added 26 commits October 22, 2025 10:17
- Remove outdated CHANGELOG.md from types, user-agent, and vm packages
- These files are no longer needed as changelog is managed elsewhere
- Migrate turbo.json from deprecated 'pipeline' to 'tasks' for v2.0+ compatibility
- Simplify primitives build outputs configuration
- Update pnpm lockfile with latest dependency versions
- Update types package: v2.2.9 → v4.0.0, update description and license
- Update user-agent package: v1.4.1 → v4.0.0, update dependencies and license
- Update vm package: v3.2.0 → v4.0.0, update dependencies and license
- Standardize Node.js requirement to >=18 across all packages
- Change license from MPL-2.0 to MIT across all packages
- Update types package README: 'Runtime Edge' → 'Edge Runtime'
- Update user-agent package README: 'Runtime Edge' → 'Edge Runtime'
- Add website reference links to both README files
- Update global type declaration: RuntimeEdge → EdgeRuntime
- Consistent with package rebranding from 'Runtime Edge' to 'Edge Runtime'
- Add env.d.ts with multer module declarations and Edge Runtime polyfills
- Add test-if.ts with conditional test execution guard and Edge Runtime detection
- Support for testing in both Node.js and Edge Runtime environments
- Test error stack trace preservation in VM context
- Test custom error classes with additional properties (digest, cause)
- Verify proper error serialization and formatting in Edge Runtime VM
- Add stream.js to export Web Stream APIs from node:stream/web
- Provides ReadableStream, WritableStream, TransformStream and related classes
- Enables stream/web module compatibility for Edge Runtime primitives
- Add ESLint configuration with Next.js recommended rules
- Add Nextra app component for documentation theme
- Enable TypeScript linting for docs
- Update VM source files with improved event handling and error management
- Update runtime CLI and server modules to use EdgeRuntime naming
- Consistent API naming throughout the Edge Runtime implementation
- Improve error handling and unhandled rejection management in VM context
- Update runtime test fixtures: RuntimeEdge → EdgeRuntime imports
- Update VM test files with EdgeRuntime naming consistency
- Maintain test coverage for API naming changes
- Update Twitter handle from @vercel to @khulnasoft in runtime and vm packages
- Consistent social media branding across documentation
- Update format package: v2.2.1 → v4.0.0, standardize description and license
- Update cookies package: v4.1.1 → v4.0.0, update description and license
- Update runtime package: v2.5.9 → v4.0.0, update dependencies and remove dev deps
- Standardize Node.js requirement to >=18 across all packages
- Change license from MPL-2.0 to MIT across all packages
- Update fetch.js example: 'Runtime Edge' → 'Edge Runtime' in marquee text
- Update html.js example: 'Runtime Edge' → 'Edge Runtime' in generated markup
- Consistent branding in example code
- Update fetch.d.ts: remove deprecated getAll method, reorganize Headers export
- Update structured-clone.d.ts: add constructor export pattern
- Improve type definitions for better compatibility
- Update primitives package.json: standardize Node.js requirement to >=18
- Update dependencies: esbuild 0.24.0, undici 6.21.0
- Change license from MPL-2.0 to MIT
- Simplify clean:build script
- Update undici-core-request.js patch to v6.21.0 compatibility
- Remove unused util-types.js patch file
- Update blob.js and fetch.js implementations
- Remove unused load.js and structured-clone.js files
- Clean up deprecated patches and implementations
- Remove outdated CHANGELOG.md from runtime package
- Consistent with other package CHANGELOG removals
- Update fetch-event and request tests: RuntimeEdge → EdgeRuntime imports
- Consistent API naming in node-utils test suite
- Update ponyfill package.json: standardize Node.js requirement to >=18
- Update dependencies: acorn 8.14.0, acorn-walk 8.3.4
- Update test environment variable: RUNTIME_EDGE_EXISTS → EDGE_RUNTIME_EXISTS
- Change license from MPL-2.0 to MIT
- Remove outdated CHANGELOG.md from primitives package
- Update primitives README with any necessary changes
- Update all remaining package configurations and dependencies
- Standardize naming from RuntimeEdge to EdgeRuntime across all packages
- Update Node.js requirements to >=18 across the entire monorepo
- Change license from MPL-2.0 to MIT across all packages
- Remove outdated CHANGELOG files and update documentation
- Update test suites and examples with new naming conventions
- Clean up deprecated code and patches
- Prepare codebase for Edge Runtime v4.0.0 release
- Add polished README with Vercel/Supabase-style layout
- Include project badges, architecture diagram, and feature highlights
- Add quick start guide and usage examples
- Document ecosystem packages and contributor information
- Responsive design with dark/light theme support
- Professional branding consistent with Edge Runtime v4.0.0
- Update branding from 'Runtime Edge' to 'Edge Runtime' throughout
- Replace generic content with accurate package descriptions based on actual codebase
- Add complete package ecosystem table with all 10 published packages
- Update features table with real functionality (Web APIs, VM, testing tools)
- Improve quick start with realistic CLI commands and usage examples
- Add architecture section explaining monorepo structure and package relationships
- Enhance testing and contributing sections with pnpm workflows
- Update 'What's New in v4.0.0' section with specific improvements made
- Remove placeholder content and replace with production-ready documentation
…cve-vu-98kr4r

Fix React Server Components CVE vulnerabilities
@codesandbox
Copy link

codesandbox bot commented Feb 9, 2026

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link
Contributor

vercel bot commented Feb 9, 2026

@vercel[bot] is attempting to deploy a commit to the devsec Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Sorry @neopilotai, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

This PR is a major v4.0.0 release that renames "Runtime Edge" to "Edge Runtime" across the codebase, upgrades Node.js minimum version from 16 to 18, changes license from MPL-2.0 to MIT, updates dependencies, refactors the primitives module, removes historical changelogs, and updates documentation and branding throughout.

Changes

Cohort / File(s) Summary
Configuration & License
.changeset/config.json, LICENSE.md
Updated changelog repository reference from khulnasoft/runtime-edge to vercel/runtime-edge; replaced Mozilla Public License v2.0 with MIT License.
GitHub Actions & Workflow
.github/dependabot.yml, .github/workflows/test.yml, .github/workflows/update.yml
Removed commit-message prefix from dependabot config; updated Node.js test matrix to 18, 20, 22 (removed 16); narrowed update-lockfile job to exclude forked PRs.
Root Package Configuration
package.json, turbo.json, docs/.eslintrc.json
Bumped devDependencies (@types/jest, @types/node, esbuild, next); updated Node engine to >=18; removed contributors array; changed turbo.json "pipeline" to "tasks" and simplified primitives build outputs.
Documentation Site
docs/package.json, docs/theme.config.js, README.md
Upgraded Next.js to 15.2.8, React to 18, SWR to 2.3.3; updated SEO titles, logo alt text, and branding from "Runtime Edge" to "Edge Runtime"; added responsive image handling and navigation badges; expanded README with features, examples, and ecosystem information.
Docs Pages - Branding Updates
docs/pages/*.mdx, docs/pages/features/*.mdx, docs/pages/packages/*.mdx
Updated product name references from "Runtime Edge" to "Edge Runtime" across getting-started, CLI, index, available-apis, polyfills, typescript-support, upgrading-nextjs, and all package documentation pages.
Docs Metadata & Footer
docs/components/footer.tsx, docs/pages/features/_meta.json
Changed Twitter handle from @vercel to @khulnasoft; updated sidebar metadata labels from "Runtime Edge APIs" to "Edge Runtime APIs".
Runtime Packages - Naming
packages/runtime/src/*.ts, packages/runtime/tests/*.ts, packages/runtime/src/cli/*.ts
Renamed RuntimeEdge class to EdgeRuntime, RuntimeEdgeServer to EdgeRuntimeServer throughout CLI, server, and test files; updated environment variable from RUNTIME_EDGE_LOGGING to EDGE_RUNTIME_LOGGING.
Primitives Core Restructuring
packages/primitives/src/primitives/*.js, packages/primitives/scripts/build.ts, packages/primitives/src/patches/*
Refactored fetch implementation with simplified undici wrapper; replaced esbuild-plugin-alias with direct onResolve handling; removed structured-clone polyfill; replaced request patching logic; introduced new stream module exporting Web Streams API.
Primitives Build & Config
packages/primitives/package.json, packages/primitives/type-definitions/*.d.ts, packages/primitives/text-encoding-streams/package.json
Updated description and version to 4.0.0; simplified clean:build script; updated undici from 5.28.4 to 6.21.0; removed structured-clone and blob-polyfill dependencies; refactored Headers and structuredClone type declarations.
Cookies Package
packages/cookies/*.ts, packages/cookies/package.json
Modified delete method to accept options object; enhanced parseSetCookie attribute key normalization; added tests for secure deletion and max-age parsing; version bumped to 4.0.0.
Format Package
packages/format/src/index.ts, packages/format/tests/index.test.ts, packages/format/package.json
Updated formatError to capture stack traces; modified Error formatting to filter 'name' key; updated test expectations to use regex matching for error stack traces; version bumped to 4.0.0.
Node Utils Restructuring
packages/node-utils/src/edge-to-node/stream.ts, packages/node-utils/test/*.ts
Delegated toToReadable to Node's built-in Readable.fromWeb instead of custom implementation; updated runtime references from RuntimeEdge to EdgeRuntime.
Integration Tests
packages/integration-tests/test/*.ts, packages/integration-tests/test/test-if.ts, packages/integration-tests/test/env.d.ts
Restructured tests from conditional testOrSkip to explicit describe/test blocks; added guard and isEdgeRuntime utilities; introduced TypeScript ambient declarations; rewrote fetch tests with socket tracking and multipart/form-data handling; updated runtime checks from RuntimeEdge to EdgeRuntime.
Jest & Testing
packages/jest-environment/src/*.ts, packages/jest-environment/test/index.test.ts, packages/jest-expect/package.json, packages/vm/tests/*.ts
Renamed RuntimeEdge global to EdgeRuntime in test assertions; updated test file structure and descriptions; bumped versions to 4.0.0.
VM & Types
packages/vm/src/edge-vm.ts, packages/vm/tests/runtime-edge.test.ts, packages/types/src/index.d.ts, packages/vm/tests/integration/error.test.ts
Updated EdgeContext to export EdgeRuntime instead of RuntimeEdge; refactored event listener code with property-based methods; added error handling integration tests; updated type declarations.
Ponyfill & Remaining Packages
packages/ponyfill/src/index.js, packages/ponyfill/package.json, packages/ponyfill/test/*.ts, packages/user-agent/package.json, packages/node-utils/package.json, packages/primitives/package.json, packages/jest-expect/package.json
Updated runtime condition from RuntimeEdge to EdgeRuntime; bumped all versions to 4.0.0; updated Node engine to >=18; changed license to MIT across all packages.
Changelog Removal
packages/cookies/CHANGELOG.md, packages/format/CHANGELOG.md, packages/jest-environment/CHANGELOG.md, packages/jest-expect/CHANGELOG.md, packages/node-utils/CHANGELOG.md, packages/ponyfill/CHANGELOG.md, packages/primitives/CHANGELOG.md, packages/runtime/CHANGELOG.md, packages/types/CHANGELOG.md, packages/user-agent/CHANGELOG.md, packages/vm/CHANGELOG.md
Removed historical changelog files across all packages (no functional impact).
README & Branding
packages/*/README.md, docs/pages/_app.mdx
Updated product references from "Runtime Edge" to "Edge Runtime"; changed Twitter attribution from @vercel to @khulnasoft; fixed docs/_app.mdx JSX syntax formatting.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 From Edge to Runtime, the name takes flight,
Renamed with care from morning to night,
Node eighteen now stands as the minimum stage,
MIT licensed—beginning a new v4.0.0 age,
With primitives rebuilt and docs so bright!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@khulnasoft-bot khulnasoft-bot merged commit 4ebe0fe into khulnasoft:main Feb 9, 2026
3 of 9 checks passed
@qodo-code-review
Copy link

Review Summary by Qodo

Major v4.0.0 release with RuntimeEdge→EdgeRuntime rename, MIT license adoption, and comprehensive test/documentation updates

✨ Enhancement 🧪 Tests 📝 Documentation

Grey Divider

Walkthroughs

Description
• **Major version bump to v4.0.0** across all packages with standardized versioning
• **Renamed RuntimeEdge class to EdgeRuntime** throughout the entire codebase for improved
  naming clarity
• **License change from MPL-2.0 to MIT** across all packages and documentation
• **Updated Node.js minimum requirement from >=16 to >=18** across all packages
• **Comprehensive test reorganization** with describe blocks, guard utilities, and improved test
  structure
• **Enhanced error formatting** to include full stack traces instead of simplified error strings
• **Simplified stream conversion** by using native Node.js Readable.fromWeb API
• **Refactored build configuration** with custom esbuild plugins replacing esbuild-plugin-alias
• **Updated all documentation** to reflect new naming conventions and expanded README with badges
  and architecture details
• **Dependencies updates** including esbuild 0.20.2→0.24.0, @types/node 16→18, Turborepo v1→v2
  configuration format
• **Removed deprecated code** including blob polyfills, CHANGELOG files, and unused dependencies
  like http-body and node-fetch
• **Improved cookie handling** with simplified deletion logic and max-age parsing tests
• **Added test utilities** including guard function and isEdgeRuntime checks for conditional
  test execution
• **Enhanced type definitions** with explicit exports and removal of deprecated Headers methods
Diagram
flowchart LR
  A["RuntimeEdge Class"] -- "Rename to" --> B["EdgeRuntime Class"]
  C["MPL-2.0 License"] -- "Change to" --> D["MIT License"]
  E["Node.js >=16"] -- "Bump to" --> F["Node.js >=18"]
  G["Simplified Errors"] -- "Enhanced with" --> H["Stack Traces"]
  I["Custom Stream Code"] -- "Simplified to" --> J["Native Node API"]
  K["Test Organization"] -- "Improved with" --> L["Describe Blocks & Guards"]
  M["Documentation"] -- "Expanded with" --> N["Badges & Architecture"]
  O["Dependencies"] -- "Updated & Cleaned" --> P["v4.0.0 Packages"]
Loading

Grey Divider

File Changes

1. packages/integration-tests/test/body.test.ts 🧪 Tests +170/-174

Reorganize body tests with describe block and simplify test conditions

• Wrapped all tests in a describe('body') block for better organization
• Removed testOrSkip conditional logic and replaced with standard test calls
• Changed error message assertion from toEqual to toContain for 'Body is unusable' message
• Updated helper function expectErrorInstanceOf to check EdgeRuntime instead of RuntimeEdge

packages/integration-tests/test/body.test.ts


2. packages/integration-tests/test/fetch.test.ts 🧪 Tests +212/-119

Refactor fetch tests with improved server management and header validation

• Added custom createServer wrapper that manages socket cleanup on close
• Replaced http-body dependency with stream/consumers for reading request bodies
• Removed testOrSkip conditional and added guard utility with isEdgeRuntime checks
• Wrapped all tests in describe('fetch') block
• Added new it.each test for header validation across different header types
• Updated test assertions and server response handling

packages/integration-tests/test/fetch.test.ts


3. packages/integration-tests/test/request.test.ts 🧪 Tests +99/-79

Reorganize request tests with describe block and header validation

• Wrapped all tests in describe('Request') block
• Removed testOrSkip conditional logic
• Added it.each test for validating various HTTP headers in Request constructor
• Updated URL parsing test to use URL object and toString() method
• Improved test organization and consistency

packages/integration-tests/test/request.test.ts


View more (119)
4. packages/integration-tests/test/response.test.ts 🧪 Tests +59/-55

Reorganize response tests with describe block and guard utilities

• Wrapped all tests in describe('Response') block
• Removed testOrSkip conditional logic
• Added guard utility for edge runtime-specific tests
• Replaced RuntimeEdge checks with isEdgeRuntime() function
• Added new test for mutating response headers for error responses

packages/integration-tests/test/response.test.ts


5. packages/format/tests/index.test.ts 🧪 Tests +7/-7

Update error formatting tests to match stack trace output

• Changed error formatting assertions from exact string matching to regex pattern matching
• Updated expectations to match stack trace format instead of simplified error format
• Modified error object formatting tests to use toMatch instead of toBe

packages/format/tests/index.test.ts


6. packages/primitives/scripts/build.ts ⚙️ Configuration changes +34/-48

Refactor build configuration with custom esbuild plugins

• Replaced esbuild-plugin-alias with custom esbuild plugins for path aliasing
• Updated process definition to include version information for Node 18.20.5
• Added new plugin request-host-header to remove host header deletion
• Removed add-finalization-registry plugin and stream/web polyfill logic
• Changed minification approach to use esbuild.build() directly instead of tsup

packages/primitives/scripts/build.ts


7. packages/runtime/tests/server.test.ts Miscellaneous +12/-12

Rename RuntimeEdge to EdgeRuntime in server tests

• Renamed RuntimeEdge class to EdgeRuntime throughout all test cases
• Updated all instantiations from new RuntimeEdge() to new EdgeRuntime()

packages/runtime/tests/server.test.ts


8. packages/integration-tests/test/headers.test.ts 🧪 Tests +64/-20

Reorganize headers tests with describe block and iterator tests

• Wrapped all tests in describe('headers') block
• Removed testOrSkip conditional logic
• Added it.each test for validating various HTTP headers in Headers constructor
• Added new describe('iterators') block with tests for Symbol.iterator, entries, and values
 methods
• Improved test organization and coverage

packages/integration-tests/test/headers.test.ts


9. packages/vm/src/edge-vm.ts ✨ Enhancement +27/-18

Update global naming and event listener property definitions

• Changed RuntimeEdge global reference to EdgeRuntime
• Converted __conditionallyUpdatesHandlerList function to a non-enumerable property using
 Object.defineProperty
• Updated event listener registration to use self.__conditionallyUpdatesHandlerList instead of
 direct function call
• Modified response header deletion logic to create new Response object instead of mutating headers

packages/vm/src/edge-vm.ts


10. packages/node-utils/test/node-to-edge/request.test.ts Miscellaneous +12/-12

Rename RuntimeEdge to EdgeRuntime in node-to-edge request tests

• Renamed import alias from RuntimeEdge to EdgeRuntime
• Updated all references to use EdgeRuntime instead of RuntimeEdge

packages/node-utils/test/node-to-edge/request.test.ts


11. packages/cookies/test/response-cookies.test.ts 🧪 Tests +25/-0

Add cookie deletion and max-age parsing tests

• Added new test for deleting cookies with Secure, HttpOnly, and SameSite=none attributes
• Added new test for parsing max-age from set-cookie header

packages/cookies/test/response-cookies.test.ts


12. packages/node-utils/src/edge-to-node/stream.ts ✨ Enhancement +1/-76

Simplify stream conversion to use native Node API

• Replaced entire custom implementation with direct export of Node's Readable.fromWeb method
• Simplified from 76 lines to 1 line of code

packages/node-utils/src/edge-to-node/stream.ts


13. packages/integration-tests/test/crypto.test.ts 🧪 Tests +3/-6

Remove conditional test skipping for crypto tests

• Removed testOrSkip conditional logic
• Changed all testOrSkip calls to standard test calls
• Simplified test execution to always run crypto tests

packages/integration-tests/test/crypto.test.ts


14. packages/vm/tests/runtime-edge.test.ts Miscellaneous +8/-12

Rename RuntimeEdge to EdgeRuntime in VM tests

• Renamed type alias from IRuntimeEdge to IEdgeRuntime
• Updated test name from 'RuntimeEdge' to 'EdgeRuntime'
• Changed global reference check from RuntimeEdge to EdgeRuntime
• Added assertion to verify __conditionallyUpdatesHandlerList is not enumerable

packages/vm/tests/runtime-edge.test.ts


15. packages/vm/tests/integration/error.test.ts 🧪 Tests +48/-0

Add error integration tests for EdgeVM

• Added new test file for error handling in EdgeVM
• Tests verify that Error objects maintain stack traces
• Tests verify that custom error properties are preserved in output

packages/vm/tests/integration/error.test.ts


16. packages/runtime/src/server/create-handler.ts Miscellaneous +5/-5

Rename RuntimeEdge to EdgeRuntime and fix documentation

• Renamed type from RuntimeEdge to EdgeRuntime
• Fixed typo in comment from 'HHTP' to 'HTTP'
• Updated JSDoc comments to reference EdgeRuntime instead of RuntimeEdge
• Added parentheses around ternary expression for clarity

packages/runtime/src/server/create-handler.ts


17. packages/cookies/src/serialize.ts ✨ Enhancement +7/-2

Improve cookie serialization formatting and attribute parsing

• Reformatted ternary expression for better readability
• Updated cookie attribute parsing to normalize header names by removing hyphens

packages/cookies/src/serialize.ts


18. packages/node-utils/test/node-to-edge/fetch-event.test.ts Miscellaneous +8/-8

Rename RuntimeEdge to EdgeRuntime in fetch-event tests

• Renamed import alias from RuntimeEdge to EdgeRuntime
• Updated all references to use EdgeRuntime instead of RuntimeEdge

packages/node-utils/test/node-to-edge/fetch-event.test.ts


19. packages/runtime/src/server/run-server.ts Miscellaneous +5/-12

Rename RuntimeEdgeServer and simplify server cleanup logic

• Renamed interface from RuntimeEdgeServer to EdgeRuntimeServer
• Simplified server close logic using promisify utility
• Updated return type and implementation to use Promise.all for cleanup

packages/runtime/src/server/run-server.ts


20. packages/format/src/index.ts ✨ Enhancement +5/-6

Update error formatting to include stack traces

• Changed error formatting to use stack trace instead of simplified error string
• Updated error object inspection to filter out 'name' property from keys
• Modified formatError to return full stack trace when available

packages/format/src/index.ts


21. packages/integration-tests/test/abort-controller.test.ts 🧪 Tests +2/-5

Remove conditional test skipping and update global reference

• Removed testOrSkip conditional logic
• Changed testOrSkip calls to standard it calls
• Updated global check from RuntimeEdge to EdgeRuntime

packages/integration-tests/test/abort-controller.test.ts


22. packages/runtime/src/cli/index.ts Miscellaneous +4/-4

Rename RuntimeEdge to EdgeRuntime in CLI

• Renamed RuntimeEdge class to EdgeRuntime
• Renamed RuntimeEdgeServer type to EdgeRuntimeServer
• Updated all instantiations and type references

packages/runtime/src/cli/index.ts


23. packages/cookies/src/response-cookies.ts ✨ Enhancement +3/-5

Simplify response cookie deletion implementation

• Simplified cookie deletion logic to preserve all cookie options
• Changed from extracting individual properties to spreading options object

packages/cookies/src/response-cookies.ts


24. packages/runtime/src/cli/repl.ts Miscellaneous +4/-4

Rename RuntimeEdge to EdgeRuntime in REPL

• Renamed RuntimeEdge class to EdgeRuntime
• Updated property definition from RuntimeEdge to EdgeRuntime

packages/runtime/src/cli/repl.ts


25. packages/primitives/type-definitions/fetch.d.ts Miscellaneous +2/-5

Simplify fetch type definitions and remove deprecated Headers

• Removed deprecated Headers class definition with getAll method
• Added HeadersConstructor type export
• Simplified type definitions to use native Headers

packages/primitives/type-definitions/fetch.d.ts


26. packages/integration-tests/test/env.d.ts Miscellaneous +22/-0

Add test environment type definitions

• Added new type definitions file for test environment
• Defined multer module types
• Added Headers interface with deprecated getAll method
• Added WeakRef class definition

packages/integration-tests/test/env.d.ts


27. packages/ponyfill/test/EdgeRuntime.test.ts Miscellaneous +3/-3

Rename RuntimeEdge to EdgeRuntime in ponyfill tests

• Renamed environment variable from RUNTIME_EDGE_EXISTS to EDGE_RUNTIME_EXISTS
• Updated test name and assertions to reference EdgeRuntime instead of RuntimeEdge

packages/ponyfill/test/EdgeRuntime.test.ts


28. packages/runtime/src/server/body-streams.ts ✨ Enhancement +3/-1

Add explicit return type to async generator function

• Added explicit return type annotation to consumeUint8ArrayReadableStream function
• Improved type safety with AsyncGenerator<Uint8Array, void, unknown> return type

packages/runtime/src/server/body-streams.ts


29. packages/runtime/tests/fixtures/unhandled-rejection.ts Miscellaneous +2/-3

Rename RuntimeEdge to EdgeRuntime in fixtures

• Renamed RuntimeEdge to EdgeRuntime
• Removed unused node-fetch import

packages/runtime/tests/fixtures/unhandled-rejection.ts


30. packages/runtime/tests/fixtures/pull-error.ts Miscellaneous +2/-2

Rename RuntimeEdge to EdgeRuntime in pull-error fixture

• Renamed RuntimeEdge to EdgeRuntime

packages/runtime/tests/fixtures/pull-error.ts


31. packages/ponyfill/test/compliance-with-primitives.node.test.ts Miscellaneous +1/-1

Update test description naming

• Updated test description from 'Runtime Edge' to 'Edge Runtime'

packages/ponyfill/test/compliance-with-primitives.node.test.ts


32. packages/integration-tests/test/test-if.ts 🧪 Tests +8/-0

Add test utility functions for conditional execution

• Added new utility file with guard function for conditional test execution
• Added isEdgeRuntime function to check for EdgeRuntime global

packages/integration-tests/test/test-if.ts


33. packages/runtime/tests/rejections-and-errors.test.ts ⚙️ Configuration changes +1/-1

Suppress Node warnings in rejection tests

• Added NODE_NO_WARNINGS=1 environment variable to suppress Node warnings

packages/runtime/tests/rejections-and-errors.test.ts


34. packages/runtime/src/cli/logger.ts Miscellaneous +2/-2

Rename logging environment variable

• Renamed environment variable from RUNTIME_EDGE_LOGGING to EDGE_RUNTIME_LOGGING

packages/runtime/src/cli/logger.ts


35. packages/jest-environment/test/index.test.ts Miscellaneous +2/-2

Rename RuntimeEdge to EdgeRuntime in jest environment tests

• Renamed test from 'has RuntimeEdge global' to 'has EdgeRuntime global'
• Updated assertion to check EdgeRuntime instead of RuntimeEdge

packages/jest-environment/test/index.test.ts


36. packages/types/src/index.d.ts Miscellaneous +1/-1

Rename RuntimeEdge to EdgeRuntime in type definitions

• Renamed global constant from RuntimeEdge to EdgeRuntime

packages/types/src/index.d.ts


37. packages/runtime/src/cli/eval.ts Miscellaneous +2/-2

Rename RuntimeEdge to EdgeRuntime in eval CLI

• Renamed RuntimeEdge class to EdgeRuntime

packages/runtime/src/cli/eval.ts


38. packages/vm/src/vm.ts Miscellaneous +1/-1

Update VM context naming

• Updated context name from 'Runtime Edge' to 'Edge Runtime'

packages/vm/src/vm.ts


39. packages/runtime/src/server/index.ts Miscellaneous +1/-1

Rename RuntimeEdgeServer export

• Renamed export from RuntimeEdgeServer to EdgeRuntimeServer

packages/runtime/src/server/index.ts


40. packages/primitives/type-definitions/structured-clone.d.ts Miscellaneous +2/-1

Add structured clone type export

• Added explicit type constructor export for structuredClone

packages/primitives/type-definitions/structured-clone.d.ts


41. packages/runtime/src/index.ts 📦 Other +1/-1
• Renamed export

packages/runtime/src/index.ts


42. LICENSE.md ⚙️ Configuration changes +21/-382

License change from MPLv2 to MIT

• Replaced Mozilla Public License v2.0 with MIT License
• Reduced license file from 382 lines to 21 lines
• Updated copyright holder from Mozilla Foundation to KhulnaSoft, Ltd (2024)

LICENSE.md


43. README.md 📝 Documentation +215/-7

Major README overhaul with expanded documentation

• Completely restructured and expanded documentation with comprehensive overview
• Added badges for build status, npm version, license, documentation, and contributors
• Introduced detailed sections for features, quick start, package ecosystem, architecture, and
 contributing guidelines
• Updated all references from "Runtime Edge" to "Edge Runtime" and from Vercel to KhulnaSoft
• Added v4.0.0 release highlights section

README.md


44. package.json Dependencies +6/-116

Dependencies update and Node.js version bump

• Removed 27-item contributors array from root package configuration
• Updated @types/node from 16 to 18 and @types/jest to 29.5.14
• Upgraded esbuild from 0.20.2 to 0.24.0 and next to 15.5.8
• Updated ts-jest to 29.2.5
• Changed minimum Node.js engine requirement from ">=16" to ">=18"

package.json


45. docs/pages/getting-started.mdx 📝 Documentation +10/-11

Documentation terminology and API naming updates

• Changed all references from "Runtime Edge" to "Edge Runtime"
• Updated class name from RuntimeEdge to EdgeRuntime in code examples
• Removed node-fetch import from server example (using native fetch instead)

docs/pages/getting-started.mdx


46. docs/pages/features/polyfills.mdx 📝 Documentation +4/-4

Terminology updates in polyfills documentation

• Updated all references from "Runtime Edge" to "Edge Runtime"
• Maintained technical content about polyfills and Node.js version support

docs/pages/features/polyfills.mdx


47. docs/pages/packages/runtime.mdx 📝 Documentation +10/-10

API naming and documentation updates

• Changed title from "Runtime Edge" to "Edge Runtime"
• Updated class name from RuntimeEdge to EdgeRuntime throughout documentation
• Updated API documentation section headers to reflect new naming

docs/pages/packages/runtime.mdx


48. docs/pages/index.mdx 📝 Documentation +9/-9

Homepage terminology standardization

• Updated all instances of "Runtime Edge" to "Edge Runtime"
• Maintained core messaging about framework integration and Web standards compliance

docs/pages/index.mdx


49. packages/format/README.md 📝 Documentation +3/-3

Minor documentation fixes and link corrections

• Fixed grammar: "An" to "A" in description
• Corrected documentation link from /packages/primitives to /packages/format
• Updated Twitter handle from @vercel to @khulnasoft

packages/format/README.md


50. docs/package.json Dependencies +15/-13

Documentation dependencies upgrade and license change

• Updated dependencies: @heroicons/react to 2.2.0, next to 15.2.8, next-themes to 0.4.6
• Updated nextra and nextra-theme-docs to version 2 (major version bump)
• Updated react and react-dom to version 18, swr to 2.3.3
• Added eslint and eslint-config-next as dev dependencies
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

docs/package.json


51. packages/cookies/README.md 📝 Documentation +3/-3

Documentation terminology and link corrections

• Updated terminology from "Runtime Edge" to "Edge Runtime"
• Corrected documentation link from /packages/jest-environment to /packages/cookies
• Updated Twitter handle from @vercel to @khulnasoft

packages/cookies/README.md


52. docs/pages/features/available-apis.mdx 📝 Documentation +7/-7

API naming and terminology updates

• Updated title from "Runtime Edge APIs" to "Edge Runtime APIs"
• Changed globalThis.RuntimeEdge reference to globalThis.EdgeRuntime
• Updated all terminology from "Runtime Edge" to "Edge Runtime"

docs/pages/features/available-apis.mdx


53. packages/ponyfill/package.json Dependencies +7/-7

Version bump, dependencies update, and license change

• Updated description from "Runtime Edge APIs" to "Edge Runtime APIs"
• Bumped version from 2.4.2 to 4.0.0
• Updated acorn from 8.11.3 to 8.14.0 and acorn-walk to 8.3.4
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed environment variable from RUNTIME_EDGE_EXISTS to EDGE_RUNTIME_EXISTS
• Changed license from "MPL-2.0" to "MIT"

packages/ponyfill/package.json


54. packages/primitives/package.json Dependencies +7/-9

Dependencies cleanup and license standardization

• Updated description from "Vercel Runtime Edge" to "Vercel Edge Runtime"
• Downgraded version from 4.1.0 to 4.0.0
• Removed dependencies: @ungap/structured-clone, blob-polyfill, esbuild-plugin-alias
• Updated undici from 5.28.4 to 6.21.0
• Simplified build output to only dist/** in turbo config
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/primitives/package.json


55. packages/ponyfill/README.md 📝 Documentation +2/-2

Terminology and social media link updates

• Updated terminology from "Runtime Edge APIs" to "Edge Runtime APIs"
• Updated Twitter handle from @vercel to @khulnasoft

packages/ponyfill/README.md


56. packages/jest-environment/README.md 📝 Documentation +2/-2

Terminology and social media updates

• Updated terminology from "Runtime Edge context" to "Edge Runtime context"
• Updated Twitter handle from @vercel to @khulnasoft

packages/jest-environment/README.md


57. packages/primitives/README.md 📝 Documentation +2/-2

Terminology and social media link updates

• Updated terminology from "Vercel Runtime Edge" to "Vercel Edge Runtime"
• Updated Twitter handle from @vercel to @khulnasoft

packages/primitives/README.md


58. packages/user-agent/README.md 📝 Documentation +2/-2

Terminology and social media updates

• Updated terminology from "Runtime Edge compatible" to "Edge Runtime compatible"
• Updated Twitter handle from @vercel to @khulnasoft

packages/user-agent/README.md


59. packages/types/README.md 📝 Documentation +2/-2

Terminology and social media link updates

• Updated terminology from "Runtime Edge" to "Edge Runtime"
• Updated Twitter handle from @vercel to @khulnasoft

packages/types/README.md


60. packages/format/package.json Dependencies +4/-4

Version bump, Node.js requirement, and license change

• Updated description from "Runtime Edge" to "Edge Runtime"
• Bumped version from 2.2.1 to 4.0.0
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/format/package.json


61. packages/cookies/package.json Dependencies +4/-4

Version standardization and license change

• Updated description from "Runtime Edge" to "Edge Runtime"
• Downgraded version from 4.1.1 to 4.0.0
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/cookies/package.json


62. docs/pages/packages/node-utils.mdx 📝 Documentation +12/-7

Documentation updates and alpha warning removal

• Updated title from "Runtime Edge Node Utils" to "Edge Runtime Node Utils"
• Removed alpha version warning callout
• Improved code block formatting for function signatures

docs/pages/packages/node-utils.mdx


63. packages/runtime/package.json Dependencies +4/-8

Version bump, dependencies cleanup, and license change

• Bumped version from 2.5.9 to 4.0.0
• Updated picocolors from 1.0.0 to 1.1.1
• Removed @types/node-fetch and node-fetch dev dependencies
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/runtime/package.json


64. packages/vm/package.json Dependencies +5/-5

Version bump, dependencies update, and license change

• Bumped version from 3.2.0 to 4.0.0
• Updated @types/ws from 8.5.10 to 8.5.13 and ws from 8.16.0 to 8.18.0
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/vm/package.json


65. packages/jest-environment/package.json Dependencies +5/-5

Version bump, terminology update, and license change

• Updated description from "Runtime Edge context" to "Edge Runtime context"
• Bumped version from 2.3.10 to 4.0.0
• Updated jest-util from 29.7.0 to 29.5.0
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/jest-environment/package.json


66. docs/pages/packages/ponyfill.mdx 📝 Documentation +4/-4

Terminology standardization in documentation

• Updated title from "Runtime Edge Ponyfill" to "Edge Runtime Ponyfill"
• Updated all terminology from "Runtime Edge" to "Edge Runtime"

docs/pages/packages/ponyfill.mdx


67. packages/user-agent/package.json Dependencies +5/-5

Version bump, dependencies update, and license change

• Updated description from "Runtime Edge compatible" to "Edge Runtime compatible"
• Bumped version from 1.4.1 to 4.0.0
• Updated ua-parser-js from 1.0.37 to 1.0.39
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/user-agent/package.json


68. packages/jest-expect/package.json Dependencies +3/-3

Version bump and license change

• Bumped version from 1.2.0 to 4.0.0
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/jest-expect/package.json


69. packages/node-utils/package.json Dependencies +3/-3

Version bump and license change

• Bumped version from 2.3.0 to 4.0.0
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/node-utils/package.json


70. turbo.json ⚙️ Configuration changes +2/-15

Turborepo configuration update to v2 format

• Changed pipeline key to tasks (Turborepo v2 configuration format)
• Simplified @runtime-edge/primitives#build outputs from 16 directories to single dist/**

turbo.json


71. packages/integration-tests/package.json Dependencies +2/-3

Version bump, dependency removal, and license change

• Bumped version from 1.0.0 to 4.0.0
• Removed http-body dependency
• Changed license from "MPL-2.0" to "MIT"

packages/integration-tests/package.json


72. docs/pages/packages/jest-environment.mdx 📝 Documentation +3/-3

Terminology standardization in documentation

• Updated title from "Runtime Edge Jest Environment" to "Edge Runtime Jest Environment"
• Updated all terminology from "Runtime Edge" to "Edge Runtime"

docs/pages/packages/jest-environment.mdx


73. packages/types/package.json Dependencies +4/-4

Version bump and license change

• Updated description from "Runtime Edge" to "Edge Runtime"
• Bumped version from 2.2.9 to 4.0.0
• Changed minimum Node.js requirement from ">=16" to ">=18"
• Changed license from "MPL-2.0" to "MIT"

packages/types/package.json


74. packages/jest-expect/README.md 📝 Documentation +1/-1

Social media link update

• Updated Twitter handle from @vercel to @khulnasoft

packages/jest-expect/README.md


75. packages/node-utils/README.md 📝 Documentation +1/-1

Social media link update

• Updated Twitter handle from @vercel to @khulnasoft

packages/node-utils/README.md


76. packages/vm/README.md 📝 Documentation +1/-1

Social media link update

• Updated Twitter handle from @vercel to @khulnasoft

packages/vm/README.md


77. docs/pages/cli.mdx 📝 Documentation +3/-3

Terminology standardization in CLI documentation

• Updated terminology from "Runtime Edge" to "Edge Runtime"
• Updated all references in CLI documentation

docs/pages/cli.mdx


78. packages/runtime/README.md 📝 Documentation +1/-1

Social media link update

• Updated Twitter handle from @vercel to @khulnasoft

packages/runtime/README.md


79. docs/components/footer.tsx 📝 Documentation +1/-1

Social media link update in footer component

• Updated Twitter link from https://twitter.com/vercel to https://twitter.com/khulnasoft

docs/components/footer.tsx


80. 📦 Other +0/-0


81. .changeset/config.json Additional files +1/-1

...

.changeset/config.json


82. .github/dependabot.yml Additional files +0/-6

...

.github/dependabot.yml


83. .github/workflows/test.yml Additional files +1/-1

...

.github/workflows/test.yml


84. .github/workflows/update.yml Additional files +1/-1

...

.github/workflows/update.yml


85. docs/.eslintrc.json Additional files +6/-0

...

docs/.eslintrc.json


86. docs/pages/_app.mdx Additional files +6/-6

...

docs/pages/_app.mdx


87. docs/pages/features/_meta.json Additional files +1/-1

...

docs/pages/features/_meta.json


88. docs/pages/features/typescript-support.mdx Additional files +1/-1

...

docs/pages/features/typescript-support.mdx


89. docs/pages/features/upgrading-nextjs.mdx Additional files +2/-2

...

docs/pages/features/upgrading-nextjs.mdx


90. docs/pages/packages/cookies.mdx Additional files +2/-2

...

docs/pages/packages/cookies.mdx


91. docs/pages/packages/format.mdx Additional files +1/-1

...

docs/pages/packages/format.mdx


92. docs/pages/packages/jest-expect.mdx Additional files +1/-1

...

docs/pages/packages/jest-expect.mdx


93. docs/pages/packages/primitives.mdx Additional files +2/-2

...

docs/pages/packages/primitives.mdx


94. docs/pages/packages/types.mdx Additional files +2/-2

...

docs/pages/packages/types.mdx


95. docs/pages/packages/user-agent.mdx Additional files +1/-1

...

docs/pages/packages/user-agent.mdx


96. docs/pages/packages/vm.mdx Additional files +1/-1

...

docs/pages/packages/vm.mdx


97. docs/theme.config.js Additional files +4/-4

...

docs/theme.config.js


98. packages/cookies/CHANGELOG.md Additional files +0/-215

...

packages/cookies/CHANGELOG.md


99. packages/format/CHANGELOG.md Additional files +0/-67

...

packages/format/CHANGELOG.md


100. packages/integration-tests/test/blob.test.ts Additional files +0/-8

...

packages/integration-tests/test/blob.test.ts


101. packages/jest-environment/CHANGELOG.md Additional files +0/-377

...

packages/jest-environment/CHANGELOG.md


102. packages/jest-expect/CHANGELOG.md Additional files +0/-43

...

packages/jest-expect/CHANGELOG.md


103. packages/node-utils/CHANGELOG.md Additional files +0/-112

...

packages/node-utils/CHANGELOG.md


104. packages/ponyfill/CHANGELOG.md Additional files +0/-109

...

packages/ponyfill/CHANGELOG.md


105. packages/ponyfill/src/index.js Additional files +1/-1

...

packages/ponyfill/src/index.js


106. packages/primitives/CHANGELOG.md Additional files +0/-331

...

packages/primitives/CHANGELOG.md


107. packages/primitives/src/patches/undici-core-request.js Additional files +190/-123

...

packages/primitives/src/patches/undici-core-request.js


108. packages/primitives/src/patches/util-types.js Additional files +0/-5

...

packages/primitives/src/patches/util-types.js


109. packages/primitives/src/primitives/blob.js Additional files +0/-1

...

packages/primitives/src/primitives/blob.js


110. packages/primitives/src/primitives/fetch.js Additional files +34/-117

...

packages/primitives/src/primitives/fetch.js


111. packages/primitives/src/primitives/load.js Additional files +61/-174

...

packages/primitives/src/primitives/load.js


112. packages/primitives/src/primitives/stream.js Additional files +12/-0

...

packages/primitives/src/primitives/stream.js


113. packages/primitives/src/primitives/structured-clone.js Additional files +0/-11

...

packages/primitives/src/primitives/structured-clone.js


114. packages/primitives/text-encoding-streams/package.json Additional files +0/-4

...

packages/primitives/text-encoding-streams/package.json


115. packages/runtime/CHANGELOG.md Additional files +0/-467

...

packages/runtime/CHANGELOG.md


116. packages/runtime/examples/fetch.js Additional files +2/-2

...

packages/runtime/examples/fetch.js


117. packages/runtime/examples/html.js Additional files +1/-1

...

packages/runtime/examples/html.js


118. packages/runtime/src/runtime-edge.ts Additional files +1/-1

...

packages/runtime/src/runtime-edge.ts


119. packages/types/CHANGELOG.md A...

@qodo-code-review
Copy link

Code Review by Qodo

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

Grey Divider


Action required

1. ESM build uses require 🐞 Bug ✓ Correctness
Description
@runtime-edge/node-utils is built/published with an ESM entry (dist/index.mjs), but
  stream.ts now uses CommonJS require() at module top-level.
• In ESM execution, require is not defined, so importing the ESM bundle can crash immediately with
  ReferenceError: require is not defined.
• This is a hard correctness/reliability break for ESM consumers (the package explicitly advertises
  ESM via the module field).
Code

packages/node-utils/src/edge-to-node/stream.ts[1]

+export const toToReadable = require('stream').Readable.fromWeb
Evidence
The changed implementation uses require('stream')... in a source file that is compiled to both CJS
and ESM. The package advertises an ESM entrypoint and tsup is configured to emit ESM, meaning this
code must be valid under ESM execution semantics (where require is not defined).

packages/node-utils/src/edge-to-node/stream.ts[1-1]
packages/node-utils/tsup.config.ts[1-8]
packages/node-utils/package.json[6-8]

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

## Issue description
`@runtime-edge/node-utils` emits an ESM build (`dist/index.mjs`) but `packages/node-utils/src/edge-to-node/stream.ts` now references `require(...)` at top-level. In ESM, `require` is not defined and can cause an immediate runtime crash for ESM consumers.

## Issue Context
The package is configured to build both CJS and ESM via tsup and advertises an ESM entrypoint via the `module` field.

## Fix Focus Areas
- packages/node-utils/src/edge-to-node/stream.ts[1-1]

## Suggested change
Prefer an import that works in both outputs:

```ts
import { Readable } from &#x27;node:stream&#x27;

export const toToReadable = Readable.fromWeb
```

If you want to preserve a fallback for older Nodes (even though engines are `&gt;=18`), you can optionally add a guarded fallback implementation.

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



Remediation recommended

2. Error format appends {} 🐞 Bug ✓ Correctness
Description
@runtime-edge/format removed the early return for Error values when there are no enumerable
  keys, so the formatter proceeds into object rendering.
• Since getKeys() (non-hidden) uses Object.keys(), typical Error instances have `keys.length
  === 0, producing an empty output` list.
• reduceToSingleString() still appends { ... } whenever base is non-empty, so a plain Error
  can end up formatted as stacktrace {} (or a multiline stacktrace {\n\n}), which is noisy and
  deviates from expected inspection/format behavior.
Code

packages/format/src/index.ts[R258-261]

      } else if (isError(value)) {
        base = formatError(value)
-        if (keys.length === 0) {
-          return base
-        }
-        base = ' ' + base
+        keys = keys.filter((x) => x !== 'name')
      } else if (hasCustomSymbol(value, ctx.customInspectSymbol)) {
Evidence
For Errors, the code now sets base = formatError(value) but no longer returns when there are no
keys; meanwhile getKeys() returns enumerable keys only (typically none for Errors). With
output=[] and base non-empty, reduceToSingleString() always emits braces, resulting in an
empty object suffix despite no properties to display.

packages/format/src/index.ts[258-266]
packages/format/src/index.ts[588-616]
packages/format/src/index.ts[540-565]

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

## Issue description
`@runtime-edge/format` now formats `Error` values by setting `base = formatError(error)` but does not return early when there are no enumerable keys. Since most Errors have no enumerable keys, the formatter emits an empty object suffix (`{}` / multiline empty braces) after the stack trace.

## Issue Context
This change likely came from wanting better Error output (stack traces), but the empty-braces suffix appears unintended and adds noise.

## Fix Focus Areas
- packages/format/src/index.ts[258-266]
- packages/format/src/index.ts[540-565]

## Suggested change
After filtering keys, add:

```ts
} else if (isError(value)) {
 base = formatError(value)
 keys = keys.filter((x) =&gt; x !== &#x27;name&#x27;)
 if (keys.length === 0) return base
}
```

(If you still want to include additional Error properties when present, keep the existing path for non-empty `keys`.)

ⓘ 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


return readable
}
export const toToReadable = require('stream').Readable.fromWeb

Choose a reason for hiding this comment

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

Action required

1. Esm build uses require 🐞 Bug ✓ Correctness

@runtime-edge/node-utils is built/published with an ESM entry (dist/index.mjs), but
  stream.ts now uses CommonJS require() at module top-level.
• In ESM execution, require is not defined, so importing the ESM bundle can crash immediately with
  ReferenceError: require is not defined.
• This is a hard correctness/reliability break for ESM consumers (the package explicitly advertises
  ESM via the module field).
Agent Prompt
## Issue description
`@runtime-edge/node-utils` emits an ESM build (`dist/index.mjs`) but `packages/node-utils/src/edge-to-node/stream.ts` now references `require(...)` at top-level. In ESM, `require` is not defined and can cause an immediate runtime crash for ESM consumers.

## Issue Context
The package is configured to build both CJS and ESM via tsup and advertises an ESM entrypoint via the `module` field.

## Fix Focus Areas
- packages/node-utils/src/edge-to-node/stream.ts[1-1]

## Suggested change
Prefer an import that works in both outputs:

```ts
import { Readable } from 'node:stream'

export const toToReadable = Readable.fromWeb
```

If you want to preserve a fallback for older Nodes (even though engines are `>=18`), you can optionally add a guarded fallback implementation.

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

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.

3 participants