Follow-up 1 from #592 (the other follow-up there, pluginDataDir, stays tracked in #592's thread).
Motivation
Since #593 / 0.0.216, jss start -c config.json mounts plugins — but the simple case still requires writing a config file for what is conceptually one argument. A repeatable flag closes that:
jss start --root ./data --public --plugin ./chat/plugin.js@/chat --plugin tideholm/jss-plugin/tideholm-jss.js@/tideholm
It's also the seam servejss needs to stay a pure flag translator: with this flag, servejss --plugin ./chat/plugin.js@/chat ./public forwards verbatim, and jsserve never learns plugin semantics (consistent with its How-it-works contract: JSS owns loading, the wrapper owns the CLI).
Proposed shape
- Repeatable: commander collect pattern; each occurrence appends one entry.
- Syntax:
module[@prefix] — split on the last @ whose remainder starts with /, so scoped packages parse unambiguously (@scope/pkg/plugin.js@/app → module @scope/pkg/plugin.js, prefix /app; bare @scope/pkg/plugin.js → no prefix).
- Merging: CLI entries append to
config.plugins from the file (both sources usable together), rather than the usual CLI-replaces-file scalar rule — replacing would make -c plus one --plugin silently drop the file's apps.
- Scope limits: per-plugin
config objects and explicit id stay config-file territory; the flag covers the module + prefix case only. Entries go through the existing loader untouched, so prefix validation, duplicate-id rejection, and fail-loudly-on-import-error all apply as-is.
Non-goals
Follow-up 1 from #592 (the other follow-up there,
pluginDataDir, stays tracked in #592's thread).Motivation
Since #593 / 0.0.216,
jss start -c config.jsonmounts plugins — but the simple case still requires writing a config file for what is conceptually one argument. A repeatable flag closes that:It's also the seam servejss needs to stay a pure flag translator: with this flag,
servejss --plugin ./chat/plugin.js@/chat ./publicforwards verbatim, and jsserve never learns plugin semantics (consistent with its How-it-works contract: JSS owns loading, the wrapper owns the CLI).Proposed shape
module[@prefix]— split on the last@whose remainder starts with/, so scoped packages parse unambiguously (@scope/pkg/plugin.js@/app→ module@scope/pkg/plugin.js, prefix/app; bare@scope/pkg/plugin.js→ no prefix).config.pluginsfrom the file (both sources usable together), rather than the usual CLI-replaces-file scalar rule — replacing would make-cplus one--pluginsilently drop the file's apps.configobjects and explicitidstay config-file territory; the flag covers the module + prefix case only. Entries go through the existing loader untouched, so prefix validation, duplicate-id rejection, and fail-loudly-on-import-error all apply as-is.Non-goals
-c(CLI silently drops plugins and appPaths from config — #206 loader unreachable from jss start #592).