This commit is contained in:
Raven Scott
2026-04-03 23:44:13 -04:00
parent 2ef56ac314
commit 9a4381ed7a
6 changed files with 368 additions and 359 deletions
@@ -1,9 +1,11 @@
'use strict'
/**
* CJS bridge: `require('bare-crypto/lib/key.js')` bypasses package `exports` on Node and avoids
* pulling Bare-only addon graphs into ESM static analysis. Pear/Bare executes this file with CJS
* `require` (no Node `module` built-in needed from our ESM entry).
* CJS bridge for Pear/Bare + Node. `bare-crypto` does not export `./lib/key.js`; resolve it from
* the package root via `bare-crypto/package` (the only `exports` entry that points at package.json).
*/
const path = require('path')
const { verify } = require('bare-crypto')
const { Ed25519PublicKey } = require('bare-crypto/lib/key.js')
const pkgJson = require.resolve('bare-crypto/package')
const keyModule = path.join(path.dirname(pkgJson), 'lib', 'key.js')
const { Ed25519PublicKey } = require(keyModule)
module.exports = { verify, Ed25519PublicKey }