Skip to content

Commit

Permalink
[patch] only run extra install commands if deps were installed
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed Nov 26, 2024
1 parent 0054918 commit 14bf919
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 93 deletions.
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/mono-repo-root",
"version": "13.8.2",
"version": "13.8.3",
"private": true,
"type": "module",
"workspaces": [
Expand Down
6 changes: 3 additions & 3 deletions packages/compile/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/compile",
"version": "13.8.2",
"version": "13.8.3",
"description": "Default TS compile plugin for virmator.",
"keywords": [
"virmator",
Expand Down Expand Up @@ -34,12 +34,12 @@
"@augment-vir/assert": "^30.8.2",
"@augment-vir/common": "^30.8.2",
"@augment-vir/node": "^30.8.2",
"@virmator/core": "^13.8.2"
"@virmator/core": "^13.8.3"
},
"devDependencies": {
"@augment-vir/test": "^30.8.2",
"@types/node": "^22.9.0",
"@virmator/plugin-testing": "^13.8.2",
"@virmator/plugin-testing": "^13.8.3",
"c8": "^10.1.2",
"chalk": "^5.3.0",
"concurrently": "^9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/core",
"version": "13.8.2",
"version": "13.8.3",
"description": "Shared core functionality for all virmator plugins and the virmator CLI.",
"keywords": [
"automation",
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/api/install-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,14 @@ export async function installNpmDeps({
},
);

const depsToInstallEntries = Object.entries(depsThatNeedInstalling);

await awaitedBlockingMap(
depsToInstallEntries,
const installed = await awaitedBlockingMap(
Object.entries(depsThatNeedInstalling),
async ([
depType,
deps,
]) => {
if (!deps.length) {
return;
return false;
}

const installDeps: string = deps.join(' ');
Expand All @@ -141,10 +139,12 @@ export async function installNpmDeps({
hookUpToConsole: true,
rejectOnError: true,
});

return true;
},
);

return !!depsToInstallEntries.length;
return installed.some(check.isTrue);
}

function combineDeps(packageJson: Readonly<PackageJson>) {
Expand Down
4 changes: 2 additions & 2 deletions packages/deps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/deps",
"version": "13.8.2",
"version": "13.8.3",
"description": "Default TS deps plugin for virmator.",
"keywords": [
"virmator",
Expand Down Expand Up @@ -36,7 +36,7 @@
"@augment-vir/assert": "^30.8.2",
"@augment-vir/common": "^30.8.2",
"@augment-vir/node": "^30.8.2",
"@virmator/core": "^13.8.2",
"@virmator/core": "^13.8.3",
"mri": "^1.2.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virmator/docs",
"version": "13.8.2",
"version": "13.8.3",
"description": "Default TS docs plugin for virmator.",
"keywords": [
"virmator",
Expand Down Expand Up @@ -35,7 +35,7 @@
"@augment-vir/assert": "^30.8.2",
"@augment-vir/common": "^30.8.2",
"@augment-vir/node": "^30.8.2",
"@virmator/core": "^13.8.2",
"@virmator/core": "^13.8.3",
"chalk": "^5.3.0",
"mri": "^1.2.0"
},
Expand Down
Loading

0 comments on commit 14bf919

Please sign in to comment.