Skip to content

Commit

Permalink
Merge branch 'master' into implement-f#-pipeline-in-parser
Browse files Browse the repository at this point in the history
* master: (58 commits)
  Remove dependency on home-or-tmp package (babel#9678)
  [proposal-object-rest-spread] fix templateLiteral in extractNormalizedKeys (babel#9628)
  Partial application plugin (babel#9474)
  Private Static Class Methods (Stage 3) (babel#9446)
  gulp-uglify@3.0.2
  rollup@1.6.0
  eslint@5.15.1
  jest@24.5.0
  regexpu-core@4.5.4
  Remove input and length from state (babel#9646)
  Switch from rollup-stream to rollup and update deps (babel#9640)
  System modules - Hoist classes like other variables (babel#9639)
  fix: Don't transpile ES2018 symbol properties (babel#9650)
  Add WarningsToErrorsPlugin to webpack to avoid missing build problems on CI (babel#9647)
  Update regexpu-core dependency (babel#9642)
  Add placeholders support to @babel/types and @babel/generator (babel#9542)
  Generate plugins file
  Make babel-standalone an ESModule and enable flow (babel#9025)
  Reorganize token types and use a map for them (babel#9645)
  [TS] Allow context type annotation on getters/setters (babel#9641)
  ...
  • Loading branch information
mAAdhaTTah committed Mar 15, 2019
2 parents 713d170 + 0a69b45 commit 7458063
Show file tree
Hide file tree
Showing 907 changed files with 23,760 additions and 4,263 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- run: yarn --version
- run: make test-ci-coverage
# Builds babel-standalone with the regular Babel config
- run: make build
- run: IS_PUBLISH=true make build
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ end_of_line = lf
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab

[*.{md,markdown}]
trim_trailing_whitespace = false
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"rules": {
"@babel/development/no-undefined-identifier": "error",
"@babel/development/no-deprecated-clone": "error",
"import/no-extraneous-dependencies": "error"
"import/no-extraneous-dependencies": "error",
"guard-for-in": "error"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions .github/actions/trigger-github-release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ADD entrypoint.sh /action/entrypoint.sh
ADD package.json /action/package.json
ADD package-lock.json /action/package-lock.json
ADD release.js /action/release.js
ADD update-changelog.js /action/update-changelog.js

RUN chmod +x /action/entrypoint.sh

Expand Down
20 changes: 14 additions & 6 deletions .github/actions/trigger-github-release/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ set -e
echo "INFO: Installing action dependencies..."
(cd /action; npm ci)

echo "INFO: Checking out current commit..."
git -c advice.detachedHead=false checkout $GITHUB_SHA

# GitHub doesn't support running actions on new tags yet: we need to run it on the commit.
# For this reason, we can't be sure that the tag already exists. We can use the commit
# message to create the tag. If the tag already exists locally, they won't conflict because
# they have the same name and are on the same commit.
echo "INFO: Getting release version..."
# current_tag=$(git describe --abbrev=0 --tags HEAD)
current_tag=$(git log --oneline --format=%B -1 HEAD)
# current_tag=$(git describe --abbrev=0 --tags $GITHUB_SHA)
current_tag=$(git log --oneline --format=%B -1 $GITHUB_SHA)

echo "INFO: Creating new tag..."
(git tag $current_tag $GITHUB_SHA) || echo "INFO: Tag already exists"

last_tag=$(git describe --abbrev=0 --tags HEAD^)
last_tag=$(git describe --abbrev=0 --tags $current_tag^)
echo "INFO: New version is $current_tag; last version is $last_tag."

echo "INFO: Generating the changelog..."
Expand All @@ -35,4 +32,15 @@ changelog=$(
echo "INFO: Publishing the new GitHub release..."
echo "$changelog" | node /action/release $current_tag

echo "INFO: Updating CHANGELOG.md..."
echo "$changelog" | node /action/update-changelog

echo "INFO: Committing changelog..."
git add CHANGELOG.md
git -c user.name="$COMMIT_AUTHOR_NAME" -c user.email="$COMMIT_AUTHOR_EMAIL" \
commit -m "Add $current_tag to CHANGELOG.md [skip ci]" --no-verify --quiet

echo "INFO: Pushing updates..."
git push "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" master

echo "INFO: Done! Don't forget to thank new contributors :)"
31 changes: 31 additions & 0 deletions .github/actions/trigger-github-release/update-changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use strict";

const getStdin = require("get-stdin");
const fs = require("fs").promises;
const path = require("path");

const { GITHUB_WORKSPACE } = process.env;

const INSERTION_POINT = "<!-- insert-new-changelog-here -->";
const CHANGELOG = path.resolve(GITHUB_WORKSPACE, "CHANGELOG.md");

main();
async function main() {
let [stdin, changelog] = await Promise.all([
getStdin(),
fs.readFile(CHANGELOG, "utf8"),
]);

if (!changelog.includes(INSERTION_POINT)) {
throw new Error(`Missing "${INSERTION_POINT}" in CHANGELOG.md`);
}

// Remove committers
stdin = stdin.split("\n\n#### Committers")[0];
changelog = changelog.replace(
INSERTION_POINT,
INSERTION_POINT + "\n" + stdin
);

await fs.writeFile(CHANGELOG, changelog);
}
5 changes: 5 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ action "Trigger GitHub release" {
uses = "./.github/actions/trigger-github-release/"
secrets = ["GITHUB_TOKEN"]

env = {
COMMIT_AUTHOR_NAME = "Babel Bot"
COMMIT_AUTHOR_EMAIL = "babel@hopeinsource.com"
}

# When GitHub Actions will support the "release" event for public
# repositories, we won't need these checks anymore.
needs = [
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,37 @@ See [CHANGELOG - v4](/.github/CHANGELOG-v4.md), [CHANGELOG - v5](/.github/CHANGE
See [CHANGELOG - 6to5](/.github/CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0.0-beta.29 version changelog.

<!-- DO NOT CHANGE THESE COMMENTS - See .github/actions/trigger-github-release/update-changelog.js -->
<!-- insert-new-changelog-here -->

## v7.3.4 (2019-02-25)

#### :bug: Bug Fix
* `babel-parser`
* [#9572](https://github.com/babel/babel/pull/9572) Fix TypeScript parsers missing token check (#9571) ([@elevatebart](https://github.com/elevatebart))
* [#9521](https://github.com/babel/babel/pull/9521) Also check AssignmentPatterns for duplicate export name ([@danez](https://github.com/danez))
* `babel-helper-create-class-features-plugin`, `babel-helper-replace-supers`, `babel-plugin-proposal-class-properties`, `babel-traverse`
* [#9508](https://github.com/babel/babel/pull/9508) Use correct "this" in static fields ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-preset-env`
* [#9566](https://github.com/babel/babel/pull/9566) Closes [#9465](https://github.com/babel/babel/issues/9465) ([@zloirock](https://github.com/zloirock))
* `babel-types`
* [#9539](https://github.com/babel/babel/pull/9539) babel-types is* type checks accept null | undefiend as value TS type ([@ian-craig](https://github.com/ian-craig))
* `babel-plugin-transform-block-scoping`, `babel-traverse`
* [#9532](https://github.com/babel/babel/pull/9532) Migrate some duplicate binding tests to traverse ([@danez](https://github.com/danez))
* `babel-generator`
* [#9524](https://github.com/babel/babel/pull/9524) Fix typescript generator params ([@tanhauhau](https://github.com/tanhauhau))
* [#9523](https://github.com/babel/babel/pull/9523) Fix flow babel-generator function parantheses ([@tanhauhau](https://github.com/tanhauhau))

#### :house: Internal
* Other
* [#9561](https://github.com/babel/babel/pull/9561) Update CHANGELOG.md using the "Trigger GitHub release" action ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-modules-systemjs`
* [#9541](https://github.com/babel/babel/pull/9541) Enable eqeqeq rule in eslint ([@danez](https://github.com/danez))
* `babel-generator`, `babel-parser`, `babel-plugin-transform-flow-strip-types`, `babel-traverse`
* [#9522](https://github.com/babel/babel/pull/9522) Make tests spec compliant by avoiding duplicate declarations in input files ([@danez](https://github.com/danez))
* `babel-plugin-transform-proto-to-assign`
* [#9533](https://github.com/babel/babel/pull/9533) Add import/no-extraneous-dependencies to ESLint ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))

## v7.3.3 (2019-02-15)

#### :eyeglasses: Spec Compliancy
Expand Down
56 changes: 27 additions & 29 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const gulp = require("gulp");
const path = require("path");
const webpack = require("webpack");
const merge = require("merge-stream");
const rollup = require("rollup-stream");
const source = require("vinyl-source-stream");
const buffer = require("vinyl-buffer");
const rollup = require("rollup");
const rollupBabel = require("rollup-plugin-babel");
const rollupNodeResolve = require("rollup-plugin-node-resolve");
const { registerStandalonePackageTask } = require("./scripts/gulp-tasks");
Expand All @@ -35,13 +33,9 @@ function getIndexFromPackage(name) {
return `${name}/src/index.js`;
}

function compilationLogger(rollup) {
function compilationLogger() {
return through.obj(function(file, enc, callback) {
fancyLog(
`Compiling '${chalk.cyan(file.relative)}'${
rollup ? " with rollup " : ""
}...`
);
fancyLog(`Compiling '${chalk.cyan(file.relative)}'...`);
callback(null, file);
});
}
Expand Down Expand Up @@ -90,32 +84,36 @@ function buildBabel(exclude) {
}

function buildRollup(packages) {
return merge(
return Promise.all(
packages.map(pkg => {
return rollup({
input: getIndexFromPackage(pkg),
format: "cjs",
plugins: [
rollupBabel({
envName: "babel-parser",
}),
rollupNodeResolve(),
],
})
.pipe(source("index.js"))
.pipe(buffer())
.pipe(errorsLogger())
.pipe(compilationLogger(/* rollup */ true))
.pipe(gulp.dest(path.join(pkg, "lib")));
const input = getIndexFromPackage(pkg);
fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`);
return rollup
.rollup({
input,
plugins: [
rollupBabel({
envName: "babel-parser",
}),
rollupNodeResolve(),
],
})
.then(bundle => {
return bundle.write({
file: path.join(pkg, "lib/index.js"),
format: "cjs",
name: "babel-parser",
});
});
})
);
}

gulp.task("build", function() {
const bundles = ["packages/babel-parser"];
const bundles = ["packages/babel-parser"];

return merge([buildBabel(/* exclude */ bundles), buildRollup(bundles)]);
});
gulp.task("build-rollup", () => buildRollup(bundles));
gulp.task("build-babel", () => buildBabel(/* exclude */ bundles));
gulp.task("build", gulp.parallel("build-rollup", "build-babel"));

gulp.task("default", gulp.series("build"));

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MAKEFLAGS = -j1
FLOW_COMMIT = 2ac56861e3ceff9ca406ae586fbafb3480c6c0b7
TEST262_COMMIT = 4f1155c566a222238fd86f179c6635ecb4c289bb
TEST262_COMMIT = b4e15b3d5cf63571151dbd02c0987864544c6a56

# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
Expand All @@ -11,6 +11,7 @@ SOURCES = packages codemods

build: clean clean-lib
./node_modules/.bin/gulp build
node ./packages/babel-standalone/scripts/generate.js
node ./packages/babel-types/scripts/generateTypeHelpers.js
# call build again as the generated files might need to be compiled again.
./node_modules/.bin/gulp build
Expand Down Expand Up @@ -103,7 +104,7 @@ test-flow-update-whitelist:
bootstrap-test262:
rm -rf ./build/test262
mkdir -p ./build
git clone --branch=master --single-branch --shallow-since=2010-01-10 https://github.com/tc39/test262.git ./build/test262
git clone --branch=master --single-branch --shallow-since=2019-01-01 https://github.com/tc39/test262.git ./build/test262
cd build/test262 && git checkout $(TEST262_COMMIT)

test-test262:
Expand Down
8 changes: 5 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ module.exports = function(api) {
"packages/babel-runtime",
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
],
plugins: [includeRuntime ? "@babel/transform-runtime" : null].filter(
Boolean
),
plugins: [
includeRuntime
? ["@babel/transform-runtime", { version: "7.3.4" }]
: null,
].filter(Boolean),
},
].filter(Boolean),
};
Expand Down
11 changes: 0 additions & 11 deletions eslint-local-rules.js

This file was deleted.

4 changes: 2 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"version": "7.3.3",
"version": "7.3.4",
"changelog": {
"repo": "babel/babel",
"cacheDir": ".changelog",
"labels": {
"PR: Spec Compliancy :eyeglasses:": ":eyeglasses: Spec Compliancy",
"PR: Spec Compliance :eyeglasses:": ":eyeglasses: Spec Compliance",
"PR: Breaking Change :boom:": ":boom: Breaking Change",
"PR: New Feature :rocket:": ":rocket: New Feature",
"PR: Bug Fix :bug:": ":bug: Bug Fix",
Expand Down
31 changes: 15 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
},
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/core": "^7.3.4",
"@babel/eslint-plugin-development": "^1.0.1",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
"@babel/plugin-transform-modules-commonjs": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/plugin-transform-runtime": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-flow": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.3.1",
"@babel/runtime": "^7.3.4",
"babel-eslint": "^11.0.0-beta.0",
"babel-jest": "^24.0.0",
"babel-jest": "^24.5.0",
"babel-loader": "^8.0.5",
"babel-plugin-transform-charcodes": "^0.2.0",
"browserify": "^16.2.3",
Expand All @@ -32,24 +32,24 @@
"derequire": "^2.0.2",
"duplicate-package-checker-webpack-plugin": "^2.1.0",
"enhanced-resolve": "^3.0.0",
"eslint": "^5.12.1",
"eslint-config-babel": "^8.0.2",
"eslint": "^5.15.1",
"eslint-config-babel": "^9.0.0",
"eslint-plugin-flowtype": "^3.2.1",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-prettier": "^3.0.1",
"fancy-log": "^1.3.3",
"flow-bin": "^0.92.1",
"flow-bin": "^0.94.0",
"graceful-fs": "^4.1.15",
"gulp": "^4.0.0",
"gulp-babel": "^8.0.0",
"gulp-filter": "^5.1.0",
"gulp-newer": "^1.0.0",
"gulp-plumber": "^1.2.1",
"gulp-rename": "^1.4.0",
"gulp-uglify": "^3.0.1",
"gulp-uglify": "^3.0.2",
"gulp-watch": "^5.0.1",
"husky": "^1.3.1",
"jest": "^24.0.0",
"jest": "^24.5.0",
"lerna": "^3.6.0",
"lerna-changelog": "^0.5.0",
"lint-staged": "^8.1.0",
Expand All @@ -59,13 +59,12 @@
"prettier": "^1.16.1",
"pump": "^3.0.0",
"rimraf": "^2.6.3",
"rollup-plugin-babel": "^4.0.0-beta.0",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-stream": "^1.24.1",
"rollup": "^1.6.0",
"rollup-plugin-babel": "^4.0.0",
"rollup-plugin-node-resolve": "^4.0.1",
"test262-stream": "^1.2.0",
"through2": "^2.0.0",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0",
"warnings-to-errors-webpack-plugin": "^2.0.0",
"webpack": "^3.4.1",
"webpack-dependency-suite": "^2.4.4",
"webpack-stream": "^4.0.0"
Expand Down
Loading

0 comments on commit 7458063

Please sign in to comment.