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

[create-block] Add npmDevDependencies as a template variable. #39723

Merged

Conversation

ryanwelcher
Copy link
Contributor

@ryanwelcher ryanwelcher commented Mar 24, 2022

What?

This PR adds a new template variable to the create-block package to allow templates to define devDependencies.

Closes #39722

Why?

Some blocks require devDependences that should not be added to regular dependencies.

How?

This is done by introducing a npmDevDependencies variable

Testing Instructions

  1. Download https://github.com/ryanwelcher/dynamic-block-template and add a npmDevDependencies entry to the index.js and add an array of dependencies
    Run ./node_modules/.bin/wp-create-block --template={pathTo}/dynamic-block-template

@ryanwelcher ryanwelcher added [Type] Enhancement A suggestion for improvement. [Tool] Create Block /packages/create-block Developer Experience Ideas about improving block and theme developer experience labels Mar 24, 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.

I haven't had a chance to test that yet. The changes proposed in the PR look great though 👍🏻

Any idea why CI jobs didn't start?

@ryanwelcher
Copy link
Contributor Author

ryanwelcher commented Mar 25, 2022

Thanks, @gziolo! Not sure about the CI either, I tried pushing another commit to restart the jobs but that did nothing.

@ryanwelcher ryanwelcher force-pushed the try/add-npm-dev-dependencies-to-template branch from 875e7ae to 99f86ed Compare March 25, 2022 15:13
Copy link
Contributor

@dgwyer dgwyer left a comment

Choose a reason for hiding this comment

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

Just updated a couple of typos.

packages/create-block/CHANGELOG.md Outdated Show resolved Hide resolved
@ryanwelcher
Copy link
Contributor Author

For posterity, I was able to get the CI job to re-run by rebasing from trunk and force-pushing the changes as per @c4rl0sbr4v0 in WP Make slack.

@gziolo gziolo merged commit 41325b9 into WordPress:trunk Mar 25, 2022
@github-actions github-actions bot added this to the Gutenberg 13.0 milestone Mar 25, 2022
@bph bph added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Apr 6, 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.

Allow devDependencies to be defined for a template
4 participants