Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/add-jsr-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@jhecht/jsr-test": patch
---

Adds in test JSR Package
18 changes: 11 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
changesets:
name: Changeset Present?
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -14,14 +15,15 @@ jobs:
- uses: pnpm/action-setup@v2
name: Install PNPM
with:
versions: 8
version: 9.0.5
- uses: actions/cache@v3
name: setup PNPM cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os}}-pnpm-store
${{ runner.os}}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
${{ runner.os}}-pnpm-store-
- uses: actions/setup-node@v3
with:
node-version: '18.x'
Expand All @@ -41,14 +43,15 @@ jobs:
- uses: pnpm/action-setup@v2
name: Install PNPM
with:
version: 8
version: 9.0.5
- uses: actions/cache@v3
name: Setup PNPM cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os}}-pnpm-store
${{ runner.os}}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
${{ runner.os}}-pnpm-store-
- uses: actions/setup-node@v3
with:
node-version: '18.x'
Expand All @@ -67,14 +70,15 @@ jobs:
- uses: pnpm/action-setup@v2
name: Install PNPM
with:
version: 8
version: 9.0.5
- uses: actions/cache@v3
name: Setup PNPM cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os}}-pnpm-store
${{ runner.os}}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
${{ runner.os}}-pnpm-store-
- uses: actions/setup-node@v3
with:
node-version: '18.x'
Expand All @@ -88,7 +92,7 @@ jobs:
- uses: pnpm/action-setup@v2
name: Install PNPM
with:
version: 8
version: 9.0.5
- uses: actions/cache@v3
name: Setup PNPM cache
with:
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# .github/workflows/publish.yml

name: Publish

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- uses: actions/checkout@v4
- run: npx jsr publish
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"deno.enable": true,
"deno.enablePaths": ["./scripts"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"prettier": "^3.1.1",
"turbo": "latest"
},
"packageManager": "pnpm@8.9.0",
"packageManager": "[email protected].5",
"engines": {
"node": ">=18"
}
Expand Down
7 changes: 7 additions & 0 deletions packages/jsr-test/cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* @description The CLI that allows for adding
*/

if (import.meta.dirname) {
console.info('hi you');
}
5 changes: 5 additions & 0 deletions packages/jsr-test/jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@jhecht/jsr-test",
"version": "0.1.0",
"exports": "./mod.ts"
}
12 changes: 12 additions & 0 deletions packages/jsr-test/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export function add(...args: (number | bigint)[]): number | bigint {
if (args.length === 1) return args[0];
return args.reduce((sum, cur) => {
if (typeof cur === 'bigint' || typeof sum === 'bigint')
return BigInt(cur) + BigInt(sum);

return cur + sum;
}, 0);
return 0;
}

console.info(add(1, 10, 3, 5));
12 changes: 12 additions & 0 deletions packages/jsr-test/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@jhecht/jsr-test",
"version": "0.1.0",
"description": "",
"exports": "./mod.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Loading