diff --git a/.github/actions/setup-node-and-deps/action.yml b/.github/actions/setup-node-and-deps/action.yml index f22f12e..0271758 100644 --- a/.github/actions/setup-node-and-deps/action.yml +++ b/.github/actions/setup-node-and-deps/action.yml @@ -10,27 +10,15 @@ inputs: runs: using: composite steps: - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ inputs.node-version }} - - name: Enable Corepack shell: bash run: corepack enable - - name: Get yarn cache directory path - id: yarn-cache-dir-path - shell: bash - run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT - - - name: Cache yarn dependencies - uses: actions/cache@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + node-version: ${{ inputs.node-version }} + cache: yarn - name: Cache Turbo uses: actions/cache@v4 @@ -43,3 +31,7 @@ runs: - name: Install dependencies shell: bash run: yarn install --immutable + + - name: Build workspace packages + shell: bash + run: yarn turbo run build --filter='./packages/*' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a06ddf..4f1d7c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: pull_request: branches: - - main + - develop env: NODE_VERSION: '22.5.1' @@ -25,8 +25,6 @@ jobs: - name: Lint run: yarn lint - continue-on-error: true - name: Run tests run: yarn test - continue-on-error: true diff --git a/.gitignore b/.gitignore index 12a6b26..9abd83e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,68 +1,28 @@ -# compiled output +# Build artifacts dist node_modules -build .turbo +/generated/prisma -# TypeScript compiled JS alongside source (use dist/ instead) -apps/*/src/**/*.js -packages/*/src/**/*.js - +# Yarn (Berry) .yarn/* !.yarn/patches !.yarn/plugins !.yarn/sdks -# Logs -logs -*.log -npm-debug.log* -pnpm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# OS -.DS_Store - -# Tests -/coverage -/.nyc_output - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json +# Caches +.eslintcache -# dotenv environment variable files +# Env files .env* !.env.example -# temp directory -.temp -.tmp - -# Runtime data -pids -*.pid -*.seed -*.pid.lock +# OS +.DS_Store -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +# Editors +.vscode/ -Pulumi.*.yaml -/generated/prisma -*.db -.eslintcache +# Claude Code (local-only) +.claude/settings.local.json +.claude/worktrees/ diff --git a/apps/swap-service/src/verification/__tests__/fixtures/near/response.json b/apps/swap-service/src/verification/__tests__/fixtures/near/response.json index d10f279..06b747e 100644 --- a/apps/swap-service/src/verification/__tests__/fixtures/near/response.json +++ b/apps/swap-service/src/verification/__tests__/fixtures/near/response.json @@ -6,13 +6,8 @@ "depositedAmount": "1000000000000000", "depositedAmountUsd": "2.2886", "depositedAmountFormatted": "0.001", - "intentHashes": [ - "CyGhYmfjXbN7MAJLS5dpR2p8ANnuuXDGC5qCmFr1NGZT" - ], - "nearTxHashes": [ - "58TKUK7G2RGmR2YEKuqyQaxRfkQVH5XupDUnsXUj4dVH", - "GJxyXn2QihLDLC3JoRESSesj3ufdz1yhbMAzqZ5TfKHK" - ], + "intentHashes": ["CyGhYmfjXbN7MAJLS5dpR2p8ANnuuXDGC5qCmFr1NGZT"], + "nearTxHashes": ["58TKUK7G2RGmR2YEKuqyQaxRfkQVH5XupDUnsXUj4dVH", "GJxyXn2QihLDLC3JoRESSesj3ufdz1yhbMAzqZ5TfKHK"], "amountIn": "1000000000000000", "amountInFormatted": "0.001", "amountInUsd": "2.2886", @@ -84,4 +79,4 @@ "timeEstimate": 52 } } -} \ No newline at end of file +} diff --git a/apps/swap-service/src/verification/__tests__/fixtures/relay/response.json b/apps/swap-service/src/verification/__tests__/fixtures/relay/response.json index 4db58c8..0d18200 100644 --- a/apps/swap-service/src/verification/__tests__/fixtures/relay/response.json +++ b/apps/swap-service/src/verification/__tests__/fixtures/relay/response.json @@ -262,4 +262,4 @@ "updatedAt": "2026-04-28T18:35:37.930Z" } ] -} \ No newline at end of file +} diff --git a/apps/swap-service/src/verification/__tests__/setup.ts b/apps/swap-service/src/verification/__tests__/setup.ts index e003543..e6bf8d4 100644 --- a/apps/swap-service/src/verification/__tests__/setup.ts +++ b/apps/swap-service/src/verification/__tests__/setup.ts @@ -19,9 +19,10 @@ jest.mock('../../env', () => ({ }, })) -// @shapeshiftoss/swapper transitively pulls chain-adapters → p-queue (ESM) → bigint-buffer. -// We don't exercise swapper internals here, so stub the module surface the verifier touches. -// Keep enum string values identical to the real module so production code paths match. +jest.mock('../../utils/pricing', () => ({ + getAssetPriceUsd: jest.fn(), +})) + jest.mock('@shapeshiftoss/swapper', () => ({ SwapperName: { Thorchain: 'THORChain', diff --git a/package.json b/package.json index f909357..ff1e155 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,11 @@ "dev": "turbo run dev", "start": "turbo run start", "start:dev": "turbo run start:dev", - "test": "jest", + "test": "turbo run test", "lint": "eslint --cache \"{apps,packages}/**/*.ts\"", "lint:fix": "yarn lint --fix", - "format": "prettier --check \"**/*.{ts,js,json,md}\"", - "format:fix": "prettier --write \"**/*.{ts,js,json,md}\"", + "format": "prettier --check \"**/*.{json,md}\"", + "format:fix": "prettier --write \"**/*.{json,md}\"", "docker:build": "docker-compose build", "docker:up": "docker-compose up -d", "docker:down": "docker-compose down", diff --git a/turbo.json b/turbo.json index d43ed15..19a8836 100644 --- a/turbo.json +++ b/turbo.json @@ -22,10 +22,7 @@ "cache": false, "persistent": true }, - "test": { - "dependsOn": ["^build"], - "outputs": ["coverage/**"] - }, + "test": {}, "//#db:generate": { "cache": false },