You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@babel/core

Package Overview
Dependencies
Maintainers
4
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.20.5 to 7.23.2

7

lib/config/caching.js

@@ -18,8 +18,7 @@ "use strict";

}
var _async = require("../gensync-utils/async");
var _util = require("./util");
var _async = require("../gensync-utils/async.js");
var _util = require("./util.js");
const synchronize = gen => {
return _gensync()(gen).sync;
};
function* genTrue() {

@@ -40,3 +39,2 @@ return true;

}
function makeCachedFunction(CallCache, handler) {

@@ -240,3 +238,2 @@ const callCacheSync = new CallCache();

}
function assertSimpleType(value) {

@@ -243,0 +240,0 @@ if ((0, _async.isThenable)(value)) {

@@ -23,11 +23,10 @@ "use strict";

}
var _options = require("./validation/options");
var _patternToRegex = require("./pattern-to-regex");
var _printer = require("./printer");
var _rewriteStackTrace = require("../errors/rewrite-stack-trace");
var _configError = require("../errors/config-error");
var _files = require("./files");
var _caching = require("./caching");
var _configDescriptors = require("./config-descriptors");
var _options = require("./validation/options.js");
var _patternToRegex = require("./pattern-to-regex.js");
var _printer = require("./printer.js");
var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
var _configError = require("../errors/config-error.js");
var _index = require("./files/index.js");
var _caching = require("./caching.js");
var _configDescriptors = require("./config-descriptors.js");
const debug = _debug()("babel:config:config-chain");

@@ -67,5 +66,5 @@ function* buildPresetChain(arg, context) {

if (typeof opts.configFile === "string") {
configFile = yield* (0, _files.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
} else if (opts.configFile !== false) {
configFile = yield* (0, _files.findRootConfig)(context.root, context.envName, context.caller);
configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller);
}

@@ -84,3 +83,2 @@ let {

configReport = yield* configFileLogger.output();
if (babelrc === undefined) {

@@ -99,3 +97,3 @@ babelrc = validatedFile.options.babelrc;

if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") {
const pkgData = yield* (0, _files.findPackageData)(context.filename);
const pkgData = yield* (0, _index.findPackageData)(context.filename);
if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {

@@ -105,3 +103,3 @@ ({

config: babelrcFile
} = yield* (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller));
} = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller));
if (ignoreFile) {

@@ -130,4 +128,3 @@ fileChain.files.add(ignoreFile.filepath);

if (context.showConfig) {
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` +
[configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----");
}

@@ -149,3 +146,2 @@ const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);

const absoluteRoot = context.root;
if (babelrcRoots === undefined) {

@@ -161,3 +157,2 @@ return pkgData.directories.indexOf(absoluteRoot) !== -1;

});
if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {

@@ -190,3 +185,2 @@ return pkgData.directories.indexOf(absoluteRoot) !== -1;

}));
const loadProgrammaticChain = makeChainWalker({

@@ -199,3 +193,2 @@ root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),

});
const loadFileChainWalker = makeChainWalker({

@@ -210,5 +203,3 @@ root: file => loadFileDescriptors(file),

const chain = yield* loadFileChainWalker(input, context, files, baseLogger);
if (chain) {
chain.files.add(input.filepath);
}
chain == null ? void 0 : chain.files.add(input.filepath);
return chain;

@@ -247,3 +238,4 @@ }

}, alias, descriptors, envName) {
const opts = options.env && options.env[envName];
var _options$env;
const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName];
return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null;

@@ -255,3 +247,4 @@ }

}, alias, descriptors, index) {
const opts = options.overrides && options.overrides[index];
var _options$overrides;
const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index];
if (!opts) throw new Error("Assertion failure - missing override");

@@ -264,5 +257,6 @@ return descriptors(dirname, opts, `${alias}.overrides[${index}]`);

}, alias, descriptors, index, envName) {
const override = options.overrides && options.overrides[index];
var _options$overrides2, _override$env;
const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index];
if (!override) throw new Error("Assertion failure - missing override");
const opts = override.env && override.env[envName];
const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName];
return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;

@@ -316,3 +310,2 @@ }

}
if (flattenedConfigs.some(({

@@ -346,3 +339,3 @@ config: {

if (opts.extends === undefined) return true;
const file = yield* (0, _files.loadConfig)(opts.extends, dirname, context.envName, context.caller);
const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller);
if (files.has(file)) {

@@ -398,3 +391,2 @@ throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n"));

delete options.exclude;
if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) {

@@ -423,3 +415,2 @@ options.sourceMaps = options.sourceMap;

descriptors.push(desc);
if (!item.ownPass) nameMap.set(item.name, desc);

@@ -449,3 +440,2 @@ } else {

}
function ignoreListReplacer(_key, value) {

@@ -457,3 +447,2 @@ if (value instanceof RegExp) {

}
function shouldIgnore(context, ignore, only, dirname) {

@@ -480,3 +469,2 @@ if (ignore && matchesPatterns(context, ignore, dirname)) {

}
function matchesPatterns(context, patterns, dirname, configName) {

@@ -483,0 +471,0 @@ return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName));

@@ -16,9 +16,10 @@ "use strict";

}
var _functional = require("../gensync-utils/functional");
var _files = require("./files");
var _item = require("./item");
var _caching = require("./caching");
var _resolveTargets = require("./resolve-targets");
var _functional = require("../gensync-utils/functional.js");
var _index = require("./files/index.js");
var _item = require("./item.js");
var _caching = require("./caching.js");
var _resolveTargets = require("./resolve-targets.js");
function isEqualDescriptor(a, b) {
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && (a.file && a.file.request) === (b.file && b.file.request) && (a.file && a.file.resolved) === (b.file && b.file.resolved);
var _a$file, _b$file, _a$file2, _b$file2;
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
}

@@ -34,3 +35,2 @@ function* handlerOf(value) {

}
function createCachedDescriptors(dirname, options, alias) {

@@ -44,9 +44,6 @@ const {

options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
plugins: plugins ? () =>
createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
presets: presets ? () =>
createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
};
}
function createUncachedDescriptors(dirname, options, alias) {

@@ -64,4 +61,3 @@ return {

const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
return descriptors.map(
desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
}));

@@ -74,9 +70,6 @@ });

const descriptors = yield* createPluginDescriptors(items, dirname, alias);
return descriptors.map(
desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
});
});
const DEFAULT_OPTIONS = {};
function loadCachedDescriptor(cache, desc) {

@@ -122,3 +115,2 @@ const {

}
function* createDescriptor(pair, dirname, {

@@ -149,3 +141,3 @@ type,

}
const resolver = type === "plugin" ? _files.loadPlugin : _files.loadPreset;
const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
const request = value;

@@ -152,0 +144,0 @@ ({

@@ -47,50 +47,31 @@ "use strict";

}
var _caching = require("../caching");
var _configApi = require("../helpers/config-api");
var _utils = require("./utils");
var _moduleTypes = require("./module-types");
var _patternToRegex = require("../pattern-to-regex");
var _configError = require("../../errors/config-error");
var fs = require("../../gensync-utils/fs");
function _module() {
const data = require("module");
_module = function () {
return data;
};
return data;
}
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace");
var _caching = require("../caching.js");
var _configApi = require("../helpers/config-api.js");
var _utils = require("./utils.js");
var _moduleTypes = require("./module-types.js");
var _patternToRegex = require("../pattern-to-regex.js");
var _configError = require("../../errors/config-error.js");
var fs = require("../../gensync-utils/fs.js");
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
const debug = _debug()("babel:config:loading:files:configuration");
const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json"];
const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts"];
exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json"];
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
const BABELIGNORE_FILENAME = ".babelignore";
const LOADING_CONFIGS = new Set();
const readConfigJS = (0, _caching.makeStrongCache)(function* readConfigJS(filepath, cache) {
if (!_fs().existsSync(filepath)) {
cache.never();
return null;
}
if (LOADING_CONFIGS.has(filepath)) {
cache.never();
debug("Auto-ignoring usage of config %o.", filepath);
return {
filepath,
dirname: _path().dirname(filepath),
options: {}
};
}
let options;
try {
LOADING_CONFIGS.add(filepath);
options = yield* (0, _moduleTypes.default)(filepath, "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously.");
} finally {
LOADING_CONFIGS.delete(filepath);
}
let assertCache = false;
const runConfig = (0, _caching.makeWeakCache)(function* runConfig(options, cache) {
yield* [];
return {
options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)),
cacheNeedsConfiguration: !cache.configured()
};
});
function* readConfigCode(filepath, data) {
if (!_fs().existsSync(filepath)) return null;
let options = yield* (0, _moduleTypes.default)(filepath, "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously.");
let cacheNeedsConfiguration = false;
if (typeof options === "function") {
yield* [];
options = (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache));
assertCache = true;
({
options,
cacheNeedsConfiguration
} = yield* runConfig(options, data));
}

@@ -100,13 +81,26 @@ if (!options || typeof options !== "object" || Array.isArray(options)) {

}
if (typeof options.then === "function") {
options.catch == null ? void 0 : options.catch(() => {});
throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath);
}
if (assertCache && !cache.configured()) throwConfigError(filepath);
return {
filepath,
dirname: _path().dirname(filepath),
options
};
});
if (cacheNeedsConfiguration) throwConfigError(filepath);
return buildConfigFileObject(options, filepath);
}
const cfboaf = new WeakMap();
function buildConfigFileObject(options, filepath) {
let configFilesByFilepath = cfboaf.get(options);
if (!configFilesByFilepath) {
cfboaf.set(options, configFilesByFilepath = new Map());
}
let configFile = configFilesByFilepath.get(filepath);
if (!configFile) {
configFile = {
filepath,
dirname: _path().dirname(filepath),
options
};
configFilesByFilepath.set(filepath, configFile);
}
return configFile;
}
const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {

@@ -230,9 +224,16 @@ const babel = file.options["babel"];

}
function readConfig(filepath, envName, caller) {
const ext = _path().extname(filepath);
return ext === ".js" || ext === ".cjs" || ext === ".mjs" ? readConfigJS(filepath, {
envName,
caller
}) : readConfigJSON5(filepath);
switch (ext) {
case ".js":
case ".cjs":
case ".mjs":
case ".cts":
return readConfigCode(filepath, {
envName,
caller
});
default:
return readConfigJSON5(filepath);
}
}

@@ -239,0 +240,0 @@ function* resolveShowConfigPath(dirname) {

@@ -17,7 +17,5 @@ "use strict";

exports.resolveShowConfigPath = resolveShowConfigPath;
function findConfigUpwards(
rootDir) {
function findConfigUpwards(rootDir) {
return null;
}
function* findPackageData(filepath) {

@@ -31,7 +29,3 @@ return {

}
function* findRelativeConfig(
pkgData,
envName,
caller) {
function* findRelativeConfig(pkgData, envName, caller) {
return {

@@ -42,22 +36,12 @@ config: null,

}
function* findRootConfig(
dirname,
envName,
caller) {
function* findRootConfig(dirname, envName, caller) {
return null;
}
function* loadConfig(name, dirname,
envName,
caller) {
function* loadConfig(name, dirname, envName, caller) {
throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
}
function* resolveShowConfigPath(
dirname) {
function* resolveShowConfigPath(dirname) {
return null;
}
const ROOT_CONFIG_FILENAMES = [];
exports.ROOT_CONFIG_FILENAMES = ROOT_CONFIG_FILENAMES;

@@ -67,3 +51,2 @@ function resolvePlugin(name, dirname) {

}
function resolvePreset(name, dirname) {

@@ -70,0 +53,0 @@ return null;

@@ -45,3 +45,3 @@ "use strict";

get: function () {
return plugins.loadPlugin;
return _plugins.loadPlugin;
}

@@ -52,6 +52,17 @@ });

get: function () {
return plugins.loadPreset;
return _plugins.loadPreset;
}
});
exports.resolvePreset = exports.resolvePlugin = void 0;
Object.defineProperty(exports, "resolvePlugin", {
enumerable: true,
get: function () {
return _plugins.resolvePlugin;
}
});
Object.defineProperty(exports, "resolvePreset", {
enumerable: true,
get: function () {
return _plugins.resolvePreset;
}
});
Object.defineProperty(exports, "resolveShowConfigPath", {

@@ -63,19 +74,8 @@ enumerable: true,

});
var _package = require("./package");
var _configuration = require("./configuration");
var plugins = require("./plugins");
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _package = require("./package.js");
var _configuration = require("./configuration.js");
var _plugins = require("./plugins.js");
({});
const resolvePlugin = _gensync()(plugins.resolvePlugin).sync;
exports.resolvePlugin = resolvePlugin;
const resolvePreset = _gensync()(plugins.resolvePreset).sync;
exports.resolvePreset = resolvePreset;
0 && 0;
//# sourceMappingURL=index.js.map

@@ -6,5 +6,5 @@ "use strict";

});
exports.default = loadCjsOrMjsDefault;
exports.default = loadCodeDefault;
exports.supportsESM = void 0;
var _async = require("../../gensync-utils/async");
var _async = require("../../gensync-utils/async.js");
function _path() {

@@ -24,5 +24,5 @@ const data = require("path");

}
function _module() {
const data = require("module");
_module = function () {
function _semver() {
const data = require("semver");
_semver = function () {
return data;

@@ -32,5 +32,5 @@ };

}
function _semver() {
const data = require("semver");
_semver = function () {
function _debug() {
const data = require("debug");
_debug = function () {
return data;

@@ -40,6 +40,8 @@ };

}
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace");
var _configError = require("../../errors/config-error");
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
var _configError = require("../../errors/config-error.js");
var _transformFile = require("../../transform-file.js");
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
const debug = _debug()("babel:config:loading:files:module-types");
let import_;

@@ -49,38 +51,93 @@ try {

} catch (_unused) {}
const supportsESM = _semver().satisfies(process.versions.node,
"^12.17 || >=13.2");
const supportsESM = _semver().satisfies(process.versions.node, "^12.17 || >=13.2");
exports.supportsESM = supportsESM;
function* loadCjsOrMjsDefault(filepath, asyncError,
fallbackToTranspiledModule = false) {
switch (guessJSModuleType(filepath)) {
case "cjs":
return loadCjsDefault(filepath, fallbackToTranspiledModule);
case "unknown":
function* loadCodeDefault(filepath, asyncError) {
switch (_path().extname(filepath)) {
case ".cjs":
{
return loadCjsDefault(filepath, arguments[2]);
}
case ".mjs":
break;
case ".cts":
return loadCtsDefault(filepath);
default:
try {
return loadCjsDefault(filepath, fallbackToTranspiledModule);
{
return loadCjsDefault(filepath, arguments[2]);
}
} catch (e) {
if (e.code !== "ERR_REQUIRE_ESM") throw e;
}
case "mjs":
if (yield* (0, _async.isAsync)()) {
return yield* (0, _async.waitFor)(loadMjsDefault(filepath));
}
if (yield* (0, _async.isAsync)()) {
return yield* (0, _async.waitFor)(loadMjsDefault(filepath));
}
throw new _configError.default(asyncError, filepath);
}
function loadCtsDefault(filepath) {
const ext = ".cts";
const hasTsSupport = !!(require.extensions[".ts"] || require.extensions[".cts"] || require.extensions[".mts"]);
let handler;
if (!hasTsSupport) {
const opts = {
babelrc: false,
configFile: false,
sourceType: "unambiguous",
sourceMaps: "inline",
sourceFileName: _path().basename(filepath),
presets: [[getTSPreset(filepath), Object.assign({
onlyRemoveTypeImports: true,
optimizeConstEnums: true
}, {
allowDeclareFields: true
})]]
};
handler = function (m, filename) {
if (handler && filename.endsWith(ext)) {
try {
return m._compile((0, _transformFile.transformFileSync)(filename, Object.assign({}, opts, {
filename
})).code, filename);
} catch (error) {
if (!hasTsSupport) {
const packageJson = require("@babel/preset-typescript/package.json");
if (_semver().lt(packageJson.version, "7.21.4")) {
console.error("`.cts` configuration file failed to load, please try to update `@babel/preset-typescript`.");
}
}
throw error;
}
}
throw new _configError.default(asyncError, filepath);
return require.extensions[".js"](m, filename);
};
require.extensions[ext] = handler;
}
try {
return loadCjsDefault(filepath);
} finally {
if (!hasTsSupport) {
if (require.extensions[ext] === handler) delete require.extensions[ext];
handler = undefined;
}
}
}
function guessJSModuleType(filename) {
switch (_path().extname(filename)) {
case ".cjs":
return "cjs";
case ".mjs":
return "mjs";
default:
return "unknown";
const LOADING_CJS_FILES = new Set();
function loadCjsDefault(filepath) {
if (LOADING_CJS_FILES.has(filepath)) {
debug("Auto-ignoring usage of config %o.", filepath);
return {};
}
let module;
try {
LOADING_CJS_FILES.add(filepath);
module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath);
} finally {
LOADING_CJS_FILES.delete(filepath);
}
{
var _module;
return (_module = module) != null && _module.__esModule ? module.default || (arguments[1] ? module : undefined) : module;
}
}
function loadCjsDefault(filepath, fallbackToTranspiledModule) {
const module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath);
return module != null && module.__esModule ?
module.default || (fallbackToTranspiledModule ? module : undefined) : module;
}
function loadMjsDefault(_x) {

@@ -92,5 +149,4 @@ return _loadMjsDefault.apply(this, arguments);

if (!import_) {
throw new _configError.default("Internal error: Native ECMAScript modules aren't supported" + " by this platform.\n", filepath);
throw new _configError.default("Internal error: Native ECMAScript modules aren't supported by this platform.\n", filepath);
}
const module = yield (0, _rewriteStackTrace.endHiddenCallStack)(import_)((0, _url().pathToFileURL)(filepath));

@@ -101,4 +157,25 @@ return module.default;

}
function getTSPreset(filepath) {
try {
return require("@babel/preset-typescript");
} catch (error) {
if (error.code !== "MODULE_NOT_FOUND") throw error;
let message = "You appear to be using a .cts file as Babel configuration, but the `@babel/preset-typescript` package was not found: please install it!";
{
if (process.versions.pnp) {
message += `
If you are using Yarn Plug'n'Play, you may also need to add the following configuration to your .yarnrc.yml file:
packageExtensions:
\t"@babel/core@*":
\t\tpeerDependencies:
\t\t\t"@babel/preset-typescript": "*"
`;
}
}
throw new _configError.default(message, filepath);
}
}
0 && 0;
//# sourceMappingURL=module-types.js.map

@@ -14,4 +14,4 @@ "use strict";

}
var _utils = require("./utils");
var _configError = require("../../errors/config-error");
var _utils = require("./utils.js");
var _configError = require("../../errors/config-error.js");
const PACKAGE_FILENAME = "package.json";

@@ -38,3 +38,2 @@ const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {

});
function* findPackageData(filepath) {

@@ -41,0 +40,0 @@ let pkg = null;

@@ -8,4 +8,3 @@ "use strict";

exports.loadPreset = loadPreset;
exports.resolvePlugin = resolvePlugin;
exports.resolvePreset = resolvePreset;
exports.resolvePreset = exports.resolvePlugin = void 0;
function _debug() {

@@ -25,11 +24,4 @@ const data = require("debug");

}
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _async = require("../../gensync-utils/async");
var _moduleTypes = require("./module-types");
var _async = require("../../gensync-utils/async.js");
var _moduleTypes = require("./module-types.js");
function _url() {

@@ -42,12 +34,3 @@ const data = require("url");

}
var _importMetaResolve = require("./import-meta-resolve");
function _module() {
const data = require("module");
_module = function () {
return data;
};
return data;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
var _importMetaResolve = require("../../vendor/import-meta-resolve.js");
const debug = _debug()("babel:config:loading:files:plugins");

@@ -62,10 +45,8 @@ const EXACT_RE = /^module:/;

const OTHER_ORG_DEFAULT_RE = /^(@(?!babel$)[^/]+)$/;
function* resolvePlugin(name, dirname) {
return yield* resolveStandardizedName("plugin", name, dirname);
}
function* resolvePreset(name, dirname) {
return yield* resolveStandardizedName("preset", name, dirname);
}
const resolvePlugin = resolveStandardizedName.bind(null, "plugin");
exports.resolvePlugin = resolvePlugin;
const resolvePreset = resolveStandardizedName.bind(null, "preset");
exports.resolvePreset = resolvePreset;
function* loadPlugin(name, dirname) {
const filepath = yield* resolvePlugin(name, dirname);
const filepath = resolvePlugin(name, dirname, yield* (0, _async.isAsync)());
const value = yield* requireModule("plugin", filepath);

@@ -79,3 +60,3 @@ debug("Loaded plugin %o from %o.", name, dirname);

function* loadPreset(name, dirname) {
const filepath = yield* resolvePreset(name, dirname);
const filepath = resolvePreset(name, dirname, yield* (0, _async.isAsync)());
const value = yield* requireModule("preset", filepath);

@@ -91,8 +72,3 @@ debug("Loaded preset %o from %o.", name, dirname);

const isPreset = type === "preset";
return name
.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`)
.replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`)
.replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`)
.replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`)
.replace(EXACT_RE, "");
return name.replace(isPreset ? BABEL_PRESET_PREFIX_RE : BABEL_PLUGIN_PREFIX_RE, `babel-${type}-`).replace(isPreset ? BABEL_PRESET_ORG_RE : BABEL_PLUGIN_ORG_RE, `$1${type}-`).replace(isPreset ? OTHER_PRESET_ORG_RE : OTHER_PLUGIN_ORG_RE, `$1babel-${type}-`).replace(OTHER_ORG_DEFAULT_RE, `$1/babel-${type}`).replace(EXACT_RE, "");
}

@@ -106,3 +82,2 @@ function* resolveAlternativesHelper(type, name) {

if (!error) return value;
if (error.code !== "MODULE_NOT_FOUND") throw error;

@@ -119,21 +94,53 @@ if (standardizedName !== name && !(yield name).error) {

}
if (type === "plugin") {
const transformName = standardizedName.replace("-proposal-", "-transform-");
if (transformName !== standardizedName && !(yield transformName).error) {
error.message += `\n- Did you mean "${transformName}"?`;
}
}
error.message += `\n
Make sure that all the Babel plugins and presets you are using
are defined as dependencies or devDependencies in your package.json
file. It's possible that the missing plugin is loaded by a preset
you are using that forgot to add the plugin to its dependencies: you
can workaround this problem by explicitly adding the missing package
to your top-level package.json.
`;
throw error;
}
function tryRequireResolve(id, {
paths: [dirname]
}) {
function tryRequireResolve(id, dirname) {
try {
if (dirname) {
return {
error: null,
value: (((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;
})(id, {
paths: [dirname]
})
};
} else {
return {
error: null,
value: require.resolve(id)
};
}
} catch (error) {
return {
error,
value: null
};
}
}
function tryImportMetaResolve(id, options) {
try {
return {
error: null,
value: (((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;
})(id, {
paths: [dirname]
})
value: (0, _importMetaResolve.resolve)(id, options)
};

@@ -147,21 +154,2 @@ } catch (error) {

}
function tryImportMetaResolve(_x, _x2) {
return _tryImportMetaResolve.apply(this, arguments);
}
function _tryImportMetaResolve() {
_tryImportMetaResolve = _asyncToGenerator(function* (id, options) {
try {
return {
error: null,
value: yield (0, _importMetaResolve.default)(id, options)
};
} catch (error) {
return {
error,
value: null
};
}
});
return _tryImportMetaResolve.apply(this, arguments);
}
function resolveStandardizedNameForRequire(type, name, dirname) {

@@ -171,46 +159,31 @@ const it = resolveAlternativesHelper(type, name);

while (!res.done) {
res = it.next(tryRequireResolve(res.value, {
paths: [dirname]
}));
res = it.next(tryRequireResolve(res.value, dirname));
}
return res.value;
}
function resolveStandardizedNameForImport(_x3, _x4, _x5) {
return _resolveStandardizedNameForImport.apply(this, arguments);
function resolveStandardizedNameForImport(type, name, dirname) {
const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname, "./babel-virtual-resolve-base.js")).href;
const it = resolveAlternativesHelper(type, name);
let res = it.next();
while (!res.done) {
res = it.next(tryImportMetaResolve(res.value, parentUrl));
}
return (0, _url().fileURLToPath)(res.value);
}
function _resolveStandardizedNameForImport() {
_resolveStandardizedNameForImport = _asyncToGenerator(function* (type, name, dirname) {
const parentUrl = (0, _url().pathToFileURL)(_path().join(dirname, "./babel-virtual-resolve-base.js")).href;
const it = resolveAlternativesHelper(type, name);
let res = it.next();
while (!res.done) {
res = it.next(yield tryImportMetaResolve(res.value, parentUrl));
function resolveStandardizedName(type, name, dirname, resolveESM) {
if (!_moduleTypes.supportsESM || !resolveESM) {
return resolveStandardizedNameForRequire(type, name, dirname);
}
try {
return resolveStandardizedNameForImport(type, name, dirname);
} catch (e) {
try {
return resolveStandardizedNameForRequire(type, name, dirname);
} catch (e2) {
if (e.type === "MODULE_NOT_FOUND") throw e;
if (e2.type === "MODULE_NOT_FOUND") throw e2;
throw e;
}
return (0, _url().fileURLToPath)(res.value);
});
return _resolveStandardizedNameForImport.apply(this, arguments);
}
}
const resolveStandardizedName = _gensync()({
sync(type, name, dirname = process.cwd()) {
return resolveStandardizedNameForRequire(type, name, dirname);
},
async(type, name, dirname = process.cwd()) {
return _asyncToGenerator(function* () {
if (!_moduleTypes.supportsESM) {
return resolveStandardizedNameForRequire(type, name, dirname);
}
try {
return yield resolveStandardizedNameForImport(type, name, dirname);
} catch (e) {
try {
return resolveStandardizedNameForRequire(type, name, dirname);
} catch (e2) {
if (e.type === "MODULE_NOT_FOUND") throw e;
if (e2.type === "MODULE_NOT_FOUND") throw e2;
throw e;
}
}
})();
}
});
{

@@ -229,4 +202,5 @@ var LOADING_MODULES = new Set();

}
return yield* (0, _moduleTypes.default)(name, `You appear to be using a native ECMAScript module ${type}, ` + "which is only supported when running Babel asynchronously.",
true);
{
return yield* (0, _moduleTypes.default)(name, `You appear to be using a native ECMAScript module ${type}, ` + "which is only supported when running Babel asynchronously.", true);
}
} catch (err) {

@@ -233,0 +207,0 @@ err.message = `[BABEL]: ${err.message} (While processing: ${name})`;

@@ -7,4 +7,4 @@ "use strict";

exports.makeStaticFileCache = makeStaticFileCache;
var _caching = require("../caching");
var fs = require("../../gensync-utils/fs");
var _caching = require("../caching.js");
var fs = require("../../gensync-utils/fs.js");
function _fs2() {

@@ -11,0 +11,0 @@ const data = require("fs");

@@ -14,9 +14,9 @@ "use strict";

}
var _async = require("../gensync-utils/async");
var _util = require("./util");
var context = require("../index");
var _plugin = require("./plugin");
var _item = require("./item");
var _configChain = require("./config-chain");
var _deepArray = require("./helpers/deep-array");
var _async = require("../gensync-utils/async.js");
var _util = require("./util.js");
var context = require("../index.js");
var _plugin = require("./plugin.js");
var _item = require("./item.js");
var _configChain = require("./config-chain.js");
var _deepArray = require("./helpers/deep-array.js");
function _traverse() {

@@ -29,8 +29,8 @@ const data = require("@babel/traverse");

}
var _caching = require("./caching");
var _options = require("./validation/options");
var _plugins = require("./validation/plugins");
var _configApi = require("./helpers/config-api");
var _partial = require("./partial");
var _configError = require("../errors/config-error");
var _caching = require("./caching.js");
var _options = require("./validation/options.js");
var _plugins = require("./validation/plugins.js");
var _configApi = require("./helpers/config-api.js");
var _partial = require("./partial.js");
var _configError = require("../errors/config-error.js");
var _default = _gensync()(function* loadFullConfig(inputOpts) {

@@ -87,3 +87,2 @@ var _opts$assumptions;

externalDependencies.push(preset.externalDependencies);
if (descriptor.ownPass) {

@@ -102,3 +101,2 @@ presets.push({

}
if (presets.length > 0) {

@@ -173,3 +171,2 @@ pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass));

}
const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function* ({

@@ -261,3 +258,2 @@ value,

});
function* loadPluginDescriptor(descriptor, context) {

@@ -281,2 +277,3 @@ if (descriptor.value instanceof _plugin.default) {

if (!context.filename) {
var _options$overrides;
const {

@@ -286,5 +283,3 @@ options

validateIfOptionNeedsFilename(options, descriptor);
if (options.overrides) {
options.overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));
}
(_options$overrides = options.overrides) == null ? void 0 : _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor));
}

@@ -305,3 +300,2 @@ };

});
function* loadPresetDescriptor(descriptor, context) {

@@ -308,0 +302,0 @@ const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context));

@@ -16,4 +16,4 @@ "use strict";

}
var _ = require("../../");
var _caching = require("../caching");
var _index = require("../../index.js");
var _caching = require("../caching.js");
function makeConfigAPI(cache) {

@@ -34,3 +34,3 @@ const env = value => cache.using(data => {

return {
version: _.version,
version: _index.version,
cache: cache.simple(),

@@ -44,4 +44,3 @@ env,

function makePresetAPI(cache, externalDependencies) {
const targets = () =>
JSON.parse(cache.using(data => JSON.stringify(data.targets)));
const targets = () => JSON.parse(cache.using(data => JSON.stringify(data.targets)));
const addExternalDependency = ref => {

@@ -71,3 +70,4 @@ externalDependencies.push(ref);

}
if (_semver().satisfies(_.version, range)) return;
;
if (_semver().satisfies(_index.version, range)) return;
const limit = Error.stackTraceLimit;

@@ -77,3 +77,3 @@ if (typeof limit === "number" && limit < 25) {

}
const err = new Error(`Requires Babel "${range}", but was loaded with "${_.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
const err = new Error(`Requires Babel "${range}", but was loaded with "${_index.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
if (typeof limit === "number") {

@@ -84,3 +84,3 @@ Error.stackTraceLimit = limit;

code: "BABEL_VERSION_UNSUPPORTED",
version: _.version,
version: _index.version,
range

@@ -87,0 +87,0 @@ });

@@ -8,3 +8,2 @@ "use strict";

exports.flattenToSet = flattenToSet;
function finalize(deepArr) {

@@ -11,0 +10,0 @@ return Object.freeze(deepArr);

@@ -7,3 +7,4 @@ "use strict";

exports.createConfigItem = createConfigItem;
exports.createConfigItemSync = exports.createConfigItemAsync = void 0;
exports.createConfigItemAsync = createConfigItemAsync;
exports.createConfigItemSync = createConfigItemSync;
Object.defineProperty(exports, "default", {

@@ -15,3 +16,8 @@ enumerable: true,

});
exports.loadPartialConfigSync = exports.loadPartialConfigAsync = exports.loadPartialConfig = exports.loadOptionsSync = exports.loadOptionsAsync = exports.loadOptions = void 0;
exports.loadOptions = loadOptions;
exports.loadOptionsAsync = loadOptionsAsync;
exports.loadOptionsSync = loadOptionsSync;
exports.loadPartialConfig = loadPartialConfig;
exports.loadPartialConfigAsync = loadPartialConfigAsync;
exports.loadPartialConfigSync = loadPartialConfigSync;
function _gensync() {

@@ -24,46 +30,63 @@ const data = require("gensync");

}
var _full = require("./full");
var _partial = require("./partial");
var _item = require("./item");
const loadOptionsRunner = _gensync()(function* (opts) {
var _full = require("./full.js");
var _partial = require("./partial.js");
var _item = require("./item.js");
var _rewriteStackTrace = require("../errors/rewrite-stack-trace.js");
const loadPartialConfigRunner = _gensync()(_partial.loadPartialConfig);
function loadPartialConfigAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.async)(...args);
}
function loadPartialConfigSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.sync)(...args);
}
function loadPartialConfig(opts, callback) {
if (callback !== undefined) {
(0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(opts, callback);
} else if (typeof opts === "function") {
(0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(undefined, opts);
} else {
{
return loadPartialConfigSync(opts);
}
}
}
function* loadOptionsImpl(opts) {
var _config$options;
const config = yield* (0, _full.default)(opts);
return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null;
});
const createConfigItemRunner = _gensync()(_item.createConfigItem);
const maybeErrback = runner => (argOrCallback, maybeCallback) => {
let arg;
let callback;
if (maybeCallback === undefined && typeof argOrCallback === "function") {
callback = argOrCallback;
arg = undefined;
}
const loadOptionsRunner = _gensync()(loadOptionsImpl);
function loadOptionsAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.async)(...args);
}
function loadOptionsSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.sync)(...args);
}
function loadOptions(opts, callback) {
if (callback !== undefined) {
(0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(opts, callback);
} else if (typeof opts === "function") {
(0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(undefined, opts);
} else {
callback = maybeCallback;
arg = argOrCallback;
{
return loadOptionsSync(opts);
}
}
return callback ? runner.errback(arg, callback) : runner.sync(arg);
};
const loadPartialConfig = maybeErrback(_partial.loadPartialConfig);
exports.loadPartialConfig = loadPartialConfig;
const loadPartialConfigSync = _partial.loadPartialConfig.sync;
exports.loadPartialConfigSync = loadPartialConfigSync;
const loadPartialConfigAsync = _partial.loadPartialConfig.async;
exports.loadPartialConfigAsync = loadPartialConfigAsync;
const loadOptions = maybeErrback(loadOptionsRunner);
exports.loadOptions = loadOptions;
const loadOptionsSync = loadOptionsRunner.sync;
exports.loadOptionsSync = loadOptionsSync;
const loadOptionsAsync = loadOptionsRunner.async;
exports.loadOptionsAsync = loadOptionsAsync;
const createConfigItemSync = createConfigItemRunner.sync;
exports.createConfigItemSync = createConfigItemSync;
const createConfigItemAsync = createConfigItemRunner.async;
exports.createConfigItemAsync = createConfigItemAsync;
}
const createConfigItemRunner = _gensync()(_item.createConfigItem);
function createConfigItemAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.async)(...args);
}
function createConfigItemSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.sync)(...args);
}
function createConfigItem(target, options, callback) {
if (callback !== undefined) {
return createConfigItemRunner.errback(target, options, callback);
(0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, options, callback);
} else if (typeof options === "function") {
return createConfigItemRunner.errback(target, undefined, callback);
(0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, undefined, callback);
} else {
return createConfigItemRunner.sync(target, options);
{
return createConfigItemSync(target, options);
}
}

@@ -70,0 +93,0 @@ }

@@ -16,7 +16,6 @@ "use strict";

}
var _configDescriptors = require("./config-descriptors");
var _configDescriptors = require("./config-descriptors.js");
function createItemFromDescriptor(desc) {
return new ConfigItem(desc);
}
function* createConfigItem(value, {

@@ -40,3 +39,2 @@ dirname = ".",

class ConfigItem {
constructor(descriptor) {

@@ -65,3 +63,2 @@ this._descriptor = void 0;

} : undefined;
Object.freeze(this);

@@ -68,0 +65,0 @@ }

@@ -7,3 +7,3 @@ "use strict";

exports.default = loadPrivatePartialConfig;
exports.loadPartialConfig = void 0;
exports.loadPartialConfig = loadPartialConfig;
function _path() {

@@ -16,17 +16,10 @@ const data = require("path");

}
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _plugin = require("./plugin");
var _util = require("./util");
var _item = require("./item");
var _configChain = require("./config-chain");
var _environment = require("./helpers/environment");
var _options = require("./validation/options");
var _files = require("./files");
var _resolveTargets = require("./resolve-targets");
var _plugin = require("./plugin.js");
var _util = require("./util.js");
var _item = require("./item.js");
var _configChain = require("./config-chain.js");
var _environment = require("./helpers/environment.js");
var _options = require("./validation/options.js");
var _index = require("./files/index.js");
var _resolveTargets = require("./resolve-targets.js");
const _excluded = ["showIgnoredFiles"];

@@ -40,3 +33,3 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

{
const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
return upwardRootDir === null ? rootDir : upwardRootDir;

@@ -46,5 +39,5 @@ }

{
const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
const upwardRootDir = (0, _index.findConfigUpwards)(rootDir);
if (upwardRootDir !== null) return upwardRootDir;
throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_files.ROOT_CONFIG_FILENAMES.join(", ")}".`), {
throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_index.ROOT_CONFIG_FILENAMES.join(", ")}".`), {
code: "BABEL_ROOT_NOT_FOUND",

@@ -74,3 +67,3 @@ dirname: rootDir

const filename = typeof args.filename === "string" ? _path().resolve(cwd, args.filename) : undefined;
const showConfigPath = yield* (0, _files.resolveShowConfigPath)(absoluteCwd);
const showConfigPath = yield* (0, _index.resolveShowConfigPath)(absoluteCwd);
const context = {

@@ -117,3 +110,3 @@ filename,

}
const loadPartialConfig = _gensync()(function* (opts) {
function* loadPartialConfig(opts) {
let showIgnoredFiles = false;

@@ -147,6 +140,4 @@ if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) {

return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files);
});
exports.loadPartialConfig = loadPartialConfig;
}
class PartialConfig {
constructor(options, babelrc, ignore, config, fileHandling, files) {

@@ -165,6 +156,4 @@ this.options = void 0;

this.files = files;
Object.freeze(this);
}
hasFilesystemConfig() {

@@ -171,0 +160,0 @@ return this.babelrc !== undefined || this.config !== undefined;

@@ -24,3 +24,2 @@ "use strict";

}
function pathToPattern(pattern, dirname) {

@@ -30,11 +29,7 @@ const parts = _path().resolve(dirname, pattern).split(_path().sep);

const last = i === parts.length - 1;
if (part === "**") return last ? starStarPatLast : starStarPat;
if (part === "*") return last ? starPatLast : starPat;
if (part.indexOf("*.") === 0) {
return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep);
}
return escapeRegExp(part) + (last ? endSep : sep);

@@ -41,0 +36,0 @@ })].join(""));

