-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Please publish ts native version to jsr.io #85
Comments
Pull requests are welcome. Before the pull request perhaps you can test this in your fork of noble hashes first. Like under name “inverted-noble-hashes” or something, to ensure everything works correctly. I have some concerns with regards to webcrypto imports. |
I played around I managed to get it working quite easily. I published it as a test to this location on JSR: https://jsr.io/@solardancer/test. The trick was to add an import map to remap the {
"name": "@noble/hashes",
"version": "1.6.1",
"exports": {
".": "./src/index.ts",
"./crypto": "./src/crypto.ts",
"./_assert": "./src/_assert.ts",
"./_md": "./src/_md.ts",
"./argon2": "./src/argon2.ts",
"./blake2b": "./src/blake2b.ts",
"./blake2s": "./src/blake2s.ts",
"./blake3": "./src/blake3.ts",
"./eskdf": "./src/eskdf.ts",
"./hkdf": "./src/hkdf.ts",
"./hmac": "./src/hmac.ts",
"./pbkdf2": "./src/pbkdf2.ts",
"./ripemd160": "./src/ripemd160.ts",
"./scrypt": "./src/scrypt.ts",
"./sha1": "./src/sha1.ts",
"./sha2": "./src/sha2.ts",
"./sha3-addons": "./src/sha3-addons.ts",
"./sha3": "./src/sha3.ts",
"./sha256": "./src/sha256.ts",
"./sha512": "./src/sha512.ts",
"./utils": "./src/utils.ts"
},
"imports": {
"@noble/hashes/crypto": "./src/crypto.ts"
},
"publish": {
"include": [
"src",
"jsr.json",
"LICENSE",
"README.md"
],
"exclude": [
"src/cryptoNode.ts"
]
}
} Publishing can be done with the following command:
The publishing command requires the I have also added the same publish-jsr.yml file from your other packages (@noble/secp256k1 and @noble/ed25519): name: Publish packge to jsr
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 # v4
- run: npm install -g jsr
- run: jsr publish --allow-slow-types I have gone ahead and created a pull request with just the Please let me know if you would like me to look into updating some of the other items I mentioned above. |
Published Also i've went forward and ensured there are no slow types. |
Pretty please could we have a typescript native version on jsr.io ?
For those of us in modern js environments, this would be grand.
jsr.io has supply chain provenance from github actions as well, but you might be able to skip the build step perhaps, and webhook straight from github, putting even less stuff in the way of purity.
Thank you for the @noble libraries 🙏
The text was updated successfully, but these errors were encountered: