@babel/plugin-transform-runtime
Advanced tools
Comparing version 7.21.4-esm to 7.21.4-esm.1
@@ -1,13 +0,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = _default; | ||
exports.resolveFSPath = resolveFSPath; | ||
function _default(moduleName, dirname, absoluteRuntime) { | ||
export default function (moduleName, dirname, absoluteRuntime) { | ||
if (absoluteRuntime === false) return moduleName; | ||
resolveFSPath(); | ||
} | ||
function resolveFSPath() { | ||
export function resolveFSPath() { | ||
throw new Error("The 'absoluteRuntime' option is not supported when using @babel/standalone."); | ||
@@ -14,0 +7,0 @@ } |
@@ -1,17 +0,11 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = _default; | ||
exports.resolveFSPath = resolveFSPath; | ||
var _path = require("path"); | ||
var _module = require("module"); | ||
function _default(moduleName, dirname, absoluteRuntime) { | ||
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)); | ||
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, { | ||
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] | ||
@@ -36,3 +30,3 @@ }, M = require("module")) => { | ||
} | ||
function resolveFSPath(path) { | ||
export function resolveFSPath(path) { | ||
return require.resolve(path).replace(/\\/g, "/"); | ||
@@ -39,0 +33,0 @@ } |
@@ -1,14 +0,8 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.hasMinVersion = hasMinVersion; | ||
var _semver = require("semver"); | ||
function hasMinVersion(minVersion, runtimeVersion) { | ||
import semver from "semver"; | ||
export 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); | ||
if (semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`; | ||
return !semver.intersects(`<${minVersion}`, runtimeVersion) && !semver.intersects(`>=8.0.0`, runtimeVersion); | ||
} | ||
//# sourceMappingURL=helpers.js.map |
@@ -1,18 +0,12 @@ | ||
"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 = require("./get-runtime-path"); | ||
var _babelPluginPolyfillCorejs = require("babel-plugin-polyfill-corejs2"); | ||
var _babelPluginPolyfillCorejs2 = require("babel-plugin-polyfill-corejs3"); | ||
var _babelPluginPolyfillRegenerator = require("babel-plugin-polyfill-regenerator"); | ||
const pluginCorejs2 = _babelPluginPolyfillCorejs.default || _babelPluginPolyfillCorejs; | ||
const pluginCorejs3 = _babelPluginPolyfillCorejs2.default || _babelPluginPolyfillCorejs2; | ||
const pluginRegenerator = _babelPluginPolyfillRegenerator.default || _babelPluginPolyfillRegenerator; | ||
import { declare } from "@babel/helper-plugin-utils"; | ||
import { addDefault, isModule } from "@babel/helper-module-imports"; | ||
import { types as t } from "@babel/core"; | ||
import { hasMinVersion } from "./helpers.js"; | ||
import getRuntimePath, { resolveFSPath } from "./get-runtime-path/index.js"; | ||
import _pluginCorejs2 from "babel-plugin-polyfill-corejs2"; | ||
import _pluginCorejs3 from "babel-plugin-polyfill-corejs3"; | ||
import _pluginRegenerator from "babel-plugin-polyfill-regenerator"; | ||
const pluginCorejs2 = _pluginCorejs2.default || _pluginCorejs2; | ||
const pluginCorejs3 = _pluginCorejs3.default || _pluginCorejs3; | ||
const pluginRegenerator = _pluginRegenerator.default || _pluginRegenerator; | ||
const pluginsCompat = "#__secret_key__@babel/runtime__compatibility"; | ||
@@ -22,3 +16,3 @@ function supportsStaticESM(caller) { | ||
} | ||
var _default = (0, _helperPluginUtils.declare)((api, options, dirname) => { | ||
export default declare((api, options, dirname) => { | ||
api.assertVersion(7); | ||
@@ -65,3 +59,3 @@ const { | ||
const DUAL_MODE_RUNTIME = "7.13.0"; | ||
var supportsCJSDefault = (0, _helpers.hasMinVersion)(DUAL_MODE_RUNTIME, runtimeVersion); | ||
var supportsCJSDefault = hasMinVersion(DUAL_MODE_RUNTIME, runtimeVersion); | ||
} | ||
@@ -93,3 +87,3 @@ function has(obj, key) { | ||
const HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"]; | ||
const modulePath = (0, _getRuntimePath.default)(moduleName, dirname, absoluteRuntime); | ||
const modulePath = getRuntimePath(moduleName, dirname, absoluteRuntime); | ||
function createCorejsPlugin(plugin, options, regeneratorPlugin) { | ||
@@ -152,3 +146,3 @@ return (api, _, filename) => { | ||
if (name === "regeneratorRuntime") { | ||
return _core.types.arrowFunctionExpression([], _core.types.identifier("regeneratorRuntime")); | ||
return t.arrowFunctionExpression([], t.identifier("regeneratorRuntime")); | ||
} | ||
@@ -159,6 +153,6 @@ return; | ||
const isInteropHelper = HEADER_HELPERS.indexOf(name) !== -1; | ||
const blockHoist = isInteropHelper && !(0, _helperModuleImports.isModule)(file.path) ? 4 : undefined; | ||
const blockHoist = isInteropHelper && !isModule(file.path) ? 4 : undefined; | ||
const helpersDir = esModules && file.path.node.sourceType === "module" ? "helpers/esm" : "helpers"; | ||
let helperPath = `${modulePath}/${helpersDir}/${name}`; | ||
if (absoluteRuntime) helperPath = (0, _getRuntimePath.resolveFSPath)(helperPath); | ||
if (absoluteRuntime) helperPath = resolveFSPath(helperPath); | ||
return addDefaultImport(helperPath, name, blockHoist, true); | ||
@@ -168,9 +162,9 @@ }); | ||
function addDefaultImport(source, nameHint, blockHoist, isHelper = false) { | ||
const cacheKey = (0, _helperModuleImports.isModule)(file.path); | ||
const cacheKey = isModule(file.path); | ||
const key = `${source}:${nameHint}:${cacheKey || ""}`; | ||
let cached = cache.get(key); | ||
if (cached) { | ||
cached = _core.types.cloneNode(cached); | ||
cached = t.cloneNode(cached); | ||
} else { | ||
cached = (0, _helperModuleImports.addDefault)(file.path, source, { | ||
cached = addDefault(file.path, source, { | ||
importedInterop: isHelper && supportsCJSDefault ? "compiled" : "uncompiled", | ||
@@ -187,4 +181,3 @@ nameHint, | ||
}); | ||
exports.default = _default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@babel/plugin-transform-runtime", | ||
"version": "7.21.4-esm", | ||
"version": "7.21.4-esm.1", | ||
"description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", | ||
@@ -23,4 +23,4 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-module-imports": "^7.21.4-esm", | ||
"@babel/helper-plugin-utils": "^7.21.4-esm", | ||
"@babel/helper-module-imports": "^7.21.4-esm.1", | ||
"@babel/helper-plugin-utils": "^7.21.4-esm.1", | ||
"babel-plugin-polyfill-corejs2": "^0.3.3", | ||
@@ -32,13 +32,13 @@ "babel-plugin-polyfill-corejs3": "^0.6.0", | ||
"peerDependencies": { | ||
"@babel/core": "^7.0.0-0 || 7.21.4-esm" | ||
"@babel/core": "^7.0.0-0 || 7.21.4-esm.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.21.4-esm", | ||
"@babel/helper-plugin-test-runner": "^7.21.4-esm", | ||
"@babel/helpers": "^7.21.4-esm", | ||
"@babel/preset-env": "^7.21.4-esm", | ||
"@babel/runtime": "^7.21.4-esm", | ||
"@babel/runtime-corejs3": "^7.21.4-esm", | ||
"@babel/template": "^7.21.4-esm", | ||
"@babel/types": "^7.21.4-esm", | ||
"@babel/core": "^7.21.4-esm.1", | ||
"@babel/helper-plugin-test-runner": "^7.21.4-esm.1", | ||
"@babel/helpers": "^7.21.4-esm.1", | ||
"@babel/preset-env": "^7.21.4-esm.1", | ||
"@babel/runtime": "^7.21.4-esm.1", | ||
"@babel/runtime-corejs3": "^7.21.4-esm.1", | ||
"@babel/template": "^7.21.4-esm.1", | ||
"@babel/types": "^7.21.4-esm.1", | ||
"make-dir": "^2.1.0" | ||
@@ -51,3 +51,3 @@ }, | ||
"author": "The Babel Team (https://babel.dev/team)", | ||
"type": "commonjs" | ||
"type": "module" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Yes
38263
272
138
0
1
0
21
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@babel/compat-data@7.25.4(transitive)
+ Added@babel/core@7.25.2(transitive)
+ Added@babel/generator@7.25.6(transitive)
+ Added@babel/helper-compilation-targets@7.25.2(transitive)
+ Added@babel/helper-module-imports@7.24.7(transitive)
+ Added@babel/helper-module-transforms@7.25.2(transitive)
+ Added@babel/helper-plugin-utils@7.24.8(transitive)
+ Added@babel/helper-simple-access@7.24.7(transitive)
+ Added@babel/helper-string-parser@7.24.8(transitive)
+ Added@babel/helper-validator-identifier@7.24.7(transitive)
+ Added@babel/helper-validator-option@7.24.8(transitive)
+ Added@babel/helpers@7.25.6(transitive)
+ Added@babel/highlight@7.24.7(transitive)
+ Added@babel/parser@7.25.6(transitive)
+ Added@babel/template@7.25.0(transitive)
+ Added@babel/traverse@7.25.6(transitive)
+ Added@babel/types@7.25.6(transitive)
+ Addedcaniuse-lite@1.0.30001664(transitive)
+ Addedelectron-to-chromium@1.5.29(transitive)
+ Addedjsesc@2.5.2(transitive)
- Removed@babel/code-frame@7.25.7(transitive)
- Removed@babel/compat-data@7.25.7(transitive)
- Removed@babel/core@7.25.7(transitive)
- Removed@babel/generator@7.25.7(transitive)
- Removed@babel/helper-compilation-targets@7.25.7(transitive)
- Removed@babel/helper-module-imports@7.25.7(transitive)
- Removed@babel/helper-module-transforms@7.25.7(transitive)
- Removed@babel/helper-plugin-utils@7.25.7(transitive)
- Removed@babel/helper-simple-access@7.25.7(transitive)
- Removed@babel/helper-string-parser@7.25.7(transitive)
- Removed@babel/helper-validator-identifier@7.25.7(transitive)
- Removed@babel/helper-validator-option@7.25.7(transitive)
- Removed@babel/helpers@7.25.7(transitive)
- Removed@babel/highlight@7.25.7(transitive)
- Removed@babel/parser@7.25.7(transitive)
- Removed@babel/template@7.25.7(transitive)
- Removed@babel/traverse@7.25.7(transitive)
- Removed@babel/types@7.25.7(transitive)
- Removedcaniuse-lite@1.0.30001667(transitive)
- Removedelectron-to-chromium@1.5.32(transitive)
- Removedjsesc@3.0.2(transitive)