Skip to content

Commit a10724a

Browse files
Add Token API docs (#906)
* Add Token API docs * Try to make build pass in CI * Ah, put it in Docker too, just in case * Add missing files * Updating name * Adding images * Improvements and fixes * Renaming banner * Updating alt-text * Better redirects * Last round of updates --------- Co-authored-by: Michael Macaulay <[email protected]>
1 parent 6a8397c commit a10724a

File tree

450 files changed

+11748
-1730
lines changed

Some content is hidden

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

450 files changed

+11748
-1730
lines changed

.prettierignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
out/
44
pnpm-lock.yaml
55
dist/
6-
# ignore below md since they are fetched from GitHub
6+
# fetched files
7+
website/src/openApi/*.json
78
website/src/pages/*/subgraphs/developing/creating/graph-ts/*.md
8-
website/src/pages/*/subgraphs/querying/graph-client/*.md
9+
website/src/pages/*/subgraphs/querying/graph-client/*.md

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENV ENVIRONMENT=$ENVIRONMENT
77
ENV ORIGIN=$ORIGIN
88

99
ENV PNPM_HOME="/usr/bin"
10+
ENV NODE_OPTIONS="--max_old_space_size=8192"
1011

1112
RUN apk add --no-cache git
1213
RUN npm install -g corepack@latest

nginx.conf

+5-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ http {
7575
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/quick-start/$ $scheme://$http_host/docs/$1/subgraphs/quick-start/ permanent;
7676
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/subgraph-debug-forking/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/subgraph-debug-forking/ permanent;
7777
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/subgraph-uncrashable/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/subgraph-uncrashable/ permanent;
78-
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/substreams-powered-subgraphs/$ $scheme://$http_host/docs/$1/sps/introduction/ permanent;
78+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/substreams-powered-subgraphs/$ $scheme://$http_host/docs/$1/sps/introduction/ permanent;
7979
rewrite ^/docs/([a-zA-Z][a-zA-Z])/subgraphs/cookbook/substreams-powered-subgraphs/$ $scheme://$http_host/docs/$1/sps/introduction/ permanent;
8080
rewrite ^/docs/([a-zA-Z][a-zA-Z])/cookbook/timeseries/$ $scheme://$http_host/docs/$1/subgraphs/best-practices/timeseries/ permanent;
8181
rewrite ^/docs/([a-zA-Z][a-zA-Z])/subgraphs/cookbook/timeseries/$ $scheme://$http_host/docs/$1/subgraphs/best-practices/timeseries/ permanent;
@@ -140,6 +140,7 @@ http {
140140
rewrite ^/docs/([a-zA-Z][a-zA-Z])/resources/release-notes/assemblyscript-migration-guide/$ $scheme://$http_host/docs/$1/resources/migration-guides/assemblyscript-migration-guide/ permanent;
141141
rewrite ^/docs/([a-zA-Z][a-zA-Z])/release-notes/graphql-validations-migration-guide/$ $scheme://$http_host/docs/$1/resources/migration-guides/graphql-validations-migration-guide/ permanent;
142142
rewrite ^/docs/([a-zA-Z][a-zA-Z])/resources/release-notes/graphql-validations-migration-guide/$ $scheme://$http_host/docs/$1/resources/migration-guides/graphql-validations-migration-guide/ permanent;
143+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/sps/$ $scheme://$http_host/docs/$1/sps/introduction/ permanent;
143144
rewrite ^/docs/([a-zA-Z][a-zA-Z])/sps/triggers-example/$ $scheme://$http_host/docs/$1/sps/tutorial/ permanent;
144145
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/billing/$ $scheme://$http_host/docs/$1/subgraphs/billing/ permanent;
145146
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/deploy-subgraph-studio/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/using-subgraph-studio/ permanent;
@@ -148,8 +149,8 @@ http {
148149
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/studio-faq/$ $scheme://$http_host/docs/$1/resources/subgraph-studio-faq/ permanent;
149150
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/subgraph-studio/$ $scheme://$http_host/docs/$1/subgraphs/developing/deploying/using-subgraph-studio/ permanent;
150151
rewrite ^/docs/([a-zA-Z][a-zA-Z])/studio/transferring-subgraph-ownership/$ $scheme://$http_host/docs/$1/subgraphs/developing/managing/transferring-a-subgraph/ permanent;
151-
rewrite ^/docs/([a-zA-Z][a-zA-Z])/subgraphs/$ $scheme://$http_host/docs/$1/subgraphs/developing/subgraphs/ permanent;
152-
rewrite ^/docs/([a-zA-Z][a-zA-Z])/substreams/$ $scheme://$http_host/docs/$1/substreams/introduction/ permanent;
152+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/subgraphs/$ $scheme://$http_host/docs/$1/subgraphs/quick-start/ permanent;
153+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/substreams/$ $scheme://$http_host/docs/$1/substreams/quick-start/ permanent;
153154
rewrite ^/docs/([a-zA-Z][a-zA-Z])/substreams/sps/(.*)$ $scheme://$http_host/docs/$1/sps/$2 permanent;
154155
rewrite ^/docs/([a-zA-Z][a-zA-Z])/substreams/developing/sinks/sinks/$ $scheme://$http_host/docs/$1/substreams/developing/sinks/ permanent;
155156
rewrite ^/docs/([a-zA-Z][a-zA-Z])/sunrise/$ $scheme://$http_host/docs/$1/archived/sunrise/ permanent;
@@ -158,6 +159,7 @@ http {
158159
rewrite ^/docs/([a-zA-Z][a-zA-Z])/supported-networks/near/$ $scheme://$http_host/docs/$1/subgraphs/cookbook/near/ permanent;
159160
rewrite ^/docs/([a-zA-Z][a-zA-Z])/tap/$ $scheme://$http_host/docs/$1/indexing/tap/ permanent;
160161
rewrite ^/docs/([a-zA-Z][a-zA-Z])/tokenomics/$ $scheme://$http_host/docs/$1/resources/tokenomics/ permanent;
162+
rewrite ^/docs/([a-zA-Z][a-zA-Z])/token-api/$ $scheme://$http_host/docs/$1/token-api/quick-start/ permanent;
161163

162164
# Temporary redirects (302)
163165
rewrite ^/docs/en/querying/graph-client/$ $scheme://$http_host/docs/en/subgraphs/querying/graph-client/README/ redirect;

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "graph-docs",
33
"private": true,
44
"version": "1.0.0",
5-
"packageManager": "pnpm@10.6.5",
5+
"packageManager": "pnpm@10.7.0",
66
"scripts": {
77
"dev": "turbo run dev",
8-
"build": "NODE_OPTIONS='--max_old_space_size=4096' turbo run build",
8+
"build": "NODE_OPTIONS='--max_old_space_size=8192' turbo run build",
99
"check": "pnpm typecheck && pnpm lint && pnpm prettier:check",
1010
"check:fix": "pnpm lint:fix; pnpm prettier",
1111
"lint": "eslint . --ignore-path .gitignore --max-warnings 0",
@@ -20,9 +20,9 @@
2020
},
2121
"devDependencies": {
2222
"@edgeandnode/eslint-config": "^2.0.3",
23-
"@types/node": "^22.13.11",
23+
"@types/node": "^22.13.14",
2424
"eslint": "^8.57.1",
25-
"eslint-plugin-mdx": "^3.2.0",
25+
"eslint-plugin-mdx": "^3.3.1",
2626
"prettier": "^3.5.3",
2727
"prettier-plugin-tailwindcss": "^0.6.11",
2828
"remark-frontmatter": "^5.0.0",

packages/og-image/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
"yoga-wasm-web": "^0.3.3"
1717
},
1818
"devDependencies": {
19-
"@cloudflare/workers-types": "^4.20250320.0",
20-
"@types/react": "^18.3.19",
19+
"@cloudflare/workers-types": "^4.20250321.0",
20+
"@types/react": "^18.3.20",
2121
"jest-image-snapshot": "^6.4.0",
2222
"tsx": "^4.19.3",
2323
"typescript": "^5.8.2",
2424
"vitest": "^2.1.9",
25-
"wrangler": "^3.114.2"
25+
"wrangler": "^3.114.3"
2626
},
2727
"sideEffects": false
2828
}

packages/remark-callouts/index.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { visit } from 'unist-util-visit'
2+
3+
export default function remarkCallouts() {
4+
return (tree) => {
5+
visit(tree, 'blockquote', (node) => {
6+
if (
7+
node.children &&
8+
node.children.length > 0 &&
9+
node.children[0].type === 'paragraph' &&
10+
node.children[0].children &&
11+
node.children[0].children.length > 0 &&
12+
node.children[0].children[0].type === 'text'
13+
) {
14+
const firstText = node.children[0].children[0]
15+
// Look for a callout marker like [!NOTE] or [!WARNING]
16+
const calloutRegex = /^\s*\[!([a-zA-Z]+)\]\s*(.*)/
17+
const match = calloutRegex.exec(firstText.value)
18+
if (match) {
19+
// Extract the callout type (e.g., "note") and remove the marker from the text
20+
const calloutType = match[1].toLowerCase()
21+
firstText.value = match[2]
22+
23+
// Attach the callout type as a data attribute
24+
node.data = node.data || {}
25+
node.data.hProperties = node.data.hProperties || {}
26+
node.data.hProperties['data-callout-type'] = calloutType
27+
28+
// If the remaining text is empty (or only whitespace), remove the first paragraph and show a default title instead
29+
if (firstText.value.trim() === '') {
30+
node.children.shift()
31+
node.data.hProperties['data-callout-type-show-title'] = true
32+
}
33+
}
34+
}
35+
})
36+
}
37+
}

packages/remark-callouts/package.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "remark-callouts",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"main": "index.js",
7+
"author": "Benoît Rouleau <[email protected]>",
8+
"dependencies": {
9+
"unist-util-visit": "^5.0.0"
10+
},
11+
"sideEffects": false
12+
}

0 commit comments

Comments
 (0)