@@ -7,3 +7,3 @@ "use strict";

exports.default = void 0;
var _deepArray = require("./helpers/deep-array");
var _deepArray = require("./helpers/deep-array.js");
class Plugin {

@@ -10,0 +10,0 @@ constructor(plugin, options, key, externalDependencies = (0, _deepArray.finalize)([])) {

@@ -15,9 +15,6 @@ "use strict";

}
function resolveBrowserslistConfigFile(
browserslistConfigFile,
configFilePath) {
function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) {
return undefined;
}
function resolveTargets(options,
root) {
function resolveTargets(options, root) {
const optTargets = options.targets;

@@ -24,0 +21,0 @@ let targets;

@@ -33,3 +33,3 @@ "use strict";

}
var _options = require("./options");
var _options = require("./options.js");
function msg(loc) {

@@ -136,5 +136,3 @@ switch (loc.type) {

const arr = assertArray(loc, value);
if (arr) {
arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
}
arr == null ? void 0 : arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
return arr;

@@ -218,3 +216,2 @@ }

}
return value;

@@ -262,3 +259,2 @@ }

}
let root = loc;

@@ -281,3 +277,2 @@ do {

}
return value;

@@ -284,0 +279,0 @@ }

@@ -9,5 +9,5 @@ "use strict";

