Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/breezy-lines-hide.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@venusprotocol/evm": minor
---

introduce pendle vault
add Yield+ feature
5 changes: 0 additions & 5 deletions .changeset/itchy-moments-serve.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/legal-tables-accept.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pink-items-search.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/pretty-keys-kneel.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/stale-bikes-smile.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/swift-beans-enjoy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr01-query-client.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr02-shared-groundwork.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr03-yieldplus-infra.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr04-domain-utils.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr05-data-hooks.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr06-readonly-shell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr07-transaction-history.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr08-position-form-foundation.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr09-open-flow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yield-plus-pr10-manage-flow.md

This file was deleted.

45 changes: 0 additions & 45 deletions .claude/references/code-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,51 +120,6 @@ These match dominant existing patterns and should be followed for new code:
| Constants | `UPPER_SNAKE_CASE` for true constants, otherwise descriptive `camelCase` exports |
| Test files | `*.spec.ts` / `*.spec.tsx` (often under `__tests__/`) |

## File and module structure rules

- **One export per file**: each file must contain exactly one function or one component. Do not co-locate multiple functions or components in the same file.
- **Self-named index files**: every function or component must live in a dedicated directory named after it, exposing the implementation via `index.ts` / `index.tsx`.
```
components/
└─ MyButton/
└─ index.tsx ← exports MyButton only
utilities/
└─ formatAmount/
└─ index.ts ← exports formatAmount only
```
- **Reuse over duplication**: extract repeated logic into reusable components, hooks, or utility functions rather than duplicating code. Prefer referencing an existing abstraction over copy-pasting.

## Control-flow rules

- **No nested conditionals**: do not nest `if` statements or ternary expressions inside one another. Flatten logic using early returns, guard clauses, or helper functions instead.

```typescript
// ✗ nested ternary
const label = isLoading ? 'Loading…' : hasError ? 'Error' : 'Done';

// ✓ guard clauses
if (isLoading) return 'Loading…';
if (hasError) return 'Error';
return 'Done';
```

## Data-type conventions for object properties

Enforce consistent property naming so the unit of every value is unambiguous at the call-site.

| Data type | Required suffix | Example property name |
|---|---|---|
| Mantissa (raw BigNumber / bigint numerator) | `Mantissa` | `supplyApyMantissa` |
| Token amounts | `Tokens` | `borrowedTokens` |
| Milliseconds | `Ms` | `lockPeriodMs` |
| Percentages (0–100 scale) | `Percentage` | `collateralFactorPercentage` |
| Dollar / fiat amounts | express in **cents** (`number \| bigint`), suffix `Cents` | `liquidationThresholdCents` |
| Date values | use the `Date` type (not `number` timestamps) | `maturityDate: Date` |

Additional rules:
- Dollar/fiat values **must** be stored and passed as integer cents; never store fractional dollar amounts.
- Date properties on domain objects **must** use the `Date` type; convert to timestamps only at serialisation boundaries.

## Generated code policy

Do not manually edit generated artifacts.
Expand Down
75 changes: 26 additions & 49 deletions .claude/scripts/ui-interaction-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import { chromium, type Page } from '@playwright/test';
import { type Page, chromium } from '@playwright/test';

// Shared utility - see .claude/scripts/utils/image.ts
import { downscaleIfNeeded } from './utils/image.js';
Expand Down Expand Up @@ -68,11 +68,11 @@ function parseArgs(args: string[]) {
} else if (arg === '--steps') {
stepsJson = args[++i] ?? '';
} else if (arg.startsWith('--width=')) {
width = parseInt(arg.split('=')[1] ?? '1440', 10);
width = Number.parseInt(arg.split('=')[1] ?? '1440', 10);
} else if (arg.startsWith('--height=')) {
height = parseInt(arg.split('=')[1] ?? '900', 10);
height = Number.parseInt(arg.split('=')[1] ?? '900', 10);
} else if (arg.startsWith('--max-width=')) {
maxWidth = parseInt(arg.split('=')[1] ?? '1400', 10);
maxWidth = Number.parseInt(arg.split('=')[1] ?? '1400', 10);
}
}

