Skip to content

Commit

Permalink
Backport 1.2.0 release to master (tweag#1603)
Browse files Browse the repository at this point in the history
* Bump versions for 1.2.0 release

* Update Cargo.lock

* Update RELEASING guide

Co-authored-by: Viktor Kleen <viktor.kleen@tweag.io>

* Add 1.2.0 release notes

* Depend from published tree-sitter-nickel

* Add warning about crates.io and format feature in READMEs

* Fix formatting_external borrowing issue

---------

Co-authored-by: Viktor Kleen <viktor.kleen@tweag.io>
  • Loading branch information
2 people authored and Ben committed Sep 17, 2023
1 parent 1f3f078 commit e2958b5
Show file tree
Hide file tree
Showing 8 changed files with 534 additions and 496 deletions.
901 changes: 430 additions & 471 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
resolver = "2"

[workspace.package]
version = "1.1.1"
version = "1.2.0"
authors = ["The Nickel Team <nickel-lang@protonmail.com>"]
license = "MIT"
edition = "2021"
Expand All @@ -21,7 +21,7 @@ homepage = "https://nickel-lang.org"
readme = "README.md"

[workspace.dependencies]
nickel-lang-core = { version = "0.1", path = "./core", default-features = false }
nickel-lang-core = { version = "0.2", path = "./core", default-features = false }
nickel-lang-utils = { version = "0.1", path = "./utils" }
lsp-harness = { version = "0.1", path = "./lsp/lsp-harness" }

Expand Down Expand Up @@ -92,5 +92,5 @@ void = "1"

topiary = { version = "0.2.3", git = "https://github.com/tweag/topiary.git", rev = "refs/heads/main" }
# This should be kept in sync with the revision in topiary
tree-sitter-nickel = { git = "https://github.com/nickel-lang/tree-sitter-nickel", rev = "b1a4718601ebd29a62bf3a7fd1069a99ccf48093" }
tree-sitter-nickel = { version = "0.1.0" }
tempfile = "3.5.0"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ highlighting and NLS.

#### Formatting

**Warning**: because the cargo registry (crates.io) requires that all
dependencies of Nickel are published there as well, the `format` feature isn't
enabled when installing nickel with `cargo install` as of Nickel version 1.2.0.
In this case, please use [Topiary](https://github.com/tweag/topiary/) separately
to format Nickel source code.

To format a Nickel source file, use `nickel format` (`-i` is short for
`--in-place`):

Expand Down
74 changes: 74 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
Version 1.2
===========

Version 1.2 comes with several improvements on the LSP and other components of
the Nickel tooling. The new customize mode of the CLI makes it possible to
dynamically turn a configuration into a command-line interface, which you can
interact with.

Several related long-standing issues and limitations when typechecking
polymorphic functions are also finally fixed.

Core language
-------------

* Make the lexer accept scientific notation by @vkleen in https://github.com/tweag/nickel/pull/1456
* Improve polymorphism handling, bidirectional typechecking and fix unsound generalization by @yannham in https://github.com/tweag/nickel/pull/1372
* Error on serializing very large numbers by @vkleen in https://github.com/tweag/nickel/pull/1470
* Import YAML files containing multiple documents as arrays by @vkleen in https://github.com/tweag/nickel/pull/1497
* Normalize line endings in string literals during parsing (Windows compatiblity) by @vkleen in https://github.com/tweag/nickel/pull/1562
* Implement curried dot operator by @suimong in https://github.com/tweag/nickel/pull/1578
* Statically merge partial record definitions by @vkleen in https://github.com/tweag/nickel/pull/1599
* Disable recursive priorities by @yannham in https://github.com/tweag/nickel/pull/1600

Fixes
-----

* Various fixes to the pretty-printer by @vkleen (https://github.com/tweag/nickel/pull/1411, https://github.com/tweag/nickel/pull/1412, https://github.com/tweag/nickel/pull/1410, https://github.com/tweag/nickel/pull/1417)
* Fix REPL panic on transitive imports by @Radvendii in https://github.com/tweag/nickel/pull/1474
* Fix contract application order in let bindings and annotations by @vkleen in https://github.com/tweag/nickel/pull/1544
* Fix cursor desyncing when using REPL by @deotimedev in https://github.com/tweag/nickel/pull/1546
* Fix handling of relative imports @jneem in https://github.com/tweag/nickel/pull/1489
* LSP Fix two issues with incomplete input by @jneem in https://github.com/tweag/nickel/pull/1550
* Fix incomplete check of record row constraints by @yannham in https://github.com/tweag/nickel/pull/1558
* Fix LSP regression on hovering by @yannham in https://github.com/tweag/nickel/pull/1583

Tooling
-------

* Full vscode extension by @szlend and @yannham in (https://github.com/tweag/nickel/pull/1405, https://github.com/tweag/nickel/pull/1413, https://github.com/tweag/nickel/pull/1416)
* Invalidate importers in NLS (plus a couple other import-related issues) by @jneem in https://github.com/tweag/nickel/pull/1426
* Improve `nickel query` (and `:query` in the REPL) interface by @yannham in
https://github.com/tweag/nickel/pull/1447
* Topiary integration (formatting) as `nickel format` by @vkleen in https://github.com/tweag/nickel/pull/1371
* LSP: various improvements to completion by @jneem (https://github.com/tweag/nickel/pull/1450, https://github.com/tweag/nickel/pull/1473)
* Improve doc extraction capabilities through `nickel doc` (evaluate terms before extracting documentation) by @vkleen in https://github.com/tweag/nickel/pull/1463
* LSP Fix persistent diagnostics by @jneem in https://github.com/tweag/nickel/pull/1478
* Restore --version for CLI, include git revision by @yannham in https://github.com/tweag/nickel/pull/1486
* Disable the colors when stdout isn't a tty by @thufschmitt in https://github.com/tweag/nickel/pull/1508
* Improve type variables name allocation when reporting type errors by @yannham in https://github.com/tweag/nickel/pull/1512
* LSP formatting without calling the topiary binary by @vkleen in https://github.com/tweag/nickel/pull/1526
* LSP Initial handling of incomplete input by @jneem in https://github.com/tweag/nickel/pull/1541
* LSP resolve imports for incomplete inputs also by @jneem in https://github.com/tweag/nickel/pull/1542
* Add multiline string support for VSCode autoclosing pairs by @deotimedev in https://github.com/tweag/nickel/pull/1553
* Display icon for nickel file in vscode explorer by @suimong in https://github.com/tweag/nickel/pull/1556
* New experimental customize mode CLI to interact with a configuration on the
command line (see `nickel help export`) by @Radvendii and @yannham in
https://github.com/tweag/nickel/pull/1475
* (LSP) Import completion by @deotimedev in https://github.com/tweag/nickel/pull/1561
* Get rid of uninformative generic notes for higher-order contract errors by @yannham in https://github.com/tweag/nickel/pull/1564
* Render hover documentation as Markdown in LSP by @deotimedev in https://github.com/tweag/nickel/pull/1559
* Exit with nonzero exit code on failure by @vkleen in https://github.com/tweag/nickel/pull/1576

Stdlib
------

* add `std.contract.Sequence` by @Radvendii in https://github.com/tweag/nickel/pull/1452

Documentation
-------------

* manual docs: fix mismatch between input command and its echo in the output by @foo-jin in https://github.com/tweag/nickel/pull/1421
* Add two examples: imports and foreach pattern by @mipmip in https://github.com/tweag/nickel/pull/1387
* Fix some leftover instances of the old enum syntax in the manual by @vkleen in https://github.com/tweag/nickel/pull/1548

Version 1.1
===========

Expand Down
29 changes: 9 additions & 20 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Other crates carry the version number of the Nickel language. These are
dropped later. Do not push**.
2. Check that a dry run of `cargo publish` succeeds on the crates to be
published (`nickel-lang-core`, `nickel-lang-cli` and `nickel-lang-lsp`):

- `cargo publish -p nickel-lang-core --dry-run`
- `cargo publish -p nickel-lang-cli --dry-run`
- `cargo publish -p nickel-lang-lsp --dry-run`
Expand All @@ -108,26 +109,15 @@ Other crates carry the version number of the Nickel language. These are

### Release on GitHub

1. Build a Docker image and a static binary for ARM64 manually, using

```console
nix build --out-link nickel-arm64-docker-image.tar.gz .#packages.aarch64-linux.dockerImage
nix build --out-link nickel-arm64-linux .#packages.aarch64-linux.dockerImage
```

on an ARM64 Linux machine (x86_64 assets are automatically handled by a
workflow, see 3).

2. Do the [release on
1. Do the [release on
GitHub](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository),
and include the docker image built in 1. Make sure that you set `X.Y.Z-release`
as the target branch and have GitHub create the `X.Y.Z` tag on release.
Upload `nickel-arm64-docker-image.tar.gz` and `nickel-arm64-linux` as release
assets from the last step.
Make sure that you set `X.Y.Z-release` as the target branch and have GitHub
create the `X.Y.Z` tag on release. Upload `nickel-arm64-docker-image.tar.gz`
and `nickel-arm64-linux` as release assets from the last step.

3. Verify that the "Upload release artifacts" GitHub action is getting triggered
and completes successfully, uploading a static Nickel binary for x86_64 Linux
and a Docker image.
2. Verify that the "Upload release artifacts" GitHub action is getting triggered
and completes successfully, uploading a static Nickel binary and a Docker
image for both x86-64 and arm64 Linux platforms.

### Redeploy nickel-lang.org with the new release

Expand All @@ -152,6 +142,5 @@ Other crates carry the version number of the Nickel language. These are
1. Cherry-pick the following commits into separate PRs to `master`:
- Bumping the version numbers done in Preparation 2.
- Updating release notes done in Preparation 5.
- Fixes that you made locally for `nix flake check`, `cargo
doc` or any other command.
- Fixes that you made locally for `nix flake check` or other commands.
2. Profit!
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nickel-lang-core"
version = "0.1.0"
version = "0.2.0"
description = "Programmable configuration files."
authors.workspace = true
edition.workspace = true
Expand Down
9 changes: 9 additions & 0 deletions lsp/nls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ it in VSCode, (Neo)Vim and Emacs.

## Formatting Capabilities

**Warning**: because the cargo registry (crates.io) requires that all
dependencies of Nickel are published there as well, the format feature isn't
enabled when installing nls with `cargo install` as of NLS version 1.2.0. In
this case, to enable formatting in NLS, you have to make the `topiary`
executable available in your `PATH`. Please follow [Topiary's setup
instructions](https://github.com/tweag/topiary#installing) and ensure in
particular that the environment variable `TOPIARY_LANGUAGE_DIR` is correctly set
(this is covered in the setup instructions).

Formatting in `nls` is currently based on
[Topiary](https://github.com/tweag/topiary), used as a library. No configuration
or external dependencies are necessary.
3 changes: 2 additions & 1 deletion lsp/nls/src/requests/formatting_external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn handle_format_document(

let new_text = String::from_utf8(output.stdout).unwrap();

let result = (text != new_text).then_some(vec![TextEdit {
let result = Some(vec![TextEdit {
range: Range {
start: Position {
line: 0,
Expand All @@ -72,5 +72,6 @@ pub fn handle_format_document(
new_text,
}]);
server.reply(Response::new_ok(id, result));

Ok(())
}

0 comments on commit e2958b5

Please sign in to comment.