Storage implementations for AT Protocol OAuth applications. Provides a simple key-value storage interface with implementations for in-memory and SQLite backends.
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.

+127 -5
+33 -2
.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 11 permissions: 12 12 contents: read ··· 35 35 36 36 - name: Publish to JSR 37 37 run: deno publish 38 + 39 + publish-npm: 40 + runs-on: ubuntu-latest 41 + needs: publish-jsr 42 + permissions: 43 + contents: read 44 + id-token: write 45 + 46 + steps: 47 + - name: Checkout 48 + uses: actions/checkout@v4 49 + 50 + - name: Setup Deno 51 + uses: denoland/setup-deno@v2 52 + with: 53 + deno-version: v2.x 54 + 55 + - name: Setup Node.js 56 + uses: actions/setup-node@v4 57 + with: 58 + node-version: "22" 59 + registry-url: "https://registry.npmjs.org" 60 + 61 + - name: Install latest npm 62 + run: npm install -g npm@latest 63 + 64 + - name: Build npm package 65 + run: deno task build:npm 66 + 67 + - name: Publish to npm 68 + run: cd npm && npm publish --provenance --access public
+3
.gitignore
··· 10 10 11 11 # Coverage 12 12 coverage/ 13 + 14 + # npm build output 15 + npm/
+37
_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 + // Exclude diagnostics from @std/assert (test-only dependency pulled in by dnt) 14 + const fileName = diagnostic.file?.fileName; 15 + if (fileName && fileName.includes("@std/assert")) return false; 16 + return true; 17 + }, 18 + compilerOptions: { 19 + lib: ["ES2022", "DOM"], 20 + }, 21 + package: { 22 + name: "@tijs/atproto-storage", 23 + version: denoJson.version, 24 + description: 25 + "Storage implementations for AT Protocol OAuth applications. Simple key-value interface with in-memory and SQLite backends.", 26 + license: "MIT", 27 + repository: { 28 + type: "git", 29 + url: "git+https://github.com/tijs/atproto-storage.git", 30 + }, 31 + keywords: ["atproto", "bluesky", "oauth", "storage", "sqlite"], 32 + }, 33 + postBuild() { 34 + Deno.copyFileSync("LICENSE", "npm/LICENSE"); 35 + Deno.copyFileSync("README.md", "npm/README.md"); 36 + }, 37 + });
+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 "@std/assert": "jsr:@std/assert@1.0.16" ··· 21 21 "fmt": "deno fmt", 22 22 "lint": "deno lint", 23 23 "quality": "deno fmt && deno lint && deno check mod.ts", 24 - "ci": "deno task quality && deno task test" 24 + "ci": "deno task quality && deno task test", 25 + "build:npm": "deno run -A _build_npm.ts" 25 26 } 26 27 }
+51 -1
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": "1.0.16", 5 - "jsr:@std/internal@^1.0.12": "1.0.12" 7 + "jsr:@std/fmt@1": "1.0.9", 8 + "jsr:@std/fs@1": "1.0.23", 9 + "jsr:@std/internal@^1.0.12": "1.0.12", 10 + "jsr:@std/path@1": "1.1.4", 11 + "jsr:@std/path@^1.1.4": "1.1.4", 12 + "jsr:@ts-morph/bootstrap@0.27": "0.27.0", 13 + "jsr:@ts-morph/common@0.27": "0.27.0" 6 14 }, 7 15 "jsr": { 16 + "@david/code-block-writer@13.0.3": { 17 + "integrity": "f98c77d320f5957899a61bfb7a9bead7c6d83ad1515daee92dbacc861e13bb7f" 18 + }, 19 + "@deno/dnt@0.42.3": { 20 + "integrity": "62a917a0492f3c8af002dce90605bb0d41f7d29debc06aca40dba72ab65d8ae3", 21 + "dependencies": [ 22 + "jsr:@david/code-block-writer", 23 + "jsr:@std/fmt", 24 + "jsr:@std/fs", 25 + "jsr:@std/path@1", 26 + "jsr:@ts-morph/bootstrap" 27 + ] 28 + }, 8 29 "@std/assert@1.0.16": { 9 30 "integrity": "6a7272ed1eaa77defe76e5ff63ca705d9c495077e2d5fd0126d2b53fc5bd6532", 10 31 "dependencies": [ 11 32 "jsr:@std/internal" 12 33 ] 13 34 }, 35 + "@std/fmt@1.0.9": { 36 + "integrity": "2487343e8899fb2be5d0e3d35013e54477ada198854e52dd05ed0422eddcabe0" 37 + }, 38 + "@std/fs@1.0.23": { 39 + "integrity": "3ecbae4ce4fee03b180fa710caff36bb5adb66631c46a6460aaad49515565a37", 40 + "dependencies": [ 41 + "jsr:@std/internal", 42 + "jsr:@std/path@^1.1.4" 43 + ] 44 + }, 14 45 "@std/internal@1.0.12": { 15 46 "integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027" 47 + }, 48 + "@std/path@1.1.4": { 49 + "integrity": "1d2d43f39efb1b42f0b1882a25486647cb851481862dc7313390b2bb044314b5", 50 + "dependencies": [ 51 + "jsr:@std/internal" 52 + ] 53 + }, 54 + "@ts-morph/bootstrap@0.27.0": { 55 + "integrity": "b8d7bc8f7942ce853dde4161b28f9aa96769cef3d8eebafb379a81800b9e2448", 56 + "dependencies": [ 57 + "jsr:@ts-morph/common" 58 + ] 59 + }, 60 + "@ts-morph/common@0.27.0": { 61 + "integrity": "c7b73592d78ce8479b356fd4f3d6ec3c460d77753a8680ff196effea7a939052", 62 + "dependencies": [ 63 + "jsr:@std/fs", 64 + "jsr:@std/path@1" 65 + ] 16 66 } 17 67 }, 18 68 "workspace": {