polyfillme is currently CommonJS (no "type": "module", CJS source, CJS test/*.test.js). It should move to the CLDMV standard — ESM-native with a thin CJS wrapper — so consumers get native import while require() still works. Non-urgent; tracking follow-up (same modernization as the CJS→ESM issues on gitmulti / wol-proxy / cldmv-node-memcache).
Reference: CLDMV/wisp (the simplest wrapper)
package.json:
ESM source: index.mjs + src/**/*.mjs.
Thin CJS wrapper index.cjs — loads the ESM build via createRequire and re-exports:
"use strict";
const { createRequire } = require("module");
const esm = createRequire(__filename)("./index.mjs");
module.exports = esm.default;
module.exports.default = esm.default;
module.exports.wisp = esm.wisp; // re-export each named export
module.exports.wispSync = esm.wispSync;
For polyfillme
- Convert the source to ESM (
.js → .mjs), add type: "module" + the exports map, and add an index.cjs wrapper re-exporting the public API.
- Preserve the current public API and any side-effect / global-patch semantics — a polyfill package's consumption pattern (side-effect import vs. explicit apply) must not change behavior across the ESM/CJS split.
- Keep the
test/* suite green against the new entry points (the in-progress v4 onboarding already wires @cldmv/vitest-runner; convert or dual-target the tests as part of this).
This is packaging modernization only — no functional change intended.
polyfillme is currently CommonJS (no
"type": "module", CJS source, CJStest/*.test.js). It should move to the CLDMV standard — ESM-native with a thin CJS wrapper — so consumers get nativeimportwhilerequire()still works. Non-urgent; tracking follow-up (same modernization as the CJS→ESM issues on gitmulti / wol-proxy / cldmv-node-memcache).Reference:
CLDMV/wisp(the simplest wrapper)package.json:{ "type": "module", // no "main" "exports": { ".": { "import": "./index.mjs", "require": "./index.cjs" } }, "files": ["src/", "index.mjs", "index.cjs", "README.md", "LICENSE", "package.json"] }ESM source:
index.mjs+src/**/*.mjs.Thin CJS wrapper
index.cjs— loads the ESM build viacreateRequireand re-exports:For polyfillme
.js→.mjs), addtype: "module"+ theexportsmap, and add anindex.cjswrapper re-exporting the public API.test/*suite green against the new entry points (the in-progress v4 onboarding already wires@cldmv/vitest-runner; convert or dual-target the tests as part of this).This is packaging modernization only — no functional change intended.