@grishonnganga/create-react-wordpress-plugin
v0.1.3
Published
Plugin scaffolding for building wordpress plugins with React and TailwindCSS
Readme
create-react-wordpress-plugin
Description
Create Wordpress + React + TailwindCSS plugin starter project.
Usage
Running the Command To generate a new project, run:
npx @grishonnganga/create-react-wordpress-pluginRunning the App
After generating the project, follow these steps to run the plugin:
- Navigate to the project directory:
cd my-awesome-project- Install the dependencies
npm install- Start the plugin
npm start- Start TailwindCSS JIT compiler
npm run tailwindwatch- Build the plugin
npm run compilenbuild- Zip plugin to upload to Wordpress site
npm run zip-pluginPrompts
The command will prompt you for the following details:
- Project name: A name for the project.
- Project Title: Title of the project.
- Project description: Description of the project.
- Author name: Name of author.
- Package name: Namespace for maintaining multiple plugins.
- TailwindCSS prefix: Prefix for tailwindcss to prevent your plugin's styles from being overriden.
Example
npx @grishonnganga/create-react-wordpress-pluginPrompts:
? Project name: zodiac-signs
? Project title: Zodiac Signs
? Project description: Zodiac Signs Wordpress plugin
? Author name: John Doe
? Package name: astrology
? TailwindCSS prefix: zx-Output:
Copy code
Project zodiac-signs created successfully.The command will generate the following structure:
zodiac-signs/
├── package.json
├── postcss.config.js
├── tailwind.config.js
├── webpack.config.js
├── index.html
├── src/zodiac-signs
│ └── App.js
│ └── block.json
│ └── edit.js
│ └── index.js
│ └── input.css
│ └── render.php
│ └── view.js
