You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/app/docs/guides/creating_plugins.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,10 +77,10 @@ Plugins are defined as Go JSON Template files, using the following schema:
77
77
],
78
78
"scripts": {
79
79
"<key>": "<value>"
80
-
}
80
+
}
81
81
},
82
82
"include": [
83
-
"<path_to_plugin>"
83
+
"<path_to_plugin>"
84
84
]
85
85
}
86
86
```
@@ -91,7 +91,8 @@ A plugin can define services by adding a `process-compose.yaml` file in its `cre
91
91
92
92
Devbox's Plugin System provides a few special placeholders that should be used when specifying paths for env variables and helper files:
93
93
94
-
*`{{ .DevboxDirRoot }}` – points to the root folder of their project, where the user's `devbox.json` is stored.
94
+
*`{{ .DevboxProjectDir }}` – points to the root folder of their project, where the user's `devbox.json` is stored.
95
+
*`{{ .DevboxDirRoot }}` - points to `<projectDir>/devbox.d`. This directory is public and added to source control by default.
95
96
*`{{ .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).
96
97
*`{{ .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.
97
98
@@ -111,9 +112,9 @@ Special usage instructions or notes to display when your plugin activates or whe
111
112
112
113
#### `packages`*string[] | object*
113
114
114
-
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`.
115
+
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`.
115
116
116
-
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]`.
117
+
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]`.
117
118
118
119
#### `env`*object*
119
120
@@ -168,12 +169,12 @@ To run multiple commands in a single script, you can pass them as an array:
168
169
}
169
170
}
170
171
}
171
-
```
172
-
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.
172
+
```
173
+
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.
173
174
174
175
#### `include`*string[]*
175
176
176
-
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.
177
+
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.
177
178
178
179
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.
0 commit comments