Skip to content

Fix plugin placeholder docs #2254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix plugin placeholder docs
  • Loading branch information
Lagoja committed Sep 5, 2024
commit b512382ac5126c6c2c00ecd5f57094c1adc09c15
17 changes: 9 additions & 8 deletions docs/app/docs/guides/creating_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ Plugins are defined as Go JSON Template files, using the following schema:
],
"scripts": {
"<key>": "<value>"
}
}
},
"include": [
"<path_to_plugin>"
"<path_to_plugin>"
]
}
```
Expand All @@ -91,7 +91,8 @@ A plugin can define services by adding a `process-compose.yaml` file in its `cre

Devbox's Plugin System provides a few special placeholders that should be used when specifying paths for env variables and helper files:

* `{{ .DevboxDirRoot }}` – points to the root folder of their project, where the user's `devbox.json` is stored.
* `{{ .DevboxProjectDir }}` – points to the root folder of their project, where the user's `devbox.json` is stored.
* `{{ .DevboxDirRoot }}` - points to `<projectDir>/devbox.d`. This directory is public and added to source control by default.
* `{{ .DevboxDir }}` – points to `<projectDir>/devbox.d/<plugin.name>`. This directory is public and added to source control by default. This directory is not modified or recreated by Devbox after the initial package installation. You should use this location for files that a user will want to modify and check-in to source control alongside their project (e.g., `.conf` files or other configs).
* `{{ .Virtenv }}` – points to `<projectDir>/.devbox/virtenv/<plugin_name>` whenever the plugin activates. This directory is hidden and added to `.gitignore` by default You should use this location for files or variables that a user should not check-in or edit directly. Files in this directory should be considered managed by Devbox, and may be recreated or modified after the initial installation.

Expand All @@ -111,9 +112,9 @@ Special usage instructions or notes to display when your plugin activates or whe

#### `packages` *string[] | object*

A list of packages that the plugin will install when activated or included in a package. This section follows the same format as [`packages`](../configuration.md#packages) section in a project's `devbox.json`.
A list of packages that the plugin will install when activated or included in a package. This section follows the same format as [`packages`](../configuration.md#packages) section in a project's `devbox.json`.

Packages installed by a plugin can be overridden if a user installs a different version of the same package in their `devbox.json` config. For example, if a plugin installs `[email protected]`, and a user's devbox.json installs `[email protected]`, the project will use `[email protected]`.
Packages installed by a plugin can be overridden if a user installs a different version of the same package in their `devbox.json` config. For example, if a plugin installs `[email protected]`, and a user's devbox.json installs `[email protected]`, the project will use `[email protected]`.

#### `env` *object*

Expand Down Expand Up @@ -168,12 +169,12 @@ To run multiple commands in a single script, you can pass them as an array:
}
}
}
```
Scripts defined in a plugin will be overridden if a user's `devbox.json` defines a script with the same name. For example, if both the plugin and the devbox.json that includes it defined a `print_once` script, the version in the user's `devbox.json` will take precedence in the shell.
```
Scripts defined in a plugin will be overridden if a user's `devbox.json` defines a script with the same name. For example, if both the plugin and the devbox.json that includes it defined a `print_once` script, the version in the user's `devbox.json` will take precedence in the shell.

#### `include` *string[]*

Include can be used to explicitly add extra configuration from [plugins](../guides/plugins.md) to your Devbox project. Plugins are parsed and merged in the order they are listed.
Include can be used to explicitly add extra configuration from [plugins](../guides/plugins.md) to your Devbox project. Plugins are parsed and merged in the order they are listed.

Note that in the event of a conflict, plugins near the end of the list will override plugins at the beginning of the list. Likewise, if a setting in your plugin.json conflicts with an included plugin, your setting will take precedence.
```json
Expand Down