Subject: CVS commit: pkgsrc/shells/nushell
From: pin
Date: 2023-01-23 22:25:14
Message id: 20230123212514.A1C7BFA90@cvs.NetBSD.org

Log Message:
shells/nushell: update to 0.74.0

0.74.0
Themes of this release / New features
 - Known externals commands and exec now have "fall-through" signatures
   (merelymyself, WindSoilder, kubouch). A common pitfall in Nushell when
   defining custom signatures using extern used to be that unrecognized
   arguments passed to the command would throw an error. Now, arguments are
   still checked against the extern signature but those that are not recognized
   are simply ignored.

   exec uses similar style which fixes errors with tools like ssh and gdb that
   internally invoke exec.
 - help is now more helpful (kubouch). For a long time, Nushell had the option
   to provide custom help messages for commands via comments.
   In this release, we allow user-defined help messages with aliases and
   modules. This goes hand-in-hand with a handful of new help subcommands to
   explore these help messages. The help messages now also treat the first line
   followed by an empty line as a "brief" description displayed in summary
   tables generated by help commands, $nu.scope.aliases, etc. The full
   description is available when querying a particular command/alias/module
   (e.g., help spam). This brief vs. full separation was already present for
   built-in commands, like path, but now it is applied also to all user-defined
   help messages. The current batch of improvements can still be taken further.
   For example, custom help messages could possibly be defined also for
   variables and environment variables (via comments adjacent to let and
   let-env). We could also further improve the presentation of existing help
   xxx commands.
 - nitial support for parse-time constants (kubouch). This is a
   proof-of-concept that we plan to expand in the future. Tip: We also addedd a
   new book section with an in-depth explanation of Nushell's parsing and
   evaluation, hopefully clearing up some confusion about things like
   "Why can't I source a dynamic path?". It also touches on the concept of
   parse-time constants. A new const keyword is added to Nushell to define
   "parse-time" constants. Constants defined with const behave the same as
   variables defined with let, but in addition, they are usable in some
   contexts that require values known at parse-time. Currently, this applies
   to files or names passed to use, overlay use, source, and source-env.
   Only a limited subset of values is allowed to be a constant. In general,
   "simple" values, like strings or integers, and their collections (lists,
   records) are allowed but values requiring some evaluation (string
   interpolation, subexpressions, environment variables) are not allowed.
   The current selection is not set in stone, however, and might change in
   the future.

   Some future direction we can take this:
    - Move parts of $nu to be constant to allow things like source
      $nu.config-path
    - Allow modules to have constants (module spam { const CONTENTS =
      [ 'eggs', 'bacon', 'sausage', 'spam' ] })
    - Some limited form of parse-time evaluation to allow static control flow
   In general, we want to be very conservative with parse-time constants and
   evaluation because it can be easy to introduce awkward side-effects and
   performance pitfalls. We plan to extend this only where it brings some
   tangible benefit to Nushell's user experience.
 - New url encode command to percent-encode URLs (MehulG). To encode text that
   is used as a path component in a URL we now provide url encode. By default
   it preserves the structure of a URL and only replaces invalid characters.
   With --all the whole string gets encoded.
 - values command to programmatically interact with records (webbedspace).
   This is a complement to columns, designed to allow the values of a record
   to be easily filtered and iterated over using the standard list tools like
   each and where. The name values is derived from similar functions in Ruby,
   Python and JavaScript. It can also operate on tables to convert them to
   lists-of-lists.
 - get, select, cell path access on tables will now error when encountering
   a hole (kubouch, webbedspace). Formerly, this would produce ['bar', null] -
   converting the table hole into a null. Now, however, they will produce an
   error. The original null-conversion behaviour can, as usual, be opted into
   using the -i flag for get and select: [{foo: 'bar'}, {}] | get -i foo
   produces ['bar', null]. (There are also plans for a future version of
   Nushell to expand the cell path syntax to allow certain cell names to be
   "nullable" - converted to null if they don't exist.).
 - Behavior of -i/--ignore-errors flag for get and select when the entire
   column is absent has changed. Formerly, if select -i or get -i couldn't find
   any value for the given column, it would produce a single null. This has
   been changed so that it now produces a table (or, in the case of get, a
   list) of all nulls. This change was made to make this flag work more
   consistently with default and compact.
 - Certain misused punctuation in def definitions are now errors (webbedspace).
   The following misuses of punctuation in def definitions now produce errors:
    - Placing a comma between a long flag and its short alternative (e.g. def
      a [--foo, (-f)] {})
    - Consecutive commas, like def a [foo,,bar] {}
    - Consecutive colons, like def a [foo::int] {}
    - Using ^ in command names, like def ^a [] {}
 - $in now works in catch closures.
   $in in catch closures now behaves identically to how it does in other
   closures, like those given to each (it's equivalent to what would be the
   first named argument).
   try { 'x' | math abs } catch { print $in } behaves the same as try
   { 'x' | math abs } catch {|e| print $e }.
 - MIME-types are supported in ls with an additional flag. (fdncred). To find
   out what application your operating system associates with a particular
   file, you can now use the --mime-type or -m flag on our ls command.
   This simplifies filtering for particular files and can help you dispatch
   files to particular programs. When opening files with Nushell directly,
   open will still follow the same heuristics using file endings and the
   built-in from ... command parsers.
 - Regular expression queries are cached for performance (rgwood). The primary
   motivation for this is to make regex and =~ operator uses in hooks and
   color_config closures more performant.
 - All built-in commands now declare their pipeline input and output types
   (sholderbach). A few releases back commands internally got the capability
   to declare not only the types of parameters but also pairs for the input
   and output on the pipeline. With this release we finally declare those
   input and output types for all core nushell commands. This can help you as
   user to see what a command expects from the pipeline and might return. We
   are exploring how nushell can leverage that for more useful diagnostics
   and completions. In the future we may introduce syntax for user-defined
   commands to declare their input and output types explicitly.

 - Breaking changes
    - get and select now error when encountering a hole
    - the behaviour of -i on get and select has changed columns will now error
      for data that is not a table or a record (#7593)
    - The dataframe specific command fill-na has been renamed to fill-nan to
      better represent its capabilities (#7565)
    - The requirements for the names of a nu command and a command alias have
      been tightened to avoid some problems (#7392)
    - to toml will only produce output for records now as the output for tables
      is ambiguous and may be invalid to parse (#7597)
    - exec and known externals don't throw errors when unknowns parameters are
      passed to them
    - help command has been thoroughly refactored and includes several more
      subcommands. help <word> now matches commands, aliases, and modules.
    - command names in help commands and $nu.scope.commands are displayed
      correctly if they were imported from a module with a prefix
    - hide command no longer hides environment variables. Use hide-env instead.
      (#7687)
    - math eval has been removed in favour of the direct math commands and
      expressions (see help operators as well) (#7284)
    - last, skip, drop, take until, take while, skip until, skip while, where,
      reverse, shuffle, and sort-by are now stricter about which types of data
      they accept (#7623)

0.73.0
Themes of this release / New features
PLEASE NOTE: Boolean && and || have changed
 - The boolean && is now and and the boolean || is now or. These were \ 
deprecated
   in the 0.72 release and have now been removed. Existing scripts will need to
   be updated to the new syntax to run in 0.73.
 - Experimental interactive explore command (zhiburt). This release includes a
   new experimental command called explore for viewing Nu data in an
   interactive UI. Some things to try:
    - pipe a large table to explore (ex: ls | explore) and use explore as a
      fancy pager
    - run explore, then type :try and press the Enter key to enter a mode where
      you can run commands inside explore

      explore is highly experimental and we expect it to change in the future.
      Please report any issues you discover.
 - New math commands (sholderbach). With this release we include a larger number
   of math commands for real valued math such as trigonometric functions and
   logarithms. The goal is to remove the math eval command that operates on
   strings instead of proper nushell expressions.
 - Changes to commands with predicates (kubouch). any, all, skip until,
   skip while, take until, and take while now accept a closure instead of a row
   condition. This makes them slightly more verbose but it is a part of an
   effort to refactor our parser to allow defining concrete grammar rules for
   the Nu language. Row condition is currently accepted only in the where
   command which becomes a parser built-in command (like use or let).
 - New filter command and simpler where (kubouch). We found the -b flag of
   where quite confusing and decided to remove it in favor of a new filter
   command. Both filter and where have similar functionality but where now only
   accepts a row condition and filter accepts a closure. Why is it useful to
   have two commands doing the same thing? Because with the filter command,
   you can store the closure in a variable. On the other hand, where is more
   concise ([{a: 1} {a: 2}] | where a > 1) but you can't store its condition in
   a variable. The choice is yours!
 - New command uniq-by (raccmonteiro). To complement uniq which can identify
   unique or duplicated values in a collection or report the number of
   occurrences for a particular entry, we now have uniq-by. It supports
   filtering a table by entries appearing in a particular column.
 - Mutable data structures can now have their inner values mutated using
   = (webbedspace). If a variable has been defined as mutable using the
   recently-added mut keyword, you can now deeply mutate its inner values
   using =. This syntax enhancement was added primarily to make modifying
   $env.config during a normal session much easier. Now, $env.config is
   considered inherently mutable. You can change a single config value.
 - More sophisticated coloring of data values using closures (webbedspace).
   The color_config config record has new functionality: instead of specifying
   a single color name for all values of a given type, you may now alternatively
   provide a closure that dynamically computes a color for each individual
   value. The closure takes, as input, a single value of the given type, and
   must produce either a string value representing a color, or a
   { fg, bg, attr } record (the same as what color_config already accepts as a
   color value). This feature can be used to provide important visual
   distinctions between ranges of values in data.
   This causes all filesize values to be colored using dark_gray if they equal
   0b, cyan_bold if they are less than 1mb, and blue_bold otherwise. This means
   that, in ls output, empty files can be more easily distinguished from
   non-empty ones. This colors true in light_cyan, and false in light_gray.
   This can be useful when browsing a large table of booleans. The themes in
   the default config.nu file have been updated with further examples of these
   closures.
   In certain situations (most notably, during a single ls call that isn't
   piped to anything else) Nushell will parallelize the execution of these
   closures. As such, you cannot expect that they will run in the same order
   as each value appears in the output data.

   WARNING
   Currently, closures are only supported for output values - they do not work
   with color settings that begin with shape_, such as shape_literal. They also
   do not work with the color configuration for the new explore command. Only
   values inside of tables are highlighted using closures.

   Breaking Changes
   - split row command will retain an empty string if splitted string is empty.
     (#7413)
   - split list now properly removes the separator in all positions (#7355)
   - The --show-created-paths flag has been replaced by --verbose from mkdir.
   - fetch removes --output, --bin, --append flags, use fetch with save to save
     fetched page to a file. (#7468)
   - changes to how get works with deep cell paths (#7480)
   - mkdir's -s/--show-created-paths has been renamed to -v/--verbose for better
     consistency (#7462)
   - && is now and and || is now or
   - any, all, skip until, skip while, take until, take while now take only a
     closure as an argument.
   - where now takes only row condition argument, -b flag removed.

0.72.1
 - This is the 0.72.1 release of Nushell. It is a hotfix release of 0.72.0 that
   changes how the Ubuntu release binary is built so that it does not change
   glibc versions.

0.72.0
Today, we're releasing version 0.72 of Nu. This release includes many new
features: mutability, looping, early returns, changes to the core commands,
and much more.

NOTE: as part of this release, we are no longer including additional features
in --features=extra. With 0.72, SQLite features have moved into the main
Nushell installation and dataframe functionality is now part of
--features=dataframe.

As part of this release, we also publish a set of optional plugins you can
install and use with Nu. To install, use cargo install nu_plugin_<plugin name>.

Themes of this release / New features
 - Try/catch
   Starting with 0.72, it's now much easier to run a command that might fail
   and then handle the failure if it happens.

The catch part of the try/catch is optional. Without it, the try block will
run, and any error that occurs will be ignored.

 - Auto-expanding data views
   Expanded data view

With the new default config, we now also detect the terminal width and will
automatically expand the data view to include more information if it's
available.

This uses an improved expanding data view capability from 0.70.

 - Redirection

This release also includes a new way of redirecting the stdout and/or stderr
of external commands. This gives easier access to the output streams than was
previously possible.

You can also create a stream built from the above, allowing one stream to empty
and then be followed by the other stream.

 - Closures/blocks

We have now split closures and blocks into two separate value types. A closure
can have parameters, can close over variables outside of its scope, and can be
passed as a value.

You can also think of creating a custom command like def foo [] { ... } as
creating a closure.

A block is much simpler and is used as the bottom of commands like if and loops.

Blocks don't close over (or capture) variables, don't have parameters, and
can't be passed as a value. Blocks, however, do have one special trick...

 - Mutation

Starting in this release, you can create local mutable variables. You can
create mutable variables using the mut keyword.

A mutable variable can only live and change in the closure in which it's
created. Blocks, however, have access to the mutable variables in the parent
closure. For example, mutating a variable inside of the block used in an if
call is valid.

 - Loop/while

The 0.72 release also includes a few new looping commands: loop and while.
The loop command runs a block forever.
The while command will run its block as long as a condition is met:

 - Break/continue

Loops can now also use the break and continue feature common in many programming
languages. break will break out of the current loop. And continue will continue
the loop at the next iteration.

 - Return

The 0.72 release also includes the ability to return early from a closure or
command.

 - Command refinement, simplification, and elimination

This release contains many breaking changes to Nu's built-in commands (sorry!).
As we move toward version 1.0 we want to ensure that Nu ships with a small
curated set of consistent, well-designed "standard library" commands.
This requires taking a hard look at existing commands, and in some cases
breaking changes are unavoidable. We expect that this effort will span a
few release cycles.

 - Dataframes no longer included by default - smaller binaries

Nu's dataframe support is extensive, impressive, and very useful to users who
rely on it. However, it comes at a high cost in terms of compile time, binary
size, and complexity. Starting with version 0.72, dataframe commands are no
longer included in the release binaries published on GitHub or the default
binaries published via package managers (like Homebrew, winget, Scoop).
As a result of this change, the main Nu executable is now about 50% smaller.

To continue using dataframe commands, you can build Nu from source using the
dataframe Cargo feature. For example, to install using Cargo: cargo install
nu --features=dataframe.

 - Allow reloading overlay definitions (kubouch)

A common pattern in using overlays is shadowing an existing environment
variable, such as PROMPT_COMMAND. However, overlay use would keep loading the
value from the first activation.

Calling overlay use prompt for the first time changes the prompt to the current
time, however, subsequent calls to overlay use won't change the time. That's
because overlays, once activated, store their state so they can be hidden and
restored at later time. To force-reload the environment, we added a new --reload
flag: Calling overlay use --reload prompt repeatedly now updates the prompt with
the current time each time.

 - virtualenv activation changes (kubouch)

Since the verion 20.17.0 of virtualenv, the new way to activate an environment
is to call overlay use activate.nu instead of the source activate.nu. This
change is in line with gradual deprecation of source and moving us towards
using modules as overlays in more cases. Please, check the activation script
itself for more details.

 - Breaking changes

    - As mentioned above, dataframe support has been removed from the default
      Nu binaries.
     - Nu's SQLite DSL commands have been removed. open foo.db and open
       foo.db | query db "SELECT * ..." still work, but the commands which
       mapped 1-to-1 with SQL clauses (ex: open foo.db | into db | select * |
       from table some_table | order-by some_column) have been removed.
       These commands were an interesting experiment but they didn't work out,
       and we're removing them to simplify database access in Nu.
     - The is_plugin, is_custom, and is_keyword columns in help commands have
       been replaced with a single command_type column.
     - date format now returns an error if not given an input. Previously it
       would default to the current time.
     - first and last will now return an error if given a negative index.
       Previously the behavior was undefined and may have returned entries
       due to an underflow.
     - The --predicate flag has been removed from find. where can be used in
       all situations where find --predicate was previously used.
     - sort-by now requires a column name to sort by. To sort lists without
       specifying a column name, sort can be used.
     - seq, seq char, and seq date no longer have --separator and --terminator
       flags (#7045, #7054, #7096). This helps ensure that the return type for
       those commands is consistent, and str join can be used to accomplish the
       same effect.
     - The build-string command has been removed. To concatenate strings, use
       the + operator, string interpolation, or str join.
     - wrap now expands ranges. It works the same as with lists or seq.
     - url parse url scheme, url host, url path, and url query commands have
       been removed. We added the command url parse.
       This new command returns a Record with scheme, username, password, host,
       path, query, params (as a Record) and fragment.
     - sort, sort-by, str contains and find have had their --insensitive flags
       renamed to --ignore-case. --ignore-case is used by uniq, as well as
       popular external commands like less, grep and wget, so it could be
       considered a standard flag name.

 - New boolean operator xor - Planned operator simplification

To complement our logical boolean operators and/&& and or/|| we added boolean
xor. This is consistent with bit-and, bit-xor, and bit-or.

We are currently considering to deprecate the C-style symbols &&/|| in \ 
favor of
the spelled out and/or to increase consistency and provide more actionable
error messages when trying to use &&/|| in a similar fashion to bash.

 - Config options have been grouped together

The structure of $env.config (and thus the record used with let-env config =
statements in config.nu and other places) has been reorganised. Various options
are now grouped into subrecords (similar to table_trim) and had their names
shortened. This allows config.nu files to be better structured, and thus easier
to edit and read, while also allowing future options to be added without making
the,

WARNING

Your existing config.nu options WILL still work in this version!! However,
you will get a warning message if you use the old versions of the options
(as you might already be aware). Support for these old options will be dropped
in a future Nushell update, so take care to convert your config.nu files when
you can.

The changes are:
    - use_ls_colors and clickable_links have been moved to into an ls subrecord.
    - rm_always_trash has been moved into the rm record. Further rm config
      options to accompany it may appear in the future.
    - cd_with_abbreviations has been moved into a cd record. Further cd config
      options to accompany it may appear in the future.
    - history_file_format, sync_history_on_enter and max_history_size have been
      moved to a history subrecord.
    - filesize_metric and filesize_format have been moved to a filesize
      subrecord.
    - case_sensitive_completions, quick_completions, partial_completions and
      completion_algorithm have been moved into a completions subrecord.
    - The completions subrecord also contains an external subrecord.
       - enable_external_completion, max_external_completion_results, and
         external_completer have been moved into the aforementioned subrecord.
       - table_mode, table_index_mode and the table_trim subrecord have been
         moved into a table subrecord.

To output your existing options in the above format (that could be pasted into
your config.nu file before you delete the old options), run this code in your
copy of Nushell:

 - Minimum Rust version has bumped to 1.65

Due to some breakage in dependencies, we've gone ahead and bumped the required
version of Rust to 1.65, which addresses the issue. Apologies to anyone who is
inconvenienced by the bump. We anticipate returning to the Rust-1 versions in
the future.

Files:
RevisionActionfile
1.27modifypkgsrc/shells/nushell/Makefile
1.15modifypkgsrc/shells/nushell/cargo-depends.mk
1.19modifypkgsrc/shells/nushell/distinfo