Skip to content

Commit

Permalink
docs/website/scripts: Eval pre-1.0 policies in v0 compatibility mode
Browse files Browse the repository at this point in the history
Signed-off-by: Ashutosh Narkar <[email protected]>
  • Loading branch information
ashutosh-narkar committed Dec 20, 2024
1 parent c91c895 commit bb10c56
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/website/scripts/live-blocks/src/preprocess/localEval.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down

0 comments on commit bb10c56

Please sign in to comment.