Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move type:module declaration into package.json. #4355

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"keywords": [
"matrix-org"
],
"type": "module",
"main": "./src/index.ts",
"browser": "./src/browser-index.ts",
"matrix_src_main": "./src/index.ts",
Expand Down
3 changes: 0 additions & 3 deletions scripts/release/pre-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ do
jq ".$i = .matrix_lib_$i" package.json > package.json.new && mv package.json.new package.json && yarn prettier --write package.json
fi
done

# Ensure that "type": "module" is present
jq '.type = "module"' package.json > package.json.new && mv package.json.new package.json && yarn prettier --write package.json
18 changes: 18 additions & 0 deletions scripts/switch_package_to_release.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/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];
}
}

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github fails to show this, but this is a symlink

This file was deleted.

1 change: 1 addition & 0 deletions scripts/switch_package_to_release.js
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github fails to show this, but this is a symlink

Loading