https://github.com/aitoroses/yarn-autolink
A tool for easily managing monorepos (multipackage packages)
https://github.com/aitoroses/yarn-autolink
Last synced: 21 days ago
JSON representation
A tool for easily managing monorepos (multipackage packages)
- Host: GitHub
- URL: https://github.com/aitoroses/yarn-autolink
- Owner: aitoroses
- Created: 2016-12-06T16:36:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-12T18:11:24.000Z (over 9 years ago)
- Last Synced: 2025-11-28T17:42:16.110Z (7 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yarn-autolink
> A tool for easily managing monorepos (multipackage packages)
## Why create another monorepo tool
[Lerna](https://lernajs.io/) and other tools exist that help you managing monorepos. `yarn-autolink`'s makes it a bit easier and uses yarn for everything under the hood.
yarn-autolink tries not to be prescriptive on how to develop your packages, like other alternatives out there do.
It's a tool for basically installing subpackage dependencies and creating and controlling links between them.
# Install
```
$ npm install --save-dev yarn-autolink
```
## Configuration
To create a monorepo:
- Install yarn-link
- Setup a structure like this:
```
root
|
- package.json
- packages
|
- package1
|
- package.json
- package2
|
- package.json
```
Each package will define a section in it's package.json for defining it's dependencies between local packages
- Add linkDependencies to you packages
```
"name": "beta",
"version": "1.0.0"
"linkDependencies": {
"alpha": "1.0.0"
}
```
Thats enough to start working by doing `autolink bootstrap`
## CLI Usage
```
yarn-autolink CLI tool
usage: autolink [options]
commands:
bootstrap Install node_modules for each package and run 'link' command too
link Resolve dependencies between modules and link them using yarn
clean Remove links and remove node_modules directories
exec [--scope | --script] Execute an NPM script in the scope of a package
example: autolink exec --scope @application/core --script start
add|remove [--scope | --dev ] Install a package for for a specific scoped package and then links packages
example: autolink add babel-core --dev --scope @application/core
options:
scope The name of the package to act in the scope of
script Name of the NPM script to be executed
```
## Examples
There's an example folder in this repo but I encourage you to have a look on how to configure a React application with a storybook using a monorepo in this [link](https://github.com/aitoroses/monorepo-starter).