Skip to content

Commit 67014ed

Browse files
committed
feat: update for new plugify
1 parent c9c15ae commit 67014ed

File tree

92 files changed

+2607
-1859
lines changed

Some content is hidden

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

92 files changed

+2607
-1859
lines changed

content/1.introduction/4.architecture.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ description: How it works under the hood (high-level explanation).
44
icon: lucide:layers
55
---
66

7+
# Version 2.#.#
8+
9+
## TODO
10+
11+
# Version 1.#.#
12+
713
The core architecture of Plugify is designed to facilitate seamless interaction between language modules, each implemented as a separate C++ library. As a result, the core does not communicate directly with plugins; instead, all interactions occur through these language modules. Likewise, plugins do not directly interact with the core but rely on language modules for communication. This modular design even extends to the C++ language itself, requiring a dedicated language module for handling C++-based plugins. The primary objective of the Plugify project is to establish a universal environment that enables fast and efficient inter-language interaction.
814

915
## Core Components of Plugify

content/1.introduction/5.faq.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ To create a new language module:
9292
9393
1. Implement the `ILanguageModule` interface provided by Plugify.
9494
2. Compile the module with the same C++ version and compiler as the Plugify core.
95-
3. Place the compiled module in the `res/modules` folder.
95+
3. Place the compiled module in the `res/extensions` folder.
9696
4. Update the `plugify.pconfig` file to include the new module.
9797
9898
Refer to the [Language Module Development Guide](/developer-guide) for detailed instructions.
@@ -125,10 +125,10 @@ Manifest files are JSON configuration files used by Plugify to define metadata a
125125
```json
126126
{
127127
"$schema": "https://raw.githubusercontent.com/untrustedmodders/plugify/refs/heads/main/schemas/plugin.schema.json",
128-
"friendlyName": "my-plugin",
128+
"name": "my_plugin",
129129
"version": "1.0.0",
130130
"dependencies": [],
131-
"entryPoint": "bin/plugin_name"
131+
"entry": "bin/plugin_name"
132132
}
133133
```
134134
@@ -139,7 +139,7 @@ Manifest files are JSON configuration files used by Plugify to define metadata a
139139
```json
140140
{
141141
"$schema": "https://raw.githubusercontent.com/untrustedmodders/plugify/refs/heads/main/schemas/module.schema.json",
142-
"friendlyName": "cpp-module",
142+
"name": "cpp_module",
143143
"version": "1.0.0",
144144
"language": "cpp"
145145
}

content/1.introduction/6.requirements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Plugify requires a C++20-compatible compiler. The following compilers are suppor
4343
Plugify has the following dependencies:
4444

4545
1. **Core Dependencies**:
46-
- [CURL](https://curl.se/): For remote package management (optional, can be disabled).
47-
- [miniz](https://github.com/richgel999/miniz): For handling ZIP archives.
46+
- [asmjit](https://github.com/asmjit/asmjit): For runtime code generation.
47+
- [libsolv](https://github.com/openSUSE/libsolv): For effective dependency resolution.
4848
- [glaze](https://github.com/stephenberry/glaze): For JSON parsing and validation.
4949

5050
2. **Language Module Dependencies**:

content/2.essentials/1.installation.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ The `plug` app allows you to test plugins and language modules locally. Follow t
6666
```
6767
2. Inside the `res` folder, create two subfolders:
6868
```
69-
mkdir ../res/plugins
70-
mkdir ../res/modules
69+
mkdir ../res/extensions
7170
```
72-
3. Place your plugins in the `plugins` folder and language modules in the `modules` folder.
71+
3. Place your plugins in the `extensions` folder and language modules in the `extensions` folder.
7372

7473
### Configure `plugify.pconfig`
7574
The `plug` app requires a configuration file named `plugify.pconfig` in the working directory. This file specifies the path to the `res` folder and other settings.

