Skip to content
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

add vite support #428

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 7 additions & 31 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const path = require('path');
module.exports = {
stories: ['../stories/**/*.stories.@(ts|tsx|js|jsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-webpack5-compiler-swc'
],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],

// https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration
typescript: {
Expand All @@ -15,34 +11,14 @@ module.exports = {
reactDocgen: 'react-docgen-typescript'
},

webpackFinal: async config => {
config.module.rules.push({
test: /\.(ts|js|tsx)?$/,
exclude: /node_modules\/(?!(flairup)\/).*/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
presets: [
require('@babel/preset-typescript').default,
[
require('@babel/preset-react').default,
{ runtime: 'automatic' }
],
require('@babel/preset-env').default
]
}
}
]
});

return config;
core: {
builder: '@storybook/builder-vite'
},

docs: {},

framework: {
name: '@storybook/react-webpack5',
name: '@storybook/react-vite',
options: {}
},

docs: {}
}
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@storybook/addon-webpack5-compiler-swc": "1.0.2",
"@storybook/addons": "^7.6.17",
"@storybook/react": "^8.1.1",
"@storybook/react-vite": "8.1.1",
"@storybook/react-webpack5": "8.1.1",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
Expand Down Expand Up @@ -100,7 +101,8 @@
"tiny-invariant": "^1.2.0",
"tsdx": "^0.14.1",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
"typescript": "^4.7.4",
"vite": "^5.4.1"
},
"dependencies": {
"flairup": "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export {
SkinTones,
Theme,
Categories,
EmojiClickData,
SuggestionMode,
SkinTonePickerLocation
} from './types/exposedTypes';
export type { EmojiClickData } from './types/exposedTypes';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ealush this won't work without adding the type anotation and moving it to diffrent export not sure if it actually affecting the package types but I think it not


export interface PickerProps extends PickerConfig {}

Expand Down
Loading