Expand All @@ -97,11 +97,9 @@ async function waitForStable(page: Page): Promise<void> {
}

async function main() {
const { url, output, steps, width, height, maxWidth } = parseArgs(
process.argv.slice(2),
);
const { url, output, steps, width, height, maxWidth } = parseArgs(process.argv.slice(2));

const targetUrl = `${DEV_SERVER_URL}${url.startsWith('/') ? url : '/' + url}`;
const targetUrl = `${DEV_SERVER_URL}${url.startsWith('/') ? url : `/${url}`}`;

// Check dev server
try {
Expand Down Expand Up @@ -200,9 +198,7 @@ async function main() {
});
await waitForStable(page);
await takeScreenshot(screenshotPath(''));
console.log(
` viewport: ${step.width}x${step.height} -> ${screenshotPath('')}`,
);
console.log(` viewport: ${step.width}x${step.height} -> ${screenshotPath('')}`);
break;
}

Expand Down Expand Up @@ -239,9 +235,7 @@ async function main() {
await locator.fill(step.value);
await waitForStable(page);
await takeScreenshot(screenshotPath(''));
console.log(
` fill: "${step.value}" into ${step.selector} -> ${screenshotPath('')}`,
);
console.log(` fill: "${step.value}" into ${step.selector} -> ${screenshotPath('')}`);
}
break;
}
Expand All @@ -251,15 +245,14 @@ async function main() {
if ((await trigger.count()) === 0) {
await takeScreenshot(screenshotPath('-NOTFOUND'));
console.log(
` select-option: trigger not found "${step.selector}" -> ${screenshotPath('-NOTFOUND')}`,
` select-option: trigger not found "${step.selector}" -> ${screenshotPath(
'-NOTFOUND',
)}`,
);
} else {
await trigger.click();
await waitForStable(page);
const option = page
.locator('[role="option"]')
.filter({ hasText: step.value })
.first();
const option = page.locator('[role="option"]').filter({ hasText: step.value }).first();

if ((await option.count()) === 0) {
await takeScreenshot(screenshotPath('-NOTFOUND'));
Expand All @@ -282,21 +275,19 @@ async function main() {
const locator = page.locator(step.selector).first();
if ((await locator.count()) === 0) {
await takeScreenshot(screenshotPath('-FAIL'));
console.log(
` assert-text: FAIL - selector not found "${step.selector}"`,
);
console.log(` assert-text: FAIL - selector not found "${step.selector}"`);
process.exitCode = 1;
} else {
const text = (await locator.textContent()) ?? '';
if (text.includes(step.expected)) {
await takeScreenshot(screenshotPath('-PASS'));
console.log(
` assert-text: PASS - "${step.expected}" found in ${step.selector}`,
);
console.log(` assert-text: PASS - "${step.expected}" found in ${step.selector}`);
} else {
await takeScreenshot(screenshotPath('-FAIL'));
console.log(
` assert-text: FAIL - expected "${step.expected}" in ${step.selector}, got "${text.slice(0, 100)}"`,
` assert-text: FAIL - expected "${step.expected}" in ${
step.selector
}, got "${text.slice(0, 100)}"`,
);
process.exitCode = 1;
}
Expand All @@ -308,9 +299,7 @@ async function main() {
const locator = page.locator(step.selector).first();
if ((await locator.count()) === 0) {
await takeScreenshot(screenshotPath('-FAIL'));
console.log(
` assert-visible: FAIL - selector not found "${step.selector}"`,
);
console.log(` assert-visible: FAIL - selector not found "${step.selector}"`);
process.exitCode = 1;
} else {
const visible = await locator.isVisible();
Expand All @@ -319,9 +308,7 @@ async function main() {
console.log(` assert-visible: PASS - ${step.selector} is visible`);
} else {
await takeScreenshot(screenshotPath('-FAIL'));
console.log(
` assert-visible: FAIL - ${step.selector} exists but not visible`,
);
console.log(` assert-visible: FAIL - ${step.selector} exists but not visible`);
process.exitCode = 1;
}
}
Expand All @@ -332,9 +319,7 @@ async function main() {
const locator = page.locator(step.selector).first();
if ((await locator.count()) === 0) {
await takeScreenshot(screenshotPath('-FAIL'));
console.log(
` assert-value: FAIL - selector not found "${step.selector}"`,
);
console.log(` assert-value: FAIL - selector not found "${step.selector}"`);
process.exitCode = 1;
} else {
const value = await locator.inputValue();
Expand All @@ -360,9 +345,7 @@ async function main() {
console.log(' check-console: PASS - no console errors');
} else {
await takeScreenshot(screenshotPath('-FAIL'));
console.log(
` check-console: FAIL - ${consoleErrors.length} error(s):`,
);
console.log(` check-console: FAIL - ${consoleErrors.length} error(s):`);
for (const err of consoleErrors) {
console.log(` ${err.slice(0, 200)}`);
}
Expand All @@ -379,14 +362,10 @@ async function main() {
timeout,
});
await takeScreenshot(screenshotPath('-PASS'));
console.log(
` wait-for: PASS - ${step.selector} visible within ${timeout}ms`,
);
console.log(` wait-for: PASS - ${step.selector} visible within ${timeout}ms`);
} catch {
await takeScreenshot(screenshotPath('-TIMEOUT'));
console.log(
` wait-for: TIMEOUT - ${step.selector} not visible after ${timeout}ms`,
);
console.log(` wait-for: TIMEOUT - ${step.selector} not visible after ${timeout}ms`);
process.exitCode = 1;
}
break;
Expand All @@ -395,12 +374,10 @@ async function main() {
}

await browser.close();
console.log(
`Interaction test complete.${process.exitCode ? ' (FAILURES DETECTED)' : ''}`,
);
console.log(`Interaction test complete.${process.exitCode ? ' (FAILURES DETECTED)' : ''}`);
}

main().catch((err) => {
main().catch(err => {
console.error(err);
process.exit(1);
});
});
15 changes: 8 additions & 7 deletions .claude/scripts/ui-screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ function parseArgs(args: string[]) {

for (const arg of args.slice(2)) {
if (arg.startsWith('--width=')) {
width = parseInt(arg.split('=')[1] ?? '1440', 10);
width = Number.parseInt(arg.split('=')[1] ?? '1440', 10);
} else if (arg.startsWith('--height=')) {
height = parseInt(arg.split('=')[1] ?? '900', 10);
height = Number.parseInt(arg.split('=')[1] ?? '900', 10);
} else if (arg.startsWith('--max-width=')) {
maxWidth = parseInt(arg.split('=')[1] ?? '1400', 10);
maxWidth = Number.parseInt(arg.split('=')[1] ?? '1400', 10);
} else if (arg === '--full-page') {
fullPage = true;
}
Expand All @@ -59,10 +59,11 @@ function parseArgs(args: string[]) {
}

async function main() {
const { routePath, outputPath, width, height, fullPage, maxWidth } =
parseArgs(process.argv.slice(2));
const { routePath, outputPath, width, height, fullPage, maxWidth } = parseArgs(
process.argv.slice(2),
);

const url = `${DEV_SERVER_URL}${routePath.startsWith('/') ? routePath : '/' + routePath}`;
const url = `${DEV_SERVER_URL}${routePath.startsWith('/') ? routePath : `/${routePath}`}`;

// Check if dev server is running
try {
Expand Down Expand Up @@ -102,7 +103,7 @@ async function main() {
await browser.close();
}

main().catch((err) => {
main().catch(err => {
console.error(err);
process.exit(1);
});
Loading
Loading