Skip to content

Commit 2ec27b0

Browse files
committed
feat: Add test JSR package
1 parent b439139 commit 2ec27b0

File tree

13 files changed

+3367
-2700
lines changed

13 files changed

+3367
-2700
lines changed

.changeset/add-jsr-test.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: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jobs:
66
changesets:
77
name: Changeset Present?
88
runs-on: ubuntu-latest
9+
continue-on-error: true
910
steps:
1011
- uses: actions/checkout@v4
1112
with:
@@ -14,14 +15,15 @@ jobs:
1415
- uses: pnpm/action-setup@v2
1516
name: Install PNPM
1617
with:
17-
versions: 8
18+
version: 9.0.5
1819
- uses: actions/cache@v3
1920
name: setup PNPM cache
2021
with:
2122
path: ${{ env.STORE_PATH }}
2223
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
2324
restore-keys: |
24-
${{ runner.os}}-pnpm-store
25+
${{ runner.os}}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
26+
${{ runner.os}}-pnpm-store-
2527
- uses: actions/setup-node@v3
2628
with:
2729
node-version: '18.x'
@@ -41,14 +43,15 @@ jobs:
4143
- uses: pnpm/action-setup@v2
4244
name: Install PNPM
4345
with:
44-
version: 8
46+
version: 9.0.5
4547
- uses: actions/cache@v3
4648
name: Setup PNPM cache
4749
with:
4850
path: ${{ env.STORE_PATH }}
4951
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
5052
restore-keys: |
51-
${{ runner.os}}-pnpm-store
53+
${{ runner.os}}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
54+
${{ runner.os}}-pnpm-store-
5255
- uses: actions/setup-node@v3
5356
with:
5457
node-version: '18.x'
@@ -67,14 +70,15 @@ jobs:
6770
- uses: pnpm/action-setup@v2
6871
name: Install PNPM
6972
with:
70-
version: 8
73+
version: 9.0.5
7174
- uses: actions/cache@v3
7275
name: Setup PNPM cache
7376
with:
7477
path: ${{ env.STORE_PATH }}
7578
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
7679
restore-keys: |
77-
${{ runner.os}}-pnpm-store
80+
${{ runner.os}}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
81+
${{ runner.os}}-pnpm-store-
7882
- uses: actions/setup-node@v3
7983
with:
8084
node-version: '18.x'
@@ -88,7 +92,7 @@ jobs:
8892
- uses: pnpm/action-setup@v2
8993
name: Install PNPM
9094
with:
91-
version: 8
95+
version: 9.0.5
9296
- uses: actions/cache@v3
9397
name: Setup PNPM cache
9498
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

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
"[typescript]": {
1212
"editor.formatOnSave": true,
1313
"editor.defaultFormatter": "esbenp.prettier-vscode"
14-
}
14+
},
15+
"deno.enable": true,
16+
"deno.enablePaths": ["./scripts"]
1517
}

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": "[email protected].5",
2424
"engines": {
2525
"node": ">=18"
2626
}

packages/jsr-test/cli.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* @description The CLI that allows for adding
3+
*/
4+
5+
if (import.meta.dirname) {
6+
console.info('hi you');
7+
}

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)