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

@babel/core - npm Package Compare versions

Comparing version 8.0.0-alpha.1 to 8.0.0-alpha.2

60

lib/config/files/configuration.js

@@ -6,3 +6,3 @@ import buildDebug from "debug";

import gensync from "gensync";
import { makeStrongCache, makeWeakCacheSync } from "../caching.js";
import { makeWeakCache, makeWeakCacheSync } from "../caching.js";
import { makeConfigAPI } from "../helpers/config-api.js";

@@ -22,15 +22,14 @@ import { makeStaticFileCache } from "./utils.js";

const LOADING_CONFIGS = new Set();
const readConfigCode = makeStrongCache(function* readConfigCode(filepath, cache) {
if (!nodeFs.existsSync(filepath)) {
cache.never();
return null;
}
const runConfig = makeWeakCache(function* runConfig(options, cache) {
yield* [];
return {
options: endHiddenCallStack(options)(makeConfigAPI(cache)),
cacheNeedsConfiguration: !cache.configured()
};
});
function* readConfigCode(filepath, data) {
if (!nodeFs.existsSync(filepath)) return null;
if (LOADING_CONFIGS.has(filepath)) {
cache.never();
debug("Auto-ignoring usage of config %o.", filepath);
return {
filepath,
dirname: path.dirname(filepath),
options: {}
};
return buildConfigFileObject({}, filepath);
}

@@ -44,7 +43,8 @@ let options;

}
let assertCache = false;
let cacheNeedsConfiguration = false;
if (typeof options === "function") {
yield* [];
options = endHiddenCallStack(options)(makeConfigAPI(cache));
assertCache = true;
({
options,
cacheNeedsConfiguration
} = yield* runConfig(options, data));
}

@@ -55,11 +55,25 @@ if (!options || typeof options !== "object" || Array.isArray(options)) {

if (typeof options.then === "function") {
options.catch?.(() => {});
throw new ConfigError(`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 = makeWeakCacheSync(file => {

@@ -66,0 +80,0 @@ const babel = file.options["babel"];

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

export const version = "8.0.0-alpha.1";
;
export const version = "8.0.0-alpha.2";
export { default as File } from "./transformation/file/file.js";

@@ -3,0 +4,0 @@ export { default as buildExternalHelpers } from "./tools/build-external-helpers.js";

@@ -67,3 +67,5 @@ import traverse from "@babel/traverse";

const visitor = traverse.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);
traverse(file.ast, visitor, file.scope);
{
traverse(file.ast.program, visitor, file.scope, null, file.path, true);
}
for (const [plugin, pass] of passPairs) {

@@ -70,0 +72,0 @@ const fn = plugin.post;

{
"name": "@babel/core",
"version": "8.0.0-alpha.1",
"version": "8.0.0-alpha.2",
"description": "Babel compiler core.",

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

"@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^8.0.0-alpha.1",
"@babel/generator": "^8.0.0-alpha.1",
"@babel/helper-compilation-targets": "^8.0.0-alpha.1",
"@babel/helper-module-transforms": "^8.0.0-alpha.1",
"@babel/helpers": "^8.0.0-alpha.1",
"@babel/parser": "^8.0.0-alpha.1",
"@babel/template": "^8.0.0-alpha.1",
"@babel/traverse": "^8.0.0-alpha.1",
"@babel/types": "^8.0.0-alpha.1",
"@babel/code-frame": "^8.0.0-alpha.2",
"@babel/generator": "^8.0.0-alpha.2",
"@babel/helper-compilation-targets": "^8.0.0-alpha.2",
"@babel/helper-module-transforms": "^8.0.0-alpha.2",
"@babel/helpers": "^8.0.0-alpha.2",
"@babel/parser": "^8.0.0-alpha.2",
"@babel/template": "^8.0.0-alpha.2",
"@babel/traverse": "^8.0.0-alpha.2",
"@babel/types": "^8.0.0-alpha.2",
"convert-source-map": "^1.7.0",

@@ -67,8 +67,8 @@ "debug": "^4.1.0",

"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "^8.0.0-alpha.1",
"@babel/plugin-syntax-flow": "^8.0.0-alpha.1",
"@babel/plugin-transform-flow-strip-types": "^8.0.0-alpha.1",
"@babel/plugin-transform-modules-commonjs": "^8.0.0-alpha.1",
"@babel/preset-env": "^8.0.0-alpha.1",
"@babel/preset-typescript": "^8.0.0-alpha.1",
"@babel/helper-transform-fixture-test-runner": "^8.0.0-alpha.2",
"@babel/plugin-syntax-flow": "^8.0.0-alpha.2",
"@babel/plugin-transform-flow-strip-types": "^8.0.0-alpha.2",
"@babel/plugin-transform-modules-commonjs": "^8.0.0-alpha.2",
"@babel/preset-env": "^8.0.0-alpha.2",
"@babel/preset-typescript": "^8.0.0-alpha.2",
"@jridgewell/trace-mapping": "^0.3.17",

@@ -75,0 +75,0 @@ "@types/convert-source-map": "^1.5.1",

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc