-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved to vite bundler instead of webpack and fixed the imports that p…
…revented the channel from working as expected
- Loading branch information
1 parent
d65d0de
commit dbd096d
Showing
14 changed files
with
1,598 additions
and
3,463 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* to load the built addon in this test Storybook | ||
*/ | ||
|
||
function managerEntries(entry = []) { | ||
return [...entry, require.resolve('../dist/esm/manager.js')]; | ||
} | ||
|
||
module.exports = { | ||
managerEntries, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
export default { | ||
stories: ['../stories/**/*.stories.tsx'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'./local-presets.js', | ||
], | ||
core: { | ||
builder: '@storybook/builder-vite', | ||
}, | ||
framework: '@storybook/react-vite', | ||
async viteFinal(config) { | ||
// Merge custom configuration into the default config | ||
const { mergeConfig } = await import('vite'); | ||
|
||
return mergeConfig(config, { | ||
// Add dependencies to pre-optimization | ||
optimizeDeps: { | ||
include: ['storybook-dark-mode'], | ||
}, | ||
}); | ||
}, | ||
}; |
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 +1,3 @@ | ||
{} | ||
{ | ||
"cSpell.words": ["formik"] | ||
} |
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,5 +1,5 @@ | ||
module.exports = { | ||
testEnvironment: 'jsdom', | ||
testPathIgnorePatterns: ['/node_modules/', '/dist/'], | ||
setupFilesAfterEnv: ['@testing-library/jest-dom'] | ||
setupFilesAfterEnv: ['@testing-library/jest-dom'], | ||
}; |
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 @@ | ||
import './dist/esm/manager'; |
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,19 +1,14 @@ | ||
import { addons, types } from '@storybook/manager-api'; | ||
import React from 'react'; | ||
import { types, addons } from '@storybook/manager-api'; | ||
import { AddonPanel } from '@storybook/components'; | ||
|
||
import { ADDON_ID, PANEL_ID, PARAM_KEY } from './shared'; | ||
import { FormikPanel } from './FormikPanel'; | ||
import { ADDON_ID, PANEL_ID, PARAM_KEY } from './shared'; | ||
|
||
addons.register(ADDON_ID, () => { | ||
addons.add(PANEL_ID, { | ||
type: types.PANEL, | ||
title: 'Formik', | ||
render: ({ active }) => ( | ||
<AddonPanel active={!!active}> | ||
<FormikPanel /> | ||
</AddonPanel> | ||
), | ||
render: ({ active }) => <FormikPanel active={active} />, | ||
paramKey: PARAM_KEY, | ||
}); | ||
}); |
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,7 @@ | ||
import { defineConfig } from 'vite'; | ||
import react from '@vitejs/plugin-react'; | ||
|
||
export default defineConfig({ | ||
plugins: [react()], | ||
// Add any additional configuration here | ||
}); |