-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
i18n/en/docusaurus-plugin-content-docs-plugin-dev/current.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Start Building | ||
--- | ||
|
||
Ready to develop a plugin? Great! Here's how to get started. | ||
|
||
## Pre-Requisites | ||
|
||
First, you will need to install [Node.js](https://nodejs.org) - use the [same major version as Peacock](https://github.com/thepeacockproject/Peacock/blob/v7/.nvmrc). | ||
|
||
After installing Node, you will need to active Node.js' package manager-manager, `corepack`. | ||
Visit a terminal or command prompt, and use the command `corepack enable` to do so. | ||
|
||
:::note PowerShell error | ||
|
||
If you are using PowerShell on Windows, you may run into an issue where it says you can't run unsigned scripts. | ||
To fix this, run `Set-ExecutionPolicy Unrestricted` and try again. | ||
|
||
::: | ||
|
||
Lastly, you will need to install [Git](https://git-scm.com). The installer on Windows has a lot of options, and the defaults are fine. | ||
|
||
## Workspace Setup | ||
|
||
Once you have all the pre-requisites satisfied, you will need to clone the Peacock repository. | ||
You can develop your plugin alongside the Peacock source code for ease of access. | ||
|
||
To clone the repository, run the following command in a terminal or command prompt: | ||
|
||
```bash | ||
git clone https://github.com/thepeacockproject/Peacock.git | ||
``` | ||
|
||
You will then want to open the project in a code editor of your choice, such as [Visual Studio Code](https://code.visualstudio.com) or [WebStorm](https://jetbrains.com/webstorm). | ||
|
||
Once you have opened the project, run the following command to install the dependencies: | ||
|
||
```bash | ||
yarn install | ||
``` | ||
|
||
You now have the workspace fully set up. You can create a new file for your plugin in the `plugins` folder, and start developing. | ||
|
||
To run the Peacock server from the repository in development mode, run the following command: | ||
|
||
```bash | ||
yarn run-dev | ||
``` | ||
|
||
While in development mode, plugins written in TypeScript will be loaded and automatically transformed into JavaScript. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: What is a Plugin? | ||
--- | ||
|
||
Peacock plugins allow you to extend Peacock's functionality and add new features. | ||
|
||
If you're interested in creating a plugin, you're in the right place. | ||
|
||
If you're a user and you want to install a plugin, check out the [Custom Content page](/wiki/custom-content), which has instructions. | ||
|
||
## Plugin Specification | ||
|
||
Peacock plugins are written in JavaScript. They can also be written in TypeScript, but must be compiled to JavaScript before Peacock can load it. Peacock comes with full type definitions. | ||
|
||
Plugins can use the latest ECMAScript features [available](https://node.green) in the version of Node.js [that Peacock uses](https://github.com/thepeacockproject/Peacock/blob/v7/.nvmrc). | ||
|
||
Plugins can be written in [CommonJS or ES Modules](https://blog.logrocket.com/commonjs-vs-es-modules-node-js/), but must be compiled to CommonJS before Peacock can load it. | ||
|
||
Plugins can be installed and managed by [Simple Mod Framework](https://www.nexusmods.com/hitman3/mods/200) mods, or manually by the user. | ||
|
||
Peacock loads plugins that match the file name schema from the Peacock folder itself or (the new and better) `plugins` folder. | ||
|
||
The file name schema is `*Plugin.js` or `*.plugin.js`, where `*` is the name of the plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default { | ||
sidebar: [ | ||
{ | ||
type: "category", | ||
label: "Plugin Development", | ||
link: { | ||
type: "generated-index", | ||
slug: "/", | ||
}, | ||
items: [ | ||
"what-is-a-plugin", | ||
"prep", | ||
], | ||
}, | ||
], | ||
} |