Subject: CVS commit: pkgsrc/lang/gleam
From: nikita
Date: 2024-02-07 16:36:56
Message id: 20240207153656.C7379FA42@cvs.NetBSD.org

Log Message:
gleam: update to version 0.34.1

Changelog:

v0.34.1 - 2023-01-17
Build tool changes

    Support has been added for using SourceHut as a repository.

Bug fixes

    Fixed a bug where long function headers with external implementations could \ 
format incorrectly.
    The @deprecated attribute can now be used to annotate module constants. This \ 
will cause a warning to be emitted when the constant is used.

v0.34.0 - 2023-01-16
v0.34.0-rc3 - 2023-01-12
Language changes

    "echo" is now a reserved word.
    A warning is no longer emitted when a function has a Gleam implementation as \ 
well as external implementations for both targets. This is because having a \ 
default Gleam implementation means the code is future-proof and continues to be \ 
cross platform even if a new target is added.

Bug fixes

    Fixed a bug where function heads would go over the line limit in the formatter.

v0.34.0-rc2 - 2023-01-11
Bug fixes

    Fixed a bug where gleam run would fail when the current directory is not the \ 
root of the project and using the JavaScript target.
    Fixed a bug where the compiler would in some cases fail to error when an \ 
application uses functions that do not support the current compilation target.

v0.34.0-rc1 - 2024-01-07
Language changes

    Warn about function body not being used, because it already has external \ 
implementations for all targets.
    It's now possible to compile a project with external functions in dependency \ 
packages that are not supported by the compilation target so long as they are \ 
not used on the current target.
    The error message for when one imports a constructor instead of an \ 
homonymous type has been improved.

Language Server Changes

    Added a View on HexDocs link on function hover.

Formatter

    Fixed some quirk with the formatting of binary operators.
    Fixed a bug where the formatter would move a function call's closed \ 
parentheses on a new line instead of splitting the function's arguments.
    Now the formatter will format tuples as if they were functions, trying to \ 
first split just the last element before splitting the whole tuple.
    Improved the formatting of multiline strings in string concatenation.

Build tool changes

    The gleam new command now accepts any existing path, as long as there are no \ 
conflicts with already existing files. Examples: gleam new ., gleam new .., \ 
gleam new ~/projects/test.
    The format for the README created by gleam new has been altered.
    The gleam.toml created by gleam new now has a link to the full reference for \ 
its available options.
    The gleam binary is now statically linked on Windows.
    New projects are created requiring between versions of v0.34.0 inclusive and \ 
exclusive v2.0.0.
    The repository section now supports additional VCS types in the form of \ 
codeberg, forgejo and gitea allowing a user, repo and additionally a host url.
    TypeScript declaration for the prelude exports previously missing functions \ 
and classes. Additionally, swaps interfaces for classes and adds missing \ 
attributes to classes.
    gleam commands now look in parent directories for a gleam.toml file.

Bug fixes

    Fixed a bug where gleam add would not update manifest.toml correctly.
    Fixed a bug where fn() { Nil }() could generate invalid JavaScript code.
    Fixed a bug where the build tool would make unnecessary calls to the Hex API \ 
when path dependencies are used.
    Fixed a bug where gleam new would generate a gitignore with build rather \ 
than /build.
    Fixed where the types of generic constants could be incorrecly inferred.
    Utf8Codepoint has been renamed to UtfCodepoint in prelude.d.mts.
    Fixed a bug where gleam deps list would look in filesystem root instead of \ 
the current directory.
    Fixed a bug with the isEqual function in prelude.js where RegExps were being \ 
incorrectly structurally compared and being falsely reported as being equal.
    JavaScript: export from prelude.d.mts in gleam.d.mts to fix the error: \ 
"Type 'Result' is not generic".
    Not providing a definition after some attributes is now a parse error.

v0.33.0 - 2023-12-18
v0.33.0-rc4 - 2023-12-17

    The deprecated bit array options binary and bit_string have been removed.
    The deprecated ambiguous type import syntax has been removed.
    The deprecated BitString type has been removed.
    The deprecated inspect functions and BitString type has been removed from \ 
the JavaScript prelude.

v0.33.0-rc3 - 2023-12-17
Formatter

    The formatter now tries to split long chains of binary operations around the \ 
operator itself, rather than around other elements like lists or function calls.

Bug fixes

    Fixed a bug where string prefix aliases defined in alternative case branches \ 
would all be bound to the same constant.

v0.33.0-rc2 - 2023-12-07
Language changes

    The \e string escape sequence has been removed. Use \u{001b} instead.
    Generated Erlang now disabled redundant case clause warnings as these are \ 
now redundant due to exhaustiveness checking.

Bug fixes

    Fixed a bug where the \u string escape sequence would not work with on \ 
Erlang on the right hand side of a string concatenation.

v0.33.0-rc1 - 2023-12-06
Formatter

    The formatter now tries to keep a function body and its arguments on a \ 
