From f5d6f97f204af84170d58922d2b025d35a3e44a6 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Sat, 21 Sep 2024 08:22:30 +0200 Subject: [PATCH] fix: add doc-check script Uses tsc to attempt to compile any `typescript` code blocks in markdown files to ensure our examples don't get out of date. --- .gitignore | 2 ++ benchmarks/add-dir/package.json | 1 + benchmarks/gc/package.json | 1 + benchmarks/pinning/package.json | 1 + benchmarks/transfer/package.json | 1 + package.json | 1 + packages/block-brokers/package.json | 1 + packages/car/package.json | 1 + packages/dag-cbor/package.json | 1 + packages/dag-json/package.json | 1 + packages/helia/package.json | 1 + packages/http/package.json | 1 + packages/interface/package.json | 1 + packages/interop/package.json | 1 + packages/ipns/package.json | 1 + packages/json/package.json | 1 + packages/mfs/package.json | 1 + packages/routers/package.json | 1 + packages/strings/package.json | 1 + packages/unixfs/package.json | 1 + packages/utils/package.json | 1 + 21 files changed, 22 insertions(+) diff --git a/.gitignore b/.gitignore index 7ad9e674e..f115d26b9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ node_modules package-lock.json yarn.lock .vscode +.tmp-compiled-docs +tsconfig-doc-check.aegir.json diff --git a/benchmarks/add-dir/package.json b/benchmarks/add-dir/package.json index f1caa15c0..c242c9f57 100644 --- a/benchmarks/add-dir/package.json +++ b/benchmarks/add-dir/package.json @@ -9,6 +9,7 @@ "build": "aegir build --bundle false", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "start": "npm run build && node dist/src/index.js" }, "dependencies": { diff --git a/benchmarks/gc/package.json b/benchmarks/gc/package.json index c4da23734..a5b900378 100644 --- a/benchmarks/gc/package.json +++ b/benchmarks/gc/package.json @@ -7,6 +7,7 @@ "build": "aegir build --bundle false", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "start": "npm run build && node dist/src/index.js" }, "dependencies": { diff --git a/benchmarks/pinning/package.json b/benchmarks/pinning/package.json index 4a683179e..f0467ccb6 100644 --- a/benchmarks/pinning/package.json +++ b/benchmarks/pinning/package.json @@ -7,6 +7,7 @@ "build": "aegir build --bundle false", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "start": "npm run build && node dist/src/index.js" }, "dependencies": { diff --git a/benchmarks/transfer/package.json b/benchmarks/transfer/package.json index 5a6d0ee5f..8a37dbb81 100644 --- a/benchmarks/transfer/package.json +++ b/benchmarks/transfer/package.json @@ -9,6 +9,7 @@ "build": "aegir build --bundle false", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "start": "npm run build && node dist/src/index.js" }, "dependencies": { diff --git a/package.json b/package.json index 19d967ed7..38404f68f 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "build": "aegir run build", "lint": "aegir run lint", "dep-check": "aegir run dep-check", + "doc-check": "aegir run doc-check", "release": "run-s build docs:no-publish npm:release docs", "npm:release": "aegir exec --bail false npm -- publish", "release:rc": "aegir release-rc", diff --git a/packages/block-brokers/package.json b/packages/block-brokers/package.json index 65462b4b8..dc78e708f 100644 --- a/packages/block-brokers/package.json +++ b/packages/block-brokers/package.json @@ -43,6 +43,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/car/package.json b/packages/car/package.json index a6f73a979..e0e372704 100644 --- a/packages/car/package.json +++ b/packages/car/package.json @@ -128,6 +128,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/dag-cbor/package.json b/packages/dag-cbor/package.json index cbcea710b..c34e0bc7f 100644 --- a/packages/dag-cbor/package.json +++ b/packages/dag-cbor/package.json @@ -128,6 +128,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "docs": "aegir docs", "test": "aegir test", diff --git a/packages/dag-json/package.json b/packages/dag-json/package.json index 14f405548..26dca34cc 100644 --- a/packages/dag-json/package.json +++ b/packages/dag-json/package.json @@ -128,6 +128,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/helia/package.json b/packages/helia/package.json index 0caa4d5d6..0e3a41bc8 100644 --- a/packages/helia/package.json +++ b/packages/helia/package.json @@ -43,6 +43,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/http/package.json b/packages/http/package.json index 39a15f631..852c217e6 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -43,6 +43,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/interface/package.json b/packages/interface/package.json index e8dae9cb8..0da488c41 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -67,6 +67,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build" }, "dependencies": { diff --git a/packages/interop/package.json b/packages/interop/package.json index d13a4f44b..45504f808 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -47,6 +47,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/ipns/package.json b/packages/ipns/package.json index c0cf9bbbd..fbbb7ef1f 100644 --- a/packages/ipns/package.json +++ b/packages/ipns/package.json @@ -152,6 +152,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "docs": "aegir docs", "test": "aegir test", diff --git a/packages/json/package.json b/packages/json/package.json index 242d6efed..518b1277e 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -128,6 +128,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/mfs/package.json b/packages/mfs/package.json index 502818cd8..d66e9725f 100644 --- a/packages/mfs/package.json +++ b/packages/mfs/package.json @@ -128,6 +128,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/routers/package.json b/packages/routers/package.json index b00cb06c0..1d6ececc4 100644 --- a/packages/routers/package.json +++ b/packages/routers/package.json @@ -43,6 +43,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/strings/package.json b/packages/strings/package.json index 3e47696a0..0cd8fd373 100644 --- a/packages/strings/package.json +++ b/packages/strings/package.json @@ -129,6 +129,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "docs": "aegir docs", "test": "aegir test", diff --git a/packages/unixfs/package.json b/packages/unixfs/package.json index 5b8e62eb5..f9e2ce2e6 100644 --- a/packages/unixfs/package.json +++ b/packages/unixfs/package.json @@ -148,6 +148,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov", diff --git a/packages/utils/package.json b/packages/utils/package.json index 2baa8d06b..11f6d3d82 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -43,6 +43,7 @@ "clean": "aegir clean", "lint": "aegir lint", "dep-check": "aegir dep-check", + "doc-check": "aegir doc-check", "build": "aegir build", "test": "aegir test", "test:chrome": "aegir test -t browser --cov",