Skip to content
Permalink
Browse files

Archive @babel/preset-env-standalone (#10993)

* Move @babel/preset-env-standalone to babel-archive

babel/babel-archive@a1fadd2

* Move tests to @babel/standalone

* Remove references in build scripts

* Update lockfile

* Delete duplicated test file.

It's already in babel-standalone/test/babel.js
  • Loading branch information
nicolo-ribaudo committed Feb 6, 2020
1 parent 7615635 commit 755ec192e22c6b6e00782e4810366d0166fdbebd
@@ -25,12 +25,6 @@ aliases:
- &artifact_babel_min
path: ~/babel/packages/babel-standalone/babel.min.js

- &artifact_env
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.js

- &artifact_env_min
path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js

- &test262_workdir
working_directory: ~/babel/babel-test262-runner

@@ -69,8 +63,6 @@ jobs:
- run: yarn jest "\-standalone/test"
- store_artifacts: *artifact_babel
- store_artifacts: *artifact_babel_min
- store_artifacts: *artifact_env
- store_artifacts: *artifact_env_min
- save_cache: *save-node-modules-cache
- save_cache: *save-yarn-cache

@@ -20,8 +20,6 @@ codemods/*/test/tmp
packages/babel-compat-data/build
packages/babel-preset-env/data/[^(plugin-features|shipped-proposals).js]
packages/babel-preset-env/test/debug-fixtures
packages/babel-preset-env-standalone/babel-preset-env.js
packages/babel-preset-env-standalone/babel-preset-env.min.js
packages/babel-standalone/babel.js
packages/babel-standalone/babel.min.js
packages/babel-parser/test/expressions
@@ -56,9 +56,6 @@ package-lock.json
packages/babel-standalone/babel.js
packages/babel-standalone/babel.js.map
packages/babel-standalone/babel.min.js
packages/babel-preset-env-standalone/babel-preset-env.js
packages/babel-preset-env-standalone/babel-preset-env.js.map
packages/babel-preset-env-standalone/babel-preset-env.min.js
/codemods/*/lib
/codemods/*/node_modules
/packages/babel-parser/build
@@ -11,7 +11,6 @@ const filter = require("gulp-filter");
const gulp = require("gulp");
const path = require("path");
const rollup = require("rollup");
const rollupAlias = require("@rollup/plugin-alias");
const rollupBabel = require("rollup-plugin-babel");
const rollupBabelSource = require("./scripts/rollup-plugin-babel-source");
const rollupCommonJs = require("rollup-plugin-commonjs");
@@ -88,9 +87,7 @@ function buildRollup(packages) {
packages.map(
({ src, format, dest, name, filename, version = babelVersion }) => {
const extraPlugins = [];
let inputExternal = undefined,
outputGlobals = undefined,
nodeResolveBrowser = false,
let nodeResolveBrowser = false,
babelEnvName = "rollup";
switch (src) {
case "packages/babel-standalone":
@@ -104,39 +101,6 @@ function buildRollup(packages) {
);
}
break;
case "packages/babel-preset-env-standalone":
nodeResolveBrowser = true;
babelEnvName = "standalone";
if (minify) {
extraPlugins.push(
rollupTerser({
include: /^.+\.min\.js$/,
})
);
}
inputExternal = ["@babel/standalone"];
outputGlobals = {
"@babel/standalone": "Babel",
};
extraPlugins.push(
rollupAlias({
entries: [
{
find: "./available-plugins",
replacement: require.resolve(
path.join(__dirname, src, "./src/available-plugins")
),
},
{
find: "caniuse-lite/data/regions",
replacement: require.resolve(
path.join(__dirname, src, "./src/caniuse-lite-regions")
),
},
],
})
);
break;
}
// If this build is part of a pull request, include the pull request number in
// the version number.
@@ -150,7 +114,6 @@ function buildRollup(packages) {
return rollup
.rollup({
input,
external: inputExternal,
plugins: [
...extraPlugins,
rollupBabelSource(),
@@ -208,7 +171,6 @@ function buildRollup(packages) {
file: outputFile,
format,
name,
globals: outputGlobals,
sourcemap: sourcemap,
})
.then(() => {
@@ -232,7 +194,6 @@ function buildRollup(packages) {
file: outputFile.replace(/\.js$/, ".min.js"),
format,
name,
globals: outputGlobals,
sourcemap: sourcemap,
});
});
@@ -262,24 +223,9 @@ const standaloneBundle = [
},
];

const presetEnvStandaloneBundle = [
{
src: "packages/babel-preset-env-standalone",
format: "umd",
name: "BabelPresetEnv",
filename: "babel-preset-env.js",
dest: "",
version: require("./packages/babel-preset-env/package").version,
},
];

gulp.task("build-rollup", () => buildRollup(libBundles));
gulp.task("build-babel-standalone", () => buildRollup(standaloneBundle));

gulp.task("build-babel-preset-env-standalone", () =>
buildRollup(presetEnvStandaloneBundle)
);

gulp.task("build-babel", () => buildBabel(/* exclude */ libBundles));
gulp.task("build-babel-types", () =>
buildBabel(/* exclude */ libBundles, "packages/babel-types/src/**/*.js")
@@ -2,7 +2,7 @@ FLOW_COMMIT = a1f9a4c709dcebb27a5084acf47755fbae699c25
TEST262_COMMIT = 28b4fcca4b1b1d278dfe0cc0e69c7d9d59b31aab
TYPESCRIPT_COMMIT = 5fc917be2e4dd64c8e9504d36615cd7fbfdd4cd3

FORCE_PUBLISH = "@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone"
FORCE_PUBLISH = "@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone"

# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
@@ -50,23 +50,17 @@ build-flow-typings:
build-typescript-typings:
$(NODE) packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts

build-standalone: build-babel-standalone build-preset-env-standalone
build-standalone: build-babel-standalone

build-standalone-ci: build-bundle-ci
$(MAKE) build-standalone

build-babel-standalone:
$(YARN) gulp build-babel-standalone

build-preset-env-standalone:
$(YARN) gulp build-babel-preset-env-standalone

prepublish-build-standalone:
BABEL_ENV=production IS_PUBLISH=true $(YARN) gulp build-babel-standalone

prepublish-build-preset-env-standalone:
BABEL_ENV=production IS_PUBLISH=true $(YARN) gulp build-babel-preset-env-standalone

build-dist: build-polyfill-dist build-plugin-transform-runtime-dist

build-polyfill-dist:
@@ -89,7 +89,6 @@ module.exports = function(api) {
"packages/*/test/fixtures",
ignoreLib ? "packages/*/lib" : null,
"packages/babel-standalone/babel.js",
"packages/babel-preset-env-standalone/babel-preset-env.js",
].filter(Boolean),
presets: [["@babel/env", envOpts]],
plugins: [
@@ -45,14 +45,12 @@ module.exports = {
transformIgnorePatterns: [
"/node_modules/",
"<rootDir>/packages/babel-standalone/babel(\\.min)?\\.js",
"<rootDir>/packages/babel-preset-env-standalone/babel-preset-env(\\.min)?\\.js",
"/test/(fixtures|tmp|__data__)/",
"<rootDir>/(packages|codemods|eslint)/[^/]+/lib/",
],
coveragePathIgnorePatterns: [
"/node_modules/",
"<rootDir>/packages/babel-standalone/babel(\\.min)?\\.js",
"<rootDir>/packages/babel-preset-env-standalone/babel-preset-env(\\.min)?\\.js",
"/test/(fixtures|tmp|__data__)/",
],
modulePathIgnorePatterns: [
@@ -27,7 +27,6 @@
"@babel/preset-flow": "^7.8.3",
"@babel/register": "^7.8.3",
"@babel/runtime": "^7.8.4",
"@rollup/plugin-alias": "^2.2.0",
"@rollup/plugin-json": "^4.0.0",
"babel-eslint": "^11.0.0-beta.2",
"babel-jest": "^24.9.0",

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 755ec19

Please sign in to comment.
You can’t perform that action at this time.