content/2.essentials/3.building.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,11 @@ mkdir ../res
336336
```
337337
2. Inside the `res` folder, create two subfolders:
338338
```
339-
mkdir ../res/plugins
340-
mkdir ../res/modules
339+
mkdir ../res/extensions
341340
```
342341
3. Copy the built plugins and language modules to the `res` folder:
343-
- Place `cross_call_worker` and `cross_call_master` in `res/plugins/`.
344-
- Place the language modules (e.g., `cpp-module`, `python-module`) in `res/modules/`.
342+
- Place `cross_call_worker` and `cross_call_master` in `res/extensions/`.
343+
- Place the language modules (e.g., `cpp-module`, `python-module`) in `res/extensions/`.
345344
346345
#### Run the Tests
347346
1. Navigate to the `build` directory and run the `plug` app:

content/2.essentials/5.configuration.md

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -35,41 +35,33 @@ The `.pplugin` file defines the configuration for a specific plugin. Below is an
3535
::code-group
3636
```json [*.pplugin]
3737
{
38-
"fileVersion": 1,
3938
"version": "1.0.0",
40-
"friendlyName": "Sample Plugin",
39+
"name": "sample_plugin",
4140
"description": "This is a sample plugin.",
42-
"createdBy": "untrustedmodders",
43-
"createdByURL": "https://github.com/untrustedmodders/",
44-
"docsURL": "https://github.com/untrustedmodders/sample_plugin",
45-
"downloadURL": "https://github.com/untrustedmodders/sample_plugin/releases/download/v1.0/sample_plugin.zip",
46-
"updateURL": "https://raw.githubusercontent.com/untrustedmodders/sample_plugin/main/sample_plugin.json",
47-
"entryPoint": "bin/sample_plugin",
48-
"supportedPlatforms": [],
49-
"languageModule": {
50-
"name": "cpp"
51-
},
41+
"author": "untrustedmodders",
42+
"website": "https://github.com/untrustedmodders/",
43+
"license": "MIT",
44+
"entry": "bin/sample_plugin",
45+
"platforms": [],
46+
"language": "cpp",
5247
"dependencies": [],
53-
"exportedMethods": []
48+
"methods": []
5449
}
5550
```
5651
::
5752

5853
#### Configuration Options:
59-
- **`fileVersion`**: The version number of the configuration file format.
6054
- **`version`**: The semantic version of the plugin.
61-
- **`friendlyName`**: A user-friendly name for the plugin.
55+
- **`name`**: An alias name for the plugin.
6256
- **`description`**: A brief description or overview of the plugin.
63-
- **`createdBy`**: The creator or author of the plugin.
64-
- **`createdByURL`**: The URL linking to the creator's profile or information.
65-
- **`docsURL`**: The URL linking to the documentation for the plugin.
66-
- **`downloadURL`**: The URL for downloading the plugin, typically a release package or ZIP file.
67-
- **`updateURL`**: The URL for checking and fetching updates for the plugin.
68-
- **`entryPoint`**: The entry point or main executable for the plugin, specified as `bin/sample_plugin`. (Depends on the language module.)
69-
- **`supportedPlatforms`**: An array listing the platforms supported by the plugin. (Currently empty in this example.)
70-
- **`languageModule`**: Information about the programming language module used. In this case, it's specified as `"cpp"` (C++).
57+
- **`author`**: The creator or author of the plugin.
58+
- **`website`**: The URL linking to the creator's profile or information.
59+
- **`license`**: The license for the plugin.
60+
- **`entry`**: The entry point or main executable for the plugin, specified as `bin/sample_plugin`. (Depends on the language module.)
61+
- **`platforms`**: An array listing the platforms supported by the plugin. (Currently empty in this example.)
62+
- **`language`**: Information about the programming language module used. In this case, it's specified as `"cpp"` (C++).
7163
- **`dependencies`**: A list of plugin references specifying the dependencies required for the plugin. This field is crucial for topological sorting to load plugins in the correct order of initialization.
72-
- **`exportedMethods`**: An array describing functions/methods exposed by the plugin.
64+
- **`methods`**: An array describing functions/methods exposed by the plugin.
7365

7466
### Module Manifest
7567

@@ -78,35 +70,27 @@ The `.pmodule` file defines the configuration for a language module. Below is an
7870
::code-group
7971
```json [*.pmodule]
8072
{
81-
"fileVersion": 1,
8273
"version": "1.0.0",
83-
"friendlyName": "C++ language module",
74+
"name": "cpp_module",
8475
"language": "cpp",
8576
"description": "Adds support for C++ plugins",
86-
"createdBy": "untrustedmodders",
87-
"createdByURL": "https://github.com/untrustedmodders/",
88-
"docsURL": "https://github.com/untrustedmodders/cpp-lang-module/README.md",
89-
"downloadURL": "https://github.com/untrustedmodders/cpp-lang-module/releases/download/v1.0/cpp-lang-module.zip",
90-
"updateURL": "https://raw.githubusercontent.com/untrustedmodders/cpp-lang-module/main/cpp-lang-module.json",
91-
"supportedPlatforms": [],
92-
"forceLoad": false
77+
"author": "untrustedmodders",
78+
"website": "https://github.com/untrustedmodders/",
79+
"license": "MIT",
80+
"platforms": []
9381
}
9482
```
9583
::
9684

9785
#### Configuration Options:
98-
- **`fileVersion`**: The version number of the configuration file format.
9986
- **`version`**: The semantic version of the language module.
100-
- **`friendlyName`**: A user-friendly name for the language module.
87+
- **`name`**: An alias name for the language module.
10188
- **`language`**: The programming language supported by this module (e.g., `"cpp"` for C++).
10289
- **`description`**: A brief description or overview of the language module.
103-
- **`createdBy`**: The creator or author of the language module.
104-
- **`createdByURL`**: The URL linking to the creator's profile or information.
105-
- **`docsURL`**: The URL linking to the documentation for the language module.
106-
- **`downloadURL`**: The URL for downloading the language module, typically a release package or ZIP file.
107-
- **`updateURL`**: The URL for checking and fetching updates for the language module.
108-
- **`supportedPlatforms`**: An array listing the platforms supported by the language module.
109-
- **`forceLoad`**: A boolean indicating whether the language module should be forcibly loaded by the core.
90+
- **`author`**: The creator or author of the language module.
91+
- **`website`**: The URL linking to the creator's profile or information.
92+
- **`license`**: The license for the language module.
93+
- **`platforms`**: An array listing the platforms supported by the language module.
11094

11195
### Notes:
11296
- Ensure all configuration files are valid JSON and adhere to the schema provided by Plugify.

content/2.essentials/6.commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ plg show _package_name_
178178
Add a new remote repository for package installation.
179179

180180
```bash
181-
plg repo https://website.com/_package_file_.json
181+
mamba install -n your_env_name -c https://website.com/conda_channel/ package_name
182182
```
183183

184184
**Note**: Only add repositories from trusted sources to avoid security risks.

content/4.languages/1.python/1.installation.md

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ The **Python Language Module** can be installed in two ways: manually downloadin
1010

1111
::steps
1212
### **Download the Release**
13-
1. Go to the [Python Language Module repository](https://github.com/untrustedmodders/plugify-module-python3.12).
13+
1. Go to the [Python Language Module repository](https://github.com/untrustedmodders/plugify-module-python3).
1414
2. Navigate to the **Releases** section.
15-
3. Download the latest release package (e.g., `plugify-module-python3.12.zip`).
15+
3. Download the latest release package (e.g., `plugify-module-python3.zip`).
1616

1717
### **Extract the Package**
1818
1. Extract the downloaded package to a temporary directory.
1919

2020
### **Place the Module in the Modules Folder**
21-
1. Locate the `modules` folder in your Plugify installation directory.
22-
2. Copy the extracted module files into the `modules` folder.
21+
1. Locate the `extensions` folder in your Plugify installation directory.
22+
2. Copy the extracted module files into the `extensions` folder.
2323

2424
### **Verify Installation**
2525
1. Start Plugify.
@@ -29,30 +29,14 @@ The **Python Language Module** can be installed in two ways: manually downloadin
2929
## **Method 2: Installation via Package Manager**
3030

3131
::steps
32-
### **Add the Repository (if needed)**
33-
If the Python Language Module is not found in the default package repository, you need to add the repository manually.
34-
35-
#### **Option A: Add Repository via Command**
36-
1. Run the following command in your terminal:
37-
```bash
38-
plg repo https://untrustedmodders.github.io/plugify-module-python3.12/plugify-module-python3.12.json
39-
```
40-
41-
#### **Option B: Add Repository via `plugify.pconfig`**
42-
1. Open the `plugify.pconfig` file in your Plugify installation directory.
43-
2. Add the following line under the `repositories` section:
44-
```json
45-
{
46-
"repositories": [
47-
"https://untrustedmodders.github.io/plugify-module-python3.12/plugify-module-python3.12.json"
48-
]
49-
}
50-
```
32+
### **Configure Mamba**
33+
Before proceeding, make sure you have the [Mamba package manager](https://mamba.readthedocs.io/en/latest/user_guide/mamba.html#mamba-user-guide) installed and understand the basics of creating and managing environments.
34+
If you are new to Mamba, please read the **Quickstart Guide** in the official documentation.
5135

5236
### **Install the Module**
53-
1. Run the following command in your terminal:
37+
1. Run the following command in your terminal (replace `your_env_name` with the name of your environment):
5438
```bash
55-
plg install plugify-module-python3.12
39+
mamba install -n your_env_name -c https://untrustedmodders.github.io/plugify-module-python3/ plugify-module-python3
5640
```
5741

5842
### **Verify Installation**
@@ -67,7 +51,7 @@ After installation, the Python Language Module should have the following folder
6751
::file-tree
6852
---
6953
tree:
70-
- res/modules:
54+
- res/extensions:
7155
- plugify-module-python:
7256
- src:
7357
- plugify-module-python.py
@@ -76,15 +60,14 @@ tree:
7660
::
7761

7862
### **Explanation**
79-
- **`res/modules/plugify-module-python3.12`**: The root folder for the Python Language Module.
63+
- **`res/extensions/plugify-module-python3`**: The root folder for the Python Language Module.
8064
- **`src`**: Contains Python source code files (`.py`).
81-
- **`plugify-module-python3.12.pplugin`**: The module manifest file that describes the module and its language.
65+
- **`plugify-module-python3.pplugin`**: The module manifest file that describes the module and its language.
8266

8367
## **Troubleshooting**
8468

8569
### **Module Not Found**
8670
- Ensure the repository URL is correct and accessible.
87-
- Verify that the repository has been added to `plugify.pconfig` or via the `plg repo <url>` command.
8871

8972
### **Installation Fails**
9073
- Check your internet connection.

content/4.languages/1.python/2.first-plugin.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ To ensure seamless integration with the Plugify framework, your plugin must foll
3636
::file-tree
3737
---
3838
tree:
39-
- res/plugins:
39+
- res/extensions:
4040
- python_example_plugin:
4141
- python_example_plugin.py
4242
- ^python_example_plugin.pplugin^
@@ -48,7 +48,7 @@ tree:
4848

4949
### Breakdown of the Structure
5050

51-
* `res/plugins/` – The main directory where all plugins are stored.
51+
* `res/extensions/` – The main directory where all plugins are stored.
5252
* `python_example_plugin/` – Each plugin has its own dedicated folder. The folder name must match the `.pplugin` file name.
5353
* `python_example_plugin.py` – The Python script containing the plugin code.
5454
* `python_example_plugin.pplugin` – The configuration file that defines metadata about the plugin.
@@ -71,32 +71,27 @@ Each plugin in the **Plugify** framework requires a **manifest file** with the `
7171
```json [python_example_plugin.pplugin]
7272
{
7373
"$schema": "https://raw.githubusercontent.com/untrustedmodders/plugify/refs/heads/main/schemas/plugin.schema.json",
74-
"fileVersion": 1,
7574
"version": "0.1.0",
76-
"friendlyName": "PythonExamplePlugin",
75+
"name": "PythonExamplePlugin",
7776
"description": "An example of a Python plugin. This can be used as a starting point when creating your own plugin.",
78-
"createdBy": "untrustedmodders",
79-
"createdByURL": "https://github.com/untrustedmodders/",
80-
"docsURL": "https://github.com/orgs/untrustedmodders/README.md",
81-
"downloadURL": "https://github.com/orgs/untrustedmodders/example-repo.zip",
82-
"updateURL": "https://github.com/untrustedmodders/plugify/issues",
83-
"entryPoint": "python_example_plugin.ExamplePlugin",
84-
"supportedPlatforms": [],
85-
"languageModule": {
86-
"name": "python3"
87-
},
77+
"author": "untrustedmodders",
78+
"website": "https://github.com/untrustedmodders/",
79+
"license": "MIT",
80+
"entry": "python_example_plugin.ExamplePlugin",
81+
"platforms": [],
82+
"language": "python3",
8883
"dependencies": [],
89-
"exportedMethods": []
84+
"methods": []
9085
}
9186
```
9287
::
9388

