Subject: CVS commit: pkgsrc/lang/gleam
From: nikita
Date: 2024-04-17 17:50:29
Message id: 20240417155029.CAA93FA2C@cvs.NetBSD.org

Log Message:
gleam: update to version 1.1.0

Changelog:

# Changelog

## v1.1.0 - 2024-04-16

### Formatter

- Fixed a bug where the first subject of a case expression clause would be
  indented more than necessary.

## v1.1.0-rc3 - 2024-04-12

### Formatter

- Fixed a bug where the `@internal` annotation wouldn't be displayed.
- Fixed a bug where a record update's arguments would be incorrectly split on
  multiple lines.

## v1.1.0-rc2 - 2024-04-10

### Compiler

- Fixed a bug on the JavaScript target where variables named `debugger`, which
  is a JavaScript keyword, were not being renamed, leading to runtime errors.

### Formatter

- Fixed a bug where comments would be moved out of an empty bit array.
- Fixed a bug where the formatter could add a trailing comma inside empty
  bit arrays, generating invalid syntax.
- Revert the warning about internal types being exposed in a package's public
  API.

### Build tool

- Revert the change that would make the build tool refuse to publish a package
  that exposes an internal type in its public API.

## v1.1.0-rc1 - 2024-04-08

### Compiler

- The `@internal` attribute can now be used to annotate definitions.
  This will hide those definitions from the generated documentation,
  autocompletions and the exported module interface.
- Prepending to lists in JavaScript (`[x, ..xs]` syntax) has been optimised.
- Function stubs are no longer generated for functions that do not have an
  implementation for the current targeting being compiled for.
- Fixed a bug where some functions would not result in a compile error when
  compiled for a target that they do not support.
- Fixed a bug where sometimes a warning would not be emitted when a result is
  discarded.
- Fixed a bug with JavaScript code generation of pattern matching guards.
- URLs in error messages have been updated for the new language tour.
- Improved error message when erroneously trying to append items to a list using
  the spread syntax (like `[..rest, last]`).
- Generate [type \ 
references](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-)
  when compiling to JavaScript with TypeScript definitions enabled.
- Fix a bug where JavaScript code generation would not properly return the
  result of nested blocks.
- Fix a bug where JavaScript code generation would not properly handle functions
  returned by blocks.
- Fix a bug where Erlang code generation would not properly handle list case
  patterns with no head and a spread tail.
- The compiler will now raise a warning if you're pattern matching on tuple
  literals and suggest you use multiple subjects instead.
- Fixed a bug where JavaScript code generation would incorrectly parenthesise a
  return statement.
- Nested tuple access (`tuple.0.1`) now parses successfully.
- Error messages are more clear about expecting values instead of types.
- Fixed a bug where pattern matching on a string would cause the program to
  crash on the JavaScript target.
- A warning is now emitted when defining an opaque external type.
- Improve error message when using incorrect quotes (`'`) to define a string
- Fixed a bug where Erlang string prefix patterns could generate invalid Erlang.
- Fixed string prefix matching producing wrong results on the JavaScript target
  when the prefix had a Unicode codepoint escape sequence (`\u{...}`).
- Improved error message for wrong patterns using constructors from other
  modules.
- Fixed a bug on the JavaScript target where variables bound by patterns, if
  used within a bit array literal inside a `case` clause's guard, would be used
  before they were defined, leading to a runtime error when evaluating the
  `case` expression.
- Improved error messages when failing to parse a series of things.
- A warning is now raised for unused binary operations, records, record access
  and record updates.
- Fixed a bug when using constant as the size option parameter
  for `BitArray` caused unknown variable exception.
- Improved recommendations on error messages.
- Improved error message for `BitArray` segment sizes.
- A warning is now raised when an internal type is accidentally exposed in a
  package's public API.
- Fixed the error message when using `panic` on the JavaScript target: it now
  correctly identifies the error variant as a `panic` instead of a `todo`.
- Fixed a bug on the JavaScript target where empty lists with little space
  available could compile to a conversion from the array `[ , ]`, causing them
  to wrongly have a length of one (the array has a single `undefined` element).

