Skip to content

Conversation

salmanmkc
Copy link
Contributor

  • Added package.json in dist/setup to specify module type as ESM.
  • Updated jest.config.js to support ESM with ts-jest and added moduleNameMapper for .js extensions.
  • Created jest.setup.js to ensure Jest globals are available in ESM mode.
  • Modified test script in package.json to use node with experimental VM modules for Jest.
  • Updated imports in various distribution files to include .js extensions for ESM compatibility.
  • Adjusted tsconfig.json to exclude tests directory and maintain ESM settings.
  • Updated package-lock.json to include new dependencies and their versions.

Description:
Describe your changes.

Related issue:
Add link to the related issue.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

- Added package.json in dist/setup to specify module type as ESM.
- Updated jest.config.js to support ESM with ts-jest and added moduleNameMapper for .js extensions.
- Created jest.setup.js to ensure Jest globals are available in ESM mode.
- Modified test script in package.json to use node with experimental VM modules for Jest.
- Updated imports in various distribution files to include .js extensions for ESM compatibility.
- Adjusted tsconfig.json to exclude __tests__ directory and maintain ESM settings.
- Updated package-lock.json to include new dependencies and their versions.
@salmanmkc salmanmkc requested a review from a team as a code owner October 14, 2025 13:21
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 13:21
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the project from CommonJS to ES modules (ESM) and upgrades node-fetch from version 2.x to 3.x. The changes enable modern JavaScript module syntax and fetch API compatibility.

  • Converted package.json to specify "type": "module" for ESM support
  • Updated all import statements to include .js extensions for ESM compatibility
  • Modified Jest configuration and test scripts to work with ESM modules

Reviewed Changes

Copilot reviewed 30 out of 40 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Added ESM module type and updated test script for experimental VM modules
jest.setup.js Created Jest setup file to ensure globals are available in ESM mode
src/**/*.ts Updated import statements to include .js extensions for ESM compatibility
tests/**/*.ts Updated test imports and added ESM compatibility utilities
.licenses/npm/*.dep.yml Updated dependency license files for node-fetch v3.x and related packages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 19 to 21
let cnSpy: any;
let logSpy: any;
let dbgSpy: any;
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

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

Using 'any' type defeats TypeScript's type safety. Consider using proper Jest spy types like 'jest.SpyInstance' or importing the specific types from '@jest/globals'.

Suggested change
let cnSpy: any;
let logSpy: any;
let dbgSpy: any;
let cnSpy: jest.SpyInstance;
let logSpy: jest.SpyInstance;
let dbgSpy: jest.SpyInstance;

Copilot uses AI. Check for mistakes.

@salmanmkc salmanmkc marked this pull request as draft October 14, 2025 13:29
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.

2 participants