Skip to content

Commit

Permalink
Merge pull request #26 from ubiquity-os-marketplace/development
Browse files Browse the repository at this point in the history
Merge development into main
  • Loading branch information
gentlementlegen authored Nov 29, 2024
2 parents f7b6e27 + b2133e6 commit 2f5260a
Show file tree
Hide file tree
Showing 27 changed files with 310 additions and 7,307 deletions.
59 changes: 0 additions & 59 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config: KnipConfig = {
ignore: ["**/__mocks__/**", "**/__fixtures__/**", "src/types/database.ts", "dist/**"],
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"],
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", "ts-node"],
eslint: true,
};

Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/cspell.yml

This file was deleted.

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

on:
push:

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

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

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

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

- name: Install toolchain
run: bun install --frozen-lockfile

- name: Eslint
run: bun run eslint --fix-dry-run

- name: Cspell
run: bun run format:cspell

- name: Prettier
run: bun run prettier --check .
8 changes: 7 additions & 1 deletion .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ jobs:
with:
fetch-depth: 0

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

- name: Install toolchain
run: bun install --frozen-lockfile

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

- name: Add Jest Report to Summary
if: always()
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ jobs:
with:
node-version: 20.10.0

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

- name: Install toolchain
run: yarn install
run: bun install --frozen-lockfile

- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt

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

- name: Upload knip result
if: failure()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/worker-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
delete:
runs-on: ubuntu-latest
name: Delete Deployment
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}
steps:
- name: Setup Node
uses: actions/setup-node@v4
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
deploy-to-cloudflare:
runs-on: ubuntu-latest
name: Automatic Cloudflare Deploy
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}
steps:
- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -19,6 +20,9 @@ jobs:

- 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')
Expand All @@ -31,21 +35,26 @@ jobs:
# Update the wrangler.toml file
sed -i "s/^name = .*/name = \"$new_name\"/" wrangler.toml
echo "Updated wrangler.toml name to: $new_name"
- name: Deploy with Wrangler
id: wrangler_deploy
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: "3.80.4"
wranglerVersion: "3.87.0"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
SUPABASE_URL
SUPABASE_KEY
${{ secrets.KERNEL_PUBLIC_KEY && secrets.KERNEL_PUBLIC_KEY != '' && 'KERNEL_PUBLIC_KEY' || '' }}
CLOUDFLARE_ACCOUNT_ID
CLOUDFLARE_API_TOKEN
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

- name: Write Deployment URL to Summary
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ junit.xml
cypress/screenshots
.dev.vars
/tests/http/http-client.private.env.json
.wrangler
.wrangler
test-dashboard.md
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,34 @@ The following commands are allowed:
```

## Running locally

### Supabase types

You can run the type generations against a local database with

```shell
yarn supabase:generate:local
```

Or against an instance by setting the `SUPABASE_ACCESS_TOKEN` and `SUPABASE_PROJECT_ID` in your `.env` file

```shell
yarn prebuild
```

### Worker

Start the Worker by running

```shell
yarn dev
```

### Make requests

To trigger the worker, `POST` requests should be made to http://localhost:4000 with a `Content-Type: application/json`
header and a body looking like

```json
{
"stateId": "",
Expand All @@ -39,9 +48,11 @@ header and a body looking like
"ref": ""
}
```

For convenience, you can find an `.http` file with a valid request [here](/tests/http/request.http).

## Configuration

A valid configuration can be like:

```yaml
Expand All @@ -52,10 +63,11 @@ A valid configuration can be like:
```
## Testing
### Jest
To start Jest tests, run
```shell
yarn test
```
```
Binary file added bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 2f5260a

Please sign in to comment.