Skip to content

Commit

Permalink
Merge pull request #28443 from storybookjs/kasper/next-babel-preset
Browse files Browse the repository at this point in the history
Next: Set default targets for next babel config
  • Loading branch information
kasperpeulen authored Jul 3, 2024
2 parents 3adada0 + 5b81e5b commit a9682ef
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 74 deletions.
44 changes: 0 additions & 44 deletions code/core/template/stories/before-each.stories.ts

This file was deleted.

28 changes: 0 additions & 28 deletions code/core/template/stories/module-mocking.stories.ts

This file was deleted.

4 changes: 2 additions & 2 deletions code/e2e-tests/module-mocking.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('module-mocking', () => {
test('should assert story lifecycle order', async ({ page }) => {
const sbPage = new SbPage(page);

await sbPage.navigateToStory('core/before-each', 'before-each-order');
await sbPage.navigateToStory('lib/test/before-each', 'before-each-order');

await sbPage.viewAddonPanel('Actions');
const logItem = await page.locator('#storybook-panel-root #panel-tab-content');
Expand All @@ -38,7 +38,7 @@ test.describe('module-mocking', () => {
test('should assert that utils import is mocked', async ({ page }) => {
const sbPage = new SbPage(page);

await sbPage.navigateToStory('core/module-mocking', 'basic');
await sbPage.navigateToStory('lib/test/module-mocking', 'basic');

await sbPage.viewAddonPanel('Actions');
const logItem = await page.locator('#storybook-panel-root #panel-tab-content', {
Expand Down
6 changes: 6 additions & 0 deletions code/frameworks/nextjs/src/babel/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ export default (api: any, options: NextBabelPresetOptions = {}): BabelPreset =>
// In production/development this option is set to `false` so that webpack can handle import/export with tree-shaking
modules: 'auto',
exclude: ['transform-typeof-symbol'],
bugfixes: true,
targets: {
chrome: 100,
safari: 15,
firefox: 91,
},
...options['preset-env'],
};

Expand Down
6 changes: 6 additions & 0 deletions scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ export const addStories: Task['run'] = async (
cwd,
disableDocs,
});

await linkPackageStories(await workspacePath('test package', '@storybook/test'), {
mainConfig,
cwd,
disableDocs,
});
}

const mainAddons = (mainConfig.getSafeFieldValue(['addons']) || []).reduce(
Expand Down

0 comments on commit a9682ef

Please sign in to comment.