Socket
Socket
Sign inDemoInstall

@babel/core

Package Overview
Dependencies
52
Maintainers
4
Versions
183
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.22.10 to 7.23.2

4

lib/config/caching.js

@@ -18,4 +18,4 @@ "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 => {

@@ -22,0 +22,0 @@ return _gensync()(gen).sync;

@@ -23,10 +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");

@@ -66,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);
}

@@ -96,3 +96,3 @@ let {

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)) {

@@ -102,3 +102,3 @@ ({

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

@@ -328,3 +328,3 @@ fileChain.files.add(ignoreFile.filepath);

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)) {

@@ -331,0 +331,0 @@ 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"));

@@ -16,7 +16,7 @@ "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) {

@@ -136,3 +136,3 @@ var _a$file, _b$file, _a$file2, _b$file2;

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

@@ -139,0 +139,0 @@ ({

@@ -47,10 +47,10 @@ "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");
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");

@@ -61,29 +61,18 @@ const ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts"];

const BABELIGNORE_FILENAME = ".babelignore";
const LOADING_CONFIGS = new Set();
const readConfigCode = (0, _caching.makeStrongCache)(function* readConfigCode(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));
}

@@ -94,11 +83,25 @@ 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 => {

@@ -105,0 +108,0 @@ const babel = file.options["babel"];

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

});
var _package = require("./package");
var _configuration = require("./configuration");
var _plugins = require("./plugins");
var _package = require("./package.js");
var _configuration = require("./configuration.js");
var _plugins = require("./plugins.js");
({});

@@ -77,0 +77,0 @@ 0 && 0;

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

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

@@ -31,7 +31,15 @@ const data = require("path");

}
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace");
var _configError = require("../../errors/config-error");
var _transformFile = require("../../transform-file");
function _debug() {
const data = require("debug");
_debug = function () {
return data;
};
return data;
}
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_;

@@ -106,4 +114,3 @@ try {

try {
const module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(filepath);
return module != null && module.__esModule ? module.default : module;
return loadCjsDefault(filepath);
} finally {

@@ -116,6 +123,18 @@ if (!hasTsSupport) {

}
const LOADING_CJS_FILES = new Set();
function loadCjsDefault(filepath) {
const module = (0, _rewriteStackTrace.endHiddenCallStack)(require)(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);
}
{
return module != null && module.__esModule ? module.default || (arguments[1] ? module : undefined) : module;
var _module;
return (_module = module) != null && _module.__esModule ? module.default || (arguments[1] ? module : undefined) : module;
}

@@ -122,0 +141,0 @@ }

@@ -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";

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

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

}
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() {

@@ -33,3 +33,3 @@ const data = require("url");

}
var _importMetaResolve = require("./import-meta-resolve");
var _importMetaResolve = require("../../vendor/import-meta-resolve.js");
const debug = _debug()("babel:config:loading:files:plugins");

@@ -139,3 +139,3 @@ const EXACT_RE = /^module:/;

error: null,
value: (0, _importMetaResolve.default)(id, options)
value: (0, _importMetaResolve.resolve)(id, options)
};

@@ -142,0 +142,0 @@ } catch (error) {

@@ -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) {

@@ -37,0 +37,0 @@ var _opts$assumptions;

@@ -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(),

@@ -70,3 +70,3 @@ env,

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

@@ -76,3 +76,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") {

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

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

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

@@ -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,49 +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);
}
}
if (!callback) {
return runner.sync(arg);
}
runner.errback(arg, callback);
};
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) {
createConfigItemRunner.errback(target, options, callback);
(0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, options, callback);
} else if (typeof options === "function") {
createConfigItemRunner.errback(target, undefined, callback);
(0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, undefined, callback);
} else {
return createConfigItemRunner.sync(target, options);
{
return createConfigItemSync(target, options);
}
}

@@ -73,0 +93,0 @@ }

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

}
var _configDescriptors = require("./config-descriptors");
var _configDescriptors = require("./config-descriptors.js");
function createItemFromDescriptor(desc) {

@@ -19,0 +19,0 @@ return new ConfigItem(desc);

@@ -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,4 +140,3 @@ 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 {

@@ -151,0 +143,0 @@ constructor(options, babelrc, ignore, config, fileHandling, files) {

@@ -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)([])) {

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

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

@@ -36,0 +36,0 @@ switch (loc.type) {

@@ -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 = {

@@ -14,0 +14,0 @@ cwd: _optionAssertions.assertString,

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

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

@@ -10,0 +10,0 @@ name: _optionAssertions.assertString,

@@ -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 {

@@ -10,0 +10,0 @@ constructor(message, filename) {

@@ -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;

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

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

@@ -29,3 +29,3 @@ });

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

@@ -36,3 +36,3 @@ });

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

@@ -49,3 +49,3 @@ });

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

@@ -56,3 +56,3 @@ });

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

@@ -63,3 +63,3 @@ });

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

@@ -70,3 +70,3 @@ });

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

@@ -77,3 +77,3 @@ });

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

@@ -84,3 +84,3 @@ });

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

@@ -109,3 +109,3 @@ });

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

@@ -116,3 +116,3 @@ });

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

@@ -193,6 +193,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() {

@@ -232,10 +232,10 @@ 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");
var thisFile = require("./index");
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.22.10";
const version = "7.23.2";
exports.version = version;

@@ -246,12 +246,10 @@ const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]);

{
{
exports.OptionManager = class OptionManager {
init(opts) {
return (0, _config.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 = 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.`);
};
}

@@ -258,0 +256,0 @@ 0 && (exports.types = exports.traverse = exports.tokTypes = exports.template = 0);

@@ -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, {

@@ -24,0 +24,0 @@ parserOpts,

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

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

@@ -38,0 +38,0 @@ arrayExpression,

@@ -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) {

@@ -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,6 +25,6 @@ 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);
});

@@ -31,0 +31,0 @@ function transformFile(...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,3 +14,3 @@ "use strict";

}
var _plugin = require("../config/plugin");
var _plugin = require("../config/plugin.js");
let LOADED_PLUGIN;

@@ -17,0 +17,0 @@ const blockHoistPlugin = {

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

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

@@ -24,0 +24,0 @@ const {

@@ -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) {

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

@@ -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 {

@@ -65,3 +65,3 @@ file,

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

@@ -77,5 +77,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");
}
}

@@ -82,0 +84,0 @@ }

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

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

"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.22.10",
"@babel/generator": "^7.22.10",
"@babel/helper-compilation-targets": "^7.22.10",
"@babel/helper-module-transforms": "^7.22.9",
"@babel/helpers": "^7.22.10",
"@babel/parser": "^7.22.10",
"@babel/template": "^7.22.5",
"@babel/traverse": "^7.22.10",
"@babel/types": "^7.22.10",
"convert-source-map": "^1.7.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.2",
"json5": "^2.2.3",
"semver": "^6.3.1"
},
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "^7.22.10",
"@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.22.5",
"@babel/preset-env": "^7.22.10",
"@babel/preset-typescript": "^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": "^1.5.1",
"@types/convert-source-map": "^2.0.0",
"@types/debug": "^4.1.0",

@@ -76,0 +76,0 @@ "@types/gensync": "^1.0.0",

@@ -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 };

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

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,3 +25,3 @@ ConfigFile,

FilePackageData,
} from "./types";
} from "./types.ts";
export {

@@ -32,2 +32,2 @@ loadPlugin,

resolvePreset,
} from "./plugins";
} 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,

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

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";

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

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc