rokucommunity / rokucommunity/brighterscript

Plugin configuration support

Open
#1,288 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
208
Forks
68
Avg merge
8h 39m
Merged PRs (30d)
39

Description

Add formal support for plugin configurations in the bsconfig.

Here's how it should work:

existing plugin string shorthand will still work
"plugins": [
    "./path/to/plugin.js",
    "plugin-from-node_modules"
]
plugin definitions can now be objects, with the following properties
  • src - the plugin string shorthand described above (an npm package name, or a path to a nodejs script)
  • config - the plugin-specific config object that will be given to the plugin, or a path to a jsonc config file to be loaded
"plugins": [
    {
        "src": "./path-to-plugin.js"
        "config": {
            //plugin-specific config
         }
    }, 
    {
        "src": "plugin-from-node_modules",
        "config": "path/to/config.json"
    }
]      
Plugins are given their configurations in a new lifecycle hook

This new configuration will be passed to the plugin in a new lifecycle hook (possibly called onSetConfiguration). Plugins may be reconfigured many times depending on whether watched files (such as bsconfig or specific plugin files) changed.

public onSetConfiguration(config: YourConfigInterfaceType) {
    this.config = config;
    //do stuff based on this config
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing bsconfig plugin loading and the existing plugin string shorthand, then review the proposed onSetConfiguration lifecycle hook and watched-file reconfiguration behavior. Done means supporting object plugin definitions with inline or JSONC config while preserving string shorthand and passing configuration to plugins through the new hook.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.