9489
### Key Fields Explained
9590

96-
* `entryPoint`: Specifies the **module path** and **class name** of the plugin. For example, if your plugin is in `python_example_plugin.py` and the class is `ExamplePlugin`, the entry point should be `python_example_plugin.ExamplePlugin`.
97-
* `languageModule`: Should be set to **python3** for Python plugins.
91+
* `entry`: Specifies the **module path** and **class name** of the plugin. For example, if your plugin is in `python_example_plugin.py` and the class is `ExamplePlugin`, the entry point should be `python_example_plugin.ExamplePlugin`.
92+
* `language`: Should be set to **python3** for Python plugins.
9893
* `dependencies`: Lists other **required plugins**, ensuring correct load order.
99-
* `exportedMethods`: **Functions** exposed by the plugin for external interaction.
94+
* `methods`: **Functions** exposed by the plugin for external interaction.
10095

10196
### Why is the Manifest File Important?
10297

content/4.languages/1.python/3.export-functions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ def add_numbers_exported(a: int, b: int) -> int:
8181
::
8282

8383
### **Plugin Manifest**
84-
To export the function, describe it in the plugin manifest under the `exportedMethods` section:
84+
To export the function, describe it in the plugin manifest under the `methods` section:
8585

8686
::code-group
8787
```json [plugin_name.pplugin]
8888
{
8989
"name": "ExamplePythonPlugin",
9090
"version": "1.0.0",
91-
"exportedMethods": [
91+
"methods": [
9292
{
9393
"name": "add_numbers",
9494
"funcName": "add_numbers_exported",
@@ -136,7 +136,7 @@ def process_data_exported(data: list[float], prefix: str) -> list[str]:
136136
{
137137
"name": "ExamplePythonPlugin",
138138
"version": "1.0.0",
139-
"exportedMethods": [
139+
"methods": [
140140
{
141141
"name": "process_data",
142142
"funcName": "process_data_exported",
@@ -185,7 +185,7 @@ def execute_with_callback_exported(value: int, input_str: str, callback: callabl
185185
{
186186
"name": "ExamplePythonPlugin",
187187
"version": "1.0.0",
188-
"exportedMethods": [
188+
"methods": [
189189
{
190190
"name": "execute_with_callback",
191191
"funcName": "execute_with_callback_exported",
@@ -234,7 +234,7 @@ def execute_with_callback_exported(value: int, input_str: str, callback: callabl
234234
1. **Define Functions Clearly**: Ensure your functions are well-documented and easy to understand.
235235
2. **Follow Type Conventions**: Adhere to Plugify's type conventions for parameters and return values.
236236
3. **Test Thoroughly**: Test your exported functions to ensure they work as expected when called by other plugins.
237-
4. **Update the Manifest**: Always describe exported functions in the plugin manifest under the `exportedMethods` section.
237+
4. **Update the Manifest**: Always describe exported functions in the plugin manifest under the `methods` section.
238238

239239
## **Conclusion**
240240

0 commit comments

Comments
 (0)