Skip to content

Commit

Permalink
chore(docs): fix wrong Nargo.toml workspace examples (#4822)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves #4805

## Summary\*

This PR fixes the issue found by @iAmMichaelConnor in #4805, where the
example Nargo.toml content for [workspace] has
 members with wrong paths. 

Since the structure has Nargo.toml inside the `crates` folder, then
`members` should direct to folders inside `crates`.
``` file structure
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │       └── main.nr
│   └── b
│       ├── Nargo.toml
│       └── src
│           └── main.nr
├── Nargo.toml
└── Prover.toml
```

## Additional Context

All nargo versions I've tested with, from v0.19.0 to v0.27.0, return
`Cannot read file /home/sihanouk/crates/crates/a/Nargo.toml - does it
exist?` without the fix.

## Documentation\*

Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
SihanoukSolver29 authored Apr 17, 2024
1 parent d817d81 commit 23e1f3b
Show file tree
Hide file tree
Showing 13 changed files with 158 additions and 132 deletions.
22 changes: 12 additions & 10 deletions docs/docs/noir/modules_packages_crates/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand All @@ -36,4 +38,4 @@ default-member = "crates/a"

Libraries can be defined in a workspace. Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml.

Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml.
Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand All @@ -36,4 +38,4 @@ default-member = "crates/a"

Libraries can be defined in a workspace. Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml.

Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml.
Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ For a project with the following structure:

```tree
├── crates
│   ├── a
│   │   ├── Nargo.toml
│   │   └── src
│   │   └── main.nr
│   └── b
│   ├── Nargo.toml
│   └── src
│   └── main.nr
├── Nargo.toml
└── Prover.toml
│ ├── a
│ │ ├── Nargo.toml
│ │ └── Prover.toml
│ │ └── src
│ │ └── main.nr
│ └── b
│ ├── Nargo.toml
│ └── Prover.toml
│ └── src
│ └── main.nr
└── Nargo.toml
```

You can define a workspace in Nargo.toml like so:
Expand Down

0 comments on commit 23e1f3b

Please sign in to comment.