Skip to content

Commit

Permalink
Merge pull request #18522 from storybookjs/actually-use-npm7-migration
Browse files Browse the repository at this point in the history
CLI: Hook up the npm7 migration
  • Loading branch information
shilman committed Jun 21, 2022
2 parents a3348bf + e17e0f0 commit 1edd3a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/cli/src/automigrate/fixes/index.ts
Expand Up @@ -5,6 +5,7 @@ import { vue3 } from './vue3';
import { mainjsFramework } from './mainjsFramework';
import { eslintPlugin } from './eslint-plugin';
import { builderVite } from './builder-vite';
import { npm7 } from './npm7';
import { Fix } from '../types';

export * from '../types';
Expand All @@ -16,4 +17,5 @@ export const fixes: Fix[] = [
mainjsFramework,
eslintPlugin,
builderVite,
npm7,
];
11 changes: 7 additions & 4 deletions lib/cli/src/js-package-manager/NPMProxy.ts
Expand Up @@ -23,10 +23,13 @@ export class NPMProxy extends JsPackageManager {
}

hasLegacyPeerDeps() {
return (
this.executeCommand('npm', ['config', 'get', 'legacy-peer-deps', '--location=project']) ===
'true'
);
const result = this.executeCommand('npm', [
'config',
'get',
'legacy-peer-deps',
'--location=project',
]);
return result.trim() === 'true';
}

setLegacyPeerDeps() {
Expand Down

0 comments on commit 1edd3a6

Please sign in to comment.