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

feat(tools): create ui-components package and setup Storybook #41920

Merged
merged 6 commits into from
May 10, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"tools/contributor/one-off-scripts",
"tools/crowdin",
"tools/scripts/build",
"tools/scripts/seed"
"tools/scripts/seed",
"tools/ui-components"
],
"command": {
"bootstrap": {
Expand All @@ -24,7 +25,8 @@
"tools/contributor/dashboard-app/server",
"tools/contributor/lib/",
"tools/contributor/one-off-scripts",
"tools/crowdin"
"tools/crowdin",
"tools/ui-components"
raisedadead marked this conversation as resolved.
Show resolved Hide resolved
]
}
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"start": "npm-run-all ensure-env -p develop:server serve:client",
"start-ci": "npm-run-all ensure-env -p start:server serve:client",
"start:server": "cd ./api-server && npm start",
"storybook": "cd ./tools/ui-components && npm run storybook",
"test": "npm-run-all ensure-env build:curriculum build-workers -p test:*",
"test-curriculum-full-output": "cd ./curriculum && npm run test:full-output",
"test:client": "cd ./client && npm test",
Expand Down
8 changes: 8 additions & 0 deletions tools/ui-components/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.js'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-postcss'
]
};
6 changes: 6 additions & 0 deletions tools/ui-components/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/addons';
import theme from './theme';

addons.setConfig({
theme
});
9 changes: 9 additions & 0 deletions tools/ui-components/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
}
};
8 changes: 8 additions & 0 deletions tools/ui-components/.storybook/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { create } from '@storybook/theming';

export default create({
base: 'light',
brandTitle: 'freeCodeCamp.org',
brandImage:
'https://cdn.freecodecamp.org/platform/universal/fcc_secondary.svg'
});