Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deploy): include all deps by default #5040

Merged
merged 2 commits into from
Jul 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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