Skip to content

Commit

Permalink
remove hard-coded login in inner command
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Mar 8, 2024
1 parent b4e944d commit 909cb23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ 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: 1 addition & 15 deletions code/lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ 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 @@ -134,20 +133,7 @@ export const automigrate = async ({
return null;
}

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 selectedFixes: Fix[] = inputFixes || allFixes;
const fixes: Fix[] = fixId ? selectedFixes.filter((f) => f.id === fixId) : selectedFixes;

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

0 comments on commit 909cb23

Please sign in to comment.