Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const config = {
],
env: {
test: {
presets: [ [ '@babel/env', { targets: { node: 'current' } } ] ],
presets: [ [ '@babel/preset-env', { targets: { node: 'current' } } ] ],
},
},
};
Expand Down
8 changes: 4 additions & 4 deletions extensions/blocks/mailchimp/view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
}

&.wp-block-jetpack-mailchimp_error {
background-color: var( --muriel-hot-red-500 );
color: var( --muriel-white );
background-color: var( --color-error );
color: $white;
}

&.wp-block-jetpack-mailchimp_processing {
background-color: rgba( 0, 0, 0, 0.025 ); // This would be "dark-opacity-light-50" which doesn't exist in Gutenberg
}

&.wp-block-jetpack-mailchimp_success {
background-color: var( --muriel-hot-green-500 );
color: var( --muriel-white );
background-color: var( --color-success );
color: $white;
}
}

Expand Down
3 changes: 2 additions & 1 deletion extensions/blocks/simple-payments/product-placeholder.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import '../../shared/styles/gutenberg-colors.scss';
@import '../../shared/styles/jetpack-variables.scss';

.simple-payments__loading {
Expand Down Expand Up @@ -74,7 +75,7 @@ body .jetpack-simple-payments-wrapper .jetpack-simple-payments-details p {
}

input[type='number'].jetpack-simple-payments-items-number {
background: var( --color-white );
background: $white;
font-size: 16px;
line-height: 1;
max-width: 60px;
Expand Down
4 changes: 2 additions & 2 deletions extensions/blocks/tiled-gallery/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
top: 0;

.components-button {
color: var( --color-white );
color: $white;
&:hover,
&:focus {
color: var( --color-white );
color: $white;
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions extensions/shared/components/upgrade-nudge/style.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
@import '../../styles/gutenberg-colors.scss';

.jetpack-upgrade-nudge__icon {
align-self: center;
background: var( --color-plan-premium );
border-radius: 50%;
box-sizing: content-box;
color: var( --color-white );
fill: var( --color-white );
color: $white;
fill: $white;
flex-shrink: 0;
margin-right: 16px;
padding: 6px;
Expand Down
4 changes: 3 additions & 1 deletion extensions/shared/jetpack-plugin-sidebar.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'styles/gutenberg-colors.scss';

.edit-post-pinned-plugins,
.edit-post-more-menu__content {
.components-icon-button {
Expand Down Expand Up @@ -33,7 +35,7 @@
}

.jetpack-logo__icon-triangle {
fill: var( --color-white ) !important;
fill: $white !important;
}
}
}
Expand Down
13 changes: 12 additions & 1 deletion jest.config.js
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'
),
},
};
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,21 @@
}
},
"dependencies": {
"@automattic/calypso-build": "1.0.0",
"@automattic/calypso-build": "4.1.0",
"@automattic/calypso-color-schemes": "1.0.0",
"@automattic/custom-colors-loader": "automattic/custom-colors-loader",
"@automattic/format-currency": "1.0.0-alpha.0",
"@automattic/wordpress-external-dependencies-plugin": "1.0.0",
"@babel/core": "7.4.0",
"@babel/preset-env": "7.6.0",
"@babel/register": "7.4.4",
"@wordpress/browserslist-config": "2.5.0",
"@wordpress/compose": "3.5.0",
"@wordpress/data": "4.7.0",
"@wordpress/element": "2.5.0",
"@wordpress/i18n": "3.5.0",
"@wordpress/url": "2.6.0",
"babel-jest": "24.9.0",
"babel-loader": "8.0.6",
"bounding-client-rect": "1.0.5",
"classnames": "2.2.6",
Expand Down Expand Up @@ -164,17 +166,13 @@
"@wordpress/e2e-test-utils": "2.2.0",
"@wordpress/editor": "9.4.0",
"@wordpress/eslint-plugin": "2.3.0",
"@wordpress/jest-preset-default": "4.2.0",
"@wordpress/server-side-render": "1.0.0",
"babel-eslint": "10.0.2",
"chai": "4.2.0",
"commander": "2.20.0",
"config": "3.2.2",
"css-loader": "2.1.1",
"danger": "7.1.4",
"enzyme": "3.9.0",
"enzyme-adapter-react-16": "1.11.2",
"enzyme-to-json": "3.4.0",
"eslint": "5.16.0",
"eslint-config-prettier": "4.3.0",
"eslint-config-wpcalypso": "4.0.1",
Expand Down
13 changes: 13 additions & 0 deletions tests/jest-extensions-babel-transform.js
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' ),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @automattic/calypso-build preset 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.WP to 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, yep 👍

],
babelrc: false,
configFile: false,
} );
6 changes: 0 additions & 6 deletions webpack.config.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ module.exports = [
},
{
...componentsWebpackConfig,
output: {
Comment thread
ockham marked this conversation as resolved.
Resolved
...componentsWebpackConfig.output,
// The next line is required to work around https://github.com/Automattic/wp-calypso/pull/34860.
// Remove once Jetpack is using a version of `@automattic/calypso-build` that contains the fix.
libraryTarget: 'commonjs2',
},
plugins: [
...componentsWebpackConfig.plugins,
new webpack.NormalModuleReplacementPlugin(
Expand Down
Loading