Skip to content

Commit 1634e3c

Browse files
init.
0 parents  commit 1634e3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+23422
-0
lines changed

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Introduction
6+
7+
ModulesPress is a powerful WordPress plugin development framework that brings modern development practices to the WordPress ecosystem. Inspired by NestJS, Angular, and Laravel, it provides a robust foundation for building scalable and maintainable WordPress plugins.
8+
9+
## Why ModulesPress?
10+
11+
:::tip What makes it special?
12+
ModulesPress combines the best practices from modern frameworks while staying true to WordPress development patterns.
13+
:::
14+
15+
### Key Features
16+
17+
- 🎯 **Modern Architecture** - NestJS-inspired modular design
18+
- 🚀 **TypeScript & React** - First-class support for modern frontend
19+
- 🛠️ **PHP 8+ Attributes** - Use decorators for clean, declarative code
20+
- 📦 **Dependency Injection** - Powerful DI container for better testing
21+
- 🔒 **Type Safety** - Full TypeScript and PHP type support
22+
-**Vite Integration** - HMR and modern build tools
23+
- 🎨 **Blade Templates** - Elegant templating with Laravel's Blade
24+
- 🔄 **Hot Module Replacement** - Instant feedback during development
25+
26+
## Framework Philosophy
27+
28+
ModulesPress follows these core principles:
29+
30+
1. **Modularity First**
31+
- Everything is a module
32+
- Clear separation of concerns
33+
- Reusable components
34+
- SOLID principles
35+
36+
2. **Developer Experience**
37+
- Modern tooling
38+
- Type safety
39+
- Hot reloading
40+
41+
3. **WordPress Integration**
42+
- Seamless WordPress hooks
43+
- Native REST API support
44+
- WordPress coding standards
45+
46+
## Plugin File
47+
48+
The generated `plugin-name.php` file extends the `ModulesPressPlugin` class and is crucial for bootstrapping your plugin. It will look something like this (replace placeholders):
49+
50+
51+
```php title="my-modulespress-plugin.php"
52+
<?php
53+
/**
54+
* Plugin Name: My ModulesPress Plugin
55+
* ... other plugin header details ...
56+
*/
57+
58+
use MyPlugin\Modules\RootModule\RootModule; // Replace with your namespace
59+
use ModulesPress\Foundation\ModulesPressPlugin;
60+
61+
if (!defined('ABSPATH')) exit;
62+
63+
final class MyPlugin extends ModulesPressPlugin {
64+
public const NAME = "My ModulesPress Plugin";
65+
public const SLUG = "my-modulespress-plugin";
66+
67+
public function __construct() {
68+
parent::__construct(
69+
rootModule: RootModule::class,
70+
rootDir: __DIR__,
71+
rootFile: __FILE__
72+
);
73+
}
74+
}
75+
76+
(new MyPlugin())->bootstrap();
77+
?>
78+
```
79+
80+
:::info Live Development
81+
ModulesPress provides instant feedback during development with Vite's HMR support!
82+
:::
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Installation
2+
3+
ModulesPress is a modern PHP framework for developing WordPress plugins, inspired by the architectural patterns of NestJS. It leverages PHP 8+ attributes for decorators, offers built-in Vite integration with Hot Module Replacement (HMR), and includes a CLI tool for streamlined plugin development. This guide will walk you through creating your first ModulesPress plugin using the CLI.
4+
5+
## Prerequisites
6+
7+
Before getting started, ensure you have these tools installed:
8+
9+
- **WordPress**
10+
- A running WordPress installation (locally or on a server)
11+
12+
- **Composer**
13+
- Installed globally on your system
14+
- Used to manage the ModulesPress framework and plugin dependencies
15+
16+
- **Node.js and NPM**
17+
- Both installed globally
18+
- Required for Vite's frontend tooling
19+
20+
- **PHP 8.1+**
21+
- ModulesPress requires PHP 8.1 or later
22+
23+
- **Git**
24+
- For version control
25+
26+
## Installation
27+
28+
### 1. Install the ModulesPress CLI
29+
30+
Use Composer to install the CLI tool globally:
31+
32+
```bash
33+
composer global require modulespress/cli
34+
```
35+
36+
:::caution
37+
After installation, you may need to add the ModulesPress CLI's bin directory to your system's PATH environment variable. Consult the Composer documentation for instructions specific to your operating system.
38+
:::
39+
40+
### 2. Create a New Plugin
41+
42+
Navigate to the directory where you want to create your plugin and run:
43+
44+
```bash
45+
modulespress new
46+
```
47+
48+
The CLI will guide you through these steps:
49+
50+
#### Configuration Prompts
51+
- Plugin name
52+
- Plugin slug
53+
- Description
54+
- Author information
55+
- Additional options
56+
57+
#### Automatic Setup
58+
The CLI will automatically:
59+
- Create plugin directory structure
60+
- Install Composer dependencies
61+
- Install npm packages
62+
- Generate configuration files
63+
- Create main plugin file
64+
- Set up root module
65+
- Configure autoloading
66+
67+
### 3. Activate the Plugin
68+
69+
Once the CLI completes the setup process:
70+
71+
1. Navigate to your WordPress admin dashboard
72+
2. Go to the Plugins page
73+
3. Locate your newly created plugin
74+
4. Click "Activate" to enable it
75+
76+
## Next Steps
77+
78+
The CLI has generated a complete plugin structure. Here's what you can do next:
79+
80+
### Add Modules
81+
- Create new modules to organize your plugin's code
82+
- Separate concerns and maintain clean architecture
83+
84+
### Define Providers
85+
- Register services and dependencies
86+
- Set up dependency injection
87+
88+
### Create Controllers
89+
- Build REST API endpoints
90+
- Handle HTTP requests
91+
92+
### Develop Entities
93+
- Create custom post types
94+
- Define taxonomies
95+
- Set up database schemas
96+
97+
:::tip
98+
For detailed instructions on these features and more advanced topics, refer to the complete ModulesPress documentation.
99+
:::

0 commit comments

Comments
 (0)