Skip to content

Commit

Permalink
fix: update module system and test configuration for ESM support
Browse files Browse the repository at this point in the history
Co-Authored-By: Michael Latman <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and michaellatman committed Dec 11, 2024
1 parent 6811d57 commit 5c555c7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
8 changes: 7 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ module.exports = {
moduleFileExtensions: ['ts', 'js', 'json', 'node'],
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
transform: {
'^.+\\.tsx?$': ['ts-jest']
'^.+\\.tsx?$': ['ts-jest', {
useESM: true
}]
},
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1'
},
extensionsToTreatAsEsm: ['.ts'],
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov'],
Expand Down
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"test": "jest --coverage",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"test:list": "node src/index.ts list",
"test:install": "node src/index.ts install",
"test:installed": "node src/index.ts installed",
"extract": "node src/extractors/modelcontextprotocol-extractor.ts",
"test:uninstall": "node src/index.ts uninstall",
"test:list": "node --loader ts-node/esm src/index.ts list",
"test:install": "node --loader ts-node/esm src/index.ts install",
"test:installed": "node --loader ts-node/esm src/index.ts installed",
"extract": "node --loader ts-node/esm src/extractors/modelcontextprotocol-extractor.ts",
"test:uninstall": "node --loader ts-node/esm src/index.ts uninstall",
"version:patch": "npm version patch",
"version:minor": "npm version minor",
"version:major": "npm version major",
Expand Down Expand Up @@ -54,11 +54,10 @@
"packages",
"LICENSE"
],
"type": "commonjs",
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js"
"import": "./dist/index.js"
}
},
"license": "MIT"
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "node",
"target": "ES2022",
"module": "node16",
"moduleResolution": "node16",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
Expand Down

0 comments on commit 5c555c7

Please sign in to comment.