pnpm-plugin-alex-857 1.0.30 → 1.0.31

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.
@@ -91,3 +91,24 @@ console.log(
91
91
  "pnpm-workspace.yaml with packages (no duplicates):",
92
92
  mergedPackages.join(", ")
93
93
  );
94
+
95
+ // Ensure catalog is in pnpm-workspace.yaml before resolution (preinstall runs before install).
96
+ // So dependencies with "catalog:" resolve; otherwise we get ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC.
97
+ const catalogJsonPath = [
98
+ path.join(__dirname, "pnpm-catalog.json"),
99
+ path.join(process.cwd(), "pnpm-catalog.json"),
100
+ ].find((p) => fs.existsSync(p));
101
+ if (catalogJsonPath && fs.existsSync(yamlPath)) {
102
+ const yamlNow = fs.readFileSync(yamlPath, "utf8");
103
+ if (!/\ncatalog\s*:/m.test(yamlNow)) {
104
+ const catalogData = JSON.parse(fs.readFileSync(catalogJsonPath, "utf8"));
105
+ const catalogBlock =
106
+ "\ncatalog:\n" +
107
+ Object.entries(catalogData)
108
+ .map(([name, version]) => ` ${name}: ${version}`)
109
+ .join("\n") +
110
+ "\n";
111
+ fs.writeFileSync(yamlPath, yamlNow.trimEnd() + catalogBlock, "utf8");
112
+ console.log("Added catalog to pnpm-workspace.yaml (for catalog: resolution).");
113
+ }
114
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pnpm-plugin-alex-857",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "A plugin for pnpm to use alex as a linter",
5
5
  "bin": {
6
6
  "install-catalog": "./install-catalog.js",