Skip to content

Commit 7a04887

Browse files
Add package also to JSR
1 parent 2c98c0d commit 7a04887

23 files changed

+5921
-7571
lines changed

.github/workflows/lint.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,22 @@ jobs:
1212
uses: actions/setup-node@v5
1313
with:
1414
node-version: 22
15-
cache: "npm"
15+
cache: 'npm'
16+
1617
- name: npm lint
1718
run: |
1819
npm ci
1920
npm run lint
21+
npm run lint:types
2022
env:
2123
CI: true
24+
25+
- name: Install Deno
26+
uses: denoland/setup-deno@v1
27+
with:
28+
deno-version: v1.x
29+
30+
- name: Deno lint
31+
run: deno lint
32+
- name: Deno check
33+
run: deno task check

.github/workflows/npm-publish.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
publish-npm:
1919
needs: build
2020
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
id-token: write
2124
steps:
2225
- uses: actions/checkout@v5
2326
with:
@@ -42,6 +45,7 @@ jobs:
4245
BRANCH=$(git branch -r --contains "$TAG_SHA" | grep -v '\->' | head -n 1 | sed 's|origin/||' | xargs)
4346
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
4447
48+
4549
- name: Set version from tag
4650
run: |
4751
git config user.name "github-actions[bot]"
@@ -53,10 +57,13 @@ jobs:
5357
git reset --hard "refs/tags/${TAG}" # Ensure code matches the tag
5458
git pull origin ${{ steps.get_branch.outputs.branch }}
5559
npm version $TAG --no-git-tag-version
56-
git add package.json package-lock.json
60+
jq '.version = "'$TAG'"' jsr.json > jsr.json.tmp && mv jsr.json.tmp jsr.json
61+
jq '.version = "'$TAG'"' deno.json > deno.json.tmp && mv deno.json.tmp deno.json
62+
git add package.json package-lock.json jsr.json deno.json
5763
git commit -m "ci: set version to $TAG [skip ci]" || true
5864
git push origin ${{ steps.get_branch.outputs.branch }}
5965
- run: npm run build --if-present
6066
- run: npm publish --access public
6167
env:
62-
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
68+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
69+
- run: npx jsr publish

deno.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@trojs/openapi-server",
3+
"version": "3.4.1",
4+
"license": "MIT",
5+
"exports": "./src/server.js",
6+
"compilerOptions": {
7+
"lib": [
8+
"esnext"
9+
]
10+
},
11+
"tasks": {
12+
"check": "deno check src/server.js"
13+
}
14+
}

jsconfig.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
{
22
"compilerOptions": {
3+
"allowJs": true,
34
"checkJs": true,
45
"target": "ESNext",
56
"module": "NodeNext",
67
"moduleResolution": "nodenext",
8+
"lib": [
9+
"ESNext"
10+
],
711
"rootDirs": [
8-
"src"
12+
"src",
13+
"types"
14+
],
15+
"baseUrl": ".",
16+
"resolveJsonModule": true,
17+
"types": [
18+
"node"
919
],
10-
"resolveJsonModule": true
20+
"skipLibCheck": true,
21+
"esModuleInterop": true,
22+
"noEmit": true
1123
},
24+
"include": [
25+
"src/**/*",
26+
"types/**/*"
27+
],
1228
"exclude": [
1329
"node_modules",
1430
"**/node_modules/*"

jsr.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@trojs/openapi-server",
3+
"version": "3.4.1",
4+
"license": "MIT",
5+
"exports": "./src/server.js"
6+
}

0 commit comments

Comments
 (0)