Jesus sucks

This commit is contained in:
2024-12-17 13:23:11 -08:00
parent 3a3382ffff
commit b2dbf46d28
13060 changed files with 1310035 additions and 1 deletions

View File

@@ -0,0 +1,94 @@
# Contributing
## Adding a new plugin or polyfill to support (when approved in the next ECMAScript version)
### Update [`plugin-features.js`](https://github.com/babel/babel/blob/main/packages/babel-compat-data/scripts/data/plugin-features.js)
*Example:*
If you were going to add `**` which is in ES2016:
Find the relevant entries on [compat-table](https://kangax.github.io/compat-table/es2016plus/#test-exponentiation_(**)_operator):
`exponentiation (**) operator`
Find the corresponding babel plugin:
`@babel/plugin-transform-exponentiation-operator`
And add them in this structure:
```js
// es2016
"@babel/plugin-transform-exponentiation-operator": {
features: [
"exponentiation (**) operator",
],
},
```
### Update data for `core-js@2` polyfilling
*Example:*
In case you want to add `Object.values` which is in ES2017:
Find the relevant feature and subfeature on [compat-table](https://kangax.github.io/compat-table/es2016plus/#test-Object_static_methods_Object.values)
and split it with `/`:
`Object static methods / Object.values`
Find the corresponding module on [`core-js@2`](https://github.com/zloirock/core-js/tree/v2/modules):
`es7.object.values.js`
Find required ES version in [`corejs2-built-in-features.js`](https://github.com/babel/babel/blob/main/packages/babel-preset-env/data/corejs2-built-in-features.js) and add the new feature:
```js
const es = {
//...
"es7.object.values": "Object static methods / Object.values"
}
```
If you want to transform a new built-in by `useBuiltIns: 'usage'`, add mapping to related `core-js` modules to [this file](https://github.com/babel/babel/blob/main/packages/babel-preset-env/polyfills/corejs2/built-in-definitions.js).
### Update data for `core-js@3` polyfilling
Just update the version of [`core-js-compat`](https://github.com/zloirock/core-js/tree/main/packages/core-js-compat) in dependencies.
If you want to transform a new built-in by `useBuiltIns: 'usage'`, add mapping to related [`core-js`](https://github.com/zloirock/core-js/tree/main/packages/core-js/modules) modules to [this file](https://github.com/babel/babel/blob/main/packages/babel-preset-env/polyfills/corejs3/built-in-definitions.js).
If you want to mark a new proposal as shipped, add it to [this list](https://github.com/babel/babel/blob/main/packages/babel-preset-env/polyfills/corejs3/shipped-proposals.js).
### Update [`plugins.json`](https://github.com/babel/babel/blob/main/packages/babel-preset-env/data/plugins.json)
Until `compat-table` is a standalone npm module for data we are using the git commit in `packages/babel-compat-data/scripts/download-compat-table.sh`
`COMPAT_TABLE_COMMIT=[latest-commit-hash]`,
So we update and then run `npm run build-data`. If there are no changes, then `plugins.json` will be the same.
## Tests
### Running tests
See general [CONTRIBUTING.md](https://github.com/babel/babel/blob/main/CONTRIBUTING.md#running-lintingtests).
### Writing tests
#### General
All the tests for `@babel/preset-env` exist in the `test/fixtures` folder. The
test setup and conventions are exactly the same as testing a Babel plugin, so
please read our [documentation on writing tests](https://github.com/babel/babel/blob/main/CONTRIBUTING.md#babel-plugin-x).
#### Testing the `debug` option
Testing debug output to `stdout` is similar. Under the `test/debug-fixtures`,
create a folder with a descriptive name of your test, and add the following:
* Add a `options.json` file (just as the other tests, this is essentially a
`.babelrc`) with the desired test configuration (required)
* Add a `stdout.txt` file with the expected debug output. For added
convenience, if there is no `stdout.txt` present, the test runner will
generate one for you.

View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
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.

View File

@@ -0,0 +1,19 @@
# @babel/preset-env
> A Babel preset for each environment.
See our website [@babel/preset-env](https://babeljs.io/docs/babel-preset-env) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20preset-env%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/preset-env
```
or using yarn:
```sh
yarn add @babel/preset-env --dev
```

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("@babel/compat-data/native-modules");

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("@babel/compat-data/native-modules");

View File

@@ -0,0 +1,4 @@
// TODO: Remove in Babel 8
// https://github.com/vuejs/vue-cli/issues/3671
module.exports = require("./corejs2-built-ins.json");

View File

@@ -0,0 +1,4 @@
// TODO: Remove in Babel 8
// https://github.com/vuejs/vue-cli/issues/3671
module.exports = require("./corejs2-built-ins.json");

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("core-js-compat/data.json");

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("@babel/compat-data/corejs2-built-ins");

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("@babel/compat-data/corejs2-built-ins");

View File

@@ -0,0 +1 @@
{ "type": "commonjs" }

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("@babel/compat-data/plugins");

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("@babel/compat-data/plugins");

View File

@@ -0,0 +1,4 @@
// TODO: Remove in Babel 8
const { pluginSyntaxMap, proposalPlugins, proposalSyntaxPlugins } = require("../lib/shipped-proposals");
module.exports = { pluginSyntaxMap, proposalPlugins, proposalSyntaxPlugins };

View File

@@ -0,0 +1,3 @@
// TODO: Remove in Babel 8
module.exports = require("@babel/helper-compilation-targets").unreleasedLabels;

View File

@@ -0,0 +1,102 @@
{
"name": "@babel/preset-env",
"version": "7.26.0",
"description": "A Babel preset for each environment.",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-preset-env",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20preset-env%22+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-preset-env"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/compat-data": "^7.26.0",
"@babel/helper-compilation-targets": "^7.25.9",
"@babel/helper-plugin-utils": "^7.25.9",
"@babel/helper-validator-option": "^7.25.9",
"@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.9",
"@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.9",
"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.9",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.9",
"@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.9",
"@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2",
"@babel/plugin-syntax-import-assertions": "^7.26.0",
"@babel/plugin-syntax-import-attributes": "^7.26.0",
"@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
"@babel/plugin-transform-arrow-functions": "^7.25.9",
"@babel/plugin-transform-async-generator-functions": "^7.25.9",
"@babel/plugin-transform-async-to-generator": "^7.25.9",
"@babel/plugin-transform-block-scoped-functions": "^7.25.9",
"@babel/plugin-transform-block-scoping": "^7.25.9",
"@babel/plugin-transform-class-properties": "^7.25.9",
"@babel/plugin-transform-class-static-block": "^7.26.0",
"@babel/plugin-transform-classes": "^7.25.9",
"@babel/plugin-transform-computed-properties": "^7.25.9",
"@babel/plugin-transform-destructuring": "^7.25.9",
"@babel/plugin-transform-dotall-regex": "^7.25.9",
"@babel/plugin-transform-duplicate-keys": "^7.25.9",
"@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.9",
"@babel/plugin-transform-dynamic-import": "^7.25.9",
"@babel/plugin-transform-exponentiation-operator": "^7.25.9",
"@babel/plugin-transform-export-namespace-from": "^7.25.9",
"@babel/plugin-transform-for-of": "^7.25.9",
"@babel/plugin-transform-function-name": "^7.25.9",
"@babel/plugin-transform-json-strings": "^7.25.9",
"@babel/plugin-transform-literals": "^7.25.9",
"@babel/plugin-transform-logical-assignment-operators": "^7.25.9",
"@babel/plugin-transform-member-expression-literals": "^7.25.9",
"@babel/plugin-transform-modules-amd": "^7.25.9",
"@babel/plugin-transform-modules-commonjs": "^7.25.9",
"@babel/plugin-transform-modules-systemjs": "^7.25.9",
"@babel/plugin-transform-modules-umd": "^7.25.9",
"@babel/plugin-transform-named-capturing-groups-regex": "^7.25.9",
"@babel/plugin-transform-new-target": "^7.25.9",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.25.9",
"@babel/plugin-transform-numeric-separator": "^7.25.9",
"@babel/plugin-transform-object-rest-spread": "^7.25.9",
"@babel/plugin-transform-object-super": "^7.25.9",
"@babel/plugin-transform-optional-catch-binding": "^7.25.9",
"@babel/plugin-transform-optional-chaining": "^7.25.9",
"@babel/plugin-transform-parameters": "^7.25.9",
"@babel/plugin-transform-private-methods": "^7.25.9",
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
"@babel/plugin-transform-property-literals": "^7.25.9",
"@babel/plugin-transform-regenerator": "^7.25.9",
"@babel/plugin-transform-regexp-modifiers": "^7.26.0",
"@babel/plugin-transform-reserved-words": "^7.25.9",
"@babel/plugin-transform-shorthand-properties": "^7.25.9",
"@babel/plugin-transform-spread": "^7.25.9",
"@babel/plugin-transform-sticky-regex": "^7.25.9",
"@babel/plugin-transform-template-literals": "^7.25.9",
"@babel/plugin-transform-typeof-symbol": "^7.25.9",
"@babel/plugin-transform-unicode-escapes": "^7.25.9",
"@babel/plugin-transform-unicode-property-regex": "^7.25.9",
"@babel/plugin-transform-unicode-regex": "^7.25.9",
"@babel/plugin-transform-unicode-sets-regex": "^7.25.9",
"@babel/preset-modules": "0.1.6-no-external-plugins",
"babel-plugin-polyfill-corejs2": "^0.4.10",
"babel-plugin-polyfill-corejs3": "^0.10.6",
"babel-plugin-polyfill-regenerator": "^0.6.1",
"core-js-compat": "^3.38.1",
"semver": "^6.3.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/core-7.12": "npm:@babel/core@7.12.9",
"@babel/helper-plugin-test-runner": "^7.25.9",
"@babel/traverse": "^7.25.9"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}