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

Adding the "env" script when --wp-env or wpEnv is present. #38530

Merged

Conversation

ryanwelcher
Copy link
Contributor

@ryanwelcher ryanwelcher commented Feb 4, 2022

Description

As discussed in #25188 (comment), when the --wp-env flag is passed or thewpEnv is added to a template, there is no accompanying script added to the package. json.

Testing Instructions

Test locally using:

  • ./node_modules/.bin/wp-create-block --wp-env to test the flag
  • ./node_modules/.bin/wp-create-block --template=@ryanwelcher/dynamic-block-template to test a template using wpEnv
  • ./node_modules/.bin/wp-create-block to ensure that no additional scripts are added.

Types of changes

New feature. Adds "env": "wp-env" to the package.json

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@ryanwelcher ryanwelcher added [Tool] Create Block /packages/create-block Developer Experience Ideas about improving block and theme developer experience labels Feb 4, 2022
@ryanwelcher ryanwelcher changed the title Adding the env script when --wp-env wpEnv is used. Adding the "env" script when --wp-env or wpEnv is present. Feb 4, 2022
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.

Nice idea. It brings more consistency 👍🏻

Would you mind listing it in the CHANGELOG of the package?

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
@gziolo gziolo added the [Type] Enhancement A suggestion for improvement. label Feb 4, 2022
@ryanwelcher ryanwelcher merged commit e9f8e41 into WordPress:trunk Feb 4, 2022
@github-actions github-actions bot added this to the Gutenberg 12.6 milestone Feb 4, 2022
@ryanwelcher ryanwelcher deleted the try/adding-script-when-env-is-added branch February 4, 2022 17:40
@bph bph added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience Needs Dev Note Requires a developer note for a major WordPress release cycle [Tool] Create Block /packages/create-block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants