Skip to content

Commit e0c8480

Browse files
author
Christopher Biel
committed
Initial commit
1 parent ef824ba commit e0c8480

File tree

10 files changed

+733
-0
lines changed

10 files changed

+733
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
.git
3+
node_modules
4+
dist

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# `yaln` (Yet another local npm)
2+
3+
While developing some libraries I noticed that `npm link`, `yarn link` and also partially `yalc` sometimes have problem
4+
when it comes to mimicking the publish process and create an acutally working local environment.
5+
6+
So `yaln` will simply "create" a simple local npm registry.
7+
8+
It will:
9+
- Use `npm pack` to create an actual npm package file and store it in `~/.yaln/packages/`.
10+
- It will watch for changes of packages in `~/.yaln/packages/` and installs them locally.
11+
12+
## Install
13+
14+
git clone ...
15+
cd ...
16+
npm i -g .
17+
18+
Currently, there is no npm package available.
19+
20+
## Update
21+
22+
Simply git pull.
23+
24+
25+
26+
## Usage
27+
28+
### In source project
29+
30+
#### tsc-watch
31+
32+
tsc-watch --onSuccess "yaln pack"
33+
34+
#### Rollup
35+
36+
rollup -c --watch --watch.onBundleEnd="yaln pack"
37+
38+
npm run watch --watch.onBundleEnd="yaln pack"
39+
40+
### In target project
41+
42+
yaln watch [package list]
43+
44+
### Pre commit hook
45+
46+
Simple pre commit hook to ensure no file references in package json get committed:
47+
48+
```yaml
49+
- id: no-relative-packages
50+
name: no-relative-packages
51+
entry: bash -c "git diff --cached --name-only | grep -q 'package.json' && cat package.json | grep -E 'file:.+\/\.yaln\/.+' && echo -e 'file references not allowed in package.json' 1>&2 && exit 1 || exit 0"
52+
language: system
53+
pass_filenames: false
54+
```
55+
56+
# Known bugs
57+
58+
- Looks like sometimes, when the first package update gets detected, the package gets installed twice
59+
60+
# Missing features
61+
62+
- Support `yarn`
63+
- Add command to add dependency without watch
64+
- Allow configuration of exchangePath
65+
- Add CommonJS support

0 commit comments

Comments
 (0)