single line by first trying to split only its last argument on multiple lines.
    Fixed a bug where the formatter would move comments out of blocks.
    gleam format now ignores the Gleam build directory by default, even when not \ 
in a git repository.

Language changes

    Gleam now has full exhaustiveness checking. Exhaustiveness issues have been \ 
downgraded from errors to warnings so that existing Gleam code can be upgraded \ 
to be exhaustive without breaking existing code. In a future version they will \ 
be upgraded to errors.
    The ! operator can now be used in clause guards.
    The words auto, delegate, derive, else, implement, macro, and test are now \ 
reserved for future use. If used they will emit a warning. In a future version \ 
this may be upgraded to an error.
    The \u{...} syntax can be used in strings to specify unicode codepoints via \ 
a hexadecimal number with 1 to 6 digits.
    The todo as and panic as syntaxes now accept an expression that evaluates to \ 
a string rather than just a string literal.

Build tool changes

    The gleam run and gleam test commands gain the -t flag, which is an alias of \ 
the --target flag.
    The gleam build, gleam check, gleam run and gleam test commands now also \ 
accept js and erl as values for the --target flag.
    The gleam new command now creates packages at version 1.0.0.
    The gleam publish command now asks for confirmation if the package being \ 
published is not yet version 1.0.0.
    The gleam publish command now asks for confirmation if the package name is \ 
one that implies the package is maintained by the Gleam core team.
    The error messages shown when dependency resolution fails have been improved.

Compiler WASM API

    The WASM API for the compiler has been rewritten to be simpler.
    The WASM API for the compiler now exposes warnings.

HTML documentation generator

    Searching in rendered HTML documentation now also matches words that do not \ 
start with the input but do contain it.

Bug fixes

    Fixed a bug where the JavaScript code generator could generate invalid code \ 
when pretty printing a zero arity function call when the line is over 80 columns \ 
wide.
    Fixed a bug where the build directory could be left in an invalid state if \ 
there is Elixir code to compile and running on Windows without permission to \ 
create symlinks.
    Fixed a bug where numbers with preceeding zeros could generate incorrect \ 
JavaScript.
    The Erlang code generated by the /. operator no longer generates a warning \ 
for the upcoming negative zero float change in Erlang OTP 27.
    Fixed a bug where using only types from an aliased import, wouldn't stop the \ 
compiler from emitting an unused alias warning for that import.
    Fixed a bug where the formatter would remove the  as name from string prefix \ 
patterns.
    Fixed a bug where the formatter would misplace comments at the start of a block.
    Fixed a bug where using a string prefix pattern in let assert would generate \ 
incorrect JavaScript.

v0.32.4 - 2023-11-09
Build tool changes

    The build tool now supports rebar3 and mix hex packages where the package \ 
name differs from the otp application name.

bug fixes

    Fixed a bug where invalid javascript code could be generated when a module \ 
function calls another function that was passed as an argument and the argument \ 
has the same name as the module function.
    Fixed the target property of gleam.toml being ignored for local path \ 
dependencies by gleam run -m module/name

v0.32.3 - 2023-11-07
Language changes

    Imported modules can now be discarded by giving them an alias starting with _.

Build tool changes

    New projects are now generated with the call to gleam format coming last in \ 
the GitHub Actions workflow. This is so that feedback from tests is presented \ 
even if formatting is incorrect.
    Added Windows support for the gleam export erlang-shipment command.

Bug fixes

    Fixed a bug where some nested pipelines could fail to type check.

v0.32.2 - 2023-11-03
Build tool changes

    New Gleam projects are created with gleam_stdlib v0.32 and gleeunit v1.0.

Bug fixes

    Fixed a bug where gleam fix would not produce correct results for code that \ 
shadowed a prelude name with an import of the same name but a different kind.
    Fixed a bug where documentation would not publish to Hexdocs for packages \ 
with a number in the name.
    Fixed a bug where aliased unqualified types and values of the same name \ 
could produce an incorrect error.

v0.32.1 - 2023-11-02
Bug fixes

    Fixed a bug where gleam fix would not produce correct results for code that \ 
shadowed a prelude name with an import of the same name but a different kind.
    Fixed a bug where incorrect JavaScript could be generated due to backwards \ 
compatibility with the deprecated import syntax.

v0.32.0 - 2023-11-01
Bug fixes

    Fixed a bug where running gleam fix multiple times could produce incorrect \ 
results.

v0.32.0-rc3 - 2023-10-26
Bug fixes

    Fixed a bug where gleam fix would fail to update the deprecated type import \ 
syntax for aliased unqualified types.

v0.32.0-rc2 - 2023-10-26
Bug fixes

    Fixed a bug where the backward compatibility for the deprecated import \ 
syntax could result in an import error with some valid imports.

v0.32.0-rc1 - 2023-10-25
Language changes

    Using import module.{TypeName} to import a type has been deprecated, \ 
