Skip to content

Commit

Permalink
add a table of content
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Jun 4, 2023
1 parent c2da065 commit 937ab93
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions docs/design/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ This file collects design ideas and directions. The intention is iterate on this
> - `NUPM_HOME`: the location of all the `nupm` files, overlays, scripts, libraries, ...,
> e.g. `~/.nupm/`, `$env.XDG_DATA_HOME/nupm/` or `~/.local/share/nupm/`
## Project Structure
# Table of content
- [Project Structure](#project-structure-toc)
- [Separate virtual environments](#separate-virtual-environments-toc)
- [Installation, bootstraping](#installation-bootstraping-toc)
- [Dependency handling](#dependency-handling-toc)
- [Package repository](#package-repository-toc)
- [API / CLI Interface](#api--cli-interface-toc)
- [Other CLI-related points](#other-cli-related-points-toc)
- [Other](#other-toc)

## Project Structure [[toc](#table-of-content)]

A `nupm` project is defined by `METADATA_FILE`.
This is where you define name of the project, version, dependencies, etc., and the type of the project.
Expand Down Expand Up @@ -43,7 +53,7 @@ You can also install non-Nushell packages as well using a "custom" project type
(e.g., you can install Nushell itself with it).
Plugins should also be supported, preferably not requiring fully custom `build.nu`.

## Separate virtual environments
## Separate virtual environments [[toc](#table-of-content)]

> Inspiration: Python, [conda](https://docs.conda.io/en/latest), `cargo`
Expand All @@ -63,7 +73,7 @@ The overlays could be used to achieve all three goals at the same time. When ins

Each package would basically have its own overlay. This overlay file (it's just a module) could be used to also handle dependencies. If your project depends on `foo` and `bar` which both depend on `spam` but different versions, they could both import the different verions privately in their own overlay files and in your project's overlay file would be just `export use path/to/foo` and `export use path/to/bar`. This should prevent name clashing of `spam`. The only problem that needs to be figured out is how to tell `foo` to be aware of its overlay.

## Installation, bootstraping
## Installation, bootstraping [[toc](#table-of-content)]

Requires these actions from the user (this should be kept as minimal as possible):
* Add `NUPM_HOME/bin` to PATH (install location for binary projects)
Expand All @@ -82,7 +92,7 @@ There are several approaches:
* (in the future maybe) as a compiled binary (using something like [`jntrnr/nu_app`])
* This would allow us to reverse the installation steps: Instead of Nushell installing `nupm`, we could let user only install `nupm` which would in turn install Nushell

## Dependency handling
## Dependency handling [[toc](#table-of-content)]

In compiled programming languages, there are two kinds of dependencies: static and dynamic. Static are included statically and compiled when compiling the project,
dynamic are pre-compiled libraries linked to the project.
Expand All @@ -101,14 +111,14 @@ Dynamic dependencies are the opposite basically.
We might want `nupm` support both types of dependencies.

## Package repository
## Package repository [[toc](#table-of-content)]

Packages need to be stored somewhere. There should be one central "official" location (see https://github.com/NixOS/nixpkgs for inspiration).

Additionally, user should be able to add 3rd party repositories as well as install local and other packages (e.g., from the web, just pointing at URL),
as long as it has `METADATA_FILE` telling `nupm` what to do.

## API / CLI Interface
## API / CLI Interface [[toc](#table-of-content)]

Nushell's module design conflates CLI interface with API -- they are the same. Not all of the below are of the same priority.

Expand Down Expand Up @@ -166,7 +176,7 @@ Nushell's module design conflates CLI interface with API -- they are the same. N
- `nupm overlay import`
- create overlay from exported file

### Other CLI-related points
### Other CLI-related points [[toc](#table-of-content)]

* We could later think about being able to extend `nupm`, like `cargo` has plugins.
* Mutable actions (like install) have by default Y/n prompt, but can be overriden with `--yes`
Expand All @@ -176,7 +186,7 @@ Nushell's module design conflates CLI interface with API -- they are the same. N
* Linux
* Android (if someone is willing to maintain it, we're not testing Nushell on Android, at least for now)

## Other
## Other [[toc](#table-of-content)]

* activations
* doc generation
Expand Down

0 comments on commit 937ab93

Please sign in to comment.