@bennyhudson/wp-generator
v1.0.4
Published
Wordpress CMS generator
Maintainers
Readme
wp-generator
Simple node script for creating a headless WordPress back end using the wedo.digital Headless WordPress Starter repo.
Prerequisites
In order to correctly run this package, you will need to have wp-cli and mySql installed on your machine.
You also need the GitHub CLI (gh) installed and authenticated so the generator can create and clone template repositories. Install it from https://cli.github.com/ and run gh auth login to connect your account.
Installation
You can install the package globally using npm:
npm install -g @bennyhudson/wp-generatorOr using yarn:
yarn global add @bennyhudson/wp-generatorUsage
Once installed globally, you can run the generator from anywhere using:
generate-wp-cmsThe generator will prompt you for:
- Project directory location
- Project name
- WordPress admin username
- WordPress admin password
- WordPress admin email
- ACF Pro license key (optional)
Environment Variables
You can set up default values using a .env.local file in the directory where you run the command. For example:
- If you want to use the generator in your projects directory:
cd ~/projects
touch .env.local- Add your ACF Pro license to the
.env.localfile:
ACF_PRO_LICENCE=your_acf_pro_license_keyThe generator will look for the .env.local file in the current working directory when you run generate-wp-cms.
Development
To work on the package locally:
- Clone the repository
git clone https://github.com/BennyHudson/wp-generator.git
cd wp-generator- Install dependencies
yarn install- Run locally
yarn generate