Skip to content

Implement unified-engine #11

@remcohaszing

Description

@remcohaszing

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions