From 5565dd5f424e362fb9b469f63a9577c697c866fd Mon Sep 17 00:00:00 2001 From: javier-garcia-meteologica <61506396+javier-garcia-meteologica@users.noreply.github.com> Date: Thu, 1 Jul 2021 21:58:55 +0200 Subject: [PATCH] fix: use a more detailed cyclic depedencies warning (#3569) (#3573) --- .changeset/thirty-adults-invite.md | 5 +++++ packages/plugin-commands-installation/src/installDeps.ts | 2 +- .../test/warnCyclicDependencies.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/thirty-adults-invite.md diff --git a/.changeset/thirty-adults-invite.md b/.changeset/thirty-adults-invite.md new file mode 100644 index 0000000000..89e3774813 --- /dev/null +++ b/.changeset/thirty-adults-invite.md @@ -0,0 +1,5 @@ +--- +"@pnpm/plugin-commands-installation": minor +--- + +Use a more detailed cyclic dependencies warning diff --git a/packages/plugin-commands-installation/src/installDeps.ts b/packages/plugin-commands-installation/src/installDeps.ts index 5a104bcc52..6b80215ea8 100644 --- a/packages/plugin-commands-installation/src/installDeps.ts +++ b/packages/plugin-commands-installation/src/installDeps.ts @@ -129,7 +129,7 @@ when running add/update with the --workspace option') ? `: ${sequencedGraph.cycles.map(deps => deps.join(', ')).join('; ')}` : '' logger.warn({ - message: `There are cyclic dependencies${cyclicDependenciesInfo}`, + message: `There are cyclic workspace dependencies${cyclicDependenciesInfo}`, prefix: opts.workspaceDir, }) } diff --git a/packages/plugin-commands-installation/test/warnCyclicDependencies.ts b/packages/plugin-commands-installation/test/warnCyclicDependencies.ts index 8077096565..6799638e01 100644 --- a/packages/plugin-commands-installation/test/warnCyclicDependencies.ts +++ b/packages/plugin-commands-installation/test/warnCyclicDependencies.ts @@ -38,7 +38,7 @@ test('should warn about cyclic dependencies', async () => { expect(logger.warn).toHaveBeenCalledTimes(1) expect(logger.warn).toHaveBeenCalledWith({ - message: expect.stringMatching(/^There are cyclic dependencies: /), + message: expect.stringMatching(/^There are cyclic workspace dependencies: /), prefix: process.cwd(), }) })