-
Notifications
You must be signed in to change notification settings - Fork 0
Support more runtimes, simplify public interface #8
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
Conversation
|
In a follow-up, the rest of the node-specific stuff should get removed (e.g., |
|
Added smoke tests for node (CJS), deno (ESM/TS), and bun (ESM/TS). Made env var access work in deno and bun as well as node. Moved test related stuff below |
| @@ -1,3 +1,4 @@ | |||
| // @ts-ignore - need to build before this will exist | |||
| import { decryptSops } from "../../../dist/index.js"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about bun, but I suspect for deno the correct solution is to import-map sops-age to ../../../src/index.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can leave this as is, more for future reference for experimentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For smoke tests, I wanted to use the built version vs. what's in src/ so I can test how the various formats get bundled. We could add a prepare script to build things when you install, or even put dist in git; but I think the above is fine for testing.
tarasglek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really impressive. I didn't think about adding a smoketest for deno/bun. Would be nice to smoketest browser too, but no idea how to do that.
|
For browser, we can use Playwright, but I didn't feel like (re)learning it over the holidays. I'll add one when I have some time. |
i was hoping there was some playwright vitest mode by now. |
|
Playwright basically is Vitest, it won't be hard to add. |
This adds support for more runtimes (deno, bun, node.js, browser, etc) and simplifies the public interface to be a single function,
decryptSops(), which can accept a file-like object/stream, or an options Object with filepath or URL where a SOPS file can be found.I've cleaned up some old code/files that I missed before.
I should add tests for Deno, Bun, Browser, etc. but it can happen in a follow-up.