Skip to content

Commit

Permalink
fix: updated port for http request.http and use bun
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Dec 2, 2024
1 parent 80aab08 commit 0e9f9a2
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
bun commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
bun lint-staged
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Allows users to register their wallets to collect rewards.

## Getting Started

1. Install the dependencies preferably using `yarn` or `bun`.
1. Install the dependencies preferably using `bun`.
2. Copy `.dev.vars.example` to `.dev.vars` and fill the variables
3. Generate Supabase types by running
```shell
yarn prebuild
bun prebuild
```
4. Run the project with `yarn wrangler`
4. Run the project with `bun wrangler`

## Example configuration

Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"node": ">=20.10.0"
},
"scripts": {
"prebuild": "dotenv -- cross-env yarn supabase:generate:remote",
"prebuild": "dotenv -- cross-env bun supabase:generate:remote",
"format": "run-p format:*",
"format:lint": "eslint --fix .",
"format:prettier": "prettier --write .",
Expand Down Expand Up @@ -75,7 +75,7 @@
},
"lint-staged": {
"*.ts": [
"yarn prettier --write",
"bun prettier --write",
"eslint --fix"
],
"src/**.{ts,json}": [
Expand Down
1 change: 1 addition & 0 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default {
settingsSchema: pluginSettingsSchema,
logLevel: env.LOG_LEVEL as LogLevel,
kernelPublicKey: env.KERNEL_PUBLIC_KEY,
bypassSignatureVerification: process.env.NODE_ENV === "local",
}
).fetch(request, env, executionCtx);
},
Expand Down
6 changes: 4 additions & 2 deletions tests/http/request.http
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# issue_number: the number of the issue, same as the one you would see in the url to that issue, e.g. "1"
# command: the command you want to test, e.g. "/wallet @ubiquibot"
# token: a valid GitHub token for auth, e.g. "ghs_xxxxx"
POST http://localhost:4000/
POST http://localhost:4002/
Content-Type: application/json

