fix: package.json override script (#2138)

This commit is contained in:
Dylan Piercey 2024-03-04 10:45:55 -07:00 committed by GitHub
parent b32602c4dc
commit 105c26bd4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 4 deletions

View File

@ -0,0 +1,11 @@
---
"@marko/babel-utils": patch
"@marko/compiler": patch
"marko": patch
"@marko/runtime-tags": patch
"@marko/translator-default": patch
"@marko/translator-interop-class-tags": patch
"@marko/translator-tags": patch
---
Fix issue with package json src/dist override script.

View File

@ -3,11 +3,14 @@ const path = require("path");
for (const name of fs.readdirSync("packages")) {
const file = path.join("packages", name, "package.json");
const details = JSON.parse(fs.readFileSync(file, "utf8"));
if (
override(details, "main") ||
override(details, "module") ||
override(details, "browser") ||
override(details, "exports")
[
override(details, "main"),
override(details, "module"),
override(details, "browser"),
override(details, "exports"),
].some(Boolean)
) {
fs.writeFileSync(file, `${JSON.stringify(details, null, 2)}\n`);
}