### Formatter

- The formatting of case expressions with multiple subjects has been improved.
- Fixed a bug where the formatter would move comments from the end of bounded
  expressions like lists, tuples, case expressions or function calls.
- Fixed a bug where a record update's arguments would not be indented correctly.
- Fixed a bug where function call arguments, tuple items and list items would be
  needlessly indented if preceded by a comment.
- Line endings other than `\n` are now handled by the formatter, preserving
  blank lines and converting them to `\n`.
- The formatter can now format groups of imports alphabetically.
- Fixed a bug where comments would be moved out of an empty list.
- Fixed a bug where pipes and binary operations in function calls would be
  nested more than necessary.
- Improved formatting of comments in binary operation chains.

### Build tool

- Added support for the [Bun](https://bun.sh/) runtime when compiling to
  JavaScript by using `gleam run --target javascript --runtime bun`
- Allow compilation of packages that require `"rebar"` using the rebar3
  compiler.
- A warning is now emitted if there is a `.gleam` file with a path that would be
  invalid as a module name.
- The `~> x.y` version constraint syntax has been dropped in favour of
  `> x.y.z and <= xx.0.0` syntax in `gleam add` and `gleam new`, for clarity.
- New projects are created with the GitHub `actions/checkout` v4 action.
- Fixed a bug where bit arrays would break syntax highlighting in the generated
  HTML documentation.
- Dependencies that use Erlang-only bit options can now compile on JavaScript,
  though the functions that use them will not be available for use in the root
  package.
- The output format of the command line help messages have been changed
  slightly.
- The command line help text now lists valid targets and runtimes.
- Generated documentation no longer exposes the constructors of opaque types,
  no longer exposes the values of constants, and indicates which types are
  opaque.
- Generated HTML documentation now includes a link to the package on Hex.
- Terminal colors can now be forced by setting the `FORCE_COLOR` environment
  variable to any non-empty value.
- Rust's Reqwest's `webpki-roots` are now used for TLS verification.
- Update Deno config to allow passing `--location` runtime flag.
- Fixed a bug with dependency resolution of exact versions of RC releases.
- Fixed a bug where the documentation of a labelled record constructor could be
  assigned to the wrong definition in the doc site.
- Fixed a bug where the code blocks in the generated documentation's site would
  have a wrong indentation.
- Fixed a bug where the compiler would panic when it cannot get current
  directory.
- Improved error message for non-UTF-8 paths encountered during Gleam commands.
  Now includes the path that caused the error for better diagnostics.
- Fixed a bug where on windows local packages had absolute paths in the manifest
  instead of relative.
- The `gleam publish` command now asks for confirmation if the package
  repository URL doesn't return a successful status code.
- `gleam publish` can now optionally use a Hex API key to authorise publishing
  and retiring packages, set via the environment variable `HEXPM_API_KEY`.
- `gleam publish` will now refuse to publish placeholder packages, to prevent
  name squatting which is against the Hex terms of service.
- If a package leaks an internal type in its public API, then the build tool
  will now refuse to publish it to Hex.
- Monospaced links in the generated documentation now have the same color as
  common links.
- Fixed a bug where the `export package interface` command would always
  recompile the project ignoring the cache.

### Language Server

- Update messages from the client are now batched to avoid doing excess
  compilation work in the language server, improving performance. This makes a
  large difference in low power machines where the language server could
  struggle to keep up with the edits from the client.
- The `Compiling Gleam` message is no longer emitted each time code is compiled.
  This is to reduce noise in editors that show this message prominently such as
  Neovim.
- Fixed a bug where hovering over an expression in the middle of a pipe would
  give the wrong node.
- Go to definition now works for values in dependency Gleam modules.
- Completions are now provided for module imports.

Files:
RevisionActionfile
1.15modifypkgsrc/lang/gleam/Makefile
1.12modifypkgsrc/lang/gleam/cargo-depends.mk
1.14modifypkgsrc/lang/gleam/distinfo