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

9
server/node_modules/browserslist-to-esbuild/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Marco Fugaro <marco.fugaro@gmail.com> (https://marcofuga.ro)
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.

51
server/node_modules/browserslist-to-esbuild/README.md generated vendored Normal file
View File

@@ -0,0 +1,51 @@
# browserslist-to-esbuild
> Use [browserslist](https://github.com/browserslist/browserslist) with [esbuild](https://esbuild.github.io/).
Allows you to use use browserslist and pass the correct browsers to esbuild's [target](https://esbuild.github.io/api/#target) option.
## Install
```
npm install --save-dev browserslist-to-esbuild
```
or
```
yarn add --dev browserslist-to-esbuild
```
## Usage
You can call `browserslistToEsbuild()` directly in your `esbuild.mjs` script, it will look for your browserslist config in either `package.json` or the `.browserslistrc`.
It will return an esbuild-compatible array of browsers.
```js
import { build } from 'esbuild'
import browserslistToEsbuild from 'browserslist-to-esbuild'
build({
entryPoints: ['input.js'],
outfile: 'output.js',
bundle: true,
target: browserslistToEsbuild(), // --> ["chrome79", "edge92", "firefox91", "safari13.1"]
}).catch(() => process.exit(1))
```
Otherwise, you can pass yourself a browserslist array or string to the function.
```js
browserslistToEsbuild(['>0.2%', 'not dead', 'not op_mini all'])
```
## API
### browserslistToEsbuild(browserslistConfig?)
#### browserslistConfig
Type: `array | string | undefined`
An array of string of browsers [compatible with browserslist](https://github.com/browserslist/browserslist#full-list). If none is passed, a browserslist config is searched in the script running directory.

View File

@@ -0,0 +1,37 @@
{
"name": "browserslist-to-esbuild",
"version": "1.2.0",
"description": "Use browserslist with esbuild",
"license": "MIT",
"repository": "marcofugaro/browserslist-to-esbuild",
"author": {
"name": "Marco Fugaro",
"email": "marco.fugaro@gmail.com",
"url": "https://marcofuga.ro"
},
"keywords": [
"browserslist",
"browserlist",
"esbuild",
"browsers"
],
"type": "commonjs",
"main": "./src/index.js",
"exports": "./src/index.js",
"types": "./src/index.d.ts",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "ava"
},
"files": [
"src/"
],
"dependencies": {
"browserslist": "^4.17.3"
},
"devDependencies": {
"ava": "^3.15.0"
}
}

View File

@@ -0,0 +1,2 @@
declare const browserslistToEsbuild: (browserslistConfig?: string[] | string) => string[]
export default browserslistToEsbuild

View File

@@ -0,0 +1,74 @@
const browserslist = require('browserslist')
// convert the browserslist field in package.json to
// esbuild compatible array of browsers
function browserslistToEsbuild(browserslistConfig) {
if (!browserslistConfig) {
// the path from where the script is run
const path = process.cwd()
// read config if none is passed
browserslistConfig = browserslist.loadConfig({ path })
}
const SUPPORTED_ESBUILD_TARGETS = ['es', 'chrome', 'edge', 'firefox', 'ios', 'node', 'safari']
// https://github.com/eBay/browserslist-config/issues/16#issuecomment-863870093
const UNSUPPORTED = ['android 4']
const replaces = {
ios_saf: 'ios',
android: 'chrome',
}
const separator = ' '
return (
browserslist(browserslistConfig)
// filter out the unsupported ones
.filter((b) => !UNSUPPORTED.some((u) => b.startsWith(u)))
// transform into ['chrome', '88']
.map((b) => b.split(separator))
// replace the similar browser
.map((b) => {
if (replaces[b[0]]) {
b[0] = replaces[b[0]]
}
return b
})
// 11.0-12.0 --> 11.0
.map((b) => {
if (b[1].includes('-')) {
b[1] = b[1].slice(0, b[1].indexOf('-'))
}
return b
})
// 11.0 --> 11
.map((b) => {
if (b[1].endsWith('.0')) {
b[1] = b[1].slice(0, -2)
}
return b
})
// only get the ones supported by esbuild
.filter((b) => SUPPORTED_ESBUILD_TARGETS.includes(b[0]))
// only get the oldest version
.reduce((acc, b) => {
const existingIndex = acc.findIndex((br) => br[0] === b[0])
if (existingIndex !== -1) {
acc[existingIndex][1] = b[1]
} else {
acc.push(b)
}
return acc
}, [])
// remove separator
.map((b) => b.join(''))
)
}
module.exports = browserslistToEsbuild