From c8c0ca21872e38b97e12a4ee5cd1132fe8a438ce Mon Sep 17 00:00:00 2001 From: DivisionByZero Date: Sat, 18 Feb 2023 01:07:09 +0100 Subject: infra: add preflight script (#1846) --- .github/pull_request_template.md | 2 ++ .github/workflows/commentCodeGeneration.ts | 2 +- CONTRIBUTING.md | 2 +- package.json | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9c07d984..8ec56cca 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,5 @@ + + diff --git a/.github/workflows/commentCodeGeneration.ts b/.github/workflows/commentCodeGeneration.ts index 74a80927..f456e563 100644 --- a/.github/workflows/commentCodeGeneration.ts +++ b/.github/workflows/commentCodeGeneration.ts @@ -21,7 +21,7 @@ module.exports = async ( issue_number: context.issue.number, }); - const body = `Uncommitted changes were detected after runnning generate:* commands.\nPlease run pnpm run generate:locales, pnpm run generate:api-docs, and pnpm run test -u to generate/update the related files, and commit them.`; + const body = `Uncommitted changes were detected after runnning generate:* commands.\nPlease run pnpm run preflight to generate/update the related files, and commit them.`; const botComment = comments.find( (comment) => comment.user?.type === 'Bot' && comment.body?.includes(body) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66503087..acdf2559 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ If you want to make `Faker` a better, please read the following contribution gui # Important -- Please make sure that you run `pnpm install`, `pnpm run build` and `pnpm run test` before making a PR to ensure that everything is working from the start. +Please make sure that you run `pnpm run preflight` before making a PR to ensure that everything is working from the start. ## Good to know diff --git a/package.json b/package.json index fb70aa2b..1ffe79c2 100644 --- a/package.json +++ b/package.json @@ -72,13 +72,15 @@ "ts-check:scripts": "tsc --project tsconfig.check-scripts.json", "ts-check:tests": "tsc --project tsconfig.check-tests.json", "test": "vitest", + "test:update-snapshots": "vitest run -u", "coverage": "vitest run --coverage", "cypress": "cypress", "docs:test:e2e:ci": "run-s docs:build:ci docs:test:e2e:run", "docs:test:e2e:run": "run-p --race docs:serve \"cypress run\"", "docs:test:e2e:open": "run-p --race docs:serve \"cypress open\"", "release": "standard-version", - "prepublishOnly": "pnpm run clean && pnpm install && pnpm run build" + "prepublishOnly": "pnpm run clean && pnpm install && pnpm run build", + "preflight": "pnpm install && run-s format lint build generate:* test:update-snapshots" }, "devDependencies": { "@actions/github": "~5.1.1", -- cgit v1.2.3