Skip to content

chore: update min build version #704

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

Merged
merged 2 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/helpers/verification.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ exports.verifyBuildTarget = (target) => {
}
}

// This is when the esbuild dynamic import support was added
const REQUIRED_BUILD_VERSION = '>=15.11.5'
// This is when nft support was added
const REQUIRED_BUILD_VERSION = '>=18.16.0'

exports.verifyNetlifyBuildVersion = ({ IS_LOCAL, NETLIFY_BUILD_VERSION, failBuild }) => {
// We check for build version because that's what's available to us, but prompt about the cli because that's what they can upgrade
if (IS_LOCAL && !satisfies(NETLIFY_BUILD_VERSION, REQUIRED_BUILD_VERSION, { includePrerelease: true })) {
return failBuild(outdent`
This version of the Essential Next.js plugin requires netlify-cli@4.4.2 or higher. Please upgrade and try again.
This version of the Essential Next.js plugin requires netlify-cli@6.12.4 or higher. Please upgrade and try again.
You can do this by running: "npm install -g netlify-cli@latest" or "yarn global add netlify-cli@latest"
`)
}
Expand Down
6 changes: 3 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ describe('preBuild()', () => {
expect(
plugin.onPreBuild({
...defaultArgs,
constants: { IS_LOCAL: true, NETLIFY_BUILD_VERSION: '15.11.4' },
constants: { IS_LOCAL: true, NETLIFY_BUILD_VERSION: '18.15.0' },
}),
).rejects.toThrow('This version of the Essential Next.js plugin requires netlify-cli@4.4.2 or higher')
).rejects.toThrow('This version of the Essential Next.js plugin requires netlify-cli')
})

test('passes if the build version is new enough', async () => {
expect(
plugin.onPreBuild({
...defaultArgs,
constants: { IS_LOCAL: true, NETLIFY_BUILD_VERSION: '15.12.2' },
constants: { IS_LOCAL: true, NETLIFY_BUILD_VERSION: '18.16.1' },
}),
).resolves.not.toThrow()
})
Expand Down