| 165 | } |
| 166 | |
| 167 | class GitHubReleaseResolver { |
| 168 | |
| 169 | supportsDescriptor(descriptor, opts) { |
| 170 | return supports(descriptor.range); |
| 171 | } |
| 172 | |
| 173 | supportsLocator(locator, opts) { |
| 174 | return supports(locator.reference); |
| 175 | } |
| 176 | |
| 177 | shouldPersistResolution(locator, opts) { |
| 178 | return true; |
| 179 | } |
| 180 | |
| 181 | bindDescriptor(descriptor, fromLocator, opts) { |
| 182 | return descriptor; |
| 183 | } |
| 184 | |
| 185 | getResolutionDependencies(descriptor, opts) { |
| 186 | return []; |
| 187 | } |
| 188 | |
| 189 | async getCandidates(descriptor, dependencies, opts) { |
| 190 | return [structUtils.convertDescriptorToLocator(descriptor)]; |
| 191 | } |
| 192 | |
| 193 | async getSatisfying(descriptor, dependencies, locators, opts) { |
| 194 | return { |
| 195 | locators |
| 196 | }; |
| 197 | } |
| 198 | |
| 199 | async resolve(locator, opts) { |
| 200 | const parts = parse(locator.reference); |
| 201 | |
| 202 | const fsLibDep = structUtils.makeDescriptor(structUtils.makeIdent('yarnpkg', 'fslib'), YARN_FS_VERSION) |
| 203 | |
| 204 | const dependencies = new Map(); |
| 205 | dependencies.set(fsLibDep.identHash, fsLibDep); |
| 206 | |
| 207 | return { |
| 208 | ...locator, |
| 209 | version: parts.version, |
| 210 | languageName: opts.project.configuration.get(`defaultLanguageName`), |
| 211 | linkType: LinkType.HARD, |
| 212 | dependencies: opts.project.configuration.normalizeDependencyMap(dependencies), |
| 213 | bin: [ |
| 214 | [ parts.binary, 'exec.js' ] |
| 215 | ] |
| 216 | }; |
| 217 | } |
| 218 | |
| 219 | } |
| 220 | |
| 221 | return { |
| 222 | fetchers: [ GitHubReleaseFetcher ], |
nothing calls this directly
no outgoing calls
no test coverage detected