fix(patch): improve printing of the pnpm patch command (#8239)

* style(patch): improve printin of the `pnpm patch` command

* fix: add missing dep

* test: fix

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
Christoph Nakazawa
2024-06-28 08:28:00 +09:00
committed by GitHub
parent 497fea8de5
commit fd884c1915
6 changed files with 51 additions and 6 deletions

View File

@@ -9,6 +9,8 @@ import {
} from '@pnpm/store-connection-manager'
import pick from 'ramda/src/pick'
import renderHelp from 'render-help'
import chalk from 'chalk'
import terminalLink from 'terminal-link'
import tempy from 'tempy'
import { PnpmError } from '@pnpm/error'
import { type ParseWantedDependencyResult } from '@pnpm/parse-wanted-dependency'
@@ -101,9 +103,15 @@ export async function handler (opts: PatchCommandOptions, params: string[]): Pro
})
}
}
return `You can now edit the following folder: ${editDir}
return `Patch: You can now edit the package at:
Once you're done with your changes, run "pnpm patch-commit '${editDir}'"`
${terminalLink(chalk.blue(editDir), 'file://' + editDir)}
To commit your changes, run:
${chalk.green(`pnpm patch-commit '${editDir}'`)}
`
}
function tryPatchWithExistingPatchFile (