-
Notifications
You must be signed in to change notification settings - Fork 794
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
Update @automattic/calypso-build to v 5.0 #13854
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: December 3, 2019. |
Turns out the `undefined` fallback doesn't work so well after all: See Automattic/jetpack#13854 which currently fails to find a PostCSS config. I tried various other fixes (setting different levels of config options to `undefined` or empty object), but none seemed to work. The fix I ended up was the only reliable way I could find.
With Automattic/wp-calypso#37110 applied, this is still failing in |
One possible fix is diff --git a/babel.config.js b/babel.config.js
index ef8132aab..b3bcbb62e 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -5,6 +5,12 @@ const config = {
test: './extensions/',
presets: [ require.resolve( '@automattic/calypso-build/babel/wordpress-element' ) ],
},
+ {
+ test: [ './gulpfile.babel.js', './webpack.config.js', './tools/builder/' ],
+ presets: [
+ [ require.resolve( '@automattic/calypso-build/babel/default' ), { modules: 'commonjs' } ],
+ ],
+ },
],
env: {
test: {
|
The simpler alternative is diff --git a/package.json b/package.json
index d420c8c57..1287601a8 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"install-if-deps-outdated": "yarn check 2> /dev/null || yarn install --check-files --production=false",
"distclean": "rm -rf node_modules && yarn clean",
"build": "yarn install-if-deps-outdated && yarn clean && yarn build-client && yarn build-php && yarn build-extensions",
- "build-client": "gulp",
+ "build-client": "MODULES=commonjs gulp",
"build-extensions": "webpack --config ./webpack.config.extensions.js",
"build-php": "composer install --ignore-platform-reqs",
"build-production-php": "COMPOSER_MIRROR_PATH_REPOS=1 composer install -o --no-dev --classmap-authoritative --prefer-dist", But I'm wondering if setting the env variable will cause all the code to be transpiled to CJS? (Though I'm not completely sure that that wouldn't be the case with #13854 (comment)). /cc @sirreal |
81d4757
to
6cb641c
Compare
ockham, Your synced wpcom patch D34594-code has been updated. |
1 similar comment
ockham, Your synced wpcom patch D34594-code has been updated. |
I pushed 8cf9d13, which implements the more granular (per-file) option, which I'm pretty sure should only transpile The downside is that it needs to be manually maintained, if a new config file is added; I think it's reasonable to assume that that won't happen that often. I'm pretty sure the other option (setting the |
ockham, Your synced wpcom patch D34594-code has been updated. |
|
ockham, Your synced wpcom patch D34594-code has been updated. |
d2a6fbe
to
4e102f0
Compare
ockham, Your synced wpcom patch D34594-code has been updated. |
Tested the build, it seems to work as expected, plus it fixes the node-sass build error that breaks the build flow on Node 12, for example, in the GitHub action that we currently have for Jetpack. |
This is the newer version of the plugin. Matches the calypso-build version
cfdf44b
to
a97a407
Compare
ockham, Your synced wpcom patch D34594-code has been updated. |
Rebased (since there was a conflict) 😬 |
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.
Still looks good to me. 🚢
r199225-wpcom |
Looks like |
module.exports = () => ( { | ||
plugins: { | ||
'postcss-custom-properties': { | ||
importFrom: [ require.resolve( '@automattic/calypso-color-schemes' ) ], |
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.
I think it would make sense to use @automattic/color-studio
directly here.
I don't really see Calypso colors bringing any additional value; it just has some extra Calypso specific things such as --sidebar-background
, --masterbar-toggle-drafts-editor-background
, etc...
Unless I'm missing something?
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.
Was considering that, yeah. I think we'd have to rename a few colors though, since they're aliased in @automattic/calypso-color-schemes
.
Furthermore, I think there's still some issue that prevents things from working entirely as they should, see #13854 (comment) 🤔
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.
I think we'd have to rename a few colors though, since they're aliased in
@automattic/calypso-color-schemes
.
That might not have been very clear; what I meant is that we're right now using the names as found in @automattic/calypso-color-schemes
in Jetpack (not names from @automattic/color-studio
).
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.
I don't really see Calypso colors bringing any additional value
calypso-color-schemes
brings exactly the value that the package name promises: it defines a family of color schemes like Classic Blue, Midnight or Powder Snow that can be applied to UI that uses "semantic" names like color-primary
, color-accent
or masterbar-item
.
color-studio
is a generic set of named colors (somewhat similar to RAL or Pantone).
If you want to style your UI with a color scheme that was designed to work together, then you need one of the Calypso color schemes.
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.
Thanks for clarification!
Sounds like @Automattic/jetpack-design could have final say which one they prefer to work with?
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.
I'm not entirely sure of the question. It seems a library choice question... what's the difference from a design perspective?
If it answer the question: going forward we'll use the latest color-studio
colors, which includes the new Jetpack green and a gamut of colors agreed across all A8c.
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.
@folletto I think the question is more like: does Jetpack have something like "color scheme" that is applied to the UI? And does it intend to share the default color scheme with Calypso, or does it define its own?
Color scheme defines approx 15-20 colors, all selected from the color-studio
palette, while the whole color-studio
has 170+ colors.
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.
Not explicitly. I think the code we have already there is the closest thing we have to a color scheme.
For sure, we won't use all the colors in the color-studio
, but right now there isn't a logical subset that has been extracted — again, except what's already there in code.
Changes proposed in this Pull Request:
Manual attempt at upgrading
@automattic/calypso-build
to v5, to surface potential bugs.Is this a new feature or does it add/remove features to an existing part of Jetpack?
Upgrading a build tool.
Testing instructions:
Proposed changelog entry for your changes:
Update @automattic/calypso-build to v5.
TODO
Currently fails to find PostCSS config.Fixed by Calypso Build: Fix PostCSS config path default wp-calypso#37110.Currently doesn't transpileSee comments for discussion.import
s in config files.