Skip to content

Commit 283f38a

Browse files
authored
Feature/project refactor (boundlessfi#44)
* feat(project): add metadata_uri, is_successful, is_closed, and created_at fields to Project struct and update new() method accordingly * refactor(create_project_event): change project_id type from u64 to String * refactor(create_project_storage): change project_id type from u64 to String * feat(create_project): add metadata_uri and change project_id to String in create_project function * feat: add wallet connection and project creation functionalities - add ConnectWalletButton component to dashboard layout - create ProjectsPage for displaying user projects - update project creation API route to handle new fields - add wallet store using Zustand for managing wallet state - implement project form with wallet connection and metadata upload - add MyProjectsList component to display user's projects - update utils with formatAddress function - add dependencies: uuid and zustand * docs: update README with detailed contribution guide and project overview * docs: update README with support section and adjust Discord link format * feat(project_contract): implement voting functionality for projects Enable voting on projects by adding vote_project module with storage and event handling. * feat(create_project): add project management functionalities - add project existence check and funding target validation - implement get_project, update_project_metadata, modify_milestone, and close_project methods - update storage to use persistent Map for project data - enhance tests for new functionalities and edge cases * ci: add GitHub Actions for Node.js, Rust, and Stellar setup ci: add Rust format check workflow ci: comment out pre-commit build step in Husky * style: reorder imports and reformat code in create_project_event.rs * ci: add Node.js workflow for build and test * chore: update lint and format scripts in package.json * ci: update GitHub Actions workflow for Node.js configuration * ci(workflows): update nodejs.yml to include complete job and reorganize steps * refactor: reorder imports and improve code formatting across multiple files * add prettier * chore: remove Prettier format check from GitHub Actions workflow * ci: add GitHub Actions workflow for verifying build chore: add Node.js version to .nvmrc chore: update package-lock.json with new dependencies chore: modify package.json to use tsx for initialization script chore: add rust-toolchain.toml for Rust toolchain configuration feat: add initialization script for setting up environment and deploying contracts chore: add utility functions for the initialization script * chore: add Makefile for build automation * chore: comment out clippy step in GitHub Actions workflow * ci(workflow): consolidate environment variables and build steps in verify-build.yml * refactor(scripts): remove unused mkdirSync import and add logging for binding and importing contracts * refactor(scripts): remove redundant console log in initialize script * refactor: comment out existing functionality in CreateProjectComponent and add placeholder component content * chore(scripts): add debug log to bindAll function in initialize script * fix: correct path for deployed contract IDs directory * fix(scripts): correct contracts directory path and enable logging * fix(scripts): correct contracts directory path and enable logging * fix(scripts): correct path for contract IDs directory in getContracts function * refactor(scripts): simplify and streamline contract initialization process * ci: add SOROBAN_SECRET_KEY to environment variables in verify-build workflow * refactor(project-form): rename createProject to contractClient for clarity * refactor: remove CreateProjectComponent and related page files * feat: add vercel configuration file for deployment * chore: update .gitignore to exclude contract unit test snapshots * style: reorder imports for consistency and readability * feat: add @radix-ui/react-alert-dialog dependency and update @radix-ui/react-dialog to 1.1.6 * ci: remove ci.yml workflow configuration
1 parent 6f76ebb commit 283f38a

118 files changed

Lines changed: 18809 additions & 17638 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Setup Node.js with .nvmrc
2+
description: Reads the .nvmrc file and sets up the corresponding Node.js version
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Read .nvmrc
7+
run: echo "node-version=$(cat .nvmrc)" >> $GITHUB_ENV
8+
shell: bash
9+
10+
- name: Setup Node.js
11+
uses: actions/setup-node@v4
12+
with:
13+
node-version: ${{ env.node-version }}
14+
cache: 'npm'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Setup Rust and Stellar
2+
description: Installs Rust toolchain and Stellar CLI
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Cache Rust dependencies
7+
uses: Swatinem/rust-cache@v2
8+
9+
- name: Install Rust
10+
uses: dtolnay/rust-toolchain@master
11+
with:
12+
toolchain: stable
13+
targets: wasm32-unknown-unknown
14+
15+
16+
- name: Install Stellar CLI
17+
run: |
18+
wget -q https://github.com/stellar/stellar-cli/releases/download/v22.2.0/stellar-cli-22.2.0-x86_64-unknown-linux-gnu.tar.gz
19+
tar xvf stellar-cli-22.2.0-x86_64-unknown-linux-gnu.tar.gz
20+
sudo mv stellar /usr/local/bin/
21+
stellar --version
22+
shell: bash
23+

.github/workflows/nodejs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Node.js
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
8+
jobs:
9+
10+
complete:
11+
if: always()
12+
needs: [build-and-test]
13+
runs-on: ubuntu-latest
14+
steps:
15+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
16+
run: exit 1
17+
18+
build-and-test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Setup Node.js
24+
uses: ./.github/actions/setup-node
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Biome lint check
30+
run: npm run lint:check
31+

.github/workflows/rustfmt.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Rust: Format Check"
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
8+
jobs:
9+
rustfmt:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Install Rust
17+
uses: actions-rs/toolchain@v1
18+
with:
19+
profile: minimal
20+
toolchain: stable
21+
components: rustfmt
22+
23+
- name: Run rustfmt
24+
run: cargo fmt -- --check
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
name: CI/CD Pipeline
2-
1+
name: Verify Build
32
on:
4-
pull_request:
5-
branches:
3+
push:
4+
branches-ignore:
65
- main
76

87
jobs:
9-
lint-and-build:
10-
name: Lint and Build
8+
build:
119
runs-on: ubuntu-latest
12-
1310
steps:
14-
- name: Checkout repository
11+
- name: Checkout your repository using git
1512
uses: actions/checkout@v4
1613

17-
- name: Set up Node.js (Use Required Version)
18-
uses: actions/setup-node@v4
19-
with:
20-
node-version: 20.18.0 # Set to the required version
14+
- name: Setup Rust and Stellar
15+
uses: ./.github/actions/setup-rust-stellar
16+
17+
- name: Setup Node.js
18+
uses: ./.github/actions/setup-node
19+
20+
- name: Build contracts
21+
run: make build
22+
23+
- name: Run tests
24+
run: cargo test --release
2125

22-
- name: Install dependencies
23-
run: npm install
26+
# - name: Run clippy
27+
# run: cargo clippy -- -D warnings
2428

25-
- name: Set up environment variables
29+
- name: Setup env
2630
run: |
2731
echo "NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}" >> .env
2832
echo "NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }}" >> .env
@@ -48,25 +52,15 @@ jobs:
4852
echo "GITHUB_ID=${{ secrets.GH_ID }}" >> .env
4953
echo "GITHUB_SECRET=${{ secrets.GH_SECRET }}" >> .env
5054
51-
- name: Debug File Listing
55+
- name: Install and build
56+
env:
57+
STELLAR_NETWORK: testnet
58+
STELLAR_ACCOUNT: ${{ secrets.STELLAR_ACCOUNT }}
59+
STELLAR_SECRET_KEY: ${{ secrets.STELLAR_SECRET_KEY }}
60+
SOROBAN_SECRET_KEY: ${{ secrets.SOROBAN_SECRET_KEY }}
61+
PUBLIC_STELLAR_NETWORK_PASSPHRASE: Test SDF Network ; September 2015
62+
PUBLIC_STELLAR_RPC_URL: https://soroban-testnet.stellar.org/
5263
run: |
53-
echo "Checking for matching files..."
54-
find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" -o -name "*.json" -o -name "*.md" -o -name "*.css" -o -name "*.scss" \) \
55-
! -path "./node_modules/*" ! -path "./dist/*" ! -path "./.git/*" ! -path "./coverage/*" \
56-
|| echo "No matching files found."
57-
58-
- name: Run Biome Formatter & Linter
59-
run: |
60-
FILES=$(find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" -o -name "*.json" -o -name "*.md" -o -name "*.css" -o -name "*.scss" \) \
61-
! -path "./node_modules/*" ! -path "./dist/*" ! -path "./.git/*" ! -path "./coverage/*")
62-
63-
if [ -n "$FILES" ]; then
64-
echo "Running Biome on found files..."
65-
echo "$FILES" | xargs npx biome format --write
66-
echo "$FILES" | xargs npx biome lint --write
67-
else
68-
echo "No files found to format or lint. Skipping."
69-
fi
70-
71-
- name: Run Build
72-
run: npm run build
64+
npm ci
65+
npm run init
66+
npm run build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ packages/*
6262
# generated contract client imports
6363
src/contracts/*
6464
!src/contracts/util.ts
65+
66+
# contract unit test test-snapshots
67+
**/test_snapshots

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx lint-staged && npm run build
1+
# npx lint-staged && npm run build

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v23.6.0

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
build/
3+
dist/
4+
contracts/
5+
./next/
6+
package-lock.json

.prettierrc.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// .prettierrc.mjs
2+
/** @type {import("prettier").Config} */
3+
const config = {
4+
tabWidth: 2,
5+
useTabs: false,
6+
printWidth: 120,
7+
singleQuote: true,
8+
jsxSingleQuote: false,
9+
bracketSpacing: true,
10+
semi: true,
11+
};
12+
13+
export default config;

0 commit comments

Comments
 (0)