Skip to content

remove directory module autoexport #11133

@amtoine

Description

@amtoine

Related problem

we've discussed this on Discord and in a Nushell meeting: directory module auto-exports are handy but sometimes annoying and force to do strange things

  • to hide a module as internal, you'd have to put it inside a subdirectory without any mod.nu
  • trying to export definitions manually produces duplicated objects, e.g. 4 times the same command in help main-command

it has been agreed in said meeting that this feature could be removed to allow more power when it comes to module architecture 😋

Describe the solution you'd like

i think it would be great to remove the auto-export by default => users would have to export them manually, as in more traditional languages such as Rust or Python.

we could imagine a new syntax that would export all from directory, something like

use dir/*

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Metadata

Assignees

Labels

A:modulesIssues related to functionality of the module system. See also usage:modulescategory:enhancementNew feature or requeststatus:needs-triageAn issue that hasn't had any proper look

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions