-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Updates Storybook to version 6 (#712)
* Removing story.name Signed-off-by: Marcos Iglesias <[email protected]> * Adding pre-push hook Signed-off-by: Marcos Iglesias <[email protected]> * Updating Flag and Card Signed-off-by: Marcos Iglesias <[email protected]> * Updating Storybook to version 6 Signed-off-by: Marcos Iglesias <[email protected]> * Updating betterer results Signed-off-by: Marcos Iglesias <[email protected]> * Update eslint config Signed-off-by: Marcos Iglesias <[email protected]> * Update eslint config Signed-off-by: Marcos Iglesias <[email protected]> * Removing pre-push hook as it runs on .src-custom Signed-off-by: Marcos Iglesias <[email protected]> Signed-off-by: dikshathakur3119 <[email protected]>
- Loading branch information
Showing
12 changed files
with
3,047 additions
and
1,546 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
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ stylesheets/* | |
vendor/* | ||
docs/* | ||
appbuilder/* | ||
.src-custom/* |
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,15 +1,34 @@ | ||
import merge from 'webpack-merge'; | ||
// Copyright Contributors to the Amundsen project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import customWebpackConfig from './webpack.config.js'; | ||
import MiniCssExtractPlugin from 'mini-css-extract-plugin'; | ||
|
||
import devWebpackConfig from '../webpack.dev'; | ||
|
||
module.exports = { | ||
stories: ['../js/**/*.story.tsx'], | ||
addons: [ | ||
'@storybook/addon-actions', | ||
'@storybook/addon-links', | ||
'@storybook/addon-knobs', | ||
'@storybook/addon-knobs' | ||
], | ||
webpackFinal: async (config) => { | ||
return merge(devWebpackConfig, config); | ||
webpackFinal: (config) => { | ||
return { | ||
...config, | ||
module: { | ||
...config.module, | ||
rules: customWebpackConfig.module.rules, | ||
}, | ||
resolve: { | ||
...config.resolve, | ||
...customWebpackConfig.resolve, | ||
}, | ||
plugins: [ | ||
new MiniCssExtractPlugin({ | ||
filename: "[name].[contenthash].css", | ||
}), | ||
...config.plugins | ||
] | ||
}; | ||
}, | ||
}; |
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,22 +1,18 @@ | ||
import anysort from 'anysort'; | ||
import { addParameters } from '@storybook/react'; | ||
// Copyright Contributors to the Amundsen project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import '../css/styles.scss'; | ||
|
||
const categoriesOrder = [ | ||
'Overview/Introduction', | ||
'Attributes/**', | ||
'Components/**', | ||
'Overview', | ||
'Attributes', | ||
'Components', | ||
]; | ||
|
||
addParameters({ | ||
export const parameters = { | ||
options: { | ||
showRoots: true, | ||
storySort: (previous, next) => { | ||
const [previousStory, previousMeta] = previous; | ||
const [nextStory, nextMeta] = next; | ||
|
||
return anysort(previousMeta.kind, nextMeta.kind, categoriesOrder); | ||
storySort: { | ||
order: categoriesOrder, | ||
}, | ||
}, | ||
}); | ||
}; |
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,77 @@ | ||
// Copyright Contributors to the Amundsen project. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
const path = require('path'); | ||
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | ||
|
||
function resolve(dir) { | ||
return path.join(__dirname, dir); | ||
} | ||
|
||
const TSX_PATTERN = /\.ts|\.tsx$/; | ||
const JSX_PATTERN = /\.jsx?$/; | ||
const CSS_PATTERN = /\.(sa|sc|c)ss$/; | ||
const IMAGE_PATTERN = /\.(png|svg|jpg|gif)$/; | ||
const FONT_PATTERN = /\.(ttf|woff2|otf)$/; | ||
const RESOLVED_EXTENSIONS = ['.tsx', '.ts', '.js', '.jsx', '.css', '.scss']; | ||
const PATHS = { | ||
dist: resolve('../dist'), | ||
pages: resolve('../js/pages'), | ||
components: resolve('../js/components'), | ||
config: resolve('../js/config'), | ||
ducks: resolve('../js/ducks'), | ||
interfaces: resolve('../js/interfaces'), | ||
utils: resolve('../js/utils'), | ||
css: resolve('../css/'), | ||
}; | ||
|
||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: TSX_PATTERN, | ||
exclude: /node_modules/, | ||
loader: 'ts-loader', | ||
}, | ||
{ | ||
test: JSX_PATTERN, | ||
exclude: /node_modules/, | ||
use: 'babel-loader', | ||
}, | ||
{ | ||
test: CSS_PATTERN, | ||
use: [ | ||
MiniCssExtractPlugin.loader, | ||
'css-loader', | ||
{ | ||
loader: 'sass-loader', | ||
options: { | ||
sassOptions: { | ||
includePaths: [PATHS.css], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
test: IMAGE_PATTERN, | ||
use: 'file-loader', | ||
}, | ||
{ | ||
test: FONT_PATTERN, | ||
use: 'file-loader', | ||
}, | ||
] | ||
}, | ||
resolve: { | ||
extensions: RESOLVED_EXTENSIONS, | ||
alias: { | ||
pages: PATHS.pages, | ||
components: PATHS.components, | ||
config: PATHS.config, | ||
ducks: PATHS.ducks, | ||
interfaces: PATHS.interfaces, | ||
utils: PATHS.utils, | ||
}, | ||
}, | ||
}; |
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
Oops, something went wrong.