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

wp-now: Remove unnecessary nvm calls #454

Closed
wants to merge 1 commit into from

Conversation

wojtekn
Copy link
Collaborator

@wojtekn wojtekn commented May 26, 2023

What?

In this diff, I propose to remove unnecessary nvm calls from the script that allows running wp-now for development purposes
globally.

Why?

  • remove dependency on nvm from the code
  • ensure that the script located in bin/ doesn't make changes on the machine when it runs

Related ticket: WordPress/playground-tools#7

How?

I removed the affected code. We still recommend running nvm use in contribution docs, but the user can skip that if wanted to manage node versions in another way.

Testing Instructions

  1. Link wp-now in development mode
  2. Ensure wp-now still works when used globally from the plugin/theme or other project root
Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

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

❤️

Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

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

❤️

export NVM_DIR=$HOME/.nvm;
source $NVM_DIR/nvm.sh;
nvm use

Copy link
Member

Choose a reason for hiding this comment

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

Do we need to have a node version check? What happens if your default node version is insufficient?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we need to have a node version check?

I consider this bin script as a wrapper, a helper that allows running commands similarly to when installed via npm. I wouldn't add any validation logic here, then.

What happens if your default node version is insufficient?

In such a case, I would expect behavior to be the same as for a user who runs npx nx preview wp-now without a wrapper.

Copy link
Collaborator

@adamziel adamziel May 30, 2023

Choose a reason for hiding this comment

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

+1 for removing nvm dependency – it prevents people don't use nvm from running this script even if they still have the required Node.js version. @luisherranz expects that to be the case at his WCEU workshop

@wojtekn
Copy link
Collaborator Author

wojtekn commented Jun 1, 2023

Closing in favor of WordPress/playground-tools#44

@wojtekn wojtekn closed this Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants