-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Compability changes #11
Conversation
- Import the `sodium` object in a single place and use it across the object. This simplifies the import semantics and enables compatibility with `node` and `bun`: FiloSottile#9 - Configure CI to run using GitHub Actions. - Add the examples from the README to `tests/readme-examples` and test them in CI using `bun`. - Add `npm run clean` - Update `tsconfig.json` to avoid warnings: - Set `"module": "nodenext"` to avoid: "Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.ts" (from TypeScript). - Set the `"include"` to the `"lib"` folder so that the top-level await lines in `tests/readme-examples` don't show errors.
@FiloSottile: Apologies for the omnibus PR. I've tried to keep with the existing project conventions where possible, but if you're interested in a subset of changes I'd be happy to break it apart. I've tested that the resulting build works in |
Hm, I'm sorry, there seems to be an issue with this that only happens in CI but which I can't reproduce locally: RUN v0.34.1 /home/runner/work/age.ts/age.ts I don't yet know if that's due to code changes in this PR, or just from trying to run |
Thank you! I had a few of these changes staged but got stuck on trying to write a test for esbuild compatibility. It looks like partially due to libsodium choices the esbuild bundle runs in the browser but not in node, so to test it I'll have to run puppeteer or something like that. |
Got it! The tests needed the same initialization conventions as well: lgarron@efadd20 (But I still really wish top-level await were ready for use in libraries, that would make this all much simpler.) |
That said, running in Puppeteer would probably still be smart. |
Closing in favor of #14. Thanks again! |
sodium
object in a single place and use the object across the project. This simplifies the import semantics and enables compatibility withnode
andbun
: Incompatibilities withnode
andbun
#9tests/readme-examples
and test them in CI usingbun
.npm run clean
tsconfig.json
to avoid warnings:"module": "nodenext"
to avoid: "Option 'module' must be set to 'NodeNext' when option 'moduleResolution' is set to 'NodeNext'.ts" (from TypeScript)."include"
to the"lib"
folder so that the top-level await lines intests/readme-examples
don't show errors.