babel / babel/babel-upgrade

plugins aren't added to package.json

Open
#101 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.3k
Forks
53
PR merge metrics
No merged PRs in 30d

Description

babel-upgrade explodes all of the stage presets that we had into the individual plugins, which is great - but it doesn't add these plugins to our package.json for installation so we had to do this manually. Is this expected, or should it have inserted the plugins into package.json itself?

babel-upgrade output,
```
🙌 Thanks for trying out https://github.com/babel/babel-upgrade!

Updating .babelrc config at .babelrc
Index: .babelrc
===================================================================
--- .babelrc Before Upgrade
+++ .babelrc After Upgrade
@@ -1,28 +1,69 @@
{
"presets": [
[
- "es2015",
+ "@babel/preset-env",
{
"modules": false
}
],
- "es2016",
- "es2017",
- "react",
- "stage-2"
+ "@babel/preset-env",
+ "@babel/preset-env",
+ "@babel/preset-react",
+ "@babel/preset-flow"
],
"plugins": [
"emotion",
- "transform-async-to-generator",
- "react-hot-loader/babel"
+ "@babel/plugin-transform-async-to-generator",
+ "react-hot-loader/babel",
+ "@babel/plugin-syntax-dynamic-import",
+ "@babel/plugin-syntax-import-meta",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-json-strings",
+ [
+ "@babel/plugin-proposal-decorators",
+ {
+ "legacy": true
+ }
+ ],
+ "@babel/plugin-proposal-function-sent",
+ "@babel/plugin-proposal-export-namespace-from",
+ "@babel/plugin-proposal-numeric-separator",
+ "@babel/plugin-proposal-throw-expressions"
],
"env": {
"test": {
"presets": [
- "es2015",
- "react",
- "stage-0"
+ "@babel/preset-env",
+ "@babel/preset-react"
+ ],
+ "plugins": [
+ "@babel/plugin-syntax-dynamic-import",
+ "@babel/plugin-syntax-import-meta",
+ "@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-json-strings",
+ [
+ "@babel/plugin-proposal-decorators",
+ {
+ "legacy": true
+ }
+ ],
+ "@babel/plugin-proposal-function-sent",
+ "@babel/plugin-proposal-export-namespace-from",
+ "@babel/plugin-proposal-numeric-separator",
+ "@babel/plugin-proposal-throw-expressions",
+ "@babel/plugin-proposal-export-default-from",
+ "@babel/plugin-proposal-logical-assignment-operators",
+ "@babel/plugin-proposal-optional-chaining",
+ [
+ "@babel/plugin-proposal-pipeline-operator",
+ {
+ "proposal": "minimal"
+ }
+ ],
+ "@babel/plugin-proposal-nullish-coalescing-operator",
+ "@babel/plugin-proposal-do-expressions",
+ "@babel/plugin-proposal-function-bind"
]
}
}
}
\ No newline at end of file

Updating closest package.json dependencies
Index: /Users/camron/src/lodgetools/inntender/package.json
===================================================================
--- /Users/camron/src/lodgetools/inntender/package.json Before Upgrade
+++ /Users/camron/src/lodgetools/inntender/package.json After Upgrade
@@ -27,15 +27,15 @@
}
},
"proxy": "https://inntender.dev",
"dependencies": {
+ "@babel/core": "^7.0.0",
+ "@babel/plugin-transform-async-to-generator": "^7.0.0",
+ "@babel/polyfill": "^7.0.0",
+ "@babel/preset-react": "^7.0.0",
"autoprefixer": "^8.4.1",
"axios": "^0.18.0",
- "babel-core": "^6.26.3",
"babel-plugin-emotion": "^9.1.2",
- "babel-plugin-transform-async-to-generator": "^6.24.1",
- "babel-polyfill": "^6.26.0",
- "babel-preset-react": "^6.24.1",
"bootstrap": "3.3.7",
"css-loader": "^0.28.11",
"cssnano": "^3.10.0",
"csso": "^3.1.1",
@@ -61,24 +61,24 @@
"redux": "^4.0.0",
"style-loader": "^0.21.0"
},
"devDependencies": {
+ "@babel/cli": "^7.0.0",
+ "@babel/core": "^7.0.0",
+ "@babel/preset-env": "^7.0.0",
+ "@babel/preset-flow": "^7.0.0",
"@kadira/storybook-addons": "^1.6.1",
"@storybook/addon-info": "^3.4.3",
"@storybook/addon-knobs": "^3.4.3",
"@storybook/addon-options": "^3.4.3",
"@storybook/react": "^3.4.3",
"axios-mock-adapter": "^1.15.0",
- "babel-cli": "^6.26.0",
- "babel-eslint": "^8.2.3",
- "babel-jest": "^22.4.3",
- "babel-loader": "^7.1.4",
+ "babel-core": "^7.0.0-bridge.0",
+ "babel-eslint": "^9.0.0",
+ "babel-jest": "^23.4.2",
+ "babel-loader": "^8.0.0",
"babel-minify": "^0.4.3",
"babel-plugin-add-module-exports": "^0.2.1",
- "babel-preset-es2015": "^6.24.1",
- "babel-preset-es2016": "^6.24.1",
- "babel-preset-es2017": "^6.24.1",
- "babel-preset-flow": "^6.23.0",
"compression-webpack-plugin": "^1.1.11",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.4.0",
"eslint-plugin-flowtype": "^2.46.3",

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the generated .babelrc with the closest package.json shown in the issue, focusing on plugins expanded from stage presets. Trace the babel-upgrade path that updates these two files and check how dependencies are selected. Done means the expected Babel plugins are consistently represented in package.json after an upgrade, with coverage for this behavior if existing tests support it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.