Files
openclaw/scripts/e2e/lib/npm-telegram-live/prepare-package.mjs
2026-04-29 11:49:45 +01:00

14 lines
536 B
JavaScript

import fs from "node:fs";
for (const packageJsonPath of process.argv.slice(2)) {
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
pkg.exports = pkg.exports && typeof pkg.exports === "object" ? pkg.exports : {};
if (!pkg.exports["./plugin-sdk/gateway-runtime"]) {
pkg.exports["./plugin-sdk/gateway-runtime"] = {
types: "./dist/plugin-sdk/gateway-runtime.d.ts",
default: "./dist/plugin-sdk/gateway-runtime.js",
};
}
fs.writeFileSync(packageJsonPath, `${JSON.stringify(pkg, null, 2)}\n`);
}