Framework-agnostic OAuth integration for AT Protocol (Bluesky) applications.
1
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.

+95 -5
+33 -3
.github/workflows/publish.yml
··· 1 - name: Publish to JSR 1 + name: Publish 2 2 3 3 on: 4 4 push: ··· 6 6 - "v*" 7 7 8 8 jobs: 9 - publish: 9 + publish-jsr: 10 10 runs-on: ubuntu-latest 11 - 12 11 permissions: 13 12 contents: read 14 13 id-token: write ··· 30 29 31 30 - name: Publish to JSR 32 31 run: deno publish 32 + 33 + publish-npm: 34 + runs-on: ubuntu-latest 35 + needs: publish-jsr 36 + permissions: 37 + contents: read 38 + id-token: write 39 + 40 + steps: 41 + - name: Checkout 42 + uses: actions/checkout@v4 43 + 44 + - name: Setup Deno 45 + uses: denoland/setup-deno@v2 46 + with: 47 + deno-version: v2.x 48 + 49 + - name: Setup Node.js 50 + uses: actions/setup-node@v4 51 + with: 52 + node-version: "22" 53 + registry-url: "https://registry.npmjs.org" 54 + 55 + - name: Install latest npm 56 + run: npm install -g npm@latest 57 + 58 + - name: Build npm package 59 + run: deno task build:npm 60 + 61 + - name: Publish to npm 62 + run: cd npm && npm publish --provenance --access public
+3
.gitignore
··· 7 7 8 8 # OS 9 9 .DS_Store 10 + 11 + # npm build output 12 + npm/
+9
_build_import_map.json
··· 1 + { 2 + "imports": { 3 + "@tijs/oauth-client-deno": "npm:@tijs/oauth-client-deno@5.1.0", 4 + "@tijs/atproto-sessions": "npm:@tijs/atproto-sessions@2.1.0", 5 + "@tijs/atproto-storage": "npm:@tijs/atproto-storage@1.1.0", 6 + "@atproto/syntax": "npm:@atproto/syntax@0.3.0", 7 + "@std/assert": "jsr:@std/assert@1.0.16" 8 + } 9 + }
+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 + typeCheck: false, 13 + skipNpmInstall: true, 14 + importMap: "./_build_import_map.json", 15 + filterDiagnostic(diagnostic) { 16 + const fileName = diagnostic.file?.fileName; 17 + if (fileName && fileName.includes("@std/assert")) return false; 18 + return true; 19 + }, 20 + compilerOptions: { 21 + lib: ["ES2022", "DOM"], 22 + }, 23 + package: { 24 + name: "@tijs/atproto-oauth", 25 + version: denoJson.version, 26 + description: 27 + "Framework-agnostic OAuth integration for AT Protocol (Bluesky) applications using standard Web Request/Response APIs.", 28 + license: "MIT", 29 + repository: { 30 + type: "git", 31 + url: "git+https://github.com/tijs/atproto-oauth.git", 32 + }, 33 + keywords: [ 34 + "atproto", 35 + "bluesky", 36 + "oauth", 37 + "authentication", 38 + ], 39 + }, 40 + postBuild() { 41 + Deno.copyFileSync("LICENSE", "npm/LICENSE"); 42 + Deno.copyFileSync("README.md", "npm/README.md"); 43 + }, 44 + });
+6 -2
deno.json
··· 13 13 "LICENSE" 14 14 ], 15 15 "exclude": [ 16 - "**/*.test.ts" 16 + "**/*.test.ts", 17 + "npm/", 18 + "_build_npm.ts", 19 + "_build_import_map.json" 17 20 ] 18 21 }, 19 22 "imports": { ··· 33 36 "fmt": "deno fmt", 34 37 "lint": "deno lint", 35 38 "quality": "deno fmt && deno lint && deno check mod.ts", 36 - "ci": "deno task quality && deno task test" 39 + "ci": "deno task quality && deno task test", 40 + "build:npm": "deno run -A _build_npm.ts" 37 41 } 38 42 }