replaced by import module.{type TypeName}. In a future version of Gleam the old \ 
syntax will only import the value of the same name. Run gleam fix to update your \ 
code.
    The BitString type has been renamed to BitArray. Run gleam fix to update \ 
your code.
    The binary and bit_string bit array modifier have been deprecated in favour \ 
of bytes and bits.
    The error message for when one element in a list doesn't match the others \ 
has been improved.
    The error message for when the elements of a list's tail don't match the \ 
previous ones has been improved.
    The error message for when one tries to access an unknown field has been \ 
improved.
    The __gleam_prelude_variant__ property has been removed from the classes \ 
defined in the JavaScript prelude.
    The deprecated todo("...") syntax has been removed.
    Module access can now be used in case clause guards.
    The JS target now supports bit syntax for module constants.
    The Erlang compiler will no longer emit a duplicate warning for unused functions.
    The @deprecated attribute can now be used with type definitions.
    A warning is now emitted if a module alias is unused.

Language server changes

    The language server now has a code action for removing unused items.
    The language server now shows the type of variables defined using use on hover.

Build tool changes

    The gleam check command supports the target flag.
    The gleam fix command updates code to use BitArray rather than BitString.
    The gleam fix command updates code to use the new import type syntax.
    gleam fix sets the gleam version constraint in gleam.toml to >= 0.32.0.
    The gleam version constraint field in gleam.toml now disregards pre and \ 
build components when checking for compatibility.
    The prelude is no longer rendered once per package when compiling to \ 
JavaScript, instead one copy is rendered for the entire project. If you are \ 
using the gleam compile-package API you now need to give a path to the prelude \ 
using the --javascript-prelude flag.
    The gleam export javascript-prelude and gleam export typescript-prelude \ 
commands have been added to export a copy of the prelude. This command may be \ 
useful for build tools that use the compiler via the gleam compile-package API.
    Fixed a bug where some deprecation messages would not be printed.
    The content has been made wider in rendered HTML documentation.
    Dependencies that can be built with both mix and rebar3 are now built with \ 
mix if it exists on the system, and with rebar3 if it doesn't.

Bug fixes

    "Compiling $package" is now only printed when a package has new \ 
changes to compile.
    The main process started with gleam run no longer traps exits on Erlang.
    The formatting of code in rendered HTML documentation has been improved.
    The formatter no longer moves trailing comments out of custom type definitions.
    Fixed a bug where some hexidecimal numbers would generate incorrect Erlang.
    Fixed a bug where markdown tables would not render correctly in HTML \ 
documentation.
    The float 0.0 is now rendered in Erlang as +0.0 to silence warnings in \ 
Erlang/OTP 27.

v0.31.0 - 2023-09-25

    New Gleam projects are created with gleam_stdlib v0.31, actions/checkout \ 
v3.*, and erlef/setup-beam v1.*.
    A note is included in the generated HTML documentation if a function is \ 
deprecated.

v0.31.0-rc1 - 2023-09-18

    The @deprecated("...") attribute can be used to mark a function as \ 
deprecated. This will cause a warning to be emitted when the function is used.
    A warning is now emitted if a module from a transitive dependency is imported.
    Record access can now be used in case clause guards.
    Fixed a bug where manifest.toml could contain absolute paths for path \ 
dependencies.
    The as keyword can now be used to assign the literal prefix to a variable \ 
when pattern matching on a string.
    The if conditional compilation, external fn, and external type syntaxes have \ 
been removed.
    The description flag for the gleam new command has been removed.
    The highlight.js grammar included with generated HTML documentation has been \ 
updated for the latest syntax.
    Packages are no longer precompiled to Erlang when publishing to Hex if the \ 
package target is set to JavaScript.
    An exception is now raised if JavaScript code uses the BitString class \ 
constructor and passes in the incorrect argument type.
    Fixed a bug where mutually recursive functions could be incorrectly inferred \ 
as having an overly general type.
    Fixed a bug where recursive type constructors could incorrectly infer a type \ 
error.
    Fixed a bug where some mutually recursive functions would be inferred as \ 
having too general a type.
    Fixed a bug where constants where not being correctly inlined when used in \ 
the size option of a bit string pattern match.
    Fixed a bug where anonymous functions could parse successfully when missing \ 
a body.
    Fixed a bug where incorrect unused variable warnings could be emitted for \ 
code that doesn't type check.
    Fixed a bug where packages defaulting to the JavaScript target could have \ 
modules missing from their HTML documentation when published.
    Corrected some outdated links in error messages.
    Hovering over a function definition will now display the function signature, \ 
or the type of the hovered argument.
    Use import type for importing types from typescript declarations.
    Use .d.mts extension for typescript declarations to match .mjs.
    Prefix module names with dollar sign in typescript to avoid name collisions.

Files:
RevisionActionfile
1.13modifypkgsrc/lang/gleam/Makefile
1.10modifypkgsrc/lang/gleam/cargo-depends.mk
1.12modifypkgsrc/lang/gleam/distinfo