Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pim 1306 #1

Merged
merged 12 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/witty-years-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pimlico/webhook": patch
---

Updated README, added usage example
16 changes: 11 additions & 5 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ jobs:
- name: Install dependencies
uses: ./.github/actions/install-dependencies

- name: Report bundle size
uses: andresz1/size-limit-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
package_manager: pnpm
- name: Build
run: pnpm build

- name: Size
run: pnpm size

# - name: Report bundle size
# uses: andresz1/size-limit-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# # package_manager: pnpm
13 changes: 0 additions & 13 deletions .size-limit.json

This file was deleted.

21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"description": "",
"main": "index.js",
"scripts": {
"size": "size-limit",
"lint": "biome check --fix --error-on-warnings .",
"format": "biome format --write .",
"webhook": "pnpm --filter @pimlico/webhook",
Expand All @@ -24,8 +25,26 @@
"@changesets/changelog-git": "^0.2.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.10",
"@size-limit/preset-small-lib": "^11.1.6",
"@types/node": "^20.11.18",
"esbuild": "^0.24.0",
"rimraf": "^6.0.1",
"size-limit": "^11.1.6",
"size-limit-node-esbuild": "^0.3.0",
"tsc-alias": "^1.8.10"
}
},
"size-limit": [
{
"name": "@pimlico/webhook (esm)",
"path": "./packages/webhook/_esm/src/index.js",
"limit": "50 kB",
"import": "*"
},
{
"name": "@pimlico/webhook (cjs)",
"path": "./packages/webhook/_cjs/src/index.js",
"limit": "50 kB",
"import": "*"
}
]
}
22 changes: 22 additions & 0 deletions packages/webhook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# @pimlico/webhook

A library for verifying webhook requests from Pimlico. [Example](./../../examples/webhook).

## Installation

```bash
pnpm install @pimlico/webhook
```

## Usage

```typescript
import { pimlicoWebhookVerifier } from "@pimlico/webhook"

const verifyWebhook = pimlicoWebhookVerifier(process.env.PIMLICO_API_KEY)

const body = await verifyWebhook(
req.headers as Record<string, string>,
Buffer.from(JSON.stringify(req.body))
)
```
Loading