Skip to content

Commit

Permalink
Rename switch_package_to_release.js to .cjs
Browse files Browse the repository at this point in the history
Slightly surprisingly, the symlink is enough to make `node
switch_package_to_release.js` work.
  • Loading branch information
richvdh committed Aug 20, 2024
1 parent 2544c14 commit 1e2aa32
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
22 changes: 22 additions & 0 deletions scripts/switch_package_to_release.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env node

const fsProm = require("fs/promises");

const PKGJSON = "package.json";

async function main() {
const pkgJson = JSON.parse(await fsProm.readFile(PKGJSON, "utf8"));
for (const field of ["main", "typings"]) {
if (pkgJson["matrix_lib_" + field] !== undefined) {
pkgJson[field] = pkgJson["matrix_lib_" + field];
}
}

// matrix-js-sdk is built into ECMAScript modules. Make sure we declare it as such.
// See https://nodejs.org/api/packages.html#type.
pkgJson["type"] = "module";

await fsProm.writeFile(PKGJSON, JSON.stringify(pkgJson, null, 2));
}

main();
22 changes: 0 additions & 22 deletions scripts/switch_package_to_release.js

This file was deleted.

1 change: 1 addition & 0 deletions scripts/switch_package_to_release.js

0 comments on commit 1e2aa32

Please sign in to comment.