-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
Add wireit build config for woo-ai plugin #43769
Conversation
Hi @retrofox, @ObliviousHarmony, @woocommerce/vortex Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
1 similar comment
Hi @retrofox, @ObliviousHarmony, @woocommerce/vortex Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
Test Results SummaryCommit SHA: 7a6795c
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
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.
LGTM but I'll leave for one of the other reviewers to approve.
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.
LGTM!
Tested the first and next builds. Also, watch mode works as expected 🚀
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 tackling this.
As an aside, it looks like I forgot to add the "ci"
configuration to the Woo AI plugin. Would you mind adding that here too and then we can also see this in action in this PR?
plugins/woo-ai/package.json
Outdated
@@ -39,9 +39,11 @@ | |||
"wireit": "0.14.3" | |||
}, | |||
"scripts": { | |||
"build": "pnpm build:admin && pnpm uglify", | |||
"build": "pnpm --if-present --workspace-concurrency=Infinity --stream --filter=\"$npm_package_name...\" '/^build:project:.*$/'", | |||
"build:admin": "wp-scripts build", |
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.
We should probably just remove this entirely.
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 sure I follow, remove the build script, or something else?
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 was highlighting the bottom build:admin
line. We should remove build:admin
and probably add the uglification step to the wireit
build command.
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 might be missing something here, but the uglify
script is defined as:
"uglify": "rm -f $npm_package_assets_js_min && for f in $npm_package_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done",
However, there's no config in the package.json
for assets.js.min
or assets.js.js
. Is this step actually doing anything the way it's configured currently? cc @retrofox
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.
Honestly since webpack
is configured here we can just remove the uglification script entirely. Not only does the current command not actually do anything this is behavior that should just be configured in webpack.config.js
if we want it.
I added a config here as well, adding linting. There seem to be several issues with the style lint though. I was going to offer to try and tackle solving those, but then I realized that the changes to the scss would have to also be reflected elsewhere, and I'm not as familiar with the code in @ObliviousHarmony can we perhaps break adding the config into a separate issue? The scope of the original PR was adding the build configuration. @retrofox would you be able to address the style linting issues in separate PR(s) so that I can add the lint config once those are resolved? |
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 perhaps break adding the config into a separate issue? The scope of the original PR was adding the build configuration
You added the configuration for linting and I think that's totally fine here. Adding support for unit tests would be a much more involved process since this plugin isn't set up with wp-env
for unit testing.
Sorry, maybe I wasn't clear. This PR is currently blocked because if I merged it there would be several failing style lint issues (see above), and therefore linting would fail whenever the entire set of jobs was returned. I was proposing stripping that out and starting a separate PR. This PR didn't originally aim to address the CI configuration. |
That's fine, do what you need to 😄 |
6985e0e
to
7a6795c
Compare
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR adds
wireit
config to@woocommerce/plugin-woo-ai
project, along with configs for both build and build watch.Closes # .
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
pnpm --filter='@woocommerce/plugin-woo-ai' build
pnpm --filter='@woocommerce/plugin-woo-ai' watch:build
Changelog entry
Significance
Type
Message
Comment
This PR only affects build tooling and no change entry is required.