Skip to content

Commit

Permalink
feat: working POC
Browse files Browse the repository at this point in the history
  • Loading branch information
whilefoo committed Jan 7, 2024
1 parent ccdfceb commit e379d71
Show file tree
Hide file tree
Showing 8 changed files with 1,241 additions and 861 deletions.
2 changes: 2 additions & 0 deletions .dev.vars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
WEBHOOK_PROXY_URL=https://smee.io/new
WEBHOOK_SECRET=xxxxxx
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
"node": ">=20.10.0"
},
"scripts": {
"start": "tsx build/esbuild-server.ts",
"build": "tsx build/esbuild-build.ts",
"format": "run-s format:prettier format:lint",
"format:lint": "eslint --fix .",
"format:prettier": "prettier --write .",
"prepare": "husky install",
"deploy": "wrangler deploy",
"dev": "wrangler dev"
"deploy": "wrangler deploy src/worker.ts",
"dev": "wrangler dev --port 8787 src/worker.ts",
"proxy": "tsx src/proxy.ts"
},
"keywords": [
"typescript",
Expand All @@ -28,17 +27,18 @@
],
"dependencies": {
"@octokit/webhooks": "^12.0.10",
"@sinclair/typebox": "^0.32.5",
"create-cloudflare": "^2.8.3",
"dotenv": "^16.3.1",
"miniflare": "^3.20231030.4",
"smee-client": "^2.0.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231121.0",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@types/node": "^20.10.6",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"dotenv": "^16.3.1",
"esbuild": "^0.19.10",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -49,7 +49,8 @@
"npm-run-all": "^4.1.5",
"prettier": "^3.1.0",
"tsx": "^4.6.2",
"typescript": "^5.0.4"
"typescript": "^5.0.4",
"wrangler": "^3.22.3"
},
"lint-staged": {
"*.ts": [
Expand Down
28 changes: 0 additions & 28 deletions src/local-server.ts

This file was deleted.

11 changes: 11 additions & 0 deletions src/proxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import dotenv from "dotenv";
import SmeeClient from "smee-client";
dotenv.config({ path: ".dev.vars" });

const smee = new SmeeClient({
source: process.env.WEBHOOK_PROXY_URL || "https://smee.io/new",
target: "http://localhost:8787/events",
logger: console,
});

smee.start();
Loading

0 comments on commit e379d71

Please sign in to comment.