From f0c6a797fe763fa2e310debb5ece1a53891aff7d Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sat, 16 Jul 2022 17:42:10 +0300 Subject: [PATCH 1/2] fix(deploy): include all deps by default close #5035 --- .changeset/cool-chefs-march.md | 6 ++++++ packages/plugin-commands-deploy/src/deploy.ts | 1 - packages/plugin-commands-deploy/test/deploy.test.ts | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/cool-chefs-march.md diff --git a/.changeset/cool-chefs-march.md b/.changeset/cool-chefs-march.md new file mode 100644 index 00000000000..2b405077cd6 --- /dev/null +++ b/.changeset/cool-chefs-march.md @@ -0,0 +1,6 @@ +--- +"@pnpm/plugin-commands-deploy": patch +"pnpm": patch +--- + +`pnpm deploy` should include all dependencies by default [#5035](https://github.com/pnpm/pnpm/issues/5035). diff --git a/packages/plugin-commands-deploy/src/deploy.ts b/packages/plugin-commands-deploy/src/deploy.ts index f3ba49b0bcf..48867de0195 100644 --- a/packages/plugin-commands-deploy/src/deploy.ts +++ b/packages/plugin-commands-deploy/src/deploy.ts @@ -61,7 +61,6 @@ export async function handler ( }, frozenLockfile: false, preferFrozenLockfile: false, - dev: false, virtualStoreDir: path.join(deployDir, 'node_modules/.pnpm'), modulesDir: path.relative(deployedDir, path.join(deployDir, 'node_modules')), }) diff --git a/packages/plugin-commands-deploy/test/deploy.test.ts b/packages/plugin-commands-deploy/test/deploy.test.ts index d3b6a7c7e5a..ec5feebe40e 100644 --- a/packages/plugin-commands-deploy/test/deploy.test.ts +++ b/packages/plugin-commands-deploy/test/deploy.test.ts @@ -48,6 +48,8 @@ test('deploy', async () => { ...DEFAULT_OPTS, allProjects, dir: process.cwd(), + dev: false, + production: true, recursive: true, selectedProjectsGraph, workspaceDir: process.cwd(), From 6ceb267c90fdc0039846340bc3e134c8aa98f317 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sat, 16 Jul 2022 17:47:40 +0300 Subject: [PATCH 2/2] fix: add options to help --- packages/plugin-commands-deploy/src/deploy.ts | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/plugin-commands-deploy/src/deploy.ts b/packages/plugin-commands-deploy/src/deploy.ts index 48867de0195..3505325cf85 100644 --- a/packages/plugin-commands-deploy/src/deploy.ts +++ b/packages/plugin-commands-deploy/src/deploy.ts @@ -8,6 +8,8 @@ import PnpmError from '@pnpm/error' import rimraf from '@zkochan/rimraf' import renderHelp from 'render-help' +export const shorthands = install.shorthands + export function rcOptionsTypes () { return install.rcOptionsTypes() } @@ -21,9 +23,29 @@ export const commandNames = ['deploy'] export function help () { return renderHelp({ description: 'Experimental! Deploy a package from a workspace', - descriptionLists: [], url: docsUrl('deploy'), usages: ['pnpm --filter= deploy '], + descriptionLists: [ + { + title: 'Options', + list: [ + { + description: "Packages in `devDependencies` won't be installed", + name: '--prod', + shortAlias: '-P', + }, + { + description: 'Only `devDependencies` are installed regardless of the `NODE_ENV`', + name: '--dev', + shortAlias: '-D', + }, + { + description: '`optionalDependencies` are not installed', + name: '--no-optional', + }, + ], + }, + ], }) }