diff --git a/benchmarks/fork-l2/encode-l2-routes.mjs b/benchmarks/fork-l2/encode-l2-routes.mjs index 415e6a8..dd00b08 100644 --- a/benchmarks/fork-l2/encode-l2-routes.mjs +++ b/benchmarks/fork-l2/encode-l2-routes.mjs @@ -1,4 +1,3 @@ -// Generates Yul-router calldata for the L2 fresh-pool WETH/USDC legs with the yul-router SDK. import { encodeRoute } from "/home/sendmoodz/Work/ekubo/yul-router/sdk/src/index.ts"; import { writeFileSync } from "node:fs"; const RECIPIENT = "0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496"; // forge test contract address (asserted in the test) diff --git a/benchmarks/fork-l2/quote-live-base.mjs b/benchmarks/fork-l2/quote-live-base.mjs index 89976c5..4a8d327 100644 --- a/benchmarks/fork-l2/quote-live-base.mjs +++ b/benchmarks/fork-l2/quote-live-base.mjs @@ -2,7 +2,6 @@ import { encodeRoute, encodeQuoteCalldata, } from "/home/sendmoodz/Work/ekubo/yul-router/sdk/src/index.ts"; -// live Base pool from the Ekubo API poolKeys listing: native ETH / USDC, fee 0x20c49ba5e353f7 (0.05%), spacing 1000 const route = encodeRoute({ specifiedToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", calculatedToken: "0x0000000000000000000000000000000000000000", diff --git a/benchmarks/page-numbers.mjs b/benchmarks/page-numbers.mjs index 2808cd0..6dbd675 100644 --- a/benchmarks/page-numbers.mjs +++ b/benchmarks/page-numbers.mjs @@ -1,7 +1,4 @@ #!/usr/bin/env node -// Derives every figure on the Gas efficiency page from the raw snapshot and measurement -// files in this directory, so each percentage can be re-checked without a calculator. -// Run: node page-numbers.mjs import { readFileSync } from "node:fs"; const j = (p) => JSON.parse(readFileSync(new URL(p, import.meta.url))); const ek = j("./prod/snapshots/ProdEkuboTest.json"); @@ -17,7 +14,6 @@ const tx = (snap, name) => const pct = (a, b) => ((100 * (b - a)) / b).toFixed(1); const fmt = (n) => Math.round(n).toLocaleString("en-US"); -// --- production routers and minimal lockers, 1 / 2 / 3 pools, fresh ERC20 pair const legs = { "Ekubo, Yul router": [1, 2, 3].map((n) => tx( @@ -73,7 +69,6 @@ console.log( ` like-for-like minimal: Ekubo ${fmt(Em)} vs v4 ${fmt(V4m)} (${pct(Em, V4m)}%) vs v3 ${fmt(V3m)} (${pct(Em, V3m)}%)`, ); -// --- native ETH input const nat = { ekubo: tx(ek, "prod ekubo Yul router 1 pool ETH->B"), v4: tx(v4, "prod v4 minimal locker 1 pool ETH->B"), @@ -86,7 +81,6 @@ console.log( ` native ETH in: Ekubo ${fmt(nat.ekubo)} vs v4 minimal ${fmt(nat.v4)} (${pct(nat.ekubo, nat.v4)}%) vs v3 SwapRouter ${fmt(nat.v3)} (${pct(nat.ekubo, nat.v3)}%)`, ); -// --- marginal cost per extra pool (minimal routers, transaction gas incl. calldata growth) and blend const marg = Object.fromEntries( Object.entries(legs) .filter(([, v]) => v.length === 3) @@ -147,7 +141,6 @@ for (const p of rows) { ); } -// --- pools per swap, 30-day sample const r = month.receipts; console.log( `30-day sample: ${month.window.blocksRead} blocks, stride ${month.window.stride}, ${month.window.fromIso} .. ${month.window.toIso}, blocks ${month.window.fromBlock}..${month.window.toBlock}`, @@ -177,7 +170,6 @@ if (month.calldata) ` router-only (calldata-decoded) txs ${month.calldata.decodedTxs}, avg ${month.calldata.avgPoolsPerSwapTx}`, ); -// --- chain-wide scenarios: share of block gas freed = share x saving const shares = [ ["4.2%, measured DEX-router burn, lower bound", 0.042], ["19.4%, ultrasound 'defi' bracket", 0.194], diff --git a/scripts/check-a11y.mjs b/scripts/check-a11y.mjs index 83d6f89..ac3aef2 100644 --- a/scripts/check-a11y.mjs +++ b/scripts/check-a11y.mjs @@ -1,10 +1,3 @@ -/** - * Runs axe's WCAG 2.1 AA and best-practice rules over every sitemap page in - * both themes. This deliberately mirrors the blog's accessibility gate. - * - * bun run check:a11y - * bun run check:a11y -- https://docs.example.com - */ import { readFileSync } from "node:fs"; import AxeBuilder from "@axe-core/playwright"; import { chromium } from "playwright"; diff --git a/scripts/check-api.mjs b/scripts/check-api.mjs index ecc3b67..b034b07 100644 --- a/scripts/check-api.mjs +++ b/scripts/check-api.mjs @@ -101,7 +101,6 @@ for (const scheme of ["light", "dark"]) { exact: true, }); try { - // Use real pointer actions so an overlay cannot silently intercept the UI. await sourceButton.click({ timeout: 5_000 }); const quoterOption = page.getByRole("option", { name: "Quoter API", diff --git a/scripts/check-legacy-routes.mjs b/scripts/check-legacy-routes.mjs index e3c733b..28f95d6 100644 --- a/scripts/check-legacy-routes.mjs +++ b/scripts/check-legacy-routes.mjs @@ -21,7 +21,6 @@ const redirects = new Map( for (const file of legacyFiles) { const target = fileToTarget(file); - // Pages that moved off this site cannot be checked against the build output. if (isExternalTarget(target)) continue; const route = new URL(target, "https://docs.ekubo.org").pathname; const output = diff --git a/scripts/check-overflow.mjs b/scripts/check-overflow.mjs index 554c66e..3a75fac 100644 --- a/scripts/check-overflow.mjs +++ b/scripts/check-overflow.mjs @@ -1,9 +1,3 @@ -/** - * Checks every sitemap page at the same six phone widths used by the blog. - * - * bun run check:overflow - * bun run check:overflow -- https://docs.example.com - */ import { readFileSync } from "node:fs"; import { chromium } from "playwright"; diff --git a/scripts/check-theme.mjs b/scripts/check-theme.mjs index 60a1f9c..5024264 100644 --- a/scripts/check-theme.mjs +++ b/scripts/check-theme.mjs @@ -55,8 +55,6 @@ for (const scheme of ["light", "dark"]) { await context.close(); } -// Simulate a cold connection and verify that fallback glyphs are never -// painted while the preloaded brand face is still downloading. const coldContext = await browser.newContext({ colorScheme: "light" }); const coldPage = await coldContext.newPage(); await coldPage.route("**/fonts/*.woff2", async (route) => { diff --git a/scripts/legacy-routes.mjs b/scripts/legacy-routes.mjs index be5325b..092fea6 100644 --- a/scripts/legacy-routes.mjs +++ b/scripts/legacy-routes.mjs @@ -39,11 +39,6 @@ export const legacyFiles = [ "user-guides/governance.md", ]; -// GitBook published a page at its position in the table of contents, not at its -// file path, so a page nested under a parent it did not live beside got a URL -// no file name predicts. `concepts/extensions-vs-v4-hooks.md` sat under -// Extensions and was served at `/concepts/extensions/extensions-vs-v4-hooks`, -// which is the URL that was linked and shared. export const movedRoutes = { "concepts/extensions/extensions-vs-v4-hooks": "concepts/extensions-vs-v4-hooks.md", @@ -80,22 +75,11 @@ export const movedRoutes = { "user-guides/governance/ekubo-inc": "products/governance.md", }; -/** - * URLs the GitBook site served for pages that were retired before the current - * structure existed, mapped to whatever now covers the subject. These have no - * file in `legacyFiles` because the file was deleted years ago; the URL is what - * survives, in old blog posts, Discord messages, and search results. - * - * Each target was chosen by reading the retired page, not by matching names. - */ export const retiredRoutes = { - // Section prefixes with no index page of their own. concepts: "/concepts/key-concepts/", reference: "/reference/contracts/", "user-guides": "/user-guides/add-liquidity/", - // "Background" and its "Key concepts" successor both explained the same - // primitives the current key concepts page covers. "about-ekubo/background": "/concepts/key-concepts/", "about-ekubo/key-concepts": "/concepts/key-concepts/", "introduction/key-concepts": "/concepts/key-concepts/", @@ -104,14 +88,11 @@ export const retiredRoutes = { "introduction/features": "/about-ekubo/features/", features: "/about-ekubo/features/", - // The FAQs were folded into the pages that answer their questions. faq: "/", "about-ekubo/faq": "/", "introduction/faq": "/", "integration-guides/reference/frequently-asked-questions-faq": "/", - // Starknet DeFi Spring was an incentive campaign; incentives are documented - // as rewards now. "about-ekubo/starknet-defi-spring": "/products/rewards/", "integration-guides/reference/starknet-defi-spring": "/products/rewards/", "user-guides/incentives": "/products/rewards/", @@ -120,7 +101,6 @@ export const retiredRoutes = { "user-guides/leaderboard": "/products/rewards/", "user-guides/swap": "/products/trading/", - // The till pattern and the core interfaces are the architecture page. "integration-guides/core-interfaces": "/concepts/architecture/", "integration-guides/core-interfaces/using-the-till-pattern": "/concepts/architecture/", @@ -129,13 +109,11 @@ export const retiredRoutes = { "/concepts/architecture/", "integration-guides/reference/till-pattern": "/concepts/architecture/", - // An example extension, and the pages that preceded the current structure. "integration-guides/extensions/oracle": "/concepts/extensions/", "integrations/extensions": "/concepts/extensions/", "integrations/aggregators": "/integration-guides/aggregators/", "integration-guides/swapping/by-example": "/integration-guides/swapping/", - // Contract and API reference pages, under the names they had at the time. "integration-guides/contract-addresses": "/reference/contracts/", "integration-guides/reference/error-codes": "/reference/contracts/", "integration-guides/reference/evm-contracts": "/reference/contracts/evm-v3/", @@ -152,7 +130,6 @@ export function fileToRoute(file) { return `/${file.slice(0, -".md".length)}/`; } -// Targets may be absolute URLs when a page moved off the documentation site. const legacyTargetOverrides = { "reference/ekubo-api/README.md": "/api/", "reference/ekubo-api/endpoints.md": "/api/", diff --git a/scripts/lint.ts b/scripts/lint.ts index 3448072..c130715 100644 --- a/scripts/lint.ts +++ b/scripts/lint.ts @@ -1,14 +1,3 @@ -// Runs oxlint over the repository and holds known violations to the per-file, -// per-rule counts in lint-suppressions.json. A file may not gain a violation of -// a recorded rule, and a count that is higher than the file needs fails too, so -// the file only ever shrinks. -// -// bun run lint lint; fails on any unrecorded violation -// bun run lint --fix extra arguments are passed to oxlint -// bun run lint:prune lower recorded counts to what remains -// bun run lint --suppress-rule=CODE record every current violation of CODE, -// e.g. "typescript(no-floating-promises)"; -// only when introducing a rule import { readFileSync, writeFileSync } from "node:fs"; const SUPPRESSIONS_FILE = "lint-suppressions.json"; diff --git a/src/styles/fonts.css b/src/styles/fonts.css index e7b3f1a..059d0ac 100644 --- a/src/styles/fonts.css +++ b/src/styles/fonts.css @@ -1,9 +1,3 @@ -/* - * Suisse Intl — the Ekubo brand typeface, self-hosted and subset. - * These are the same optimized faces used by blog.ekubo.org and are derived - * from the source fonts in the interface repository. - */ - @font-face { font-family: "Suisse Intl"; src: url("/fonts/suisse-intl-400.f6cfafea4909.woff2") format("woff2");