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.
Files changed (2) hide show
  1. package/README.md +12 -9
  2. 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
- - [ ] **Add the plugin** – From the monorepo root, run: `pnpm add --config pnpm-plugin-alex-857@latest`
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
- For updates: when a new version of the plugin is released, running **`pnpm install`** is enough (preinstall will pull the latest).
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: Add the plugin as a config dependency
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 add --config pnpm-plugin-alex-857@latest
33
+ pnpm run setup
34
+ pnpm install
34
35
  ```
35
36
 
36
- This updates your `pnpm-workspace.yaml` with a `configDependencies` entry and installs the plugin so its pnpmfile and catalog are used on every `pnpm install`.
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
- "pnpm:devPreinstall": "pnpm add --config pnpm-plugin-alex-857@latest && node node_modules/.pnpm-config/pnpm-plugin-alex-857/install-workspace.js",
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
- - **pnpm:devPreinstall**: Runs **before** dependency resolution. Installs the plugin and runs install-workspace.js so `pnpm-workspace.yaml` has the catalog and packages **before** `catalog:` is resolved. This avoids `ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC`.
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
- The **preinstall** script runs `pnpm add --config pnpm-plugin-alex-857@latest`, so the latest plugin version is installed automatically. No extra steps are required.
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pnpm-plugin-alex-857",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "A plugin for pnpm to use alex as a linter",
5
5
  "bin": {
6
6
  "install-catalog": "./install-catalog.js",