* Fetch the wasm-bindgen-cli version from Cargo.lock instead of Cargo.toml
* Move the Nickel CLI to a separate crate
* Fix snapshot tests
* Rename the nickel flake output to nickel-lang-cli for consistency
* Move the nickel-lang crate into a subdirectory
* Update documentation for the new crate split
* Tweak snapshot test instructions
* Use project_root instead of ad-hoc environment variables
* Remove the library from nickel-lang-cli for now
* Rename nickel-lang to nickel-lang-lib and nickel-lang-cli to nickel-lang
* Apply suggestions from code review
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
* Tweak documentation for nickel_lang_utilities::project_root
* Use MacOS 13 github runner because of https://github.com/cachix/install-nix-action/issues/183
---------
Co-authored-by: Yann Hamdaoui <yann.hamdaoui@tweag.io>
Rename the builtin `Num` and `Str` types to `Number` and `String`, and
use long names on a number of related functions and stdlib modules for
consistency. This is a breaking syntax change.
* Update regex crate to 1.7
We want to use the regex filtering feature of the insta snapshot testing
library. That has a dependency on a newer version of the regex crate
than Nickel currently does, so this commit updates the Nickel version to
a more recent compatible version.
* Add insta dependency
* Add cargo-insta to dev shells
* Add snapshot testing infrastructure
This uses the insta crate to implement snapshot testing.
Each snapshot test invokes the debug nickel binary with some set of
arguments, then captures the output & compares it to a file in the
snapshots directory
* Add nixpkgs-fmt to dev shell
This makes it possible to easily reformat flake.nix from within a dev
shell.
* Update HACKING.md
* Add snapshot testing README
* Refactor flake inputs because it's been annoying me for weeks now
* Fix a long-standing bug in mk_uniftype.rs
Can be reproduced by running `cargo test --workspace`.
This was never noticed before in CI because the `--workspace` flag is not passed.
This will be addressed in the Crane migration
* Remove utilities/Cargo.lock
This is probably a fragment of the past, back when Nickel did not use Cargo workspaces.
* Fix Clippy issues in tests
* Rustfmt and clippy are no longer in preview
* Update README with Nix flake shell command
* Migrate from import-cargo to crane for Nickel
Nickel WASM build is intentionally left intact and still uses the old
import-cargo.
This is because the change is already massive, and in practice the WASM build
relies more on `wasm-pack` than Cargo (even though under the hood, `wasm-pack`
uses Cargo).
If Crane looks good, both for DX and for CI, we will consider migrating Nickel
WASM to Crane too in a future PR.
* Remove support for Rust nightly channel
* Only Nix check for Rust `stable` channel
* Fix deprecated Nix build documentation commands
* Fix completion test
* Restructure integration tests into a single crate
This commit replaces our multi-crate integration test setup with a
single crate that contains all tests, inspired by [this
blog](https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html).
This has dual benefits:
1. it should reduce the amount of time tests take to compile, as we're
only producing a single binary,
2. it should reduce the amount of time tests take to run, as cargo
schedules individual test binaries to run sequentially whereas tests
within a binary can run in parallel.
* Update test references in HACKING.md
* Add README explaining test structure