Skip to content

Commit

Permalink
Merge pull request #26412 from storybookjs/version-non-patch-from-8.0…
Browse files Browse the repository at this point in the history
….0-rc.4

Release: Prerelease 8.0.0-rc.5
  • Loading branch information
vanessayuenn authored Mar 11, 2024
2 parents bfa0570 + cdfd820 commit 1e33053
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 8.0.0-rc.5

- CLI: Automigration fix version detection of upgrading related packages - [#26410](https://github.com/storybookjs/storybook/pull/26410), thanks @ndelangen!

## 8.0.0-rc.4

- Actions: Fix attaching action after a spy is restored to original function - [#26364](https://github.com/storybookjs/storybook/pull/26364), thanks @kasperpeulen!
Expand Down
4 changes: 3 additions & 1 deletion code/lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const doAutomigrate = async (options: AutofixOptionsFromCLI) => {
mainConfigPath,
configDir,
isUpgrade: false,
isLatest: false,
});

if (outcome) {
Expand All @@ -125,6 +126,7 @@ export const automigrate = async ({
skipInstall,
hideMigrationSummary = false,
isUpgrade,
isLatest,
}: AutofixOptions): Promise<{
fixResults: Record<string, FixStatus>;
preCheckFailure?: PreCheckFailure;
Expand All @@ -140,7 +142,7 @@ export const automigrate = async ({
// 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' &&
isLatest === false &&
fixId !== upgradeStorybookRelatedDependencies.id
) {
return false;
Expand Down
5 changes: 3 additions & 2 deletions code/lib/cli/src/automigrate/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { StorybookConfigRaw } from '@storybook/types';
import type { JsPackageManager, PackageManagerName } from '@storybook/core-common';
import type { StorybookConfigRaw } from '@storybook/types';

export interface CheckOptions {
packageManager: JsPackageManager;
Expand Down Expand Up @@ -75,7 +75,8 @@ export interface AutofixOptions extends Omit<AutofixOptionsFromCLI, 'packageMana
/**
* Whether the migration is part of an upgrade.
*/
isUpgrade: false | true | 'latest';
isUpgrade: boolean;
isLatest: boolean;
}
export interface AutofixOptionsFromCLI {
fixId?: FixId;
Expand Down
7 changes: 4 additions & 3 deletions code/lib/cli/src/migrate.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { listCodemods, runCodemod } from '@storybook/codemod';
import { runFixes } from './automigrate';
import { mdxToCSF } from './automigrate/fixes/mdx-to-csf';
import {
JsPackageManagerFactory,
getStorybookInfo,
getCoercedStorybookVersion,
getStorybookInfo,
} from '@storybook/core-common';

import { runFixes } from './automigrate';
import { mdxToCSF } from './automigrate/fixes/mdx-to-csf';
import { getStorybookVersionSpecifier } from './helpers';

const logger = console;
Expand Down
4 changes: 3 additions & 1 deletion code/lib/cli/src/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const doUpgrade = async ({
]);

const isOutdated = lt(currentVersion, latestVersion);
const isExactLatest = currentVersion === latestVersion;
const isPrerelease = prerelease(currentVersion) !== null;

const borderColor = isOutdated ? '#FC521F' : '#F1618C';
Expand Down Expand Up @@ -261,7 +262,8 @@ export const doUpgrade = async ({
mainConfigPath,
beforeVersion,
storybookVersion: currentVersion,
isUpgrade: isOutdated ? true : 'latest',
isUpgrade: isOutdated,
isLatest: isExactLatest,
});
}

Expand Down
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,5 +294,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "8.0.0-rc.5"
}
2 changes: 1 addition & 1 deletion docs/versions/next.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"8.0.0-rc.4","info":{"plain":"- Actions: Fix attaching action after a spy is restored to original function - [#26364](https://github.com/storybookjs/storybook/pull/26364), thanks @kasperpeulen!\n- CLI: Add explicit actions to header story - [#26352](https://github.com/storybookjs/storybook/pull/26352), thanks @kasperpeulen!\n- CLI: Automigration for upgrading storybook related dependencies - [#26377](https://github.com/storybookjs/storybook/pull/26377), thanks @ndelangen!\n- CLI: Fix doctor compatibility check - [#26363](https://github.com/storybookjs/storybook/pull/26363), thanks @yannbf!\n- CLI: Fix fn reference in preact templates - [#26384](https://github.com/storybookjs/storybook/pull/26384), thanks @kasperpeulen!\n- CLI: Remove duplicated dependency warning - [#26385](https://github.com/storybookjs/storybook/pull/26385), thanks @yannbf!\n- CLI: Vite migration link (shorter) - [#26379](https://github.com/storybookjs/storybook/pull/26379), thanks @ndelangen!\n- Composition: Fix refs not loading when there's multiple - [#26356](https://github.com/storybookjs/storybook/pull/26356), thanks @ndelangen!\n- Dependencies: Broaden `esbuild` version range - [#26405](https://github.com/storybookjs/storybook/pull/26405), thanks @ndelangen!\n- Maintenance: Replace `@storybook/testing-library` with `@storybook/test` in monorepo - [#26351](https://github.com/storybookjs/storybook/pull/26351), thanks @ndelangen!\n- Maintenance: What's new modal changes - [#26355](https://github.com/storybookjs/storybook/pull/26355), thanks @kasperpeulen!\n- Portable Stories: Fix injected root element changing layout - [#26387](https://github.com/storybookjs/storybook/pull/26387), thanks @JReinhold!\n- React: Support all React component types in JSX Decorator - [#26382](https://github.com/storybookjs/storybook/pull/26382), thanks @yannbf!"}}
{"version":"8.0.0-rc.5","info":{"plain":"- CLI: Automigration fix version detection of upgrading related packages - [#26410](https://github.com/storybookjs/storybook/pull/26410), thanks @ndelangen!"}}

0 comments on commit 1e33053

Please sign in to comment.