Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update workspaces guide for consistency #4426

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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