diff --git a/CHANGELOG.md b/CHANGELOG.md index 80fe79d..9a7a249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.8 + +- Update README docs. + ## 1.0.7 - Provide graceful fallback for `.gitignore` in repo. diff --git a/README.md b/README.md index c65abc0..744ef02 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ A CLI tool for sculpting WP plugins quickly. ## Why Sculpt? -Sculpt is a simple, but powerful CLI tool for building enterprise WP plugins very quickly. It uses simple commands to create standard WP features such as `Posts`, `Taxonomies`, `Meta`, `Assets`, `Services` and so much more. In this way, you can focus more on the business logic of your WordPress plugin than spending time trying to write classes from scratch. +Sculpt is a simple, but powerful CLI tool for building WP plugins very quickly. It uses simple commands to create standard WP features such as `Posts`, `Taxonomies`, `Meta`, `Assets`, `Services` and so much more. In this way, you can focus more on the business logic of your WordPress plugin than spending time trying to write boilerplate code from scratch. -If you are a fan of Laravel and how it presents an Object-Oriented approach to building clean, robust and scalabale PHP applications using the `artisan make` commands, then you would definitely love **Sculpt**. +If you are a fan of __Laravel__ and how it presents an Object-Oriented approach to building clean, robust and scalabale PHP applications using the `artisan make` commands, then you would definitely love __Sculpt__. ## Getting Started @@ -64,17 +64,28 @@ sculpt post This will ultimately prompt you for a list of values related to your custom post type like so: -sculpt-post +```bash +sculpt-cli v1.0.0 by badasswp +A CLI tool for sculpting WP plugins quickly. + +Custom Post Type: Employee +Singular Label: Employee +Plural Label: Employees +Show in REST: true +Show in Menu: true + +New Custom post type created: Employee +``` --- Once you're done providing those values, your new custom post type would be implemented automatically and wired up correctly to the appropriate WP hooks, ready for use! -sculpt-vscode-post +sculpt-post #### Behind the Scenes -Sculpt will attempt to create a custom post type **concrete** class for you based on the values you have provided as well as the following classes: +Sculpt will attempt to create a custom post type class for you based on the values you have provided as well as the following classes: - Post Abstraction - Post Service @@ -95,17 +106,28 @@ sculpt taxonomy This will ultimately prompt you for a list of values related to your custom taxonomy like so: -sculpt-plugin +```bash +sculpt-cli v1.0.0 by badasswp +A CLI tool for sculpting WP plugins quickly. + +Custom Taxonomy: Country +Singular Label: Country +Plural Label: Countries +Slug: employee_country +Post type it belongs to: Employee + +New Taxonomy created: Country +``` --- Once you're done providing those values, your new custom taxonomy would be implemented automatically and wired up correctly to the appropriate WP hooks. -sculpt-vscode-taxonomy +sculpt-taxonomy #### Behind the Scenes -Sculpt will attempt to create a custom taxonomy **concrete** class for you based on the values you have provided as well as the following classes: +Sculpt will attempt to create a custom taxonomy class for you based on the values you have provided as well as the following classes: - Taxonomy Abstraction - Taxonomy Service @@ -114,6 +136,108 @@ The Taxonomy abstraction would take care of most of the heavy lifting for your c The Taxonomy service would take of binding the custom taxonomy's logic to the necessary WP hooks at run time. +### Creating A Service + +Sculpt provides users a way of implementing a service. A service is essentially a high-level point where we bind our logic to WP core hooks. You can achieve this like so: + +```bash +sculpt service +``` + +This will prompt you for a list of values like so: + +```bash +sculpt-cli v1.0.0 by badasswp +A CLI tool for sculpting WP plugins quickly. + +Service Name: LoadImages + +New Service created: LoadImages +``` + +--- + +Once you're done providing those values, your new service would be implemented & wired up to load from the Container factory. + +sculpt-service + +#### Behind the Scenes + +Sculpt will attempt to create a **service** class for you and load it into the Container factory. + +### Creating An Asset. + +An asset class is where we load JavaScript code for our plugin. Sculpt provides an easy way of doing this like so: + +```bash +sculpt asset +``` + +This will prompt you for a list of values like so: + +```bash +sculpt-cli v1.0.0 by badasswp +A CLI tool for sculpting WP plugins quickly. + +Asset Name: Podcast + +New Asset created: Podcast +``` + +--- + +Once you're done providing those values, your new asset class would be implemented automatically and wired up correctly to the appropriate WP hooks. + +sculpt-asset + +#### Behind the Scenes + +Sculpt will attempt to create an **asset** class for you based on the values you have provided as well as the following classes: + +- Asset Abstraction +- Asset Service + +The Asset abstraction would handle all of the loading of the various scripts and correctly binding them to WP's hooks. + +The Asset service would handle the registration of the various asset classes. + +### Creating A Meta. + +A meta class handles meta data registration for post types. Again, Sculpt provides an easy way of doing this like so: + +```bash +sculpt meta +``` + +This will prompt you for a list of values like so: + +```bash +sculpt-cli v1.0.0 by badasswp +A CLI tool for sculpting WP plugins quickly. + +Meta name: EmployeeMeta +Post type it belongs to: employee + +New Meta created: EmployeeMeta +``` + +--- + +Once you're done providing those values, your new meta class would be implemented automatically and provide you options of adding in meta data. + +sculpt-meta + +#### Behind the Scenes + +Sculpt will attempt to create a **meta** class for you based on the values you have provided as well as the following classes: + +- Meta Abstraction +- Meta Service + +The Meta abstraction would handle the registration of the various meta data. + +The Meta service would handle the registration of the various meta classes. + ## Design Methodology Sculpt uses a design pattern we call **FASI (Factory-Singleton)**. This design pattern is made up of two parts: The **factory** which holds the services to be instantiated, and the **singletons** which are the services themselves. diff --git a/package.json b/package.json index 75fb4d1..47e47f6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@badasswp/sculpt-cli", "description": "A CLI tool for sculpting WP plugins quickly.", - "version": "1.0.7", + "version": "1.0.8", "license": "MIT", "type": "module", "main": "index.js",