Draft
Conversation
- 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.
There was a problem hiding this comment.
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.
__tests__/authutil.test.ts
Outdated
Comment on lines
19
to
21
| let cnSpy: any; | ||
| let logSpy: any; | ||
| let dbgSpy: any; |
There was a problem hiding this comment.
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; |
…as a dev dependency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Describe your changes.
Related issue:
Add link to the related issue.
Check list: