Skip to content

Commit

Permalink
docs: update workspaces guide for consistency (#4426)
Browse files Browse the repository at this point in the history
Signed-off-by: Tierney Cyren <[email protected]>
  • Loading branch information
bnb authored Feb 16, 2022
1 parent 20378c6 commit 408d2fc
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions docs/content/using-npm/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,25 @@ Workspaces are usually defined via the `workspaces` property of the
{
"name": "my-workspaces-powered-project",
"workspaces": [
"workspace-a"
"packages/a"
]
}
```

Given the above `package.json` example living at a current working
directory `.` that contains a folder named `workspace-a` that itself contains
directory `.` that contains a folder named `packages/a` that itself contains
a `package.json` inside it, defining a Node.js package, e.g:

```
.
+-- package.json
`-- workspace-a
`-- package.json
`-- packages
+-- a
| `-- package.json
```

The expected result once running `npm install` in this current working
directory `.` is that the folder `workspace-a` will get symlinked to the
directory `.` is that the folder `packages/a` will get symlinked to the
`node_modules` folder of the current working dir.

Below is a post `npm install` example, given that same previous example
Expand All @@ -56,11 +57,12 @@ structure of files and folders:
```
.
+-- node_modules
| `-- workspace-a -> ../workspace-a
| `-- packages/a -> ../packages/a
+-- package-lock.json
+-- package.json
`-- workspace-a
`-- package.json
`-- packages
+-- a
| `-- package.json
```

### Getting started with workspaces
Expand Down

0 comments on commit 408d2fc

Please sign in to comment.