node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

21
server/node_modules/get-latest-version/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018 Espen Hovlandsdal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

65
server/node_modules/get-latest-version/README.md generated vendored Normal file
View File

@@ -0,0 +1,65 @@
# get-latest-version
Find the latest version of an npm module matching a given semver range
[![npm version](https://img.shields.io/npm/v/get-latest-version.svg?style=flat-square)](https://www.npmjs.com/package/get-latest-version)[![Build status](https://img.shields.io/github/actions/workflow/status/rexxars/get-latest-version/test.yml?branch=main&style=flat-square)](https://github.com/rexxars/get-latest-version/actions/workflows/test.yml)
## Installing
```
npm install --save get-latest-version
```
## Basic usage
```js
const getLatestVersion = require('get-latest-version')
getLatestVersion('some-module')
.then((version) => console.log(version)) // 1.0.0, or whichever is 'latest'
.catch((err) => console.error(err))
getLatestVersion('some-other-module', {range: '^1.0.0'})
.then((version) => console.log(version)) // highest version matching ^1.0.0 range
.catch((err) => console.error(err))
// Returns both the highest in the given range and the actual `latest` tag
// Note that this differens in that the return value is an object
getLatestVersion('@sanity/base', {range: '^1.0.0', includeLatest: true})
.then((versions) => console.log(versions)) // {inRange: '1.150.8', latest '2.23.0'}
.catch((err) => console.error(err))
```
## Disabling authenticated requests
By default, this module will read the authorization token for whichever registry the module belongs to, based on local npm configuration. To disable this and always send unauthenticated requests to the registry, provide `auth: false` to the options:
```js
getLatestVersion('some-module', {auth: false})
.then((version) => console.log(version))
.catch((err) => console.error(err))
```
## Using custom registry
By default, module utilizes [registry-url](https://www.npmjs.com/package/registry-url) to resolve registry URL from NPM configuration files. However, if you need to set up the registry programmatically, you can make use of the `registryUrl` option:
```js
getLatestVersion('some-module', {registryUrl: 'https://some-custom-registry.com'})
.then((version) => console.log(version))
.catch((err) => console.error(err))
```
## Developing
```bash
git clone git@github.com:rexxars/get-latest-version.git
cd get-latest-version
npm install
npm test
```
## License
MIT © [Espen Hovlandsdal](https://espen.codes/)

53
server/node_modules/get-latest-version/package.json generated vendored Normal file
View File

@@ -0,0 +1,53 @@
{
"name": "get-latest-version",
"version": "5.1.0",
"description": "Find the latest version of an npm module matching a given semver range",
"main": "src/index.js",
"types": "src/index.d.ts",
"scripts": {
"test": "jest",
"posttest": "eslint ."
},
"engines": {
"node": ">=14.18"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/rexxars/get-latest-version.git"
},
"files": [
"src"
],
"keywords": [
"npm",
"registry",
"version",
"semver"
],
"author": "Espen Hovlandsdal <espen@hovlandsdal.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/rexxars/get-latest-version/issues"
},
"homepage": "https://github.com/rexxars/get-latest-version#readme",
"devDependencies": {
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-sanity": "^6.0.0",
"jest": "^29.3.1",
"prettier": "^2.8.3"
},
"dependencies": {
"get-it": "^8.0.9",
"registry-auth-token": "^5.0.2",
"registry-url": "^5.1.0",
"semver": "^7.3.8"
},
"jest": {
"verbose": true,
"testEnvironment": "node",
"collectCoverageFrom": [
"src/**.js"
]
}
}

31
server/node_modules/get-latest-version/src/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,31 @@
declare namespace getLatestVersion {
interface BaseOptions {
readonly auth?: boolean
readonly range?: string
readonly registryUrl?: string
}
interface WithLatestOptions extends BaseOptions {
readonly includeLatest: true
}
interface Options extends BaseOptions {
readonly includeLatest?: false
}
interface ResolvedVersions {
latest: string
inRange: string | undefined
}
}
declare function getLatestVersion(
pkgName: string,
optionsOrRange?: string
): Promise<string | undefined>
declare function getLatestVersion(
pkgName: string,
optionsOrRange: getLatestVersion.Options
): Promise<string | undefined>
declare function getLatestVersion(
pkgName: string,
optionsOrRange: getLatestVersion.WithLatestOptions
): Promise<getLatestVersion.ResolvedVersions>
export = getLatestVersion

95
server/node_modules/get-latest-version/src/index.js generated vendored Normal file
View File

@@ -0,0 +1,95 @@
const url = require('url')
const {getIt} = require('get-it')
const {debug, retry, promise, httpErrors, jsonResponse} = require('get-it/middleware')
const registryUrl = require('registry-url')
const registryAuthToken = require('registry-auth-token')
const semver = require('semver')
const isJson = (contentType) => /(application\/json|\+json)/.test(contentType || '')
function shouldRetry(err, num, options) {
const response = err.response || {statusCode: 500, headers: {}}
return (
// allow retries on low-level errors (socket errors et al)
retry.shouldRetry(err, num, options) ||
// npm registry routinely fails, giving 503 and similar
(response && response.statusCode >= 500) ||
// npm registry sometimes returns 2xx with HTML content
(response.statusCode < 300 && !isJson(response.headers['content-type']))
)
}
function resolveRegistryUrl(pkgName, options) {
if (options.registryUrl) {
return options.registryUrl
}
const scope = pkgName.split('/')[0]
return registryUrl(scope);
}
const httpRequest = getIt([
jsonResponse({force: true}),
httpErrors(),
debug({namespace: 'get-latest-version'}),
promise(),
retry({shouldRetry}),
])
async function getLatestVersion(pkgName, opts) {
const options =
typeof opts === 'string'
? {range: opts, auth: true}
: Object.assign({range: 'latest', auth: true}, opts)
const regUrl = resolveRegistryUrl(pkgName, options)
const pkgUrl = url.resolve(regUrl, encodeURIComponent(pkgName).replace(/^%40/, '@'))
const authInfo = options.auth && registryAuthToken(regUrl, {recursive: true})
const request = options.request || httpRequest
const headers = {
accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*',
}
if (authInfo) {
headers.authorization = `${authInfo.type} ${authInfo.token}`
}
let res
try {
res = await request({url: pkgUrl, headers})
} catch (err) {
if (err.response && err.response.statusCode === 404) {
throw new Error(`Package \`${pkgName}\` doesn't exist`)
}
throw err
}
const data = res.body
const range = options.range
const latest = data['dist-tags'].latest
if (data['dist-tags'][range]) {
return options.includeLatest
? {latest, inRange: data['dist-tags'][range]}
: data['dist-tags'][range]
}
if (data.versions[range]) {
return options.includeLatest ? {latest, inRange: range} : range
}
const versions = Object.keys(data.versions)
const version = semver.maxSatisfying(versions, range)
if (version) {
return options.includeLatest ? {latest, inRange: version} : version
}
return options.includeLatest ? {latest, inRange: undefined} : undefined
}
getLatestVersion.request = httpRequest
module.exports = getLatestVersion