pastoralist 0.1.3 โ†’ 0.1.4

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 +57 -20
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,63 @@
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
 
59
+ **Pastoralist** manages `overrides` and `resolutions` so you don't have to!
60
+
13
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.
14
62
 
15
63
  - Pastoralist adds an `appendix` with a list of "resolved" dependencies into a `pastoralist` key.
@@ -22,6 +70,7 @@ Pastoralist is comprised of a few functions which read `node_module` `package.js
22
70
  - Pastoralist **does** manage dependenceis that exists in a `package.json`'s overrides or resolutions objects.
23
71
  - Pastoralist will remove overrides and resolutions if they become unneeded according to child `package.json`'s spec!
24
72
 
73
+ ---
25
74
  ## Install
26
75
 
27
76
  ```sh
@@ -29,6 +78,8 @@ npm install pastoralist --save-dev
29
78
  # pastoralist does not expect to be a dependency! It's a tool!!!
30
79
  ```
31
80
 
81
+ ---
82
+
32
83
  ## Usage
33
84
 
34
85
  Pastoralist is built to be used as a CLI program and runs with a single word "pastoralist".`
@@ -40,24 +91,10 @@ pastoralist
40
91
 
41
92
  Pastoralist can _and should be incorporated_ into your workflowโ€”which ever way is best for you and your team's developer experience! ๐Ÿ‘Œ
42
93
 
43
- ### Example output
44
-
45
- ```js
46
- // package.json
47
- "overrides": {
48
- "trim": "^0.0.3"
49
- },
50
- "pastoralist": {
51
- "appendix": {
52
- "trim@^0.0.3": {
53
- "remark-parse": "4.0.0"
54
- }
55
- }
56
- }
57
- ```
58
-
94
+ ---
59
95
  ## Roadmap
60
96
 
61
97
  - [ ] More tests
98
+ - [ ] Local development setup
62
99
  - [ ] Provide more configuration options using a tool like [cosmiconfig](https://github.com/davidtheclark/cosmiconfig).
63
100
  - [ ] Provide caveats, code examples, and more documentation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pastoralist",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",