Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"dataurl",
"outdir",
"servedir",
"denoland",
"SUPABASE",
"pipefail",
"binfmt"
],
"dictionaries": ["typescript", "node", "software-terms", "html"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
- name: Set up Deno
uses: denoland/setup-deno@v2
with:
node-version: 20.10.0
deno-version: v2.x

- name: Install dependencies
run: deno install

- name: Build
run: |
yarn
yarn build
run: deno task build

- name: Upload build artifact
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
with:
node-version: "20.10.0"

- name: Install cspell
run: yarn add cspell
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run cspell
run: yarn format:cspell
13 changes: 3 additions & 10 deletions .github/workflows/deno-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,22 @@ name: Deno Deploy

on:
push:
pull_request:
workflow_dispatch:

jobs:
deploy:
uses: ubiquity/deno-deploy-workflow/.github/workflows/deno-deploy-reusable.yml@main
with:
project: keygen-ubq-fi
deploy_platform: deno2
entrypoint: serve.ts
bun_version: 1.3.4
install_command: HUSKY=0 bun install --registry=https://registry.npmjs.org
build_command: bun run build
build_env: |
SUPABASE_URL=$SUPABASE_URL
SUPABASE_ANON_KEY=$SUPABASE_ANON_KEY
FRONTEND_URL=https://keygen.ubq.fi
install_command: deno install
build_command: deno task build
runtime_env: |
STATIC_DIR=static
include: |
static/**
debug_fetch_fail: true
required_env: |
DENO_DEPLOY_TOKEN
SUPABASE_URL
SUPABASE_ANON_KEY
secrets: inherit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ node_modules
.pnp.cjs
.pnp.loader.mjs
.env
static/dist
static/dist
static/out
14 changes: 13 additions & 1 deletion build/esbuild-build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// @ts-expect-error - Could not find a declaration file for module
import esbuild from "esbuild";
import { createRequire } from "node:module";

const require = createRequire(`${process.cwd()}/package.json`);
const libsodiumWrappersPath = require.resolve("libsodium-wrappers");

const typescriptEntries = ["static/scripts/key-generator/keygen.ts"];
const cssEntries = ["static/styles/rewards/rewards.css", "static/styles/audit-report/audit.css", "static/styles/onboarding/onboarding.css"];
export const entries = [...typescriptEntries, ...cssEntries];
Expand All @@ -17,6 +21,14 @@ export const esBuildContext: esbuild.BuildOptions = {
".ttf": "dataurl",
".svg": "dataurl",
},
plugins: [
{
name: "libsodium-wrappers-cjs",
setup(build) {
build.onResolve({ filter: /^libsodium-wrappers$/ }, () => ({ path: libsodiumWrappersPath }));
},
},
],
outdir: "static/out",
};

Expand Down
187 changes: 64 additions & 123 deletions bun.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tasks": {
"build": "deno run -A build/esbuild-build.ts",
"serve": "deno run --allow-all serve.ts",
},
}
Loading
Loading