feat: add multi-engine regex flavour support
This commit is contained in:
@@ -37,20 +37,34 @@ const packageJson = JSON.parse(
|
||||
);
|
||||
const engineDirectory = path.join(root, "public", "engines");
|
||||
const entries = (await readdir(engineDirectory)).sort();
|
||||
const expectedEntries = [
|
||||
"README.md",
|
||||
"cpp",
|
||||
"dotnet",
|
||||
"go",
|
||||
"java",
|
||||
"pcre2",
|
||||
"perl",
|
||||
"php",
|
||||
"python",
|
||||
"ruby",
|
||||
"rust",
|
||||
];
|
||||
|
||||
if (
|
||||
typeof packageJson.version !== "string" ||
|
||||
entries.length !== 4 ||
|
||||
entries[0] !== "README.md" ||
|
||||
entries[1] !== "java" ||
|
||||
entries[2] !== "pcre2" ||
|
||||
entries[3] !== "python"
|
||||
entries.length !== expectedEntries.length ||
|
||||
entries.some((entry, index) => entry !== expectedEntries[index])
|
||||
) {
|
||||
throw new Error(
|
||||
"The production build requires the documented Java, PCRE2 and Python runtime packs.",
|
||||
"The production build requires every documented checked-in runtime pack.",
|
||||
);
|
||||
}
|
||||
|
||||
console.log(
|
||||
"The checked-in Java, PCRE2 and Python runtime packs are present; no release-time download or engine compilation is needed.",
|
||||
`The checked-in ${expectedEntries
|
||||
.filter((entry) => entry !== "README.md")
|
||||
.join(
|
||||
", ",
|
||||
)} runtime packs are present; no release-time download or engine compilation is needed.`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user