Skip to content

Commit 05714d7

Browse files
committed
chore: switch to a typescript base for jsr
1 parent 6d763a2 commit 05714d7

9 files changed

+257
-22
lines changed

.github/workflows/release-beta.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ jobs:
2323
- name: Install dependencies
2424
run: pnpm i --frozen-lockfile
2525

26+
- name: Build
27+
run: pnpm build
28+
2629
- name: Test
2730
run: pnpm test
2831

2932
- name: Publish
3033
run: |
31-
pnpm publish --tag beta
34+
npm publish --tag beta
3235
env:
3336
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ jobs:
2929
- name: Test
3030
run: pnpm test
3131

32+
- name: Build
33+
run: pnpm build
34+
3235
- name: Publish
3336
run: |
34-
pnpm publish
37+
npm publish
3538
env:
3639
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3740

jsr.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"name": "@dumbjs/quick-hash",
33
"version": "0.0.5",
44
"exports": {
5-
".": "./src/index.js",
6-
"./djb2": "./src/djb2.js",
7-
"./sdbm": "./src/sdbm.js"
5+
".": "./src/index.ts",
6+
"./djb2": "./src/djb2.ts",
7+
"./sdbm": "./src/sdbm.ts"
88
}
99
}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"fix": "prettier --write .",
5151
"next": "bumpp",
5252
"prepare": "husky",
53-
"test": "uvu",
53+
"test": "uvu -r tsm",
5454
"test:ci": "c8 npm run test"
5555
},
5656
"nano-staged": {
@@ -67,6 +67,7 @@
6767
"nano-staged": "^0.8.0",
6868
"prettier": "^3.5.0",
6969
"publint": "^0.3.4",
70+
"tsm": "^2.3.0",
7071
"tsup": "^8.3.6",
7172
"typescript": "^5.7.3",
7273
"uvu": "^0.5.6"

pnpm-lock.yaml

+240
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/djb2.js src/djb2.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
/**
2-
* @param {string} toHash
3-
* @return {string}
4-
*/
5-
export const djb2 = function djb2(toHash) {
1+
export const djb2 = function djb2(toHash: string) {
62
let hash = 5381
73
let c
84

src/index.js src/index.ts

File renamed without changes.

src/sdbm.js src/sdbm.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
/**
2-
* @param {string} toHash
3-
* @return {string}
4-
*/
5-
export function sdbm(toHash) {
1+
export function sdbm(toHash: string) {
62
let hash = BigInt(0)
73
let c
84

@@ -14,11 +10,7 @@ export function sdbm(toHash) {
1410
return '' + hash
1511
}
1612

17-
/**
18-
* @param {string} toHash
19-
* @return {string}
20-
*/
21-
export function sdbmGawk(toHash) {
13+
export function sdbmGawk(toHash: String) {
2214
let hash = BigInt(0)
2315

2416
for (let i = 0; i < toHash.length; i++)

0 commit comments

Comments
 (0)