greenpeace / planet4-gpnl-plugin-gutenberg-blocks
This repository contains the WordPress plugin that provides the gutenberg blocks for Planet4 project
Installs: 1 180
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 10
Forks: 0
Language:JavaScript
Type:wordpress-plugin
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^v0.7.1
- phpmd/phpmd: ^2.9.1
- phpunit/phpunit: ^9.3.6
- squizlabs/php_codesniffer: ^3.5.8
- stevegrunwell/phpunit-markup-assertions: ^1.2
- wp-coding-standards/wpcs: ^2.3.0
- dev-develop
- v2.12.1
- v2.12.0
- v2.11.1
- v2.11.0
- v2.10.0
- v2.9.1
- v2.9.0
- v2.8.0
- v2.7.0
- v2.6.0
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.0
- 2.2.0
- 2.1.0
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.11
- 1.6.10
- 1.6.9
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.2
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- 0.0.1
- dev-dependabot/npm_and_yarn/cacheable-request-and-wordpress/scripts--removed
- dev-dependabot/npm_and_yarn/http-cache-semantics-4.1.1
- dev-dependabot/npm_and_yarn/json5-1.0.2
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-master
- dev-dependabot/npm_and_yarn/jsdom-and-wordpress/scripts-16.7.0
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-dependabot/npm_and_yarn/got-and-wordpress/scripts--removed
- dev-dependabot/npm_and_yarn/scss-tokenizer-and-node-sass-0.4.3
- dev-dependabot/npm_and_yarn/moment-timezone-0.5.37
- dev-dependabot/npm_and_yarn/terser-4.8.1
- dev-dependabot/npm_and_yarn/nanoid-3.3.4
- dev-dependabot/npm_and_yarn/postcss-8.2.13
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/minimist-1.2.6
- dev-dependabot/npm_and_yarn/shelljs-0.8.5
- dev-dependabot/npm_and_yarn/trim-off-newlines-1.0.3
- dev-dependabot/npm_and_yarn/tmpl-1.0.5
- dev-feature/simplify-webpack
- dev-feature/change-block-categories
- dev-feature/integrated_ab_tests
- dev-snyk-upgrade-7b03b128b76db22afb75ff6bc43877df
- dev-snyk-upgrade-6dde30f9a2fbdd02c35fcac6bec14da7
- dev-snyk-upgrade-f61357e03dbb33b30f9bbd92ac85eb10
This package is auto-updated.
Last update: 2024-11-12 16:23:16 UTC
README
! WorkInProgress
Contents
Introduction
This WordPress plugin provides the necessary blocks to be used with Gutenberg with Twig.
Composer
We use composer as dependency manager for the this plugin. To install dependencies run
$ composer install
Code standards
We follow the WordPress Coding Standards
We use a custom php codesniffer ruleset which adds some rules over WordPress-Core, WordPress-Docs and WordPress-Extra rulesets.
WordPress Coding Standards Rulesets
WordPress Coding Standards Wiki
To run the php codesniffer
$ vendor/bin/phpcs
or
$ composer sniffs
To run the php code beautifier and fixer
$ vendor/bin/phpcbf
or
$ composer fixes
Contribute
Please read the Contribution Guidelines for Planet4.
Commit guidelines
Included is a githook (commit-msg) which is run to ensure standardized commit messages. Conventional commits is used as the convention.
In short:
[optional 'maintenance' type][type]([optional scope])[breaking change]: [description]
[optional body]
The following commits correlate to SemVer version changes.
Build process
Development
To watch the files run yarn start
.
Build for production
To build files for production run yarn build
.
Browserslist
All source code gets transpiled according to our actual usage data. To make sure we don't support too old browsers, the usage data should be refreshed every once in a while (once-twice a year).
Generating the usage data can be done using browserslist-ga-export
Linting
Linters for both CSS and JS are available both for linting and fixing.
yarn lint
yarn lint:fix
for both CSS and JS
yarn lint:[css/js]
for either CSS or JS
yarn lint:[css/js]:fix
for either CSS or JS
Release preparation
Release steps are largely automated, this includes: changing branching to loosely follow gitflow, generating assets generating changelogs and tagging the new release. Only (purposely) manual step left is pushing the branches and tags to remote.
Changelogs are autogenerated by standard-version
if the commit guidelines are followed.
yarn release
for running releases
yarn dryrelease
for checking what the impact of a release is.
CircleCI is used as the CI automation. Steps for releasing new versions are in the Planet4 Documentation
Dependencies
Adding external dependencies for a block can be done by enqueueing an asset and enqueueing external assets like so:
$external_assets = [
[
'handle' => 'swiper',
'src' => 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.1/css/swiper.css',
'type' => 'style'
],
[
'handle' => 'swiper',
'src' => 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.1/js/swiper.js',
'type' => 'script'
]
];
Asset_Enqueuer::enqueue_external_asset( $external_assets );
asd