-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from InseeFr/feat/upgrade-storybook-and-stories
feat:config-storybook
- Loading branch information
Showing
86 changed files
with
176,667 additions
and
8,372 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,18 @@ | ||
{ | ||
"sourceType": "unambiguous", | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"chrome": 100, | ||
"safari": 15, | ||
"firefox": 91 | ||
} | ||
} | ||
], | ||
"@babel/preset-typescript", | ||
"@babel/preset-react" | ||
], | ||
"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 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,46 +1,57 @@ | ||
const config = require("process"); | ||
const path = require("path"); | ||
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); | ||
import config from "process"; | ||
import { resolve } from "path"; | ||
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin"; | ||
|
||
module.exports = { | ||
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"], | ||
addons: [ | ||
export const stories = ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"]; | ||
export const staticDirs = ["../public"]; | ||
export const features = { | ||
storyStoreV7: false, | ||
}; | ||
export const addons = [ | ||
{ | ||
name: "@storybook/addon-docs", | ||
options: { | ||
configureJSX: true, | ||
babelOptions: {}, | ||
sourceLoaderOptions: null, | ||
transcludeMarkdown: true, | ||
}, | ||
}, | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: "@storybook/react", | ||
core: { | ||
builder: "@storybook/builder-webpack5", | ||
}, | ||
|
||
webpackFinal: async (config, { configType }) => { | ||
"@storybook/addon-mdx-gfm", | ||
]; | ||
export const framework = { | ||
name: "@storybook/react-webpack5", | ||
options: { fastRefresh: true }, | ||
}; | ||
export async function webpackFinal(config, { configType }) { | ||
config.module.rules.push({ | ||
test: /\.scss$/, | ||
use: ["style-loader", "css-loader", "sass-loader"], | ||
include: path.resolve(__dirname, "../"), | ||
test: /\.scss$/, | ||
use: ["style-loader", "css-loader", "sass-loader"], | ||
include: resolve(__dirname, "../"), | ||
}); | ||
|
||
config.resolve = { | ||
extensions: [".js", ".jsx", ".ts", ".tsx"], | ||
modules: [ | ||
...(config.resolve.modules || []), | ||
path.resolve(__dirname, "../src"), | ||
], | ||
fallback: { | ||
...(config.resolve || {}).fallback, | ||
fs: false, | ||
stream: false, | ||
os: false, | ||
}, | ||
plugins: [ | ||
...(config.resolve.plugins || []), | ||
new TsconfigPathsPlugin({ | ||
extensions: config.resolve.extensions, | ||
}), | ||
], | ||
extensions: [".js", ".jsx", ".ts", ".tsx"], | ||
modules: [...(config.resolve.modules || []), resolve(__dirname, "../src")], | ||
fallback: { | ||
...(config.resolve || {}).fallback, | ||
fs: false, | ||
stream: false, | ||
os: false, | ||
}, | ||
plugins: [ | ||
...(config.resolve.plugins || []), | ||
new TsconfigPathsPlugin({ | ||
extensions: config.resolve.extensions, | ||
}), | ||
], | ||
}; | ||
|
||
return config; | ||
}, | ||
} | ||
export const docs = { | ||
autodocs: true, | ||
}; |
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,9 +1,9 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
} | ||
}; |
Oops, something went wrong.