Skip to content

Commit

Permalink
fix(deploy): include all deps by default (#5040)
Browse files Browse the repository at this point in the history
close #5035
  • Loading branch information
zkochan committed Jul 17, 2022
1 parent 0e9fa30 commit 31e73ba
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/cool-chefs-march.md
Original file line number Diff line number Diff line change
@@ -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).
25 changes: 23 additions & 2 deletions packages/plugin-commands-deploy/src/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand All @@ -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=<deployed project name> deploy <target directory>'],
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',
},
],
},
],
})
}

Expand Down Expand Up @@ -61,7 +83,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')),
})
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-commands-deploy/test/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ test('deploy', async () => {
...DEFAULT_OPTS,
allProjects,
dir: process.cwd(),
dev: false,
production: true,
recursive: true,
selectedProjectsGraph,
workspaceDir: process.cwd(),
Expand Down

0 comments on commit 31e73ba

Please sign in to comment.