Skip to content

Commit 59497c2

Browse files
committed
Merge branch 'main' into add-hyperliquid
2 parents 5ddf898 + 4a3c6a2 commit 59497c2

File tree

11 files changed

+31
-76
lines changed

11 files changed

+31
-76
lines changed

.github/workflows/firebase-live.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: pnpm/action-setup@v4
1515

1616
- name: Setup Node
17-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@v5
1818
with:
1919
node-version: '^22.19.0'
2020
cache: 'pnpm'

.github/workflows/firebase-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: pnpm/action-setup@v4
1515

1616
- name: Setup Node
17-
uses: actions/setup-node@v4
17+
uses: actions/setup-node@v5
1818
with:
1919
node-version: '^22.19.0'
2020
cache: 'pnpm'

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: pnpm/action-setup@v4
2020

2121
- name: Setup Node
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@v5
2323
with:
2424
node-version: '^22.19.0'
2525
cache: 'pnpm'

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"options": {
1212
"parser": "markdown"
1313
}
14+
},
15+
{
16+
"files": "*.js",
17+
"options": {
18+
"printWidth": 120
19+
}
1420
}
1521
],
1622
"endOfLine": "lf"

docs/oev-searchers/in-depth/oev-auctioneer.test.ts renamed to docs/oev-searchers/in-depth/oev-auctioneer.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,14 @@ import { getChains } from '@api3/dapi-management';
66

77
const supportedMainnets = getChains()
88
.filter((chain) => chain.stage === 'active')
9-
.map((chain) => CHAINS.find((api3Chain) => api3Chain.id === chain.id)!)
9+
.map((chain) => CHAINS.find((api3Chain) => api3Chain.id === chain.id))
1010
.filter((chain) => !chain.testnet)
1111
.filter((chain) => chain.alias !== 'oev-network')
1212
.map((chain) => chain.name)
1313
.sort((a, b) => a.localeCompare(b));
1414

