Skip to content

Commit 5d282dc

Browse files
committed
Merge branch 'local-db-order-details' into local-db-vault-details
2 parents 2f18b41 + d81b881 commit 5d282dc

94 files changed

Lines changed: 6163 additions & 5408 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.

.cargo/config.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
[target.wasm32-unknown-unknown]
22
# Required to make the rand feature of alloy work for wasm32-unknown-unknown
33
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]
4-
5-
[env]
6-
# Limit test threads to avoid "too many open files" errors with mock servers
7-
RUST_TEST_THREADS = "1"

.github/copilot-instructions.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
> NOTE: Before using this guide, read the repository root `AGENTS.md` for authoritative agent instructions.
2+
3+
# Rain Orderbook – Agent Guide (Concise)
4+
5+
Always run commands via Nix: `nix develop -c <command>`. Never cancel long-running tasks (45–90 min builds, 30+ min tests).
6+
7+
## 1. Dependency readiness (quick check)
8+
```bash
9+
nix develop -c cargo build
10+
nix develop -c cargo build --target wasm32-unknown-unknown --lib -r --workspace \
11+
--exclude rain_orderbook_cli --exclude rain_orderbook_integration_tests
12+
nix develop -c npm install
13+
nix develop -c npm run build:orderbook
14+
nix develop -c npm run build:ui
15+
```
16+
17+
If any step fails due to earlier lint/test issues, use the fallback below.
18+
19+
## 2. Development loop
20+
- Edit code
21+
- Rebuild dependencies you touched:
22+
- Rust used by `@rainlanguage/orderbook``nix develop -c npm run build:orderbook`
23+
- `@rainlanguage/ui-components``nix develop -c npm run build -w @rainlanguage/ui-components`
24+
- Run targeted tests and lints for changed areas
25+
26+
## Reference: tests and lints by area
27+
28+
| Area | Build (if needed) | Lint/Check | Tests |
29+
|------|--------------------|------------|-------|
30+
| Rust crates (`crates/*`) | `nix develop -c cargo build` | `nix develop -c cargo clippy --workspace --all-targets --all-features -D warnings` | `nix develop -c cargo test --workspace` or `--package <crate>` |
31+
| Orderbook TS (`packages/orderbook`) | `nix develop -c npm run build:orderbook` | `nix develop -c npm run check -w @rainlanguage/orderbook` | `nix develop -c npm run test -w @rainlanguage/orderbook` |
32+
| UI components (`packages/ui-components`) | `nix develop -c npm run build -w @rainlanguage/ui-components` | `nix develop -c npm run svelte-lint-format-check -w @rainlanguage/ui-components` | `nix develop -c npm run test -w @rainlanguage/ui-components` |
33+
| Webapp (`packages/webapp`) | `nix develop -c npm run build -w @rainlanguage/webapp` | `nix develop -c npm run svelte-lint-format-check -w @rainlanguage/webapp` | `nix develop -c npm run test -w @rainlanguage/webapp` |
34+
| Solidity contracts | `nix develop -c forge build` || `nix develop -c forge test` |
35+
36+
## Frontend verification (required when frontend changes)
37+
38+
- If you modify frontend code or functionality affecting the frontend, you MUST provide a screenshot of the built webapp reflecting your change.
39+
- Build and preview:
40+
```bash
41+
nix develop -c npm run build -w @rainlanguage/webapp
42+
nix develop -c npm run preview -w @rainlanguage/webapp
43+
```
44+
- If you are unable to build the webapp, you MUST provide the concrete reasons and errors. Workarounds are not acceptable.
45+
46+
## 3. End-of-session gate (comprehensive)
47+
Partial commits are OK during the session. Before your final commit of the session, fully mirror CI:
48+
```bash
49+
./prep-all.sh
50+
nix develop -c npm run lint-format-check:all
51+
nix develop -c npm run build:orderbook # if Rust/orderbook changed
52+
nix develop -c npm run build:ui
53+
nix develop -c cargo test --workspace
54+
nix develop -c npm run test
55+
nix develop -c forge test
56+
```
57+
58+
## 4. Push gate (quick recheck)
59+
Do a short verification right before pushing:
60+
```bash
61+
nix develop -c npm run lint-format-check:all
62+
nix develop -c npm run test
63+
nix develop -c cargo test --workspace
64+
```
65+
66+
## Fallback if end-of-session `./prep-all.sh` fails early
67+
If the end-of-session gate fails during `./prep-all.sh`, run these steps sequentially so dependencies still build:
68+
```bash
69+
nix develop -c forge install
70+
nix develop -c bash -c '(cd lib/rain.interpreter && rainix-sol-prelude && rainix-rs-prelude && i9r-prelude)'
71+
nix develop -c bash -c '(cd lib/rain.interpreter/lib/rain.interpreter.interface/lib/rain.math.float && rainix-sol-prelude && rainix-rs-prelude)'
72+
nix develop -c bash -c '(cd lib/rain.interpreter/lib/rain.metadata && rainix-sol-prelude && rainix-rs-prelude)'
73+
nix develop -c rainix-sol-prelude && nix develop -c rainix-rs-prelude && nix develop -c raindex-prelude
74+
nix develop .#tauri-shell -c ob-tauri-prelude && nix develop .#tauri-shell -c ob-ui-components-prelude
75+
nix develop -c npm run build -w @rainlanguage/orderbook
76+
nix develop -c npm run build -w @rainlanguage/ui-components
77+
nix develop -c npm run build -w @rainlanguage/webapp
78+
```
79+
80+
Goal: all CI checks in `.github/workflows` pass. Be patient with long builds/tests and never commit with failing lint/tests.
81+
82+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Copilot Agent Setup
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
jobs:
12+
copilot-setup-steps:
13+
permissions:
14+
id-token: write
15+
contents: read
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
fetch-depth: 0
22+
23+
- uses: nixbuild/nix-quick-install-action@v30
24+
with:
25+
nix_conf: |
26+
keep-env-derivations = true
27+
keep-outputs = true
28+
29+
- name: Restore and save Nix store
30+
uses: nix-community/cache-nix-action@v6
31+
with:
32+
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
33+
restore-prefixes-first-match: nix-${{ runner.os }}-
34+
gc-max-store-size-linux: 1G
35+
36+
- name: Prepare environment files
37+
run: |
38+
set -euxo pipefail
39+
cp -f .env.example .env
40+
cp -f packages/webapp/.env.example packages/webapp/.env
41+
cp -f .env.example crates/common/.env
42+
43+
- name: Prepare repository dependencies
44+
run: ./prep-all.sh
45+
env:
46+
PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID || 'test' }}
47+
COMMIT_SHA: ${{ github.sha }}

