Skip to content

Commit

Permalink
chore: merged development branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Feb 19, 2024
1 parent 3b7c3d2 commit 2f11234
Show file tree
Hide file tree
Showing 4 changed files with 4,113 additions and 748 deletions.
16 changes: 16 additions & 0 deletions build/esbuild-build.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import esbuild from "esbuild";
import * as dotenv from "dotenv";
const typescriptEntries = [
"static/scripts/rewards/index.ts",
"static/scripts/audit-report/audit.ts",
Expand All @@ -22,6 +23,7 @@ export const esBuildContext: esbuild.BuildOptions = {
".svg": "dataurl",
},
outdir: "static/out",
define: createEnvDefines(["SUPABASE_URL", "SUPABASE_KEY"]),
};

esbuild
Expand All @@ -33,3 +35,17 @@ esbuild
console.error(err);
process.exit(1);
});

function createEnvDefines(variableNames: string[]): Record<string, string> {
const defines: Record<string, string> = {};
dotenv.config();
for (const name of variableNames) {
const envVar = process.env[name];
if (envVar !== undefined) {
defines[`process.env.${name}`] = JSON.stringify(envVar);
} else {
throw new Error(`Missing environment variable: ${name}`);
}
}
return defines;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@octokit/plugin-throttling": "^8.1.3",
"@octokit/rest": "^20.0.2",
"@sinclair/typebox": "^0.32.14",
"@supabase/supabase-js": "2.39.7",
"@types/libsodium-wrappers": "^0.7.13",
"@uniswap/permit2-sdk": "^1.2.0",
"axios": "^1.6.7",
Expand Down
Loading

0 comments on commit 2f11234

Please sign in to comment.