Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 1.74 KB

DEVELOPMENT.md

File metadata and controls

77 lines (55 loc) · 1.74 KB

merpress

Merpress is a WordPress plugin for creating diagrams and visualizations using MermaidJS.

Setup

Composer is only used to run phpcs for linting and formatting.

pnpm install && composer install

Development

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.

Linting

pnpm lint

Formatting

pnpm wp-scripts format <filename>

Get a new mermaid drop

  1. pnpm update -L
  2. composer update
  3. Build a new version of mermaid (change to the mermaid git repo directory)
    1. Change the tag to the version you want: e.g. git fetch origin [email protected] --depth 1
    2. git checkout -b [email protected] FETCH_HEAD
    3. pnpm i
    4. pnpm run -r clean
    5. pnpm run build:mermaid
    6. cp packages/mermaid/dist/mermaid.{,min.}js* $MERPRESS_DIR/public/
  4. Update versions (bin/update-versions.sh), rebuild (pnpm build), test, commit, create PR.

Setting a new version

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.4 11.2.1
# need to build again
pnpm build

Creating a release

pnpm wp-scripts plugin-zip

Using playground

Quickly launch a development environment after you have built the plugin using:

npx @wp-now/wp-now start