1515
test('the auction length section lists all the supported chains', () => {
16-
const docPath = path.join(
17-
process.cwd(),
18-
'docs',
19-
'oev-searchers',
20-
'in-depth',
21-
'oev-auctioneer.md'
22-
);
23-
const content = fs.readFileSync(docPath, 'utf8');
24-
16+
const content = readMarkdownFile();
2517
const chains = extractContentBetweenMarkers(content, 'chain-auction-length-table')
2618
.split('\n')
2719
.filter(Boolean) // Get rid of blank lines
@@ -31,7 +23,15 @@ test('the auction length section lists all the supported chains', () => {
3123
expect(chains).toStrictEqual(supportedMainnets);
3224
});
3325

34-
function extractContentBetweenMarkers(content: string, key: string) {
26+
function readMarkdownFile() {
27+
const docPath = path.join(process.cwd(), 'docs', 'oev-searchers', 'in-depth', 'oev-auctioneer.md');
28+
if (!fs.existsSync(docPath)) {
29+
throw new Error(`Could not find file "oev-auctioneer.md" at "${docPath}"`);
30+
}
31+
return fs.readFileSync(docPath, 'utf8');
32+
}
33+
34+
function extractContentBetweenMarkers(content, key) {
3535
const beginMarker = `<!-- BEGIN:${key} -->`;
3636
const endMarker = `<!-- END:${key} -->`;
3737
const beginIndex = content.indexOf(beginMarker);

libs/link-validator.js

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ function tempCB(dirPath, dirs, files) {
4949
// Load and display ignore list
5050
var fs = require('fs');
5151
const { link } = require('fs-extra');
52-
var ignore = JSON.parse(
53-
fs.readFileSync('./libs/link-validator-ignore.json', 'utf8')
54-
);
52+
var ignore = JSON.parse(fs.readFileSync('./libs/link-validator-ignore.json', 'utf8'));
5553
console.log(colors.bold('| > Ignore list'));
5654
ignore.forEach((element) => {
5755
console.log('|', colors.bold.yellow(element));
@@ -119,14 +117,9 @@ async function testLink(url, filePath, ignoreTimeout) {
119117
//console.log('> Target URL:', url);
120118

121119
// Look for urlAnchor in response.data.
122-
if (
123-
urlAnchor &&
124-
response.data.indexOf('href="' + urlAnchor + '"') === -1
125-
) {
120+
if (urlAnchor && response.data.indexOf('href="' + urlAnchor + '"') === -1) {
126121
//console.log(colors.red('> Anchor was NOT found in the response data.'));
127-
throw new Error(
128-
'Did not find anchor in the response data: ' + urlAnchor
129-
);
122+
throw new Error('Did not find anchor in the response data: ' + urlAnchor);
130123
}
131124
// else {
132125
//console.log('> Anchor was found in the response data.');
@@ -150,11 +143,7 @@ async function testLink(url, filePath, ignoreTimeout) {
150143
return 0;
151144
} catch (error) {
152145
// If a timeout try one more time
153-
if (
154-
!ignoreTimeout &&
155-
error.code == 'ECONNABORTED' &&
156-
error.toString().indexOf('Error: timeout') > -1
157-
) {
146+
if (!ignoreTimeout && error.code == 'ECONNABORTED' && error.toString().indexOf('Error: timeout') > -1) {
158147
testLink(url, filePath, true);
159148
} else {
160149
process.stdout.write(colors.bold.red('X'));
@@ -165,8 +154,7 @@ async function testLink(url, filePath, ignoreTimeout) {
165154
}
166155

167156
async function run(task) {
168-
(console.log('Checking (' + task + ')', Object.keys(linksObj).length),
169-
'links.');
157+
(console.log('Checking (' + task + ')', Object.keys(linksObj).length), 'links.');
170158
for (var key in linksObj) {
171159
if (linksObj.hasOwnProperty(key)) {
172160
let fail = await testLink(key, linksObj[key], false);
@@ -202,11 +190,7 @@ function loadLinks() {
202190
// If the URL starts with an anchor (#) tag
203191
// or is to the root (/)
204192
// do nothing
205-
} else if (
206-
url &&
207-
url.indexOf('http://') === -1 &&
208-
url.indexOf('https://') === -1
209-
) {
193+
} else if (url && url.indexOf('http://') === -1 && url.indexOf('https://') === -1) {
210194
// These are internal links within the docs
211195
url = baseURL + url;
212196

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"docs:serve": "vitepress serve docs --port 8082",
1212
"format": "prettier --write --cache \"./**/*.{js,vue,md,json,yaml}\" --log-level silent",
1313
"format:check": "prettier --check --cache \"./**/*.{js,vue,md,json,yaml}\"",
14-
"lint": "pnpm format:check && pnpm lint:tsc",
15-
"lint:tsc": "pnpm tsc",
14+
"lint": "pnpm format:check",
1615
"test": "vitest run",
1716
"generate-llms-files": "node scripts/generate-llms-files.js",
1817
"prepare": "husky",
@@ -30,7 +29,6 @@
3029
"medium-zoom": "^1.1.0",
3130
"oust": "^2.0.4",
3231
"prettier": "^3.6.2",
33-
"typescript": "^5.9.2",
3432
"vitepress": "1.6.4",
3533
"vitest": "^3.2.4",
3634
"walk-sync": "^3.0.0"

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generate-llms-files.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ function generateLlmsFullTxt() {
8484
for (const link of links) {
8585
const match = link.match(/- \[(.*?)\]\((.*?)\)/);
8686
if (match) {
87-
const url = match[2]
88-
.replace('https://docs.api3.org', '')
89-
.replace('.html', '.md');
87+
const url = match[2].replace('https://docs.api3.org', '').replace('.html', '.md');
9088
const filePath = path.join(docsDir, url);
9189
if (fs.existsSync(filePath)) {
9290
let fileContent = fs.readFileSync(filePath, 'utf-8');
@@ -103,15 +101,10 @@ function generateLlmsFullTxt() {
103101
if (pageHeaderIndex === -1) {
104102
throw new Error(`Could not find PageHeader in ${filePath}`);
105103
}
106-
fileContent = fileContent.substring(
107-
pageHeaderIndex + pageHeader.length
108-
);
104+
fileContent = fileContent.substring(pageHeaderIndex + pageHeader.length);
109105
const titleMatch = fileContent.match(/# (.*)/);
110106
if (titleMatch && pageHeaderValue) {
111-
fileContent = fileContent.replace(
112-
/# (.*)/,
113-
`# ${titleMatch[1]} (${pageHeaderValue})`
114-
);
107+
fileContent = fileContent.replace(/# (.*)/, `# ${titleMatch[1]} (${pageHeaderValue})`);
115108
}
116109
fullContent += fileContent + '\n\n';
117110
}

tsconfig.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)