wp-alchemist
v0.2.0
Published
Create WordPress plugins with Composer, namespace prefixing, REST routes, migrations, Vite, Vue and Tailwind, then generate modules, migrations, controllers and repositories inside them.
Maintainers
Readme
wp-alchemist
Create WordPress plugins that start out structured, secure and on modern tooling, then keep adding code in the same shape.
npm create wp-alchemist@latest my-pluginYou get:
- Composer with dependencies namespace-prefixed by Strauss, so two plugins using different framework versions never conflict
- Feature modules under
src/Modules/<Feature>/ - REST routes that require a permission, plus schema-driven settings that reject unknown keys
- Migrations that run on activation and updates, and roll back on uninstall
- Vite + Vue + Tailwind admin pages with hot reload inside wp-admin
- Linting: PSR-12 plus WordPress security, SQL and i18n sniffs
composer zipfor a runtime-only release
Requirements: Node 20.12+, PHP 8.1+, Composer 2. pnpm, yarn and bun work too (pnpm create wp-alchemist, …).
Generators
Inside a generated plugin (wp-alchemist is already a dev dependency):
npx wp-alchemist make:module "Link Reports" --admin --table # module, controller, Vue page, migration, repository
npx wp-alchemist make:migration add_status_to_link_reports
npx wp-alchemist make:controller LinkReports/Export
npx wp-alchemist make:repository LinkReports/Snapshot --table link_snapshotsOptions
npm create wp-alchemist@latest [directory] -- [options]
--name <name> Plugin name, e.g. "Acme Links"
--slug <slug> Folder, main file and text domain
--namespace <ns> PHP namespace
--description <text> Plugin description
--author <name> Plugin author
--package-manager <pm> npm, pnpm, yarn or bun
--no-install Only write the files
-y, --yes Accept defaults without promptingTroubleshooting
- "Missing requirements": install the listed tools, or use
--no-installand install later. composer installfails behind a proxy or firewall: the plugin is already written; fix the network issue and runcomposer installin the plugin folder.- "Do not run Composer as root" (Docker, CI): set
COMPOSER_ALLOW_SUPERUSER=1.
Docs and source: https://github.com/Rubylenshy/wp-alchemist
