@forestrie/merklelog 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"algorithms-sync.d.ts","sourceRoot":"","sources":["../../src/mmr/algorithms-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAazC;;;;;;GAMG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAiBxD"}
1
+ {"version":3,"file":"algorithms-sync.d.ts","sourceRoot":"","sources":["../../src/mmr/algorithms-sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAazC;;;;;;GAMG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAuBxD"}
@@ -23,7 +23,13 @@ function concatChunks(chunks) {
23
23
  * Only available in Node.js; throws if node:crypto is not available.
24
24
  */
25
25
  export async function createSyncHasher() {
26
- const { createHash } = await import("node:crypto");
26
+ // Keep the specifier opaque so bundlers do not resolve node:crypto at
27
+ // build time: this factory is documented runtime-guarded Node-only, and
28
+ // browser consumers of the package index (e.g. @forestrie/receipt-verify's
29
+ // ADR-0048 browser-safety guard) must not get node builtins in their
30
+ // module graph merely by importing it.
31
+ const nodeCryptoSpecifier = "node:crypto";
32
+ const { createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier);
27
33
  const chunks = [];
28
34
  return {
29
35
  reset() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forestrie/merklelog",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "MMR (merkle mountain range) proofs and massif storage format for Forestrie transparency logs",
@@ -27,7 +27,13 @@ function concatChunks(chunks: Uint8Array[]): Uint8Array {
27
27
  * Only available in Node.js; throws if node:crypto is not available.
28
28
  */
29
29
  export async function createSyncHasher(): Promise<Hasher> {
30
- const { createHash } = await import("node:crypto");
30
+ // Keep the specifier opaque so bundlers do not resolve node:crypto at
31
+ // build time: this factory is documented runtime-guarded Node-only, and
32
+ // browser consumers of the package index (e.g. @forestrie/receipt-verify's
33
+ // ADR-0048 browser-safety guard) must not get node builtins in their
34
+ // module graph merely by importing it.
35
+ const nodeCryptoSpecifier = "node:crypto";
36
+ const { createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier);
31
37
  const chunks: Uint8Array[] = [];
32
38
  return {
33
39
  reset(): void {