MCPcopy Create free account
hub / github.com/remix-run/react-router / main

Function main

scripts/changes/validate.ts:24–60  ·  view source on GitHub ↗

* Validates all change files in the repository * Exits with code 1 if any validation errors are found

()

Source from the content-addressed store, hash-verified

22 * Exits with code 1 if any validation errors are found
23 */
24function main() {
25 let hasErrors = false;
26
27 // Validate all packages have changelogs
28 console.log("Validating package changelogs...\n");
29 let missingChangelogPackageDirNames = getMissingChangelogPackageDirNames();
30
31 if (missingChangelogPackageDirNames.length > 0) {
32 hasErrors = true;
33 console.error(colorize("Missing changelogs", colors.red) + "\n");
34 for (let packageDirName of missingChangelogPackageDirNames) {
35 console.error(`📦 ${packageDirName}: Missing CHANGELOG.md file`);
36 }
37 console.error();
38 }
39
40 // Validate change files
41 console.log("Validating change files...\n");
42 let result = parseAllChangeFiles();
43
44 if (!result.valid) {
45 hasErrors = true;
46 console.error(colorize("Invalid change files", colors.red) + "\n");
47 console.error(formatValidationErrors(result.errors));
48 console.error();
49 } else if (result.releases.length === 0) {
50 console.log(colorize("Nothing to release!", colors.lightGreen) + "\n");
51 } else {
52 console.log(
53 colorize("All change files are valid!", colors.lightGreen) + "\n",
54 );
55 }
56
57 if (hasErrors) {
58 process.exit(1);
59 }
60}
61
62main();

Callers 1

validate.tsFile · 0.70

Calls 7

colorizeFunction · 0.90
parseAllChangeFilesFunction · 0.90
formatValidationErrorsFunction · 0.90
logMethod · 0.80
errorMethod · 0.80
exitMethod · 0.45

Tested by

no test coverage detected