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

Updated package.json structs and populated new main field #1151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DoctorBracewell
Copy link

#1009 discusses how the generated package.json should have a main entry regardless of target type, this has been confirmed by a member of the NodeJS module team.

Added main field to NoModulesPackage and ESModulesPackage in the generated package.json.

Cloned the entry filename during struct instantiation for when the package.json is generated. Cloning might not be optimal, it is probably possible to borrow the String and generate the filename with that, but I think clones here should be fine.

  • [✅ ] You have the latest version of rustfmt installed
$ rustup component add rustfmt
  • [✅ ] You ran cargo fmt on the code base before submitting
  • [✅ ] You reference which issue is being closed in the PR text

Added `main` field to  NoModulesPackage and ESModulesPackage in the generated package.json.

Also cloned the entry filename during struct instantiation for when the package.json is generated. Cloning might not be optimal, it is probably possible to borrow the String and generate the filename with that, but I think clones here should be fine.
@zensh
Copy link

zensh commented Jul 16, 2023

Look forward to merge, module field is not work in node.js.
And there should have "type": "module" in package.json. See https://github.com/yiwen-ai/isolang-wasm/blob/main/pkg/package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants