nushell/crates
Piepmatz 9b7f899410
Allow missing fields in derived FromValue::from_value calls (#13206)
# Description
In #13031 I added the derive macros for `FromValue` and `IntoValue`. In
that implementation, in particular for structs with named fields, it was
not possible to omit fields while loading them from a value, when the
field is an `Option`. This PR adds extra handling for this behavior, so
if a field is an `Option` and that field is missing in the `Value`, then
the field becomes `None`. This behavior is also tested in
`nu_protocol::value::test_derive::missing_options`.

# User-Facing Changes
When using structs for options or similar, users can now just emit
fields in the record and the derive `from_value` method will be able to
understand this, if the struct has an `Option` type for that field.

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting
A showcase for this feature would be great, I tried to use the current
derive macro in a plugin of mine for a config but without this addition,
they are annoying to use. So, when this is done, I would add an example
for such plugin configs that may be loaded via `FromValue`.
2024-06-22 13:31:09 -07:00
..
nu_plugin_custom_values Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_example Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_formats Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_gstat Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_inc Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_nu_example Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_polars Polars default infer (#13193) 2024-06-22 07:23:42 -05:00
nu_plugin_python Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_query Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu_plugin_stress_internals Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-cli Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-cmd-base Improves commands that support range input (#13113) 2024-06-18 07:19:13 -05:00
nu-cmd-extra Make which-support feature non-optional (#13125) 2024-06-12 20:04:12 -05:00
nu-cmd-lang Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-cmd-plugin Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-color-config Move most of the peculiar argument handling for external calls into the parser (#13089) 2024-06-19 21:00:03 -07:00
nu-command Suppress column index for default cal output (#13188) 2024-06-22 07:41:29 -05:00
nu-derive-value Allow missing fields in derived FromValue::from_value calls (#13206) 2024-06-22 13:31:09 -07:00
nu-engine Table help rendering (#13182) 2024-06-19 20:12:25 -05:00
nu-explore nu-explore: Add vertical lines && fix index/transpose issue (#13147) 2024-06-21 12:07:57 -07:00
nu-glob bump version to 0.94.3 (#13055) 2024-06-05 06:52:40 +08:00
nu-json bump version to 0.94.3 (#13055) 2024-06-05 06:52:40 +08:00
nu-lsp bump version to 0.94.3 (#13055) 2024-06-05 06:52:40 +08:00
nu-parser Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-path add $nu.data-dir for completions and $nu.cache-dir for other uses (#13122) 2024-06-11 15:10:31 -04:00
nu-plugin Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-plugin-core bump version to 0.94.3 (#13055) 2024-06-05 06:52:40 +08:00
nu-plugin-engine Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-plugin-protocol Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-plugin-test-support Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
nu-pretty-hex bump version to 0.94.3 (#13055) 2024-06-05 06:52:40 +08:00
nu-protocol Allow missing fields in derived FromValue::from_value calls (#13206) 2024-06-22 13:31:09 -07:00
nu-std Return an empty list when no std help --find results are found (#13160) 2024-06-15 12:27:55 -05:00
nu-system fix nu-system build on arm64 FreeBSD (#13196) 2024-06-21 03:03:10 -07:00
nu-table Improve performance of explore - 1 (#13116) 2024-06-12 18:35:04 -07:00
nu-term-grid bump version to 0.94.3 (#13055) 2024-06-05 06:52:40 +08:00
nu-test-support Move most of the peculiar argument handling for external calls into the parser (#13089) 2024-06-19 21:00:03 -07:00
nu-utils Add shape_glob_interpolation to default_config.nu (#13198) 2024-06-21 06:17:29 -05:00
nuon Move most of the peculiar argument handling for external calls into the parser (#13089) 2024-06-19 21:00:03 -07:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.