-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release: Prerelease alpha 8.5.0-alpha.21 #30017
Merged
valentinpalkovic
merged 41 commits into
next-release
from
version-non-patch-from-8.5.0-alpha.20
Dec 12, 2024
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
871eec7
Addon Onboarding: Prebundle react-confetti
yannbf 23b9834
Core: Fix bundling of React
yannbf 11628b2
Run the a11y automigration on postInstall
kasperpeulen ba51dda
Add typesVersions support for TypeScript definitions in a11y package
valentinpalkovic d9eeb21
Merge branch 'next' into valentin/fix-type-issue-for-older-typescript…
valentinpalkovic dc09430
Use spawn instead
kasperpeulen 3e51714
use treekill to kill the entire process tree
JReinhold cb1ba8e
Use textMutedColor rather than barTextColor where this is contextuall…
ghengeveld 212f83a
Indicate when an option is disabled using color and a suffix
ghengeveld ca259b1
Merge branch 'next' into kasper/a11y-postinstall
kasperpeulen aa4c423
Merge pull request #30012 from storybookjs/jeppe/fix-storybook-not-st…
JReinhold 4711d6b
Build: Improve task command and error message
yannbf 20a1e60
Merge branch 'next' into kasper/a11y-postinstall
kasperpeulen f6bdeee
Update SECURITY.md
vanessayuenn b24ab48
Update SECURITY.md
vanessayuenn ce4466a
Merge pull request #30020 from storybookjs/vanessayuenn-patch-1
vanessayuenn 53fa387
Merge pull request #30005 from storybookjs/valentin/fix-type-issue-fo…
valentinpalkovic bb14633
Merge pull request #30018 from storybookjs/yann/improve-task-command
yannbf 21d7c3d
Use execa
kasperpeulen 3fbd948
Merge remote-tracking branch 'origin/kasper/a11y-postinstall' into ka…
kasperpeulen 41f52fa
Refactor environment variable handling for Vitest integration
valentinpalkovic 36fab90
Forward the yes flag
kasperpeulen 133a414
Merge pull request #30003 from storybookjs/yann/fix-react-bundling
yannbf 750a57f
fix: update error logging colors for task details
yannbf 48d1d42
Merge pull request #30024 from storybookjs/yann/fix-template-text-color
yannbf ecd8707
Merge branch 'next' into yann/prebundle-react-confetti
yannbf 805e18a
fix #29785
ndelangen 67bf4f6
Addon A11y: Update accessibility status handling in TestProviderRender
valentinpalkovic 560f731
Merge branch 'next' into norbert/fix-29785
ndelangen b83343b
Fix eslint
kasperpeulen ed64194
Merge pull request #30022 from storybookjs/valentin/fix-accessibility…
valentinpalkovic 7b56f57
Merge pull request #30027 from storybookjs/valentin/do-not-show-state…
valentinpalkovic 63ddc88
Update code/addons/test/src/vitest-plugin/index.ts
ndelangen 5cfb832
change to use pathe
ndelangen 4dde682
Merge branch 'norbert/fix-29785' of https://github.com/storybookjs/st…
ndelangen 0f514e2
Merge pull request #30004 from storybookjs/kasper/a11y-postinstall
kasperpeulen 25d6ef6
Merge pull request #29996 from storybookjs/yann/prebundle-react-confetti
yannbf 1c5c52f
Merge branch 'next' into norbert/fix-29785
ndelangen 2873e6c
Merge pull request #30019 from storybookjs/30009-show-sub-test-provid…
ghengeveld 014e862
Merge pull request #30026 from storybookjs/norbert/fix-29785
ndelangen 2de3b7a
Write changelog for 8.5.0-alpha.21 [skip ci]
storybook-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { PostinstallOptions } from '@storybook/cli/src/add'; | ||
|
||
// eslint-disable-next-line depend/ban-dependencies | ||
import { execa } from 'execa'; | ||
|
||
const $ = execa({ | ||
preferLocal: true, | ||
stdio: 'inherit', | ||
// we stream the stderr to the console | ||
reject: false, | ||
}); | ||
|
||
export default async function postinstall(options: PostinstallOptions) { | ||
await $`storybook automigrate addonA11yAddonTest ${options.yes ? '--yes' : ''}`; | ||
} |
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 |
---|---|---|
@@ -1,25 +1,17 @@ | ||
export function getIsVitestStandaloneRun() { | ||
try { | ||
return process.env.VITEST_STORYBOOK === 'false'; | ||
} catch { | ||
try { | ||
// @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. | ||
return import.meta.env.VITEST_STORYBOOK === 'false'; | ||
} catch (e) { | ||
return false; | ||
} | ||
// @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. | ||
return import.meta.env.VITEST_STORYBOOK === 'false'; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
|
||
export function getIsVitestRunning() { | ||
try { | ||
return process?.env.MODE === 'test'; | ||
} catch { | ||
try { | ||
// @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. | ||
return import.meta.env.MODE === 'test'; | ||
} catch (e) { | ||
return false; | ||
} | ||
// @ts-expect-error Suppress TypeScript warning about wrong setting. Doesn't matter, because we don't use tsc for bundling. | ||
return import.meta.env.MODE === 'test'; | ||
} catch (e) { | ||
return false; | ||
} | ||
} |
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
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
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 |
---|---|---|
|
@@ -5,6 +5,8 @@ import type { GlobalSetupContext } from 'vitest/node'; | |
|
||
import { logger } from 'storybook/internal/node-logger'; | ||
|
||
import treeKill from 'tree-kill'; | ||
|
||
let storybookProcess: ChildProcess | null = null; | ||
|
||
const getIsVitestStandaloneRun = () => { | ||
|
@@ -59,23 +61,26 @@ const startStorybookIfNotRunning = async () => { | |
} | ||
}; | ||
|
||
const killProcess = (process: ChildProcess) => { | ||
return new Promise((resolve, reject) => { | ||
process.on('close', resolve); | ||
process.on('error', reject); | ||
process.kill(); | ||
}); | ||
}; | ||
|
||
export const setup = async ({ config }: GlobalSetupContext) => { | ||
if (config.watch && isVitestStandaloneRun) { | ||
await startStorybookIfNotRunning(); | ||
} | ||
}; | ||
|
||
export const teardown = async () => { | ||
if (storybookProcess) { | ||
logger.verbose('Stopping Storybook process'); | ||
await killProcess(storybookProcess); | ||
if (!storybookProcess) { | ||
return; | ||
} | ||
logger.verbose('Stopping Storybook process'); | ||
await new Promise<void>((resolve, reject) => { | ||
// Storybook starts multiple child processes, so we need to kill the whole tree | ||
treeKill(storybookProcess.pid, 'SIGTERM', (error) => { | ||
if (error) { | ||
logger.error('Failed to stop Storybook process:'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: The error message is incomplete - it should include the actual error details from the callback |
||
reject(error); | ||
return; | ||
} | ||
resolve(); | ||
}); | ||
}); | ||
}; |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding a timeout to the treeKill operation in case it hangs