{
Expand All @@ -14,5 +14,7 @@ Content-Type: application/json
"eventPayload": {"action":"created","issue":{"url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/{{issue_number}}","repository_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}","labels_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/{{issue_number}}/labels{/name}","comments_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/{{issue_number}}/comments","events_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/{{issue_number}}/events","html_url":"https://github.com/{{org_name}}/{{repo_name}}/issues/{{issue_number}}","id":2297627819,"node_id":"I_kwDOLy-Pv86I8wSr","number":5,"title":"New issue","user":{"login":"ubiquibot","id":1,"node_id":"MDQ6VXNlcjk4MDcwMDg=","avatar_url":"https://avatars.githubusercontent.com/u/1?v=4","gravatar_id":"","url":"https://api.github.com/users/ubiquibot","html_url":"https://github.com/ubiquibot","followers_url":"https://api.github.com/users/ubiquibot/followers","following_url":"https://api.github.com/users/ubiquibot/following{/other_user}","gists_url":"https://api.github.com/users/ubiquibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ubiquibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubiquibot/subscriptions","organizations_url":"https://api.github.com/users/ubiquibot/orgs","repos_url":"https://api.github.com/users/ubiquibot/repos","events_url":"https://api.github.com/users/ubiquibot/events{/privacy}","received_events_url":"https://api.github.com/users/ubiquibot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":34,"created_at":"2024-05-15T11:22:48Z","updated_at":"2024-05-19T11:54:24Z","closed_at":null,"author_association":"CONTRIBUTOR","active_lock_reason":null,"body":"Another issue.","reactions":{"url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/{{issue_number}}/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/{{issue_number}}/timeline","performed_via_github_app":null,"state_reason":null},"comment":{"url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/comments/1","html_url":"https://github.com/{{org_name}}/{{repo_name}}/issues/{{issue_number}}#issuecomment-1","issue_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/{{issue_number}}","id":1,"node_id":"IC_kwDOLy-Pv85-UI-X","user":{"login":"ubiquibot","id":1,"node_id":"MDQ6VXNlcjk4MDcwMDg=","avatar_url":"https://avatars.githubusercontent.com/u/1?v=4","gravatar_id":"","url":"https://api.github.com/users/ubiquibot","html_url":"https://github.com/ubiquibot","followers_url":"https://api.github.com/users/ubiquibot/followers","following_url":"https://api.github.com/users/ubiquibot/following{/other_user}","gists_url":"https://api.github.com/users/ubiquibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ubiquibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubiquibot/subscriptions","organizations_url":"https://api.github.com/users/ubiquibot/orgs","repos_url":"https://api.github.com/users/ubiquibot/repos","events_url":"https://api.github.com/users/ubiquibot/events{/privacy}","received_events_url":"https://api.github.com/users/ubiquibot/received_events","type":"User","site_admin":false},"created_at":"2024-05-19T11:54:23Z","updated_at":"2024-05-19T11:54:23Z","author_association":"CONTRIBUTOR","body":"{{command}}","reactions":{"url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/comments/1/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null},"repository":{"id":1,"node_id":"R_kgDOLy-Pvw","name":"{{repo_name}}","full_name":"{{org_name}}/{{repo_name}}","private":false,"owner":{"login":"{{org_name}}","id":1,"node_id":"O_kgDOCYfonA","avatar_url":"https://avatars.githubusercontent.com/u/1?v=4","gravatar_id":"","url":"https://api.github.com/users/{{org_name}}","html_url":"https://github.com/{{org_name}}","followers_url":"https://api.github.com/users/{{org_name}}/followers","following_url":"https://api.github.com/users/{{org_name}}/following{/other_user}","gists_url":"https://api.github.com/users/{{org_name}}/gists{/gist_id}","starred_url":"https://api.github.com/users/{{org_name}}/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/{{org_name}}/subscriptions","organizations_url":"https://api.github.com/users/{{org_name}}/orgs","repos_url":"https://api.github.com/users/{{org_name}}/repos","events_url":"https://api.github.com/users/{{org_name}}/events{/privacy}","received_events_url":"https://api.github.com/users/{{org_name}}/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/{{org_name}}/{{repo_name}}","description":null,"fork":false,"url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}","forks_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/forks","keys_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/keys{/key_id}","collaborators_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/teams","hooks_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/hooks","issue_events_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/events{/number}","events_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/events","assignees_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/assignees{/user}","branches_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/branches{/branch}","tags_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/tags","blobs_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/git/refs{/sha}","trees_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/git/trees{/sha}","statuses_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/statuses/{sha}","languages_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/languages","stargazers_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/stargazers","contributors_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/contributors","subscribers_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/subscribers","subscription_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/subscription","commits_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/commits{/sha}","git_commits_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/git/commits{/sha}","comments_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/comments{/number}","issue_comment_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues/comments{/number}","contents_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/contents/{+path}","compare_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/compare/{base}...{head}","merges_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/merges","archive_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/downloads","issues_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/issues{/number}","pulls_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/pulls{/number}","milestones_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/milestones{/number}","notifications_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/labels{/name}","releases_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/releases{/id}","deployments_url":"https://api.github.com/repos/{{org_name}}/{{repo_name}}/deployments","created_at":"2024-04-25T05:19:30Z","updated_at":"2024-05-19T09:47:02Z","pushed_at":"2024-05-19T09:46:59Z","git_url":"git://github.com/{{org_name}}/{{repo_name}}.git","ssh_url":"[email protected]:{{org_name}}/{{repo_name}}.git","clone_url":"https://github.com/{{org_name}}/{{repo_name}}.git","svn_url":"https://github.com/{{org_name}}/{{repo_name}}","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":1,"watchers":0,"default_branch":"main","custom_properties":{}},"organization":{"login":"{{org_name}}","id":1,"node_id":"O_kgDOCYfonA","url":"https://api.github.com/orgs/{{org_name}}","repos_url":"https://api.github.com/orgs/{{org_name}}/repos","events_url":"https://api.github.com/orgs/{{org_name}}/events","hooks_url":"https://api.github.com/orgs/{{org_name}}/hooks","issues_url":"https://api.github.com/orgs/{{org_name}}/issues","members_url":"https://api.github.com/orgs/{{org_name}}/members{/member}","public_members_url":"https://api.github.com/orgs/{{org_name}}/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/1?v=4","description":null},"sender":{"login":"ubiquibot","id":1,"node_id":"MDQ6VXNlcjk4MDcwMDg=","avatar_url":"https://avatars.githubusercontent.com/u/1?v=4","gravatar_id":"","url":"https://api.github.com/users/ubiquibot","html_url":"https://github.com/ubiquibot","followers_url":"https://api.github.com/users/ubiquibot/followers","following_url":"https://api.github.com/users/ubiquibot/following{/other_user}","gists_url":"https://api.github.com/users/ubiquibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ubiquibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubiquibot/subscriptions","organizations_url":"https://api.github.com/users/ubiquibot/orgs","repos_url":"https://api.github.com/users/ubiquibot/repos","events_url":"https://api.github.com/users/ubiquibot/events{/privacy}","received_events_url":"https://api.github.com/users/ubiquibot/received_events","type":"User","site_admin":false},"installation":{"id":1,"node_id":"MDIzOkludGVncmF0aW9uSW5zdGFsbGF0aW9uNDgzODE5NzI="}},
"settings": {},
"ref": "",
"authToken": "{{token}}"
"authToken": "{{token}}",
"command": null,
"signature": "1234"
}

0 comments on commit 0e9f9a2

Please sign in to comment.