Initial checklist
Problem
As part of remarkjs/remark#910 I would like to make unified-language-server based on unified-engine, so it yields the same result as CLIs created using unified-args.
Currently the language server is written in CJS, has a custom configuration file, and is synchronous. Unfortunately this means a lot of the existing code needs to be rewritten. Fortunately this also means a lot of code can be removed.
In order to do this right, the command line interface of the language server needs to be redesigned.
Solution
I imagine the CLI works like this:
unified-language-server \
--prefix remark \
--plugin remark-parse \
--plugin remark-stringify
--prefix defines the prefix that’s passed to unified-engine. I.e. the example loads .remarkrc.js, .remarkignore, etc.
--plugin specifies plugins to be loaded that aren’t defined in the configuration file. They will be loaded using load-plugin.
Also I suggest we add a pre existing command line parser, i.e. commander
Alternatives
Another possibility is to load remark. This better matches behavior of remark-cli. However, I’m not sure how this should be defined, because remark uses a named export.
Initial checklist
Problem
As part of remarkjs/remark#910 I would like to make
unified-language-serverbased onunified-engine, so it yields the same result as CLIs created usingunified-args.Currently the language server is written in CJS, has a custom configuration file, and is synchronous. Unfortunately this means a lot of the existing code needs to be rewritten. Fortunately this also means a lot of code can be removed.
In order to do this right, the command line interface of the language server needs to be redesigned.
Solution
I imagine the CLI works like this:
--prefixdefines the prefix that’s passed tounified-engine. I.e. the example loads.remarkrc.js,.remarkignore, etc.--pluginspecifies plugins to be loaded that aren’t defined in the configuration file. They will be loaded usingload-plugin.Also I suggest we add a pre existing command line parser, i.e.
commanderAlternatives
Another possibility is to load
remark. This better matches behavior ofremark-cli. However, I’m not sure how this should be defined, becauseremarkuses a named export.