import { readFile, readdir } from "node:fs/promises"; import path from "node:path"; import { fileURLToPath } from "node:url"; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const packageJson = JSON.parse( await readFile(path.join(root, "package.json"), "utf8"), ); const engineDirectory = path.join(root, "public", "engines"); const entries = (await readdir(engineDirectory)).sort(); if ( packageJson.version !== "0.1.0" || entries.length !== 1 || entries[0] !== "README.md" ) { throw new Error( "The ECMAScript release must contain only the documented native-browser engine placeholder.", ); } console.log( "Regex Tools 0.1.0 uses the native browser RegExp engine; no external engine pack needs building.", );