trifid
trifid copied to clipboard
Discuss refactoring of config system
- One package/plugin can be used multiple times in different pathes or vhosts
- It should be possible to configure setups like the following with the same level complexity
- Features can be composed by combining different configs (baseConfig single value will be replaced by an array of configs to merge)
- SPARQL base
- SPARQL full (yasgui, graph-explorer, spex)
- Add a function to generate a router object out of a given configuration
- It should be possible to use a config in custom code
The outcome of todays (2022-04-19) discussion can be found in the wiki.
Regarding middlewares, from the WIKI:
All middlewares are defined in the middlewares property. The value of the property is an object. Each middleware instance uses it own key. The order of loading the middlewares is defined by the value of the order property. The module property points to the module to load. A string is used that will be processed by ESM import().
{
"middlewares": {
"templateEngine": {
"order": 10,
"module": "trifid-plugin-cotton-candy"
}
}
}
Since now the string is processed by ESM import(), should be the .js extension mandatory? It would be consistent with ESM import(). Trifid could error explaining the mismatch. Does it make sense?