-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Babel 7 plugins compatibility with Babel 8 core #16332
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7e45300
Allow configuring monorepo root in helper-fixtures
nicolo-ribaudo 7edb2f2
Do not `require()` old syntax plugins when loading with Babel 8
nicolo-ribaudo fc4c32d
Add `REQUIRED_VERSION` macro
nicolo-ribaudo fbecf46
Add test utils for Babel 7 plugins with Babel 8 core
nicolo-ribaudo c1f08c3
Run on CI
nicolo-ribaudo eb2e36d
babel.config.js runs in node 6
nicolo-ribaudo 17e4380
chmod
nicolo-ribaudo 5a079ae
external-helpers doesn't work with Babel 8
nicolo-ribaudo f274bfc
Discard changes to packages/babel-helper-fixtures/src/index.ts
nicolo-ribaudo cae826b
Use `yarn constraints` to update package.json
nicolo-ribaudo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
test/babel-7-8-compat/babel-7-plugins-with-babel-8-core.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
# Usage: BABEL_8_VERSION=next ./test/babel-7-8-compat/babel-7-plugins-with-babel-8-core.sh | ||
# NOTE: This will change files in your monorepo, make sure to commit/stage | ||
# everything before running it. | ||
|
||
#==============================================================================# | ||
# SETUP # | ||
#==============================================================================# | ||
|
||
# Start in test/babel-7-8-compat even if run from root directory | ||
cd "$(dirname "$0")" || exit | ||
|
||
# Echo every command being executed | ||
set -x | ||
|
||
# Go to the root of the monorepo | ||
cd ../.. | ||
|
||
#==============================================================================# | ||
# TEST # | ||
#==============================================================================# | ||
|
||
node -e ' | ||
if (!process.env.BABEL_8_VERSION) throw new Error("Please specify BABEL_8_VERSION=x.y.z env var"); | ||
|
||
const pluginsList = require("./test/babel-7-8-compat/data.json")["babel7plugins-babel8core"]; | ||
|
||
for (const plugin of pluginsList) { | ||
const pkgJsonPath = path.join("./packages", plugin, "package.json"); | ||
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath)); | ||
pkgJson.devDependencies["@babel/core"] = process.env.BABEL_8_VERSION; | ||
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkgJson, null, 2) + "\n"); | ||
} | ||
' || exit | ||
|
||
export YARN_ENABLE_IMMUTABLE_INSTALLS=false | ||
export SKIP_YARN_CORE_DEP_CHECK=true | ||
|
||
# Build and test | ||
make -j use-cjs | ||
yarn jest $(node -p 'require("./test/babel-7-8-compat/data.json")["babel7plugins-babel8core"].join(" ")' || exit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"babel7plugins-babel8core": [ | ||
"babel-plugin-external-helpers", | ||
"babel-plugin-transform-json-strings" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pass the
BABEL_8_VERSION
here and letyarn constraints --fix
update the dependencies for us?