Skip to content

Commit b22db30

Browse files
committed
Merge branch 'main' of https://github.com/jetpack-io/devbox into gcurtis/flakeref
2 parents dccd262 + 00ee8fb commit b22db30

File tree

10 files changed

+349
-192
lines changed

10 files changed

+349
-192
lines changed

docs/app/docs/guides/creating_plugins.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Before contributing, please consult our [Contributing Guide](https://github.com/
1414

1515
## Creating a Plugin
1616

17-
We recommend organizing your plugin with the following directory structure, where the top-level folder matches the name of your plugin:
17+
We recommend organizing your plugin with the following directory structure, where the top-level folder matches the name of your plugin:
1818

1919
```
2020
my-plugin/
@@ -98,12 +98,6 @@ The name of your plugin. This is used to identify your plugin when a user runs `
9898

9999
The version of your plugin. You should start your version at 0.0.1 and bump it whenever you merge an update to the plugin.
100100

101-
#### `match` *string*
102-
103-
A regex expression that is used to identify when the plugin will be activated. Devbox will activate your plugin when a package installed with `devbox add` matches this regular expression.
104-
105-
The regex you provide should match a package name to automatically update. You can look up packages at `nixhub.io`
106-
107101
#### `readme` *string*
108102

109103
Special usage instructions or notes to display when your plugin activates or when a user runs `devbox info`. You do not need to document variables, helper files, or services, since these are automatically printed when a user runs `devbox info`.
@@ -128,7 +122,7 @@ You should use this to copy starter config files or templates needed to run the
128122

129123
#### `shell.init_hook` *string | string[]*
130124

131-
A single `bash` command or list of `bash` commands that should run before the user's shell is initialized.
125+
A single `bash` command or list of `bash` commands that should run before the user's shell is initialized.
132126

133127
This will run every time a shell is started, so you should avoid any resource heavy or long running processes in this step.
134128

@@ -145,15 +139,15 @@ See the process compose [docs](https://github.com/F1bonacc1/process-compose) for
145139
Testing plugins can be done using an example Devbox project. Follow the steps below to create a new test project
146140

147141
1. Create a new `devbox.json` in an empty directory using `devbox init`.
148-
2. Add your plugin to the `include` section of the `devbox.json` file.
142+
2. Add your plugin to the `include` section of the `devbox.json` file.
149143
2. Add any expected packages using `devbox add <pkg>`.
150144
3. Check that your plugin creates the correct files and environment variables when running `devbox shell`
151145
4. If you are looking for sample projects to test your plugin with, check out our [examples](https://github.com/jetpack-io/devbox/tree/main/examples).
152146

153147

154148
## Example: MongoDB
155149

156-
The plugin.json below sets the environment variables and config needed to run MongoDB in Devbox. You can view the full example at
150+
The plugin.json below sets the environment variables and config needed to run MongoDB in Devbox. You can view the full example at
157151

158152
```json
159153
{

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ require (
3939
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a
4040
github.com/wk8/go-ordered-map/v2 v2.1.8
4141
github.com/zealic/go2node v0.1.0
42-
go.jetpack.io/pkg v0.0.0-20231012130632-77dcd111db2e
42+
go.jetpack.io/pkg v0.0.0-20231019173032-13f60a9e32b8
4343
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17
4444
golang.org/x/mod v0.12.0
4545
golang.org/x/sync v0.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ github.com/yuin/gopher-lua v0.0.0-20190514113301-1cd887cd7036/go.mod h1:gqRgreBU
339339
github.com/zaffka/mongodb-boltdb-mock v0.0.0-20221014194232-b4bb03fbe3a0/go.mod h1:GsDD1qsG+86MeeCG7ndi6Ei3iGthKL3wQ7PTFigDfNY=
340340
github.com/zealic/go2node v0.1.0 h1:ofxpve08cmLJBwFdI0lPCk9jfwGWOSD+s6216x0oAaA=
341341
github.com/zealic/go2node v0.1.0/go.mod h1:GrkFr+HctXwP7vzcU9RsgtAeJjTQ6Ud0IPCQAqpTfBg=
342-
go.jetpack.io/pkg v0.0.0-20231012130632-77dcd111db2e h1:GtqFrE5uUf6rXFk3zaIqIfLfykrqrB8gp6bDmOfH+2s=
343-
go.jetpack.io/pkg v0.0.0-20231012130632-77dcd111db2e/go.mod h1:m49CAcLbpZttEbzoEWC1SKD+/z5mEiFdw0dQxY6AM5Q=
342+
go.jetpack.io/pkg v0.0.0-20231019173032-13f60a9e32b8 h1:xzAAUVfg9uqyJhZVc+ZDTLHtFlMhj/5St5JnVfDxbpk=
343+
go.jetpack.io/pkg v0.0.0-20231019173032-13f60a9e32b8/go.mod h1:m49CAcLbpZttEbzoEWC1SKD+/z5mEiFdw0dQxY6AM5Q=
344344
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
345345
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
346346
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=

internal/devconfig/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package devconfig
55

66
import (
7+
"bytes"
78
"encoding/json"
89
"io"
910
"net/http"
@@ -87,7 +88,8 @@ func DefaultConfig() *Config {
8788
}
8889

8990
func (c *Config) Bytes() []byte {
90-
return c.ast.root.Pack()
91+
b := c.ast.root.Pack()
92+
return bytes.ReplaceAll(b, []byte("\t"), []byte(" "))
9193
}
9294

9395
func (c *Config) Hash() (string, error) {

0 commit comments

Comments
 (0)