Skip to content

Commit c0be1f5

Browse files
committed
refactor: number nested folders by sidebar position
- rename hand-authored folders to use numeric prefixes matching their _category_.json position (concepts, guides, reference, api, apps, solana) - update autogen-reference.sh and graphql.ts to write into prefixed paths - delete orphan docs/api/05-airdrops; promote docs/api/airdrops into the slot - add Bob Vaults section to docs/concepts/14-fees.mdx (fixes broken anchor) - drop dead baseURL from graphql-markdown plugin config - ignore .ai/ in prettier
1 parent f2ee26b commit c0be1f5

2,012 files changed

Lines changed: 94618 additions & 78974 deletions

File tree

Some content is hidden

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

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# directories
2+
.ai
23
.docusaurus
34
.serena
45
build

cli/autogen-reference.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ root=$(pwd)
2020
bun install --cwd "$root/repos/evm-monorepo"
2121

2222
# Define the contracts directories
23-
airdrops=docs/reference/airdrops/contracts
24-
bob=docs/reference/bob/contracts
25-
flow=docs/reference/flow/contracts
26-
lockup=docs/reference/lockup/contracts
27-
utils=docs/reference/utils/contracts
23+
airdrops=docs/reference/03-airdrops/contracts
24+
bob=docs/reference/05-bob/contracts
25+
flow=docs/reference/04-flow/contracts
26+
lockup=docs/reference/02-lockup/contracts
27+
utils=docs/reference/06-utils/contracts
2828

2929
# Delete the current contracts documentations
3030
for dir in $airdrops $bob $flow $lockup $utils; do
@@ -57,7 +57,7 @@ fix_utils_abstract() {
5757
}
5858

5959
lint() {
60-
contracts=docs/reference/$1/contracts
60+
contracts=${!1}
6161

6262
# Cache find result to avoid redundant filesystem scan
6363
all_md_files=$(find $contracts -type f -name "*.md")
@@ -90,7 +90,7 @@ run() {
9090
cd "$root"
9191

9292
# Define the contracts directory
93-
contracts=docs/reference/$repo/contracts
93+
contracts=${!repo}
9494

9595
# Copy over the auto-generated files
9696
rsync --archive \
@@ -125,7 +125,7 @@ run() {
125125
sd "\{SablierMerkleSignature\}" "[SablierMerkleSignature](/$contracts/abstracts/abstract.SablierMerkleSignature.md)" $all_md_files
126126

127127
# The Airdrops has certain references to the Lockup
128-
sd "\{SablierLockup\}" "[SablierLockup](/reference/lockup/contracts/contract.SablierLockup.md)" $all_md_files
128+
sd "\{SablierLockup\}" "[SablierLockup](/$lockup/contract.SablierLockup.md)" $all_md_files
129129

130130
# Airdrops-only evm-utils abstract
131131
sd "\bAdminable\b" "[Adminable](/$contracts/abstracts/abstract.Adminable.md)" $all_md_files
@@ -149,7 +149,7 @@ run() {
149149
sd "/$lockup/interfaces/interface.InvalidStreamInCancelMultiple.md" "/$lockup/interfaces/interface.ISablierLockup.md#invalidstreamincancelmultiple" $all_md_files
150150
sd "/node_modules/forge-std/src/mocks/MockERC721.sol/contract.MockERC721.md" "https://eips.ethereum.org/EIPS/eip-165" $all_md_files
151151
sd "/node_modules/@arbitrum/token-bridge-contracts/contracts/tokenbridge/libraries/ERC165.sol/abstract.ERC165.md#supportsinterface" "https://eips.ethereum.org/EIPS/eip-165" $all_md_files
152-
# TODO: retarget to /reference/utils/contracts/contract.SablierComptroller.md now that the page exists
152+
# TODO: retarget to /reference/06-utils/contracts/contract.SablierComptroller.md now that the page exists
153153
sd "/node_modules/@sablier/evm-utils/docs/reference/lockup/contracts/contract.SablierComptroller.md#supportsinterface" "https://eips.ethereum.org/EIPS/eip-165" $all_md_files
154154

155155
# Rewrite Unicode-art math in LockupMath natspec to KaTeX-compatible LaTeX.
@@ -192,7 +192,7 @@ run() {
192192

193193
# Fix external contract references that don't have docs
194194
if [ "$repo" = "lockup" ]; then
195-
# TODO: retarget to /reference/utils/contracts/contract.SablierComptroller.md now that the page exists
195+
# TODO: retarget to /reference/06-utils/contracts/contract.SablierComptroller.md now that the page exists
196196
sd "\[SablierComptroller\]\(/$lockup/contract\.SablierComptroller\.md\)" "**SablierComptroller**" $all_md_files
197197
sd "/node_modules/@sablier/evm-utils[^\"]*contract\.SablierComptroller\.md[^\"]*" "https://eips.ethereum.org/EIPS/eip-165" $all_md_files
198198
fi

cli/commands/autogen/graphql.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import type { CliOptions } from "../../types";
1111

1212
const CHAIN_ID_SEPOLIA = 11_155_111;
1313

14+
// Numeric prefix encodes the sidebar position; keep in sync with `docs/api/` folders.
15+
const INDEXER_FOLDER: Record<Indexer.IndexerKey, string> = {
16+
airdrops: "05-airdrops",
17+
streams: "04-streams",
18+
};
19+
1420
type Category = {
1521
/** @see https://docusaurus.io/feature-requests/p/hiding-parts-of-docs-in-autogenerated-sidebar */
1622
className?: "hidden";
@@ -131,7 +137,7 @@ function cleanupDocs(docsPaths: string[]): void {
131137
}
132138

133139
async function generateEnvio(indexer: Indexer.IndexerKey): Promise<string> {
134-
const docsPath = `./docs/api/${indexer}/graphql/envio`;
140+
const docsPath = `./docs/api/${INDEXER_FOLDER[indexer]}/graphql/envio`;
135141
const schemaURL = getIndexerEnvio({ chainId: CHAIN_ID_SEPOLIA, indexer }).endpoint.url;
136142

137143
await runCommand(docsPath, schemaURL);
@@ -140,7 +146,7 @@ async function generateEnvio(indexer: Indexer.IndexerKey): Promise<string> {
140146
}
141147

142148
async function generateGraph(indexer: Indexer.IndexerKey): Promise<string> {
143-
const docsPath = `./docs/api/${indexer}/graphql/the-graph`;
149+
const docsPath = `./docs/api/${INDEXER_FOLDER[indexer]}/graphql/the-graph`;
144150
const schemaURL = getIndexerGraph({ chainId: CHAIN_ID_SEPOLIA, indexer }).testingURL;
145151

146152
await runCommand(docsPath, schemaURL);

config/plugins.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ type GraphQLMarkdownOptions = GraphQLMarkdownCliOptions & Partial<PluginOptions>
3232
const graphqlMarkdown: [string, GraphQLMarkdownOptions] = [
3333
"@graphql-markdown/docusaurus",
3434
/**
35-
* Some settings will be overridden by the CLI.
35+
* The CLI provides `--base` and `--schema` per invocation; everything below is shared config.
3636
* @see https://graphql-markdown.dev/docs/settings
3737
*/
3838
{
39-
baseURL: "./docs/api/streams/the-graph",
4039
homepage: "static/graphql-overview.md",
4140
loaders: {
4241
UrlLoader: {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)