Skip to content

Commit

Permalink
Merge branch 'master' into implement-smart-pipeline-in-parser
Browse files Browse the repository at this point in the history
* master: (222 commits)
  Set correct methods name
  Use toPropertyKey in the "decorate" helper
  Allow function types in type params within arrow return types (babel#8954)
  Fix message when plugin of a wrong type is passed (babel#8950)
  rename colliding let bindings with for loop init (babel#8937)
  edge incomplete support for arrow destructuring (babel babel#8349) (babel#8926)
  fix single-arg async arrows when retainLines=true (babel#8868)
  [flow] Explicit inexact objects with `...` (babel#8884)
  Update preset-env data (babel#8898)
  Treat break inside block inside loop (babel#8914)
  fixed "source map" formatting in comment (babel#8878) [skip ci]
  fix typo in contributing guidelines (babel#8901) [skip ci]
  fix: Expression x === 'y' && '' should not evaluate to undefined. (babel#8880)
  fixed an extra word
  Fixes babel#8865 (babel#8866)
  v7.1.4
  v7.1.3
  Bump Babel deps (babel#8770)
  flow-bin@0.82.0 (babel#8832)
  Insertafter jsx fix (babel#8833)
  ...

# Conflicts:
#	packages/babel-parser/src/tokenizer/index.js
#	packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json
#	packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json
  • Loading branch information
mAAdhaTTah committed Nov 3, 2018
2 parents 122906d + d35563e commit 4521204
Show file tree
Hide file tree
Showing 1,882 changed files with 21,573 additions and 6,447 deletions.
5 changes: 3 additions & 2 deletions .eslintignore
Expand Up @@ -4,8 +4,9 @@
package.json
lerna.json
packages/babel-runtime
!packages/babel-runtime/scripts
!packages/babel-runtime/core-js.js
!packages/babel-plugin-transform-runtime/scripts
!packages/babel-runtime-corejs2/core-js.js
packages/babel-runtime-corejs2
packages/*/node_modules
packages/*/lib
packages/*/dist
Expand Down
10 changes: 4 additions & 6 deletions .eslintrc.json
@@ -1,11 +1,9 @@
{
"root": true,
"extends": "babel",
"plugins": ["prettier"],
"plugins": ["local-rules", "prettier"],
"rules": {
"curly": ["error", "multi-line"],
"prettier/prettier": "error",
"no-case-declarations": "error"
"prettier/prettier": "error"
},
"env": {
"node": true
Expand All @@ -14,8 +12,8 @@
{
"files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"],
"rules": {
"no-undefined-identifier": "error",
"no-deprecated-clone": "error"
"local-rules/no-undefined-identifier": "error",
"local-rules/no-deprecated-clone": "error"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions .flowconfig
Expand Up @@ -5,6 +5,7 @@
.*/codemods/.*/lib
.*/codemods/.*/test
.*/node_modules/conventional-changelog-core/
.*/node_modules/module-deps/

[include]
packages/*/src
Expand Down
34 changes: 20 additions & 14 deletions .gitignore
@@ -1,6 +1,9 @@
.DS_Store
/node_modules
/packages/*/node_modules
/packages/*/LICENSE
!/packages/babel-parser/LICENSE
!/packages/babel-plugin-transform-object-assign/LICENSE
*.log
*.cache
/build
Expand All @@ -12,24 +15,27 @@ coverage
dist
/.package.json
package-lock.json
/packages/babel-runtime/core-js/**/*.js
!/packages/babel-runtime/core-js/map.js

/packages/babel-runtime/helpers/*.js
!/packages/babel-runtime/helpers/toArray.js
!/packages/babel-runtime/helpers/iterableToArray.js
!/packages/babel-runtime/helpers/temporalRef.js
/packages/babel-runtime/helpers/builtin/*.js
!/packages/babel-runtime/helpers/builtin/toArray.js
!/packages/babel-runtime/helpers/builtin/iterableToArray.js
!/packages/babel-runtime/helpers/builtin/temporalRef.js
/packages/babel-runtime/helpers/builtin/es6/*.js
!/packages/babel-runtime/helpers/builtin/es6/toArray.js
!/packages/babel-runtime/helpers/builtin/es6/iterableToArray.js
!/packages/babel-runtime/helpers/builtin/es6/temporalRef.js
/packages/babel-runtime/helpers/es6/*.js
!/packages/babel-runtime/helpers/es6/toArray.js
!/packages/babel-runtime/helpers/es6/iterableToArray.js
!/packages/babel-runtime/helpers/es6/temporalRef.js
/packages/babel-runtime/helpers/esm/*.js
!/packages/babel-runtime/helpers/esm/toArray.js
!/packages/babel-runtime/helpers/esm/iterableToArray.js
!/packages/babel-runtime/helpers/esm/temporalRef.js

/packages/babel-runtime-corejs2/helpers/*.js
!/packages/babel-runtime-corejs2/helpers/toArray.js
!/packages/babel-runtime-corejs2/helpers/iterableToArray.js
!/packages/babel-runtime-corejs2/helpers/temporalRef.js
/packages/babel-runtime-corejs2/helpers/esm/*.js
!/packages/babel-runtime-corejs2/helpers/esm/toArray.js
!/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js
!/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js
/packages/babel-runtime-corejs2/core-js/**/*.js
!/packages/babel-runtime-corejs2/core-js/map.js

/packages/babel-register/test/.babel
/packages/babel-cli/test/tmp
/packages/babel-node/test/tmp
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Expand Up @@ -7,7 +7,6 @@
"bracketSpacing": true,
"jsxBracketSameLine": false,
"tabWidth": 2,
"parser": "babylon",
"printWidth": 80,
"overrides": [{
"files": [
Expand All @@ -16,6 +15,7 @@
"**/packages/*/src/**/*.js",
"**/packages/*/test/**/*.js"
],
"parser": "babylon",
"options": {
"trailingComma": "all"
}
Expand Down
345 changes: 344 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Expand Up @@ -3,7 +3,7 @@
## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
Expand Down Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting hzoo, thejameskyle, sebastian, or loganfsmyth on [Slack](https://slack.babeljs.io/). All
reported by contacting Henry Zhu <hi@henryzoo.com>, Logan Smyth <loganfsmyth@gmail.com> or one of the other [Babel core team members](https://babeljs.io/team). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -24,7 +24,7 @@ contributing, please read the
## Not sure where to start?

- If you aren't just making a documentation change, you'll probably want to learn a bit about a few topics.
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://github.com/babel/babel/tree/master/packages/babel-parser#output).
- [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://babeljs.io/docs/en/next/babel-parser.html#output).
- Check out [`/doc`](https://github.com/babel/babel/tree/master/doc) for information about Babel's internals
- Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook) - core plugins are written the same way as any other plugin!
- Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs or make your own plugin in the browser
Expand Down Expand Up @@ -186,7 +186,7 @@ For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https:/
- If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
- The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.

In a fixture test, you simply write out the code you want transformed in `input.js`.
In a fixture test, you simply write out the code you want to transform in `input.js`.

```js
// input.js
Expand Down Expand Up @@ -230,7 +230,7 @@ If the test requires a minimum Node version, you can add `minNodeVersion` (must

Writing tests for the babel parser is very
similar to the other packages.
Inside the `packages/babel-parser/tests/fixtures` folder are categories/groupings of test fixtures (es2015, flow,
Inside the `packages/babel-parser/test/fixtures` folder are categories/groupings of test fixtures (es2015, flow,
etc.). To add a test, create a folder under one of these groupings (or create a new one) with a
descriptive name, and add the following:

Expand Down Expand Up @@ -310,7 +310,7 @@ Note that the code shown in Chrome DevTools is compiled code and therefore diffe
- Create a new issue that describes the proposal (ex: [#538](https://github.com/babel/babylon/issues/538)). Include any relevant information like proposal repo/author, examples, parsing approaches, meeting notes, presentation slides, and more.
- The pull request should include:
- [ ] An update to the [plugins](https://github.com/babel/babel/tree/master/packages/babel-parser#plugins) part of the readme. Add a new entry to that list for the new plugin flag (and link to the proposal)
- [ ] If any new nodes or modifications need to be added to the AST, update [ast/spec.md](https://github.com/babel/babel/bloc/master/packages/babel-parser/ast/spec.md)
- [ ] If any new nodes or modifications need to be added to the AST, update [ast/spec.md](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md)
- [ ] Make sure you use the `this.hasPlugin("plugin-name-here")` check in the babel parser so that your new plugin code only runs when that flag is turned on (not default behavior)
- [ ] Add failing/passing tests according to spec behavior
- Start working about the Babel transform itself!
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2014-2018 Sebastian McKenzie <sebmck@gmail.com>
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
36 changes: 24 additions & 12 deletions Makefile
@@ -1,6 +1,6 @@
MAKEFLAGS = -j1
FLOW_COMMIT = 395e045c18d537fcbbc552a96ef2cdcd70b4ab52
TEST262_COMMIT = f90a52b39609a620c0854e0bd0b3a906c930fd17
FLOW_COMMIT = bea8b83f50f597454941d2a7ecef6e93a881e576
TEST262_COMMIT = 06c2f019019cf7850923de4d56828e6dfd9212b8

# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
Expand Down Expand Up @@ -31,7 +31,7 @@ build-preset-env-standalone:
build-dist: build
cd packages/babel-polyfill; \
scripts/build-dist.sh
cd packages/babel-runtime; \
cd packages/babel-plugin-transform-runtime; \
node scripts/build-dist.js

watch: clean clean-lib
Expand All @@ -47,10 +47,13 @@ flow:
./node_modules/.bin/flow check --strip-root

lint:
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --rulesdir="./scripts/eslint_rules"
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe

fix:
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --fix --rulesdir="./scripts/eslint_rules"
fix: fix-json
./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --fix

fix-json:
./node_modules/.bin/prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn

clean: test-clean
rm -rf packages/babel-polyfill/browser*
Expand Down Expand Up @@ -104,23 +107,32 @@ test-test262-ci: bootstrap test-test262
test-test262-update-whitelist:
node scripts/tests/test262/run_babel_parser_test262.js --update-whitelist

publish:
git pull --rebase
clone-license:
./scripts/clone-license.sh

prepublish-build:
make clean-lib
rm -rf packages/babel-runtime/helpers
rm -rf packages/babel-runtime/core-js
rm -rf packages/babel-runtime-corejs2/helpers
rm -rf packages/babel-runtime-corejs2/core-js
BABEL_ENV=production make build-dist
make clone-license

prepublish:
git pull --rebase
make prepublish-build
make test
# not using lerna independent mode atm, so only update packages that have changed since we use ^

publish: prepublish
# --only-explicit-updates
./node_modules/.bin/lerna publish --force-publish=* --exact --skip-temp-tag
./node_modules/.bin/lerna publish
make clean

bootstrap: clean-all
yarn --ignore-engines
./node_modules/.bin/lerna bootstrap -- --ignore-engines
make build
cd packages/babel-runtime; \
cd packages/babel-plugin-transform-runtime; \
node scripts/build-dist.js

clean-lib:
Expand Down
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -24,7 +24,7 @@
<a href="https://medium.com/friendship-dot-js/i-peeked-into-my-node-modules-directory-and-you-wont-believe-what-happened-next-b89f63d21558"><img alt="Business Strategy Status" src="https://img.shields.io/badge/business%20model-flavortown-green.svg"></a>
</p>

Babel is a community-driven project used by many companies and projects, and is maintained by a group of [volunteers](https://babeljs.io/team). If you'd like to help support the future of the project, please consider:
Babel (pronounced ["babble"](https://soundcloud.com/sebmck/how-to-pronounce-babel)) is a community-driven project used by many companies and projects, and is maintained by a group of [volunteers](https://babeljs.io/team). If you'd like to help support the future of the project, please consider:

- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance!)
- Giving funds by becoming a sponsor (see below)!
Expand Down Expand Up @@ -68,6 +68,10 @@ Become a sponsor and get your logo on our README on Github with a link to your s

Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://www.patreon.com/henryzhu)]

## Silver

<a href="https://issue.sh/?utm_medium=github&utm_campaign=babel" target="_blank"><img src="https://user-images.githubusercontent.com/5557143/43912065-c8cdff78-9c33-11e8-829a-0b4166ccc215.png"></a>

## Bronze

<a href="http://teamextension.io/" target="_blank"><img src="https://teamextension.io/dist/img/logo/te-logo-compact.png" height="64"></a>
Expand Down Expand Up @@ -103,11 +107,11 @@ Mostly a handful of volunteers! Please check out our [team page](https://babeljs

### Looking for support?

For questions and support please visit join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).
For questions and support please join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs).

### Is there a Babel song?

I'm so glad you asked: [Hallelujah —— In Praise of Babel](SONG.md) by [@angus-c](https://github.com/angus-c). Tweet us your recordings!
I'm so glad you asked: [Hallelujah —— In Praise of Babel](SONG.md) by [@angus-c](https://github.com/angus-c), [audio version](https://youtu.be/40abpedBKK8) by [@swyx](https://twitter.com/@swyx). Tweet us your recordings!

### Where are the docs?

Expand Down
2 changes: 2 additions & 0 deletions SONG.md
@@ -1,5 +1,7 @@
## Hallelujah—In Praise of Babel

[🎶 Audio version here!](https://youtu.be/40abpedBKK8)

I heard there was a clever trick
That rewrote all your JavaScript
But you don’t really care for magic, do you
Expand Down
33 changes: 32 additions & 1 deletion babel.config.js
Expand Up @@ -13,13 +13,18 @@ module.exports = function(api) {

let convertESM = true;
let ignoreLib = true;
let includeRuntime = false;

switch (env) {
// Configs used during bundling builds.
case "babel-parser":
convertESM = false;
ignoreLib = false;
break;
case "standalone":
convertESM = false;
ignoreLib = false;
includeRuntime = true;
break;
case "production":
// Config during builds before publish.
Expand All @@ -41,6 +46,10 @@ module.exports = function(api) {
}

const config = {
// Our dependencies are all standard CommonJS, along with all sorts of
// other random files in Babel's codebase, so we use script as the default,
// and then mark actual modules as modules farther down.
sourceType: "script",
comments: false,
ignore: [
// These may not be strictly necessary with the newly-limited scope of
Expand Down Expand Up @@ -84,7 +93,29 @@ module.exports = function(api) {
convertESM ? "@babel/transform-modules-commonjs" : null,
].filter(Boolean),
},
],
{
// The vast majority of our src files are modules, but we use
// unambiguous to keep things simple until we get around to renaming
// the modules to be more easily distinguished from CommonJS
test: [
"packages/*/src",
"packages/*/test",
"codemods/*/src",
"codemods/*/test",
],
sourceType: "unambiguous",
},
{
// The runtime transform shouldn't process its own runtime or core-js.
exclude: [
"packages/babel-runtime",
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
],
plugins: [includeRuntime ? "@babel/transform-runtime" : null].filter(
Boolean
),
},
].filter(Boolean),
};

// we need to do this as long as we do not test everything from source
Expand Down
Expand Up @@ -36,7 +36,7 @@ npm install --save-dev @babel/plugin-codemod-object-assign-to-object-spread

**.babelrc**

```json
```jsonc
{
"plugins": ["@babel/plugin-codemod-object-assign-to-object-spread"]
}
Expand Down
@@ -1,23 +1,26 @@
{
"name": "@babel/plugin-codemod-object-assign-to-object-spread",
"version": "7.0.0-beta.52",
"version": "7.0.0",
"description": "Transforms Object.assign into object spread syntax",
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "lib/index.js",
"keywords": [
"@babel/codemod",
"@babel/plugin"
],
"dependencies": {
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.52"
"@babel/plugin-syntax-object-rest-spread": "^7.0.0"
},
"peerDependencies": {
"@babel/core": ">=7.0.0-beta.50 <7.0.0-rc.0"
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "7.0.0-beta.52",
"@babel/helper-plugin-test-runner": "7.0.0-beta.52"
"@babel/core": "^7.0.0",
"@babel/helper-plugin-test-runner": "^7.0.0"
},
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit 4521204

Please sign in to comment.