Setting up our workspace
If you followed this book's code in the official GitHub repository, you probably noticed that we had a file structure like this:
├── package.json ├── packages │ ├── chapter-x │ ├── chapter-y └── yarn.lock
Workspaces are usually structured like this: a root package.json
file and infinite modules inside a packages/
folder. This module must contain a package.json
file, which must have name and version properties.
It is flexible enough to allow us to define in the root package.json
file where your modules are located. So, technically, you could just create the modules in the root, or even inside other folders or names.
For example, we could create a root package.json
file with this configuration:
{ "name": "my-workspaces-project", "version": "...