pastoralist 0.1.2 โ 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,35 +1,88 @@
|
|
|
1
1
|
# Pastoralist
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+

|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
A tool to watch over node module \***`overrides and resolutions`** ๐ ๐ฉ๐ฝโ๐พ
|
|
7
|
+
|
|
8
|
+
> \***overrides and resolutions** solve the same problem-they give developers a way to specify the dependency versions downloaded to repository's `node_modules`. This is very convenient for setting dependency dependencies to specific versions to fix security issues. However, it is easy to lose track of why an override or resolution is specified. This is an inconvenient problem when trying to maintain useable dependencies over timeโuntil now.
|
|
9
|
+
|
|
10
|
+
---
|
|
6
11
|
## Synopsis
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
By using **Pastoralist** in a `pre-commit` hook (or other npm script or terminal command) your resolution which looks like this:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
// package.json
|
|
17
|
+
"overrides": {
|
|
18
|
+
"trim": "^0.0.3"
|
|
19
|
+
},
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Will look like this:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
// package.json
|
|
26
|
+
"overrides": {
|
|
27
|
+
"trim": "^0.0.3"
|
|
28
|
+
},
|
|
29
|
+
"pastoralist": {
|
|
30
|
+
"appendix": {
|
|
31
|
+
"trim@^0.0.3": {
|
|
32
|
+
"remark-parse": "4.0.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
By simply running a command similar to this!
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
"pre-commit": "pastoralist"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
But there's more! If `pastoralist` is run and a `resolution` or `override` is no longer required, it will clean up itself and resolutions!
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
// pastoralist finds and removes `trim` when/if it's no longer needed!
|
|
48
|
+
"overrides": {},
|
|
49
|
+
"pastoralist": {
|
|
50
|
+
"appendix": {}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
9
56
|
|
|
10
|
-
**Pastoralist** manages `overrides` and `resolutions` so you don't have to!
|
|
11
57
|
## How Pastoralist works
|
|
12
58
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
59
|
+
**Pastoralist** manages `overrides` and `resolutions` so you don't have to!
|
|
60
|
+
|
|
61
|
+
Pastoralist is comprised of a few functions which read `node_module` `package.json` and reduce any `overrides` or `resolutions` within the root `package.json` into a single `appendix` object.
|
|
62
|
+
|
|
63
|
+
- Pastoralist adds an `appendix` with a list of "resolved" dependencies into a `pastoralist` key.
|
|
64
|
+
- Better yet, if Pastoralist observes an `override` or `resolution` is no longer needed, it removes it from `resolutions`, `overrides`, and the pastoralist `appendix` object.
|
|
65
|
+
- This means with Pastoralist, your **only** concern is adding dependencies to the `overrides` and `resolutions` objects.
|
|
16
66
|
|
|
17
67
|
### Key notes
|
|
18
68
|
|
|
19
69
|
- Pastoralist does **not** manage what is added to overrides and resolutions objects.
|
|
20
|
-
- Pastoralist **does** manage
|
|
70
|
+
- Pastoralist **does** manage dependenceis that exists in a `package.json`'s overrides or resolutions objects.
|
|
21
71
|
- Pastoralist will remove overrides and resolutions if they become unneeded according to child `package.json`'s spec!
|
|
22
72
|
|
|
23
|
-
|
|
73
|
+
---
|
|
74
|
+
## Install
|
|
24
75
|
|
|
25
76
|
```sh
|
|
26
77
|
npm install pastoralist --save-dev
|
|
27
78
|
# pastoralist does not expect to be a dependency! It's a tool!!!
|
|
28
79
|
```
|
|
29
80
|
|
|
81
|
+
---
|
|
82
|
+
|
|
30
83
|
## Usage
|
|
31
84
|
|
|
32
|
-
Pastoralist is built to be used as a CLI program
|
|
85
|
+
Pastoralist is built to be used as a CLI program and runs with a single word "pastoralist".`
|
|
33
86
|
|
|
34
87
|
```sh
|
|
35
88
|
pastoralist
|
|
@@ -38,9 +91,12 @@ pastoralist
|
|
|
38
91
|
|
|
39
92
|
Pastoralist can _and should be incorporated_ into your workflowโwhich ever way is best for you and your team's developer experience! ๐
|
|
40
93
|
|
|
41
|
-
|
|
94
|
+
---
|
|
42
95
|
## Roadmap
|
|
43
96
|
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
97
|
+
**Updated `2022-05-20`**
|
|
98
|
+
|
|
99
|
+
- More tests (in progress)
|
|
100
|
+
- Local development setup (next few days)
|
|
101
|
+
- Provide more configuration options using a tool like [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) (within the next weeks)
|
|
102
|
+
- Provide caveats, code examples, and more documentation (next few days)
|