This repository was archived by the owner on Apr 6, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 336
Updated Breadcrumb script #1060
Merged
Merged
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f0d666c
update breadcrumb script
krofax 2a8ea49
updated breadcrumb notes
krofax 52b93cf
Update notes/breadcrumbs.md
krofax 2595a8f
Update pages/stack/beta-features/beta-features.mdx
krofax 28bc2d9
add workflow
krofax 17e8ff0
fix conflict
krofax cac2458
fix code issues
krofax a3d3a4c
updated the workflow file
krofax 5ced9a3
updated check breadcrumb script
krofax f782dab
updated script
krofax 66d7e38
updated breadcrumbs script
krofax 6633952
updated script file
krofax 149c30b
fix conflict
krofax dc92482
updated breadcrumbs
krofax 8d26531
updated creadcrumbs
krofax 3ac9f42
fix lint issues
krofax e14923f
updated breadcrumb check script
krofax c264bb4
fix lint issues
krofax 1fdff8c
fix lint markdown issues
krofax be06f2d
fix lint issues
krofax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Check Breadcrumbs | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'pages/**/*.mdx' | ||
| - 'pages/**/*.md' | ||
|
|
||
| jobs: | ||
| check-breadcrumbs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: '20.x' | ||
|
|
||
| - name: Install pnpm | ||
| run: npm install -g pnpm | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install | ||
|
|
||
| - name: Run breadcrumb check | ||
| run: pnpm check-breadcrumbs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| title: Beta Features | ||
| description: Documentation covering Alt Da Mode, Custom Gas Token in the Beta Features section of the OP Stack ecosystem. | ||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Beta Features | ||
|
|
||
| Documentation covering Alt Da Mode, Custom Gas Token in the Beta Features section of the OP Stack ecosystem. | ||
|
|
||
| <Cards> | ||
| <Card title="Alt-DA Mode explainer" href="/stack/beta-features/alt-da-mode" /> | ||
| <Card title="Custom Gas token explainer" href="/stack/beta-features/custom-gas-token" /> | ||
| </Cards> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| title: Fault Proofs | ||
| description: Documentation covering Cannon, Challenger, Explainer, Fp Components, Fp Security, Mips in the Fault Proofs section of the OP Stack ecosystem. | ||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Fault Proofs | ||
|
|
||
| Documentation covering Cannon, Challenger, Explainer, Fp Components, Fp Security, Mips in the Fault Proofs section of the OP Stack ecosystem. | ||
|
|
||
| <Cards> | ||
| <Card title="Fault proof VM - Cannon" href="/stack/fault-proofs/cannon" /> | ||
| <Card title="OP-Challenger explainer" href="/stack/fault-proofs/challenger" /> | ||
| <Card title="Fault proofs explainer" href="/stack/fault-proofs/explainer" /> | ||
| <Card title="FP System components" href="/stack/fault-proofs/fp-components" /> | ||
| <Card title="Fault proofs Mainnet security" href="/stack/fault-proofs/fp-security" /> | ||
| <Card title="Fault proof VM - MIPS.sol" href="/stack/fault-proofs/mips" /> | ||
| </Cards> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| title: Features | ||
| description: Documentation covering Send Raw Transaction Conditional in the Features section of the OP Stack ecosystem. | ||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Features | ||
|
|
||
| Documentation covering Send Raw Transaction Conditional in the Features section of the OP Stack ecosystem. | ||
|
|
||
| <Cards> | ||
| <Card title="SendRawTransactionConditional explainer" href="/stack/features/send-raw-transaction-conditional" /> | ||
| </Cards> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| title: Interop | ||
| description: Documentation covering Cross Chain Message, Explainer, Message Passing, Op Supervisor, Superchain Erc20, Superchain Weth, Supersim, Transfer Superchainerc20 in the Interop section of the OP Stack ecosystem. | ||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Interop | ||
|
|
||
| Documentation covering Cross Chain Message, Explainer, Message Passing, Op Supervisor, Superchain Erc20, Superchain Weth, Supersim, Transfer Superchainerc20 in the Interop section of the OP Stack ecosystem. | ||
|
|
||
| <Cards> | ||
| <Card title="Anatomy of a cross-chain message" href="/stack/interop/cross-chain-message" /> | ||
| <Card title="Interoperability explainer" href="/stack/interop/explainer" /> | ||
| <Card title="Interop message passing overview" href="/stack/interop/message-passing" /> | ||
| <Card title="OP Supervisor" href="/stack/interop/op-supervisor" /> | ||
| <Card title="SuperchainERC20" href="/stack/interop/superchain-erc20" /> | ||
| <Card title="SuperchainWETH (Interoperable ETH)" href="/stack/interop/superchain-weth" /> | ||
| <Card title="Supersim multichain development environment" href="/stack/interop/supersim" /> | ||
| <Card title="How to transfer a SuperchainERC20" href="/stack/interop/transfer-superchainERC20" /> | ||
| </Cards> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| title: Research | ||
| description: Documentation covering Block Time Research in the Research section of the OP Stack ecosystem. | ||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Research | ||
|
|
||
| Documentation covering Block Time Research in the Research section of the OP Stack ecosystem. | ||
|
|
||
| <Cards> | ||
| <Card title="Block time research" href="/stack/research/block-time-research" /> | ||
| </Cards> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| title: Rollup | ||
| description: The big idea that makes Optimism possible is the Optimistic Rollup. We'll go through a brief explainer of *how* Optimistic Rollups work at a high l... | ||
|
krofax marked this conversation as resolved.
|
||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Rollup | ||
|
|
||
| The big idea that makes Optimism possible is the Optimistic Rollup. We'll go through a brief explainer of *how* Optimistic Rollups work at a high l... | ||
|
krofax marked this conversation as resolved.
|
||
|
|
||
| <Cards> | ||
| <Card title="Derivation pipeline" href="/stack/rollup/derivation-pipeline" /> | ||
| <Card title="Sequencer outages" href="/stack/rollup/outages" /> | ||
| <Card title="Rollup protocol overview" href="/stack/rollup/overview" /> | ||
| </Cards> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,16 @@ | ||
| --- | ||
| title: Security | ||
| description: This section provides information on op stack security faqs and pausing the bridge. | ||
| description: Documentation covering Faq, Pause in the Security section of the OP Stack ecosystem. | ||
|
krofax marked this conversation as resolved.
|
||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Security | ||
|
|
||
| This section provides information on op stack security faqs and pausing the bridge. | ||
| Documentation covering Faq, Pause in the Security section of the OP Stack ecosystem. | ||
|
krofax marked this conversation as resolved.
|
||
|
|
||
| <Cards> | ||
| <Card title="Op stack security faqs" href="/stack/security/faq" /> | ||
|
|
||
| <Card title="OP Stack security FAQs" href="/stack/security/faq" /> | ||
| <Card title="Pausing the bridge" href="/stack/security/pause" /> | ||
| </Cards> | ||
| </Cards> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| title: Transactions | ||
| description: Documentation covering Cross Domain, Deposit Flow, Fees, Forced Transaction, Transaction Flow, Withdrawal Flow in the Transactions section of the OP Stack ecosystem. | ||
| lang: en-US | ||
| --- | ||
|
|
||
| import { Card, Cards } from 'nextra/components' | ||
|
|
||
| # Transactions | ||
|
|
||
| Documentation covering Cross Domain, Deposit Flow, Fees, Forced Transaction, Transaction Flow, Withdrawal Flow in the Transactions section of the OP Stack ecosystem. | ||
|
|
||
| <Cards> | ||
| <Card title="Cross-Domain" href="/stack/transactions/cross-domain" /> | ||
| <Card title="Deposit flow" href="/stack/transactions/deposit-flow" /> | ||
| <Card title="Transaction fees on OP Mainnet" href="/stack/transactions/fees" /> | ||
| <Card title="Forced transaction" href="/stack/transactions/forced-transaction" /> | ||
| <Card title="Transaction Flow" href="/stack/transactions/transaction-flow" /> | ||
| <Card title="Withdrawal flow" href="/stack/transactions/withdrawal-flow" /> | ||
| </Cards> | ||
|
krofax marked this conversation as resolved.
Outdated
krofax marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| import * as fs from 'fs/promises'; | ||
| import * as path from 'path'; | ||
| import matter from 'gray-matter'; | ||
|
|
||
| const rootDir = path.join(process.cwd(), 'pages'); | ||
| const warnings: string[] = []; | ||
|
|
||
| // ANSI color codes | ||
| const YELLOW = '\x1b[33m'; | ||
| const RESET = '\x1b[0m'; | ||
| const BOLD = '\x1b[1m'; | ||
|
|
||
| // Pages to exclude from checks | ||
| const excludedPages = [ | ||
| '400.mdx', | ||
| '500.mdx', | ||
| 'index.mdx', | ||
| '404.mdx' | ||
| ]; | ||
|
|
||
| async function getReferencedPagesFromBreadcrumb(breadcrumbPath: string): Promise<string[]> { | ||
| try { | ||
| const content = await fs.readFile(breadcrumbPath, 'utf-8'); | ||
| const cardMatches = content.match(/<Card[^>]*href="([^"]+)"[^>]*>/g) || []; | ||
| return cardMatches.map(match => { | ||
| const hrefMatch = match.match(/href="([^"]+)"/); | ||
| return hrefMatch ? hrefMatch[1] : ''; | ||
| }).filter(Boolean); | ||
| } catch (error) { | ||
| return []; | ||
| } | ||
| } | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
|
|
||
| async function checkDirectory(dirPath: string): Promise<void> { | ||
| const entries = await fs.readdir(dirPath, { withFileTypes: true }); | ||
| const currentDir = path.basename(dirPath); | ||
|
|
||
| // Skip the root directory check | ||
| if (dirPath !== rootDir) { | ||
| const breadcrumbPath = path.join(dirPath, `${currentDir}.mdx`); | ||
| const referencedPages = await getReferencedPagesFromBreadcrumb(breadcrumbPath); | ||
|
|
||
| // Check all .mdx and .md files in the current directory | ||
| for (const entry of entries) { | ||
| if (entry.isFile() && | ||
| (entry.name.endsWith('.mdx') || entry.name.endsWith('.md')) && | ||
| !excludedPages.includes(entry.name) && | ||
| entry.name !== `${currentDir}.mdx`) { | ||
|
|
||
| const pageName = entry.name.replace(/\.(md|mdx)$/, ''); | ||
| // Dynamically construct the path relative to the pages directory | ||
| const relativePath = '/' + path.relative(rootDir, path.join(dirPath, pageName)) | ||
| .replace(/\\/g, '/'); | ||
|
|
||
| if (!referencedPages.includes(relativePath)) { | ||
| const humanReadableName = pageName.split('-') | ||
| .map(word => word.charAt(0).toUpperCase() + word.slice(1)) | ||
| .join(' '); | ||
|
|
||
| warnings.push( | ||
| `Page "${humanReadableName}" at path "${relativePath}" is not listed in the breadcrumb navigation of ${currentDir}.mdx` | ||
| ); | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Process subdirectories | ||
| for (const entry of entries) { | ||
| if (entry.isDirectory() && !entry.name.startsWith('_') && !entry.name.startsWith('.')) { | ||
| await checkDirectory(path.join(dirPath, entry.name)); | ||
| } | ||
| } | ||
| } | ||
|
krofax marked this conversation as resolved.
|
||
|
|
||
| async function main() { | ||
| try { | ||
| await checkDirectory(rootDir); | ||
|
|
||
| if (warnings.length > 0) { | ||
| console.log(`${YELLOW}${BOLD}Missing pages in breadcrumb navigation:${RESET}`); | ||
| warnings.forEach(warning => console.log(`${YELLOW}- ${warning}${RESET}`)); | ||
| process.exit(1); | ||
| } else { | ||
| console.log('All pages are properly listed in their respective breadcrumb navigation files.'); | ||
| } | ||
| } catch (error) { | ||
| console.log(`${YELLOW}${BOLD}Error checking breadcrumbs:${RESET}`, error); | ||
| process.exit(1); | ||
| } | ||
| } | ||
|
|
||
| main(); | ||
|
krofax marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.