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

Feat/workerize #96

Draft
wants to merge 131 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
6d67585
Create README.md
gentlementlegen Jun 2, 2024
836193f
chore: init
Keyrxng Jun 2, 2024
bf6084f
fix: log types and minors
Keyrxng Jun 3, 2024
58db88f
fix: remove db type
Keyrxng Jun 3, 2024
84b1710
chore: slight readme tweak
Keyrxng Jun 3, 2024
812683a
chore: remove placeholder fn
Keyrxng Jun 3, 2024
0566a60
chore: use schema default
Keyrxng Jun 3, 2024
6ae1914
fix: remove workflow env ref
Keyrxng Jun 3, 2024
c79b342
chore: readme
Keyrxng Jun 3, 2024
0c401b6
fix: missing comma
Keyrxng Jun 3, 2024
802d869
chore: add typebox validator
Keyrxng Jun 3, 2024
9b07b87
chore: add validation to worker entry
Keyrxng Jun 3, 2024
1cb6b52
fix: remove ubq_bot token and commit_hash
Keyrxng Jun 7, 2024
5fcbf89
Merge pull request #1 from Keyrxng/main
gentlementlegen Jun 9, 2024
9909633
fix: run jest wf on Knip complete
Keyrxng Jun 10, 2024
9de5740
fix: update worker
Keyrxng Jun 12, 2024
42a961d
feat: updated eslint to use flat-config file
gentlementlegen Jun 18, 2024
9b7e261
chore: removed GitHub file as it was unused and triggered Knip errors
gentlementlegen Jun 18, 2024
52f63f0
chore: knip run on pull_request
gentlementlegen Jun 18, 2024
94df7f5
chore: updated knip workflow and added release-please.yml
gentlementlegen Jun 18, 2024
2e8634f
chore: removed unused packages
gentlementlegen Jun 18, 2024
5c16941
chore: removed unused deps
gentlementlegen Jun 18, 2024
75ed3ba
chore: validators for environment and settings
gentlementlegen Jun 18, 2024
f41f971
chore: removed log files
gentlementlegen Jun 18, 2024
ec83511
feat: added knip reporter
gentlementlegen Jun 18, 2024
c14c62e
chore: replaced npm-run-all by concurrently
gentlementlegen Jun 18, 2024
bba7dbe
chore: reverted concurrently to npm-run-all
gentlementlegen Jun 18, 2024
8b57978
chore: test run-p
gentlementlegen Jun 19, 2024
2e98ddf
Merge pull request #6 from gentlementlegen/feat/eslint-flat-config
0x4007 Jun 19, 2024
16344b7
fix: updated Jest test comment
gentlementlegen Jun 22, 2024
8e06edb
chore: added Jest reporter
gentlementlegen Jun 22, 2024
9a58fd8
Merge branch 'ubiquibot:main' into main
Keyrxng Jun 22, 2024
a7bb0fc
Merge pull request #9 from gentlementlegen/fix/jest-comments
0x4007 Jun 24, 2024
c0beca3
Merge branch 'main' into main
gentlementlegen Jun 24, 2024
cf32c8f
Merge pull request #4 from Keyrxng/main
gentlementlegen Jun 25, 2024
52d947c
ci: fix knip
rndquu Jun 25, 2024
da78017
Merge pull request #10 from rndquu/ci/fix-knip
rndquu Jun 26, 2024
82ffa47
fix: fixed import for typebox and updated gitignore
gentlementlegen Jul 2, 2024
67c9bcd
Merge pull request #11 from gentlementlegen/main
Keyrxng Jul 3, 2024
4e93751
chore: manifest.json
gentlementlegen Jul 11, 2024
fb0f9a8
fix: drop db for each test to avoid duplicates
gentlementlegen Jul 11, 2024
687b0fb
chore: manifest.json
gentlementlegen Jul 11, 2024
b95310d
chore: manifest.json
gentlementlegen Jul 16, 2024
e72ed38
Merge pull request #12 from gentlementlegen/main
gentlementlegen Jul 17, 2024
c28b92e
chore(deps): types/jest
Keyrxng Jul 27, 2024
05f6a99
chore: remove test
Keyrxng Jul 27, 2024
64bc487
chore: split plugin() for easier tests
Keyrxng Jul 27, 2024
3123d9d
feat: ubiquibot-logger
Keyrxng Jul 27, 2024
bd25bcc
chore: typeguards
Keyrxng Jul 27, 2024
90122fb
feat: hello-world
Keyrxng Jul 27, 2024
6c43c9c
chore: add configurable item
Keyrxng Jul 27, 2024
1ec4cb4
chore: hello world plugin test examples
Keyrxng Jul 27, 2024
9a0037b
chore: comment out supabase so it can run
Keyrxng Jul 27, 2024
f34b8b5
chore: eslint, cspell
Keyrxng Jul 27, 2024
a6992a0
chore: update comments
Keyrxng Jul 28, 2024
88af8a1
chore: remove adapters
Keyrxng Jul 29, 2024
7e699c3
Merge pull request #15 from Keyrxng/gg
Keyrxng Jul 31, 2024
88c6ebf
feat: worker deploy and delete
gentlementlegen Aug 27, 2024
7593c45
chore: updated worker deploy / delete
gentlementlegen Aug 28, 2024
9e8491e
chore: updated README.md
gentlementlegen Aug 28, 2024
e79bd4a
chore: truncate url to 63 characters
gentlementlegen Aug 28, 2024
dad0189
fix: truncate name to 63 characters to respect RFC 1035
gentlementlegen Aug 28, 2024
7f66809
Merge pull request #16 from gentlementlegen/main
gentlementlegen Aug 28, 2024
fb4298e
feat: add a new parmater
whck6 Aug 31, 2024
7e17676
Merge pull request #20 from whck6/feature/bot-strings-language-locali…
rndquu Sep 6, 2024
dbb9b22
feat: only the gobal name is considered for automatic deployment with…
gentlementlegen Sep 24, 2024
1a28d65
Merge pull request #22 from gentlementlegen/fix/base-name-wrangler
0x4007 Sep 24, 2024
82c2f88
feat: schema validation
gentlementlegen Sep 25, 2024
d3e8bf8
chore: added workflow to update schema
gentlementlegen Oct 2, 2024
fdd7cd2
chore: updated plugin workflow
gentlementlegen Oct 2, 2024
e8be4ef
chore: fixed jest
gentlementlegen Oct 2, 2024
a3adde1
Create build.yml
0x4007 Oct 3, 2024
f4497fb
chore: changed return
gentlementlegen Oct 3, 2024
bef70c8
chore: changed commit username
gentlementlegen Oct 3, 2024
6331f6b
chore: updated ts
gentlementlegen Oct 3, 2024
303767a
chore: updated generated configuration
ubiquity-os[bot] Oct 3, 2024
403ddcf
Update manifest.json
0x4007 Oct 3, 2024
ce27401
chore: fix knip
gentlementlegen Oct 4, 2024
98fb4b9
Merge branch 'main' into feat/schema-validation
gentlementlegen Oct 4, 2024
b5bb400
chore: fix knip
gentlementlegen Oct 4, 2024
553c4a0
chore: updated generated configuration
ubiquity-os[bot] Oct 4, 2024
2b65e83
Merge pull request #23 from gentlementlegen/feat/schema-validation
gentlementlegen Oct 4, 2024
8f5ce45
fix: running full formatting checks
gentlementlegen Oct 7, 2024
b888e39
chore: fix knip
gentlementlegen Oct 8, 2024
1203f39
chore: fix knip
gentlementlegen Oct 8, 2024
9968b9a
chore: updated generated configuration
ubiquity-os[bot] Oct 8, 2024
3bad7b1
chore: added scripts for formatting
gentlementlegen Oct 9, 2024
7601e39
chore: updated generated configuration
ubiquity-os[bot] Oct 9, 2024
3516d1d
Merge pull request #27 from gentlementlegen/main
0x4007 Oct 10, 2024
8d8f069
Update compute.yml
gentlementlegen Oct 21, 2024
6c531a4
chore: Merge remote-tracking branch 'template/development' into feat/…
Keyrxng Oct 29, 2024
583e7b4
chore: remove slash commands, this product doesn't have any
Keyrxng Oct 29, 2024
2dd7d77
chore: add logger, fix imports, add adapters to ctx
Keyrxng Oct 29, 2024
ea12619
chore: format, add TODO comments in worker
Keyrxng Oct 29, 2024
0e30b55
chore: correct types
Keyrxng Oct 29, 2024
91d82c5
refactor: generate-erc20-permit
Keyrxng Oct 29, 2024
80ca64e
refactor: generate-erc721-permits
Keyrxng Oct 29, 2024
857d737
chore: eslint, prettier, general clean up
Keyrxng Oct 29, 2024
d121ade
chore: fix test with removed log
Keyrxng Oct 29, 2024
455ce19
chore: use esbuild
Keyrxng Oct 30, 2024
4ca4e3b
chore: refactor adapters
Keyrxng Oct 30, 2024
8ed5105
chore: delete unused files
Keyrxng Oct 30, 2024
218eb2b
chore: update permit detail getters
Keyrxng Oct 30, 2024
cf8ea1b
chore: remove @actions/octokit for breaking build
Keyrxng Oct 30, 2024
d404d8b
chore: move error throw into getProvider
Keyrxng Oct 30, 2024
57a5af4
chore: remove dotenv for breaking build
Keyrxng Oct 30, 2024
c1fa687
chore: single logger export, fix returnDataToKernel
Keyrxng Oct 30, 2024
3b0b598
feat: /generate endpoint
Keyrxng Oct 30, 2024
7f47920
chore: refactor permitRequestSchema
Keyrxng Oct 30, 2024
b1aec73
chore: .eslintignore /dist, /coverage
Keyrxng Oct 30, 2024
ca9c063
chore: fn split, remove /generate endpoint
Keyrxng Oct 30, 2024
b9b8d52
chore: refactor generate-payout-permits
Keyrxng Oct 30, 2024
5df1caa
chore: update runPlugin
Keyrxng Oct 30, 2024
f1ad9b3
chore: refactor plugin input
Keyrxng Oct 30, 2024
091f4f2
chore: update erc20 tests
Keyrxng Oct 30, 2024
f57f726
chore: update erc721 tests and dual permit test
Keyrxng Oct 31, 2024
10dde0b
chore: use logger in adapters
Keyrxng Oct 31, 2024
90baac6
chore: move x25519 into env, fn params
Keyrxng Oct 31, 2024
490c89d
chore: fixing types, inputs, logger
Keyrxng Oct 31, 2024
4fa5dc7
chore: some knip fixes
Keyrxng Oct 31, 2024
b57277f
chore: TypeBox discrim union for permit request
Keyrxng Oct 31, 2024
1ed5e2d
chore: use tweetnacl
Keyrxng Nov 3, 2024
e89fc63
chore: return params from decrypt
Keyrxng Nov 3, 2024
219deb4
chore: return permits json
Keyrxng Nov 3, 2024
b71c702
chore: try catch returnToKernel for local
Keyrxng Nov 3, 2024
18ab37f
chore: minor fixes, readme, tests, cspell, format
Keyrxng Nov 3, 2024
7aac49d
Merge remote-tracking branch 'upstream/development' into feat/workerize
Keyrxng Nov 3, 2024
8e61947
chore: remove workflow logic, update tsconfig, octokit.rest, clear ma…
Keyrxng Nov 3, 2024
156d349
chore: update dev.vars.example
Keyrxng Nov 27, 2024
63ed2fd
Merge remote-tracking branch 'upstream/development' into feat/workerize
Keyrxng Nov 27, 2024
686c05e
chore: format
Keyrxng Nov 27, 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
35 changes: 30 additions & 5 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,29 @@
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "supabase", "bun.lockb", "tests"],
"useGitignore": true,
"language": "en",
"words": ["dataurl", "devpool", "outdir", "servedir", "typebox"],
"words": [
"dataurl",
"devpool",
"outdir",
"servedir",
"typebox",
"Nektos",
"dataurl",
"devpool",
"outdir",
"servedir",
"Supabase",
"SUPABASE",
"typebox",
"ubiquibot",
"Smee",
"typeguards",
"mswjs",
"Typeguards",
"sonarjs",
"knip",
"mischeck"
],
"dictionaries": ["typescript", "node", "software-terms"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
"ignoreRegExpList": ["[0-9a-fA-F]{6}"],
Expand All @@ -18,9 +40,11 @@
"Gddm",
"Njbl",
"knip",
"jiggery",
"pokery",
"URLSAFE2",
"BLUS",
"Wfryd",
"Mnll",
"Skow",
"Hpwq",
"Mult",
"WXDAI",
"ubiquibot",
Expand All @@ -32,6 +56,7 @@
"tweetnacl",
"typeguards",
"Numberish",
"Rpcs"
"Rpcs",
"nacl"
]
}
1 change: 1 addition & 0 deletions .dev.vars.example
Keyrxng marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MY_SECRET="MY_SECRET"
53 changes: 0 additions & 53 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

