WordPress integration development
Info
This section of the docs covers developing the Comet Components suite of WordPress plugins (Comet Plugin, Comet Calendar) themselves.
For guidance on implementing Comet Components in your own plugins and themes, see the Custom Plugins and Themes page.
Prerequisites
- Composer installed on your machine
- Local WordPress installation to use for testing
- Local dev setup for the Comet Components project as a whole
- The Comet Components monorepo cloned to your local machine and open in your IDE.
Warning
Make sure any PhpStorm file watchers you have for your WordPress site are scoped to your own plugin and theme. If you leave them scoped to the entire project, they'll try to compile the various Comet packages' assets, which you don't need it to do
and won't work because of file path differences.
Setup
Tips
My WordPress Canvas project provides a good starting point for setting up a WordPress site for developing and testing Comet Components and other Double-E Design plugins.
To use your local copy of Comet Components packages in your dev site instead of the published versions that Composer will install by default, use symbolic links (symlinks). This is a two-step process:
In the
comet-componentsproject directory, refresh all dependencies with:pnpm run refresh:all:devThe
:devversion of the refresh script usescomposer.local.jsonwhere available, which should be configured to symlink local package usages (e.g., thecomet-plugin-blockspackage's installation ofcomet-components-core).In your WordPress site, add a modified version of the suggested Composer configuration that symlinks to your local copy of the theme and plugins. Refer to my WordPress Canvas repo's
composer.jsonfile for an example of how to do this.Optionally, you can save this as
composer.local.jsonand run install/update commands with:$env:COMPOSER = "composer.local.json"; composer update --prefer-source
Development
- Please see the Comet Blocks Plugin README for the latest information about plugin architecture and development guidance.
