generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 87
BREAKING: ESM only, Support for Storybook 10 and Jest 30 #571
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
8c39869
wip
yannbf 4720a97
wip
yannbf 659e613
fix
yannbf 217b308
fix
yannbf f910288
experiment
yannbf 70a2f93
fix
yannbf 8fd8132
more experiments
yannbf 10734a1
experiment
yannbf 6833c21
wip
yannbf 9d2bec5
remove transformIgnorePatterns
yannbf 7cffe9e
Update package.json
ndelangen 93dc6cc
Update storybook peerDependencies version in yarn.lock
ndelangen bd1811a
dedupe lockfile
ndelangen 5476b85
use latest canary of esm build of storybook
ndelangen 12b71b1
Refactor Babel configuration to ESM syntax, update package.json to en…
ndelangen c4a1f20
Remove unused SWC Jest path from Jest configuration and update snapsh…
ndelangen f536e8a
wip
ndelangen 17a1bcd
Upgrade Vite to version 7.0.5, remove unused Jest Playwright test fil…
yannbf d326828
fix lockfile
yannbf 71f31ea
add vitest coverage
yannbf 1ec7c6d
fix
yannbf fe87de1
fix
yannbf 501055a
bundle jest-playwright-preset in
yannbf 8803e9c
fix tests
yannbf 52b7622
fix
yannbf 2e84193
Merge pull request #574 from storybookjs/yann/bring-in-jest-playwrigh…
yannbf cefc1d2
upgrade to Storybook 10 beta
yannbf af6bf62
Merge branch 'next' into yann/experiment-with-esm
yannbf 8ec6db1
fix path
yannbf fe81472
fixes
yannbf e482a2f
fix constants
yannbf 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 hidden or 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 hidden or 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 hidden or 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,10 @@ | ||
| { | ||
| "globalSetup": "@storybook/test-runner/dist/jest-playwright-entries/setup.js", | ||
| "globalTeardown": "@storybook/test-runner/dist/jest-playwright-entries/teardown.js", | ||
| "testEnvironment": "@storybook/test-runner/dist/jest-playwright-entries", | ||
| "runner": "@storybook/test-runner/dist/jest-playwright-entries/runner.js", | ||
| "setupFilesAfterEnv": [ | ||
| "expect-playwright", | ||
| "@storybook/test-runner/dist/jest-playwright-entries/lib/extends.js" | ||
| ] | ||
| } |
This file contains hidden or 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,11 +1,11 @@ | ||
| module.exports = { | ||
| export default { | ||
| testMatch: ['**/*.test.ts'], | ||
| moduleNameMapper: { | ||
| '@storybook/test-runner/playwright/global-setup': '<rootDir>/playwright/global-setup', | ||
| '@storybook/test-runner/playwright/global-teardown': '<rootDir>/playwright/global-teardown', | ||
| '@storybook/test-runner/playwright/global-setup': '<rootDir>/playwright/global-setup.js', | ||
| '@storybook/test-runner/playwright/global-teardown': '<rootDir>/playwright/global-teardown.js', | ||
| '@storybook/test-runner/playwright/custom-environment': | ||
| '<rootDir>/playwright/custom-environment', | ||
| '@storybook/test-runner/playwright/jest-setup': '<rootDir>/playwright/jest-setup', | ||
| '@storybook/test-runner/playwright/transform': '<rootDir>/playwright/transform', | ||
| '<rootDir>/playwright/custom-environment.js', | ||
| '@storybook/test-runner/playwright/jest-setup': '<rootDir>/playwright/jest-setup.js', | ||
| '@storybook/test-runner/playwright/transform': '<rootDir>/playwright/transform.js', | ||
| }, | ||
| }; |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,17 +1,33 @@ | ||
| const { transformSync: swcTransform } = require('@swc/core'); | ||
| const { transformPlaywright } = require('../dist'); | ||
| import { transform as swcTransform } from '@swc/core'; | ||
| import { transformPlaywright } from '../dist/index.js'; | ||
|
|
||
| module.exports = { | ||
| process(src, filename) { | ||
| const csfTest = transformPlaywright(src, filename); | ||
|
|
||
| const result = swcTransform(csfTest, { | ||
| // Only export async version - force Jest to use it | ||
| async function processAsync(src, filename) { | ||
| try { | ||
| const csfTest = await transformPlaywright(src, filename); | ||
| // This swc transform might not be needed | ||
| const result = await swcTransform(csfTest, { | ||
| filename, | ||
| isModule: true, | ||
| module: { | ||
| type: 'commonjs', | ||
| type: 'es6', | ||
| }, | ||
| jsc: { | ||
| parser: { | ||
| syntax: 'typescript', | ||
| tsx: true, | ||
| }, | ||
| target: 'es2015', | ||
| }, | ||
| }); | ||
|
|
||
| return { code: result ? result.code : src }; | ||
| }, | ||
| } catch (error) { | ||
| console.error('Transform error:', error); | ||
| return { code: src }; | ||
| } | ||
| } | ||
|
|
||
| export default { | ||
| processAsync, | ||
| }; |
This file was deleted.
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.
Uh oh!
There was an error while loading. Please reload this page.