pnpm-plugin-alex-857 1.0.32 → 1.0.33
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 +12 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,26 +14,29 @@ A pnpm config plugin that provides a shared **catalog** of dependency versions a
|
|
|
14
14
|
|
|
15
15
|
Use this checklist when setting up a monorepo with this plugin:
|
|
16
16
|
|
|
17
|
-
- [ ] **
|
|
17
|
+
- [ ] **One-time setup** – From the monorepo root, run **`pnpm run setup`** then **`pnpm install`**. Commit `pnpm-workspace.yaml` so others can run `pnpm install` directly.
|
|
18
18
|
- [ ] **Add scripts** – Copy the `scripts` block from Step 2 below into your root `package.json`
|
|
19
19
|
- [ ] **Use the catalog** – Add dependencies with `catalog:` in root or workspace `package.json`, or run `pnpm run install:catalog` to add all catalog packages at once
|
|
20
20
|
- [ ] **Verify** – Run `pnpm install` and confirm install and postinstall complete without errors
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
**Why setup first?** pnpm reads `pnpm-workspace.yaml` once at the start of `pnpm install`. It does not re-read after lifecycle scripts. So the **catalog** and **configDependencies** must already be in the file before `pnpm install` runs, or you get `ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC`. Running `pnpm run setup` once writes them, then `pnpm install` works. Commit the updated yaml so teammates don’t need to run setup.
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
26
|
## Setup (step by step)
|
|
27
27
|
|
|
28
|
-
### Step 1:
|
|
28
|
+
### Step 1: One-time setup (required when using `catalog:`)
|
|
29
29
|
|
|
30
|
-
From your monorepo root:
|
|
30
|
+
From your monorepo root, run **once** (e.g. first clone or when you get `ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC`):
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
pnpm
|
|
33
|
+
pnpm run setup
|
|
34
|
+
pnpm install
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
Then **commit `pnpm-workspace.yaml`**. After that, anyone can run `pnpm install` without running setup.
|
|
38
|
+
|
|
39
|
+
`pnpm run setup` installs the plugin and writes **packages**, **catalog**, and **configDependencies** into `pnpm-workspace.yaml`. pnpm does not re-read that file during the same `pnpm install`, so the catalog must be there **before** you run `pnpm install`.
|
|
37
40
|
|
|
38
41
|
### Step 2: Add scripts to your root `package.json`
|
|
39
42
|
|
|
@@ -41,13 +44,13 @@ This updates your `pnpm-workspace.yaml` with a `configDependencies` entry and in
|
|
|
41
44
|
|
|
42
45
|
```json
|
|
43
46
|
"scripts": {
|
|
44
|
-
"
|
|
47
|
+
"setup": "pnpm add --config pnpm-plugin-alex-857@latest && node node_modules/.pnpm-config/pnpm-plugin-alex-857/install-workspace.js",
|
|
45
48
|
"postinstall": "pnpm run install:catalog",
|
|
46
49
|
"install:catalog": "node node_modules/.pnpm-config/pnpm-plugin-alex-857/install-catalog.js"
|
|
47
50
|
}
|
|
48
51
|
```
|
|
49
52
|
|
|
50
|
-
- **
|
|
53
|
+
- **setup**: Run **once** (or when you see the catalog error). Installs the plugin and writes **packages** + **catalog** + **configDependencies** into `pnpm-workspace.yaml`. Then run `pnpm install`; commit the yaml so others don’t need to run setup.
|
|
51
54
|
- **postinstall**: Runs after `pnpm install` and adds all catalog packages to the root (if not already present).
|
|
52
55
|
- **install:catalog**: Manual script to add all catalog packages at once.
|
|
53
56
|
|
|
@@ -84,7 +87,7 @@ pnpm add react@catalog:
|
|
|
84
87
|
pnpm install
|
|
85
88
|
```
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
To get the latest plugin, run **`pnpm run setup`** then **`pnpm install`** (and commit the updated `pnpm-workspace.yaml` if you want to pin the version).
|
|
88
91
|
|
|
89
92
|
---
|
|
90
93
|
|