Skip to content
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

Scripts: Use default value for process.env.WP_SRC_DIRECTORY #44367

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

loxK
Copy link
Contributor

@loxK loxK commented Sep 22, 2022

What?

Fixes this regression: #44309

Why?

See discussion here: #43917 (review)

How?

Using wp-scripts command, if is not specified, process.env.WP_SRC_DIRECTORY defaults to string 'src'. When extending the webpack.config.js directly, it should behave the same.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Sep 22, 2022
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @loxK! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@loxK loxK force-pushed the fix-wp-scripts-regression-alt branch 8 times, most recently from 370783c to bcf3b8e Compare September 22, 2022 12:07
@loxK loxK changed the title Use default value for process.env.WP_SRC_DIRECTORY. Fixes #44309. Scripts: Use default value for process.env.WP_SRC_DIRECTORY. Fixes #44309. Sep 22, 2022
@luisherranz luisherranz changed the title Scripts: Use default value for process.env.WP_SRC_DIRECTORY. Fixes #44309. Scripts: Use default value for process.env.WP_SRC_DIRECTORY Sep 23, 2022
@luisherranz luisherranz added the [Tool] WP Scripts /packages/scripts label Sep 23, 2022
Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

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

This looks about right to me. Thanks for the PR, Laurent 🙂

@gziolo, what do you think? Should we also centralize the default value defined on build.js and start.js so there's only a single place where the 'src' string is defined?

Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

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

Oh, would you please rename the function from getWebpackSrcDirectory to getWordPressSrcDirectory? Thanks!

packages/scripts/utils/config.js Outdated Show resolved Hide resolved
@loxK loxK force-pushed the fix-wp-scripts-regression-alt branch 2 times, most recently from b4e5360 to c4c2b2c Compare September 24, 2022 00:00
@loxK
Copy link
Contributor Author

loxK commented Sep 24, 2022

@gziolo, what do you think? Should we also centralize the default value defined on build.js and start.js so there's only a single place where the 'src' string is defined?

I thought about it too, but decided it was up to you.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

This looks good to go, @luisherranz is there anything I missed?

@luisherranz
Copy link
Member

@luisherranz is there anything I missed?

If you think it's good, let's merge it 🙂

@luisherranz luisherranz merged commit 189fe7f into WordPress:trunk Sep 26, 2022
@github-actions
Copy link

Congratulations on your first merged pull request, @loxK! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts:

https://profiles.wordpress.org/me/profile/edit/

And if you don't have a WordPress.org account, you can create one on this page:

https://login.wordpress.org/register

Kudos!

@github-actions github-actions bot added this to the Gutenberg 14.3 milestone Sep 26, 2022
@luisherranz
Copy link
Member

Thanks for your contribution, @loxK!

@loxK
Copy link
Contributor Author

loxK commented Sep 27, 2022

Thanks for your contribution, @loxK!

I appreciate but it is nothing compared to how useful is WordPress to me. Thank YOU guys.

@loxK loxK deleted the fix-wp-scripts-regression-alt branch September 27, 2022 21:56
@annezazu
Copy link
Contributor

@loxK wanted to follow up - did you make a WordPress.org profile? If so, can you share the link here? For example, here's mine: https://profiles.wordpress.org/annezazu/ We'd love to gives you props in the next WordPress release but need your WordPress.org username to do so.

You can follow the steps above to set it up correctly: #44367 (comment)

Thank you!

@loxK
Copy link
Contributor Author

loxK commented Oct 25, 2022

@annezazu Here you go, thanks

https://profiles.wordpress.org/dreadlox/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Tool] WP Scripts /packages/scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants