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.
Files changed (2) hide show
  1. package/README.md +70 -14
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,35 +1,88 @@
1
1
  # Pastoralist
2
2
 
3
- A tool to watch over node module *`overrides` and *`resolutions` ๐Ÿ‘ ๐Ÿ‘ฉ๐Ÿฝโ€๐ŸŒพ
3
+ ![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript&label&labelColor=blue&color=555555)
4
+ ![Twitter](https://img.shields.io/twitter/url?url=https%3A%2F%2Fgithub.com%2Fyowainwright%2Fpastoralist)
4
5
 
5
- > \***overrides and resolutions**: throughout this repository the key words "overrides" and "resolutions" are used interchangeably because nomenclature between npm, pnpm, and yarn varies. However, the reason and resolution are the same! Use Pastoralist!
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
- To maintain a secure `node_module` ecosystem, the `package.json` keys `overrides` and `resolutions` have implemented to be by [npm](https://www.npmjs.com/), [yarn](https://yarnpkg.com/), and [pnpm](https://pnpm.io/) to provide developers with a last-resort way to fix dependency vulnerabilities.
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
- - It adds an `appendix` to a `pastoralist` key within a project's `package.json` which lists dependencies that are dependent on the `overrides` and `resolutions` keys.
14
- - Better yet, if Pastoralist observes an `override` or `resolution` is no longer needed, it will remove it from the `resolutions`, `overrides`, and pastoralist `appendix` objects.
15
- - This means developers only concern is adding dependencies to the `overrides` and `resolutions` objects.
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 packages that exists in the overrides or resolutions objects.
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
- ## Inistall
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 which runs initially with a single word "pastoralist".`
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
- - [ ] More tests
45
- - [ ] Provide more configuration options using a tool like [cosmiconfig](https://github.com/davidtheclark/cosmiconfig).
46
- - [ ] Provide caveats, code examples, and more documentation.
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pastoralist",
3
- "version": "0.1.2",
3
+ "version": "0.1.5",
4
4
  "description": "A tool to watch over node module resolutions and overrides ๐Ÿ‘ ๐Ÿ‘ฉ๐Ÿฝโ€๐ŸŒพ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",