Skip to content

Commit 0bcf8ac

Browse files
committed
ESM-only. Rewrite tests in ts. Update to noble-hashes v2 beta
1 parent 35e0502 commit 0bcf8ac

16 files changed

+60
-521
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
types: [created]
55
jobs:
66
release-js:
7-
name: 'jsbt v0.3.3' # Should match commit below
8-
uses: paulmillr/jsbt/.github/workflows/release.yml@c9a9f2cd6b4841aa3117b174e9ea468b1650e5ea
7+
name: 'jsbt v0.4.1'
8+
uses: paulmillr/jsbt/.github/workflows/release.yml@2318b9efe24831b4bd4cadf720c96f071c69c64d
99
with:
1010
build-path: test/build
11+
# slow-types: false
1112
secrets:
1213
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
1314
permissions:

.github/workflows/test-ts.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Run TS tests
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
test-js:
7+
name: 'jsbt v0.4.1'
8+
uses: paulmillr/jsbt/.github/workflows/test-ts.yml@2318b9efe24831b4bd4cadf720c96f071c69c64d
9+
# with:
10+
# submodules: false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/index.d.ts.map
99
/test/*.d.ts
1010
/test/*.js
11+
/lib
1112
/esm
1213
/test/build
1314
node_modules

esm/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

package-lock.json

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"src/index.ts"
1212
],
1313
"dependencies": {
14-
"@noble/hashes": "~1.8.0",
14+
"@noble/hashes": "2.0.0-beta.1",
1515
"@scure/base": "~1.2.5"
1616
},
1717
"devDependencies": {
18-
"@paulmillr/jsbt": "0.3.3",
19-
"micro-bmark": "0.4.1",
20-
"micro-should": "0.5.2",
18+
"@paulmillr/jsbt": "0.4.1",
19+
"micro-bmark": "0.4.2",
20+
"micro-should": "0.5.3",
2121
"prettier": "3.5.3",
2222
"typescript": "5.8.3"
2323
},
@@ -29,17 +29,19 @@
2929
},
3030
"license": "MIT",
3131
"scripts": {
32-
"build": "tsc && tsc -p tsconfig.cjs.json",
32+
"build": "tsc",
3333
"build:release": "npx jsbt esbuild test/build",
3434
"lint": "prettier --check 'src/**/*.ts' 'test/*.test.ts' 'scripts/*.js'",
3535
"format": "prettier --write 'src/**/*.ts' 'test/*.test.ts' 'scripts/*.js'",
36-
"test": "node test/index.js",
37-
"test:bun": "bun test/index.js",
36+
"test": "node --experimental-strip-types --no-warnings test/index.ts",
37+
"test:bun": "bun test/index.ts",
3838
"test:deno": "deno --allow-env --allow-read test/index.js",
3939
"fetch-wordlist": "./scripts/fetch-wordlist.js"
4040
},
4141
"sideEffects": false,
42+
"type": "module",
4243
"main": "index.js",
44+
"module": "index.js",
4345
"types": "./index.d.ts",
4446
"exports": {
4547
".": {

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/tradition
2929
*/
3030

3131
/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
32-
import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2';
33-
import { sha256, sha512 } from '@noble/hashes/sha2';
34-
import { abytes, anumber, randomBytes } from '@noble/hashes/utils';
32+
import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2.js';
33+
import { sha256, sha512 } from '@noble/hashes/sha2.js';
34+
import { abytes, anumber, randomBytes } from '@noble/hashes/utils.js';
3535
import { utils as baseUtils } from '@scure/base';
3636

3737
// Japanese wordlist

src/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/assert.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)