MerPress is a WordPress plugin for creating diagrams and visualizations using MermaidJS.
Composer is only used to run phpcs
for linting and formatting.
pnpm install && composer install
Development now uses WordPress blocks best practices (i.e. '@wordpress/scripts' to generate the javascript). Create the production javascript with:
pnpm build
If you want to work with development, use the watch
script (e.g. pnpm watch
). And it's suggested that you run pnpm husky install
in order to add a
linting check before committing.
pnpm lint
pnpm wp-scripts format <filename>
pnpm update -L
composer update
- Build a new version of mermaid (change to the mermaid git repo directory)
- Change the tag to the version you want: e.g.
git fetch origin [email protected] --depth 1
git checkout -b [email protected] FETCH_HEAD
pnpm i
pnpm run -r clean
pnpm run build:mermaid
cp packages/mermaid/dist/mermaid.{,min.}js* $MERPRESS_DIR/public/
- Change the tag to the version you want: e.g.
- Update versions (
bin/update-versions.sh
), rebuild (pnpm build
), test, commit, create PR. (Check if the WordPress version or other README values should be updated.)
Use the included script bin/update-versions.sh
to roll the version numbers. It
takes 1 positional parameter (the new plugin version) and an optional one
(mermaid version).
# Update this plugin
./bin/update-versions.sh 1.1.7 11.4.1
# need to build again
pnpm build
pnpm wp-scripts plugin-zip
Quickly launch a development environment after you have built the plugin using:
npx @wp-now/wp-now start