amnestywebsite / humanity-theme

The Amnesty International WordPress Humanity Theme
https://wordpresstheme.amnesty.org/
Other
38 stars 10 forks source link

Scaffold new block directory structure and build process #441

Open jaymcp opened 1 month ago

jaymcp commented 1 month ago

We are migrating our custom blocks to v3 of the Block API to better support modern WordPress features.

To make block management easier, we should migrate away from our custom Webpack build process, and adopt wp-scripts.

To minimise the amount of configuration required, and to future-proof our blocks, we should adopt the default directory structure.

Currently, our blocks have code in several places:

This is unwieldy, and makes block management frustrating. The new directory structure is greatly simplified:

Each block should have its own directory within source/blocks, and should contain the following files (where applicable):