Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/website/scripts: Eval pre-1.0 policies in v0 compatibility mode #7233

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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