Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@automattic/newspack-blocks

Package Overview
Dependencies
Maintainers
0
Versions
358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/newspack-blocks

=== Newspack Blocks === Contributors: (this should be a list of wordpress.org userid's) Donate link: https://example.com/ Tags: comments, spam Requires at least: 4.5 Tested up to: 5.1.1 Stable tag: 0.1.0 License: GPLv2 or later License URI: https://www.gn

  • 4.3.0-epic-ras-acc.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
724
increased by11.21%
Maintainers
0
Weekly downloads
 
Created
Source

Newspack Blocks

This plugin is meant to serve as a container for most Newspack Gutenberg blocks. There may be certain blocks that relate to specific functionality in other plugins, in which case they would live with the primary functionality, but besides this exception most will live in this one.

Setup

To get set up for block development, run composer install && npm install

Generating Builds

To generate a build of the current blocks, run npm run build.

To clean out the built blocks, run npm run clean.

Developing

To work on Block development and have Webpack watch your files for changes run: npm start.

Linting

is performed on changed files before commiting. In other words, is run during pre-commit git hook, but only on staged files. The hook is configured in composer.json.

PHPJSSCSS
toolPHPCSeslintstylelint
config.phpcs.xml.dist.eslintrc.js.stylelintrc
run manuallycomposer lintnpm run lint:jsnpm run lint:scss
autofix ✨./vendor/bin/phpcbf <file>npm run lint:js -- --fixnpm run lint:scss -- --fix

Building New Blocks

To get started with a new block:

  • Duplicate one of the example block directories in src/
  • Rename the directory to the slug of your block.
  • At minimum edit index.js and change name and title definitions.
  • Add the block slug to the production array in src/setup/blocks.json
  • If the block requires server-side code add the slug to the $newspack_blocks_blocks array in newspack-blocks.php
  • Execute npm run build. If all went smoothly, you should see a Newspack category in the block picker, and your block should appear within it.

Usage

End-user documentation can be found here.

FAQs

Package last updated on 22 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc