@bostonuniversity/create-block-templates

0.0.6 • Public • Published

Create Block

Home for code that will allow us to quickly and consistently create blocks.

This template provides the structure to generate a starter block. The following command will create a folder with all pertinent block files:

npx @wordpress/create-block@latest --template @bostonuniversity/create-block-templates --no-plugin

If you are using the block theme or plugin starter, you can run:

npm run new-id-block

To test locally, run:

npx @wordpress/create-block@latest --template . --no-plugin

Use

There are 2 variants: theme and plugin. The only difference is that plugin will create block-decorative.scss.

Known Issues

  • When going through the prompts, you should replace the default namespace value repo-slug with your theme or plugin slug.
  • You should manually replace the generated block.json textdomain value with your actual theme or plugin textdomain.
  • This script does not @import the block’s styles in src/blocks/blocks-bundled.scss or src/blocks/blocks-decorative.scss. This must be done manually.
  • The theme variant does not create the individual block-decorative.scss for plugins. This must be done manually.

Additional Reading

Publishing & Release Process

This package is managed through NPM. It can be found here: https://www.npmjs.com/package/@bostonuniversity/create-block-templates

This repo has an action that will run whenever a new release is created.

To learn more about how NPM is managed for BU projects, please read https://developer.bu.edu/webteam/developer/vcs/npm-javascript-packages/

NOTE: you should verify that the package JSON file includes the following to make publishing easier:

"publishConfig": {
    "access": "public"
  }

Package Sidebar

Install

npm i @bostonuniversity/create-block-templates

Weekly Downloads

0

Version

0.0.6

License

GPL-2.0-or-later

Unpacked Size

11.2 kB

Total Files

14

Last publish

Collaborators

  • buweb
  • jdub233
  • dannycrews
  • rfera213
  • smtierneybu
  • timkingbuedu
  • hirozed
  • acketon