Skip to content

Commit

Permalink
Add support for Core components written in TypeScript
Browse files Browse the repository at this point in the history
Upgrade to Storybook 6
  • Loading branch information
craigpalermo committed Jan 6, 2021
1 parent a48cb6e commit 3a9743f
Show file tree
Hide file tree
Showing 47 changed files with 5,470 additions and 57,040 deletions.
33 changes: 2 additions & 31 deletions apps/storybook/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,8 @@
const path = require('path')

const reactComponentRoot = path.resolve(__dirname, '../../../packages')

module.exports = {
addons: [
'@storybook/addon-a11y/',
'@storybook/addon-actions/',
'@storybook/addon-knobs/',
'@storybook/addon-viewport/',
'@storybook/addon-essentials',
],
presets: [
{
name: '@storybook/addon-docs/preset',
options: {
configureJSX: true,
},
},
],
stories: ['../../../packages/**/src/**/*.stories.js'],
webpackFinal: async (config, { configType }) => {
const rushCIPath = process.env.RUSH_TEMP_FOLDER

const mdxJsxRule = config.module.rules.find(
(rule) => rule && rule.include && rule.include[0]
)

mdxJsxRule && mdxJsxRule.include.push(reactComponentRoot)
mdxJsxRule && mdxJsxRule.exclude.push(/\/node_modules\//)

if (mdxJsxRule && rushCIPath) {
mdxJsxRule.include.push(path.resolve(rushCIPath))
}

return config
},
stories: ['../../../packages/**/src/**/*.stories.@(js|tsx|mdx)'],
}
16 changes: 9 additions & 7 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
"@compositor/kit": "^1.0.47",
"@priceline/babel-preset": "^0.0.1",
"@priceline/eslint-config": "^0.0.1",
"@storybook/addon-a11y": "^5.3.21",
"@storybook/addon-actions": "^5.3.21",
"@storybook/addon-docs": "^5.3.21",
"@storybook/addon-knobs": "^5.3.21",
"@storybook/addon-viewport": "^5.3.21",
"@storybook/react": "^5.3.21",
"@storybook/addon-a11y": "^6.1.8",
"@storybook/addon-actions": "^6.1.8",
"@storybook/addon-docs": "^6.1.8",
"@storybook/addon-knobs": "^6.1.8",
"@storybook/addon-viewport": "^6.1.8",
"@storybook/addon-essentials": "^6.1.8",
"@storybook/react": "^6.1.8",
"babel-loader": "^8.1.0",
"babel-plugin-react-docgen": "4.1.0",
"chromatic": "^5.2.0",
Expand All @@ -36,6 +37,7 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-draggable-playground": "^1.0.0",
"styled-components": "^4.4.1"
"styled-components": "^4.4.1",
"webpack": "^4.44.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "pcln-design-system",
"comment": "",
"type": "none"
}
],
"packageName": "pcln-design-system",
"email": "[email protected]"
}
11 changes: 11 additions & 0 deletions common/changes/pcln-icons/typescript-support_2020-11-29-05-56.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "pcln-icons",
"comment": "",
"type": "none"
}
],
"packageName": "pcln-icons",
"email": "[email protected]"
}
Loading

0 comments on commit 3a9743f

Please sign in to comment.