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

Fix broken stories in UI Storybook #19632

Merged
merged 2 commits into from
Oct 26, 2022
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
4 changes: 2 additions & 2 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"publish:debug": "npm run publish:latest -- --npm-tag=debug --no-push",
"publish:latest": "lerna publish --exact --concurrency 1 --force-publish",
"publish:next": "npm run publish:latest -- --npm-tag=next",
"storybook:ui": "./lib/cli/bin/index.js dev --port 6006 --config-dir ./ui/.storybook --no-manager-cache",
"storybook:ui:build": "./lib/cli/bin/index.js build --config-dir ./ui/.storybook",
"storybook:ui": "NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" ./lib/cli/bin/index.js dev --port 6006 --config-dir ./ui/.storybook --no-manager-cache",
"storybook:ui:build": "NODE_OPTIONS=\"--preserve-symlinks --preserve-symlinks-main\" ./lib/cli/bin/index.js build --config-dir ./ui/.storybook",
Copy link
Member

Choose a reason for hiding this comment

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

You should probably cd into the ui directory & run storybook from there. Though I'm not 100% sure it's required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's actually on purpose we don't do that, because Vite will look for node_modules in cwd, and since they're all at code/node_modules we have to run from code

"storybook:ui:chromatic": "yarn chromatic --build-script-name storybook:ui:build --storybook-config-dir ./ui/.storybook --storybook-base-dir ./code/ui --project-token=$CHROMATIC_TOKEN_STORYBOOK_UI --only-changed --exit-zero-on-changes --exit-once-uploaded",
"task": "cd .. && yarn task",
"test": "NODE_OPTIONS=--max_old_space_size=4096 jest --config ./jest.config.js",
Expand Down
4 changes: 2 additions & 2 deletions code/ui/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
convert,
styled,
useTheme,
} from '../../lib/theming';
import { Symbols } from '../components';
} from '@storybook/theming';
import { Symbols } from '@storybook/components';

const { document } = global;

Expand Down
28 changes: 27 additions & 1 deletion code/ui/components/src/typography/typography.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ export const sampleText =

## Sans-serif

```
font-family:
"Nunito Sans",
-apple-system,
".SFNSText-Regular",
"San Francisco",
BlinkMacSystemFont,
"Segoe UI",
"Helvetica Neue",
Helvetica,
Arial,
sans-serif;
```

<Typeset
fontFamily={typography.fonts.base}
fontSizes={fontSizes}
Expand All @@ -33,7 +47,19 @@ export const sampleText =

## Monospace

Currently not working
```
font-family:
ui-monospace,
Menlo,
Monaco,
"Roboto Mono",
"Oxygen Mono",
"Ubuntu Monospace",
"Source Code Pro",
"Droid Sans Mono",
"Courier New",
monospace;
```

<Typeset
fontFamily={typography.fonts.mono}
Expand Down