From c07e6d4fa9a922ae25c640a32ccb0e99cb597fef Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Thu, 10 Jun 2021 09:30:40 +0100 Subject: [PATCH] chore(docs): ensure old docs are removed when generating (#7308) I lost time today due to some old docs files lingering for code that is now gone. To avoid that happening, let's remove the directories before generating. As part of this work I also changed the API Extractor to not output to `temp/X.api.json` and instead `docs-api-json/X.api.json` to make it clearer what that folder is for. --- .gitignore | 1 + api-extractor.json | 3 ++- package.json | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1b6fdd7c47280..2b7b3cb6c2114 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ test/coverage.json temp/ new-docs/ puppeteer.tgz +docs-api-json/ diff --git a/api-extractor.json b/api-extractor.json index 0426638054075..615f57fda3dff 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -8,7 +8,8 @@ }, "docModel": { - "enabled": true + "enabled": true, + "apiJsonFilePath": "/docs-api-json/.api.json" }, "dtsRollup": { diff --git a/package.json b/package.json index 09b3fd071afee..800c356239cd3 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,9 @@ "tsc-esm": "tsc -b src/tsconfig.esm.json", "apply-next-version": "node utils/apply_next_version.js", "test-install": "scripts/test-install.sh", - "generate-d-ts": "api-extractor run --local --verbose", - "generate-docs": "npm run generate-d-ts && api-documenter markdown -i temp -o new-docs", + "clean-docs": "rimraf new-docs && rimraf docs-api-json", + "generate-d-ts": "npm run clean-docs && api-extractor run --local --verbose", + "generate-docs": "npm run generate-d-ts && api-documenter markdown -i docs-api-json -o new-docs", "ensure-correct-devtools-protocol-revision": "ts-node -s scripts/ensure-correct-devtools-protocol-package", "ensure-pinned-deps": "ts-node -s scripts/ensure-pinned-deps", "test-types-file": "ts-node -s scripts/test-ts-definition-files.ts",