diff --git a/docs/website/scripts/live-blocks/src/preprocess/localEval.js b/docs/website/scripts/live-blocks/src/preprocess/localEval.js index 0a5609de67..bdd9b85c9f 100644 --- a/docs/website/scripts/live-blocks/src/preprocess/localEval.js +++ b/docs/website/scripts/live-blocks/src/preprocess/localEval.js @@ -69,7 +69,13 @@ export default async function localEval(groups, groupName, opaVersion) { // Returns 1st a function that consumes a string for the output format you want and produces an array of arguments and 2nd a map of module file names to strings that should be replaced in error messages. May throw a user-friendly error. async function prepEval(groups, groupName, opaVersion) { const {module, package: pkg, query, input, included} = getGroupData(groups, groupName) - const base = ['eval', '--fail', '--v1-compatible'] // Fail on undefined + const base = ['eval', '--fail'] // Fail on undefined + + // eval pre-1.0 policies in v0 compatible mode. + if (semver.valid(opaVersion) && semver.satisfies(semver.coerce(opaVersion), '<1.0.0')) { + base.push('--v0-compatible') + } + const rest = [] const moduleFilenameMap = {}