Skip to content

Commit

Permalink
Merge pull request #72 from upstash/DX-462
Browse files Browse the repository at this point in the history
Add new wrapper for appRouter and replace rome with biome
  • Loading branch information
ogzhanolguncu authored Nov 14, 2023
2 parents 9efe949 + 9acee86 commit 4b93fa1
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 142 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/prerelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tests
on:
pull_request:
branches:
- main

jobs:
prerelease:
outputs:
version: ${{ steps.version.outputs.version }}
name: Pre release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Get version
id: version
run: echo "::set-output name=version::v0.0.0-ci.${GITHUB_SHA}-$(date +%Y%m%d%H%M%S)"

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm
run: npm install -g pnpm

- name: Set version
run: |
echo $(jq --arg v "${{ steps.version.outputs.version }}" '(.version) = $v' package.json) > package.json
- name: Install Dependencies
run: pnpm install

- name: Build
run: pnpm run build

- name: Set NPM_TOKEN
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}

- name: Publish ci version
run: npm publish --tag=ci --verbose
1 change: 0 additions & 1 deletion rome.json → biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"formatter": {
"indentStyle": "space",
"indentSize": 2,
"enabled": true,
"lineWidth": 100,
"ignore": ["node_modules", ".next", "dist", ".nuxt", ".contentlayer"]
Expand Down
11 changes: 11 additions & 0 deletions examples/nextjs/app/serverless/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { verifySignatureAppRouter } from "@upstash/qstash/dist/nextjs";
import { NextRequest, NextResponse } from "next/server";

async function handler(_req: NextRequest) {
// simulate work
await new Promise((r) => setTimeout(r, 1000));

console.log("Success");
return NextResponse.json({ name: "John Doe Serverless" });
}
export const POST = verifySignatureAppRouter(handler);
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,25 @@
"fmt": "pnpm rome check . --apply-unsafe && pnpm rome format . --write"
},
"devDependencies": {
"@types/crypto-js": "^4.1.1",
"@biomejs/biome": "^1.3.3",
"@types/crypto-js": "^4.2.0",
"@types/node": "^20.5.7",
"next": "^13.4.19",
"rome": "12.1.3",
"next": "^14.0.2",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
},
"dependencies": {
"crypto-js": "^4.1.1",
"crypto-js": "^4.2.0",
"jose": "^4.14.4"
},
"typesVersions": {
"*": {
".": ["./dist/index.d.ts"],
"nextjs": ["./dist/nextjs.d.ts"]
".": [
"./dist/index.d.ts"
],
"nextjs": [
"./dist/nextjs.d.ts"
]
}
}
}
Loading

0 comments on commit 4b93fa1

Please sign in to comment.