npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wp-block-builder

v0.12.1

Published

A foundation for WordPress Gutenberg blocks plugin development that aims to provide clear and concise guide for building your first block plugin.

Downloads

14

Readme

WordPress Gutenberg Block Plugin Builder

A foundation for WordPress Gutenberg blocks plugin development that aims to provide clear and concise guide for building your first block plugin.

Table of contents

Installation

WP Block Builder is available through npm. Run this command inside wp-content/plugins folder to start the installation.

$ npx wp-block-builder

↑ Go up to Table of contents

Setup

Series of questions will automatically be asked via CLI with regards to plugin information such as folder and plugin name, etc.

? The block slug used for identification (also the plugin and output folder name):
? The internal namespace for the block name (something unique for your products):
? The display title for your block:
? The short description for your block (optional):
? The name of the plugin author (optional). Multiple authors may be listed using commas:
? The short name of the plugin’s license (optional):
? The current version number of the plugin:

↑ Go up to Table of contents

Development

All the required npm and composer packages will be automatically installed after the setup questions. This WordPress blocks plugin configuration is the one I've been using and it battle-tested. This config comes with:

📦 Multiple Gutenberg blocks sample

  • Posts List: a dynamic gutenberg block that displays configurable number of posts with title, featured image, post meta and excerpt. This block provides extensive code resources when it comes to building dynamic gutenberg block.
  • Custom Container: regular sample block using InnerBlocks. This block will let you follow the usage of inner blocks and custom color supports.

👨‍💻 PostCSS ready

  • easily add both editor and frontend styling via configured wp-scripts. Both sample blocks are showing how to include the .scss files which will automagically be generated on the builds folder.

🇵🇭 Translation ready

  • languages folder will automatically be generated on npm build or npm makepot. Both .php and .js files will be included on the translation process.

✅ ESLint, Stylint and Prettier configurations

  • WordPress standards for CSS and JS formatting are included with auto fixing configuration via npm run lint:js-fix or npm run lint:css-fix.

🔃 Browser-sync live reload

  • Live reloading is also available with configurable local.json file to easily add your WordPress website link.
{ "devURL": "http://icebergtest.local/wp-admin/post.php?post=5617&action=edit" }

📃 PHP file WordPress coding standards

  • WordPress coding standards check for .php files is also configure via composer. Just run composer run format to check which one needs changing.

⚙️ WebPack configurations

  • webpack.config.js is available for you to easily extend it with your own configs.

↑ Go up to Table of contents

Available Commands

Inside that bootstrapped directory (it doesn't apply to es5 template), you can run several commands:

$ npm start

Starts the build for development. Learn more.

$ npm run build

Builds the code for production. Learn more.

$ npm run format:js

Formats JavaScript files. Learn more.

$ npm run lint:css

Lints CSS files. Learn more.

$ npm run lint:css-fix

Check and auto apply Stylelint fixes on CSS files. Learn more.

$ npm run lint:js

Lints JavaScript files. Learn more.

$ npm run lint:js-fix

Check and auto apply ESlint fixes on JS files. Learn more.

$ npm run makepot

Generate language translations for PHP and JS files.

$ npm run packages-update

Updates WordPress packages to the latest version. Learn more.

↑ Go up to Table of contents

Contribute

Your contributions and support tickets are welcome. Please see our guidelines before submitting a pull request.

Credits