diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c5b2ba52e4..a7a44ead2f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -43,5 +43,5 @@ jobs: uses: lycheeverse/lychee-action@v2.0.0 with: fail: true - args: --verbose --exclude '^https?://localhost(:[0-9]+)?/?$' --exclude 'https://hibachi.xyz/' --exclude 'https://dl.acm.org/doi/abs/10.1145/98163.98167' --exclude 'https://lib.rs/crates/celestia-client' --exclude 'https://github.com/celestiaorg/celestia-app/blob/29906a468910184f221b42be0a15898722a2b08f/specs/src/parameters_v6.md?plain=1#L31' --exclude 'https://polkachu.com/tendermint_snapshots/celestia' --exclude 'https://polkachu.com/testnets/celestia/snapshots' README.md app/**/*.mdx app/**/*.md + args: --verbose --exclude '^https?://localhost(:[0-9]+)?/?$' --exclude 'https://hibachi.xyz/' --exclude 'https://dl.acm.org/doi/abs/10.1145/98163.98167' --exclude 'https://lib.rs/crates/celestia-client' --exclude 'https://github.com/celestiaorg/celestia-app/blob/29906a468910184f221b42be0a15898722a2b08f/specs/src/parameters_v6.md?plain=1#L31' --exclude 'https://polkachu.com/tendermint_snapshots/celestia' --exclude 'https://polkachu.com/testnets/celestia/snapshots' --exclude '.*%7B.*' --exclude '.*\{.*' README.md app/**/*.mdx app/**/*.md token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index c318fbf594..175d0bc821 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -31,7 +31,7 @@ jobs: env: BASE: /docs-preview/new_docs/ NEXT_PUBLIC_BASE_PATH: /docs-preview/new_docs - run: yarn build + run: yarn build:static - name: Checkout docs-preview repository uses: actions/checkout@v4.1.7 diff --git a/next.config.mjs b/next.config.mjs index 766eb7fe2f..df40bfe5bc 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -2,6 +2,9 @@ import nextra from 'nextra' import remarkMath from 'remark-math' import rehypeKatex from 'rehype-katex' import remarkReplaceVariables from './plugins/remark-replace-variables.mjs' +import fs from 'node:fs' +import path from 'node:path' + // Set up Nextra with its configuration const withNextra = nextra({ @@ -21,7 +24,7 @@ export default withNextra({ // Add regular Next.js options here basePath: basePath, assetPrefix: base || undefined, // Keep trailing slash for assets - output: 'export', + output: process.env.STATIC_EXPORT === 'true' ? 'export' : undefined, trailingSlash: true, images: { unoptimized: true, @@ -35,5 +38,19 @@ export default withNextra({ ignored: ['**/node_modules/**'] } return config + }, + async redirects() { + if (process.env.STATIC_EXPORT === 'true') { + return [] + } + + try { + const redirectsPath = path.join(process.cwd(), 'redirects.json') + const redirectsData = fs.readFileSync(redirectsPath, 'utf8') + return JSON.parse(redirectsData) + } catch (error) { + console.error('Error reading redirects.json:', error) + return [] + } } }) diff --git a/package.json b/package.json index 6c9e46cc12..3037e5cfa4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "scripts": { "dev": "next dev --webpack", "build": "next build --webpack", + "build:static": "STATIC_EXPORT=true next build --webpack", "postbuild": "pagefind --site .next/server/app --output-path out/_pagefind", + "postbuild:static": "npm run postbuild", "start": "next start", "lint": "eslint", "prepare": "simple-git-hooks" @@ -19,7 +21,7 @@ "@monaco-editor/react": "^4.7.0", "@open-rpc/client-js": "^2.0.0", "axios": "^1.13.2", - "next": "16.0.0", + "next": "^16.0.8", "nextra": "^4.6.0", "nextra-theme-docs": "^4.6.0", "react": "19.2.0", @@ -38,7 +40,7 @@ "@types/react-dom": "^19", "@types/react-syntax-highlighter": "^15.5.13", "eslint": "^9", - "eslint-config-next": "16.0.0", + "eslint-config-next": "^16.0.8", "glob": "^11.0.3", "pagefind": "^1.4.0", "simple-git-hooks": "^2.13.1", diff --git a/redirects.json b/redirects.json new file mode 100644 index 0000000000..b6edfe6b63 --- /dev/null +++ b/redirects.json @@ -0,0 +1,47 @@ +[ + { + "source": "/how-to-guides/nodes-overview", + "destination": "/operate/getting-started/overview", + "permanent": true + }, + { + "source": "/how-to-guides/quick-start", + "destination": "/build/post-retrieve-blob/overview/", + "permanent": true + }, + { + "source": "/learn/how-celestia-works/overview", + "destination": "/learn/celestia-101/data-availability/", + "permanent": true + }, + { + "source": "/learn/staking-governance-supply", + "destination": "/learn/TIA/staking-governance-supply/", + "permanent": true + }, + { + "source": "/how-to-guides/arbitrum-integration", + "destination": "/build/stacks/nitro-das-server/", + "permanent": true + }, + { + "source": "/learn/how-celestia-works/monolithic-vs-modular", + "destination": "/learn/celestia-101/data-availability/#monolithic-vs-modular-blockchains", + "permanent": true + }, + { + "source": "/how-to-guides/mocha-testnet", + "destination": "/operate/networks/mocha-testnet/", + "permanent": true + }, + { + "source": "/learn/how-to-stake-tia", + "destination": "/learn/TIA/staking/", + "permanent": true + }, + { + "source": "/learn/how-celestia-works/data-availability-layer", + "destination": "/learn/celestia-101/data-availability/", + "permanent": true + } +] diff --git a/yarn.lock b/yarn.lock index d3caf10da4..49e235c1e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -753,57 +753,57 @@ "@emnapi/runtime" "^1.7.1" "@tybys/wasm-util" "^0.10.1" -"@next/env@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/env/-/env-16.0.0.tgz#52df6ea4efa447ae9f7df0105dce088505bc8f3d" - integrity sha512-s5j2iFGp38QsG1LWRQaE2iUY3h1jc014/melHFfLdrsMJPqxqDQwWNwyQTcNoUSGZlCVZuM7t7JDMmSyRilsnA== +"@next/env@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/env/-/env-16.0.8.tgz#6167b208ffde10fee64230e09daff387f3f451fd" + integrity sha512-xP4WrQZuj9MdmLJy3eWFHepo+R3vznsMSS8Dy3wdA7FKpjCiesQ6DxZvdGziQisj0tEtCgBKJzjcAc4yZOgLEQ== -"@next/eslint-plugin-next@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-16.0.0.tgz#f07c3524ba0e9e403c6bd6aabef809b1bcb9ca09" - integrity sha512-IB7RzmmtrPOrpAgEBR1PIQPD0yea5lggh5cq54m51jHjjljU80Ia+czfxJYMlSDl1DPvpzb8S9TalCc0VMo9Hw== +"@next/eslint-plugin-next@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-16.0.8.tgz#62018f7f9eb3eda013f72a67f0805bda51360eb0" + integrity sha512-1miV0qXDcLUaOdHridVPCh4i39ElRIAraseVIbb3BEqyZ5ol9sPyjTP/GNTPV5rBxqxjF6/vv5zQTVbhiNaLqA== dependencies: fast-glob "3.3.1" -"@next/swc-darwin-arm64@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.0.0.tgz#bca00a28469352ad9259143f2a3bc2a3dc36e29b" - integrity sha512-/CntqDCnk5w2qIwMiF0a9r6+9qunZzFmU0cBX4T82LOflE72zzH6gnOjCwUXYKOBlQi8OpP/rMj8cBIr18x4TA== - -"@next/swc-darwin-x64@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-16.0.0.tgz#d52aee6e34ae474e1b5f786f028965f015ab64e0" - integrity sha512-hB4GZnJGKa8m4efvTGNyii6qs76vTNl+3dKHTCAUaksN6KjYy4iEO3Q5ira405NW2PKb3EcqWiRaL9DrYJfMHg== - -"@next/swc-linux-arm64-gnu@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.0.0.tgz#21433fc35e5d55786380ee4ac314b7a5f347d795" - integrity sha512-E2IHMdE+C1k+nUgndM13/BY/iJY9KGCphCftMh7SXWcaQqExq/pJU/1Hgn8n/tFwSoLoYC/yUghOv97tAsIxqg== - -"@next/swc-linux-arm64-musl@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.0.0.tgz#e405896fc4e4ce472f3324124cfdfca42f878dda" - integrity sha512-xzgl7c7BVk4+7PDWldU+On2nlwnGgFqJ1siWp3/8S0KBBLCjonB6zwJYPtl4MUY7YZJrzzumdUpUoquu5zk8vg== - -"@next/swc-linux-x64-gnu@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.0.0.tgz#e92401b0bacb9acefe3f183f5fff8c7a78c28213" - integrity sha512-sdyOg4cbiCw7YUr0F/7ya42oiVBXLD21EYkSwN+PhE4csJH4MSXUsYyslliiiBwkM+KsuQH/y9wuxVz6s7Nstg== - -"@next/swc-linux-x64-musl@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.0.0.tgz#b3b0654571b8b375026df0ec66b9d406b7847cc7" - integrity sha512-IAXv3OBYqVaNOgyd3kxR4L3msuhmSy1bcchPHxDOjypG33i2yDWvGBwFD94OuuTjjTt/7cuIKtAmoOOml6kfbg== - -"@next/swc-win32-arm64-msvc@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.0.0.tgz#cd5d608f08f17e6b774e19878d42edc77c7101c2" - integrity sha512-bmo3ncIJKUS9PWK1JD9pEVv0yuvp1KPuOsyJTHXTv8KDrEmgV/K+U0C75rl9rhIaODcS7JEb6/7eJhdwXI0XmA== - -"@next/swc-win32-x64-msvc@16.0.0": - version "16.0.0" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.0.0.tgz#0f5726a0657e9ae5c87d0e0d0f074fa127b84d7a" - integrity sha512-O1cJbT+lZp+cTjYyZGiDwsOjO3UHHzSqobkPNipdlnnuPb1swfcuY6r3p8dsKU4hAIEO4cO67ZCfVVH/M1ETXA== +"@next/swc-darwin-arm64@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.0.8.tgz#0b28316ea33542365d3a7770c548910992b29cae" + integrity sha512-yjVMvTQN21ZHOclQnhSFbjBTEizle+1uo4NV6L4rtS9WO3nfjaeJYw+H91G+nEf3Ef43TaEZvY5mPWfB/De7tA== + +"@next/swc-darwin-x64@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-16.0.8.tgz#51139ce4b2fca924c1df48b0a0b33a7ba6641ed2" + integrity sha512-+zu2N3QQ0ZOb6RyqQKfcu/pn0UPGmg+mUDqpAAEviAcEVEYgDckemOpiMRsBP3IsEKpcoKuNzekDcPczEeEIzA== + +"@next/swc-linux-arm64-gnu@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.0.8.tgz#323625ec532c119495fbea6301c29c00fa25b767" + integrity sha512-LConttk+BeD0e6RG0jGEP9GfvdaBVMYsLJ5aDDweKiJVVCu6sGvo+Ohz9nQhvj7EQDVVRJMCGhl19DmJwGr6bQ== + +"@next/swc-linux-arm64-musl@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.0.8.tgz#19a988df87f26390233cbe8eb793edde7157c84b" + integrity sha512-JaXFAlqn8fJV+GhhA9lpg6da/NCN/v9ub98n3HoayoUSPOVdoxEEt86iT58jXqQCs/R3dv5ZnxGkW8aF4obMrQ== + +"@next/swc-linux-x64-gnu@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.0.8.tgz#71dc3516fab7ca793bf0fd424c638280175afcc1" + integrity sha512-O7M9it6HyNhsJp3HNAsJoHk5BUsfj7hRshfptpGcVsPZ1u0KQ/oVy8oxF7tlwxA5tR43VUP0yRmAGm1us514ng== + +"@next/swc-linux-x64-musl@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.0.8.tgz#6878cbd85eee73dbd18b3e34791e4e3cc9dc5f43" + integrity sha512-8+KClEC/GLI2dLYcrWwHu5JyC5cZYCFnccVIvmxpo6K+XQt4qzqM5L4coofNDZYkct/VCCyJWGbZZDsg6w6LFA== + +"@next/swc-win32-arm64-msvc@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.0.8.tgz#556fadbd1915060ef821eb0e38b86866194bcbcf" + integrity sha512-rpQ/PgTEgH68SiXmhu/cJ2hk9aZ6YgFvspzQWe2I9HufY6g7V02DXRr/xrVqOaKm2lenBFPNQ+KAaeveywqV+A== + +"@next/swc-win32-x64-msvc@16.0.8": + version "16.0.8" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.0.8.tgz#9cb3db37d0113ce099877e04b975868e57782204" + integrity sha512-jWpWjWcMQu2iZz4pEK2IktcfR+OA9+cCG8zenyLpcW8rN4rzjfOzH4yj/b1FiEAZHKS+5Vq8+bZyHi+2yqHbFA== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -2803,12 +2803,12 @@ escape-string-regexp@^5.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== -eslint-config-next@16.0.0: - version "16.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-16.0.0.tgz#ebf26f21fc3c516f2a9c6052c46ab7d9e7297285" - integrity sha512-DWKT1YAO9ex2rK0/EeiPpKU++ghTiG59z6m08/ReLRECOYIaEv17maSCYT8zmFQLwIrY5lhJ+iaJPQdT4sJd4g== +eslint-config-next@^16.0.8: + version "16.0.8" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-16.0.8.tgz#0f5bb2c8c2a88479ef004258963112a31e4cc6a5" + integrity sha512-8J5cOAboXIV3f8OD6BOyj7Fik6n/as7J4MboiUSExWruf/lCu1OPR3ZVSdnta6WhzebrmAATEmNSBZsLWA6kbg== dependencies: - "@next/eslint-plugin-next" "16.0.0" + "@next/eslint-plugin-next" "16.0.8" eslint-import-resolver-node "^0.3.6" eslint-import-resolver-typescript "^3.5.2" eslint-plugin-import "^2.32.0" @@ -5020,25 +5020,25 @@ next-themes@^0.4.0: resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.4.6.tgz#8d7e92d03b8fea6582892a50a928c9b23502e8b6" integrity sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA== -next@16.0.0: - version "16.0.0" - resolved "https://registry.yarnpkg.com/next/-/next-16.0.0.tgz#f98a345ea27cb96979dbb88e5ede5ab753c99d8d" - integrity sha512-nYohiNdxGu4OmBzggxy9rczmjIGI+TpR5vbKTsE1HqYwNm1B+YSiugSrFguX6omMOKnDHAmBPY4+8TNJk0Idyg== +next@^16.0.8: + version "16.0.8" + resolved "https://registry.yarnpkg.com/next/-/next-16.0.8.tgz#10c0289e76e8617a8ad991210ec7402cb9cba87b" + integrity sha512-LmcZzG04JuzNXi48s5P+TnJBsTGPJunViNKV/iE4uM6kstjTQsQhvsAv+xF6MJxU2Pr26tl15eVbp0jQnsv6/g== dependencies: - "@next/env" "16.0.0" + "@next/env" "16.0.8" "@swc/helpers" "0.5.15" caniuse-lite "^1.0.30001579" postcss "8.4.31" styled-jsx "5.1.6" optionalDependencies: - "@next/swc-darwin-arm64" "16.0.0" - "@next/swc-darwin-x64" "16.0.0" - "@next/swc-linux-arm64-gnu" "16.0.0" - "@next/swc-linux-arm64-musl" "16.0.0" - "@next/swc-linux-x64-gnu" "16.0.0" - "@next/swc-linux-x64-musl" "16.0.0" - "@next/swc-win32-arm64-msvc" "16.0.0" - "@next/swc-win32-x64-msvc" "16.0.0" + "@next/swc-darwin-arm64" "16.0.8" + "@next/swc-darwin-x64" "16.0.8" + "@next/swc-linux-arm64-gnu" "16.0.8" + "@next/swc-linux-arm64-musl" "16.0.8" + "@next/swc-linux-x64-gnu" "16.0.8" + "@next/swc-linux-x64-musl" "16.0.8" + "@next/swc-win32-arm64-msvc" "16.0.8" + "@next/swc-win32-x64-msvc" "16.0.8" sharp "^0.34.4" nextra-theme-docs@^4.6.0: