Compare commits
89 Commits
v7.0.0-bet
...
v7.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f03adbadf4 | ||
|
|
97145ad01e | ||
|
|
25810d2609 | ||
|
|
5f58117790 | ||
|
|
dca2631ef0 | ||
|
|
ba11d9fa7c | ||
|
|
e06cf20d2e | ||
|
|
df1afa3160 | ||
|
|
cec93c01ce | ||
|
|
0a8367c979 | ||
|
|
ac5d2ba984 | ||
|
|
040ba2bf53 | ||
|
|
98f0808a22 | ||
|
|
bdcfb697a6 | ||
|
|
0341d299c8 | ||
|
|
1a7765712e | ||
|
|
b87c43d894 | ||
|
|
02c4a28608 | ||
|
|
4260ffd7ec | ||
|
|
25c3f0d689 | ||
|
|
21b03c35d3 | ||
|
|
ee1ee0e7ae | ||
|
|
73f8059ea0 | ||
|
|
70e3454d7a | ||
|
|
9dab691302 | ||
|
|
95fc38cecf | ||
|
|
84e76e2d49 | ||
|
|
0d9eef4750 | ||
|
|
d2ed7bbc8d | ||
|
|
5b5ac1f366 | ||
|
|
fa1547d8f8 | ||
|
|
b42b21f25c | ||
|
|
6dca0ff9bf | ||
|
|
3e9b59c0f1 | ||
|
|
3f6c475aae | ||
|
|
5c31e501d7 | ||
|
|
ed6b4e0e40 | ||
|
|
8615b6fe57 | ||
|
|
95fa5a66b1 | ||
|
|
c94355c1c9 | ||
|
|
839bf68d1f | ||
|
|
8198b1b334 | ||
|
|
d608535719 | ||
|
|
0353ce9ed5 | ||
|
|
65ca968f8b | ||
|
|
77445cb044 | ||
|
|
7c4509e280 | ||
|
|
87ae286bc3 | ||
|
|
9c1b3e8dc1 | ||
|
|
39d07638cf | ||
|
|
e887eecda4 | ||
|
|
a3e622ad15 | ||
|
|
494a56df5f | ||
|
|
8060ae5dae | ||
|
|
bd4ebc11c1 | ||
|
|
80cefaff2f | ||
|
|
e9d5073af1 | ||
|
|
c8fb48ffd6 | ||
|
|
55ef39eb87 | ||
|
|
91e1e1728c | ||
|
|
acf509bab5 | ||
|
|
4f312f5739 | ||
|
|
696f84468e | ||
|
|
71fd37067e | ||
|
|
7142a79eb9 | ||
|
|
1a6855eff2 | ||
|
|
1de36948ac | ||
|
|
b28ffedead | ||
|
|
a5edab7393 | ||
|
|
725e6a01c0 | ||
|
|
224ce38882 | ||
|
|
8c46fd159f | ||
|
|
47201db61e | ||
|
|
138d60922c | ||
|
|
cfb386ff03 | ||
|
|
9e7fe0ab49 | ||
|
|
e31e907d5f | ||
|
|
4da4728bf5 | ||
|
|
0112479ba9 | ||
|
|
408124438a | ||
|
|
eab4c0e93e | ||
|
|
d06bf993db | ||
|
|
1076018c4c | ||
|
|
07ff8f30f5 | ||
|
|
e6ba0ab82c | ||
|
|
2afe9404fe | ||
|
|
037fee8ffb | ||
|
|
3a2aa9b862 | ||
|
|
c8b57f777a |
@@ -1,5 +0,0 @@
|
||||
# Ensure babel-register won't compile fixtures, or try to recompile compiled code.
|
||||
packages/*/test/fixtures
|
||||
packages/*/lib
|
||||
packages/babel-standalone/babel.js
|
||||
packages/babel-preset-env-standalone/babel-preset-env.js
|
||||
59
.github/ISSUE_TEMPLATE.md
vendored
59
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,63 +1,6 @@
|
||||
<!---
|
||||
Thanks for filing an issue 😄 ! Before you submit, please read the following:
|
||||
|
||||
Check the other issue templates if you are trying to submit a bug report, feature request, or question
|
||||
Search open/closed issues before submitting since someone might have asked the same thing before!
|
||||
|
||||
If you have a support request or question please submit them to one of this resources:
|
||||
|
||||
* Slack Community: https://babeljs.slack.com (you can sign-up at https://slack.babeljs.io/ for an invite)
|
||||
* StackOverflow: http://stackoverflow.com/questions/tagged/babeljs using the tag `babeljs`
|
||||
* Also have a look at the readme for more information on how to get support:
|
||||
https://github.com/babel/babel/blob/master/README.md
|
||||
|
||||
Issues on GitHub are only related to problems of Babel itself and we cannot answer
|
||||
support questions here.
|
||||
-->
|
||||
|
||||
Choose one: is this a bug report or feature request?
|
||||
|
||||
<!--- Provide a general summary of the issue in the title above -->
|
||||
|
||||
### Input Code
|
||||
<!--- If you're describing a bug, please let us know which sample code reproduces your problem -->
|
||||
<!--- If you have link to our REPL or a standalone repo please link that! -->
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
### Babel/Babylon Configuration (.babelrc, package.json, cli command)
|
||||
<!--- If describing a bug, tell us what your babel configuration looks like -->
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
### Expected Behavior
|
||||
<!--- If you're describing a bug, tell us what should happen -->
|
||||
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||
|
||||
### Current Behavior
|
||||
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||
|
||||
### Possible Solution
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
<!--- or ideas how to implement the addition or change -->
|
||||
|
||||
### Context
|
||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||
|
||||
### Your Environment
|
||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||
|
||||
| software | version(s)
|
||||
| ---------------- | -------
|
||||
| Babel |
|
||||
| Babylon | <!-- This is only needed if you are using Babylon directly -->
|
||||
| node |
|
||||
| npm |
|
||||
| Operating System |
|
||||
|
||||
41
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: 🐛 Bug Report
|
||||
about: If something isn't working as expected 🤔.
|
||||
|
||||
---
|
||||
|
||||
## Bug Report
|
||||
|
||||
**Current Behavior**
|
||||
A clear and concise description of the behavior.
|
||||
|
||||
**Input Code**
|
||||
- REPL or Repo link if applicable:
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
**Expected behavior/code**
|
||||
A clear and concise description of what you expected to happen (or code).
|
||||
|
||||
**Babel Configuration (.babelrc, package.json, cli command)**
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
**Environment**
|
||||
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
|
||||
- Node/npm version: [e.g. Node 8/npm 5]
|
||||
- OS: [e.g. OSX 10.13.4, Windows 10]
|
||||
- Monorepo [e.g. yes/no/Lerna]
|
||||
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
|
||||
|
||||
**Possible Solution**
|
||||
<!--- Only if you have suggestions on a fix for the bug -->
|
||||
|
||||
**Additional context/Screenshots**
|
||||
Add any other context about the problem here. If applicable, add screenshots to help explain.
|
||||
20
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: 🚀 Feature Request
|
||||
about: I have a suggestion (and may want to implement it 🙂)!
|
||||
|
||||
---
|
||||
|
||||
## Feature Request
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I have an issue when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen. Add any considered drawbacks.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Teachability, Documentation, Adoption, Migration Strategy**
|
||||
If you can, explain how users will be able to use this and possibly write out a version the docs.
|
||||
Maybe a screenshot or design?
|
||||
41
.github/ISSUE_TEMPLATE/Regression-v7.md
vendored
Normal file
41
.github/ISSUE_TEMPLATE/Regression-v7.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
name: 💥 v7 Regression
|
||||
about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first ✌️)
|
||||
|
||||
---
|
||||
|
||||
# v7 Regression
|
||||
|
||||
> First check out: https://new.babeljs.io/docs/en/next/v7-migration.html
|
||||
> Also a partial upgrade tool: https://github.com/babel/babel-upgrade
|
||||
|
||||
**Potential Commit/PR that introduced the regression**
|
||||
If you have time to investigate, what PR/date introduced this issue.
|
||||
|
||||
**Describe the regression**
|
||||
A clear and concise description of what the regression is.
|
||||
|
||||
**Input Code**
|
||||
<!--- If you have link to our REPL or a standalone repo please link that! -->
|
||||
|
||||
```js
|
||||
var your => (code) => here;
|
||||
```
|
||||
|
||||
**Babel Configuration (.babelrc, package.json, cli command)**
|
||||
|
||||
```js
|
||||
{
|
||||
"your": { "config": "here" }
|
||||
}
|
||||
```
|
||||
|
||||
**Expected behavior/code**
|
||||
A clear and concise description of what you expected to happen (or code).
|
||||
|
||||
**Environment**
|
||||
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
|
||||
- Node/npm version: [e.g. Node 8/npm 5]
|
||||
- OS: [e.g. OSX 10.13.4, Windows 10]
|
||||
- Monorepo [e.g. yes/no/Lerna]
|
||||
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
|
||||
16
.github/ISSUE_TEMPLATE/Support_question.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/Support_question.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: 🤗 Support Question
|
||||
about: If you have a question 💬, please check out our Slack or StackOverflow!
|
||||
|
||||
---
|
||||
|
||||
--------------^ Click "Preview" for a nicer view!
|
||||
We primarily use GitHub as an issue tracker; for usage and support questions, please check out these resources below. Thanks! 😁.
|
||||
|
||||
---
|
||||
|
||||
* Slack Community Chat: https://babeljs.slack.com (you can sign-up at https://slack.babeljs.io/ for an invite)
|
||||
* StackOverflow: https://stackoverflow.com/questions/tagged/babeljs using the tag `babeljs`
|
||||
* Twitter: If it's just a quick question you can ping our Twitter: https://twitter.com/babeljs
|
||||
* Also have a look at the readme for more information on how to get support:
|
||||
https://github.com/babel/babel/blob/master/README.md
|
||||
24
.github/ISSUE_TEMPLATE/Support_us.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/Support_us.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: 🤝 Support us on Babel
|
||||
about: If you would like to support our efforts in maintaining this community-driven project 🙌!
|
||||
|
||||
---
|
||||
|
||||
--------------^ Click "Preview" for a nicer view!
|
||||
> Open Collective: https://opencollective.com/babel
|
||||
> Henry's Patreon: https://www.patreon.com/henryzhu
|
||||
|
||||
Help support Babel!
|
||||
|
||||
Babel has always been a community project, not really backed or owned by any single (or group) of companies. While some maintainers used to work at Facebook (and Henry at Adobe) no one was working on it full time and there certainly isn't a huge company or team anywhere doing all this work.
|
||||
|
||||
---
|
||||
|
||||
As a group of volunteers you can help us in a few ways
|
||||
|
||||
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance). Companies should be paying their employees to contribute back to the open source projects they use everyday.
|
||||
- Giving funds by becoming one of our sponsors/donators!
|
||||
|
||||
If you'd like to sustain the future of the project as a whole, we have an [Open Collective](https://opencollective.com/babel) that you can donate to. This is a way for funds to be allocated to the core team.
|
||||
|
||||
You can also support [Henry](https://github.com/hzoo) directly since I [left my job to work on Babel and Open Source full time](https://twitter.com/left_pad/status/969793227862790144) at my [Patreon](https://www.patreon.com/henryzhu).
|
||||
12
.github/lock.yml
vendored
Normal file
12
.github/lock.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# Configuration for lock-threads - https://github.com/dessant/lock-threads
|
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked
|
||||
daysUntilLock: 91
|
||||
# Comment to post before locking. Set to `false` to disable
|
||||
lockComment: false
|
||||
only: issues
|
||||
lockLabel: 'outdated'
|
||||
|
||||
# Issues or pull requests with these labels will not be locked
|
||||
# exemptLabels:
|
||||
# - no-locking
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -44,3 +44,4 @@ packages/babel-preset-env-standalone/babel-preset-env.min.js
|
||||
/codemods/*/node_modules
|
||||
/packages/babylon/build
|
||||
.idea/
|
||||
/.changelog
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
package.json
|
||||
packages/babel-preset-env/data
|
||||
|
||||
@@ -5,7 +5,7 @@ language: node_js
|
||||
cache:
|
||||
yarn: true
|
||||
directories:
|
||||
- node_modules
|
||||
- node_modules
|
||||
node_js:
|
||||
# We test the latest version on circleci
|
||||
- '8'
|
||||
|
||||
23
Gulpfile.js
23
Gulpfile.js
@@ -5,7 +5,7 @@ const through = require("through2");
|
||||
const chalk = require("chalk");
|
||||
const newer = require("gulp-newer");
|
||||
const babel = require("gulp-babel");
|
||||
const watch = require("gulp-watch");
|
||||
const gulpWatch = require("gulp-watch");
|
||||
const gutil = require("gulp-util");
|
||||
const filter = require("gulp-filter");
|
||||
const gulp = require("gulp");
|
||||
@@ -99,8 +99,6 @@ function buildRollup(packages) {
|
||||
plugins: [
|
||||
rollupBabel({
|
||||
envName: "babylon",
|
||||
babelrc: false,
|
||||
extends: "./.babelrc.js",
|
||||
}),
|
||||
rollupNodeResolve(),
|
||||
],
|
||||
@@ -114,21 +112,26 @@ function buildRollup(packages) {
|
||||
);
|
||||
}
|
||||
|
||||
gulp.task("default", ["build"]);
|
||||
|
||||
gulp.task("build", function() {
|
||||
const bundles = ["packages/babylon"];
|
||||
|
||||
return merge([buildBabel(/* exclude */ bundles), buildRollup(bundles)]);
|
||||
});
|
||||
|
||||
gulp.task("default", gulp.series("build"));
|
||||
|
||||
gulp.task("build-no-bundle", () => buildBabel());
|
||||
|
||||
gulp.task("watch", ["build-no-bundle"], function() {
|
||||
watch(sources.map(getGlobFromSource), { debounceDelay: 200 }, function() {
|
||||
gulp.start("build-no-bundle");
|
||||
});
|
||||
});
|
||||
gulp.task(
|
||||
"watch",
|
||||
gulp.series("build-no-bundle", function watch() {
|
||||
gulpWatch(
|
||||
sources.map(getGlobFromSource),
|
||||
{ debounceDelay: 200 },
|
||||
gulp.task("build-no-bundle")
|
||||
);
|
||||
})
|
||||
);
|
||||
|
||||
registerStandalonePackageTask(
|
||||
gulp,
|
||||
|
||||
5
Makefile
5
Makefile
@@ -1,6 +1,6 @@
|
||||
MAKEFLAGS = -j1
|
||||
FLOW_COMMIT = f193e19cf2185006ea9139bb0e71f31ea93e7b72
|
||||
TEST262_COMMIT = 52f70e2f637731aae92a9c9a2d831310c3ab2e1e
|
||||
FLOW_COMMIT = 395e045c18d537fcbbc552a96ef2cdcd70b4ab52
|
||||
TEST262_COMMIT = 40883f4c6ae17e073dfd03e34f73a6bf8c855595
|
||||
|
||||
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
|
||||
export FORCE_COLOR = true
|
||||
@@ -134,6 +134,7 @@ clean-lib:
|
||||
clean-all:
|
||||
rm -rf node_modules
|
||||
rm -rf package-lock.json
|
||||
rm -rf .changelog
|
||||
|
||||
$(foreach source, $(SOURCES), \
|
||||
$(call clean-source-all, $(source)))
|
||||
|
||||
@@ -68,11 +68,6 @@ 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)]
|
||||
|
||||
## Gold
|
||||
|
||||
<a href="https://vueschool.io/?babel" target="_blank"><img src="http://new.babeljs.io/img/sponsors/vueschool.png" height="64"></a>
|
||||
<a href="https://devrant.com/?babel" target="_blank"><img src="http://new.babeljs.io/img/sponsors/devRant.png" height="64"></a>
|
||||
|
||||
## Bronze
|
||||
|
||||
<a href="http://teamextension.io/" target="_blank"><img src="https://teamextension.io/dist/img/logo/te-logo-compact.png" height="64"></a>
|
||||
|
||||
@@ -12,15 +12,20 @@ module.exports = function(api) {
|
||||
};
|
||||
|
||||
let convertESM = true;
|
||||
let ignoreLib = true;
|
||||
|
||||
switch (env) {
|
||||
// Configs used during bundling builds.
|
||||
case "babylon":
|
||||
case "standalone":
|
||||
convertESM = false;
|
||||
ignoreLib = false;
|
||||
break;
|
||||
case "production":
|
||||
// Config during builds before publish.
|
||||
envOpts.targets = {
|
||||
node: 6,
|
||||
};
|
||||
break;
|
||||
case "development":
|
||||
envOpts.debug = true;
|
||||
@@ -37,6 +42,15 @@ module.exports = function(api) {
|
||||
|
||||
const config = {
|
||||
comments: false,
|
||||
ignore: [
|
||||
// These may not be strictly necessary with the newly-limited scope of
|
||||
// babelrc searching, but including them for now because we had them
|
||||
// in our .babelignore before.
|
||||
"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: [
|
||||
// TODO: Use @babel/preset-flow when
|
||||
@@ -45,7 +59,10 @@ module.exports = function(api) {
|
||||
["@babel/proposal-class-properties", { loose: true }],
|
||||
"@babel/proposal-export-namespace-from",
|
||||
"@babel/proposal-numeric-separator",
|
||||
["@babel/proposal-object-rest-spread", { useBuiltIns: true }],
|
||||
[
|
||||
"@babel/proposal-object-rest-spread",
|
||||
{ useBuiltIns: true, loose: true },
|
||||
],
|
||||
|
||||
// Explicitly use the lazy version of CommonJS modules.
|
||||
convertESM ? ["@babel/transform-modules-commonjs", { lazy: true }] : null,
|
||||
@@ -0,0 +1,3 @@
|
||||
src
|
||||
test
|
||||
*.log
|
||||
@@ -0,0 +1,57 @@
|
||||
# @babel/plugin-codemod-object-assign-to-object-spread
|
||||
|
||||
Transforms old code that uses `Object.assign` with an Object Literal as
|
||||
the first param to use Object Spread syntax.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
const obj = Object.assign({
|
||||
test1: 1,
|
||||
}, other, {
|
||||
test2: 2,
|
||||
}, other2);
|
||||
```
|
||||
|
||||
Is transformed to:
|
||||
|
||||
```js
|
||||
const obj = {
|
||||
test1: 1,
|
||||
...other,
|
||||
test2: 2,
|
||||
...other2,
|
||||
};
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save-dev @babel/plugin-codemod-object-assign-to-object-spread
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Via `.babelrc` (Recommended)
|
||||
|
||||
**.babelrc**
|
||||
|
||||
```json
|
||||
{
|
||||
"plugins": ["@babel/plugin-codemod-object-assign-to-object-spread"]
|
||||
}
|
||||
```
|
||||
|
||||
### Via CLI
|
||||
|
||||
```sh
|
||||
babel --plugins @babel/plugin-codemod-object-assign-to-object-spread script.js
|
||||
```
|
||||
|
||||
### Via Node API
|
||||
|
||||
```javascript
|
||||
require("@babel/core").transform("code", {
|
||||
plugins: ["@babel/plugin-codemod-object-assign-to-object-spread"]
|
||||
});
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-object-assign-to-object-spread",
|
||||
"version": "7.0.0-beta.47",
|
||||
"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",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"@babel/codemod",
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.47"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.47",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.47"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";
|
||||
|
||||
export default function({ types: t }) {
|
||||
return {
|
||||
inherits: syntaxObjectRestSpread,
|
||||
|
||||
visitor: {
|
||||
CallExpression(path) {
|
||||
if (!path.get("callee").matchesPattern("Object.assign")) return;
|
||||
|
||||
const args = path.get("arguments");
|
||||
if (args.length === 0) return;
|
||||
|
||||
const [objPath] = args;
|
||||
if (!objPath.isObjectExpression()) return;
|
||||
|
||||
const obj = objPath.node;
|
||||
const { properties } = obj;
|
||||
|
||||
for (let i = 1; i < args.length; i++) {
|
||||
const arg = args[i];
|
||||
const { node } = arg;
|
||||
|
||||
if (arg.isObjectExpression()) {
|
||||
properties.push(...node.properties);
|
||||
} else {
|
||||
properties.push(t.spreadElement(node));
|
||||
}
|
||||
}
|
||||
|
||||
path.replaceWith(obj);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1}, {test: 2});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
({
|
||||
test: 1,
|
||||
test: 2
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1}, test2, {test: 2}, test3);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
({
|
||||
test: 1,
|
||||
...test2,
|
||||
test: 2,
|
||||
...test3
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign(test);
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign(test);
|
||||
@@ -0,0 +1 @@
|
||||
Object.assign({test: 1});
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["../../../../lib"]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
({
|
||||
test: 1
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
import runner from "@babel/helper-plugin-test-runner";
|
||||
|
||||
runner(__dirname);
|
||||
@@ -1,21 +1,22 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-optional-catch-binding",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Remove unused catch bindings",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-remove-unused-catch-binding",
|
||||
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-remove-unused-catch-binding",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"keywords": [
|
||||
"@babel/codemod",
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.45"
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.47"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.45"
|
||||
"@babel/core": "7.0.0-beta.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.45",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.45"
|
||||
"@babel/core": "7.0.0-beta.47",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding";
|
||||
import { types as t } from "@babel/core";
|
||||
|
||||
export default function() {
|
||||
export default function({ types: t }) {
|
||||
return {
|
||||
inherits: syntaxOptionalCatchBinding,
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"lerna": "2.0.0-rc.4",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"changelog": {
|
||||
"repo": "babel/babel",
|
||||
"cacheDir": ".changelog",
|
||||
"labels": {
|
||||
"PR: Spec Compliancy :eyeglasses:": ":eyeglasses: Spec Compliancy",
|
||||
"PR: Breaking Change :boom:": ":boom: Breaking Change",
|
||||
@@ -13,7 +14,6 @@
|
||||
"PR: Internal :house:": ":house: Internal"
|
||||
}
|
||||
},
|
||||
"cacheDir": ".changelog",
|
||||
"commands": {
|
||||
"publish": {
|
||||
"ignore": [
|
||||
|
||||
@@ -26,22 +26,124 @@ declare module "lodash/defaults" {
|
||||
|
||||
declare module "lodash/clone" {
|
||||
declare export default <T>(obj: T) => T;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "lodash/merge" {
|
||||
declare export default <T: Object>(T, Object) => T;
|
||||
}
|
||||
|
||||
declare module "convert-source-map" {
|
||||
declare module "source-map" {
|
||||
declare export type SourceMap = {
|
||||
version: 3,
|
||||
file: ?string,
|
||||
sourceRoot: ?string,
|
||||
sources: [?string],
|
||||
sourcesContent: [?string],
|
||||
names: [?string],
|
||||
mappings: string,
|
||||
};
|
||||
|
||||
declare module.exports: {
|
||||
SourceMapConsumer: typeof SourceMapConsumer,
|
||||
SourceMapGenerator: typeof SourceMapGenerator,
|
||||
}
|
||||
|
||||
declare class SourceMapConsumer {
|
||||
static GENERATED_ORDER: 1;
|
||||
static ORIGINAL_ORDER: 2;
|
||||
|
||||
file: string | null;
|
||||
sourceRoot: string | null;
|
||||
sources: Array<string>;
|
||||
|
||||
constructor(?SourceMap): this;
|
||||
|
||||
computeColumnSpans(): string;
|
||||
originalPositionFor({
|
||||
line: number,
|
||||
column: number,
|
||||
}): {|
|
||||
source: string,
|
||||
line: number,
|
||||
column: number,
|
||||
name: string | null
|
||||
|} | {|
|
||||
source: null,
|
||||
line: null,
|
||||
column: null,
|
||||
name: null
|
||||
|};
|
||||
|
||||
generatedPositionFor({
|
||||
source: string,
|
||||
line: number,
|
||||
column: number,
|
||||
}): {|
|
||||
line: number,
|
||||
column: number,
|
||||
lastColumn: number | null | void,
|
||||
|} | {|
|
||||
line: null,
|
||||
column: null,
|
||||
lastColumn: null | void,
|
||||
|};
|
||||
|
||||
allGeneratedPositionsFor({
|
||||
source: string,
|
||||
line: number,
|
||||
column: number,
|
||||
}): Array<{|
|
||||
line: number,
|
||||
column: number,
|
||||
lastColumn: number,
|
||||
|}>;
|
||||
|
||||
sourceContentFor(string, boolean | void): string | null;
|
||||
|
||||
eachMapping(
|
||||
({|
|
||||
generatedLine: number,
|
||||
generatedColumn: number,
|
||||
source: string,
|
||||
originalLine: number,
|
||||
originalColumn: number,
|
||||
name: string | null,
|
||||
|} | {|
|
||||
generatedLine: number,
|
||||
generatedColumn: number,
|
||||
source: null,
|
||||
originalLine: null,
|
||||
originalColumn: null,
|
||||
name: null,
|
||||
|}) => mixed,
|
||||
context: mixed,
|
||||
order: ?(1 | 2),
|
||||
): void;
|
||||
}
|
||||
|
||||
declare class SourceMapGenerator {
|
||||
constructor(?{
|
||||
file?: string | null,
|
||||
sourceRoot?: string | null,
|
||||
skipValidation?: boolean | null,
|
||||
}): this;
|
||||
|
||||
addMapping({
|
||||
generated: {
|
||||
line: number,
|
||||
column: number,
|
||||
}
|
||||
}): void;
|
||||
|
||||
setSourceContent(string, string): void;
|
||||
|
||||
toJSON(): SourceMap;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "convert-source-map" {
|
||||
import type { SourceMap } from "source-map";
|
||||
|
||||
declare class Converter {
|
||||
toJSON(): string;
|
||||
toBase64(): string;
|
||||
|
||||
22
package.json
22
package.json
@@ -10,19 +10,19 @@
|
||||
"test": "make test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.0.0-beta.44",
|
||||
"@babel/core": "7.0.0-beta.44",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.44",
|
||||
"@babel/preset-env": "7.0.0-beta.44",
|
||||
"@babel/preset-flow": "7.0.0-beta.44",
|
||||
"@babel/preset-stage-0": "7.0.0-beta.44",
|
||||
"@babel/register": "7.0.0-beta.44",
|
||||
"@babel/cli": "7.0.0-beta.46",
|
||||
"@babel/core": "7.0.0-beta.46",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.46",
|
||||
"@babel/preset-env": "7.0.0-beta.46",
|
||||
"@babel/preset-flow": "7.0.0-beta.46",
|
||||
"@babel/preset-stage-0": "7.0.0-beta.46",
|
||||
"@babel/register": "7.0.0-beta.46",
|
||||
"babel-core": "^7.0.0-0",
|
||||
"babel-eslint": "^8.0.1",
|
||||
"babel-jest": "^22.4.1",
|
||||
"babel-loader": "8.0.0-beta.0",
|
||||
"babel-plugin-transform-charcodes": "^0.1.0",
|
||||
"babylon": "7.0.0-beta.44",
|
||||
"babylon": "7.0.0-beta.46",
|
||||
"browserify": "^13.1.1",
|
||||
"bundle-collapser": "^1.2.1",
|
||||
"chalk": "^2.3.2",
|
||||
@@ -35,7 +35,7 @@
|
||||
"eslint-plugin-prettier": "^2.5.0",
|
||||
"flow-bin": "^0.66.0",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-babel": "^8.0.0-beta.2",
|
||||
"gulp-filter": "^5.1.0",
|
||||
"gulp-newer": "^1.0.0",
|
||||
@@ -43,13 +43,13 @@
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"gulp-util": "^3.0.7",
|
||||
"gulp-watch": "^4.3.5",
|
||||
"gulp-watch": "^5.0.0",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^22.4.2",
|
||||
"lerna": "2.0.0",
|
||||
"lerna-changelog": "^0.5.0",
|
||||
"lint-staged": "^6.0.1",
|
||||
"lodash": "^4.2.0",
|
||||
"lodash": "^4.17.5",
|
||||
"merge-stream": "^1.0.1",
|
||||
"output-file-sync": "^2.0.0",
|
||||
"prettier": "1.11.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/cli",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Babel command line.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -20,20 +20,20 @@
|
||||
"convert-source-map": "^1.1.0",
|
||||
"fs-readdir-recursive": "^1.0.0",
|
||||
"glob": "^7.0.0",
|
||||
"lodash": "^4.2.0",
|
||||
"lodash": "^4.17.5",
|
||||
"output-file-sync": "^2.0.0",
|
||||
"slash": "^1.0.0",
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"chokidar": "^1.6.1"
|
||||
"chokidar": "^2.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "7.0.0-beta.45"
|
||||
"@babel/core": "7.0.0-beta.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.45",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.45"
|
||||
"@babel/core": "7.0.0-beta.47",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.47"
|
||||
},
|
||||
"bin": {
|
||||
"babel": "./bin/babel.js",
|
||||
|
||||
@@ -9,11 +9,8 @@ import * as util from "./util";
|
||||
let compiledFiles = 0;
|
||||
|
||||
export default function(commander, filenames, opts) {
|
||||
function write(src, relative, base, callback) {
|
||||
if (typeof base === "function") {
|
||||
callback = base;
|
||||
base = undefined;
|
||||
}
|
||||
function write(src, base, callback) {
|
||||
let relative = path.relative(base, src);
|
||||
if (!util.isCompilableExtension(relative, commander.extensions)) {
|
||||
return process.nextTick(callback);
|
||||
}
|
||||
@@ -70,15 +67,11 @@ export default function(commander, filenames, opts) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleFile(src, filename, base, callback) {
|
||||
if (typeof base === "function") {
|
||||
callback = base;
|
||||
base = undefined;
|
||||
}
|
||||
|
||||
write(src, filename, base, function(err, res) {
|
||||
function handleFile(src, base, callback) {
|
||||
write(src, base, function(err, res) {
|
||||
if (err) return callback(err);
|
||||
if (!res && commander.copyFiles) {
|
||||
const filename = path.relative(base, src);
|
||||
const dest = getDest(commander, filename, base);
|
||||
outputFileSync(dest, fs.readFileSync(src));
|
||||
util.chmod(src, dest);
|
||||
@@ -102,7 +95,7 @@ export default function(commander, filenames, opts) {
|
||||
const filename = files[index];
|
||||
const src = path.join(dirname, filename);
|
||||
|
||||
handleFile(src, filename, dirname, function(err) {
|
||||
handleFile(src, dirname, function(err) {
|
||||
if (err) return callback(err);
|
||||
index++;
|
||||
if (index !== files.length) {
|
||||
@@ -128,12 +121,7 @@ export default function(commander, filenames, opts) {
|
||||
const files = util.readdir(dirname, commander.includeDotfiles);
|
||||
sequentialHandleFile(files, dirname, callback);
|
||||
} else {
|
||||
write(
|
||||
filename,
|
||||
path.basename(filename),
|
||||
path.dirname(filename),
|
||||
callback,
|
||||
);
|
||||
write(filename, path.dirname(filename), callback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,8 +151,8 @@ export default function(commander, filenames, opts) {
|
||||
if (commander.watch) {
|
||||
const chokidar = util.requireChokidar();
|
||||
|
||||
filenames.forEach(function(dirname) {
|
||||
const watcher = chokidar.watch(dirname, {
|
||||
filenames.forEach(function(filenameOrDir) {
|
||||
const watcher = chokidar.watch(filenameOrDir, {
|
||||
persistent: true,
|
||||
ignoreInitial: true,
|
||||
awaitWriteFinish: {
|
||||
@@ -175,14 +163,15 @@ export default function(commander, filenames, opts) {
|
||||
|
||||
["add", "change"].forEach(function(type) {
|
||||
watcher.on(type, function(filename) {
|
||||
const relative = path.relative(dirname, filename) || filename;
|
||||
try {
|
||||
handleFile(filename, relative, function(err) {
|
||||
if (err) throw err;
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(err.stack);
|
||||
}
|
||||
handleFile(
|
||||
filename,
|
||||
filename === filenameOrDir
|
||||
? path.dirname(filenameOrDir)
|
||||
: filenameOrDir,
|
||||
function(err) {
|
||||
if (err) console.error(err.stack);
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -51,9 +51,10 @@ export function log(msg, force) {
|
||||
}
|
||||
|
||||
export function transform(filename, code, opts, callback) {
|
||||
opts = Object.assign({}, opts, {
|
||||
opts = {
|
||||
...opts,
|
||||
filename,
|
||||
});
|
||||
};
|
||||
|
||||
babel.transform(code, opts, callback);
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ var foo = function foo() {
|
||||
return 4;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9yaWdpbmFsLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsVUFBVSxlO1MsQUFBTTtBQUFDIiwiZmlsZSI6InNjcmlwdDIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZm9vID0gKCkgPT4gNDsiXX0=
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9yaWdpbmFsLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBQSxNQUFVLFNBQVYsR0FBVSxHO1NBQU0sQztBQUFDLENBQWpCIiwiZmlsZSI6InNjcmlwdDIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZm9vID0gKCkgPT4gNDsiXX0=
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/code-frame",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -8,7 +8,7 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-code-frame",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/highlight": "7.0.0-beta.45"
|
||||
"@babel/highlight": "7.0.0-beta.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chalk": "^2.0.0",
|
||||
|
||||
@@ -38,12 +38,15 @@ function getMarkerLines(
|
||||
source: Array<string>,
|
||||
opts: Object,
|
||||
): { start: number, end: number, markerLines: Object } {
|
||||
const startLoc: Location = Object.assign(
|
||||
{},
|
||||
{ column: 0, line: -1 },
|
||||
loc.start,
|
||||
);
|
||||
const endLoc: Location = Object.assign({}, startLoc, loc.end);
|
||||
const startLoc: Location = {
|
||||
column: 0,
|
||||
line: -1,
|
||||
...loc.start,
|
||||
};
|
||||
const endLoc: Location = {
|
||||
...startLoc,
|
||||
...loc.end,
|
||||
};
|
||||
const { linesAbove = 2, linesBelow = 3 } = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
|
||||
@@ -205,7 +205,7 @@ Each `ConfigItem` exposes all of the information Babel knows. The fields are:
|
||||
You can pass these options from the Babel CLI like so:
|
||||
</p>
|
||||
<p>
|
||||
<code>babel --name<span class="o">=</span>value</code>
|
||||
<code>babel --option-name<span class="o">=</span>value</code>
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "./lib/index.js",
|
||||
"main": "lib/index.js",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"license": "MIT",
|
||||
@@ -28,24 +28,24 @@
|
||||
"./lib/transform-file-sync.js": "./lib/transform-file-sync-browser.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "7.0.0-beta.45",
|
||||
"@babel/generator": "7.0.0-beta.45",
|
||||
"@babel/helpers": "7.0.0-beta.45",
|
||||
"@babel/template": "7.0.0-beta.45",
|
||||
"@babel/traverse": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45",
|
||||
"babylon": "7.0.0-beta.45",
|
||||
"@babel/code-frame": "7.0.0-beta.47",
|
||||
"@babel/generator": "7.0.0-beta.47",
|
||||
"@babel/helpers": "7.0.0-beta.47",
|
||||
"@babel/template": "7.0.0-beta.47",
|
||||
"@babel/traverse": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47",
|
||||
"babylon": "7.0.0-beta.47",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"debug": "^3.1.0",
|
||||
"json5": "^0.5.0",
|
||||
"lodash": "^4.2.0",
|
||||
"lodash": "^4.17.5",
|
||||
"micromatch": "^2.3.11",
|
||||
"resolve": "^1.3.2",
|
||||
"semver": "^5.4.1",
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.45",
|
||||
"@babel/register": "7.0.0-beta.45"
|
||||
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.47",
|
||||
"@babel/register": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,12 +130,8 @@ export function buildRootChain(
|
||||
);
|
||||
if (!programmaticChain) return null;
|
||||
|
||||
const {
|
||||
root: rootDir = ".",
|
||||
babelrc = true,
|
||||
babelrcRoots,
|
||||
configFile: configFileName = true,
|
||||
} = opts;
|
||||
const { root: rootDir = ".", configFile: configFileName = true } = opts;
|
||||
let { babelrc, babelrcRoots } = opts;
|
||||
|
||||
const absoluteRoot = path.resolve(context.cwd, rootDir);
|
||||
|
||||
@@ -148,9 +144,19 @@ export function buildRootChain(
|
||||
|
||||
const configFileChain = emptyChain();
|
||||
if (configFile) {
|
||||
const result = loadFileChain(configFile, context);
|
||||
const validatedFile = validateConfigFile(configFile);
|
||||
const result = loadFileChain(validatedFile, context);
|
||||
if (!result) return null;
|
||||
|
||||
// Allow config files to toggle `.babelrc` resolution on and off and
|
||||
// specify where the roots are.
|
||||
if (babelrc === undefined) {
|
||||
babelrc = validatedFile.options.babelrc;
|
||||
}
|
||||
if (babelrcRoots === undefined) {
|
||||
babelrcRoots = validatedFile.options.babelrcRoots;
|
||||
}
|
||||
|
||||
mergeChain(configFileChain, result);
|
||||
}
|
||||
|
||||
@@ -163,7 +169,7 @@ export function buildRootChain(
|
||||
const fileChain = emptyChain();
|
||||
// resolve all .babelrc files
|
||||
if (
|
||||
babelrc &&
|
||||
(babelrc === true || babelrc === undefined) &&
|
||||
pkgData &&
|
||||
babelrcLoadEnabled(context, pkgData, babelrcRoots, absoluteRoot)
|
||||
) {
|
||||
@@ -180,7 +186,7 @@ export function buildRootChain(
|
||||
}
|
||||
|
||||
if (babelrcFile) {
|
||||
const result = loadFileChain(babelrcFile, context);
|
||||
const result = loadFileChain(validateBabelrcFile(babelrcFile), context);
|
||||
if (!result) return null;
|
||||
|
||||
mergeChain(fileChain, result);
|
||||
@@ -231,11 +237,30 @@ function babelrcLoadEnabled(
|
||||
return micromatch(pkgData.directories, babelrcPatterns).length > 0;
|
||||
}
|
||||
|
||||
const validateConfigFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
|
||||
filepath: file.filepath,
|
||||
dirname: file.dirname,
|
||||
options: validate("configfile", file.options),
|
||||
}));
|
||||
|
||||
const validateBabelrcFile = makeWeakCache(
|
||||
(file: ConfigFile): ValidatedFile => ({
|
||||
filepath: file.filepath,
|
||||
dirname: file.dirname,
|
||||
options: validate("babelrcfile", file.options),
|
||||
}),
|
||||
);
|
||||
|
||||
const validateExtendFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
|
||||
filepath: file.filepath,
|
||||
dirname: file.dirname,
|
||||
options: validate("extendsfile", file.options),
|
||||
}));
|
||||
|
||||
/**
|
||||
* Build a config chain for just the programmatic options passed into Babel.
|
||||
*/
|
||||
const loadProgrammaticChain = makeChainWalker({
|
||||
init: arg => arg,
|
||||
root: input => buildRootDescriptors(input, "base", createCachedDescriptors),
|
||||
env: (input, envName) =>
|
||||
buildEnvDescriptors(input, "base", createCachedDescriptors, envName),
|
||||
@@ -255,18 +280,12 @@ const loadProgrammaticChain = makeChainWalker({
|
||||
* Build a config chain for a given file.
|
||||
*/
|
||||
const loadFileChain = makeChainWalker({
|
||||
init: input => validateFile(input),
|
||||
root: file => loadFileDescriptors(file),
|
||||
env: (file, envName) => loadFileEnvDescriptors(file)(envName),
|
||||
overrides: (file, index) => loadFileOverridesDescriptors(file)(index),
|
||||
overridesEnv: (file, index, envName) =>
|
||||
loadFileOverridesEnvDescriptors(file)(index)(envName),
|
||||
});
|
||||
const validateFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({
|
||||
filepath: file.filepath,
|
||||
dirname: file.dirname,
|
||||
options: validate("file", file.options),
|
||||
}));
|
||||
const loadFileDescriptors = makeWeakCache((file: ValidatedFile) =>
|
||||
buildRootDescriptors(file, file.filepath, createUncachedDescriptors),
|
||||
);
|
||||
@@ -350,25 +369,18 @@ function buildOverrideEnvDescriptors(
|
||||
: null;
|
||||
}
|
||||
|
||||
function makeChainWalker<
|
||||
ArgT,
|
||||
InnerT: { options: ValidatedOptions, dirname: string },
|
||||
>({
|
||||
init,
|
||||
function makeChainWalker<ArgT: { options: ValidatedOptions, dirname: string }>({
|
||||
root,
|
||||
env,
|
||||
overrides,
|
||||
overridesEnv,
|
||||
}: {
|
||||
init: ArgT => InnerT,
|
||||
root: InnerT => OptionsAndDescriptors,
|
||||
env: (InnerT, string) => OptionsAndDescriptors | null,
|
||||
overrides: (InnerT, number) => OptionsAndDescriptors,
|
||||
overridesEnv: (InnerT, number, string) => OptionsAndDescriptors | null,
|
||||
root: ArgT => OptionsAndDescriptors,
|
||||
env: (ArgT, string) => OptionsAndDescriptors | null,
|
||||
overrides: (ArgT, number) => OptionsAndDescriptors,
|
||||
overridesEnv: (ArgT, number, string) => OptionsAndDescriptors | null,
|
||||
}): (ArgT, ConfigContext, Set<ConfigFile> | void) => ConfigChain | null {
|
||||
return (arg, context, files = new Set()) => {
|
||||
const input = init(arg);
|
||||
|
||||
return (input, context, files = new Set()) => {
|
||||
const { dirname } = input;
|
||||
|
||||
const flattenedConfigs = [];
|
||||
@@ -442,7 +454,7 @@ function mergeExtendsChain(
|
||||
}
|
||||
|
||||
files.add(file);
|
||||
const fileChain = loadFileChain(file, context, files);
|
||||
const fileChain = loadFileChain(validateExtendFile(file), context, files);
|
||||
files.delete(file);
|
||||
|
||||
if (!fileChain) return false;
|
||||
@@ -480,7 +492,9 @@ function emptyChain(): ConfigChain {
|
||||
}
|
||||
|
||||
function normalizeOptions(opts: ValidatedOptions): ValidatedOptions {
|
||||
const options = Object.assign({}, opts);
|
||||
const options = {
|
||||
...opts,
|
||||
};
|
||||
delete options.extends;
|
||||
delete options.env;
|
||||
delete options.plugins;
|
||||
|
||||
@@ -174,7 +174,10 @@ const loadDescriptor = makeWeakCache(
|
||||
|
||||
let item = value;
|
||||
if (typeof value === "function") {
|
||||
const api = Object.assign({}, context, makeAPI(cache));
|
||||
const api = {
|
||||
...context,
|
||||
...makeAPI(cache),
|
||||
};
|
||||
try {
|
||||
item = value(api, options, dirname);
|
||||
} catch (e) {
|
||||
@@ -229,9 +232,13 @@ const instantiatePlugin = makeWeakCache(
|
||||
): Plugin => {
|
||||
const pluginObj = validatePluginObject(value);
|
||||
|
||||
const plugin = Object.assign({}, pluginObj);
|
||||
const plugin = {
|
||||
...pluginObj,
|
||||
};
|
||||
if (plugin.visitor) {
|
||||
plugin.visitor = traverse.explode(Object.assign({}, plugin.visitor));
|
||||
plugin.visitor = traverse.explode({
|
||||
...plugin.visitor,
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.inherits) {
|
||||
|
||||
@@ -49,6 +49,7 @@ export default function loadPrivatePartialConfig(
|
||||
// passed back to Babel a second time, it will be in the right structure
|
||||
// to not change behavior.
|
||||
options.babelrc = false;
|
||||
options.configFile = false;
|
||||
options.envName = envName;
|
||||
options.cwd = absoluteCwd;
|
||||
options.passPerPreset = false;
|
||||
|
||||
@@ -36,12 +36,6 @@ const ROOT_VALIDATORS: ValidatorSet = {
|
||||
filenameRelative: (assertString: Validator<
|
||||
$PropertyType<ValidatedOptions, "filenameRelative">,
|
||||
>),
|
||||
babelrc: (assertBoolean: Validator<
|
||||
$PropertyType<ValidatedOptions, "babelrc">,
|
||||
>),
|
||||
babelrcRoots: (assertBabelrcSearch: Validator<
|
||||
$PropertyType<ValidatedOptions, "babelrcRoots">,
|
||||
>),
|
||||
code: (assertBoolean: Validator<$PropertyType<ValidatedOptions, "code">>),
|
||||
ast: (assertBoolean: Validator<$PropertyType<ValidatedOptions, "ast">>),
|
||||
|
||||
@@ -50,6 +44,15 @@ const ROOT_VALIDATORS: ValidatorSet = {
|
||||
>),
|
||||
};
|
||||
|
||||
const BABELRC_VALIDATORS: ValidatorSet = {
|
||||
babelrc: (assertBoolean: Validator<
|
||||
$PropertyType<ValidatedOptions, "babelrc">,
|
||||
>),
|
||||
babelrcRoots: (assertBabelrcSearch: Validator<
|
||||
$PropertyType<ValidatedOptions, "babelrcRoots">,
|
||||
>),
|
||||
};
|
||||
|
||||
const NONPRESET_VALIDATORS: ValidatorSet = {
|
||||
extends: (assertString: Validator<
|
||||
$PropertyType<ValidatedOptions, "extends">,
|
||||
@@ -243,7 +246,14 @@ export type SourceTypeOption = "module" | "script" | "unambiguous";
|
||||
export type CompactOption = boolean | "auto";
|
||||
export type RootInputSourceMapOption = {} | boolean;
|
||||
|
||||
export type OptionsType = "arguments" | "file" | "env" | "preset" | "override";
|
||||
export type OptionsType =
|
||||
| "arguments"
|
||||
| "env"
|
||||
| "preset"
|
||||
| "override"
|
||||
| "configfile"
|
||||
| "babelrcfile"
|
||||
| "extendsfile";
|
||||
|
||||
export function validate(type: OptionsType, opts: {}): ValidatedOptions {
|
||||
assertNoDuplicateSourcemap(opts);
|
||||
@@ -255,6 +265,22 @@ export function validate(type: OptionsType, opts: {}): ValidatedOptions {
|
||||
if (type !== "arguments" && ROOT_VALIDATORS[key]) {
|
||||
throw new Error(`.${key} is only allowed in root programmatic options`);
|
||||
}
|
||||
if (
|
||||
type !== "arguments" &&
|
||||
type !== "configfile" &&
|
||||
BABELRC_VALIDATORS[key]
|
||||
) {
|
||||
if (type === "babelrcfile" || type === "extendsfile") {
|
||||
throw new Error(
|
||||
`.${key} is not allowed in .babelrc or "extend"ed files, only in root programmatic options, ` +
|
||||
`or babel.config.js/config file options`,
|
||||
);
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`.${key} is only allowed in root programmatic options, or babel.config.js/config file options`,
|
||||
);
|
||||
}
|
||||
if (type === "env" && key === "env") {
|
||||
throw new Error(`.${key} is not allowed inside another env block`);
|
||||
}
|
||||
@@ -268,6 +294,7 @@ export function validate(type: OptionsType, opts: {}): ValidatedOptions {
|
||||
const validator =
|
||||
COMMON_VALIDATORS[key] ||
|
||||
NONPRESET_VALIDATORS[key] ||
|
||||
BABELRC_VALIDATORS[key] ||
|
||||
ROOT_VALIDATORS[key];
|
||||
|
||||
if (validator) validator(key, opts[key]);
|
||||
|
||||
@@ -12,7 +12,10 @@ export default function transformFileSync(
|
||||
if (opts == null) {
|
||||
options = { filename };
|
||||
} else if (opts && typeof opts === "object") {
|
||||
options = Object.assign({}, opts, { filename });
|
||||
options = {
|
||||
...opts,
|
||||
filename,
|
||||
};
|
||||
}
|
||||
|
||||
const config = loadConfig(options);
|
||||
|
||||
@@ -19,7 +19,10 @@ export default ((function transformFile(filename, opts, callback) {
|
||||
if (opts == null) {
|
||||
options = { filename };
|
||||
} else if (opts && typeof opts === "object") {
|
||||
options = Object.assign({}, opts, { filename });
|
||||
options = {
|
||||
...opts,
|
||||
filename,
|
||||
};
|
||||
}
|
||||
|
||||
process.nextTick(() => {
|
||||
|
||||
@@ -13,6 +13,7 @@ export default function loadBlockHoistPlugin(): Plugin {
|
||||
// which loads this file, and this 'loadConfig' loading plugins.
|
||||
const config = loadConfig({
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
plugins: [blockHoistPlugin],
|
||||
});
|
||||
LOADED_PLUGIN = config ? config.passes[0][0] : undefined;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import type { PluginPasses } from "../../config";
|
||||
import convertSourceMap, { type SourceMap } from "convert-source-map";
|
||||
import sourceMap from "source-map";
|
||||
import generate from "@babel/generator";
|
||||
|
||||
import type File from "./file";
|
||||
import mergeSourceMap from "./merge-map";
|
||||
|
||||
export default function generateCode(
|
||||
pluginPasses: PluginPasses,
|
||||
@@ -72,46 +72,3 @@ export default function generateCode(
|
||||
|
||||
return { outputCode, outputMap };
|
||||
}
|
||||
|
||||
function mergeSourceMap(inputMap: SourceMap, map: SourceMap): SourceMap {
|
||||
const inputMapConsumer = new sourceMap.SourceMapConsumer(inputMap);
|
||||
const outputMapConsumer = new sourceMap.SourceMapConsumer(map);
|
||||
|
||||
const mergedGenerator = new sourceMap.SourceMapGenerator({
|
||||
file: inputMapConsumer.file,
|
||||
sourceRoot: inputMapConsumer.sourceRoot,
|
||||
});
|
||||
|
||||
// This assumes the output map always has a single source, since Babel always compiles a
|
||||
// single source file to a single output file.
|
||||
const source = outputMapConsumer.sources[0];
|
||||
|
||||
inputMapConsumer.eachMapping(function(mapping) {
|
||||
const generatedPosition = outputMapConsumer.generatedPositionFor({
|
||||
line: mapping.generatedLine,
|
||||
column: mapping.generatedColumn,
|
||||
source: source,
|
||||
});
|
||||
if (generatedPosition.column != null) {
|
||||
mergedGenerator.addMapping({
|
||||
source: mapping.source,
|
||||
|
||||
original:
|
||||
mapping.source == null
|
||||
? null
|
||||
: {
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn,
|
||||
},
|
||||
|
||||
generated: generatedPosition,
|
||||
|
||||
name: mapping.name,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const mergedMap = mergedGenerator.toJSON();
|
||||
inputMap.mappings = mergedMap.mappings;
|
||||
return inputMap;
|
||||
}
|
||||
|
||||
317
packages/babel-core/src/transformation/file/merge-map.js
Normal file
317
packages/babel-core/src/transformation/file/merge-map.js
Normal file
@@ -0,0 +1,317 @@
|
||||
// @flow
|
||||
|
||||
import type { SourceMap } from "convert-source-map";
|
||||
import sourceMap from "source-map";
|
||||
|
||||
export default function mergeSourceMap(
|
||||
inputMap: SourceMap,
|
||||
map: SourceMap,
|
||||
): SourceMap {
|
||||
const input = buildMappingData(inputMap);
|
||||
const output = buildMappingData(map);
|
||||
|
||||
const mergedGenerator = new sourceMap.SourceMapGenerator();
|
||||
for (const { source } of input.sources) {
|
||||
if (typeof source.content === "string") {
|
||||
mergedGenerator.setSourceContent(source.path, source.content);
|
||||
}
|
||||
}
|
||||
|
||||
if (output.sources.length === 1) {
|
||||
const defaultSource = output.sources[0];
|
||||
|
||||
const insertedMappings = new Map();
|
||||
|
||||
// Process each generated range in the input map, e.g. each range over the
|
||||
// code that Babel was originally given.
|
||||
eachInputGeneratedRange(input, (generated, original, source) => {
|
||||
// Then pick out each range over Babel's _output_ that corresponds with
|
||||
// the given range on the code given to Babel.
|
||||
eachOverlappingGeneratedOutputRange(defaultSource, generated, item => {
|
||||
// It's possible that multiple input ranges will overlap the same
|
||||
// generated range. Since sourcemap don't traditionally represent
|
||||
// generated locations with multiple original locations, we explicitly
|
||||
// skip generated locations once we've seen them the first time.
|
||||
const key = makeMappingKey(item);
|
||||
if (insertedMappings.has(key)) return;
|
||||
insertedMappings.set(key, item);
|
||||
|
||||
mergedGenerator.addMapping({
|
||||
source: source.path,
|
||||
original: {
|
||||
line: original.line,
|
||||
column: original.columnStart,
|
||||
},
|
||||
generated: {
|
||||
line: item.line,
|
||||
column: item.columnStart,
|
||||
},
|
||||
name: original.name,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Since mappings are manipulated using single locations, but are interpreted
|
||||
// as ranges, the insertions above may not actually have their ending
|
||||
// locations mapped yet. Here be go through each one and ensure that it has
|
||||
// a well-defined ending location, if one wasn't already created by the start
|
||||
// of a different range.
|
||||
for (const item of insertedMappings.values()) {
|
||||
if (item.columnEnd === Infinity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const clearItem = {
|
||||
line: item.line,
|
||||
columnStart: item.columnEnd,
|
||||
};
|
||||
|
||||
const key = makeMappingKey(clearItem);
|
||||
if (insertedMappings.has(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Insert mappings with no original position to terminate any mappings
|
||||
// that were found above, so that they don't expand beyond their correct
|
||||
// range.
|
||||
mergedGenerator.addMapping({
|
||||
generated: {
|
||||
line: clearItem.line,
|
||||
column: clearItem.columnStart,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const result = mergedGenerator.toJSON();
|
||||
// addMapping expects a relative path, and setSourceContent expects an
|
||||
// absolute path. To avoid this whole confusion, we leave the root out
|
||||
// entirely, and add it at the end here.
|
||||
if (typeof input.sourceRoot === "string") {
|
||||
result.sourceRoot = input.sourceRoot;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function makeMappingKey(item: { line: number, columnStart: number }) {
|
||||
return JSON.stringify([item.line, item.columnStart]);
|
||||
}
|
||||
|
||||
function eachOverlappingGeneratedOutputRange(
|
||||
outputFile: ResolvedFileMappings,
|
||||
inputGeneratedRange: ResolvedGeneratedRange,
|
||||
callback: ResolvedGeneratedRange => mixed,
|
||||
) {
|
||||
// Find the Babel-generated mappings that overlap with this range in the
|
||||
// input sourcemap. Generated locations within the input sourcemap
|
||||
// correspond with the original locations in the map Babel generates.
|
||||
const overlappingOriginal = filterApplicableOriginalRanges(
|
||||
outputFile,
|
||||
inputGeneratedRange,
|
||||
);
|
||||
|
||||
for (const { generated } of overlappingOriginal) {
|
||||
for (const item of generated) {
|
||||
callback(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function filterApplicableOriginalRanges(
|
||||
{ mappings }: ResolvedFileMappings,
|
||||
{ line, columnStart, columnEnd }: ResolvedGeneratedRange,
|
||||
): OriginalMappings {
|
||||
// The mapping array is sorted by original location, so we can
|
||||
// binary-search it for the overlapping ranges.
|
||||
return filterSortedArray(mappings, ({ original: outOriginal }) => {
|
||||
if (line > outOriginal.line) return -1;
|
||||
if (line < outOriginal.line) return 1;
|
||||
|
||||
if (columnStart >= outOriginal.columnEnd) return -1;
|
||||
if (columnEnd <= outOriginal.columnStart) return 1;
|
||||
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
function eachInputGeneratedRange(
|
||||
map: ResolvedMappings,
|
||||
callback: (
|
||||
ResolvedGeneratedRange,
|
||||
ResolvedOriginalRange,
|
||||
ResolvedSource,
|
||||
) => mixed,
|
||||
) {
|
||||
for (const { source, mappings } of map.sources) {
|
||||
for (const { original, generated } of mappings) {
|
||||
for (const item of generated) {
|
||||
callback(item, original, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type ResolvedMappings = {|
|
||||
file: ?string,
|
||||
sourceRoot: ?string,
|
||||
sources: Array<ResolvedFileMappings>,
|
||||
|};
|
||||
type ResolvedFileMappings = {|
|
||||
source: ResolvedSource,
|
||||
mappings: OriginalMappings,
|
||||
|};
|
||||
type OriginalMappings = Array<{|
|
||||
original: ResolvedOriginalRange,
|
||||
generated: Array<ResolvedGeneratedRange>,
|
||||
|}>;
|
||||
type ResolvedSource = {|
|
||||
path: string,
|
||||
content: string | null,
|
||||
|};
|
||||
type ResolvedOriginalRange = {|
|
||||
line: number,
|
||||
columnStart: number,
|
||||
columnEnd: number,
|
||||
name: string | null,
|
||||
|};
|
||||
type ResolvedGeneratedRange = {|
|
||||
line: number,
|
||||
columnStart: number,
|
||||
columnEnd: number,
|
||||
|};
|
||||
|
||||
function buildMappingData(map: SourceMap): ResolvedMappings {
|
||||
const consumer = new sourceMap.SourceMapConsumer({
|
||||
...map,
|
||||
|
||||
// This is a bit hack. .addMapping expects source values to be relative,
|
||||
// but eachMapping returns mappings with absolute paths. To avoid that
|
||||
// incompatibility, we leave the sourceRoot out here and add it to the
|
||||
// final map at the end instead.
|
||||
sourceRoot: null,
|
||||
});
|
||||
|
||||
const sources = new Map();
|
||||
const mappings = new Map();
|
||||
|
||||
let last = null;
|
||||
|
||||
consumer.computeColumnSpans();
|
||||
|
||||
consumer.eachMapping(
|
||||
m => {
|
||||
if (m.originalLine === null) return;
|
||||
|
||||
let source = sources.get(m.source);
|
||||
if (!source) {
|
||||
source = {
|
||||
path: m.source,
|
||||
content: consumer.sourceContentFor(m.source, true),
|
||||
};
|
||||
sources.set(m.source, source);
|
||||
}
|
||||
|
||||
let sourceData = mappings.get(source);
|
||||
if (!sourceData) {
|
||||
sourceData = {
|
||||
source,
|
||||
mappings: [],
|
||||
};
|
||||
mappings.set(source, sourceData);
|
||||
}
|
||||
|
||||
const obj = {
|
||||
line: m.originalLine,
|
||||
columnStart: m.originalColumn,
|
||||
columnEnd: Infinity,
|
||||
name: m.name,
|
||||
};
|
||||
|
||||
if (
|
||||
last &&
|
||||
last.source === source &&
|
||||
last.mapping.line === m.originalLine
|
||||
) {
|
||||
last.mapping.columnEnd = m.originalColumn;
|
||||
}
|
||||
|
||||
last = {
|
||||
source,
|
||||
mapping: obj,
|
||||
};
|
||||
|
||||
sourceData.mappings.push({
|
||||
original: obj,
|
||||
generated: consumer
|
||||
.allGeneratedPositionsFor({
|
||||
source: m.source,
|
||||
line: m.originalLine,
|
||||
column: m.originalColumn,
|
||||
})
|
||||
.map(item => ({
|
||||
line: item.line,
|
||||
columnStart: item.column,
|
||||
// source-map's lastColumn is inclusive, not exclusive, so we need
|
||||
// to add 1 to it.
|
||||
columnEnd: item.lastColumn + 1,
|
||||
})),
|
||||
});
|
||||
},
|
||||
null,
|
||||
sourceMap.SourceMapConsumer.ORIGINAL_ORDER,
|
||||
);
|
||||
|
||||
return {
|
||||
file: map.file,
|
||||
sourceRoot: map.sourceRoot,
|
||||
sources: Array.from(mappings.values()),
|
||||
};
|
||||
}
|
||||
|
||||
function findInsertionLocation<T>(
|
||||
array: Array<T>,
|
||||
callback: T => number,
|
||||
): number {
|
||||
let left = 0;
|
||||
let right = array.length;
|
||||
while (left < right) {
|
||||
const mid = Math.floor((left + right) / 2);
|
||||
const item = array[mid];
|
||||
|
||||
const result = callback(item);
|
||||
if (result === 0) {
|
||||
left = mid;
|
||||
break;
|
||||
}
|
||||
if (result >= 0) {
|
||||
right = mid;
|
||||
} else {
|
||||
left = mid + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the value is the start of any set of matches.
|
||||
let i = left;
|
||||
if (i < array.length) {
|
||||
while (i > 0 && callback(array[i]) >= 0) {
|
||||
i--;
|
||||
}
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
function filterSortedArray<T>(
|
||||
array: Array<T>,
|
||||
callback: T => number,
|
||||
): Array<T> {
|
||||
const start = findInsertionLocation(array, callback);
|
||||
|
||||
const results = [];
|
||||
for (let i = start; i < array.length && callback(array[i]) === 0; i++) {
|
||||
results.push(array[i]);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
@@ -6,7 +6,10 @@ import type { ResolvedConfig } from "../config";
|
||||
export default function normalizeOptions(config: ResolvedConfig): {} {
|
||||
const {
|
||||
filename,
|
||||
filenameRelative = filename || "unknown",
|
||||
cwd,
|
||||
filenameRelative = typeof filename === "string"
|
||||
? path.relative(cwd, filename)
|
||||
: "unknown",
|
||||
sourceType = "module",
|
||||
inputSourceMap,
|
||||
sourceMaps = !!inputSourceMap,
|
||||
@@ -14,7 +17,7 @@ export default function normalizeOptions(config: ResolvedConfig): {} {
|
||||
moduleRoot,
|
||||
sourceRoot = moduleRoot,
|
||||
|
||||
sourceFileName = filenameRelative,
|
||||
sourceFileName = path.basename(filenameRelative),
|
||||
|
||||
comments = true,
|
||||
compact = "auto",
|
||||
@@ -22,36 +25,38 @@ export default function normalizeOptions(config: ResolvedConfig): {} {
|
||||
|
||||
const opts = config.options;
|
||||
|
||||
const options = Object.assign({}, opts, {
|
||||
parserOpts: Object.assign(
|
||||
{
|
||||
sourceType:
|
||||
path.extname(filenameRelative) === ".mjs" ? "module" : sourceType,
|
||||
sourceFileName: filename,
|
||||
plugins: [],
|
||||
},
|
||||
opts.parserOpts,
|
||||
),
|
||||
generatorOpts: Object.assign(
|
||||
{
|
||||
// General generator flags.
|
||||
filename,
|
||||
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
|
||||
auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
|
||||
retainLines: opts.retainLines,
|
||||
comments,
|
||||
shouldPrintComment: opts.shouldPrintComment,
|
||||
compact,
|
||||
minified: opts.minified,
|
||||
const options = {
|
||||
...opts,
|
||||
|
||||
// Source-map generation flags.
|
||||
sourceMaps,
|
||||
sourceRoot,
|
||||
sourceFileName,
|
||||
},
|
||||
opts.generatorOpts,
|
||||
),
|
||||
});
|
||||
parserOpts: {
|
||||
sourceType:
|
||||
path.extname(filenameRelative) === ".mjs" ? "module" : sourceType,
|
||||
|
||||
sourceFileName: filename,
|
||||
plugins: [],
|
||||
...opts.parserOpts,
|
||||
},
|
||||
|
||||
generatorOpts: {
|
||||
// General generator flags.
|
||||
filename,
|
||||
|
||||
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
|
||||
auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
|
||||
retainLines: opts.retainLines,
|
||||
comments,
|
||||
shouldPrintComment: opts.shouldPrintComment,
|
||||
compact,
|
||||
minified: opts.minified,
|
||||
|
||||
// Source-map generation flags.
|
||||
sourceMaps,
|
||||
|
||||
sourceRoot,
|
||||
sourceFileName,
|
||||
...opts.generatorOpts,
|
||||
},
|
||||
};
|
||||
|
||||
for (const plugins of config.passes) {
|
||||
for (const plugin of plugins) {
|
||||
|
||||
@@ -12,11 +12,35 @@ function assertNotIgnored(result) {
|
||||
expect(result.ignored).toBeFalsy();
|
||||
}
|
||||
|
||||
function transform(code, opts) {
|
||||
return babel.transform(code, {
|
||||
cwd: __dirname,
|
||||
...opts,
|
||||
});
|
||||
}
|
||||
|
||||
function transformFile(filename, opts, cb) {
|
||||
return babel.transformFile(
|
||||
filename,
|
||||
{
|
||||
cwd: __dirname,
|
||||
...opts,
|
||||
},
|
||||
cb,
|
||||
);
|
||||
}
|
||||
function transformFileSync(filename, opts) {
|
||||
return babel.transformFileSync(filename, {
|
||||
cwd: __dirname,
|
||||
...opts,
|
||||
});
|
||||
}
|
||||
|
||||
// shim
|
||||
function transformAsync(code, opts) {
|
||||
return {
|
||||
then: function(resolve) {
|
||||
resolve(babel.transform(code, opts));
|
||||
resolve(transform(code, opts));
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -32,7 +56,7 @@ describe("parser and generator options", function() {
|
||||
};
|
||||
|
||||
function newTransform(string) {
|
||||
return babel.transform(string, {
|
||||
return transform(string, {
|
||||
ast: true,
|
||||
parserOpts: {
|
||||
parser: recast.parse,
|
||||
@@ -48,7 +72,7 @@ describe("parser and generator options", function() {
|
||||
it("options", function() {
|
||||
const string = "original;";
|
||||
expect(newTransform(string).ast).toEqual(
|
||||
babel.transform(string, { ast: true }).ast,
|
||||
transform(string, { ast: true }).ast,
|
||||
);
|
||||
expect(newTransform(string).code).toBe(string);
|
||||
});
|
||||
@@ -57,7 +81,7 @@ describe("parser and generator options", function() {
|
||||
const experimental = "var a: number = 1;";
|
||||
|
||||
expect(newTransform(experimental).ast).toEqual(
|
||||
babel.transform(experimental, {
|
||||
transform(experimental, {
|
||||
ast: true,
|
||||
parserOpts: {
|
||||
plugins: ["flow"],
|
||||
@@ -67,7 +91,7 @@ describe("parser and generator options", function() {
|
||||
expect(newTransform(experimental).code).toBe(experimental);
|
||||
|
||||
function newTransformWithPlugins(string) {
|
||||
return babel.transform(string, {
|
||||
return transform(string, {
|
||||
ast: true,
|
||||
plugins: [__dirname + "/../../babel-plugin-syntax-flow"],
|
||||
parserOpts: {
|
||||
@@ -80,7 +104,7 @@ describe("parser and generator options", function() {
|
||||
}
|
||||
|
||||
expect(newTransformWithPlugins(experimental).ast).toEqual(
|
||||
babel.transform(experimental, {
|
||||
transform(experimental, {
|
||||
ast: true,
|
||||
parserOpts: {
|
||||
plugins: ["flow"],
|
||||
@@ -94,7 +118,7 @@ describe("parser and generator options", function() {
|
||||
const experimental = "if (true) {\n import a from 'a';\n}";
|
||||
|
||||
expect(newTransform(experimental).ast).not.toBe(
|
||||
babel.transform(experimental, {
|
||||
transform(experimental, {
|
||||
ast: true,
|
||||
parserOpts: {
|
||||
allowImportExportEverywhere: true,
|
||||
@@ -123,7 +147,7 @@ describe("api", function() {
|
||||
babelrc: false,
|
||||
};
|
||||
Object.freeze(options);
|
||||
babel.transformFile(__dirname + "/fixtures/api/file.js", options, function(
|
||||
transformFile(__dirname + "/fixtures/api/file.js", options, function(
|
||||
err,
|
||||
res,
|
||||
) {
|
||||
@@ -141,15 +165,14 @@ describe("api", function() {
|
||||
};
|
||||
Object.freeze(options);
|
||||
expect(
|
||||
babel.transformFileSync(__dirname + "/fixtures/api/file.js", options)
|
||||
.code,
|
||||
transformFileSync(__dirname + "/fixtures/api/file.js", options).code,
|
||||
).toBe("foo();");
|
||||
expect(options).toEqual({ babelrc: false });
|
||||
});
|
||||
|
||||
it("options throw on falsy true", function() {
|
||||
return expect(function() {
|
||||
babel.transform("", {
|
||||
transform("", {
|
||||
plugins: [__dirname + "/../../babel-plugin-syntax-jsx", false],
|
||||
});
|
||||
}).toThrow(/.plugins\[1\] must be a string, object, function/);
|
||||
@@ -170,7 +193,7 @@ describe("api", function() {
|
||||
let calledRaw = 0;
|
||||
let calledIntercept = 0;
|
||||
|
||||
babel.transform("function foo() { bar(foobar); }", {
|
||||
transform("function foo() { bar(foobar); }", {
|
||||
wrapPluginVisitorMethod: function(pluginAlias, visitorType, callback) {
|
||||
if (pluginAlias !== "foobar") {
|
||||
return callback;
|
||||
@@ -204,7 +227,7 @@ describe("api", function() {
|
||||
let aliasBaseType = null;
|
||||
|
||||
function execTest(passPerPreset) {
|
||||
return babel.transform("type Foo = number; let x = (y): Foo => y;", {
|
||||
return transform("type Foo = number; let x = (y): Foo => y;", {
|
||||
sourceType: "script",
|
||||
passPerPreset: passPerPreset,
|
||||
presets: [
|
||||
@@ -293,7 +316,7 @@ describe("api", function() {
|
||||
const oldEnv = process.env.BABEL_ENV;
|
||||
process.env.BABEL_ENV = "development";
|
||||
|
||||
const result = babel.transform("", {
|
||||
const result = transform("", {
|
||||
cwd: path.join(__dirname, "fixtures", "config", "complex-plugin-config"),
|
||||
filename: path.join(
|
||||
__dirname,
|
||||
@@ -348,7 +371,7 @@ describe("api", function() {
|
||||
});
|
||||
|
||||
it("source map merging", function() {
|
||||
const result = babel.transform(
|
||||
const result = transform(
|
||||
[
|
||||
/* eslint-disable max-len */
|
||||
'function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }',
|
||||
@@ -394,6 +417,16 @@ describe("api", function() {
|
||||
});
|
||||
});
|
||||
|
||||
it("default source map filename", function() {
|
||||
return transformAsync("var a = 10;", {
|
||||
cwd: "/some/absolute",
|
||||
filename: "/some/absolute/file/path.js",
|
||||
sourceMaps: true,
|
||||
}).then(function(result) {
|
||||
expect(result.map.sources).toEqual(["path.js"]);
|
||||
});
|
||||
});
|
||||
|
||||
it("code option false", function() {
|
||||
return transformAsync("foo('bar');", { code: false }).then(function(
|
||||
result,
|
||||
@@ -545,7 +578,7 @@ describe("api", function() {
|
||||
});
|
||||
|
||||
it("default", function() {
|
||||
const result = babel.transform("foo;", {
|
||||
const result = transform("foo;", {
|
||||
env: {
|
||||
development: { comments: false },
|
||||
},
|
||||
@@ -556,7 +589,7 @@ describe("api", function() {
|
||||
|
||||
it("BABEL_ENV", function() {
|
||||
process.env.BABEL_ENV = "foo";
|
||||
const result = babel.transform("foo;", {
|
||||
const result = transform("foo;", {
|
||||
env: {
|
||||
foo: { comments: false },
|
||||
},
|
||||
@@ -566,7 +599,7 @@ describe("api", function() {
|
||||
|
||||
it("NODE_ENV", function() {
|
||||
process.env.NODE_ENV = "foo";
|
||||
const result = babel.transform("foo;", {
|
||||
const result = transform("foo;", {
|
||||
env: {
|
||||
foo: { comments: false },
|
||||
},
|
||||
@@ -624,7 +657,7 @@ describe("api", function() {
|
||||
};
|
||||
|
||||
it("only syntax plugin available", function(done) {
|
||||
babel.transformFile(
|
||||
transformFile(
|
||||
__dirname + "/fixtures/api/parsing-errors/only-syntax/file.js",
|
||||
options,
|
||||
function(err) {
|
||||
@@ -641,7 +674,7 @@ describe("api", function() {
|
||||
});
|
||||
|
||||
it("both syntax and transform plugin available", function(done) {
|
||||
babel.transformFile(
|
||||
transformFile(
|
||||
__dirname + "/fixtures/api/parsing-errors/syntax-and-transform/file.js",
|
||||
options,
|
||||
function(err) {
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { loadOptions } from "../lib";
|
||||
import { loadOptions as loadOptionsOrig } from "../lib";
|
||||
|
||||
function fixture(...args) {
|
||||
return path.join(__dirname, "fixtures", "config", ...args);
|
||||
}
|
||||
|
||||
function loadOptions(opts) {
|
||||
return loadOptionsOrig({
|
||||
cwd: __dirname,
|
||||
...opts,
|
||||
});
|
||||
}
|
||||
|
||||
describe("buildConfigChain", function() {
|
||||
describe("test", () => {
|
||||
describe("single", () => {
|
||||
@@ -897,6 +904,7 @@ describe("buildConfigChain", function() {
|
||||
describe("config files", () => {
|
||||
const getDefaults = () => ({
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
cwd: process.cwd(),
|
||||
envName: "development",
|
||||
passPerPreset: false,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{
|
||||
"plugins": ["@babel/syntax-decorators"]
|
||||
"plugins": [
|
||||
["@babel/syntax-decorators", { "legacy": true }]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [
|
||||
"HelloWorld.vue"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
|
||||
"sourceRoot": "src/components",
|
||||
"sourcesContent": [
|
||||
"<template>\n <div class=\"hello\">\n <h1>{{ msg }}</h1>\n <h2>Essential Links</h2>\n <ul>\n <li>\n <a\n href=\"https://vuejs.org\"\n target=\"_blank\"\n >\n Core Docs\n </a>\n </li>\n <li>\n <a\n href=\"https://forum.vuejs.org\"\n target=\"_blank\"\n >\n Forum\n </a>\n </li>\n <li>\n <a\n href=\"https://chat.vuejs.org\"\n target=\"_blank\"\n >\n Community Chat\n </a>\n </li>\n <li>\n <a\n href=\"https://twitter.com/vuejs\"\n target=\"_blank\"\n >\n Twitter\n </a>\n </li>\n <br>\n <li>\n <a\n href=\"http://vuejs-templates.github.io/webpack/\"\n target=\"_blank\"\n >\n Docs for This Template\n </a>\n </li>\n </ul>\n <h2>Ecosystem</h2>\n <ul>\n <li>\n <a\n href=\"http://router.vuejs.org/\"\n target=\"_blank\"\n >\n vue-router\n </a>\n </li>\n <li>\n <a\n href=\"http://vuex.vuejs.org/\"\n target=\"_blank\"\n >\n vuex\n </a>\n </li>\n <li>\n <a\n href=\"http://vue-loader.vuejs.org/\"\n target=\"_blank\"\n >\n vue-loader\n </a>\n </li>\n <li>\n <a\n href=\"https://github.com/vuejs/awesome-vue\"\n target=\"_blank\"\n >\n awesome-vue\n </a>\n </li>\n </ul>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'HelloWorld',\n data () {\n return {\n msg: 'Welcome to Your Vue.js App'\n }\n }\n}\n</script>\n\n<!-- Add \"scoped\" attribute to limit CSS to this component only -->\n<style scoped>\nh1, h2 {\n font-weight: normal;\n}\nul {\n list-style-type: none;\n padding: 0;\n}\nli {\n display: inline-block;\n margin: 0 10px;\n}\na {\n color: #42b983;\n}\n</style>\n"
|
||||
]
|
||||
}
|
||||
113
packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/input.mjs
vendored
Normal file
113
packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/input.mjs
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
export default {
|
||||
name: 'HelloWorld',
|
||||
data () {
|
||||
return {
|
||||
msg: 'Welcome to Your Vue.js App'
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-modules-commonjs"
|
||||
]
|
||||
}
|
||||
120
packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/output.js
vendored
Normal file
120
packages/babel-core/test/fixtures/transformation/source-maps/input-source-map-complex/output.js
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
var _default = {
|
||||
name: 'HelloWorld',
|
||||
|
||||
data() {
|
||||
return {
|
||||
msg: 'Welcome to Your Vue.js App'
|
||||
};
|
||||
}
|
||||
|
||||
}; //
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
exports.default = _default;
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [
|
||||
"HelloWorld.vue"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsFA;AACA,QAAA,YADA;;AAEA,SAAA;AACA,WAAA;AACA,WAAA;AADA,KAAA;AAGA;;AANA,C",
|
||||
"sourceRoot": "src/components",
|
||||
"sourcesContent": [
|
||||
"<template>\n <div class=\"hello\">\n <h1>{{ msg }}</h1>\n <h2>Essential Links</h2>\n <ul>\n <li>\n <a\n href=\"https://vuejs.org\"\n target=\"_blank\"\n >\n Core Docs\n </a>\n </li>\n <li>\n <a\n href=\"https://forum.vuejs.org\"\n target=\"_blank\"\n >\n Forum\n </a>\n </li>\n <li>\n <a\n href=\"https://chat.vuejs.org\"\n target=\"_blank\"\n >\n Community Chat\n </a>\n </li>\n <li>\n <a\n href=\"https://twitter.com/vuejs\"\n target=\"_blank\"\n >\n Twitter\n </a>\n </li>\n <br>\n <li>\n <a\n href=\"http://vuejs-templates.github.io/webpack/\"\n target=\"_blank\"\n >\n Docs for This Template\n </a>\n </li>\n </ul>\n <h2>Ecosystem</h2>\n <ul>\n <li>\n <a\n href=\"http://router.vuejs.org/\"\n target=\"_blank\"\n >\n vue-router\n </a>\n </li>\n <li>\n <a\n href=\"http://vuex.vuejs.org/\"\n target=\"_blank\"\n >\n vuex\n </a>\n </li>\n <li>\n <a\n href=\"http://vue-loader.vuejs.org/\"\n target=\"_blank\"\n >\n vue-loader\n </a>\n </li>\n <li>\n <a\n href=\"https://github.com/vuejs/awesome-vue\"\n target=\"_blank\"\n >\n awesome-vue\n </a>\n </li>\n </ul>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'HelloWorld',\n data () {\n return {\n msg: 'Welcome to Your Vue.js App'\n }\n }\n}\n</script>\n\n<!-- Add \"scoped\" attribute to limit CSS to this component only -->\n<style scoped>\nh1, h2 {\n font-weight: normal;\n}\nul {\n list-style-type: none;\n padding: 0;\n}\nli {\n display: inline-block;\n margin: 0 10px;\n}\na {\n color: #42b983;\n}\n</style>\n"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
[
|
||||
{
|
||||
"generated": {
|
||||
"line": 92,
|
||||
"column": 15
|
||||
},
|
||||
"original": {
|
||||
"line": 87,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"generated": {
|
||||
"line": 93,
|
||||
"column": 0
|
||||
},
|
||||
"original": {
|
||||
"line": 88,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"generated": {
|
||||
"line": 95,
|
||||
"column": 9
|
||||
},
|
||||
"original": {
|
||||
"line": 89,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"generated": {
|
||||
"line": 96,
|
||||
"column": 0
|
||||
},
|
||||
"original": {
|
||||
"line": 90,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"generated": {
|
||||
"line": 97,
|
||||
"column": 0
|
||||
},
|
||||
"original": {
|
||||
"line": 91,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"generated": {
|
||||
"line": 98,
|
||||
"column": 0
|
||||
},
|
||||
"original": {
|
||||
"line": 90,
|
||||
"column": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"generated": {
|
||||
"line": 99,
|
||||
"column": 0
|
||||
},
|
||||
"original": {
|
||||
"line": 93,
|
||||
"column": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -1,11 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"mappings": "AAAA,UAAU,Y;SAAM,A;AAAC",
|
||||
"mappings": "AAAA,IAAA,MAAU,Y;SAAM,C;AAAC,CAAjB",
|
||||
"names": [],
|
||||
"sources": [
|
||||
"original.js"
|
||||
],
|
||||
"sourcesContent": [
|
||||
"var foo = () => 4;"
|
||||
]
|
||||
"sources": ["original.js"],
|
||||
"sourcesContent": ["var foo = () => 4;"],
|
||||
"version": 3
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { loadOptions } from "../lib";
|
||||
import { loadOptions as loadOptionsOrig } from "../lib";
|
||||
import path from "path";
|
||||
|
||||
function loadOptions(opts) {
|
||||
return loadOptionsOrig({
|
||||
cwd: __dirname,
|
||||
...opts,
|
||||
});
|
||||
}
|
||||
|
||||
describe("option-manager", () => {
|
||||
it("throws for babel 5 plugin", () => {
|
||||
return expect(() => {
|
||||
|
||||
@@ -22,7 +22,10 @@ describe("parse", function() {
|
||||
const input = fs.readFileSync(fixture("input.js"), "utf8");
|
||||
const output = require(fixture("output.json"));
|
||||
|
||||
const result = parse(input, { parserOpts: { plugins: ["decorators"] } });
|
||||
const result = parse(input, {
|
||||
parserOpts: { plugins: ["decorators"] },
|
||||
cwd: fixture(),
|
||||
});
|
||||
expect(JSON.parse(JSON.stringify(result))).toEqual(output);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,6 +6,7 @@ describe("traversal path", function() {
|
||||
const expectCode = "function foo() {}";
|
||||
|
||||
const actualCode = transform(expectCode, {
|
||||
cwd: __dirname,
|
||||
plugins: [
|
||||
new Plugin({
|
||||
visitor: {
|
||||
@@ -24,6 +25,7 @@ describe("traversal path", function() {
|
||||
const expectCode = "var fn = () => true;";
|
||||
|
||||
const actualCode = transform(expectCode, {
|
||||
cwd: __dirname,
|
||||
plugins: [
|
||||
new Plugin({
|
||||
visitor: {
|
||||
@@ -53,6 +55,7 @@ describe("traversal path", function() {
|
||||
const expectCode = "var fn = () => { return true; }";
|
||||
|
||||
const actualCode = transform(expectCode, {
|
||||
cwd: __dirname,
|
||||
plugins: [
|
||||
new Plugin({
|
||||
visitor: {
|
||||
@@ -74,6 +77,7 @@ describe("traversal path", function() {
|
||||
const expectCode = "for (KEY in right);";
|
||||
|
||||
const actualCode = transform(expectCode, {
|
||||
cwd: __dirname,
|
||||
plugins: [
|
||||
new Plugin({
|
||||
visitor: {
|
||||
@@ -104,6 +108,7 @@ describe("traversal path", function() {
|
||||
const expectCode = "for (var KEY in right);";
|
||||
|
||||
const actualCode = transform(expectCode, {
|
||||
cwd: __dirname,
|
||||
plugins: [
|
||||
new Plugin({
|
||||
visitor: {
|
||||
@@ -125,6 +130,7 @@ describe("traversal path", function() {
|
||||
const expectCode = "for (KEY;;);";
|
||||
|
||||
const actualCode = transform(expectCode, {
|
||||
cwd: __dirname,
|
||||
plugins: [
|
||||
new Plugin({
|
||||
visitor: {
|
||||
@@ -155,6 +161,7 @@ describe("traversal path", function() {
|
||||
const expectCode = "for (var KEY;;);";
|
||||
|
||||
const actualCode = transform(expectCode, {
|
||||
cwd: __dirname,
|
||||
plugins: [
|
||||
new Plugin({
|
||||
visitor: {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -11,14 +11,14 @@
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.47",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.2.0",
|
||||
"lodash": "^4.17.5",
|
||||
"source-map": "^0.5.0",
|
||||
"trim-right": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "7.0.0-beta.45",
|
||||
"babylon": "7.0.0-beta.45"
|
||||
"@babel/helper-fixtures": "7.0.0-beta.47",
|
||||
"babylon": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{ "plugins": ["decorators"] }
|
||||
{ "plugins": ["decorators-legacy"] }
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["typescript", "decorators"]
|
||||
"plugins": ["typescript", "decorators-legacy"]
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-annotate-as-pure",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to annotate paths and nodes with #__PURE__ comment",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-annotate-as-pure",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-bindify-decorators",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to bindify decorators",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-bindify-decorators",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/traverse": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/traverse": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-builder-binary-assignment-operator-visitor",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to build binary assignment operator visitors",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-explode-assignable-expression": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/helper-explode-assignable-expression": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-builder-react-jsx",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to build react jsx",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.47",
|
||||
"esutils": "^2.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-call-delegate",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to call delegate",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-hoist-variables": "7.0.0-beta.45",
|
||||
"@babel/traverse": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/helper-hoist-variables": "7.0.0-beta.47",
|
||||
"@babel/traverse": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-define-map",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to define a map",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45",
|
||||
"lodash": "^4.2.0"
|
||||
"@babel/helper-function-name": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47",
|
||||
"lodash": "^4.17.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-explode-assignable-expression",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to explode an assignable expression",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/traverse": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/traverse": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-explode-class",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to explode class",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-class",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-bindify-decorators": "7.0.0-beta.45",
|
||||
"@babel/traverse": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/helper-bindify-decorators": "7.0.0-beta.47",
|
||||
"@babel/traverse": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-fixtures",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to support fixtures",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-fixtures",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.2.0",
|
||||
"lodash": "^4.17.5",
|
||||
"semver": "^5.3.0",
|
||||
"try-resolve": "^1.0.0"
|
||||
}
|
||||
|
||||
@@ -196,6 +196,11 @@ export default function get(entryLoc): Array<Suite> {
|
||||
if (fs.existsSync(sourceMapLoc)) {
|
||||
test.sourceMap = JSON.parse(readFile(sourceMapLoc));
|
||||
}
|
||||
|
||||
const inputMapLoc = taskDir + "/input-source-map.json";
|
||||
if (fs.existsSync(inputMapLoc)) {
|
||||
test.inputSourceMap = JSON.parse(readFile(inputMapLoc));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-function-name",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to change the property 'name' of every function",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-get-function-arity": "7.0.0-beta.45",
|
||||
"@babel/template": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/helper-get-function-arity": "7.0.0-beta.47",
|
||||
"@babel/template": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-get-function-arity",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to get function arity",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-hoist-variables",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to hoist variables",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-member-expression-to-functions",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to replace certain member expressions with function calls",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"author": "Justin Ridgewell <justin@ridgewell.name>",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,5 +82,8 @@ const handle = {
|
||||
// Optionally, a memoize method may be defined on the state, which will be
|
||||
// called when the member is a self-referential update.
|
||||
export default function memberExpressionToFunctions(path, visitor, state) {
|
||||
path.traverse(visitor, Object.assign({}, state, handle));
|
||||
path.traverse(visitor, {
|
||||
...state,
|
||||
...handle,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-module-imports",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Babel helper functions for inserting module loads",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -8,10 +8,10 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-imports",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45",
|
||||
"lodash": "^4.2.0"
|
||||
"@babel/types": "7.0.0-beta.47",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.45"
|
||||
"@babel/core": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,9 @@ export default class ImportInjector {
|
||||
optsList.push(importedSource);
|
||||
}
|
||||
|
||||
const newOpts = Object.assign({}, this._defaultOpts);
|
||||
const newOpts = {
|
||||
...this._defaultOpts,
|
||||
};
|
||||
for (const opts of optsList) {
|
||||
if (!opts) continue;
|
||||
Object.keys(newOpts).forEach(key => {
|
||||
|
||||
@@ -10,6 +10,7 @@ function test(sourceType, opts, initializer, expectedCode) {
|
||||
}
|
||||
|
||||
const result = babel.transform("", {
|
||||
cwd: __dirname,
|
||||
sourceType,
|
||||
filename: "example" + (sourceType === "module" ? ".mjs" : ".js"),
|
||||
babelrc: false,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-module-transforms",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Babel helper functions for implementing ES6 module transformations",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -8,11 +8,11 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-transforms",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "7.0.0-beta.45",
|
||||
"@babel/helper-simple-access": "7.0.0-beta.45",
|
||||
"@babel/helper-split-export-declaration": "7.0.0-beta.45",
|
||||
"@babel/template": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45",
|
||||
"lodash": "^4.2.0"
|
||||
"@babel/helper-module-imports": "7.0.0-beta.47",
|
||||
"@babel/helper-simple-access": "7.0.0-beta.47",
|
||||
"@babel/helper-split-export-declaration": "7.0.0-beta.47",
|
||||
"@babel/template": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47",
|
||||
"lodash": "^4.17.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function rewriteLiveReferences(
|
||||
exportMeta.push(...data.names);
|
||||
}
|
||||
|
||||
// Rewrite inititialization of bindings to update exports.
|
||||
// Rewrite initialization of bindings to update exports.
|
||||
programPath.traverse(rewriteBindingInitVisitor, {
|
||||
metadata,
|
||||
requeueInParent,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-optimise-call-expression",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to optimise call expression",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-plugin-test-runner",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to support test runner",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.45"
|
||||
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-plugin-utils",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "General utilities for plugins to use",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
|
||||
@@ -34,7 +34,10 @@ function copyApiObject(api) {
|
||||
}
|
||||
}
|
||||
|
||||
return Object.assign({}, proto, api);
|
||||
return {
|
||||
...proto,
|
||||
...api,
|
||||
};
|
||||
}
|
||||
|
||||
function has(obj, key) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-regex",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to check for literal RegEx",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.2.0"
|
||||
"lodash": "^4.17.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "@babel/helper-remap-async-to-generator",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to remap async functions to generators",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-annotate-as-pure": "7.0.0-beta.45",
|
||||
"@babel/helper-wrap-function": "7.0.0-beta.45",
|
||||
"@babel/template": "7.0.0-beta.45",
|
||||
"@babel/traverse": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/helper-annotate-as-pure": "7.0.0-beta.47",
|
||||
"@babel/helper-wrap-function": "7.0.0-beta.47",
|
||||
"@babel/template": "7.0.0-beta.47",
|
||||
"@babel/traverse": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "@babel/helper-replace-supers",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Helper function to replace supers",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-member-expression-to-functions": "7.0.0-beta.45",
|
||||
"@babel/helper-optimise-call-expression": "7.0.0-beta.45",
|
||||
"@babel/traverse": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/helper-member-expression-to-functions": "7.0.0-beta.47",
|
||||
"@babel/helper-optimise-call-expression": "7.0.0-beta.47",
|
||||
"@babel/traverse": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-simple-access",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "Babel helper for ensuring that access to a given value is performed through simple accesses",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -8,8 +8,8 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "7.0.0-beta.45",
|
||||
"@babel/types": "7.0.0-beta.45",
|
||||
"lodash": "^4.2.0"
|
||||
"@babel/template": "7.0.0-beta.47",
|
||||
"@babel/types": "7.0.0-beta.47",
|
||||
"lodash": "^4.17.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-split-export-declaration",
|
||||
"version": "7.0.0-beta.45",
|
||||
"version": "7.0.0-beta.47",
|
||||
"description": "",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.45"
|
||||
"@babel/types": "7.0.0-beta.47"
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user