diff --git a/package.json b/package.json index b982c7c..cf3f8df 100644 --- a/package.json +++ b/package.json @@ -11,5 +11,8 @@ "docs:dev": "vitepress dev src", "docs:build": "vitepress build src", "docs:preview": "vitepress preview src" + }, + "dependencies": { + "sitemap": "^8.0.0" } } diff --git a/src/.vitepress/config.mts b/src/.vitepress/config.mts index fb75354..42c2546 100644 --- a/src/.vitepress/config.mts +++ b/src/.vitepress/config.mts @@ -1,4 +1,7 @@ import { defineConfig } from 'vitepress' +import { SitemapStream } from 'sitemap' +import { createWriteStream } from 'node:fs' +import { resolve } from 'node:path' // https://vitepress.dev/reference/site-config @@ -84,4 +87,26 @@ export default defineConfig({ md.disable(['replacements'], false) }, }, + + // Sitemap generation + transformHtml: (_, id, { pageData }) => { + if (!/[\\/]404\.html$/.test(id)) + links.push({ + // you might need to change this if not using clean urls mode + url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'), + lastmod: pageData.lastUpdated + }) + }, + buildEnd: async ({ outDir }) => { + const sitemap = new SitemapStream({ + hostname: 'https://dexorder.trade/' + }) + const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml')) + sitemap.pipe(writeStream) + links.forEach((link) => sitemap.write(link)) + sitemap.end() + await new Promise((r) => writeStream.on('finish', r)) + }, }) + +const links = [] diff --git a/src/execution-policy.md b/src/execution-policy.md index b63aeac..d39acbc 100644 --- a/src/execution-policy.md +++ b/src/execution-policy.md @@ -15,7 +15,7 @@ Dexorder will attempt to execute each tranche at least ten (10) times under norm If an execution attempt reverts for an unrecognized reason unrelated to price, time, or other order conditions, Dexorder will progressively slow down its execution attempts of that tranche, and if the tranche execution raises -an unknown reversion code three times in a row, the execution of that order may be prematurely aborted. +an unknown reversion code five times in a row, the execution of that order may be prematurely aborted. ## Timeout diff --git a/yarn.lock b/yarn.lock index 706205e..95e1471 100644 --- a/yarn.lock +++ b/yarn.lock @@ -521,6 +521,25 @@ resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-2.0.0.tgz#d43878b5b20222682163ae6f897b20447233bdfd" integrity sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg== +"@types/node@*": + version "22.13.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.13.4.tgz#3fe454d77cd4a2d73c214008b3e331bfaaf5038a" + integrity sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg== + dependencies: + undici-types "~6.20.0" + +"@types/node@^17.0.5": + version "17.0.45" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" + integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== + +"@types/sax@^1.2.1": + version "1.2.7" + resolved "https://registry.yarnpkg.com/@types/sax/-/sax-1.2.7.tgz#ba5fe7df9aa9c89b6dff7688a19023dd2963091d" + integrity sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A== + dependencies: + "@types/node" "*" + "@types/unist@*", "@types/unist@^3.0.0": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c" @@ -698,6 +717,11 @@ algoliasearch@^5.14.2: "@algolia/requester-fetch" "5.20.2" "@algolia/requester-node-http" "5.20.2" +arg@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c" + integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg== + birpc@^0.2.19: version "0.2.19" resolved "https://registry.yarnpkg.com/birpc/-/birpc-0.2.19.tgz#cdd183a4a70ba103127d49765b4a71349da5a0ca" @@ -1006,6 +1030,11 @@ rollup@^4.20.0: "@rollup/rollup-win32-x64-msvc" "4.34.7" fsevents "~2.3.2" +sax@^1.2.4: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.4.1.tgz#44cc8988377f126304d3b3fc1010c733b929ef0f" + integrity sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg== + shiki@^2.1.0: version "2.4.1" resolved "https://registry.yarnpkg.com/shiki/-/shiki-2.4.1.tgz#68e11cb61fb172d1700ece9f02c14d32b9619298" @@ -1020,6 +1049,16 @@ shiki@^2.1.0: "@shikijs/vscode-textmate" "^10.0.2" "@types/hast" "^3.0.4" +sitemap@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-8.0.0.tgz#eb6ea48f95787cd680b83683c555d6f6b5a903fd" + integrity sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A== + dependencies: + "@types/node" "^17.0.5" + "@types/sax" "^1.2.1" + arg "^5.0.0" + sax "^1.2.4" + source-map-js@^1.2.0, source-map-js@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" @@ -1060,6 +1099,11 @@ trim-lines@^3.0.0: resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== + unist-util-is@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424"