Skip to content

[Bug]: Plugin documentation is unclear #1499

@adamdicarlo0

Description

@adamdicarlo0

Current Behavior (bug)

The Creating plugins page does not say what the filename for a plugin must be. It just says "Here's what goes in your plugin file." I don't have the context to know what the filename should be. At first I thought maybe it should be devbox.json -- i.e. plugins were special devbox.jsons.

Looking in the devbox repository, the builtin plugins are all named different things. mysql.json, postgres.json, etc. Seeing that confused me more.

I eventually figured out that it is at least convention -- still not sure if it's required -- to name the file plugin.json.

  • When using path: to test locally (please add instructions for this to the docs), you have to specify the json file itself, not just the directory. That seemed unintuitive--I figured I'd specify the directory and name the json file correctly and be on my way.
  • When using github:, you don't specify the file name, just the repository and (optional?) ?dir= parameter. Wha? Why is it different? Is the name being plugin.json only required when specifying a plugin from github?

Do init_hooks actually work with plugins? (see #1500)

The Creating plugins page shows init_hook incorrectly located at the root of the JSON:

{
  "name": "",
  "version": "",
  "readme": "",
  "env": {
    "<key>": "<value>"
  },
  "create_files": {
    "<destination>": "<source>"
  },
  "init_hook": [              <--- must be nested in `shell` object
    "<bash commands>"
  ]
}

Expected Behavior (fix)

Creating plugins page describes how to:

  • name the plugin's JSON file - are there requirements? Conventions? Can you name the file something different, and still "include" it from github?
  • go about testing a plugin while creating it--mention the "path:" syntax, and whether devbox add can be used to install a plugin, or whether manual editing of devbox.json is necessary
  • correctly identify init_hook's location in JSON -- shell.init_hook

shell.init_hook support was added in #1500 - thank you @mikeland73!

Creating plugins page has a link to jetpack-io/devbox-plugins as an example of plugins that are not the special-cased/hardcoded builtin variety.

Additional context
Devbox 0.5.13, running on a Linux system

Thank you for devbox! My team and I have been really liking it!

### Tasks
- [x] Clarify or recommend a plugin filename
- [ ] https://github.com/jetpack-io/devbox/pull/1500
- [x] Update testing information for local plugins

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions