-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure module is loaded before consuming as imports
- Loading branch information
Showing
9 changed files
with
1,314 additions
and
949 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
const jestConfig: JestConfigWithTsJest = { | ||
preset: 'ts-jest/presets/default-esm', | ||
testPathIgnorePatterns: ["src"], | ||
}; | ||
|
||
export default jestConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ | |
"type": "module", | ||
"scripts": { | ||
"build": "tsc && tsc-alias -p tsconfig.json -f", | ||
"test": "jest --verbose", | ||
"test:cov": "jest --coverage" | ||
"test": "tsc && tsc-alias -p tsconfig.json -f && node --experimental-vm-modules node_modules/.bin/jest", | ||
"test:cov": "tsc && tsc-alias -p tsconfig.json -f && node --experimental-vm-modules node_modules/.bin/jest --coverage" | ||
}, | ||
"keywords": [], | ||
"author": "Algorand Foundation", | ||
|
@@ -21,12 +21,14 @@ | |
"@semantic-release/changelog": "^6.0.3", | ||
"@semantic-release/git": "^10.0.1", | ||
"@semantic-release/npm": "^12.0.1", | ||
"@types/bn.js": "^5.1.6", | ||
"@types/jest": "^29.5.5", | ||
"@types/libsodium-wrappers-sumo": "^0.7.7", | ||
"@types/node": "^20.7.1", | ||
"semantic-release": "^24.1.1", | ||
"bip32-ed25519": "^0.0.4", | ||
"ts-jest": "^29.1.1", | ||
"ts-node": "^10.9.2", | ||
"tsc-alias": "^1.8.10", | ||
"tweetnacl": "^1.0.3", | ||
"typescript": "^5.2.2" | ||
|
@@ -43,34 +45,6 @@ | |
"ts-custom-error": "^3.2.0", | ||
"ts-log": "^2.2.4" | ||
}, | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"ts" | ||
], | ||
"rootDir": ".", | ||
"testRegex": ".spec.ts$", | ||
"coverageDirectory": "../test/coverage", | ||
"collectCoverageFrom": [ | ||
"**/!(*.module|*.interface|main|repl|exception.filter|logging.interceptor).{ts,js}" | ||
], | ||
"coveragePathIgnorePatterns": [ | ||
"/src/migration/" | ||
], | ||
"testEnvironment": "node", | ||
"moduleNameMapper": { | ||
"^(\\.{1,2}/.*)\\.js$": "$1" | ||
}, | ||
"transform": { | ||
"^.+\\.tsx?$": [ | ||
"ts-jest", | ||
{ | ||
"useESM": true | ||
} | ||
] | ||
} | ||
}, | ||
"repository": "[email protected]:algorandfoundation/xHD-Wallet-API-ts.git", | ||
"files": [ | ||
"dist", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './x.hd.wallet.api.crypto' | ||
export * from './bip32-ed25519' | ||
export * from './x.hd.wallet.api.crypto.js' | ||
export * from './bip32-ed25519.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pkg from 'libsodium-wrappers-sumo' | ||
|
||
await pkg.ready; | ||
|
||
export const crypto_core_ed25519_add = pkg.crypto_core_ed25519_add; | ||
export const crypto_core_ed25519_scalar_add = pkg.crypto_core_ed25519_scalar_add | ||
export const crypto_core_ed25519_scalar_mul = pkg.crypto_core_ed25519_scalar_mul | ||
export const crypto_core_ed25519_scalar_reduce = pkg.crypto_core_ed25519_scalar_reduce | ||
export const crypto_hash_sha512 = pkg.crypto_hash_sha512 | ||
export const crypto_scalarmult_ed25519_base_noclamp = pkg.crypto_scalarmult_ed25519_base_noclamp | ||
export const crypto_sign_verify_detached = pkg.crypto_sign_verify_detached | ||
export const crypto_sign_ed25519_pk_to_curve25519 = pkg.crypto_sign_ed25519_pk_to_curve25519 | ||
export const crypto_scalarmult = pkg.crypto_scalarmult | ||
export const crypto_generichash = pkg.crypto_generichash | ||
export const crypto_sign_keypair = pkg.crypto_sign_keypair | ||
export const crypto_sign_ed25519_sk_to_curve25519 = pkg.crypto_sign_ed25519_sk_to_curve25519 | ||
export const crypto_secretbox_open_easy = pkg.crypto_secretbox_open_easy | ||
export const crypto_secretbox_easy = pkg.crypto_secretbox_easy | ||
export const crypto_kx_client_session_keys = pkg.crypto_kx_client_session_keys | ||
export const crypto_kx_server_session_keys = pkg.crypto_kx_server_session_keys | ||
export const to_base64 = pkg.to_base64 |
Oops, something went wrong.