alleyinteractive / alley-scripts

A collection of scripts and utilities for Alley projects.
https://alley-scripts.alley.dev/
6 stars 1 forks source link

Enhancement: Update `create-block` templates to scaffold optional view script #603

Closed stevenslack closed 8 months ago

stevenslack commented 8 months ago

Summary

The wp-create-block script from @wordpress/create-block will scaffold a viewScript by default. This may not be necessary as many blocks do not require a view script. The result is that a stale file is scaffolded and enqueued when the developer creates a block. This may require the developer to manually remove the stale file and the block.json viewScript definition.

This change introduces a prompt allowing the developer to opt-in to including a viewScript block type definition and will scaffold with the scaffolded block by prompting the developer during the Alley create-block process.

Related Issue: #602

Changes

Test Steps

Additional Notes

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: 71a8c3c353e698478cbc493c88931fedd06015d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------------ | ----- | | @alleyinteractive/create-block | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR