nushell/crates
Devyn Cairns 390a7e3f0b
Add environment engine calls for plugins (#12166)
# Description

This adds three engine calls: `GetEnvVar`, `GetEnvVars`, for getting
environment variables from the plugin command context, and
`GetCurrentDir` for getting the current working directory.

Plugins are now launched in the directory of their executable to try to
make improper use of the current directory without first setting it more
obvious. Plugins previously launched in whatever the current directory
of the engine was at the time the plugin command was run, but switching
to persistent plugins broke this, because they stay in whatever
directory they launched in initially.

This also fixes the `gstat` plugin to use `get_current_dir()` to
determine its repo location, which was directly affected by this
problem.

# User-Facing Changes
- Adds new engine calls (`GetEnvVar`, `GetEnvVars`, `GetCurrentDir`)
- Runs plugins in a different directory from before, in order to catch
bugs
- Plugins will have to use the new engine calls if they do filesystem
stuff to work properly

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

# After Submitting
- [ ] Document the working directory behavior on plugin launch
- [ ] Document the new engine calls + response type (`ValueMap`)
2024-03-12 06:34:32 -05:00
..
nu_plugin_custom_values Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu_plugin_example Add environment engine calls for plugins (#12166) 2024-03-12 06:34:32 -05:00
nu_plugin_formats Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu_plugin_gstat Add environment engine calls for plugins (#12166) 2024-03-12 06:34:32 -05:00
nu_plugin_inc Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu_plugin_python Improve the error message for a plugin version mismatch (#12122) 2024-03-08 06:04:22 -06:00
nu_plugin_query Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu_plugin_stream_example Add support for engine calls from plugins (#12029) 2024-03-09 11:26:30 -06:00
nu-cli Canonicalize config dir (#12136) 2024-03-10 11:07:31 +01:00
nu-cmd-base Allow for stacks to have parents (#11654) 2024-03-09 17:55:39 +01:00
nu-cmd-dataframe Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu-cmd-extra Remove feat extra and include in default (#12140) 2024-03-10 17:29:02 +01:00
nu-cmd-lang do command: Make closure support default parameters and type checking (#12056) 2024-03-11 18:11:08 +08:00
nu-color-config Restructure nu-protocol in more meaningful units (#11917) 2024-03-10 18:45:45 +01:00
nu-command Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu-engine Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-explore Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-glob Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-json remove repetitive word (#12117) 2024-03-08 15:29:20 +08:00
nu-lsp Introduce workspace dependencies (#12043) 2024-03-07 14:40:31 -08:00
nu-parser Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-path Use XDG_CONFIG_HOME before default config directory (#12118) 2024-03-11 06:15:46 -05:00
nu-plugin Add environment engine calls for plugins (#12166) 2024-03-12 06:34:32 -05:00
nu-pretty-hex Introduce workspace dependencies (#12043) 2024-03-07 14:40:31 -08:00
nu-protocol Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu-std Debugger experiments (#11441) 2024-03-08 20:21:35 +02:00
nu-system Bump windows from 0.52.0 to 0.54.0 (#12037) 2024-03-07 16:36:28 -08:00
nu-table Introduce workspace dependencies (#12043) 2024-03-07 14:40:31 -08:00
nu-term-grid Bump version to 0.91.1 (#12085) 2024-03-06 23:08:14 +01:00
nu-test-support Update tests Playground (#12134) 2024-03-08 20:31:21 -08:00
nu-utils Keep plugins persistently running in the background (#12064) 2024-03-09 17:10:22 -06: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.