WebDevStudios / wds-block-starter

A block starter for projects.
15 stars 3 forks source link

Plugin Scaffolding Automation #24

Closed michealengland closed 4 years ago

michealengland commented 4 years ago

Similar to https://www.npmjs.com/package/@wordpress/create-block, it would incredibly helpful is users did not have to manually scaffold the WDS Block Starter plugin when starting a new project.

Guidelines

donmhico commented 4 years ago

Update

We have a scaffolding command available now. You can use the command

npm init @donmhico/wds-block <Namespace>/<BlockName>

<Namespace> is a placeholder for the Namespace. <BlockName> for the block name.

An actual example is

npm init @donmhico/wds-block WebDevStudios/SampleBlock

Note If you are having problems with it, try to use the latest version of npm and node.

TODO

  1. Better documentation.
  2. When we are in a point of stable release, maybe we can transfer the GitHub repo to WDS and create a company org in npmjs.org so the command will be npm init @webdevstudios/wds-block instead of my name.

Links https://www.npmjs.com/package/@donmhico/create-wds-block https://github.com/donmhico/create-wds-block

donmhico commented 4 years ago

Update

The first version of the scaffolding command is now available: https://github.com/WebDevStudios/create-block https://www.npmjs.com/package/@webdevstudios/create-block

You can scaffold a block using the command npm init @webdevstudios/block WebDevStudios/SampleBlock

At the moment, i'm re-creating the scaffolding package from scratch. I had a discussion with @salcode and @michealengland that the current way that the scaffolding package fetches the actual Block Starter files from this repo isn't ideal. This is because the current scaffolding package has the Block Starter files as templates, so when the WDS Block Starter files updates, the scaffolding package also needs to be updated.

The ideal solution is to have the scaffolding package fetch the WDS Block Starter files from this repo on-demand. I'm currently in the process of creating this. I'll provide updates as soon as possible.

gregrickaby commented 4 years ago

This can be closed. Check out our block starter with:

npx @webdevstudios/block YourName/YourBlock