Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plaidev/link-local-dependencies
symlink local dependencies
https://github.com/plaidev/link-local-dependencies
npm-link npm-package
Last synced: about 1 month ago
JSON representation
symlink local dependencies
- Host: GitHub
- URL: https://github.com/plaidev/link-local-dependencies
- Owner: plaidev
- License: mit
- Created: 2019-09-17T03:58:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-09T02:30:12.000Z (9 months ago)
- Last Synced: 2024-10-14T06:41:09.341Z (2 months ago)
- Topics: npm-link, npm-package
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@plaidev/link-local-dependencies
- Size: 656 KB
- Stars: 14
- Watchers: 66
- Forks: 6
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Link local dependencies
Just make relative symbolic links in local dependencies, not update, install or check differences.
## Usage
- package.json
```package.json{
"scripts": {
"postinstall": "npx @plaidev/link-local-dependencies",
"local:postinstall": "echo 'this script will be executed after linking local dependencies'"
},
"localDependencies": {
"packageA": "./packages/packageA"
}
}```
- js
```ts
import packageA from 'packageA';
const packageA = require('packageA');
```- make links
```
$ npx @plaidev/link-local-dependencies
```## Before you use
This package requires `node.js >= 10.12.0`, since we use fs.mkdir with recursive option.
## Why
We, dev members in plaid inc, are developping very big product which is written in nodejs with mono structured repository.
To develop mono structured repository with nodejs, we have to orchestrate multiple packages to harmonize each other. Luckily, there are some choices to handle it. For example, lerna is one of these, which is widely used in many mono structured projects. We tried several useful utilities, lerna, yarn workspace, pnpm workspace, and npm link. These utilities, however, were not suited to our case. Lerna forces us to unnecessarily learn extra usages, yarn hoisting breaks docker environment with too many filesytem use, pnpm breaks dependency solving, and npm link has fatal bugs! Eventually, we adopted an super simple solution - just linking -.