-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move the CLI into its own crate #1351
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there several things to consider. How that will play with the next update? For example, people updating the nickel-lang
package via cargo
, thinking they will just have the latest version of the binary, will find an error saying something like "there's no binary available" I guess? I wonder how we could smooth the transition.
Second, It's not horrible but it's a bit sad to split the test in two (mainly because the source code controlling error messages are not in the CLI crate currently, but thinking about it, maybe they should just be? I don't really know the answer at this point)
The error message formatting itself should probably stay accessible from the I suppose we could split the snapshot tests by purpose, but I'm not sure the effort would be worth it at the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder also if we shouldn't move everything ito its own subdirectory, including the nickel-lang
crate, and name directories accordingly, so that the hierarchy is more consistent. Also, we might have to update the README or other documentation lying around about running tests, since there's now tests located inside two different crates.
I like the idea of |
06bc9f8
to
be1bc6b
Compare
b08dd47
to
38b4ff4
Compare
38b4ff4
to
47b4b1c
Compare
@vkleen is it ready for review? Last time I checked there were still some mixed up stuff with |
I think it's ready for review now. Hopefully I've found all the mixups 😅 |
47b4b1c
to
2261cc0
Compare
2261cc0
to
8caab69
Compare
8caab69
to
451ec86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not 100% sure about the nickel-lang
vs nickel-lang-cli
😅 but I guess if we want to change that for the next release, it's just a small search and replace, isn't it? It's better to proceed with the new file hierarchy to avoid painful rebasing.
- `nickel-lang-lsp` (path: `lsp/nls/`). the Nickel Language Server (NLS), an LSP | ||
- `nickel-lang-lib` (path: `nickel-lang-lib`). The main crate containing the interpreter | ||
as a library. | ||
- `nickel-lang` (path: `nickel-lang-cli`). The `nickel` binary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so the path is nickel-lang-cli
, but the crate name will be nickel-lang
? Hmm...that sounds a bit confusing. On the other hand, I agree that nickel-lang
is a bit misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point, I had the CLI just under cli
, like the utilities
subdirectory now. I don't think there's any paritcular necessity to tie the directory name to the crate name, and just nickel-lang
felt a bit misleading as you say.
Co-authored-by: Yann Hamdaoui <[email protected]>
It's not quite a search and replace, but we're not using the string "nickel-lang" in all too many places, so it's not very painful. I agree that it's better to proceed as is and switch the names around later if we feel like it. |
2cd7550
to
6aa84e9
Compare
Move the Nickel CLI into its own crate
nickel-lang-cli
. This will make it easier to integrate external tools such as Topiary without incurring a ton of dependencies in thenickel-lang
crate.In the future, we may want to split out the REPL handling from
nickel-lang
into the CLI, and the WASM interface. But for now, this PR is just a straightforward move.