forked from babel/babel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/valtech-nyc/babel into fe…
…ature/pipe-await * 'master' of https://github.com/valtech-nyc/babel: (131 commits) v7.0.0-beta.42 Use strict namespace behavior for mjs files. (babel#7545) Remove outdated spec deviation note [skip ci] (babel#7571) Ensure that the backward-compat logic for plugin-utils copies over the version API properly. (babel#7580) Rename actual/expected test files to input/output (babel#7578) Use helper-module-import inside entry plugin too Use helper-module-imports instead of custom import (babel#7457) Fix "Module build failed: Error: Cannot find module '@babel/types'" (babel#7575) Wrap wrapNativeSuper helpers in redefining functions for better tree-shakeability (babel#7188) Favour extends helper over objectWithoutProperties when whole object gets copied anyway (babel#7390) Fix incorrect value of _cache in _wrapNativeSuper (babel#7570) [transform-classes] Fix typo in _wrapNativeSuper helper [typeof-symbol] Guard against undefined built-in globals update to beta.41 (babel#7568) v7.0.0-beta.41 Fix import of type ConfigItem (babel#7561) Run node 9 on circleci and remove from travis (babel#7560) docs: [skip ci] fix proposal link text update preset-env after build-data (babel#7543) Re-add TEST_ONLY and use Jest's -t for TEST_GREP. (babel#7556) ...
- Loading branch information
Showing
1,397 changed files
with
13,987 additions
and
6,297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,48 @@ | ||
"use strict"; | ||
|
||
// Thanks Logan for this. | ||
// This works around https://github.com/istanbuljs/istanbuljs/issues/92 until | ||
// we have a version of Istanbul that actually works with 7.x. | ||
function istanbulHacks() { | ||
return { | ||
inherits: require("babel-plugin-istanbul").default, | ||
visitor: { | ||
Program: { | ||
exit: function(path) { | ||
if (!this.__dv__) return | ||
|
||
const node = path.node.body[0]; | ||
if ( | ||
node.type !== "VariableDeclaration" || | ||
node.declarations[0].id.type !== "Identifier" || | ||
!node.declarations[0].id.name.match(/cov_/) || | ||
node._blockHoist !== 3 | ||
) { | ||
throw new Error("Something has gone wrong in Logan's hacks."); | ||
} | ||
|
||
// Gross hacks to put the code coverage block above all compiled | ||
// import statement output. | ||
node._blockHoist = 5; | ||
}, | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
let envOpts = { | ||
const env = process.env.BABEL_ENV || process.env.NODE_ENV; | ||
const envOpts = { | ||
loose: true, | ||
}; | ||
|
||
switch (env) { | ||
case "development": | ||
envOpts.debug = true; | ||
// fall-through | ||
case "test": | ||
case "cov": | ||
envOpts.targets = { | ||
node: "current", | ||
}; | ||
} | ||
|
||
const config = { | ||
comments: false, | ||
presets: [ | ||
["@babel/env", envOpts], | ||
], | ||
presets: [["@babel/env", envOpts]], | ||
plugins: [ | ||
// TODO: Use @babel/preset-flow when | ||
// TODO: Use @babel/preset-flow when | ||
// https://github.com/babel/babel/issues/7233 is fixed | ||
"@babel/plugin-transform-flow-strip-types", | ||
["@babel/proposal-class-properties", { loose: true }], | ||
"@babel/proposal-export-namespace-from", | ||
"@babel/proposal-numeric-separator", | ||
["@babel/proposal-object-rest-spread", { useBuiltIns: true }], | ||
], | ||
overrides: [{ | ||
test: "packages/babylon", | ||
plugins: [ | ||
"babel-plugin-transform-charcodes", | ||
["@babel/transform-for-of", { assumeArray: true }], | ||
], | ||
}], | ||
overrides: [ | ||
{ | ||
test: "packages/babylon", | ||
plugins: [ | ||
"babel-plugin-transform-charcodes", | ||
["@babel/transform-for-of", { assumeArray: true }], | ||
], | ||
}, | ||
], | ||
}; | ||
|
||
if (process.env.BABEL_ENV === "cov") { | ||
// we need to do this as long as we do not test everything from source | ||
if (env === "cov") { | ||
config.auxiliaryCommentBefore = "istanbul ignore next"; | ||
config.plugins.push(istanbulHacks); | ||
} | ||
|
||
if (process.env.BABEL_ENV === "development") { | ||
envOpts.targets = { | ||
node: "current" | ||
}; | ||
envOpts.debug = true; | ||
config.plugins.push("babel-plugin-istanbul"); | ||
} | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
version: 2 | ||
aliases: | ||
- &restore-node-modules-cache | ||
keys: | ||
- v1-yarn-deps-{{ checksum "yarn.lock" }} | ||
|
||
- &restore-yarn-cache | ||
keys: | ||
- v1-yarn-cache | ||
|
||
- &save-node-modules-cache | ||
paths: | ||
- node_modules | ||
key: v1-yarn-deps-{{ checksum "yarn.lock" }} | ||
|
||
- &save-yarn-cache | ||
paths: | ||
- ~/.yarn-cache | ||
key: v1-yarn-cache | ||
|
||
- &yarn-install | ||
run: | | ||
sudo npm i -g yarn@^1.5.1 | ||
yarn --version | ||
- &artifact_babel | ||
path: ~/babel/packages/babel-standalone/babel.js | ||
|
||
- &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 | ||
|
||
jobs: | ||
build: | ||
working_directory: ~/babel | ||
docker: | ||
- image: circleci/node:9 | ||
steps: | ||
- checkout | ||
- restore-cache: *restore-yarn-cache | ||
- restore-cache: *restore-node-modules-cache | ||
- *yarn-install | ||
- run: make test-ci-coverage | ||
# Builds babel-standalone with the regular Babel config | ||
- run: 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. | ||
- run: ./node_modules/.bin/jest packages/babel-standalone/test/ | ||
- run: ./node_modules/.bin/jest packages/babel-preset-env-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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.