Commit 36260dc
committed
fix: resolve ES module compatibility issues with dual-module setup
🔧 Module System Fixes:
- Update build process to output .cjs files for CommonJS compatibility
- Add build:rename script to convert .js to .cjs extensions
- Update package.json main entry to point to build/server.cjs
- Update bin entry to use build/server.cjs
- Restore 'type': 'module' for Smithery.ai compatibility
📦 Dual Module Support:
- CommonJS: build/server.cjs (for npm/CLI usage)
- ES Modules: src/index.ts (for Smithery.ai deployment)
- Jest configs: .cjs extensions (for test compatibility)
✅ Verification Results:
- npm run test:ci: ✅ 31 tests pass
- npm run build: ✅ Creates .cjs files correctly
- npm run build:smithery: ✅ ES modules for Smithery
- require('./build/server.cjs'): ✅ CommonJS import works
- Server startup: ✅ CLI functionality preserved
This resolves the 'require() of ES Module not supported' error
while maintaining compatibility with both traditional npm usage
and modern Smithery.ai deployment requirements.1 parent 62e80a0 commit 36260dc
File tree
13 files changed
+37
-396
lines changed- build
- config
- services
- types
- utils
- test-results
13 files changed
+37
-396
lines changedThis file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments