Skip to content

Commit 7ec3f94

Browse files
committed
0.4.3: add pnpm override diff
1 parent ff34381 commit 7ec3f94

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

cli/index.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,34 @@ const overridePnpm = async () => {
9090
}, {});
9191

9292
const pkgJsonData = await fs.readJSON(pkgJsonPath);
93+
const prev = Object.keys(pkgJsonData.pnpm.overrides);
94+
const next = Object.keys(overrides);
9395

9496
pkgJsonData.pnpm.overrides = overrides;
95-
9697
await fs.writeJSON(pkgJsonPath, pkgJsonData, { spaces: 2 });
9798

9899
console.log(
99100
"Your CoSpace's workspace links have been overriden. Run `pnpm install`, `pnpm build` and you're good to go!"
100101
);
102+
103+
const removed = prev.filter((name) => !next.includes(name));
104+
const added = next.filter((name) => !prev.includes(name));
105+
106+
if (removed.length) {
107+
console.log(
108+
`\nYou removed the following packages from your CoSpace:\n- ${removed.join(
109+
"\n- "
110+
)}`
111+
);
112+
}
113+
if (added.length) {
114+
console.log(
115+
`\nYou added the following packages to your CoSpace:\n- ${added.join(
116+
"\n- "
117+
)}`
118+
);
119+
}
120+
101121
};
102122

103123
const purge = async () => {

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cospace",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "Setup a `CoSpace` to link multiple (mono)repos together!",
55
"author": "https://github.com/aruniverse",
66
"license": "MIT",

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
"private": true,
55
"scripts": {
66
"preinstall": "npx only-allow pnpm",
7-
"init:test": "cospace init test",
8-
"purge": "cospace purge",
9-
"setOverrides": "cospace override",
107
"list-pkgs": "pnpm ls -r --depth -1"
118
},
129
"packageManager": "[email protected]",

0 commit comments

Comments
 (0)