.github/workflows/npm-package-release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ jobs:
6060
working-directory: lib/rain.interpreter/lib/rain.metadata
6161
- run: nix develop -c rainix-rs-prelude
6262
working-directory: lib/rain.interpreter/lib/rain.metadata
63+
- run: nix develop -c rainix-sol-prelude
64+
working-directory: lib/rain.interpreter/lib/rain.interpreter.interface/lib/rain.math.float
65+
- run: nix develop -c rainix-rs-prelude
66+
working-directory: lib/rain.interpreter/lib/rain.interpreter.interface/lib/rain.math.float
6367
- run: nix develop -c rainix-sol-prelude
6468
- run: nix develop -c rainix-rs-prelude
6569
- run: nix develop -c raindex-prelude
@@ -75,6 +79,17 @@ jobs:
7579
- name: Test UI Components
7680
run: nix develop -c npm run test -w @rainlanguage/ui-components
7781

82+
# check for npm package blacklists pkgs across all orderbook related packages
83+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
84+
85+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
86+
with:
87+
working-directory: packages/orderbook
88+
89+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
90+
with:
91+
working-directory: packages/ui-components
92+
7893
- name: Git Config
7994
run: |
8095
git config --global user.email "${{ secrets.CI_GIT_EMAIL }}"

.github/workflows/tauri-release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ jobs:
9999
COMMIT_SHA: ${{ github.sha }}
100100
SENTRY_LOG_LEVEL: debug
101101

102+
# check for npm package blacklists pkgs across all tauri related packages
103+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
104+
105+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
106+
with:
107+
working-directory: packages/orderbook
108+
109+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
110+
with:
111+
working-directory: packages/ui-components
112+
113+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
114+
with:
115+
working-directory: tauri-app
116+
102117
- uses: tauri-apps/tauri-action@v0
103118
env:
104119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tauri.yaml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,17 @@ jobs:
3434
if: matrix.os == 'ubuntu-22.04'
3535
run: |
3636
sudo apt-get clean
37-
sudo rm -rf "/usr/local/share/boost"
38-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
37+
sudo rm -rf \
38+
"$AGENT_TOOLSDIRECTORY" \
39+
/usr/local/lib/android \
40+
/usr/local/lib/node_modules \
41+
/usr/local/share/boost \
42+
/usr/local/share/chromium \
43+
/usr/local/share/powershell \
44+
/usr/share/dotnet \
45+
/opt/ghc
46+
sudo rm -rf "$HOME/.rustup/toolchains" "$HOME/.rustup/update-hashes"
47+
df -h /
3948
- name: Free up disk space in action runner (Macos)
4049
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
4150
run: |
@@ -91,10 +100,43 @@ jobs:
91100
- run: nix develop .#tauri-shell --command npm run svelte-lint-format-check
92101
working-directory: ./tauri-app
93102

103+
- name: Reset workspace target before Rust tests
104+
run: |
105+
rm -rf target
106+
rm -rf tauri-app/src-tauri/target
107+
108+
- name: Run Rust tests with reduced debug artifacts
109+
run: nix develop .#tauri-shell --command tauri-rs-test
110+
env:
111+
RUSTFLAGS: "-Cdebuginfo=0"
112+
CARGO_INCREMENTAL: 0
113+
114+
- run: |
115+
rm -rf target
116+
rm -rf tauri-app/src-tauri/target
117+
94118
- run: nix develop .#tauri-shell --command cargo tauri build --verbose
95119
working-directory: ./tauri-app
96120

97-
# remove test artifacts to free up space
98-
- run: rm -rf tauri-app/src-tauri/target/debug tauri-app/src-tauri/target/release
121+
- name: Reclaim workspace target artifacts
122+
run: |
123+
rm -rf target
124+
rm -rf tauri-app/build
99125
100-
- run: nix develop .#tauri-shell --command tauri-rs-test
126+
# remove release artifacts to free up space before checks
127+
- run: rm -rf tauri-app/src-tauri/target
128+
129+
# check for npm package blacklists pkgs across all tauri related packages
130+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
131+
132+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
133+
with:
134+
working-directory: packages/orderbook
135+
136+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
137+
with:
138+
working-directory: packages/ui-components
139+
140+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
141+
with:
142+
working-directory: tauri-app

.github/workflows/test-ui-components.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,17 @@ jobs:
4444
env:
4545
PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID || 'test' }}
4646

47-
- run: nix develop -c npm run svelte-lint-format-check
48-
working-directory: packages/ui-components
49-
- run: nix develop -c npm run test
50-
working-directory: packages/ui-components
47+
- run: nix develop -c npm run svelte-lint-format-check -w @rainlanguage/ui-components
48+
49+
- run: nix develop -c npm run test -w @rainlanguage/ui-components
50+
51+
# check for npm package blacklists pkgs across all packages
52+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
53+
54+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
55+
with:
56+
working-directory: packages/orderbook
57+
58+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
59+
with:
60+
working-directory: packages/ui-components

.github/workflows/test-webapp.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,25 @@ jobs:
4444
env:
4545
PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID || 'test' }}
4646

47-
- run: nix develop -c npm run svelte-lint-format-check
48-
working-directory: packages/webapp
47+
- run: nix develop -c npm run svelte-lint-format-check -w @rainlanguage/webapp
4948
env:
5049
PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID || 'test' }}
5150

52-
- run: nix develop -c npm run test
53-
working-directory: packages/webapp
51+
- run: nix develop -c npm run test -w @rainlanguage/webapp
5452
env:
5553
PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID || 'test' }}
54+
55+
# check for npm package blacklists pkgs across all packages
56+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
57+
58+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
59+
with:
60+
working-directory: packages/orderbook
61+
62+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
63+
with:
64+
working-directory: packages/ui-components
65+
66+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
67+
with:
68+
working-directory: packages/webapp

.github/workflows/vercel-preview-pr-target.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ jobs:
5959
env:
6060
PUBLIC_WALLETCONNECT_PROJECT_ID: test
6161

62+
# check for npm package blacklists pkgs across all packages
63+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
64+
65+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
66+
with:
67+
working-directory: packages/orderbook
68+
69+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
70+
with:
71+
working-directory: packages/ui-components
72+
6273
- name: Install Vercel CLI (local, pinned)
6374
shell: bash --noprofile --norc -euo pipefail {0}
6475
run: |

.github/workflows/vercel-preview.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ jobs:
6363
env:
6464
PUBLIC_WALLETCONNECT_PROJECT_ID: ${{ secrets.WALLETCONNECT_PROJECT_ID }}
6565

66+
# check for npm package blacklists pkgs across all packages
67+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
68+
69+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
70+
with:
71+
working-directory: packages/orderbook
72+
73+
- uses: rainlanguage/github-chore/.github/actions/npm-blacklist@main
74+
with:
75+
working-directory: packages/ui-components
76+
6677
- name: Install Vercel CLI (local, pinned)
6778
shell: bash --noprofile --norc -euo pipefail {0}
6879
run: |

0 commit comments

Comments
 (0)