This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

22
node_modules/@babel/plugin-transform-runtime/LICENSE generated vendored Normal file
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
node_modules/@babel/plugin-transform-runtime/README.md generated vendored Normal file
View File

@ -0,0 +1,19 @@
# @babel/plugin-transform-runtime
> Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals
See our website [@babel/plugin-transform-runtime](https://babeljs.io/docs/en/babel-plugin-transform-runtime) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/plugin-transform-runtime
```
or using yarn:
```sh
yarn add @babel/plugin-transform-runtime --dev
```

View File

@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function _default(moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
throw new Error("The 'absoluteRuntime' option is not supported when using @babel/standalone.");
}

View File

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
var _module = require("module");
const path = require("path");
function _default(moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
return resolveAbsoluteRuntime(moduleName, path.resolve(dirname, absoluteRuntime === true ? "." : absoluteRuntime));
}
function resolveAbsoluteRuntime(moduleName, dirname) {
try {
return path.dirname((((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
paths: [b]
}, M = require("module")) => {
let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
if (f) return f;
f = new Error(`Cannot resolve module '${r}'`);
f.code = "MODULE_NOT_FOUND";
throw f;
})(`${moduleName}/package.json`, {
paths: [dirname]
})).replace(/\\/g, "/");
} catch (err) {
if (err.code !== "MODULE_NOT_FOUND") throw err;
throw Object.assign(new Error(`Failed to resolve "${moduleName}" relative to "${dirname}"`), {
code: "BABEL_RUNTIME_NOT_FOUND",
runtime: moduleName,
dirname
});
}
}

View File

@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasMinVersion = hasMinVersion;
const semver = require("semver");
function hasMinVersion(minVersion, runtimeVersion) {
if (!runtimeVersion) return true;
if (semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;
return !semver.intersects(`<${minVersion}`, runtimeVersion) && !semver.intersects(`>=8.0.0`, runtimeVersion);
}

View File

@ -0,0 +1,206 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperModuleImports = require("@babel/helper-module-imports");
var _core = require("@babel/core");
var _helpers = require("./helpers");
var _getRuntimePath = _interopRequireDefault(require("./get-runtime-path"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const _pluginCorejs2 = require("babel-plugin-polyfill-corejs2");
const _pluginCorejs3 = require("babel-plugin-polyfill-corejs3");
const _pluginRegenerator = require("babel-plugin-polyfill-regenerator");
const pluginCorejs2 = _pluginCorejs2.default;
const pluginCorejs3 = _pluginCorejs3.default;
const pluginRegenerator = _pluginRegenerator.default;
const pluginsCompat = "#__secret_key__@babel/runtime__compatibility";
function supportsStaticESM(caller) {
return !!(caller != null && caller.supportsStaticESM);
}
var _default = (0, _helperPluginUtils.declare)((api, options, dirname) => {
api.assertVersion(7);
const {
corejs,
helpers: useRuntimeHelpers = true,
regenerator: useRuntimeRegenerator = true,
useESModules = false,
version: runtimeVersion = "7.0.0-beta.0",
absoluteRuntime = false
} = options;
let proposals = false;
let rawVersion;
if (typeof corejs === "object" && corejs !== null) {
rawVersion = corejs.version;
proposals = Boolean(corejs.proposals);
} else {
rawVersion = corejs;
}
const corejsVersion = rawVersion ? Number(rawVersion) : false;
if (![false, 2, 3].includes(corejsVersion)) {
throw new Error(`The \`core-js\` version must be false, 2 or 3, but got ${JSON.stringify(rawVersion)}.`);
}
if (proposals && (!corejsVersion || corejsVersion < 3)) {
throw new Error("The 'proposals' option is only supported when using 'corejs: 3'");
}
if (typeof useRuntimeRegenerator !== "boolean") {
throw new Error("The 'regenerator' option must be undefined, or a boolean.");
}
if (typeof useRuntimeHelpers !== "boolean") {
throw new Error("The 'helpers' option must be undefined, or a boolean.");
}
if (typeof useESModules !== "boolean" && useESModules !== "auto") {
throw new Error("The 'useESModules' option must be undefined, or a boolean, or 'auto'.");
}
if (typeof absoluteRuntime !== "boolean" && typeof absoluteRuntime !== "string") {
throw new Error("The 'absoluteRuntime' option must be undefined, a boolean, or a string.");
}
if (typeof runtimeVersion !== "string") {
throw new Error(`The 'version' option must be a version string.`);
}
const DUAL_MODE_RUNTIME = "7.13.0";
const supportsCJSDefault = (0, _helpers.hasMinVersion)(DUAL_MODE_RUNTIME, runtimeVersion);
function has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
if (has(options, "useBuiltIns")) {
if (options.useBuiltIns) {
throw new Error("The 'useBuiltIns' option has been removed. The @babel/runtime " + "module now uses builtins by default.");
} else {
throw new Error("The 'useBuiltIns' option has been removed. Use the 'corejs'" + "option to polyfill with `core-js` via @babel/runtime.");
}
}
if (has(options, "polyfill")) {
if (options.polyfill === false) {
throw new Error("The 'polyfill' option has been removed. The @babel/runtime " + "module now skips polyfilling by default.");
} else {
throw new Error("The 'polyfill' option has been removed. Use the 'corejs'" + "option to polyfill with `core-js` via @babel/runtime.");
}
}
if (has(options, "moduleName")) {
throw new Error("The 'moduleName' option has been removed. @babel/transform-runtime " + "no longer supports arbitrary runtimes. If you were using this to " + "set an absolute path for Babel's standard runtimes, please use the " + "'absoluteRuntime' option.");
}
const esModules = useESModules === "auto" ? api.caller(supportsStaticESM) : useESModules;
const injectCoreJS2 = corejsVersion === 2;
const injectCoreJS3 = corejsVersion === 3;
const moduleName = injectCoreJS3 ? "@babel/runtime-corejs3" : injectCoreJS2 ? "@babel/runtime-corejs2" : "@babel/runtime";
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
const modulePath = (0, _getRuntimePath.default)(moduleName, dirname, absoluteRuntime);
function createCorejsPlgin(plugin, options, regeneratorPlugin) {
return (api, _, filename) => {
return Object.assign({}, plugin(api, options, filename), {
inherits: regeneratorPlugin
});
};
}
function createRegeneratorPlugin(options) {
if (!useRuntimeRegenerator) return undefined;
return (api, _, filename) => {
return pluginRegenerator(api, options, filename);
};
}
const corejsExt = absoluteRuntime ? ".js" : "";
return {
name: "transform-runtime",
inherits: injectCoreJS2 ? createCorejsPlgin(pluginCorejs2, {
method: "usage-pure",
[pluginsCompat]: {
runtimeVersion,
useBabelRuntime: modulePath,
ext: corejsExt
}
}, createRegeneratorPlugin({
method: "usage-pure",
[pluginsCompat]: {
useBabelRuntime: modulePath
}
})) : injectCoreJS3 ? createCorejsPlgin(pluginCorejs3, {
method: "usage-pure",
version: 3,
proposals,
[pluginsCompat]: {
useBabelRuntime: modulePath,
ext: corejsExt
}
}, createRegeneratorPlugin({
method: "usage-pure",
[pluginsCompat]: {
useBabelRuntime: modulePath
}
})) : createRegeneratorPlugin({
method: "usage-pure",
[pluginsCompat]: {
useBabelRuntime: modulePath
}
}),
pre(file) {
if (!useRuntimeHelpers) return;
file.set("helperGenerator", name => {
if (file.availableHelper && !file.availableHelper(name, runtimeVersion)) {
return;
}
const isInteropHelper = HEADER_HELPERS.indexOf(name) !== -1;
const blockHoist = isInteropHelper && !(0, _helperModuleImports.isModule)(file.path) ? 4 : undefined;
const helpersDir = esModules && file.path.node.sourceType === "module" ? "helpers/esm" : "helpers";
return addDefaultImport(`${modulePath}/${helpersDir}/${name}`, name, blockHoist, true);
});
const cache = new Map();
function addDefaultImport(source, nameHint, blockHoist, isHelper = false) {
const cacheKey = (0, _helperModuleImports.isModule)(file.path);
const key = `${source}:${nameHint}:${cacheKey || ""}`;
let cached = cache.get(key);
if (cached) {
cached = _core.types.cloneNode(cached);
} else {
cached = (0, _helperModuleImports.addDefault)(file.path, source, {
importedInterop: isHelper && supportsCJSDefault ? "compiled" : "uncompiled",
nameHint,
blockHoist
});
cache.set(key, cached);
}
return cached;
}
}
};
});
exports.default = _default;

