Repository navigation
Build: Update calypso-build to v4 #13503
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9ccb376
Upgrade calypso build to 4.1.0
sirreal 0d04cf8
Apply wordpress-element babel transform in Jest
sirreal 414fec9
Add @babel/preset-env dep
sirreal 82107a1
Remove fixed @TODO
sirreal e59c7b3
Update yarn.lock
sirreal 93fd21c
Fix colors
simison File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,15 @@ | ||
| /** | ||
| * External dependencies | ||
| */ | ||
| const path = require( 'path' ); | ||
|
|
||
| module.exports = { | ||
| preset: '@wordpress/jest-preset-default', | ||
| preset: '@automattic/calypso-build', | ||
| roots: [ '<rootDir>/extensions/' ], | ||
| transform: { | ||
| '\\.[jt]sx?$': path.join( __dirname, 'tests', 'jest-extensions-babel-transform' ), | ||
| '\\.(gif|jpg|jpeg|png|svg|scss|sass|css)$': require.resolve( | ||
| '@automattic/calypso-build/jest/transform/asset' | ||
| ), | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or 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,13 @@ | ||
| /** | ||
| * External dependencies | ||
| */ | ||
| const babelJest = require( 'babel-jest' ); | ||
|
|
||
| module.exports = babelJest.createTransformer( { | ||
| presets: [ | ||
| require.resolve( '@automattic/calypso-build/babel/default' ), | ||
| require.resolve( '@automattic/calypso-build/babel/wordpress-element' ), | ||
| ], | ||
| babelrc: false, | ||
| configFile: false, | ||
| } ); | ||
This file contains hidden or 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
Oops, something went wrong.
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.
The
@automattic/calypso-buildpreset provides this transform without this line.That is something the preset should provide, but I'm not sure of the best way to go about it.
This aligns with the way we pass
--env.WPto webpack, but Jest doesn't seem to have any concept of arbitrary arguments we pass through the CLI. In fact, jest fails if it doesn't understand the arguments passed to the CLI.This is sufficient for now, but it's something that should be considered for future calypso-build work.
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.
Good point, yep 👍