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

Merge development into main #31

Merged
merged 69 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0e9f9a2
fix: updated port for http request.http and use bun
gentlementlegen Dec 2, 2024
b516df0
chore: updated lock file
gentlementlegen Dec 2, 2024
03017f3
chore: updated manifest.json and dist build
github-actions[bot] Dec 2, 2024
85c3c0c
chore: updated manifest.json and dist build
github-actions[bot] Dec 2, 2024
89109e0
chore: remove generated dist/index.js file
gentlementlegen Dec 6, 2024
8cb078c
chore: updated manifest.json and dist build
github-actions[bot] Dec 6, 2024
bcd24a5
chore: updated manifest.json and dist build
github-actions[bot] Dec 6, 2024
9c36cf6
fix: improved error messages
gentlementlegen Dec 6, 2024
965bcd4
chore: updated manifest.json and dist build
github-actions[bot] Dec 6, 2024
56faa8e
chore: fix unregister wallet
gentlementlegen Dec 7, 2024
940b581
chore: updated manifest.json and dist build
github-actions[bot] Dec 7, 2024
6fa4bb1
feat: user can unset their wallet or link multiple accounts to the sa…
gentlementlegen Dec 8, 2024
b947480
chore: updated manifest.json and dist build
github-actions[bot] Dec 8, 2024
78175e9
chore: changed unset flag to 'unset' argument
gentlementlegen Dec 8, 2024
026331b
chore: updated manifest.json and dist build
github-actions[bot] Dec 8, 2024
3199d2f
chore: added linguist file
gentlementlegen Dec 8, 2024
001e976
chore: remove generated dist/index.js file
gentlementlegen Dec 6, 2024
cf03791
chore: updated manifest.json and dist build
github-actions[bot] Dec 6, 2024
91780fd
Merge remote-tracking branch 'origin/development' into development
gentlementlegen Dec 8, 2024
3166ec2
Merge branch 'development' into fix/error-messages
gentlementlegen Dec 8, 2024
9d994e5
chore: updated manifest.json and dist build
github-actions[bot] Dec 8, 2024
e98524c
chore: updated manifest.json
gentlementlegen Dec 8, 2024
ff8c8c9
test: added test for wallet unlink
gentlementlegen Dec 8, 2024
8da54d8
test: fixed wallet address
gentlementlegen Dec 8, 2024
f4b38d9
chore: added support for LLM command with unset option
gentlementlegen Dec 10, 2024
b6ddcd9
chore: updated manifest.json and dist build
github-actions[bot] Dec 10, 2024
8be2137
chore: added support for LLM command with unset option in manifest.json
gentlementlegen Dec 10, 2024
23ca59d
chore: removed error details from displayed errors
gentlementlegen Dec 10, 2024
bf6109d
chore: updated manifest.json and dist build
github-actions[bot] Dec 10, 2024
c6a0eb2
chore: simplified error handling for the plugin sdk
gentlementlegen Dec 10, 2024
c00c024
chore: updated manifest.json and dist build
github-actions[bot] Dec 10, 2024
9e7235e
chore: removed unused file utils.ts
gentlementlegen Dec 10, 2024
69ad73d
chore: fixed tests
gentlementlegen Dec 10, 2024
dba4496
chore: fixed patch API call implementation
gentlementlegen Dec 11, 2024
4d47db8
fix: removed location from wallet DB references
gentlementlegen Dec 11, 2024
44df9ab
chore: updated manifest.json and dist build
github-actions[bot] Dec 11, 2024
dd47e9c
fix: users can only register to a unique wallet
gentlementlegen Dec 11, 2024
f9de807
chore: updated manifest.json and dist build
github-actions[bot] Dec 11, 2024
65f5ffd
chore: changed message contents
gentlementlegen Dec 12, 2024
8380526
chore: updated manifest.json and dist build
github-actions[bot] Dec 12, 2024
099ee70
chore: fixed unit tests
gentlementlegen Dec 12, 2024
bfd38c3
Merge pull request #29 from gentlementlegen/fix/error-messages
gentlementlegen Dec 12, 2024
e78898f
chore: updated deployment workflow
gentlementlegen Dec 17, 2024
1a17ed1
chore: updated worker url commit with app login
gentlementlegen Dec 17, 2024
944555a
chore: added write permission to workflow
gentlementlegen Dec 17, 2024
35ed7e0
chore: changed `url` to `homepage_url`
gentlementlegen Dec 17, 2024
26a8d2b
chore: fixed prettier in worker-deploy.yml
gentlementlegen Dec 17, 2024
c186fe0
chore: change run order for worker-deploy.yml
gentlementlegen Dec 17, 2024
0c34cfd
chore: fixed prettier
gentlementlegen Dec 17, 2024
911afe1
chore: added prettier for manifest.json generation
gentlementlegen Dec 17, 2024
0a74fe4
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
76aaa67
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
1188b8d
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
ff74205
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
61ab456
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
f17e6c5
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
063f11e
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
08dccc2
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
b0c15e9
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
31b4267
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
821bb17
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
616c99f
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
a352ad5
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
dc7bb9f
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
e4eb972
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
b5ec0f3
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
fb9f549
chore: new token workflow for worker-deploy.yml
gentlementlegen Dec 18, 2024
18f9035
Merge pull request #30 from gentlementlegen/development
gentlementlegen Dec 18, 2024
ebcfe2a
chore: [skip ci] update manifest.json url
ubiquity-os[bot] Dec 18, 2024
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/** linguist-generated
bun.lockb linguist-generated
10 changes: 5 additions & 5 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: Update Manifest and Commit Changes
name: "Update Configuration and Build"

on:
workflow_dispatch:
push:

jobs:
update-manifest:
name: "Update Manifest and Commit Changes"
name: "Update Configuration & Build"
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: Update Manifest and Commit Changes
uses: ubiquity-os/action-deploy-plugin@main
- uses: ubiquity-os/action-deploy-plugin@main
with:
treatAsEsm: false
sourcemap: false
pluginEntry: ${{ github.workspace }}/src/main.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
56 changes: 51 additions & 5 deletions .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
name: Deploy Worker

on:
push:
workflow_dispatch:
workflow_run:
workflows: ["Update Configuration and Build"]
types:
- completed

env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}

jobs:
deploy-to-cloudflare:
runs-on: ubuntu-latest
name: Automatic Cloudflare Deploy
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}
permissions:
contents: write

steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Enable corepack
run: corepack enable

- uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Update wrangler.toml Name Field
run: |
branch_name=$(echo '${{ github.event.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
branch_name=$(echo '${{ github.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
# Extract base name from wrangler.toml
base_name=$(grep '^name = ' wrangler.toml | sed 's/^name = "\(.*\)"$/\1/')
# Concatenate branch name with base name
Expand Down Expand Up @@ -57,6 +63,46 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}

- name: Update manifest.json worker url
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');

const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));

manifest["homepage_url"] = "${{ steps.wrangler_deploy.outputs.deployment-url }}";

const updatedManifest = JSON.stringify(manifest, null, 2);
fs.writeFileSync(manifestPath, updatedManifest);
console.log('Updated manifest:', updatedManifest);

- name: Get GitHub App token
if: env.APP_ID != '' && env.APP_PRIVATE_KEY != ''
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.APP_PRIVATE_KEY }}

- name: Format manifest.json using Prettier
shell: bash
run: |
bun add -DE prettier
bun prettier --write .

- name: Commit file
uses: swinton/[email protected]
env:
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
with:
files: |
manifest.json
commit-message: "chore: [skip ci] update manifest.json url"
ref: ${{ github.ref }}

- name: Write Deployment URL to Summary
run: |
echo "### Deployment URL" >> $GITHUB_STEP_SUMMARY
Expand Down
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.
6 changes: 3 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
"commands": {
"wallet": {
"ubiquity:example": "/wallet ubq.eth",
"description": "Register your wallet address for payments.",
"description": "Register your wallet address for payments. Use '/wallet unset' to unlink your wallet.",
"parameters": {
"type": "object",
"properties": {
"walletAddress": {
"description": "Ethereum address or Ethereum Name Service",
"type": "string"
},
"unset": {
"description": "Unsets the wallet associated with a user",
"type": "boolean",
"default": false
}
}
}
Expand All @@ -26,5 +31,6 @@
"type": "boolean"
}
}
}
},
"homepage_url": "https://ubiquity-os-command-wallet-development.ubiquity.workers.dev"
}
6 changes: 3 additions & 3 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 All @@ -34,7 +34,7 @@
"@sinclair/typebox": "0.34.3",
"@supabase/supabase-js": "2.43.5",
"@ubiquity-dao/rpc-handler": "1.3.0",
"@ubiquity-os/plugin-sdk": "^1.1.0",
"@ubiquity-os/plugin-sdk": "^1.1.1",
"@ubiquity-os/ubiquity-os-logger": "^1.3.2",
"commander": "12.1.0",
"dotenv": "16.4.5",
Expand Down Expand Up @@ -75,7 +75,7 @@
},
"lint-staged": {
"*.ts": [
"yarn prettier --write",
"prettier --write",
"eslint --fix"
],
"src/**.{ts,json}": [
Expand Down
Loading
Loading