From ec457f72df81ba914f70ecbec8a98a5bc6681c69 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Thu, 19 Jun 2025 12:53:01 -0400 Subject: [PATCH] chore(repo): add raw-docs (#31640) This PR adds `raw-docs` integration. See here for more details: https://github.com/nrwl/raw-docs --- .gitignore | 3 +++ .rawdocs.json | 10 ++++++++++ package.json | 3 ++- tools/scripts/analyze-docs.mjs | 18 ++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .rawdocs.json create mode 100755 tools/scripts/analyze-docs.mjs diff --git a/.gitignore b/.gitignore index 27f93e6666..65756abf75 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,6 @@ node_modules/ # Task files tasks.json tasks/ + +# Raw docs local configuration (machine-specific) +.rawdocs.local.json diff --git a/.rawdocs.json b/.rawdocs.json new file mode 100644 index 0000000000..4c9e6e0820 --- /dev/null +++ b/.rawdocs.json @@ -0,0 +1,10 @@ +{ + "include": ["apps/**/*", "libs/**/*", "packages/**/*"], + "exclude": [ + "**/*.spec.*", + "**/test/**/*", + "**/__tests__/**/*", + "**/*.test.*", + "node_modules/**/*" + ] +} diff --git a/package.json b/package.json index a2950cc327..511b148c78 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "e2e": "nx run-many -t e2e --projects ./e2e/*", "build:wasm": "rustup override set nightly-2025-05-09 && rustup target add wasm32-wasip1-threads && WASI_SDK_PATH=\"$(pwd)/wasi-sdk-23.0-x86_64-linux\" CMAKE_BUILD_PARALLEL_LEVEL=2 LIBSQLITE3_FLAGS=\"-DLONGDOUBLE_TYPE=double\" pnpm exec nx run-many -t build-native-wasm && rustup override unset", "lint-pnpm-lock": "eslint pnpm-lock.yaml", - "migrate-to-pnpm-version": "node ./scripts/migrate-to-pnpm-version.js" + "migrate-to-pnpm-version": "node ./scripts/migrate-to-pnpm-version.js", + "analyze-docs": "node tools/scripts/analyze-docs.mjs" }, "devDependencies": { "@actions/core": "^1.10.0", diff --git a/tools/scripts/analyze-docs.mjs b/tools/scripts/analyze-docs.mjs new file mode 100755 index 0000000000..6e971af344 --- /dev/null +++ b/tools/scripts/analyze-docs.mjs @@ -0,0 +1,18 @@ +#!/usr/bin/env node +import { readFileSync } from 'fs'; +import { execSync } from 'child_process'; +try { + const config = JSON.parse( + readFileSync(new URL('../../.rawdocs.local.json', import.meta.url)) + ); + execSync( + `node ${config.rawDocsPath}/scripts/analyze-changes.mjs ${process.argv + .slice(2) + .join(' ')}`, + { stdio: 'inherit' } + ); +} catch { + console.log( + `Error: Run installation with:\ngh api repos/nrwl/raw-docs/contents/install.sh --jq '.content' | base64 -d | bash` + ); +}