• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mongodb-js / mongodb-mcp-server / 16320816887

16 Jul 2025 01:27PM UTC coverage: 76.93% (-0.5%) from 77.385%
16320816887

Pull #371

github

web-flow
Merge cce6ddb82 into fd3f2a4fd
Pull Request #371: chore(build): build a universal ESM and CommonJS package

501 of 691 branches covered (72.5%)

Branch coverage included in aggregate %.

2 of 66 new or added lines in 6 files covered. (3.03%)

1 existing line in 1 file now uncovered.

2827 of 3635 relevant lines covered (77.77%)

28.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

8.33
/scripts/createUniversalPackage.ts
1
#!/usr/bin/env tsx
2✔
2

NEW
3
import { writeFileSync, mkdirSync } from "fs";
×
NEW
4
import { resolve } from "path";
×
5

NEW
6
const distDir = resolve("dist");
×
7

8
/**
9
 * Node uses the package.json to know whether files with a .js extensions
10
 * should be interpreted as CommonJS or ESM.
11
 */
12
// ESM package.json
NEW
13
const esmPath = resolve(distDir, "esm", "package.json");
×
NEW
14
mkdirSync(resolve(distDir, "esm"), { recursive: true });
×
NEW
15
writeFileSync(esmPath, JSON.stringify({ type: "module" }));
×
16

17
// CJS package.json
NEW
18
const cjsPath = resolve(distDir, "cjs", "package.json");
×
NEW
19
mkdirSync(resolve(distDir, "cjs"), { recursive: true });
×
NEW
20
writeFileSync(cjsPath, JSON.stringify({ type: "commonjs" }));
×
21

22
// Create a dist/index.js file that imports the ESM index.js file
23
// To minimize breaking changes from pre-universal package time.
NEW
24
const indexPath = resolve(distDir, "index.js");
×
NEW
25
writeFileSync(indexPath, `import "./esm/index.js";`);
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc