From 1645865c5a768aaa428386edbcf5f4bb361fe8ab Mon Sep 17 00:00:00 2001 From: johba Date: Sun, 5 Oct 2025 19:40:14 +0200 Subject: [PATCH] first integration tests (#64) resolves #60 Co-authored-by: johba Reviewed-on: https://codeberg.org/johba/harb/pulls/64 --- AGENTS.md | 4 + containers/webapp-dev-entrypoint.sh | 2 +- issue.txt | 322 ---- package-lock.json | 130 ++ package.json | 10 +- playwright.config.ts | 17 + podman-compose.yml | 18 +- scripts/dev.sh | 79 +- services/ponder/package-lock.json | 1957 +----------------------- services/ponder/src/helpers/stats.ts | 5 + tests/e2e/01-acquire-and-stake.spec.ts | 154 ++ tests/setup/stack.ts | 141 ++ tests/setup/wallet-provider.ts | 207 +++ tests/verify-swap.sh | 93 ++ 14 files changed, 913 insertions(+), 2226 deletions(-) delete mode 100644 issue.txt create mode 100644 playwright.config.ts create mode 100644 tests/e2e/01-acquire-and-stake.spec.ts create mode 100644 tests/setup/stack.ts create mode 100644 tests/setup/wallet-provider.ts create mode 100755 tests/verify-swap.sh diff --git a/AGENTS.md b/AGENTS.md index de67d93..af5a423 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -12,6 +12,9 @@ ## Operating the Stack - Start everything with `nohup ./scripts/dev.sh start &` and stop via `./scripts/dev.sh stop`. Do not launch services individually. +- **Restart modes** for faster iteration: + - `./scripts/dev.sh restart --light` - Fast restart (~10-20s): only webapp + txnbot, preserves Anvil/Ponder state. Use for frontend changes. + - `./scripts/dev.sh restart --full` - Full restart (~3-4min): redeploys contracts, fresh state. Use for contract changes. - Supported environments: `BASE_SEPOLIA_LOCAL_FORK` (default Anvil fork), `BASE_SEPOLIA`, and `BASE`. Match contract addresses and RPCs accordingly. - The stack boots Anvil, deploys contracts, seeds liquidity, starts Ponder, launches the landing site, and runs the txnBot. Wait for logs to settle before manual testing. @@ -26,6 +29,7 @@ - Contracts: run `forge build`, `forge test`, and `forge snapshot` inside `onchain/`. - Fuzzing: scripts under `onchain/analysis/` (e.g., `./analysis/run-fuzzing.sh [optimizer] debugCSV`) generate replayable scenarios. - Integration: after the stack boots, inspect Anvil logs, hit `http://localhost:42069/graphql` for Ponder, and poll `http://127.0.0.1:43069/status` for txnBot health. +- **E2E Tests**: Playwright-based full-stack tests in `tests/e2e/` verify complete user journeys (mint ETH → swap KRK → stake). Run with `npm run test:e2e` from repo root. Tests use mocked wallet provider with Anvil accounts and automatically start/stop the stack. See `INTEGRATION_TEST_STATUS.md` and `SWAP_VERIFICATION.md` for details. ## Guardrails & Tips - `token0isWeth` flips amount semantics; confirm ordering before seeding or interpreting liquidity. diff --git a/containers/webapp-dev-entrypoint.sh b/containers/webapp-dev-entrypoint.sh index 0c5a239..c87c5ac 100755 --- a/containers/webapp-dev-entrypoint.sh +++ b/containers/webapp-dev-entrypoint.sh @@ -54,7 +54,7 @@ else fi export VITE_DEFAULT_CHAIN_ID=${VITE_DEFAULT_CHAIN_ID:-31337} -export VITE_LOCAL_RPC_URL=${VITE_LOCAL_RPC_URL:-/app/rpc/anvil} +export VITE_LOCAL_RPC_URL=${VITE_LOCAL_RPC_URL:-/rpc/anvil} export VITE_LOCAL_RPC_PROXY_TARGET=${VITE_LOCAL_RPC_PROXY_TARGET:-http://anvil:8545} export VITE_KRAIKEN_ADDRESS=$KRAIKEN export VITE_STAKE_ADDRESS=$STAKE diff --git a/issue.txt b/issue.txt deleted file mode 100644 index 807345c..0000000 --- a/issue.txt +++ /dev/null @@ -1,322 +0,0 @@ -# Implement Remaining Startup Optimizations - -## Problem -Three critical startup optimization features remain unimplemented: -1. **Sequential block mining** - Blocks are mined sequentially, blocking service startup -2. **No auto-reset on redeployment** - Ponder doesn't detect contract redeployment, causing block mismatch errors -3. **Missing graceful degradation** - Services crash when insufficient block history exists for ringbuffer calculations - -## Tasks - -### 1. Parallel Block Mining -**File:** `containers/bootstrap.sh` - -**Change:** Run `prime_chain()` in background to allow services to start while blocks are mined. - -**Before (lines 190-204):** -```bash -main() { - log "Waiting for Anvil" - wait_for_rpc - maybe_set_deployer_from_mnemonic - run_forge_script - extract_addresses - fund_liquidity_manager - grant_recenter_access - call_recenter - seed_application_state - prime_chain # <-- Blocks here - write_ponder_env - write_txn_bot_env - fund_txn_bot_wallet - log "Bootstrap complete" - # ... -} -``` - -**After:** -```bash -main() { - log "Waiting for Anvil" - wait_for_rpc - maybe_set_deployer_from_mnemonic - run_forge_script - extract_addresses - fund_liquidity_manager - grant_recenter_access - call_recenter - seed_application_state - write_ponder_env # <-- Write configs immediately - write_txn_bot_env # <-- Services can start now - fund_txn_bot_wallet - prime_chain & # <-- Background mining - local prime_pid=$! - log "Bootstrap complete (mining blocks in background)" - log "Kraiken: $KRAIKEN" - log "Stake: $STAKE" - log "LiquidityManager: $LIQUIDITY_MANAGER" - wait $prime_pid # <-- Wait before exiting - log "Block mining complete" -} -``` - ---- - -### 2. Auto-Reset Ponder Database on Redeployment -**File:** `containers/ponder-dev-entrypoint.sh` - -**Add:** Schema detection and automatic database reset when `START_BLOCK` changes. - -**Insert after line 13 (`cd "$PONDER_WORKDIR"`):** -```bash -# Load contract deployment info -source "$CONTRACT_ENV" -START_BLOCK=$(grep START_BLOCK "$ROOT_DIR/services/ponder/.env.local" 2>/dev/null | cut -d= -f2 || echo "") -EXPECTED_SCHEMA="ponder_local_${START_BLOCK}" - -# Check if schema changed (contract redeployment detected) -if [[ -f .env.local ]]; then - CURRENT_SCHEMA=$(grep DATABASE_SCHEMA .env.local 2>/dev/null | cut -d= -f2 || echo "") - - if [[ -n "$CURRENT_SCHEMA" && "$CURRENT_SCHEMA" != "$EXPECTED_SCHEMA" ]]; then - echo "[ponder-entrypoint] Contract redeployment detected (schema changed: $CURRENT_SCHEMA -> $EXPECTED_SCHEMA)" - echo "[ponder-entrypoint] Resetting Ponder database..." - - export PGPASSWORD=ponder_local - psql -h postgres -U ponder -d ponder_local -c \ - "DROP SCHEMA IF EXISTS \"$CURRENT_SCHEMA\" CASCADE;" 2>/dev/null || true - - echo "[ponder-entrypoint] Old schema dropped successfully" - fi -fi -``` - ---- - -### 3. Graceful Degradation for Insufficient Block History -**Files:** All Ponder event handlers that reference ringbuffer data - -**⚠️ IMPORTANT NAMING CORRECTION:** -All mentions of "VWAP" in Ponder code are **incorrect**. The data source is the **ringbuffer** in the contracts, not a traditional VWAP calculation. Update all references: -- `vwapPrice` → `ringbufferPrice` or `priceFromRingbuffer` -- `calculateVWAP()` → `calculateRingbufferPrice()` -- Comments mentioning "VWAP" → "ringbuffer price data" - -**Implementation pattern:** -```typescript -import { ponder } from "@/generated"; - -const MINIMUM_BLOCKS_FOR_RINGBUFFER = 100; - -ponder.on("Kraiken:Transfer", async ({ event, context }) => { - const { Stats } = context.db; - - // ... existing transfer logic ... - - // Check block history before calculating ringbuffer-dependent values - const currentBlock = event.block.number; - const deployBlock = BigInt(context.network.contracts.Kraiken.startBlock); - const blocksSinceDeployment = Number(currentBlock - deployBlock); - - if (blocksSinceDeployment < MINIMUM_BLOCKS_FOR_RINGBUFFER) { - // Not enough history - use spot price fallback - context.log.warn( - `Using spot price fallback (only ${blocksSinceDeployment} blocks available, need ${MINIMUM_BLOCKS_FOR_RINGBUFFER})` - ); - stats.ringbufferPrice = stats.currentPrice; // Fallback to spot - } else { - // Normal ringbuffer price calculation - stats.ringbufferPrice = await calculateRingbufferPrice(context); - } - - await Stats.update({ id: "0x01", data: stats }); -}); -``` - -**Apply this pattern to:** -- All event handlers that read contract ringbuffer data -- Any calculations depending on historical block data -- GraphQL resolvers that aggregate historical events - ---- - -## Testing Instructions - -### Setup -```bash -# Clean any existing state -./scripts/dev.sh stop -rm -rf tmp/podman .ponder - -# Ensure kraiken-lib is built -./scripts/build-kraiken-lib.sh -``` - -### Test 1: Parallel Block Mining -**Verify services start before mining completes** - -```bash -# Start stack -podman-compose up -d - -# Monitor logs in parallel -podman-compose logs -f bootstrap & -podman-compose logs -f ponder & - -# Expected behavior: -# 1. Bootstrap writes configs immediately after seeding -# 2. Ponder starts installing dependencies WHILE blocks are mining -# 3. Bootstrap log shows "Block mining complete" after other services start -# 4. Total startup time < 60 seconds -``` - -**Acceptance:** -- [ ] Ponder starts before "Block mining complete" appears in bootstrap logs -- [ ] All services healthy within 60 seconds: `podman-compose ps` - ---- - -### Test 2: Auto-Reset on Redeployment -**Verify Ponder detects and handles contract redeployment** - -```bash -# Initial deployment -podman-compose up -d -podman-compose logs ponder | grep "schema" # Note initial schema name - -# Wait for healthy -until podman-compose exec ponder wget -q -O- http://localhost:42069/ >/dev/null 2>&1; do sleep 2; done - -# Query initial data -curl -X POST http://localhost:42069/graphql \ - -H "Content-Type: application/json" \ - -d '{"query":"{ stats(id:\"0x01\"){kraikenTotalSupply}}"}' - -# Simulate redeployment: Stop and restart (forces new deployment) -./scripts/dev.sh stop -podman volume rm harb-health_postgres-data # Clear DB but keep schema files -podman-compose up -d - -# Check logs -podman-compose logs ponder | grep -E "redeployment|schema|Resetting" - -# Expected output: -# [ponder-entrypoint] Contract redeployment detected (schema changed: ponder_local_X -> ponder_local_Y) -# [ponder-entrypoint] Resetting Ponder database... -# [ponder-entrypoint] Old schema dropped successfully -``` - -**Acceptance:** -- [ ] Log shows "Contract redeployment detected" -- [ ] Log shows "Old schema dropped successfully" -- [ ] Ponder starts cleanly without block number errors -- [ ] GraphQL endpoint returns fresh data (no stale schema) - ---- - -### Test 3: Graceful Degradation -**Verify services don't crash with insufficient block history** - -```bash -# Start stack with default 2000 blocks -podman-compose up -d - -# Monitor Ponder startup logs -podman-compose logs -f ponder | grep -E "warn|error|fallback|blocks available" - -# Expected during early blocks (< 100): -# [ponder] WARN: Using spot price fallback (only 45 blocks available, need 100) - -# Query GraphQL early (before 100 blocks) -for i in {1..5}; do - curl -s -X POST http://localhost:42069/graphql \ - -H "Content-Type: application/json" \ - -d '{"query":"{ stats(id:\"0x01\"){ringbufferPrice currentPrice}}"}' - sleep 2 -done - -# Expected behavior: -# 1. Early queries show ringbufferPrice == currentPrice (fallback active) -# 2. No crash or error responses -# 3. After 100+ blocks, ringbufferPrice diverges from currentPrice (normal calculation) -``` - -**Acceptance:** -- [ ] No service crashes during startup -- [ ] Ponder logs show "Using spot price fallback" warnings -- [ ] GraphQL returns valid data even with <100 blocks -- [ ] After 100+ blocks, ringbuffer calculation activates automatically - ---- - -### Test 4: Full Integration Test -**End-to-end verification** - -```bash -# Clean start -./scripts/dev.sh stop -rm -rf tmp/podman .ponder services/ponder/.env.local -./scripts/build-kraiken-lib.sh - -# Start and time it -time podman-compose up -d - -# Wait for all services -./scripts/dev.sh status - -# Verify endpoints -curl http://localhost:42069/graphql -d '{"query":"{ stats(id:\"0x01\"){kraikenTotalSupply}}"}' -curl http://localhost:43069/status -curl -I http://localhost:8081/ - -# Check Ponder schema is correct -podman-compose exec ponder bash -c 'echo $DATABASE_SCHEMA' -# Should output: ponder_local_ - -# Verify no errors in logs -podman-compose logs | grep -i error -``` - -**Acceptance:** -- [ ] Total startup time < 60 seconds -- [ ] All services healthy (0 errors in logs) -- [ ] GraphQL returns valid data -- [ ] txnBot status endpoint responds -- [ ] Landing page loads at port 8081 - ---- - -## Naming Corrections Required - -**Search and replace across `services/ponder/src/`:** - -| Incorrect Name | Correct Name | Reason | -|----------------|--------------|--------| -| `vwapPrice` | `ringbufferPrice` | Data comes from contract ringbuffer, not VWAP | -| `calculateVWAP()` | `calculateRingbufferPrice()` | Not a traditional VWAP calculation | -| `// VWAP calculation` | `// Ringbuffer price data` | Avoid confusion with traditional VWAP | - -**Files to audit:** -```bash -grep -r "vwap\|VWAP" services/ponder/src/ -``` - -Update all matches to use `ringbuffer` terminology. - ---- - -## Acceptance Criteria Summary -- [ ] `bootstrap.sh` mines blocks in background -- [ ] Services start in parallel with block mining -- [ ] `ponder-dev-entrypoint.sh` detects schema changes -- [ ] Old Ponder schema auto-drops on redeployment -- [ ] Ponder event handlers have `MINIMUM_BLOCKS_FOR_RINGBUFFER` check -- [ ] Ringbuffer calculations fall back to spot price when insufficient data -- [ ] All "VWAP" references renamed to "ringbuffer" -- [ ] Full stack startup completes in <60 seconds -- [ ] No crashes with insufficient block history -- [ ] All integration tests pass - -## Dependencies -- `postgresql-client` already in `node-dev.Containerfile` ✅ -- `podman-compose.yml` already uses `service_started` condition ✅ diff --git a/package-lock.json b/package-lock.json index 482d053..09ad2f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,9 +6,17 @@ "": { "devDependencies": { "@playwright/test": "^1.55.1", + "ethers": "^6.11.1", + "husky": "^9.0.11", "playwright-mcp": "^0.0.12" } }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "dev": true + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.10", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.10.tgz", @@ -580,6 +588,30 @@ "node": ">=18" } }, + "node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dev": true, + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@playwright/test": { "version": "1.55.1", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.1.tgz", @@ -1842,6 +1874,12 @@ "node": ">= 0.6" } }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "dev": true + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2222,6 +2260,55 @@ "node": ">= 0.6" } }, + "node_modules/ethers": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.15.0.tgz", + "integrity": "sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "22.7.5", + "aes-js": "4.0.0-beta.5", + "tslib": "2.7.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "dev": true, + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/ethers/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "dev": true + }, + "node_modules/ethers/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, "node_modules/eventsource": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", @@ -2536,6 +2623,21 @@ "node": ">= 0.8" } }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -3815,6 +3917,13 @@ "node": ">= 0.6" } }, + "node_modules/undici-types": { + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.13.0.tgz", + "integrity": "sha512-Ov2Rr9Sx+fRgagJ5AX0qvItZG/JKKoBRAVITs1zk7IqZGTJUwgUr7qoYBpWwakpWilTZFM98rG/AFRocu10iIQ==", + "dev": true, + "optional": true + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -4023,6 +4132,27 @@ "dev": true, "license": "ISC" }, + "node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/yallist": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", diff --git a/package.json b/package.json index 5d5f2cd..3d86971 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,13 @@ { "devDependencies": { "@playwright/test": "^1.55.1", - "playwright-mcp": "^0.0.12" + "playwright-mcp": "^0.0.12", + "ethers": "^6.11.1", + "husky": "^9.0.11" }, "scripts": { - "prepare": "husky" - } + "prepare": "husky", + "test:e2e": "playwright test" + }, + "type": "module" } diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..26e95be --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,17 @@ +import { defineConfig } from '@playwright/test'; + +export default defineConfig({ + testDir: './tests/e2e', + testMatch: '**/*.spec.ts', + fullyParallel: false, + timeout: 5 * 60 * 1000, + expect: { + timeout: 30_000, + }, + retries: process.env.CI ? 1 : 0, + use: { + headless: true, + viewport: { width: 1280, height: 720 }, + actionTimeout: 0, + }, +}); diff --git a/podman-compose.yml b/podman-compose.yml index 1a619bf..f2cf9f2 100644 --- a/podman-compose.yml +++ b/podman-compose.yml @@ -8,9 +8,11 @@ services: - .:/workspace:z expose: - "8545" + ports: + - "127.0.0.1:8545:8545" restart: unless-stopped healthcheck: - test: ["CMD", "cast", "block-number", "--rpc-url", "http://localhost:8545"] + test: ["CMD", "cast", "block-number", "--rpc-url", "http://127.0.0.1:8545"] interval: 2s timeout: 1s retries: 5 @@ -78,9 +80,11 @@ services: condition: service_completed_successfully expose: - "42069" + ports: + - "127.0.0.1:42069:42069" restart: unless-stopped healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost:42069/"] + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:42069/"] interval: 5s timeout: 3s retries: 12 @@ -105,9 +109,11 @@ services: condition: service_healthy expose: - "5173" + ports: + - "127.0.0.1:5173:5173" restart: unless-stopped healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost:5173/app/"] + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:5173/app/"] interval: 5s retries: 6 start_period: 10s @@ -133,7 +139,7 @@ services: - "5174" restart: unless-stopped healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost:5174/"] + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:5174/"] interval: 5s retries: 6 start_period: 10s @@ -159,7 +165,7 @@ services: - "43069" restart: unless-stopped healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost:43069/status"] + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:43069/status"] interval: 5s retries: 4 start_period: 10s @@ -179,7 +185,7 @@ services: condition: service_healthy restart: unless-stopped healthcheck: - test: ["CMD", "wget", "--spider", "-q", "http://localhost:80"] + test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:80"] interval: 2s retries: 3 start_period: 2s diff --git a/scripts/dev.sh b/scripts/dev.sh index f51e3e5..12a9dc3 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -75,14 +75,77 @@ check_health() { done } +restart_light() { + echo "Light restart: webapp + txn-bot only..." + echo " Preserving Anvil state (contracts remain deployed)" + + local webapp_container txnbot_container + webapp_container=$(podman ps --all \ + --filter "label=com.docker.compose.project=${PROJECT_NAME}" \ + --filter "label=com.docker.compose.service=webapp" \ + --format '{{.Names}}' | head -n1) + + txnbot_container=$(podman ps --all \ + --filter "label=com.docker.compose.project=${PROJECT_NAME}" \ + --filter "label=com.docker.compose.service=txn-bot" \ + --format '{{.Names}}' | head -n1) + + if [[ -z "$webapp_container" ]]; then + echo "[!!] webapp container not found - run './scripts/dev.sh start' first" + exit 1 + fi + + local start_time=$(date +%s) + + echo " Restarting containers..." + podman restart "$webapp_container" >/dev/null + [[ -n "$txnbot_container" ]] && podman restart "$txnbot_container" >/dev/null + + echo " Waiting for webapp to be ready..." + local max_attempts=30 + local attempt=0 + while ((attempt < max_attempts)); do + if curl -s -f -o /dev/null http://localhost:5173/app/ 2>/dev/null; then + local end_time=$(date +%s) + local duration=$((end_time - start_time)) + echo "[ok] Light restart complete (~${duration}s)" + echo " Web App: http://localhost:8081/app/" + return 0 + fi + sleep 2 + ((attempt++)) + done + + echo "[!!] Webapp failed to respond after ${max_attempts} attempts" + exit 1 +} + +restart_full() { + echo "Full restart: all containers + bootstrap..." + stop_stack + start_stack + echo "[ok] Full restart complete" +} + usage() { cat <=18.0.0" } }, + "../../kraiken-lib": { + "version": "0.2.0", + "dependencies": { + "@apollo/client": "^3.9.10", + "graphql": "^16.8.1", + "graphql-tag": "^2.12.6" + }, + "devDependencies": { + "@graphql-codegen/cli": "^5.0.2", + "@graphql-codegen/client-preset": "^4.2.5", + "@graphql-codegen/typescript": "^4.0.6", + "@graphql-codegen/typescript-operations": "^4.2.0", + "@graphql-typed-document-node/core": "^3.2.0", + "@types/jest": "^29.5.12", + "@types/node": "^24.6.0", + "@typescript-eslint/eslint-plugin": "^8.45.0", + "@typescript-eslint/parser": "^8.45.0", + "eslint": "^9.36.0", + "husky": "^9.1.7", + "jest": "^29.7.0", + "lint-staged": "^16.2.3", + "prettier": "^3.6.2", + "ts-jest": "^29.1.2", + "typescript": "^5.4.3" + } + }, "node_modules/@adraffy/ens-normalize": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz", "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==", "license": "MIT" }, - "node_modules/@alcalzone/ansi-tokenize": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@alcalzone/ansi-tokenize/-/ansi-tokenize-0.1.3.tgz", - "integrity": "sha512-3yWxPTq3UQ/FY9p1ErPxIyfT64elWaMvM9lIHnaqpyft63tkxodF5aUElYHrdisWve5cETkh1+KBw1yJuW0aRw==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "is-fullwidth-code-point": "^4.0.0" - }, - "engines": { - "node": ">=14.13.1" - } - }, - "node_modules/@alcalzone/ansi-tokenize/node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@babel/code-frame": { "version": "7.27.1", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", @@ -97,7 +97,8 @@ "version": "0.2.13", "resolved": "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.2.13.tgz", "integrity": "sha512-YRY806NnScVqa21/1L1vaysSQ+0/cAva50z7vlwzaGiBOTS9JhdzIRHN0KfgMhobFAphbznZJ7urMso4RtMBIQ==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/@envelop/core": { "version": "5.3.2", @@ -1075,6 +1076,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -1088,6 +1090,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -1097,6 +1100,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -1106,161 +1110,12 @@ "node": ">= 8" } }, - "node_modules/@oclif/core": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-4.5.4.tgz", - "integrity": "sha512-78YYJls8+KG96tReyUsesKKIKqC0qbFSY1peUSrt0P2uGsrgAuU9axQ0iBQdhAlIwZDcTyaj+XXVQkz2kl/O0w==", - "license": "MIT", - "dependencies": { - "ansi-escapes": "^4.3.2", - "ansis": "^3.17.0", - "clean-stack": "^3.0.1", - "cli-spinners": "^2.9.2", - "debug": "^4.4.3", - "ejs": "^3.1.10", - "get-package-type": "^0.1.0", - "indent-string": "^4.0.0", - "is-wsl": "^2.2.0", - "lilconfig": "^3.1.3", - "minimatch": "^9.0.5", - "semver": "^7.6.3", - "string-width": "^4.2.3", - "supports-color": "^8", - "tinyglobby": "^0.2.14", - "widest-line": "^3.1.0", - "wordwrap": "^1.0.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@oclif/core/node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "license": "MIT", - "dependencies": { - "type-fest": "^0.21.3" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@oclif/core/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@oclif/core/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@oclif/core/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/@oclif/core/node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@oclif/core/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@oclif/core/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@oclif/core/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@oclif/core/node_modules/widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "license": "MIT", - "dependencies": { - "string-width": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@oclif/core/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/@opentelemetry/api": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=8.0.0" } @@ -1275,211 +1130,6 @@ "node": ">=14" } }, - "node_modules/@ponder/core": { - "version": "0.7.17", - "resolved": "https://registry.npmjs.org/@ponder/core/-/core-0.7.17.tgz", - "integrity": "sha512-PT4VE7jhXj1BZkXzv252N21egBhaGbWhxNi2tiQXIjPP+EF5KJob08iTQfhgfayoMxKMyw6+0DuxW7kYS8MYkA==", - "license": "MIT", - "dependencies": { - "@babel/code-frame": "^7.23.4", - "@commander-js/extra-typings": "^12.0.1", - "@electric-sql/pglite": "^0.2.5", - "@escape.tech/graphql-armor-max-aliases": "^2.3.0", - "@escape.tech/graphql-armor-max-depth": "^2.2.0", - "@escape.tech/graphql-armor-max-tokens": "^2.3.0", - "@hono/node-server": "1.13.3", - "@ponder/utils": "0.2.3", - "abitype": "^0.10.2", - "commander": "^12.0.0", - "conf": "^12.0.0", - "dataloader": "^2.2.2", - "detect-package-manager": "^3.0.2", - "dotenv": "^16.3.1", - "drizzle-orm": "0.36.4", - "glob": "^10.3.10", - "graphql": "^16.8.1", - "graphql-yoga": "^5.3.0", - "http-terminator": "^3.2.0", - "ink": "^4.4.1", - "kysely": "^0.26.3", - "kysely-pglite": "^0.6.0", - "pg": "^8.11.3", - "pg-connection-string": "^2.6.2", - "picocolors": "^1.0.0", - "pino": "^8.16.2", - "prom-client": "^15.0.0", - "react": "^18.2.0", - "stacktrace-parser": "^0.1.10", - "vite": "5.0.7", - "vite-node": "1.0.2", - "vite-tsconfig-paths": "4.3.1" - }, - "bin": { - "ponder": "dist/bin/ponder.js" - }, - "engines": { - "node": ">=18.14" - }, - "peerDependencies": { - "hono": ">=4.5", - "typescript": ">=5.0.4", - "viem": ">=2" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@ponder/core/node_modules/@ponder/utils": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@ponder/utils/-/utils-0.2.3.tgz", - "integrity": "sha512-QdlRXrn48nRM/QxNHRffO3PnIFvUf9qHE+rXSut44r74E4iiq9UrIPMhSMyCbJN68yU4QyTupZ/qpqE5PNAo8A==", - "license": "MIT", - "peerDependencies": { - "typescript": ">=5.0.4", - "viem": ">=2" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@ponder/core/node_modules/drizzle-orm": { - "version": "0.36.4", - "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.36.4.tgz", - "integrity": "sha512-1OZY3PXD7BR00Gl61UUOFihslDldfH4NFRH2MbP54Yxi0G/PKn4HfO65JYZ7c16DeP3SpM3Aw+VXVG9j6CRSXA==", - "license": "Apache-2.0", - "peerDependencies": { - "@aws-sdk/client-rds-data": ">=3", - "@cloudflare/workers-types": ">=3", - "@electric-sql/pglite": ">=0.2.0", - "@libsql/client": ">=0.10.0", - "@libsql/client-wasm": ">=0.10.0", - "@neondatabase/serverless": ">=0.10.0", - "@op-engineering/op-sqlite": ">=2", - "@opentelemetry/api": "^1.4.1", - "@planetscale/database": ">=1", - "@prisma/client": "*", - "@tidbcloud/serverless": "*", - "@types/better-sqlite3": "*", - "@types/pg": "*", - "@types/react": ">=18", - "@types/sql.js": "*", - "@vercel/postgres": ">=0.8.0", - "@xata.io/client": "*", - "better-sqlite3": ">=7", - "bun-types": "*", - "expo-sqlite": ">=14.0.0", - "knex": "*", - "kysely": "*", - "mysql2": ">=2", - "pg": ">=8", - "postgres": ">=3", - "react": ">=18", - "sql.js": ">=1", - "sqlite3": ">=5" - }, - "peerDependenciesMeta": { - "@aws-sdk/client-rds-data": { - "optional": true - }, - "@cloudflare/workers-types": { - "optional": true - }, - "@electric-sql/pglite": { - "optional": true - }, - "@libsql/client": { - "optional": true - }, - "@libsql/client-wasm": { - "optional": true - }, - "@neondatabase/serverless": { - "optional": true - }, - "@op-engineering/op-sqlite": { - "optional": true - }, - "@opentelemetry/api": { - "optional": true - }, - "@planetscale/database": { - "optional": true - }, - "@prisma/client": { - "optional": true - }, - "@tidbcloud/serverless": { - "optional": true - }, - "@types/better-sqlite3": { - "optional": true - }, - "@types/pg": { - "optional": true - }, - "@types/react": { - "optional": true - }, - "@types/sql.js": { - "optional": true - }, - "@vercel/postgres": { - "optional": true - }, - "@xata.io/client": { - "optional": true - }, - "better-sqlite3": { - "optional": true - }, - "bun-types": { - "optional": true - }, - "expo-sqlite": { - "optional": true - }, - "knex": { - "optional": true - }, - "kysely": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "pg": { - "optional": true - }, - "postgres": { - "optional": true - }, - "prisma": { - "optional": true - }, - "react": { - "optional": true - }, - "sql.js": { - "optional": true - }, - "sqlite3": { - "optional": true - } - } - }, - "node_modules/@ponder/core/node_modules/kysely": { - "version": "0.26.3", - "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.26.3.tgz", - "integrity": "sha512-yWSgGi9bY13b/W06DD2OCDDHQmq1kwTGYlQ4wpZkMOJqMGCstVCFIvxCCVG4KfY1/3G0MhDAcZsip/Lw8/vJWw==", - "license": "MIT", - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@ponder/utils": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/@ponder/utils/-/utils-0.2.13.tgz", @@ -1823,30 +1473,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/@sindresorhus/is": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.1.0.tgz", - "integrity": "sha512-7F/yz2IphV39hiS2zB4QYVkivrptHHh0K8qJJd9HhuWSdvf8AN7NpebW3CcDZDBQsUPMoDKWsY2WWgW7bqOcfA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@sindresorhus/merge-streams": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", - "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/@types/estree": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", @@ -1866,6 +1492,7 @@ "integrity": "sha512-gfehUI8N1z92kygssiuWvLiwcbOB3IRktR6hTDgJlXMYh5OvkPSRmgfoBUmfZt+vhwJtX7v1Yw4KvvAf7c5QKQ==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -1906,6 +1533,7 @@ "integrity": "sha512-TGf22kon8KW+DeKaUmOibKWktRY8b2NSAZNdtWh798COm1NWx8+xJ6iFBtk3IvLdv6+LGLJLRlyhrhEDZWargQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.45.0", "@typescript-eslint/types": "8.45.0", @@ -2186,50 +1814,6 @@ "node": ">=18.0.0" } }, - "node_modules/@wry/caches": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", - "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/context": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", - "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/equality": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", - "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@wry/trie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", - "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", - "dependencies": { - "tslib": "^2.3.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/abitype": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/abitype/-/abitype-0.10.3.tgz", @@ -2269,6 +1853,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2358,28 +1943,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/ansis": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/ansis/-/ansis-3.17.0.tgz", - "integrity": "sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==", - "license": "ISC", - "engines": { - "node": ">=14" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -2387,12 +1950,6 @@ "dev": true, "license": "Python-2.0" }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "license": "MIT" - }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -2411,18 +1968,6 @@ "when-exit": "^2.1.1" } }, - "node_modules/auto-bind": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/auto-bind/-/auto-bind-5.0.1.tgz", - "integrity": "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2449,18 +1994,6 @@ ], "license": "MIT" }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/bintrees": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", @@ -2480,6 +2013,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -2531,167 +2065,6 @@ "node": ">=6" } }, - "node_modules/chalk": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", - "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", - "license": "MIT", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "license": "MIT", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/ci-info": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", - "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/clean-stack": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-3.0.1.tgz", - "integrity": "sha512-lR9wNiMRcVQjSB3a7xXGLuz4cr4wJuuXlaAEbRutGowQTmlp7R72/DOgN21e8jdwblMWl9UOJMJXarX94pzKdg==", - "license": "MIT", - "dependencies": { - "escape-string-regexp": "4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-boxes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", - "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "license": "MIT", - "dependencies": { - "restore-cursor": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", - "license": "MIT", - "dependencies": { - "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate/node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate/node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/code-excerpt": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-4.0.0.tgz", - "integrity": "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA==", - "license": "MIT", - "dependencies": { - "convert-to-spaces": "^2.0.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2722,6 +2095,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "license": "MIT", + "peer": true, "engines": { "node": ">=18" } @@ -2730,6 +2104,7 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, "license": "MIT" }, "node_modules/conf": { @@ -2755,24 +2130,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "license": "MIT", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, - "node_modules/convert-to-spaces": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz", - "integrity": "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/copy-anything": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/copy-anything/-/copy-anything-3.0.5.tgz", @@ -2883,15 +2240,6 @@ "node": ">=12" } }, - "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/dot-prop": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-8.0.2.tgz", @@ -2919,21 +2267,6 @@ "url": "https://dotenvx.com" } }, - "node_modules/dotenv-expand": { - "version": "11.0.7", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-11.0.7.tgz", - "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==", - "license": "BSD-2-Clause", - "dependencies": { - "dotenv": "^16.4.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, "node_modules/drizzle-orm": { "version": "0.41.0", "resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.41.0.tgz", @@ -3070,21 +2403,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "license": "MIT" }, - "node_modules/ejs": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", - "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", - "license": "Apache-2.0", - "dependencies": { - "jake": "^10.8.5" - }, - "bin": { - "ejs": "bin/cli.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -3160,6 +2478,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -3174,6 +2493,7 @@ "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -3539,6 +2859,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3603,6 +2924,7 @@ "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -3621,31 +2943,11 @@ "node": ">=16.0.0" } }, - "node_modules/filelist": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", - "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", - "license": "Apache-2.0", - "dependencies": { - "minimatch": "^5.0.1" - } - }, - "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -3720,26 +3022,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/fs-extra": { - "version": "11.3.2", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.2.tgz", - "integrity": "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A==", - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "license": "ISC" - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -3754,15 +3036,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-east-asian-width": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz", @@ -3776,15 +3049,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "license": "MIT", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -3797,93 +3061,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/git-diff": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/git-diff/-/git-diff-2.0.6.tgz", - "integrity": "sha512-/Iu4prUrydE3Pb3lCBMbcSNIf81tgGt0W1ZwknnyF62t3tHmtiJTRj0f+1ZIhp3+Rh0ktz1pJVoa7ZXUCskivA==", - "license": "ISC", - "dependencies": { - "chalk": "^2.3.2", - "diff": "^3.5.0", - "loglevel": "^1.6.1", - "shelljs": "^0.8.1", - "shelljs.exec": "^1.1.7" - }, - "engines": { - "node": ">= 4.8.0" - } - }, - "node_modules/git-diff/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "license": "MIT", - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/git-diff/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/git-diff/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "license": "MIT", - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/git-diff/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "license": "MIT" - }, - "node_modules/git-diff/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "license": "MIT", - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/git-diff/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/git-diff/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "license": "MIT", - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -3908,6 +3085,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -3929,38 +3107,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz", - "integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==", - "license": "MIT", - "dependencies": { - "@sindresorhus/merge-streams": "^2.1.0", - "fast-glob": "^3.3.3", - "ignore": "^7.0.3", - "path-type": "^6.0.0", - "slash": "^5.1.0", - "unicorn-magic": "^0.3.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globrex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "license": "MIT" }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "license": "ISC" - }, "node_modules/graphemer": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", @@ -3973,24 +3125,11 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.11.0.tgz", "integrity": "sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw==", "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } }, - "node_modules/graphql-tag": { - "version": "2.12.6", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", - "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" - } - }, "node_modules/graphql-yoga": { "version": "5.16.0", "resolved": "https://registry.npmjs.org/graphql-yoga/-/graphql-yoga-5.16.0.tgz", @@ -4022,36 +3161,18 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dependencies": { - "react-is": "^16.7.0" - } - }, "node_modules/hono": { "version": "4.9.8", "resolved": "https://registry.npmjs.org/hono/-/hono-4.9.8.tgz", "integrity": "sha512-JW8Bb4RFWD9iOKxg5PbUarBYGM99IcxFl2FPBo2gSJO11jjUDqlP1Bmfyqt8Z/dGhIQ63PMA9LdcLefXyIasyg==", "license": "MIT", + "peer": true, "engines": { "node": ">=16.9.0" } @@ -4132,6 +3253,7 @@ "version": "7.0.5", "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, "license": "MIT", "engines": { "node": ">= 4" @@ -4164,175 +3286,11 @@ "node": ">=0.8.19" } }, - "node_modules/indent-string": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", - "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ink": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/ink/-/ink-4.4.1.tgz", - "integrity": "sha512-rXckvqPBB0Krifk5rn/5LvQGmyXwCUpBfmTwbkQNBY9JY8RSl3b8OftBNEYxg4+SWUhEKcPifgope28uL9inlA==", - "license": "MIT", - "dependencies": { - "@alcalzone/ansi-tokenize": "^0.1.3", - "ansi-escapes": "^6.0.0", - "auto-bind": "^5.0.1", - "chalk": "^5.2.0", - "cli-boxes": "^3.0.0", - "cli-cursor": "^4.0.0", - "cli-truncate": "^3.1.0", - "code-excerpt": "^4.0.0", - "indent-string": "^5.0.0", - "is-ci": "^3.0.1", - "is-lower-case": "^2.0.2", - "is-upper-case": "^2.0.2", - "lodash": "^4.17.21", - "patch-console": "^2.0.0", - "react-reconciler": "^0.29.0", - "scheduler": "^0.23.0", - "signal-exit": "^3.0.7", - "slice-ansi": "^6.0.0", - "stack-utils": "^2.0.6", - "string-width": "^5.1.2", - "type-fest": "^0.12.0", - "widest-line": "^4.0.1", - "wrap-ansi": "^8.1.0", - "ws": "^8.12.0", - "yoga-wasm-web": "~0.3.3" - }, - "engines": { - "node": ">=14.16" - }, - "peerDependencies": { - "@types/react": ">=18.0.0", - "react": ">=18.0.0", - "react-devtools-core": "^4.19.1" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react-devtools-core": { - "optional": true - } - } - }, - "node_modules/ink/node_modules/ansi-escapes": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", - "integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/ink/node_modules/type-fest": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.12.0.tgz", - "integrity": "sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "license": "MIT", - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "license": "MIT", - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -4351,6 +3309,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -4359,19 +3318,11 @@ "node": ">=0.10.0" } }, - "node_modules/is-lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-2.0.2.tgz", - "integrity": "sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.3" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" @@ -4389,15 +3340,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-2.0.2.tgz", - "integrity": "sha512-44pxmxAvnnAOwBg4tHPnkfvgjPwbc5QIsSstNU+YcJ1ovxVzCWpSGosPJOZh/a1tdl81fbgnLc9LLv+x2ywbPQ==", - "license": "MIT", - "dependencies": { - "tslib": "^2.0.3" - } - }, "node_modules/is-what": { "version": "4.1.16", "resolved": "https://registry.npmjs.org/is-what/-/is-what-4.1.16.tgz", @@ -4410,18 +3352,6 @@ "url": "https://github.com/sponsors/mesqueeb" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "license": "MIT", - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -4458,32 +3388,6 @@ "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/jake": { - "version": "10.9.4", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", - "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", - "license": "Apache-2.0", - "dependencies": { - "async": "^3.2.6", - "filelist": "^1.0.4", - "picocolors": "^1.1.1" - }, - "bin": { - "jake": "bin/cli.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/jiti": { - "version": "2.0.0-beta.3", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.0.0-beta.3.tgz", - "integrity": "sha512-pmfRbVRs/7khFrSAYnSiJ8C0D5GvzkE4Ey2pAvUcJsw1ly/p+7ut27jbJrjY79BpAJQJ4gXYFtK6d1Aub+9baQ==", - "license": "MIT", - "bin": { - "jiti": "lib/jiti-cli.mjs" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4529,18 +3433,6 @@ "dev": true, "license": "MIT" }, - "node_modules/jsonfile": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", - "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -4552,190 +3444,8 @@ } }, "node_modules/kraiken-lib": { - "version": "0.2.0", - "resolved": "file:../../kraiken-lib", - "dependencies": { - "@apollo/client": "^3.9.10", - "graphql": "^16.8.1", - "graphql-tag": "^2.12.6" - } - }, - "node_modules/kraiken-lib/node_modules/@apollo/client": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.14.0.tgz", - "integrity": "sha512-0YQKKRIxiMlIou+SekQqdCo0ZTHxOcES+K8vKB53cIDpwABNR0P0yRzPgsbgcj3zRJniD93S/ontsnZsCLZrxQ==", - "dependencies": { - "@graphql-typed-document-node/core": "^3.1.1", - "@wry/caches": "^1.0.0", - "@wry/equality": "^0.5.6", - "@wry/trie": "^0.5.0", - "graphql-tag": "^2.12.6", - "hoist-non-react-statics": "^3.3.2", - "optimism": "^0.18.0", - "prop-types": "^15.7.2", - "rehackt": "^0.1.0", - "symbol-observable": "^4.0.0", - "ts-invariant": "^0.10.3", - "tslib": "^2.3.0", - "zen-observable-ts": "^1.2.5" - }, - "peerDependencies": { - "graphql": "^15.0.0 || ^16.0.0", - "graphql-ws": "^5.5.5 || ^6.0.3", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc", - "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" - }, - "peerDependenciesMeta": { - "graphql-ws": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "subscriptions-transport-ws": { - "optional": true - } - } - }, - "node_modules/kysely": { - "version": "0.27.6", - "resolved": "https://registry.npmjs.org/kysely/-/kysely-0.27.6.tgz", - "integrity": "sha512-FIyV/64EkKhJmjgC0g2hygpBv5RNWVPyNCqSAD7eTCv6eFWNIi4PN1UvdSJGicN/o35bnevgis4Y0UDC0qi8jQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/kysely-codegen": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/kysely-codegen/-/kysely-codegen-0.15.0.tgz", - "integrity": "sha512-LPta2nQOyoEPDQ3w/Gsplc+2iyZPAsGvtWoS21VzOB0NDQ0B38Xy1gS8WlbGef542Zdw2eLJHxekud9DzVdNRw==", - "license": "MIT", - "dependencies": { - "chalk": "4.1.2", - "dotenv": "^16.4.5", - "dotenv-expand": "^11.0.6", - "git-diff": "^2.0.6", - "micromatch": "^4.0.5", - "minimist": "^1.2.8" - }, - "bin": { - "kysely-codegen": "dist/cli/bin.js" - }, - "peerDependencies": { - "@libsql/kysely-libsql": "^0.3.0", - "@tediousjs/connection-string": "^0.5.0", - "better-sqlite3": ">=7.6.2", - "kysely": "^0.27.0", - "kysely-bun-worker": "^0.5.3", - "mysql2": "^2.3.3 || ^3.0.0", - "pg": "^8.8.0", - "tarn": "^3.0.0", - "tedious": "^16.6.0 || ^17.0.0" - }, - "peerDependenciesMeta": { - "@libsql/kysely-libsql": { - "optional": true - }, - "@tediousjs/connection-string": { - "optional": true - }, - "better-sqlite3": { - "optional": true - }, - "kysely": { - "optional": false - }, - "kysely-bun-worker": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "pg": { - "optional": true - }, - "tarn": { - "optional": true - }, - "tedious": { - "optional": true - } - } - }, - "node_modules/kysely-codegen/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/kysely-codegen/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/kysely-codegen/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/kysely-pglite": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/kysely-pglite/-/kysely-pglite-0.6.1.tgz", - "integrity": "sha512-+q9FS6km6Y9yLLxe4SAMu4cQA3qIOSqdZ9uidVDU7g90Z/ZEjDhEKX/Rk5xug0HoGpCfMLHC2XGLqiVMZXqnRw==", - "license": "MIT", - "dependencies": { - "@oclif/core": "^4.0.19", - "@repeaterjs/repeater": "^3.0.6", - "@sindresorhus/is": "^7.0.0", - "chokidar": "^3.6.0", - "consola": "^3.2.3", - "fs-extra": "^11.2.0", - "globby": "^14.0.2", - "jiti": "2.0.0-beta.3", - "kysely-codegen": "^0.15.0", - "radash": "^12.1.0" - }, - "bin": { - "kpg": "bin/run.js", - "kysely-pglite": "bin/run.js" - }, - "peerDependencies": { - "@electric-sql/pglite": "*", - "kysely": "*" - } + "resolved": "../../kraiken-lib", + "link": true }, "node_modules/levn": { "version": "0.4.1", @@ -4751,18 +3461,6 @@ "node": ">= 0.8.0" } }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, "node_modules/lint-staged": { "version": "16.2.3", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.2.3.tgz", @@ -4942,12 +3640,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -5113,31 +3805,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/loglevel": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", - "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", - "license": "MIT", - "engines": { - "node": ">= 0.6.0" - }, - "funding": { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/loglevel" - } - }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "license": "MIT", - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -5154,6 +3821,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -5163,6 +3831,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -5212,15 +3881,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -5274,15 +3934,6 @@ "dev": true, "license": "MIT" }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -5295,14 +3946,6 @@ "node": ">=8" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -5318,15 +3961,6 @@ "node": ">=14.0.0" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/onetime": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", @@ -5351,17 +3985,6 @@ "node": ">=6" } }, - "node_modules/optimism": { - "version": "0.18.1", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.1.tgz", - "integrity": "sha512-mLXNwWPa9dgFyDqkNi54sjDyNJ9/fTI6WGBLgnXku1vdKY/jovHfZT5r+aiVeFFLOz+foPNOm5YJ4mqgld2GBQ==", - "dependencies": { - "@wry/caches": "^1.0.0", - "@wry/context": "^0.7.0", - "@wry/trie": "^0.5.0", - "tslib": "^2.3.0" - } - }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", @@ -5518,15 +4141,6 @@ "node": ">=6" } }, - "node_modules/patch-console": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/patch-console/-/patch-console-2.0.0.tgz", - "integrity": "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA==", - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -5537,15 +4151,6 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -5555,12 +4160,6 @@ "node": ">=8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "license": "MIT" - }, "node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", @@ -5577,18 +4176,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-type": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz", - "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", @@ -5600,6 +4187,7 @@ "resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz", "integrity": "sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==", "license": "MIT", + "peer": true, "dependencies": { "pg-connection-string": "^2.9.1", "pg-pool": "^3.10.1", @@ -5709,6 +4297,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "license": "MIT", "engines": { "node": ">=8.6" @@ -5958,16 +4547,6 @@ "node": "^16 || ^18 || >=20" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -5982,6 +4561,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -6004,48 +4584,6 @@ "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==", "license": "MIT" }, - "node_modules/radash": { - "version": "12.1.1", - "resolved": "https://registry.npmjs.org/radash/-/radash-12.1.1.tgz", - "integrity": "sha512-h36JMxKRqrAxVD8201FrCpyeNuUY9Y5zZwujr20fFO77tpUtGa6EZzfKw/3WaiBX95fq7+MpsuMLNdSnORAwSA==", - "license": "MIT", - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, - "node_modules/react-reconciler": { - "version": "0.29.2", - "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.29.2.tgz", - "integrity": "sha512-zZQqIiYgDCTP/f1N/mAR10nJGrPD2ZR+jDSEsKWJHYC7Cm2wodlwbR3upZRdC3cjIjSlTLNVyO7Iu0Yy7t2AYg==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - }, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "react": "^18.3.1" - } - }, "node_modules/readable-stream": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.7.0.tgz", @@ -6062,18 +4600,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, "node_modules/real-require": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", @@ -6083,34 +4609,6 @@ "node": ">= 12.13.0" } }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/rehackt": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", - "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", - "peerDependencies": { - "@types/react": "*", - "react": "*" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "react": { - "optional": true - } - } - }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", @@ -6120,26 +4618,6 @@ "node": ">=0.10.0" } }, - "node_modules/resolve": { - "version": "1.22.10", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", - "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", - "license": "MIT", - "dependencies": { - "is-core-module": "^2.16.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -6150,26 +4628,11 @@ "node": ">=4" } }, - "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "license": "MIT", - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -6242,6 +4705,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -6290,15 +4754,6 @@ "node": ">=10" } }, - "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - } - }, "node_modules/semver": { "version": "7.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", @@ -6338,121 +4793,12 @@ "node": ">=8" } }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "license": "BSD-3-Clause", - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/shelljs.exec": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/shelljs.exec/-/shelljs.exec-1.1.8.tgz", - "integrity": "sha512-vFILCw+lzUtiwBAHV8/Ex8JsFjelFMdhONIsgKNLgTzeRckp2AOYRQtHJE/9LhNvdMmE27AGtzWx0+DHpwIwSw==", - "license": "ISC", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/shelljs/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/shelljs/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/shelljs/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "license": "ISC" }, - "node_modules/slash": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", - "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/slice-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-6.0.0.tgz", - "integrity": "sha512-6bn4hRfkTvDfUoEQYkERg0BVF1D0vrX9HEkMl08uDiNWvVvjylLHvZFZWkDo6wjT8tUctbYl1nCOuE66ZTaUtA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "is-fullwidth-code-point": "^4.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/sonic-boom": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz", @@ -6480,27 +4826,6 @@ "node": ">= 10.x" } }, - "node_modules/stack-utils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", - "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", - "license": "MIT", - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/stacktrace-parser": { "version": "0.1.11", "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", @@ -6676,41 +5001,6 @@ "node": ">=16" } }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/symbol-observable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", - "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", - "engines": { - "node": ">=0.10" - } - }, "node_modules/tdigest": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", @@ -6741,55 +5031,11 @@ "real-require": "^0.2.0" } }, - "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.3" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -6811,17 +5057,6 @@ "typescript": ">=4.8.4" } }, - "node_modules/ts-invariant": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", - "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/tsconfck": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz", @@ -6879,6 +5114,7 @@ "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6906,27 +5142,6 @@ "devOptional": true, "license": "MIT" }, - "node_modules/unicorn-magic": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", - "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==", - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6954,6 +5169,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "@noble/curves": "1.9.1", "@noble/hashes": "1.8.0", @@ -7115,21 +5331,6 @@ "node": ">= 8" } }, - "node_modules/widest-line": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz", - "integrity": "sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==", - "license": "MIT", - "dependencies": { - "string-width": "^5.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -7140,12 +5341,6 @@ "node": ">=0.10.0" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "license": "MIT" - }, "node_modules/wrap-ansi": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", @@ -7237,17 +5432,12 @@ "node": ">=8" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "license": "ISC" - }, "node_modules/ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, @@ -7298,25 +5488,6 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } - }, - "node_modules/yoga-wasm-web": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/yoga-wasm-web/-/yoga-wasm-web-0.3.3.tgz", - "integrity": "sha512-N+d4UJSJbt/R3wqY7Coqs5pcV0aUj2j9IaQ3rNj9bVCLld8tTGKRa2USARjnvZJWVx1NDmQev8EknoczaOQDOA==", - "license": "MIT" - }, - "node_modules/zen-observable": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" - }, - "node_modules/zen-observable-ts": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", - "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", - "dependencies": { - "zen-observable": "0.8.15" - } } } } diff --git a/services/ponder/src/helpers/stats.ts b/services/ponder/src/helpers/stats.ts index bdc6896..a19da29 100644 --- a/services/ponder/src/helpers/stats.ts +++ b/services/ponder/src/helpers/stats.ts @@ -100,6 +100,11 @@ function computeProjections(ringBuffer: bigint[], pointer: number, timestamp: bi } export function checkBlockHistorySufficient(context: StatsContext, event: StatsEvent): boolean { + // Guard against incomplete context during initialization + if (!context?.network?.contracts?.Kraiken) { + return false; + } + const currentBlock = event.block.number; const deployBlock = DEPLOY_BLOCK; const blocksSinceDeployment = Number(currentBlock - deployBlock); diff --git a/tests/e2e/01-acquire-and-stake.spec.ts b/tests/e2e/01-acquire-and-stake.spec.ts new file mode 100644 index 0000000..b6ca254 --- /dev/null +++ b/tests/e2e/01-acquire-and-stake.spec.ts @@ -0,0 +1,154 @@ +import { expect, test, type APIRequestContext } from '@playwright/test'; +import { Wallet } from 'ethers'; +import { createWalletContext } from '../setup/wallet-provider'; +import { startStack, waitForStackReady, stopStack } from '../setup/stack'; + +const ACCOUNT_PRIVATE_KEY = '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'; +const ACCOUNT_ADDRESS = new Wallet(ACCOUNT_PRIVATE_KEY).address.toLowerCase(); +const STACK_RPC_URL = process.env.STACK_RPC_URL ?? 'http://127.0.0.1:8545'; +const STACK_WEBAPP_URL = process.env.STACK_WEBAPP_URL ?? 'http://localhost:5173'; +const STACK_GRAPHQL_URL = process.env.STACK_GRAPHQL_URL ?? 'http://localhost:42069/graphql'; + +async function fetchPositions(request: APIRequestContext, owner: string) { + const response = await request.post(STACK_GRAPHQL_URL, { + data: { + query: ` + query PositionsByOwner($owner: String!) { + positionss(where: { owner: $owner }, limit: 5) { + items { + id + owner + taxRate + stakeDeposit + status + } + } + } + `, + variables: { owner }, + }, + headers: { 'content-type': 'application/json' }, + }); + + expect(response.ok()).toBeTruthy(); + const payload = await response.json(); + return (payload?.data?.positionss?.items ?? []) as Array<{ + id: string; + owner: string; + taxRate: number; + stakeDeposit: string; + status: string; + }>; +} + +test.describe('Acquire & Stake', () => { + test.beforeAll(async () => { + await startStack(); + await waitForStackReady({ + rpcUrl: STACK_RPC_URL, + webAppUrl: STACK_WEBAPP_URL, + graphqlUrl: STACK_GRAPHQL_URL, + }); + }); + + test.afterAll(async () => { + await stopStack(); + }); + + test('users can swap KRK via UI', async ({ browser, request }) => { + console.log('[TEST] Creating wallet context...'); + const context = await createWalletContext(browser, { + privateKey: ACCOUNT_PRIVATE_KEY, + rpcUrl: STACK_RPC_URL, + }); + + const page = await context.newPage(); + + // Log browser console messages + page.on('console', msg => console.log(`[BROWSER] ${msg.type()}: ${msg.text()}`)); + page.on('pageerror', error => console.log(`[BROWSER ERROR] ${error.message}`)); + + try { + console.log('[TEST] Loading app...'); + await page.goto(`${STACK_WEBAPP_URL}/app/`, { waitUntil: 'domcontentloaded' }); + console.log('[TEST] App loaded, waiting for wallet to initialize...'); + + // Wait for wallet to be fully recognized + await page.waitForTimeout(3_000); + + // Check if wallet shows as connected in UI + console.log('[TEST] Checking for wallet display...'); + const walletDisplay = page.getByText(/0xf39F/i).first(); + await expect(walletDisplay).toBeVisible({ timeout: 15_000 }); + console.log('[TEST] Wallet connected successfully!'); + + console.log('[TEST] Navigating to cheats page...'); + await page.goto(`${STACK_WEBAPP_URL}/app/#/cheats`); + await expect(page.getByRole('heading', { name: 'Cheat Console' })).toBeVisible(); + + console.log('[TEST] Minting test ETH...'); + await page.getByLabel('RPC URL').fill(STACK_RPC_URL); + await page.getByLabel('Recipient').fill(ACCOUNT_ADDRESS); + const mintButton = page.getByRole('button', { name: 'Mint' }); + await expect(mintButton).toBeEnabled(); + await mintButton.click(); + await page.waitForTimeout(3_000); + + console.log('[TEST] Buying KRK tokens via swap...'); + await page.screenshot({ path: 'test-results/before-swap.png' }); + + // Check if swap is available + const buyWarning = await page.getByText('Connect to the Base Sepolia fork').isVisible().catch(() => false); + if (buyWarning) { + throw new Error('Swap not available - chain config issue persists'); + } + + const ethToSpendInput = page.getByLabel('ETH to spend'); + await ethToSpendInput.fill('0.05'); + + const buyButton = page.getByRole('button', { name: 'Buy' }).last(); + await expect(buyButton).toBeVisible(); + console.log('[TEST] Clicking Buy button...'); + await buyButton.click(); + + // Wait for button to show "Submitting..." then return to "Buy" + console.log('[TEST] Waiting for swap to process...'); + try { + await page.getByRole('button', { name: /Submitting/i }).waitFor({ state: 'visible', timeout: 5_000 }); + console.log('[TEST] Swap initiated, waiting for completion...'); + await page.getByRole('button', { name: 'Buy' }).last().waitFor({ state: 'visible', timeout: 60_000 }); + console.log('[TEST] Swap completed!'); + } catch (e) { + console.log('[TEST] No "Submitting" state detected, swap may have completed instantly'); + } + await page.waitForTimeout(2_000); + + console.log('[TEST] Verifying swap via RPC...'); + // Query the blockchain directly to verify KRK balance increased + const balanceResponse = await fetch(STACK_RPC_URL, { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ + jsonrpc: '2.0', + id: 1, + method: 'eth_call', + params: [{ + to: '0xe527ddac2592faa45884a0b78e4d377a5d3df8cc', // KRK token + data: `0x70a08231000000000000000000000000${ACCOUNT_ADDRESS.slice(2)}` // balanceOf(address) + }, 'latest'] + }) + }); + + const balanceData = await balanceResponse.json(); + const balance = BigInt(balanceData.result || '0'); + console.log(`[TEST] KRK balance: ${balance.toString()} wei`); + + expect(balance).toBeGreaterThan(0n); + console.log('[TEST] ✅ Swap successful! KRK balance > 0'); + console.log('[TEST] ✅ E2E test complete: Swap verified through UI'); + console.log('[TEST] Note: Staking is verified separately via verify-swap.sh script'); + } finally { + await context.close(); + } + }); +}); diff --git a/tests/setup/stack.ts b/tests/setup/stack.ts new file mode 100644 index 0000000..ac228d9 --- /dev/null +++ b/tests/setup/stack.ts @@ -0,0 +1,141 @@ +import { exec as execCallback } from 'node:child_process'; +import { readFile } from 'node:fs/promises'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { promisify } from 'node:util'; + +const exec = promisify(execCallback); + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const repoRoot = resolve(__dirname, '..', '..'); + +const DEFAULT_RPC_URL = process.env.STACK_RPC_URL ?? 'http://127.0.0.1:8545'; +const DEFAULT_WEBAPP_URL = process.env.STACK_WEBAPP_URL ?? 'http://localhost:5173'; +const DEFAULT_GRAPHQL_URL = process.env.STACK_GRAPHQL_URL ?? 'http://localhost:42069/graphql'; + +let stackStarted = false; + +async function cleanupContainers(): Promise { + try { + await run("podman pod ps -q --filter name=harb | xargs -r podman pod rm -f || true"); + await run("podman ps -aq --filter name=harb | xargs -r podman rm -f || true"); + } catch (error) { + console.warn('[stack] Failed to cleanup containers', error); + } +} + +function delay(ms: number): Promise { + return new Promise(resolveDelay => setTimeout(resolveDelay, ms)); +} + +async function run(command: string): Promise { + await exec(command, { cwd: repoRoot, shell: true }); +} + +async function checkRpcReady(rpcUrl: string): Promise { + const response = await fetch(rpcUrl, { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'eth_chainId', params: [] }), + }); + + if (!response.ok) { + throw new Error(`RPC health check failed with status ${response.status}`); + } + + const payload = await response.json(); + if (!payload?.result) { + throw new Error('RPC health check returned no result'); + } +} + +async function checkWebAppReady(webAppUrl: string): Promise { + const url = webAppUrl.endsWith('/') ? `${webAppUrl}app/` : `${webAppUrl}/app/`; + const response = await fetch(url, { + method: 'GET', + redirect: 'manual', + }); + + if (!response.ok && response.status !== 308) { + throw new Error(`Web app health check failed with status ${response.status}`); + } +} + +async function checkGraphqlReady(graphqlUrl: string): Promise { + const response = await fetch(graphqlUrl, { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ query: '{ __typename }' }), + }); + + if (!response.ok) { + throw new Error(`GraphQL health check failed with status ${response.status}`); + } +} + +export async function startStack(): Promise { + if (stackStarted) { + return; + } + + await cleanupContainers(); + + await run('nohup ./scripts/dev.sh start > ./tests/.stack.log 2>&1 &'); + stackStarted = true; +} + +export async function waitForStackReady(options: { + rpcUrl?: string; + webAppUrl?: string; + graphqlUrl?: string; + timeoutMs?: number; + pollIntervalMs?: number; +} = {}): Promise { + const rpcUrl = options.rpcUrl ?? DEFAULT_RPC_URL; + const webAppUrl = options.webAppUrl ?? DEFAULT_WEBAPP_URL; + const graphqlUrl = options.graphqlUrl ?? DEFAULT_GRAPHQL_URL; + const timeoutMs = options.timeoutMs ?? 180_000; + const pollIntervalMs = options.pollIntervalMs ?? 2_000; + + const start = Date.now(); + const errors = new Map(); + + while (Date.now() - start < timeoutMs) { + try { + await Promise.all([ + checkRpcReady(rpcUrl), + checkWebAppReady(webAppUrl), + checkGraphqlReady(graphqlUrl), + ]); + return; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + errors.set('lastError', message); + await delay(pollIntervalMs); + } + } + + const logPath = resolve(repoRoot, 'tests', '.stack.log'); + let logTail = ''; + try { + const contents = await readFile(logPath, 'utf-8'); + logTail = contents.split('\n').slice(-40).join('\n'); + } catch (readError) { + logTail = `Unable to read stack log: ${readError}`; + } + + throw new Error(`Stack failed to become ready within ${timeoutMs}ms\nLast error: ${errors.get('lastError')}\nLog tail:\n${logTail}`); +} + +export async function stopStack(): Promise { + if (!stackStarted) { + return; + } + + try { + await run('./scripts/dev.sh stop'); + } finally { + stackStarted = false; + } +} diff --git a/tests/setup/wallet-provider.ts b/tests/setup/wallet-provider.ts new file mode 100644 index 0000000..2669e33 --- /dev/null +++ b/tests/setup/wallet-provider.ts @@ -0,0 +1,207 @@ +import type { Browser, BrowserContext } from '@playwright/test'; +import { Wallet } from 'ethers'; + +export interface WalletProviderOptions { + privateKey: string; + rpcUrl?: string; + chainId?: number; + chainName?: string; + walletName?: string; + walletUuid?: string; +} + +const DEFAULT_CHAIN_ID = 31337; +const DEFAULT_RPC_URL = 'http://127.0.0.1:8545'; +const DEFAULT_WALLET_NAME = 'Playwright Wallet'; +const DEFAULT_WALLET_UUID = '11111111-2222-3333-4444-555555555555'; + +export async function createWalletContext( + browser: Browser, + options: WalletProviderOptions, +): Promise { + const chainId = options.chainId ?? DEFAULT_CHAIN_ID; + const rpcUrl = options.rpcUrl ?? DEFAULT_RPC_URL; + const chainName = options.chainName ?? 'Kraiken Local Fork'; + const walletName = options.walletName ?? DEFAULT_WALLET_NAME; + const walletUuid = options.walletUuid ?? DEFAULT_WALLET_UUID; + + const wallet = new Wallet(options.privateKey); + const address = wallet.address; + const chainIdHex = `0x${chainId.toString(16)}`; + + const context = await browser.newContext(); + + await context.addInitScript(() => { + window.localStorage.setItem('authentificated', 'true'); + }); + + await context.addInitScript( + ({ + account, + chainIdHex: cidHex, + chainId: cid, + rpcEndpoint, + chainLabel, + walletLabel, + walletId, + }) => { + const listeners = new Map void>>(); + let rpcRequestId = 0; + let connected = false; + + const emit = (event: string, payload: any): void => { + const handlers = listeners.get(event); + if (!handlers) { + return; + } + for (const handler of Array.from(handlers)) { + try { + handler(payload); + } catch (error) { + console.error(`[wallet-provider] listener for ${event} failed`, error); + } + } + }; + + const sendRpc = async (method: string, params: unknown[]): Promise => { + rpcRequestId += 1; + const response = await fetch(rpcEndpoint, { + method: 'POST', + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ jsonrpc: '2.0', id: rpcRequestId, method, params }), + }); + + if (!response.ok) { + throw new Error(`RPC call to ${method} failed with status ${response.status}`); + } + + const payload = await response.json(); + if (payload?.error) { + const message = payload.error?.message ?? 'RPC error'; + throw new Error(message); + } + return payload.result; + }; + + const provider: any = { + isMetaMask: true, + isPlaywrightWallet: true, + isConnected: () => connected, + selectedAddress: account, + chainId: cidHex, + networkVersion: String(cid), + request: async ({ method, params = [] }: { method: string; params?: unknown[] }) => { + const args = Array.isArray(params) ? params.slice() : []; + + switch (method) { + case 'eth_requestAccounts': + connected = true; + provider.selectedAddress = account; + provider.chainId = cidHex; + provider.networkVersion = String(cid); + emit('connect', { chainId: cidHex }); + emit('chainChanged', cidHex); + emit('accountsChanged', [account]); + return [account]; + case 'eth_accounts': + return [account]; + case 'eth_chainId': + return cidHex; + case 'net_version': + return String(cid); + case 'wallet_switchEthereumChain': { + const requested = (args[0] as { chainId?: string } | undefined)?.chainId; + if (requested && requested.toLowerCase() !== cidHex.toLowerCase()) { + throw new Error(`Unsupported chain ${requested}`); + } + return null; + } + case 'wallet_addEthereumChain': + return null; + case 'eth_sendTransaction': { + const [tx = {}] = args as Record[]; + const enrichedTx = { ...tx, from: account }; + return sendRpc(method, [enrichedTx]); + } + case 'eth_sign': + case 'personal_sign': + case 'eth_signTypedData': + case 'eth_signTypedData_v3': + case 'eth_signTypedData_v4': { + if (args.length > 0) { + args[0] = account; + } + return sendRpc(method, args); + } + default: + return sendRpc(method, args); + } + }, + on: (event: string, listener: (...args: any[]) => void) => { + const handlers = listeners.get(event) ?? new Set(); + handlers.add(listener); + listeners.set(event, handlers); + if (event === 'connect' && connected) { + listener({ chainId: cidHex }); + } + return provider; + }, + removeListener: (event: string, listener: (...args: any[]) => void) => { + const handlers = listeners.get(event); + if (handlers) { + handlers.delete(listener); + } + return provider; + }, + enable: () => provider.request({ method: 'eth_requestAccounts' }), + requestPermissions: () => + Promise.resolve([{ parentCapability: 'eth_accounts' }]), + getProviderState: async () => ({ + accounts: [account], + chainId: cidHex, + isConnected: connected, + }), + }; + + const announce = () => { + const detail = Object.freeze({ + info: Object.freeze({ + uuid: walletId, + name: walletLabel, + icon: 'data:image/svg+xml,', + rdns: 'org.playwright.wallet', + }), + provider, + }); + window.dispatchEvent(new CustomEvent('eip6963:announceProvider', { detail })); + }; + + const requestListener = () => announce(); + window.addEventListener('eip6963:requestProvider', requestListener); + + Object.defineProperty(window, 'ethereum', { + configurable: true, + enumerable: true, + value: provider, + writable: false, + }); + + provider.providers = [provider]; + + announce(); + window.dispatchEvent(new Event('ethereum#initialized')); + console.info('[wallet-provider] Injected test provider for', chainLabel); + }, + { + account: address, + chainIdHex, + chainId, + rpcEndpoint: rpcUrl, + chainLabel: chainName, + walletLabel: walletName, + walletId: walletUuid, + }, + ); + + return context; +} diff --git a/tests/verify-swap.sh b/tests/verify-swap.sh new file mode 100755 index 0000000..755fc35 --- /dev/null +++ b/tests/verify-swap.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +set -euo pipefail + +RPC_URL="http://127.0.0.1:8545" +ACCOUNT="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" +WETH="0x4200000000000000000000000000000000000006" +SWAP_ROUTER="0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4" +KRK="0xe527ddac2592faa45884a0b78e4d377a5d3df8cc" # From bootstrap logs + +# Get Stake contract address dynamically from KRK token +PERIPHERY=$(cast call --rpc-url "$RPC_URL" "$KRK" "peripheryContracts()(address,address)") +STAKE=$(echo "$PERIPHERY" | tail -1) + +echo "[1/7] Checking initial KRK balance..." +INITIAL_BALANCE=$(cast call --rpc-url "$RPC_URL" "$KRK" "balanceOf(address)(uint256)" "$ACCOUNT" | awk '{print $1}') +echo "Initial KRK balance: $INITIAL_BALANCE" + +echo "[2/7] Wrapping 0.05 ETH to WETH..." +cast send --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" \ + "$WETH" "deposit()" --value 0.05ether + +echo "[3/7] Approving swap router..." +cast send --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" \ + "$WETH" "approve(address,uint256)" "$SWAP_ROUTER" 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + +echo "[4/7] Executing swap (0.05 ETH -> KRK)..." +cast send --legacy --gas-limit 300000 --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" \ + "$SWAP_ROUTER" "exactInputSingle((address,address,uint24,address,uint256,uint256,uint160))" \ + "($WETH,$KRK,10000,$ACCOUNT,50000000000000000,0,0)" + +echo "[5/7] Checking final KRK balance..." +FINAL_BALANCE=$(cast call --rpc-url "$RPC_URL" "$KRK" "balanceOf(address)(uint256)" "$ACCOUNT" | awk '{print $1}') +echo "Final KRK balance: $FINAL_BALANCE" + +# Convert to human readable (divide by 10^18) +FINAL_KRK=$(python3 -c "print(f'{$FINAL_BALANCE / 1e18:.4f}')") +echo "Final KRK balance: $FINAL_KRK KRK" + +if [ "$FINAL_BALANCE" -le "$INITIAL_BALANCE" ]; then + echo "❌ FAILED: No KRK tokens received" + exit 1 +fi + +RECEIVED=$(python3 -c "print(f'{($FINAL_BALANCE - $INITIAL_BALANCE) / 1e18:.4f}')") +echo "✅ SUCCESS! Received $RECEIVED KRK tokens from swap" + +# Calculate 1/5 of received tokens for staking +STAKE_AMOUNT=$(python3 -c "print(int(($FINAL_BALANCE - $INITIAL_BALANCE) / 5))") +echo "" +echo "[6/7] Staking 1/5 of received KRK ($STAKE_AMOUNT wei)..." + +# Approve Stake contract to spend KRK +echo " → Approving Stake contract..." +cast send --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" \ + "$KRK" "approve(address,uint256)" "$STAKE" "$STAKE_AMOUNT" + +# Stake with tax rate index 5 (18% annual tax), no positions to snatch +echo " → Creating staking position (18% tax rate)..." +TX_OUTPUT=$(cast send --legacy --gas-limit 500000 --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" \ + "$STAKE" "snatch(uint256,address,uint32,uint256[])" \ + "$STAKE_AMOUNT" "$ACCOUNT" "5" "[]") + +TX_HASH=$(echo "$TX_OUTPUT" | grep "^transactionHash" | awk '{print $2}') +echo " → Staking transaction: $TX_HASH" + +echo "[7/7] Verifying staking position created..." +# Get the PositionCreated event topic from the transaction receipt +# The position ID is the first indexed parameter (topic[1]) +RECEIPT_JSON=$(cast receipt --rpc-url "$RPC_URL" "$TX_HASH" --json) +POSITION_ID_HEX=$(echo "$RECEIPT_JSON" | python3 -c "import sys, json; logs = json.load(sys.stdin)['logs']; print([l for l in logs if len(l['topics']) > 1 and '8f7598451bc034be2bd3fe6e2f06af052c2dc238bb90bc6fb426754f04301462' in l['topics'][0]][0]['topics'][1] if any('8f7598451bc034be2bd3fe6e2f06af052c2dc238bb90bc6fb426754f04301462' in l['topics'][0] for l in logs) else '')" 2>/dev/null || echo "") + +if [ -n "$POSITION_ID_HEX" ]; then + POSITION_ID=$(python3 -c "print(int('$POSITION_ID_HEX', 16))") + STAKE_KRK=$(python3 -c "print(f'{$STAKE_AMOUNT / 1e18:.4f}')") + echo "✅ SUCCESS! Staking position created with ID: $POSITION_ID" + echo "" + echo "Summary:" + echo " - Swapped: 0.05 ETH → $RECEIVED KRK" + echo " - Staked: $STAKE_KRK KRK (1/5 of received)" + echo " - Position ID: $POSITION_ID" + echo " - Tax Rate: 18% annual" + exit 0 +else + echo "⚠️ WARNING: Could not extract position ID from receipt" + echo "But staking transaction succeeded: $TX_HASH" + echo "" + echo "Summary:" + echo " - Swapped: 0.05 ETH → $RECEIVED KRK" + echo " - Staked: 1/5 of received KRK" + echo " - Transaction: $TX_HASH" + exit 0 +fi