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

Add prebuild script for WalletConnect domain verification #416

Merged
merged 7 commits into from
Mar 20, 2024
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
5 changes: 5 additions & 0 deletions .changeset/witty-rings-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@delvtech/council-cli": patch
---

Fix dotenv parsing
3 changes: 2 additions & 1 deletion apps/council-ui/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ NEXT_PUBLIC_GOERLI_RPC_URL=
NEXT_PUBLIC_LOCAL_RPC_URL=http://127.0.0.1:8545

# WalletConnect integration w/ RainbowKit
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
WALLET_CONNECT_DOMAIN_VERIFICATION_CODE=
5 changes: 4 additions & 1 deletion apps/council-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.env
out
out

# WalletConnect domain verification code
public/.well-known/walletconnect.txt
1 change: 1 addition & 0 deletions apps/council-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"prebuild": "sh ./scripts/prebuild.sh",
"build": "next build",
"export": "next export",
"start": "next start",
Expand Down
22 changes: 22 additions & 0 deletions apps/council-ui/scripts/prebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

# Set the environment variables from the .env file if it exists
if [ -f .env ]; then
set -o allexport
source .env
set +o allexport
fi

# Get the WalletConnect domain verification code from the
# WALLET_CONNECT_DOMAIN_VERIFICATION_CODE environment variable
verification_code=$WALLET_CONNECT_DOMAIN_VERIFICATION_CODE

# Save the verification code to Public/.well-known/walletconnect.txt
if [ -n "$verification_code" ]; then
echo "Saving verification code to public/.well-known/walletconnect.txt"
mkdir -p public/.well-known
echo "$verification_code" >public/.well-known/walletconnect.txt
else
echo "Verification code is empty. Skipping."
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "council-kit",
"version": "0.0.0",
"version": "0.0.3",
"private": true,
"workspaces": [
"apps/*",
Expand Down
8 changes: 4 additions & 4 deletions packages/council-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"dist"
],
"scripts": {
"council": "node -r dotenv/config dist/council.js",
"dev": "NODE_ENV=development tesm-node -r dotenv/config src/council.ts",
"prod": "tesm-node -r dotenv/config src/council.ts",
"council": "node dist/council.js",
"dev": "NODE_ENV=development tesm-node src/council.ts",
"prod": "tesm-node src/council.ts",
"build": "rimraf dist && tsc",
"watch": "tsc --watch"
},
Expand All @@ -35,6 +35,7 @@
"clide-js": "^0.1.3",
"clide-plugin-command-menu": "^0.0.7",
"colors": "^1.4.0",
"dotenv": "^16.4.5",
"json-schema-typed": "^8.0.1",
"merkletreejs": "^0.3.11",
"node-fetch-native": "^1.6.2",
Expand All @@ -47,7 +48,6 @@
"@types/node": "^20.11.19",
"@types/prompts": "^2.4.9",
"@types/signale": "^1.4.7",
"dotenv": "^16.4.5",
"hardhat": "^2.20.1",
"rimraf": "^5.0.5",
"tesm-node": "^1.3.1",
Expand Down
1 change: 1 addition & 0 deletions packages/council-cli/src/council.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
import { help, run } from "clide-js";
import { commandMenu } from "clide-plugin-command-menu";
import "dotenv/config";
import signale from "signale";

run({
Expand Down