From 4e0de6d6e4860fbdb6f368c27c40622a57997527 Mon Sep 17 00:00:00 2001 From: Peter Hirn Date: Tue, 29 Apr 2025 17:30:48 +0200 Subject: [PATCH] wip: publish to jsr --- examples/deno-npm.ts | 4 ++++ examples/deno.ts | 12 ++++++++++++ jsr.json | 14 ++++++++++++++ release-please-config.json | 9 ++++++++- 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 examples/deno-npm.ts create mode 100644 examples/deno.ts create mode 100644 jsr.json diff --git a/examples/deno-npm.ts b/examples/deno-npm.ts new file mode 100644 index 00000000..4c12537a --- /dev/null +++ b/examples/deno-npm.ts @@ -0,0 +1,4 @@ +import initialize from "npm:@phi-ag/argon2/node"; + +const argon2 = await initialize(); +console.log(argon2.hash("my secret password")); diff --git a/examples/deno.ts b/examples/deno.ts new file mode 100644 index 00000000..be134687 --- /dev/null +++ b/examples/deno.ts @@ -0,0 +1,12 @@ +//import initialize from "jsr:@peterhirn/test@0.0.5/node"; +import Argon2 from "jsr:@peterhirn/test@0.0.5"; +import wasm from "jsr:@peterhirn/test@0.0.5/argon2.wasm"; + +const argon2 = await Argon2.initializeModule(wasm); + +//const argon2 = await initialize(); + +const password = "my secret password"; +const { encoded } = argon2.hash(password); + +argon2.verify(encoded, password); diff --git a/jsr.json b/jsr.json new file mode 100644 index 00000000..6bea5df7 --- /dev/null +++ b/jsr.json @@ -0,0 +1,14 @@ +{ + "name": "@peterhirn/test", + "version": "0.0.5", + "exports": { + ".": "./src/index.ts", + "./node": "./src/node.ts", + "./fetch": "./src/fetch.ts", + "./argon2.wasm": "./src/argon2.wasm" + }, + "publish": { + "include": ["LICENSE", "README.md", "src/*.ts", "src/argon2.wasm"], + "exclude": ["src/*.test.ts", "src/*.bench.ts"] + } +} diff --git a/release-please-config.json b/release-please-config.json index 3c53ce13..2785ebc5 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -22,7 +22,14 @@ ], "packages": { ".": { - "changelog-path": "CHANGELOG.md" + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "json", + "path": "jsr.json", + "jsonpath": "$.version" + } + ] } } }