aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivisionByZero <[email protected]>2023-02-18 01:07:09 +0100
committerGitHub <[email protected]>2023-02-18 01:07:09 +0100
commitc8c0ca21872e38b97e12a4ee5cd1132fe8a438ce (patch)
treec3f626bd87738a3657cd0fbf1b4b19596cb648ad
parent2e2db6cffbaab669f8ff363b07c92314513702e0 (diff)
downloadfaker-c8c0ca21872e38b97e12a4ee5cd1132fe8a438ce.tar.xz
faker-c8c0ca21872e38b97e12a4ee5cd1132fe8a438ce.zip
infra: add preflight script (#1846)
-rw-r--r--.github/pull_request_template.md2
-rw-r--r--.github/workflows/commentCodeGeneration.ts2
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--package.json4
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 @@
+<!-- Please run `pnpm run preflight` before opening a Pull Request to ensure that your code fulfills the minimal requirements for our project. -->
+
<!-- Please first read https://github.com/faker-js/faker/blob/next/CONTRIBUTING.md -->
<!-- Help us by writing a correct PR title following this guide: https://github.com/faker-js/faker/blob/next/CONTRIBUTING.md#committing -->
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 <code>generate:*</code> commands.\nPlease run <code>pnpm run generate:locales</code>, <code>pnpm run generate:api-docs</code>, and <code>pnpm run test -u</code> to generate/update the related files, and commit them.`;
+ const body = `Uncommitted changes were detected after runnning <code>generate:*</code> commands.\nPlease run <code>pnpm run preflight</code> 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",