exports.validate = validate;
var _removed = require("./removed");
var _optionAssertions = require("./option-assertions");
var _configError = require("../../errors/config-error");
var _removed = require("./removed.js");
var _optionAssertions = require("./option-assertions.js");
var _configError = require("../../errors/config-error.js");
const ROOT_VALIDATORS = {

@@ -74,3 +74,3 @@ cwd: _optionAssertions.assertString,

}
const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "objectRestNoSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"];
const assumptionsNames = new Set(knownAssumptions);

@@ -77,0 +77,0 @@ exports.assumptionsNames = assumptionsNames;

@@ -7,3 +7,3 @@ "use strict";

exports.validatePluginObject = validatePluginObject;
var _optionAssertions = require("./option-assertions");
var _optionAssertions = require("./option-assertions.js");
const VALIDATORS = {

@@ -22,3 +22,7 @@ name: _optionAssertions.assertString,

if (obj) {
Object.keys(obj).forEach(prop => assertVisitorHandler(prop, obj[prop]));
Object.keys(obj).forEach(prop => {
if (prop !== "_exploded" && prop !== "_verified") {
assertVisitorHandler(prop, obj[prop]);
}
});
if (obj.enter || obj.exit) {

@@ -40,3 +44,2 @@ throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`);

}
return value;
}

@@ -43,0 +46,0 @@ function validatePluginObject(obj) {

@@ -7,3 +7,3 @@ "use strict";

exports.default = void 0;
var _rewriteStackTrace = require("./rewrite-stack-trace");
var _rewriteStackTrace = require("./rewrite-stack-trace.js");
class ConfigError extends Error {

@@ -13,3 +13,3 @@ constructor(message, filename) {

(0, _rewriteStackTrace.expectedError)(this);
if (filename) (0, _rewriteStackTrace.injcectVirtualStackFrame)(this, filename);
if (filename) (0, _rewriteStackTrace.injectVirtualStackFrame)(this, filename);
}

@@ -16,0 +16,0 @@ }

@@ -9,8 +9,8 @@ "use strict";

exports.expectedError = expectedError;
exports.injcectVirtualStackFrame = injcectVirtualStackFrame;
exports.injectVirtualStackFrame = injectVirtualStackFrame;
var _Object$getOwnPropert;
const ErrorToString = Function.call.bind(Error.prototype.toString);
const SUPPORTED = !!Error.captureStackTrace;
const START_HIDNG = "startHiding - secret - don't use this - v1";
const STOP_HIDNG = "stopHiding - secret - don't use this - v1";
const SUPPORTED = !!Error.captureStackTrace && ((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit")) == null ? void 0 : _Object$getOwnPropert.writable) === true;
const START_HIDING = "startHiding - secret - don't use this - v1";
const STOP_HIDING = "stopHiding - secret - don't use this - v1";
const expectedErrors = new WeakSet();

@@ -32,3 +32,3 @@ const virtualFrames = new WeakMap();

}
function injcectVirtualStackFrame(error, filename) {
function injectVirtualStackFrame(error, filename) {
if (!SUPPORTED) return;

@@ -51,3 +51,3 @@ let frames = virtualFrames.get(error);

}, "name", {
value: STOP_HIDNG
value: STOP_HIDING
});

@@ -60,3 +60,3 @@ }

}, "name", {
value: START_HIDNG
value: START_HIDING
});

@@ -69,3 +69,2 @@ }

} = Error;
const MIN_STACK_TRACE_LIMIT = 50;

@@ -79,5 +78,5 @@ Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, MIN_STACK_TRACE_LIMIT));

const name = trace[i].getFunctionName();
if (name === START_HIDNG) {
if (name === START_HIDING) {
status = "hiding";
} else if (name === STOP_HIDNG) {
} else if (name === STOP_HIDING) {
if (status === "hiding") {

@@ -84,0 +83,0 @@ status = "showing";

@@ -23,3 +23,2 @@ "use strict";

});
const isAsync = _gensync()({

@@ -29,3 +28,2 @@ sync: () => false,

});
exports.isAsync = isAsync;

@@ -55,3 +53,2 @@ function maybeAsync(fn, message) {

});
function forwardAsync(action, cb) {

@@ -64,3 +61,2 @@ const g = _gensync()(action);

}
const onFirstPause = _gensync()({

@@ -83,3 +79,2 @@ name: "onFirstPause",

});
exports.onFirstPause = onFirstPause;

@@ -86,0 +81,0 @@ const waitFor = _gensync()({

@@ -7,3 +7,3 @@ "use strict";

exports.once = once;
var _async = require("./async");
var _async = require("./async.js");
function once(fn) {

@@ -10,0 +10,0 @@ let result;

@@ -13,4 +13,2 @@ "use strict";

});
exports.OptionManager = void 0;
exports.Plugin = Plugin;
Object.defineProperty(exports, "buildExternalHelpers", {

@@ -25,3 +23,3 @@ enumerable: true,

get: function () {
return _config.createConfigItem;
return _index2.createConfigItem;
}

@@ -32,3 +30,3 @@ });

get: function () {
return _config.createConfigItemAsync;
return _index2.createConfigItemAsync;
}

@@ -39,3 +37,3 @@ });

get: function () {
return _config.createConfigItemSync;
return _index2.createConfigItemSync;
}

@@ -52,3 +50,3 @@ });

get: function () {
return _config.loadOptions;
return _index2.loadOptions;
}

@@ -59,3 +57,3 @@ });

get: function () {
return _config.loadOptionsAsync;
return _index2.loadOptionsAsync;
}

@@ -66,3 +64,3 @@ });

get: function () {
return _config.loadOptionsSync;
return _index2.loadOptionsSync;
}

@@ -73,3 +71,3 @@ });

get: function () {
return _config.loadPartialConfig;
return _index2.loadPartialConfig;
}

@@ -80,3 +78,3 @@ });

get: function () {
return _config.loadPartialConfigAsync;
return _index2.loadPartialConfigAsync;
}

@@ -87,3 +85,3 @@ });

get: function () {
return _config.loadPartialConfigSync;
return _index2.loadPartialConfigSync;
}

@@ -112,3 +110,3 @@ });

get: function () {
return _files.resolvePlugin;
return _index.resolvePlugin;
}

@@ -119,3 +117,3 @@ });

get: function () {
return _files.resolvePreset;
return _index.resolvePreset;
}

@@ -196,6 +194,6 @@ });

exports.version = exports.types = void 0;
var _file = require("./transformation/file/file");
var _buildExternalHelpers = require("./tools/build-external-helpers");
var _files = require("./config/files");
var _environment = require("./config/helpers/environment");
var _file = require("./transformation/file/file.js");
var _buildExternalHelpers = require("./tools/build-external-helpers.js");
var _index = require("./config/files/index.js");
var _environment = require("./config/helpers/environment.js");
function _types() {

@@ -235,23 +233,26 @@ const data = require("@babel/types");

}
var _config = require("./config");
var _transform = require("./transform");
var _transformFile = require("./transform-file");
var _transformAst = require("./transform-ast");
var _parse = require("./parse");
const version = "7.20.5";
var _index2 = require("./config/index.js");
var _transform = require("./transform.js");
var _transformFile = require("./transform-file.js");
var _transformAst = require("./transform-ast.js");
var _parse = require("./parse.js");
var thisFile = require("./index.js");
;
const version = "7.23.2";
exports.version = version;
const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
class OptionManager {
init(opts) {
return (0, _config.loadOptionsSync)(opts);
}
;
{
exports.OptionManager = class OptionManager {
init(opts) {
return (0, _index2.loadOptionsSync)(opts);
}
};
exports.Plugin = function Plugin(alias) {
throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
};
}
exports.OptionManager = OptionManager;
function Plugin(alias) {
throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
}
0 && (exports.types = exports.traverse = exports.tokTypes = exports.template = 0);
//# sourceMappingURL=index.js.map

@@ -16,12 +16,12 @@ "use strict";

}
var _config = require("./config");
var _parser = require("./parser");
var _normalizeOpts = require("./transformation/normalize-opts");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace");
var _index = require("./config/index.js");
var _index2 = require("./parser/index.js");
var _normalizeOpts = require("./transformation/normalize-opts.js");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
const parseRunner = _gensync()(function* parse(code, opts) {
const config = yield* (0, _config.default)(opts);
const config = yield* (0, _index.default)(opts);
if (config === null) {
return null;
}
return yield* (0, _parser.default)(config.passes, (0, _normalizeOpts.default)(config), code);
return yield* (0, _index2.default)(config.passes, (0, _normalizeOpts.default)(config), code);
});

@@ -28,0 +28,0 @@ const parse = function parse(code, opts, callback) {

@@ -21,3 +21,3 @@ "use strict";

}
var _missingPluginHelper = require("./util/missing-plugin-helper");
var _missingPluginHelper = require("./util/missing-plugin-helper.js");
function* parser(pluginPasses, {

@@ -55,3 +55,2 @@ parserOpts,

}
const {

@@ -58,0 +57,0 @@ loc,

@@ -90,6 +90,6 @@ "use strict";

},
importAssertions: {
importAttributes: {
syntax: {
name: "@babel/plugin-syntax-import-assertions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions"
name: "@babel/plugin-syntax-import-attributes",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes"
}

@@ -113,12 +113,2 @@ },

},
regexpUnicodeSets: {
syntax: {
name: "@babel/plugin-syntax-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md"
},
transform: {
name: "@babel/plugin-proposal-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md"
}
},
throwExpressions: {

@@ -143,154 +133,172 @@ syntax: {

}
},
asyncGenerators: {
syntax: {
name: "@babel/plugin-syntax-async-generators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators"
}
};
{
Object.assign(pluginNameMap, {
asyncGenerators: {
syntax: {
name: "@babel/plugin-syntax-async-generators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators"
},
transform: {
name: "@babel/plugin-transform-async-generator-functions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions"
}
},
transform: {
name: "@babel/plugin-proposal-async-generator-functions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-async-generator-functions"
}
},
classProperties: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
classProperties: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
},
transform: {
name: "@babel/plugin-transform-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
}
},
transform: {
name: "@babel/plugin-proposal-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-class-properties"
}
},
classPrivateProperties: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
classPrivateProperties: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
},
transform: {
name: "@babel/plugin-transform-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
}
},
transform: {
name: "@babel/plugin-proposal-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-class-properties"
}
},
classPrivateMethods: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
classPrivateMethods: {
syntax: {
name: "@babel/plugin-syntax-class-properties",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
},
transform: {
name: "@babel/plugin-transform-private-methods",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods"
}
},
transform: {
name: "@babel/plugin-proposal-private-methods",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-private-methods"
}
},
classStaticBlock: {
syntax: {
name: "@babel/plugin-syntax-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block"
classStaticBlock: {
syntax: {
name: "@babel/plugin-syntax-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block"
},
transform: {
name: "@babel/plugin-transform-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block"
}
},
transform: {
name: "@babel/plugin-proposal-class-static-block",
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-class-static-block"
}
},
dynamicImport: {
syntax: {
name: "@babel/plugin-syntax-dynamic-import",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import"
}
},
exportNamespaceFrom: {
syntax: {
name: "@babel/plugin-syntax-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from"
dynamicImport: {
syntax: {
name: "@babel/plugin-syntax-dynamic-import",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import"
}
},
transform: {
name: "@babel/plugin-proposal-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-namespace-from"
}
},
importMeta: {
syntax: {
name: "@babel/plugin-syntax-import-meta",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta"
}
},
logicalAssignment: {
syntax: {
name: "@babel/plugin-syntax-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators"
exportNamespaceFrom: {
syntax: {
name: "@babel/plugin-syntax-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from"
},
transform: {
name: "@babel/plugin-transform-export-namespace-from",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from"
}
},
transform: {
name: "@babel/plugin-proposal-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-logical-assignment-operators"
}
},
moduleStringNames: {
syntax: {
name: "@babel/plugin-syntax-module-string-names",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names"
}
},
numericSeparator: {
syntax: {
name: "@babel/plugin-syntax-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator"
importAssertions: {
syntax: {
name: "@babel/plugin-syntax-import-assertions",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions"
}
},
transform: {
name: "@babel/plugin-proposal-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-numeric-separator"
}
},
nullishCoalescingOperator: {
syntax: {
name: "@babel/plugin-syntax-nullish-coalescing-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator"
importMeta: {
syntax: {
name: "@babel/plugin-syntax-import-meta",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta"
}
},
transform: {
name: "@babel/plugin-proposal-nullish-coalescing-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator"
}
},
objectRestSpread: {
syntax: {
name: "@babel/plugin-syntax-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread"
logicalAssignment: {
syntax: {
name: "@babel/plugin-syntax-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators"
},
transform: {
name: "@babel/plugin-transform-logical-assignment-operators",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators"
}
},
transform: {
name: "@babel/plugin-proposal-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-object-rest-spread"
}
},
optionalCatchBinding: {
syntax: {
name: "@babel/plugin-syntax-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding"
moduleStringNames: {
syntax: {
name: "@babel/plugin-syntax-module-string-names",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names"
}
},
transform: {
name: "@babel/plugin-proposal-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-optional-catch-binding"
}
},
optionalChaining: {
syntax: {
name: "@babel/plugin-syntax-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining"
numericSeparator: {
syntax: {
name: "@babel/plugin-syntax-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator"
},
transform: {
name: "@babel/plugin-transform-numeric-separator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator"
}
},
transform: {
name: "@babel/plugin-proposal-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-optional-chaining"
}
},
privateIn: {
syntax: {
name: "@babel/plugin-syntax-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object"
nullishCoalescingOperator: {
syntax: {
name: "@babel/plugin-syntax-nullish-coalescing-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator"
},
transform: {
name: "@babel/plugin-transform-nullish-coalescing-operator",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator"
}
},
transform: {
name: "@babel/plugin-proposal-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-private-property-in-object"
objectRestSpread: {
syntax: {
name: "@babel/plugin-syntax-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread"
},
transform: {
name: "@babel/plugin-transform-object-rest-spread",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread"
}
},
optionalCatchBinding: {
syntax: {
name: "@babel/plugin-syntax-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding"
},
transform: {
name: "@babel/plugin-transform-optional-catch-binding",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding"
}
},
optionalChaining: {
syntax: {
name: "@babel/plugin-syntax-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining"
},
transform: {
name: "@babel/plugin-transform-optional-chaining",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining"
}
},
privateIn: {
syntax: {
name: "@babel/plugin-syntax-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object"
},
transform: {
name: "@babel/plugin-transform-private-property-in-object",
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object"
}
},
regexpUnicodeSets: {
syntax: {
name: "@babel/plugin-syntax-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md"
},
transform: {
name: "@babel/plugin-transform-unicode-sets-regex",
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md"
}
}
}
};
pluginNameMap.privateIn.syntax = pluginNameMap.privateIn.transform;
});
}
const getNameURLCombination = ({

@@ -300,3 +308,2 @@ name,

}) => `${name} (${url})`;
function generateMissingPluginMessage(missingPluginName, loc, codeFrame) {

@@ -303,0 +310,0 @@ let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;

@@ -35,3 +35,3 @@ "use strict";

}
var _file = require("../transformation/file/file");
var _file = require("../transformation/file/file.js");
const {

@@ -75,4 +75,3 @@ arrayExpression,

const container = functionExpression(null, [identifier("global")], blockStatement(body));
const tree = program([expressionStatement(callExpression(container, [
conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))]));

@@ -79,0 +78,0 @@ buildHelpers(body, namespace, allowlist);

@@ -16,10 +16,10 @@ "use strict";

}
var _config = require("./config");
var _transformation = require("./transformation");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace");
var _index = require("./config/index.js");
var _index2 = require("./transformation/index.js");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
const transformFromAstRunner = _gensync()(function* (ast, code, opts) {
const config = yield* (0, _config.default)(opts);
const config = yield* (0, _index.default)(opts);
if (config === null) return null;
if (!ast) throw new Error("No AST given");
return yield* (0, _transformation.run)(config, code, ast);
return yield* (0, _index2.run)(config, code, ast);
});

@@ -26,0 +26,0 @@ const transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) {

@@ -9,3 +9,2 @@ "use strict";

exports.transformFileSync = transformFileSync;
const transformFile = function transformFile(filename, opts, callback) {

@@ -12,0 +11,0 @@ if (typeof opts === "function") {

@@ -16,5 +16,5 @@ "use strict";

}
var _config = require("./config");
var _transformation = require("./transformation");
var fs = require("./gensync-utils/fs");
var _index = require("./config/index.js");
var _index2 = require("./transformation/index.js");
var fs = require("./gensync-utils/fs.js");
({});

@@ -25,10 +25,9 @@ const transformFileRunner = _gensync()(function* (filename, opts) {

});
const config = yield* (0, _config.default)(options);
const config = yield* (0, _index.default)(options);
if (config === null) return null;
const code = yield* fs.readFile(filename, "utf8");
return yield* (0, _transformation.run)(config, code);
return yield* (0, _index2.run)(config, code);
});
function transformFile(...args) {
return transformFileRunner.errback(...args);
transformFileRunner.errback(...args);
}

@@ -35,0 +34,0 @@ function transformFileSync(...args) {

@@ -16,9 +16,9 @@ "use strict";

}
var _config = require("./config");
var _transformation = require("./transformation");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace");
var _index = require("./config/index.js");
var _index2 = require("./transformation/index.js");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
const transformRunner = _gensync()(function* transform(code, opts) {
const config = yield* (0, _config.default)(opts);
const config = yield* (0, _index.default)(opts);
if (config === null) return null;
return yield* (0, _transformation.run)(config, code);
return yield* (0, _index2.run)(config, code);
});

@@ -25,0 +25,0 @@ const transform = function transform(code, optsOrCallback, maybeCallback) {

@@ -14,6 +14,5 @@ "use strict";

}
var _plugin = require("../config/plugin");
var _plugin = require("../config/plugin.js");
let LOADED_PLUGIN;
const blockHoistPlugin = {
name: "internal.blockHoist",

@@ -28,3 +27,2 @@ visitor: {

} = node;
let max = Math.pow(2, 30) - 1;

@@ -42,3 +40,2 @@ let hasChange = false;

if (!hasChange) return;
node.body = stableSort(body.slice());

@@ -65,11 +62,8 @@ }

const buckets = Object.create(null);
for (let i = 0; i < body.length; i++) {
const n = body[i];
const p = priority(n);
const bucket = buckets[p] || (buckets[p] = []);
bucket.push(n);
}
const keys = Object.keys(buckets).map(k => +k).sort((a, b) => b - a);

@@ -76,0 +70,0 @@ let index = 0;

@@ -97,3 +97,2 @@ "use strict";

}
get shebang() {

@@ -130,3 +129,2 @@ const {

}
availableHelper(name, versionRange) {

@@ -141,3 +139,2 @@ let minVersion;

if (typeof versionRange !== "string") return true;
if (_semver().valid(versionRange)) versionRange = `^${versionRange}`;

@@ -154,3 +151,2 @@ return !_semver().intersects(`<${minVersion}`, versionRange) && !_semver().intersects(`>=8.0.0`, versionRange);

}
helpers().ensure(name, File);

@@ -157,0 +153,0 @@ const uid = this.declarations[name] = this.scope.generateUidIdentifier(name);

@@ -21,3 +21,3 @@ "use strict";

}
var _mergeMap = require("./merge-map");
var _mergeMap = require("./merge-map.js");
function generateCode(pluginPasses, file) {

@@ -33,2 +33,3 @@ const {

} = opts;
generatorOpts.inputSourceMap = inputMap == null ? void 0 : inputMap.toObject();
const results = [];

@@ -57,3 +58,2 @@ for (const plugins of pluginPasses) {

}
let {

@@ -63,7 +63,11 @@ code: outputCode,

} = result;
if (outputMap) {
if (inputMap) {
outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap, generatorOpts.sourceFileName);
} else {
outputMap = result.map;
if (result.__mergedMap) {
outputMap = Object.assign({}, result.map);
} else {
if (outputMap) {
if (inputMap) {
outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap, generatorOpts.sourceFileName);
} else {
outputMap = result.map;
}
}

@@ -70,0 +74,0 @@ }

@@ -16,3 +16,2 @@ "use strict";

const source = sourceFileName.replace(/\\/g, "/");
let found = false;

@@ -30,3 +29,2 @@ const result = _remapping()(rootless(map), (s, ctx) => {

}
return Object.assign({}, result);

@@ -33,0 +31,0 @@ }

@@ -14,8 +14,8 @@ "use strict";

}
var _pluginPass = require("./plugin-pass");
var _blockHoistPlugin = require("./block-hoist-plugin");
var _normalizeOpts = require("./normalize-opts");
var _normalizeFile = require("./normalize-file");
var _generate = require("./file/generate");
var _deepArray = require("../config/helpers/deep-array");
var _pluginPass = require("./plugin-pass.js");
var _blockHoistPlugin = require("./block-hoist-plugin.js");
var _normalizeOpts = require("./normalize-opts.js");
var _normalizeFile = require("./normalize-file.js");
var _generate = require("./file/generate.js");
var _deepArray = require("../config/helpers/deep-array.js");
function* run(config, code, ast) {

@@ -75,3 +75,2 @@ const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast);

const result = fn.call(pass, file);
yield* [];

@@ -83,5 +82,6 @@ if (isThenable(result)) {

}
const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);
(0, _traverse().default)(file.ast, visitor, file.scope);
{
(0, _traverse().default)(file.ast, visitor, file.scope);
}
for (const [plugin, pass] of passPairs) {

@@ -91,3 +91,2 @@ const fn = plugin.post;

const result = fn.call(pass, file);
yield* [];

@@ -94,0 +93,0 @@ if (isThenable(result)) {

@@ -42,5 +42,5 @@ "use strict";

}
var _file = require("./file/file");
var _parser = require("../parser");
var _cloneDeep = require("./util/clone-deep");
var _file = require("./file/file.js");
var _index = require("../parser/index.js");
var _cloneDeep = require("./util/clone-deep.js");
const {

@@ -51,4 +51,2 @@ file,

const debug = _debug()("babel:transform:file");
const LARGE_INPUT_SOURCEMAP_THRESHOLD = 3000000;
const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;

@@ -68,3 +66,3 @@ const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;

} else {
ast = yield* (0, _parser.default)(pluginPasses, options, code);
ast = yield* (0, _index.default)(pluginPasses, options, code);
}

@@ -80,5 +78,7 @@ let inputMap = null;

try {
inputMap = _convertSourceMap().fromComment(lastComment);
inputMap = _convertSourceMap().fromComment("//" + lastComment);
} catch (err) {
debug("discarding unknown inline input sourcemap", err);
{
debug("discarding unknown inline input sourcemap");
}
}

@@ -92,9 +92,4 @@ }

const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment);
const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]));
if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) {
debug("skip merging input map > 1 MB");
} else {
inputMap = _convertSourceMap().fromJSON(
inputMapContent);
}
const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]), "utf8");
inputMap = _convertSourceMap().fromJSON(inputMapContent);
} catch (err) {

@@ -101,0 +96,0 @@ debug("discarding unknown file input sourcemap", err);

@@ -8,3 +8,2 @@ "use strict";

class PluginPass {
constructor(file, key, options) {

@@ -35,5 +34,2 @@ this._map = new Map();

}
addImport() {
return this.file.addImport();
}
buildCodeFrameError(node, msg, _Error) {

@@ -48,2 +44,5 @@ return this.file.buildCodeFrameError(node, msg, _Error);

};
PluginPass.prototype.addImport = function addImport() {
this.file.addImport();
};
}

@@ -50,0 +49,0 @@ 0 && 0;

@@ -13,2 +13,3 @@ "use strict";

cloned = new Array(value.length);
cache.set(value, cloned);
for (let i = 0; i < value.length; i++) {

@@ -19,2 +20,3 @@ cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache);

cloned = {};
cache.set(value, cloned);
const keys = Object.keys(value);

@@ -26,3 +28,2 @@ for (let i = 0; i < keys.length; i++) {

}
cache.set(value, cloned);
return cloned;

@@ -29,0 +30,0 @@ }

{
"name": "@babel/core",
"version": "7.20.5",
"version": "7.23.2",
"description": "Babel compiler core.",

@@ -49,26 +49,27 @@ "main": "./lib/index.js",

"dependencies": {
"@ampproject/remapping": "^2.1.0",
"@babel/code-frame": "^7.18.6",
"@babel/generator": "^7.20.5",
"@babel/helper-compilation-targets": "^7.20.0",
"@babel/helper-module-transforms": "^7.20.2",
"@babel/helpers": "^7.20.5",
"@babel/parser": "^7.20.5",
"@babel/template": "^7.18.10",
"@babel/traverse": "^7.20.5",
"@babel/types": "^7.20.5",
"convert-source-map": "^1.7.0",
"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.22.13",
"@babel/generator": "^7.23.0",
"@babel/helper-compilation-targets": "^7.22.15",
"@babel/helper-module-transforms": "^7.23.0",
"@babel/helpers": "^7.23.2",
"@babel/parser": "^7.23.0",
"@babel/template": "^7.22.15",
"@babel/traverse": "^7.23.2",
"@babel/types": "^7.23.0",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
"json5": "^2.2.1",
"semver": "^6.3.0"
"json5": "^2.2.3",
"semver": "^6.3.1"
},
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "^7.19.4",
"@babel/plugin-syntax-flow": "^7.18.6",
"@babel/plugin-transform-flow-strip-types": "^7.19.0",
"@babel/plugin-transform-modules-commonjs": "^7.19.6",
"@babel/preset-env": "^7.20.2",
"@jridgewell/trace-mapping": "^0.3.8",
"@types/convert-source-map": "^1.5.1",
"@babel/helper-transform-fixture-test-runner": "^7.22.19",
"@babel/plugin-syntax-flow": "^7.22.5",
"@babel/plugin-transform-flow-strip-types": "^7.22.5",
"@babel/plugin-transform-modules-commonjs": "^7.23.0",
"@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@jridgewell/trace-mapping": "^0.3.17",
"@types/convert-source-map": "^2.0.0",
"@types/debug": "^4.1.0",

@@ -78,5 +79,6 @@ "@types/gensync": "^1.0.0",

"@types/semver": "^5.4.0",
"rimraf": "^3.0.0"
"rimraf": "^3.0.0",
"ts-node": "^10.9.1"
},
"type": "commonjs"
}

@@ -5,3 +5,3 @@ # @babel/core

See our website [@babel/core](https://babeljs.io/docs/en/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package.
See our website [@babel/core](https://babeljs.io/docs/babel-core) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen) associated with this package.

@@ -8,0 +8,0 @@ ## Install

@@ -8,5 +8,5 @@ import type { Handler } from "gensync";

FilePackageData,
} from "./types";
} from "./types.ts";
import type { CallerMetadata } from "../validation/options";
import type { CallerMetadata } from "../validation/options.ts";

@@ -13,0 +13,0 @@ export type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData };

@@ -6,5 +6,5 @@ type indexBrowserType = typeof import("./index-browser");

// exports of index-browser, since this file may be replaced at bundle time with index-browser.
({} as any as indexBrowserType as indexType);
({}) as any as indexBrowserType as indexType;
export { findPackageData } from "./package";
export { findPackageData } from "./package.ts";

@@ -18,3 +18,3 @@ export {

ROOT_CONFIG_FILENAMES,
} from "./configuration";
} from "./configuration.ts";
export type {

@@ -25,9 +25,8 @@ ConfigFile,

FilePackageData,
} from "./types";
export { loadPlugin, loadPreset } from "./plugins";
import gensync from "gensync";
import * as plugins from "./plugins";
export const resolvePlugin = gensync(plugins.resolvePlugin).sync;
export const resolvePreset = gensync(plugins.resolvePreset).sync;
} from "./types.ts";
export {
loadPlugin,
loadPreset,
resolvePlugin,
resolvePreset,
} from "./plugins.ts";

@@ -1,2 +0,2 @@

import type { ValidatedOptions } from "./validation/options";
import type { ValidatedOptions } from "./validation/options.ts";
import getTargets, {

@@ -3,0 +3,0 @@ type InputTargets,

@@ -6,5 +6,5 @@ type browserType = typeof import("./resolve-targets-browser");

// exports of index-browser, since this file may be replaced at bundle time with index-browser.
({} as any as browserType as nodeType);
({}) as any as browserType as nodeType;
import type { ValidatedOptions } from "./validation/options";
import type { ValidatedOptions } from "./validation/options.ts";
import path from "path";

@@ -11,0 +11,0 @@ import getTargets, {

import gensync, { type Handler } from "gensync";
import loadConfig from "./config";
import type { InputOptions, ResolvedConfig } from "./config";
import { run } from "./transformation";
import type { FileResult, FileResultCallback } from "./transformation";
import * as fs from "./gensync-utils/fs";
import loadConfig from "./config/index.ts";
import type { InputOptions, ResolvedConfig } from "./config/index.ts";
import { run } from "./transformation/index.ts";
import type { FileResult, FileResultCallback } from "./transformation/index.ts";
import * as fs from "./gensync-utils/fs.ts";

@@ -15,3 +15,3 @@ type transformFileBrowserType = typeof import("./transform-file-browser");

// transform-file-browser.
({} as any as transformFileBrowserType as transformFileType);
({}) as any as transformFileBrowserType as transformFileType;

@@ -44,3 +44,3 @@ const transformFileRunner = gensync(function* (

) {
return transformFileRunner.errback(...args);
transformFileRunner.errback(...args);
}

@@ -47,0 +47,0 @@

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

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

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

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

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

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

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

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

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

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

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

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

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

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 too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc