Skip to content

Commit 7307a72

Browse files
khadniaelmanaa
andauthored
Copy page & SDK/Chain family components (#3242)
* add copy page button * add copy page button * add copy page button * add copy page button * uniformize dropdowns * Restore llms-full in sidebar * refactor: extract shared markdown formatters * copy page position + modal improvements * nit improvements * handle CodeHighlightBlockMulti * nit positioning * shorten copy page desc * fix stripHighlightComments regex * fix stripHighlightComments regex * fix stripHighlightComments regex * reset TS as default for cre --------- Co-authored-by: aelmanaa <[email protected]>
1 parent 97a601d commit 7307a72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3721
-490
lines changed

jest.config.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = {
1313
extensionsToTreatAsEsm: [".ts", ".tsx"],
1414
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json", "node"],
1515
moduleNameMapper: {
16+
"^(\\.{1,2}/.*)\\.js$": "$1",
1617
"\\.(css)$": "<rootDir>/src/__mocks__/styleMock.ts",
1718
"^~/(.*)$": "<rootDir>/src/$1",
1819
"^@api/(.*)$": "<rootDir>/src/pages/api/$1",
@@ -29,6 +30,7 @@ module.exports = {
2930
"^@variables$": "<rootDir>/src/config/markdown-variables.ts",
3031
"^@abi$": "<rootDir>/src/features/abi/index.ts",
3132
"^@lib$": "<rootDir>/src/lib/index.ts",
33+
"^@lib/(.*)\\.js$": "<rootDir>/src/lib/$1",
3234
"^@lib/(.*)$": "<rootDir>/src/lib/$1",
3335
"\\.ya?ml$": "<rootDir>/src/__mocks__/yamlMock.ts",
3436
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"astro": "astro",
1111
"dev": "astro dev",
1212
"start": "astro dev",
13-
"build": "astro build && npm run pin-sol-version",
13+
"build": "astro build && npm run pin-sol-version && node scripts/cleanup-vercel-function.mjs",
1414
"preview": "astro preview",
1515
"pin-sol-version": "tsx --require tsconfig-paths/register src/scripts/helper/pin-solver-dist.ts",
1616
"linkcheckWrapper": "tsx --require tsconfig-paths/register src/scripts/link-check/linkcheckWrapper.ts",

reports/llms-report.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"startedAt": "2025-11-25T23:16:10.318Z",
2+
"startedAt": "2025-11-28T16:27:51.081Z",
33
"siteBase": "https://docs.chain.link",
44
"sections": [
55
{
@@ -47,8 +47,8 @@
4747
"pagesProcessed": 54,
4848
"outputPath": "src/content/data-streams/llms-full.txt",
4949
"bytes": 477065,
50-
"prevBytes": 477061,
51-
"deltaBytes": 4
50+
"prevBytes": 477065,
51+
"deltaBytes": 0
5252
},
5353
{
5454
"section": "dta-technical-standard",
@@ -123,5 +123,5 @@
123123
"deltaBytes": 0
124124
}
125125
],
126-
"finishedAt": "2025-11-25T23:16:13.816Z"
126+
"finishedAt": "2025-11-28T16:27:55.235Z"
127127
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env node
2+
/**
3+
* Post-build script to remove unnecessary files from Vercel serverless function
4+
* Reduces function size from 364MB to under 250MB limit
5+
*/
6+
7+
import { rm } from "fs/promises"
8+
import { existsSync } from "fs"
9+
import { execSync } from "child_process"
10+
11+
const FUNCTION_DIR = ".vercel/output/functions/_render.func"
12+
13+
async function cleanup() {
14+
if (!existsSync(FUNCTION_DIR)) {
15+
console.error(`❌ Function directory not found: ${FUNCTION_DIR}`)
16+
process.exit(1)
17+
}
18+
19+
console.log("🧹 Cleaning up serverless function bundle...")
20+
21+
const sizeBefore = execSync(`du -sh ${FUNCTION_DIR}`, { encoding: "utf-8" }).trim()
22+
console.log(`📦 Size before: ${sizeBefore}`)
23+
24+
// Remove large files/directories that are served statically by CDN
25+
const itemsToRemove = [
26+
`${FUNCTION_DIR}/public/images`,
27+
`${FUNCTION_DIR}/public/search-index.json`,
28+
`${FUNCTION_DIR}/public/files`,
29+
`${FUNCTION_DIR}/public/default-og-image.png`,
30+
`${FUNCTION_DIR}/public/samples`,
31+
`${FUNCTION_DIR}/public/changelog.json`,
32+
]
33+
34+
for (const item of itemsToRemove) {
35+
if (existsSync(item)) {
36+
await rm(item, { recursive: true, force: true })
37+
console.log(` ✓ Removed: ${item.replace(FUNCTION_DIR + "/", "")}`)
38+
}
39+
}
40+
41+
const sizeAfter = execSync(`du -sh ${FUNCTION_DIR}`, { encoding: "utf-8" }).trim()
42+
console.log(`📦 Size after: ${sizeAfter}`)
43+
console.log("✨ Cleanup complete!")
44+
}
45+
46+
cleanup().catch((error) => {
47+
console.error("❌ Cleanup failed:", error)
48+
process.exit(1)
49+
})

src/components/ChainSelector/ChainTypeSelector.module.css

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

0 commit comments

Comments
 (0)