fix the case where a range is specified

pull/3622/head
yann300 2 years ago
parent dae0708a90
commit d40d83256f
  1. 6
      libs/remix-url-resolver/src/resolve.ts
  2. 2
      package.json
  3. 7
      yarn.lock

@ -1,5 +1,6 @@
// eslint-disable-next-line no-unused-vars
import axios, { AxiosResponse } from 'axios'
import semver from 'semver'
import { BzzNode as Bzz } from '@erebos/bzz-node'
export interface Imported {
@ -171,7 +172,10 @@ export class RemixURLResolver {
// package.json
version = deps[pkg]
}
if (version) url = url.replace(pkg, `${pkg}@${version}`)
if (version) {
const versionSemver = semver.minVersion(version)
url = url.replace(pkg, `${pkg}@${versionSemver.version}`)
}
}
}
} catch (e) {

@ -342,7 +342,7 @@
"request": "^2.83.0",
"rimraf": "^2.6.1",
"selenium-standalone": "^8.2.3",
"semver": "^6.3.0",
"semver": "^7.4.0",
"solc": "0.7.4",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",

@ -23663,6 +23663,13 @@ semver@^7.3.7:
dependencies:
lru-cache "^6.0.0"
semver@^7.4.0:
version "7.4.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.4.0.tgz#8481c92feffc531ab1e012a8ffc15bdd3a0f4318"
integrity sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw==
dependencies:
lru-cache "^6.0.0"
semver@~7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"

Loading…
Cancel
Save