13 changes: 13 additions & 0 deletions .github/knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
entry: ["build/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
ignoreExportsUsedInFile: true,
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier"],
eslint: true,
};

export default config;
38 changes: 0 additions & 38 deletions .github/workflows/compute.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/formatting-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Formatting Check

on:
push:

jobs:
spellcheck:
name: Check for formatting errors
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Run formatting checks
run: |
yarn install
yarn check-formatting
9 changes: 5 additions & 4 deletions .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Build & Run test suite
run: |
yarn install --immutable --immutable-cache --check-cache
yarn test

- name: Jest With Coverage
run: yarn install --immutable --immutable-cache --check-cache && yarn test

- name: Add Jest Report to Summary
if: always()
run: echo "$(cat test-dashboard.md)" >> $GITHUB_STEP_SUMMARY
13 changes: 2 additions & 11 deletions .github/workflows/knip-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,13 @@ on:
types:
- completed

permissions: write-all

jobs:
knip-reporter:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Install toolchain
run: yarn install

- uses: actions/download-artifact@v4
with:
name: knip-results
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Knip

on:
pull_request:
workflow_dispatch:

jobs:
run-knip:
Expand All @@ -22,7 +23,7 @@ jobs:
run: echo ${{ github.event.number }} > pr-number.txt

