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: update pnpm install flags #1820

Merged
merged 1 commit into from
Oct 27, 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
4 changes: 2 additions & 2 deletions lib/package-managers/pnpm.package-manager.ts
Expand Up @@ -16,8 +16,8 @@ export class PnpmPackageManager extends AbstractPackageManager {
// As of PNPM v5.3, all commands are shared with NPM v6.14.5. See: https://pnpm.js.org/en/pnpm-vs-npm
get cli(): PackageManagerCommands {
return {
install: 'install',
add: 'install',
install: 'install --strict-peer-dependencies=false',
add: 'install --strict-peer-dependencies=false',
update: 'update',
remove: 'uninstall',
saveFlag: '--save',
Expand Down
14 changes: 7 additions & 7 deletions test/lib/package-managers/pnpm.package-manager.spec.ts
Expand Up @@ -23,8 +23,8 @@ describe('PnpmPackageManager', () => {
});
it('should have the correct cli commands', () => {
const expectedValues: PackageManagerCommands = {
install: 'install',
add: 'install',
install: 'install --strict-peer-dependencies=false',
add: 'install --strict-peer-dependencies=false',
update: 'update',
remove: 'uninstall',
saveFlag: '--save',
Expand All @@ -39,15 +39,15 @@ describe('PnpmPackageManager', () => {
const dirName = '/tmp';
const testDir = join(process.cwd(), dirName);
packageManager.install(dirName, 'pnpm');
expect(spy).toBeCalledWith('install --reporter=silent', true, testDir);
expect(spy).toBeCalledWith('install --strict-peer-dependencies=false --reporter=silent', true, testDir);
});
});
describe('addProduction', () => {
it('should use the proper command for adding production dependencies', () => {
const spy = jest.spyOn((packageManager as any).runner, 'run');
const dependencies = ['@nestjs/common', '@nestjs/core'];
const tag = '5.0.0';
const command = `install --save ${dependencies
const command = `install --strict-peer-dependencies=false --save ${dependencies
.map((dependency) => `${dependency}@${tag}`)
.join(' ')}`;
packageManager.addProduction(dependencies, tag);
Expand All @@ -59,7 +59,7 @@ describe('PnpmPackageManager', () => {
const spy = jest.spyOn((packageManager as any).runner, 'run');
const dependencies = ['@nestjs/common', '@nestjs/core'];
const tag = '5.0.0';
const command = `install --save-dev ${dependencies
const command = `install --strict-peer-dependencies=false --save-dev ${dependencies
.map((dependency) => `${dependency}@${tag}`)
.join(' ')}`;
packageManager.addDevelopment(dependencies, tag);
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('PnpmPackageManager', () => {
const tag = '5.0.0';
const uninstallCommand = `uninstall --save ${dependencies.join(' ')}`;

const installCommand = `install --save ${dependencies
const installCommand = `install --strict-peer-dependencies=false --save ${dependencies
.map((dependency) => `${dependency}@${tag}`)
.join(' ')}`;

Expand All @@ -110,7 +110,7 @@ describe('PnpmPackageManager', () => {
const tag = '5.0.0';
const uninstallCommand = `uninstall --save-dev ${dependencies.join(' ')}`;

const installCommand = `install --save-dev ${dependencies
const installCommand = `install --strict-peer-dependencies=false --save-dev ${dependencies
.map((dependency) => `${dependency}@${tag}`)
.join(' ')}`;

Expand Down