Skip to content

Commit

Permalink
Revert "remove hard-coded login in inner command"
Browse files Browse the repository at this point in the history
This reverts commit 909cb23.
  • Loading branch information
ndelangen committed Mar 8, 2024
1 parent 909cb23 commit b197874
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ export const upgradeStorybookRelatedDependencies = {
promptDefaultValue: false,

async check({ packageManager, storybookVersion }) {
const latestStorybookVersion = await packageManager.latestVersion('storybook');

if (storybookVersion !== latestStorybookVersion) {
return null;
}

const analyzedPackages = await getIncompatibleStorybookPackages({
currentStorybookVersion: storybookVersion,
packageManager,
Expand Down
16 changes: 15 additions & 1 deletion code/lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { getMigrationSummary } from './helpers/getMigrationSummary';
import { getStorybookData } from './helpers/mainConfigFile';
import { doctor } from '../doctor';

import { upgradeStorybookRelatedDependencies } from './fixes/upgrade-storybook-related-dependencies';
import dedent from 'ts-dedent';

const logger = console;
Expand Down Expand Up @@ -133,7 +134,20 @@ export const automigrate = async ({
return null;
}

const selectedFixes: Fix[] = inputFixes || allFixes;
const selectedFixes: Fix[] =
inputFixes ||
allFixes.filter((fix) => {
// we only allow this automigration when the user explicitly asks for it, or they are upgrading to the latest version of storybook
if (
fix.id === upgradeStorybookRelatedDependencies.id &&
isUpgrade !== 'latest' &&
fixId !== upgradeStorybookRelatedDependencies.id
) {
return false;
}

return true;
});
const fixes: Fix[] = fixId ? selectedFixes.filter((f) => f.id === fixId) : selectedFixes;

if (fixId && fixes.length === 0) {
Expand Down

0 comments on commit b197874

Please sign in to comment.