-
Notifications
You must be signed in to change notification settings - Fork 179
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
chore(components): sub in storybook for styleguidist #7549
Changes from 88 commits
084411e
86a7336
a08ddc6
7e7e8d4
f926dc5
2b743ca
c883f15
b338c8a
dfeb0f5
df2d557
4a7ecd0
0d7b91a
546b50a
9481e40
dc17d4e
8918d62
0f1546a
bb8b4d8
3db923d
d105565
6b65363
973a566
a581bf3
7b71e14
2f28bf1
eb371dd
be07f4b
8b23039
8f6ace7
baba5c3
35c39ff
9ee75f8
ffe808a
9f82285
de6b1c4
1ec3f5d
65a9013
e795522
6937b25
b3b9ce2
90578a0
aaead15
f9ed804
bcd9311
154b9cc
6b0c746
f01e901
7e214f1
1d5908a
2c52afc
207fdbb
5bafba9
eba7114
2494b20
b18be1a
0f835c0
cd9aeba
7c23b61
b39773a
dbfd400
ed529a6
3c1b764
030eaf0
c406412
b562f32
fae5813
122d2f5
a66e8e4
62f3782
3b1d517
325ea8d
72b850f
82ebdb6
c2a9fc8
0902454
ef32740
d0d9be0
04f18d4
6aad3a7
109785d
0487af7
915478c
49fb4e5
4764d83
2d3a7b7
bcd2fdb
1fe352e
18058ca
09678be
f1686ff
df28643
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict' | ||
|
||
const { baseConfig } = require('@opentrons/webpack-config') | ||
|
||
module.exports = { | ||
webpackFinal: config => ({ | ||
...config, | ||
module: { ...config.module, rules: baseConfig.module.rules }, | ||
plugins: [...config.plugins, ...baseConfig.plugins], | ||
}), | ||
stories: ['../components/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
} | ||
|
||
import React from 'react' | ||
|
||
import { GlobalStyle } from '../app/src/atoms/GlobalStyle' | ||
|
||
// Global decorator to apply the styles to all stories | ||
export const decorators = [ | ||
Story => ( | ||
<> | ||
<GlobalStyle /> | ||
<Story /> | ||
</> | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# opentrons component library makefile | ||
|
||
# dev server port | ||
port ?= 8081 | ||
port ?= 6060 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how come we're switching this to port 6060? upon googling looks like 6060 is used to indicate the use of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😬 so yeah, turns out we never used this |
||
|
||
# type definitions | ||
typedefs := $(shell yarn -s shx find "lib/**/*.d.ts") | ||
|
@@ -13,21 +13,16 @@ flow_out := $(patsubst lib/%.d.ts,flow-types/%.js.flow,$(typedefs)) | |
.PHONY: all | ||
all: clean dist | ||
|
||
.PHONY: setup | ||
setup: | ||
yarn | ||
|
||
.PHONY: clean | ||
clean: | ||
yarn shx rm -rf dist | ||
yarn --cwd .. shx rm -rf storybook-static | ||
|
||
# artifacts | ||
##################################################################### | ||
|
||
.PHONY: dist | ||
dist: export NODE_ENV := development | ||
dist: | ||
yarn styleguidist build | ||
yarn --cwd .. build-storybook | ||
|
||
.PHONY: flow-types | ||
flow-types: $(flow_out) | ||
|
@@ -39,6 +34,5 @@ flow-types/%.js.flow: lib/%.d.ts | |
##################################################################### | ||
|
||
.PHONY: dev | ||
build: export NODE_ENV := development | ||
dev: | ||
yarn styleguidist server | ||
yarn --cwd .. storybook --port $(port) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import * as React from 'react' | ||
import { AlertItem } from './AlertItem' | ||
mcous marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import type { Story, Meta } from '@storybook/react' | ||
|
||
export default { | ||
title: 'Library/Molecules/AlertItem', | ||
component: AlertItem, | ||
argTypes: { onCloseClick: { action: 'clicked' } }, | ||
} as Meta | ||
|
||
const Template: Story<React.ComponentProps<typeof AlertItem>> = args => ( | ||
<AlertItem {...args} /> | ||
) | ||
|
||
export const Basic = Template.bind({}) | ||
Basic.args = { | ||
type: 'success', | ||
title: 'good job!', | ||
} | ||
|
||
export const OverriddenIcon = Template.bind({}) | ||
OverriddenIcon.args = { | ||
type: 'info', | ||
title: 'Alert with overridden icon', | ||
icon: { name: 'pause-circle' }, | ||
} | ||
|
||
export const Stackable: Story< | ||
React.ComponentProps<typeof AlertItem> | ||
> = args => ( | ||
<div> | ||
<Template {...args} type="warning" title={'Warning with close button'} /> | ||
<Template | ||
{...args} | ||
onCloseClick={undefined} | ||
type="warning" | ||
title={'Warning with no close button'} | ||
/> | ||
<Template {...args} type="warning" title={'Warning with no children'} /> | ||
<Template | ||
{...args} | ||
type="warning" | ||
title={'Warning with React Node children'} | ||
> | ||
<p>Some additional info</p> | ||
</Template> | ||
</div> | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity how come we gotta bump this up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not bumping it can result in flow crashing with
Unhandled exception: SharedMem.Hash_table_full
🙃But yeah, as the codebase grew, we started seeing that particular flow crash. Added the config to bump it up to 20 in #4959. As Brian was working on this PR, he started seeing this crash again, and bumping it again (from 16 MB to 32 MB) seemed to resolve it.
Since Flow is on its way out, it seemed like the most straightforward thing to do to keep things chugging along rather than investigating it too deeply