Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Merged
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
17 changes: 16 additions & 1 deletion .config/webpack/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ module.exports = (options = {}) => {
module: {
rules: [
{
test: /demo[/\\]index.html?$/,
test: /demo[\\\/]index.html?$/,
loader: 'file-loader?name=index.[ext]'
},
{
test: /\.csv$/,
loader: 'raw-loader'
},
{
test: /\.ts(x?)$/,
include: /node_modules[\\\/](highlight[.]js)[\\\/]/,
use: [
{ loader: 'babel-loader', options: babel },
{ loader: 'ts-loader', options: ts },
]
},
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
Expand All @@ -55,6 +63,13 @@ module.exports = (options = {}) => {
{ loader: 'webpack-preprocessor', options: JSON.stringify(preprocessor) }
]
},
{
test: /\.js$/,
include: /node_modules[\\\/](highlight[.]js)[\\\/]/,
use: [
{ loader: 'babel-loader', options: babel }
]
},
{
test: /\.js$/,
exclude: /node_modules/,
Expand Down
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tabWidth": 4,
"singleQuote": true,
"jsxSingleQuote": true,
"arrowParens": "avoid",
"bracketSpacing": false,
"trailingComma": "none"
}
8 changes: 0 additions & 8 deletions .storybook/config.js

This file was deleted.

25 changes: 25 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const path = require('path');

const baseConfig = require('./../.config/webpack/base.js')({
ts: {
transpileOnly: true
},
preprocessor: {
variables: {
mode: 'eager'
}
}
});

module.exports = {
stories: ['./../tests/visual/percy-storybook/**/*.percy.tsx'],
webpackFinal: async (config, { configType }) => {
// jerry rig everything
config.resolve.alias.core = path.resolve(__dirname, './../src/core'),
config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

config.module = baseConfig.module;

return config;
}
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Storybook 6 brings totally new configuration files and opinions. Making it work with our own needs..

Copy link
Contributor

Choose a reason for hiding this comment

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

@Marc-Andre-Rivet For any package using Storybook >=6, I imagine we now have to add

config.resolve.alias['dash-table'] = path.resolve(__dirname, './../src/dash-table')

but specific to the path/package name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. But the table is the only project using storybook.

17 changes: 0 additions & 17 deletions .storybook/webpack.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion demo/AppMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function getState() {
const flavorParam = Environment.searchParams.get('flavor');
const flavors = flavorParam ? flavorParam.split(';') : [];

let state = getModeState(mode);
const state = getModeState(mode);
flavors.forEach(flavor => {
const [key, valueString] = flavor.split('=');
const value = JSON.parse(valueString);
Expand Down
Loading