Skip to content

Commit 1861f0d

Browse files
committed
feat: Add test JSR package
1 parent b439139 commit 1861f0d

File tree

8 files changed

+3212
-2696
lines changed

8 files changed

+3212
-2696
lines changed

.changeset/friendly-bobcats-fry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@jhecht/jsr-test": patch
3+
---
4+
5+
Adds in test JSR Package

.github/workflows/pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: pnpm/action-setup@v2
1515
name: Install PNPM
1616
with:
17-
versions: 8
17+
version: 9.0.5
1818
- uses: actions/cache@v3
1919
name: setup PNPM cache
2020
with:
@@ -41,7 +41,7 @@ jobs:
4141
- uses: pnpm/action-setup@v2
4242
name: Install PNPM
4343
with:
44-
version: 8
44+
version: 9.0.5
4545
- uses: actions/cache@v3
4646
name: Setup PNPM cache
4747
with:
@@ -67,7 +67,7 @@ jobs:
6767
- uses: pnpm/action-setup@v2
6868
name: Install PNPM
6969
with:
70-
version: 8
70+
version: 9.0.5
7171
- uses: actions/cache@v3
7272
name: Setup PNPM cache
7373
with:
@@ -88,7 +88,7 @@ jobs:
8888
- uses: pnpm/action-setup@v2
8989
name: Install PNPM
9090
with:
91-
version: 8
91+
version: 9.0.5
9292
- uses: actions/cache@v3
9393
name: Setup PNPM cache
9494
with:

.github/workflows/publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# .github/workflows/publish.yml
2+
3+
name: Publish
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
id-token: write # The OIDC ID token is used for authentication with JSR.
16+
steps:
17+
- uses: actions/checkout@v4
18+
- run: npx jsr publish

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"prettier": "^3.1.1",
2121
"turbo": "latest"
2222
},
23-
"packageManager": "pnpm@8.9.0",
23+
"packageManager": "pnpm@9.0.5",
2424
"engines": {
2525
"node": ">=18"
2626
}

packages/jsr-test/jsr.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "@jhecht/jsr-test",
3+
"version": "0.1.0",
4+
"exports": "./mod.ts"
5+
}

packages/jsr-test/mod.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export function add(...args: (number | bigint)[]): number | bigint {
2+
if (args.length === 1) return args[0];
3+
return args.reduce((sum, cur) => {
4+
if (typeof cur === 'bigint' || typeof sum === 'bigint')
5+
return BigInt(cur) + BigInt(sum);
6+
7+
return cur + sum;
8+
}, 0);
9+
return 0;
10+
}
11+
12+
console.info(add(1, 10, 3, 5));

packages/jsr-test/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@jhecht/jsr-test",
3+
"version": "0.1.0",
4+
"description": "",
5+
"exports": "./mod.ts",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC"
12+
}

0 commit comments

Comments
 (0)