View File

@ -0,0 +1,46 @@
{
"name": "@babel/plugin-transform-runtime",
"version": "7.13.10",
"description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-plugin-transform-runtime"
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"babel-plugin"
],
"browser": {
"./lib/get-runtime-path/index.js": "./lib/get-runtime-path/browser.js",
"./src/get-runtime-path/index.js": "./src/get-runtime-path/browser.js"
},
"dependencies": {
"@babel/helper-module-imports": "^7.12.13",
"@babel/helper-plugin-utils": "^7.13.0",
"babel-plugin-polyfill-corejs2": "^0.1.4",
"babel-plugin-polyfill-corejs3": "^0.1.3",
"babel-plugin-polyfill-regenerator": "^0.1.2",
"semver": "^6.3.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "7.13.10",
"@babel/helper-plugin-test-runner": "7.13.10",
"@babel/helpers": "7.13.10",
"@babel/plugin-transform-typeof-symbol": "7.12.13",
"@babel/preset-env": "7.13.10",
"@babel/runtime": "7.13.10",
"@babel/runtime-corejs3": "7.13.10",
"@babel/template": "7.12.13",
"@babel/types": "7.13.0",
"make-dir": "^2.1.0"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-runtime"
}

View File

@ -0,0 +1,7 @@
export default function (moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
throw new Error(
"The 'absoluteRuntime' option is not supported when using @babel/standalone.",
);
}

View File

@ -0,0 +1,34 @@
import path from "path";
import { createRequire } from "module";
const require = createRequire(import.meta.url);
export default function (moduleName, dirname, absoluteRuntime) {
if (absoluteRuntime === false) return moduleName;
return resolveAbsoluteRuntime(
moduleName,
path.resolve(dirname, absoluteRuntime === true ? "." : absoluteRuntime),
);
}
function resolveAbsoluteRuntime(moduleName: string, dirname: string) {
try {
return path
.dirname(
require.resolve(`${moduleName}/package.json`, { paths: [dirname] }),
)
.replace(/\\/g, "/");
} catch (err) {
if (err.code !== "MODULE_NOT_FOUND") throw err;
throw Object.assign(
new Error(`Failed to resolve "${moduleName}" relative to "${dirname}"`),
{
code: "BABEL_RUNTIME_NOT_FOUND",
runtime: moduleName,
dirname,
},
);
}
}