From 8f5d3dccc94f21b7814c8e389e692d0bc03d542c Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Thu, 25 Jul 2024 16:52:40 -0400 Subject: [PATCH] chore(repo): cache documentation script (#27100) ## Current Behavior `documentation` is not cacheable. It is reran everytime someone tries to push, including the following flow: - git push, fails as docs changes found - git commit -am "chore(repo): add docs" - git push, runs full docs cycle again in pre-push hook ## Expected Behavior `documentation` is cacheable, and avoids rerunning when no fs changes are made ## Related Issue(s) Fixes # --- package.json | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6366d2b491..e96dde9972 100644 --- a/package.json +++ b/package.json @@ -376,7 +376,26 @@ "check-lock-files", "check-codeowners", "documentation" - ] + ], + "targets": { + "documentation": { + "cache": true, + "inputs": [ + "{workspaceRoot}/packages/**", + "{workspaceRoot}/docs/**", + "{workspaceRoot}/scripts/documentation/**", + "!{workspaceRoot}/docs/generated", + "!{workspaceRoot}/packages/**/*.spec.ts", + "!{workspaceRoot}/packages/**/project.json", + "!{workspaceRoot}/packages/**/tsconfig.json", + "!{workspaceRoot}/packages/**/tsconfig.lib.json", + "!{workspaceRoot}/packages/**/tsconfig.spec.json", + "!{workspaceRoot}/packages/**/jest.config.{ts,js}", + "!{workspaceRoot}/packages/**/.eslintrc.json" + ] + }, + "outputs": ["{workspaceRoot}/docs/generated"] + } }, "packageManager": "pnpm@8.15.7" }