- name: Run Knip
run: yarn knip || yarn -s knip --reporter json > knip-results.json
run: yarn knip || yarn knip --reporter json > knip-results.json

- name: Upload knip result
if: failure()
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: release-please

on:
workflow_dispatch:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: simple
58 changes: 58 additions & 0 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "Update Configuration"

on:
workflow_dispatch:
push:

jobs:
update:
name: "Update Configuration in manifest.json"
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4

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

- name: Install deps and run configuration update
run: |
yarn install --immutable --immutable-cache --check-cache
yarn tsc --noCheck --project tsconfig.json

- name: Update manifest configuration using GitHub Script
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');

const { pluginSettingsSchema } = require('./src/types');

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

const configuration = JSON.stringify(pluginSettingsSchema);

manifest["configuration"] = JSON.parse(configuration);

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

- name: Commit and Push generated types
run: |
git config --global user.name 'ubiquity-os[bot]'
git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com'
git add ./manifest.json
if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then
git commit -m "chore: updated generated configuration" || echo "Lint-staged check failed"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/worker-delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Delete Deployment

on:
delete:

jobs:
delete:
runs-on: ubuntu-latest
name: Delete Deployment
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: Get Deleted Branch Name
id: get_branch
run: |
branch_name=$(echo '${{ github.event.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
echo "branch_name=$branch_name" >> $GITHUB_ENV
- name: Retrieve and Construct Full Worker Name
id: construct_worker_name
run: |
base_name=$(grep '^name = ' wrangler.toml | head -n 1 | sed 's/^name = "\(.*\)"$/\1/')
full_worker_name="${base_name}-${{ env.branch_name }}"
# Make sure that it doesnt exceed 63 characters or it will break RFC 1035
full_worker_name=$(echo "${full_worker_name}" | cut -c 1-63)
echo "full_worker_name=$full_worker_name" >> $GITHUB_ENV
- name: Delete Deployment with Wrangler
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: delete --name ${{ env.full_worker_name }}

- name: Output Deletion Result
run: |
echo "### Deployment URL" >> $GITHUB_STEP_SUMMARY
echo 'Deployment `${{ env.full_worker_name }}` has been deleted.' >> $GITHUB_STEP_SUMMARY
Loading
Loading