"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Gulpfile.js" between
babel-7.12.6.tar.gz and babel-7.12.7.tar.gz

About: Babel is a JavaScript compiler that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript. Hint: There exists a high-performance language interoperability tool also named "Babel".

Gulpfile.js  (babel-7.12.6):Gulpfile.js  (babel-7.12.7)
skipping to change at line 12 skipping to change at line 12
const plumber = require("gulp-plumber"); const plumber = require("gulp-plumber");
const through = require("through2"); const through = require("through2");
const chalk = require("chalk"); const chalk = require("chalk");
const newer = require("gulp-newer"); const newer = require("gulp-newer");
const babel = require("gulp-babel"); const babel = require("gulp-babel");
const fancyLog = require("fancy-log"); const fancyLog = require("fancy-log");
const filter = require("gulp-filter"); const filter = require("gulp-filter");
const gulp = require("gulp"); const gulp = require("gulp");
const path = require("path"); const path = require("path");
const fs = require("fs");
const rollup = require("rollup"); const rollup = require("rollup");
const rollupBabel = require("@rollup/plugin-babel").default; const rollupBabel = require("@rollup/plugin-babel").default;
const rollupBabelSource = require("./scripts/rollup-plugin-babel-source"); const rollupBabelSource = require("./scripts/rollup-plugin-babel-source");
const rollupCommonJs = require("@rollup/plugin-commonjs"); const rollupCommonJs = require("@rollup/plugin-commonjs");
const rollupJson = require("@rollup/plugin-json"); const rollupJson = require("@rollup/plugin-json");
const rollupNodePolyfills = require("rollup-plugin-node-polyfills"); const rollupNodePolyfills = require("rollup-plugin-node-polyfills");
const rollupNodeResolve = require("@rollup/plugin-node-resolve").default; const rollupNodeResolve = require("@rollup/plugin-node-resolve").default;
const rollupReplace = require("@rollup/plugin-replace"); const rollupReplace = require("@rollup/plugin-replace");
const { terser: rollupTerser } = require("rollup-plugin-terser"); const { terser: rollupTerser } = require("rollup-plugin-terser");
const defaultSourcesGlob = "./@(codemods|packages|eslint)/*/src/**/*.js"; const defaultSourcesGlob = "./@(codemods|packages|eslint)/*/src/**/*.{js,ts}";
function swapSrcWithLib(srcPath) { function swapSrcWithLib(srcPath) {
const parts = srcPath.split(path.sep); const parts = srcPath.split(path.sep);
parts[2] = "lib"; parts[2] = "lib";
return parts.join(path.sep); return parts.join(path.sep);
} }
function getIndexFromPackage(name) { function getIndexFromPackage(name) {
return `${name}/src/index.js`; try {
fs.statSync(`./${name}/src/index.ts`);
return `${name}/src/index.ts`;
} catch {
return `${name}/src/index.js`;
}
} }
function compilationLogger() { function compilationLogger() {
return through.obj(function (file, enc, callback) { return through.obj(function (file, enc, callback) {
fancyLog(`Compiling '${chalk.cyan(file.relative)}'...`); fancyLog(`Compiling '${chalk.cyan(file.relative)}'...`);
callback(null, file); callback(null, file);
}); });
} }
function errorsLogger() { function errorsLogger() {
skipping to change at line 99 skipping to change at line 105
let versionSuffix = ""; let versionSuffix = "";
if (process.env.CIRCLE_PR_NUMBER) { if (process.env.CIRCLE_PR_NUMBER) {
versionSuffix = "+pr." + process.env.CIRCLE_PR_NUMBER; versionSuffix = "+pr." + process.env.CIRCLE_PR_NUMBER;
} }
const babelVersion = const babelVersion =
require("./packages/babel-core/package.json").version + versionSuffix; require("./packages/babel-core/package.json").version + versionSuffix;
function buildRollup(packages) { function buildRollup(packages) {
const sourcemap = process.env.NODE_ENV === "production"; const sourcemap = process.env.NODE_ENV === "production";
return Promise.all( return Promise.all(
packages.map(async ({ src, format, dest, name, filename, version }) => { packages.map(async ({ src, format, dest, name, filename }) => {
const pkgJSON = require("./" + src + "/package.json");
const version = pkgJSON.version + versionSuffix;
const { dependencies = {}, peerDependencies = {} } = pkgJSON;
const external = Object.keys(dependencies).concat(
Object.keys(peerDependencies)
);
let nodeResolveBrowser = false, let nodeResolveBrowser = false,
babelEnvName = "rollup"; babelEnvName = "rollup";
switch (src) { switch (src) {
case "packages/babel-standalone": case "packages/babel-standalone":
nodeResolveBrowser = true; nodeResolveBrowser = true;
babelEnvName = "standalone"; babelEnvName = "standalone";
break; break;
} }
const input = getIndexFromPackage(src); const input = getIndexFromPackage(src);
fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`); fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`);
const bundle = await rollup.rollup({ const bundle = await rollup.rollup({
input, input,
external,
plugins: [ plugins: [
rollupBabelSource(), rollupBabelSource(),
rollupReplace({ rollupReplace({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV), "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
BABEL_VERSION: JSON.stringify(babelVersion), BABEL_VERSION: JSON.stringify(babelVersion),
VERSION: JSON.stringify(version), VERSION: JSON.stringify(version),
}), }),
rollupBabel({ rollupBabel({
envName: babelEnvName, envName: babelEnvName,
babelrc: false, babelrc: false,
babelHelpers: "bundled", babelHelpers: "bundled",
extends: "./babel.config.js", extends: "./babel.config.js",
extensions: [".mjs", ".cjs", ".ts", ".js"],
}), }),
rollupNodeResolve({ rollupNodeResolve({
extensions: [".mjs", ".cjs", ".ts", ".js", ".json"],
browser: nodeResolveBrowser, browser: nodeResolveBrowser,
preferBuiltins: true, preferBuiltins: true,
//todo: remove when semver and source-map are bumped to latest versi ons //todo: remove when semver and source-map are bumped to latest versi ons
dedupe(importee) { dedupe(importee) {
return ["semver", "source-map"].includes(importee); return ["semver", "source-map"].includes(importee);
}, },
}), }),
rollupCommonJs({ rollupCommonJs({
include: [ include: [
/node_modules/, /node_modules/,
"packages/babel-runtime/regenerator/**", "packages/babel-runtime/regenerator/**",
"packages/babel-preset-env/data/*.js", "packages/babel-preset-env/data/*.js",
// Rollup doesn't read export maps, so it loads the cjs fallback // Rollup doesn't read export maps, so it loads the cjs fallback
"packages/babel-compat-data/*.js", "packages/babel-compat-data/*.js",
], ],
}), }),
rollupJson(), rollupJson(),
rollupNodePolyfills({ rollupNodePolyfills({
sourceMap: sourcemap, sourceMap: sourcemap,
include: "**/*.js", include: "**/*.{js,ts}",
}), }),
], ],
}); });
const outputFile = path.join(src, dest, filename || "index.js"); const outputFile = path.join(src, dest, filename || "index.js");
await bundle.write({ await bundle.write({
file: outputFile, file: outputFile,
format, format,
name, name,
sourcemap: sourcemap, sourcemap: sourcemap,
exports: "named",
}); });
if (!process.env.IS_PUBLISH) { if (!process.env.IS_PUBLISH) {
fancyLog( fancyLog(
chalk.yellow( chalk.yellow(
`Skipped minification of '${chalk.cyan( `Skipped minification of '${chalk.cyan(
outputFile outputFile
)}' because not publishing` )}' because not publishing`
) )
); );
return undefined; return undefined;
} }
fancyLog(`Minifying '${chalk.cyan(outputFile)}'...`); fancyLog(`Minifying '${chalk.cyan(outputFile)}'...`);
await bundle.write({ await bundle.write({
file: outputFile.replace(/\.js$/, ".min.js"), file: outputFile.replace(/\.js$/, ".min.js"),
format, format,
name, name,
sourcemap: sourcemap, sourcemap: sourcemap,
exports: "named",
plugins: [ plugins: [
rollupTerser({ rollupTerser({
// workaround https://bugs.webkit.org/show_bug.cgi?id=212725 // workaround https://bugs.webkit.org/show_bug.cgi?id=212725
output: { output: {
ascii_only: true, ascii_only: true,
}, },
}), }),
], ],
}); });
}) })
); );
} }
const libBundles = [ const libBundles = [
{ "packages/babel-parser",
src: "packages/babel-parser", "packages/babel-plugin-proposal-optional-chaining",
format: "cjs", "packages/babel-helper-member-expression-to-functions",
dest: "lib", ].map(src => ({
version: require("./packages/babel-parser/package").version + versionSuffix, src,
}, format: "cjs",
]; dest: "lib",
}));
const standaloneBundle = [ const standaloneBundle = [
{ {
src: "packages/babel-standalone", src: "packages/babel-standalone",
format: "umd", format: "umd",
name: "Babel", name: "Babel",
filename: "babel.js", filename: "babel.js",
dest: "", dest: "",
version: babelVersion, version: babelVersion,
}, },
 End of changes. 11 change blocks. 
11 lines changed or deleted 29 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)