-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevOverlay] Add Next.js version staleness indicator (#74601)
This PR added style for the version staleness indicator. The "Turbopack-ness" will be added in the follow up PR. ### Light ![CleanShot 2025-01-08 at 03 03 42](https://github.com/user-attachments/assets/2e8fc270-bf5a-4437-88f5-4a4f0ea0813c) ### Dark ![CleanShot 2025-01-08 at 03 03 13](https://github.com/user-attachments/assets/932ff217-b50e-4d02-97ca-4b4cf26d7b7f) Closes NDX-575
- Loading branch information
1 parent
3b53d9f
commit d29f2f9
Showing
8 changed files
with
202 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...onents/react-dev-overlay/_experimental/internal/components/VersionStalenessInfo/index.tsx
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
...onents/react-dev-overlay/_experimental/internal/components/VersionStalenessInfo/styles.ts
This file was deleted.
Oops, something went wrong.
94 changes: 94 additions & 0 deletions
94
..._experimental/internal/components/VersionStalenessInfo/version-staleness-info.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { VersionStalenessInfo } from './VersionStalenessInfo' | ||
import { withShadowPortal } from '../../storybook/with-shadow-portal' | ||
|
||
const meta: Meta<typeof VersionStalenessInfo> = { | ||
title: 'VersionStalenessInfo', | ||
component: VersionStalenessInfo, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
decorators: [withShadowPortal], | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof VersionStalenessInfo> | ||
|
||
// Mock version info for different scenarios | ||
const mockVersionInfo = { | ||
fresh: { | ||
installed: '15.0.0', | ||
expected: '15.0.0', | ||
staleness: 'fresh' as const, | ||
}, | ||
stalePatch: { | ||
installed: '15.0.0', | ||
expected: '15.0.1', | ||
staleness: 'stale-patch' as const, | ||
}, | ||
staleMinor: { | ||
installed: '15.0.0', | ||
expected: '15.1.0', | ||
staleness: 'stale-minor' as const, | ||
}, | ||
staleMajor: { | ||
installed: '14.0.0', | ||
expected: '15.0.0', | ||
staleness: 'stale-major' as const, | ||
}, | ||
stalePrerelease: { | ||
installed: '15.0.0-canary.0', | ||
expected: '15.0.0-canary.1', | ||
staleness: 'stale-prerelease' as const, | ||
}, | ||
newerThanNpm: { | ||
installed: '15.0.0-canary.1', | ||
expected: '15.0.0-canary.0', | ||
staleness: 'newer-than-npm' as const, | ||
}, | ||
} | ||
|
||
export const Fresh: Story = { | ||
args: { | ||
versionInfo: mockVersionInfo.fresh, | ||
}, | ||
} | ||
|
||
export const StalePatch: Story = { | ||
args: { | ||
versionInfo: mockVersionInfo.stalePatch, | ||
}, | ||
} | ||
|
||
export const StaleMinor: Story = { | ||
args: { | ||
versionInfo: mockVersionInfo.staleMinor, | ||
}, | ||
} | ||
|
||
export const StaleMajor: Story = { | ||
args: { | ||
versionInfo: mockVersionInfo.staleMajor, | ||
}, | ||
} | ||
|
||
export const StalePrerelease: Story = { | ||
args: { | ||
versionInfo: mockVersionInfo.stalePrerelease, | ||
}, | ||
} | ||
|
||
export const NewerThanNpm: Story = { | ||
args: { | ||
versionInfo: mockVersionInfo.newerThanNpm, | ||
}, | ||
} | ||
|
||
export const Turbopack: Story = { | ||
args: { | ||
versionInfo: { | ||
...mockVersionInfo.fresh, | ||
}, | ||
isTurbopack: true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters