Befor generating

This commit is contained in:
marys committed 2026-06-01 13:17:37 +02:00
1 parent 3383f4bf4a
commit 1aa1b5f625
6756 files changed
+649946 -1

No files matched your search

+22
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.
+19
View File
@@ -0,0 +1,19 @@
# @babel/preset-react
> Babel preset for all React plugins.
See our website [@babel/preset-react](https://babeljs.io/docs/babel-preset-react) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22area%3A%20react%22+is%3Aopen) associated with this package.
## Install
Using npm:
```sh
npm install --save-dev @babel/preset-react
```
or using yarn:
```sh
yarn add @babel/preset-react --dev
```
+77
View File
@@ -0,0 +1,77 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var helperPluginUtils = require('@babel/helper-plugin-utils');
var transformReactJSX = require('@babel/plugin-transform-react-jsx');
var transformReactJSXDevelopment = require('@babel/plugin-transform-react-jsx-development');
var transformReactDisplayName = require('@babel/plugin-transform-react-display-name');
var transformReactPure = require('@babel/plugin-transform-react-pure-annotations');
var helperValidatorOption = require('@babel/helper-validator-option');
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
var transformReactJSX__default = /*#__PURE__*/_interopDefault(transformReactJSX);
var transformReactJSXDevelopment__default = /*#__PURE__*/_interopDefault(transformReactJSXDevelopment);
var transformReactDisplayName__default = /*#__PURE__*/_interopDefault(transformReactDisplayName);
var transformReactPure__default = /*#__PURE__*/_interopDefault(transformReactPure);
new helperValidatorOption.OptionValidator("@babel/preset-react");
function normalizeOptions(options = {}) {
let {
pragma,
pragmaFrag
} = options;
const {
pure,
throwIfNamespace = true,
runtime = "classic",
importSource,
useBuiltIns,
useSpread
} = options;
if (runtime === "classic") {
pragma = pragma || "React.createElement";
pragmaFrag = pragmaFrag || "React.Fragment";
}
const development = options.development == null ? undefined : !!options.development;
return {
development,
importSource,
pragma,
pragmaFrag,
pure,
runtime,
throwIfNamespace,
useBuiltIns,
useSpread
};
}
var index = helperPluginUtils.declarePreset((api, opts) => {
api.assertVersion(7);
const {
development = false,
importSource,
pragma,
pragmaFrag,
pure,
runtime,
throwIfNamespace
} = normalizeOptions(opts);
return {
plugins: [[development ? transformReactJSXDevelopment__default.default : transformReactJSX__default.default, {
importSource,
pragma,
pragmaFrag,
runtime,
throwIfNamespace,
pure,
useBuiltIns: !!opts.useBuiltIns,
useSpread: opts.useSpread
}], transformReactDisplayName__default.default, pure !== false && transformReactPure__default.default].filter(Boolean)
};
});
exports.default = index;
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../src/normalize-options.ts","../src/index.ts"],"sourcesContent":["import {\n OptionValidator,\n findSuggestion,\n} from \"@babel/helper-validator-option\";\nconst v = new OptionValidator(\"@babel/preset-react\");\n\nexport default function normalizeOptions(options: any = {}) {\n if (process.env.BABEL_8_BREAKING) {\n if (\"useSpread\" in options) {\n throw new Error(\n '@babel/preset-react: Since Babel 8, an inline object with spread elements is always used, and the \"useSpread\" option is no longer available. Please remove it from your config.',\n );\n }\n\n if (\"useBuiltIns\" in options) {\n const useBuiltInsFormatted = JSON.stringify(options.useBuiltIns);\n throw new Error(\n `@babel/preset-react: Since \"useBuiltIns\" is removed in Babel 8, you can remove it from the config.\n- Babel 8 now transforms JSX spread to object spread. If you need to transpile object spread with\n\\`useBuiltIns: ${useBuiltInsFormatted}\\`, you can use the following config\n{\n \"plugins\": [\n [\"@babel/plugin-transform-object-rest-spread\", { \"loose\": true, \"useBuiltIns\": ${useBuiltInsFormatted} }]\n ],\n \"presets\": [\"@babel/preset-react\"]\n}`,\n );\n }\n\n const TopLevelOptions = {\n development: \"development\",\n importSource: \"importSource\",\n pragma: \"pragma\",\n pragmaFrag: \"pragmaFrag\",\n pure: \"pure\",\n runtime: \"runtime\",\n throwIfNamespace: \"throwIfNamespace\",\n };\n v.validateTopLevelOptions(options, TopLevelOptions);\n const development = v.validateBooleanOption(\n TopLevelOptions.development,\n options.development,\n );\n let importSource = v.validateStringOption(\n TopLevelOptions.importSource,\n options.importSource,\n );\n let pragma = v.validateStringOption(TopLevelOptions.pragma, options.pragma);\n let pragmaFrag = v.validateStringOption(\n TopLevelOptions.pragmaFrag,\n options.pragmaFrag,\n );\n const pure = v.validateBooleanOption(TopLevelOptions.pure, options.pure);\n const runtime = v.validateStringOption(\n TopLevelOptions.runtime,\n options.runtime,\n \"automatic\",\n );\n const throwIfNamespace = v.validateBooleanOption(\n TopLevelOptions.throwIfNamespace,\n options.throwIfNamespace,\n true,\n );\n\n const validRuntime = [\"classic\", \"automatic\"];\n\n if (runtime === \"classic\") {\n pragma = pragma || \"React.createElement\";\n pragmaFrag = pragmaFrag || \"React.Fragment\";\n } else if (runtime === \"automatic\") {\n importSource = importSource || \"react\";\n } else {\n throw new Error(\n `@babel/preset-react: 'runtime' must be one of ['automatic', 'classic'] but we have '${runtime}'\\n` +\n `- Did you mean '${findSuggestion(runtime, validRuntime)}'?`,\n );\n }\n\n return {\n development,\n importSource,\n pragma,\n pragmaFrag,\n pure,\n runtime,\n throwIfNamespace,\n };\n } else {\n let { pragma, pragmaFrag } = options;\n\n const {\n pure,\n throwIfNamespace = true,\n runtime = \"classic\",\n importSource,\n useBuiltIns,\n useSpread,\n } = options;\n\n if (runtime === \"classic\") {\n pragma = pragma || \"React.createElement\";\n pragmaFrag = pragmaFrag || \"React.Fragment\";\n }\n\n const development =\n options.development == null ? undefined : !!options.development;\n\n return {\n development,\n importSource,\n pragma,\n pragmaFrag,\n pure,\n runtime,\n throwIfNamespace,\n useBuiltIns,\n useSpread,\n };\n }\n}\n","import { declarePreset } from \"@babel/helper-plugin-utils\";\nimport transformReactJSX from \"@babel/plugin-transform-react-jsx\";\nimport transformReactJSXDevelopment from \"@babel/plugin-transform-react-jsx-development\";\nimport transformReactDisplayName from \"@babel/plugin-transform-react-display-name\";\nimport transformReactPure from \"@babel/plugin-transform-react-pure-annotations\";\nimport normalizeOptions from \"./normalize-options.ts\";\nimport type { PluginItem } from \"@babel/core\";\n\nexport interface Options {\n development?: boolean;\n importSource?: string;\n pragma?: string;\n pragmaFrag?: string;\n pure?: string;\n runtime?: \"automatic\" | \"classic\";\n throwIfNamespace?: boolean;\n useBuiltIns?: boolean;\n useSpread?: boolean;\n}\n\nexport default declarePreset((api, opts: Options) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const {\n development = process.env.BABEL_8_BREAKING\n ? api.env(env => env === \"development\")\n : false,\n importSource,\n pragma,\n pragmaFrag,\n pure,\n runtime,\n throwIfNamespace,\n } = normalizeOptions(opts);\n\n return {\n plugins: [\n [\n development ? transformReactJSXDevelopment : transformReaLine truncated
+37
View File
@@ -0,0 +1,37 @@
{
"name": "@babel/preset-react",
"version": "7.29.7",
"description": "Babel preset for all React plugins.",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-preset-react",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22area%3A%20react%22+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-preset-react"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/helper-plugin-utils": "^7.29.7",
"@babel/helper-validator-option": "^7.29.7",
"@babel/plugin-transform-react-display-name": "^7.29.7",
"@babel/plugin-transform-react-jsx": "^7.29.7",
"@babel/plugin-transform-react-jsx-development": "^7.29.7",
"@babel/plugin-transform-react-pure-annotations": "^7.29.7"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/helper-plugin-test-runner": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}