@netlify/build 27.15.5 → 27.15.8-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "27.15.5",
3
+ "version": "27.15.8-rc",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./src/core/main.js",
@@ -33,7 +33,7 @@ export const getExpectedVersion = async function ({ versions, nodeVersion, packa
33
33
  // - After their first successful run, plugins are pinned by their major
34
34
  // version which is passed as `pinnedVersion` to the next builds.
35
35
  // When the plugin does not have a `pinnedVersion`, we use the most recent
36
- // `compatibility` entry whith a successful condition.
36
+ // `compatibility` entry with a successful condition.
37
37
  // When the plugin has a `pinnedVersion`, we do not use the `compatibility`
38
38
  // conditions. Instead, we just use the most recent entry with a `version`
39
39
  // matching `pinnedVersion`.
@@ -42,7 +42,12 @@ export const getExpectedVersion = async function ({ versions, nodeVersion, packa
42
42
  // - Otherwise, use `latestVersion`
43
43
  const getCompatibleEntry = async function ({ versions, nodeVersion, packageJson, buildDir, pinnedVersion }) {
44
44
  if (pinnedVersion !== undefined) {
45
- return versions.find(({ version }) => semver.satisfies(version, pinnedVersion)) || { version: pinnedVersion }
45
+ // invalid semver versions are coerced to valid ones (e.g 4.17.1-runtime.7 -> 4.17.1)
46
+ return (
47
+ versions.find(({ version }) => semver.satisfies(semver.coerce(version), pinnedVersion)) || {
48
+ version: pinnedVersion,
49
+ }
50
+ )
46
51
  }
47
52
 
48
53
  const versionsWithConditions = versions.filter(hasConditions)