Framework-agnostic session management for AT Protocol applications using Iron Session encryption
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add npm publishing with trusted publishing (OIDC)

Add dnt build script to compile TypeScript for npm distribution.
Update publish workflow to publish to both JSR and npm using
GitHub Actions OIDC trusted publishing with provenance.

+128 -5
+28 -3
.github/workflows/publish.yml
··· 6 6 - "v*" 7 7 8 8 jobs: 9 - publish: 9 + publish-jsr: 10 10 runs-on: ubuntu-latest 11 11 permissions: 12 12 contents: read 13 13 id-token: write 14 + 14 15 steps: 15 - - uses: actions/checkout@v5 16 + - uses: actions/checkout@v4 16 17 - uses: denoland/setup-deno@v2 17 18 with: 18 19 deno-version: v2.x 19 20 - name: Run CI checks 20 21 run: deno task ci 21 - - name: Publish package 22 + - name: Publish to JSR 22 23 run: deno publish 24 + 25 + publish-npm: 26 + runs-on: ubuntu-latest 27 + needs: publish-jsr 28 + permissions: 29 + contents: read 30 + id-token: write 31 + 32 + steps: 33 + - uses: actions/checkout@v4 34 + - uses: denoland/setup-deno@v2 35 + with: 36 + deno-version: v2.x 37 + - name: Setup Node.js 38 + uses: actions/setup-node@v4 39 + with: 40 + node-version: "22" 41 + registry-url: "https://registry.npmjs.org" 42 + - name: Install latest npm 43 + run: npm install -g npm@latest 44 + - name: Build npm package 45 + run: deno task build:npm 46 + - name: Publish to npm 47 + run: cd npm && npm publish --provenance --access public
+3
.gitignore
··· 26 26 27 27 # Coverage 28 28 coverage/ 29 + 30 + # npm build output 31 + npm/
+44
_build_npm.ts
··· 1 + import { build, emptyDir } from "jsr:@deno/dnt@0.42.3"; 2 + 3 + const denoJson = JSON.parse(Deno.readTextFileSync("./deno.json")); 4 + 5 + await emptyDir("./npm"); 6 + 7 + await build({ 8 + entryPoints: ["./mod.ts"], 9 + outDir: "./npm", 10 + shims: {}, 11 + test: false, 12 + filterDiagnostic(diagnostic) { 13 + const fileName = diagnostic.file?.fileName; 14 + if (fileName && fileName.includes("@std/assert")) return false; 15 + return true; 16 + }, 17 + compilerOptions: { 18 + lib: ["ES2022", "DOM"], 19 + }, 20 + importMap: "./deno.json", 21 + package: { 22 + name: "@tijs/atproto-sessions", 23 + version: denoJson.version, 24 + description: 25 + "Framework-agnostic session management for AT Protocol applications using encrypted cookies.", 26 + license: "MIT", 27 + repository: { 28 + type: "git", 29 + url: "git+https://github.com/tijs/atproto-sessions.git", 30 + }, 31 + keywords: [ 32 + "atproto", 33 + "bluesky", 34 + "oauth", 35 + "sessions", 36 + "iron-session", 37 + "cookies", 38 + ], 39 + }, 40 + postBuild() { 41 + Deno.copyFileSync("LICENSE", "npm/LICENSE"); 42 + Deno.copyFileSync("README.md", "npm/README.md"); 43 + }, 44 + });
+3 -2
deno.json
··· 6 6 "exports": "./mod.ts", 7 7 "publish": { 8 8 "include": ["mod.ts", "src/**/*.ts", "README.md", "LICENSE"], 9 - "exclude": ["**/*.test.ts"] 9 + "exclude": ["**/*.test.ts", "npm/", "_build_npm.ts"] 10 10 }, 11 11 "imports": { 12 12 "iron-session": "npm:iron-session@8.0.4", ··· 22 22 "fmt": "deno fmt", 23 23 "lint": "deno lint", 24 24 "quality": "deno fmt && deno lint && deno check mod.ts", 25 - "ci": "deno task quality && deno task test" 25 + "ci": "deno task quality && deno task test", 26 + "build:npm": "deno run -A _build_npm.ts" 26 27 } 27 28 }
+50
deno.lock
··· 1 1 { 2 2 "version": "5", 3 3 "specifiers": { 4 + "jsr:@david/code-block-writer@^13.0.3": "13.0.3", 5 + "jsr:@deno/dnt@0.42.3": "0.42.3", 4 6 "jsr:@std/assert@*": "1.0.16", 5 7 "jsr:@std/assert@1.0.16": "1.0.16", 8 + "jsr:@std/fmt@1": "1.0.9", 9 + "jsr:@std/fs@1": "1.0.23", 6 10 "jsr:@std/internal@^1.0.12": "1.0.12", 11 + "jsr:@std/path@1": "1.1.4", 12 + "jsr:@std/path@^1.1.4": "1.1.4", 13 + "jsr:@ts-morph/bootstrap@0.27": "0.27.0", 14 + "jsr:@ts-morph/common@0.27": "0.27.0", 7 15 "npm:iron-session@8.0.4": "8.0.4" 8 16 }, 9 17 "jsr": { 18 + "@david/code-block-writer@13.0.3": { 19 + "integrity": "f98c77d320f5957899a61bfb7a9bead7c6d83ad1515daee92dbacc861e13bb7f" 20 + }, 21 + "@deno/dnt@0.42.3": { 22 + "integrity": "62a917a0492f3c8af002dce90605bb0d41f7d29debc06aca40dba72ab65d8ae3", 23 + "dependencies": [ 24 + "jsr:@david/code-block-writer", 25 + "jsr:@std/fmt", 26 + "jsr:@std/fs", 27 + "jsr:@std/path@1", 28 + "jsr:@ts-morph/bootstrap" 29 + ] 30 + }, 10 31 "@std/assert@1.0.16": { 11 32 "integrity": "6a7272ed1eaa77defe76e5ff63ca705d9c495077e2d5fd0126d2b53fc5bd6532", 12 33 "dependencies": [ 13 34 "jsr:@std/internal" 14 35 ] 15 36 }, 37 + "@std/fmt@1.0.9": { 38 + "integrity": "2487343e8899fb2be5d0e3d35013e54477ada198854e52dd05ed0422eddcabe0" 39 + }, 40 + "@std/fs@1.0.23": { 41 + "integrity": "3ecbae4ce4fee03b180fa710caff36bb5adb66631c46a6460aaad49515565a37", 42 + "dependencies": [ 43 + "jsr:@std/internal", 44 + "jsr:@std/path@^1.1.4" 45 + ] 46 + }, 16 47 "@std/internal@1.0.12": { 17 48 "integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027" 49 + }, 50 + "@std/path@1.1.4": { 51 + "integrity": "1d2d43f39efb1b42f0b1882a25486647cb851481862dc7313390b2bb044314b5", 52 + "dependencies": [ 53 + "jsr:@std/internal" 54 + ] 55 + }, 56 + "@ts-morph/bootstrap@0.27.0": { 57 + "integrity": "b8d7bc8f7942ce853dde4161b28f9aa96769cef3d8eebafb379a81800b9e2448", 58 + "dependencies": [ 59 + "jsr:@ts-morph/common" 60 + ] 61 + }, 62 + "@ts-morph/common@0.27.0": { 63 + "integrity": "c7b73592d78ce8479b356fd4f3d6ec3c460d77753a8680ff196effea7a939052", 64 + "dependencies": [ 65 + "jsr:@std/fs", 66 + "jsr:@std/path@1" 67 + ] 18 68 } 19 69 }, 20 70 "npm": {