Skip to content

Commit 7d08ef9

Browse files
authored
Merge pull request #13 from bbc/adds-adr-28-08
Adds ADR for publishing and refactoring processes
2 parents ebc87d7 + d2f0b87 commit 7d08ef9

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

docs/ADR/adr-28-08.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Relationship between Storybook and DPE Client
2+
3+
* Status: accepted
4+
* Deciders: Alli and Eimi
5+
* Date: 2019-08-28
6+
7+
Technical Story: N/A
8+
9+
## Context and Problem Statement
10+
11+
We needed to clarify the relationship between the DPE Client repository, where the components we are using to populate the Storybook repo have already been written, and the Storybook repository.
12+
13+
+ From which repo would components be published?
14+
+ Which repos would consume components from NPM?
15+
+ Should the Storybook live inside the Client repo?
16+
17+
## Decision Drivers
18+
19+
N/A
20+
21+
## Considered Options
22+
23+
1. Publish components to NPM from the DPE Client repo, and then consume those components in the Storybook repo
24+
2. Publish components to NPM from the Storybook repo, and then consume those components in the DPE client
25+
3. Include the Storybook config and setup within the Client repo
26+
27+
## Decision Outcome
28+
29+
Chosen option: Option 2, because this allows us to refactor components' code and preview changes within the Storybook locally — before publishing the component to the hosted Storybook and NPM.
30+
31+
This means that our workflow for populating the Storybook and refactoring the Client code is as follows:
32+
33+
1. Duplicate component code to Storybook repo
34+
2. Publish completed components to NPM
35+
3. Remove the original component code from the Client and import via NPM
36+
37+
### Positive Consequences
38+
39+
### Negative consequences
40+
Caveat: If more than one person is working on the Storybook and DPE Client, they'll need to sync up to ensure that details in code refactors are not lost due to overlapping work.
41+
42+
If possible, also avoid having people working simultaneously on a component that consumes / is consumed by another component (i.e., one person working on a card component and another person working on a list component that consumes card components).
43+
44+
## Pros and Cons of the Options
45+
46+
### Option 1: Publish components to NPM from the Client and consume via Storybook
47+
48+
This workflow would mean that we would need to be refactoring code in the client before publishing individual components to NPM. To modify the components in the Storybook, we would need to re-publish to NPM from the client. This is gross.
49+
50+
### Option 2: Publish components to NPM from the Storybook and refactor to consume in the Client
51+
52+
Although this workflow means we are essentially copy-pasting code over from the Client repo to the Storybook, it allows us to:
53+
54+
+ Refactor component code while previewing the Storybook locally
55+
+ Reflect changes to the code in the Client by refactoring to import components from NPM
56+
57+
This is a more sensible workflow than option one.
58+
59+
### Option 3: Same repo for both Storybook and Client
60+
61+
We didn't discuss this option in detail — mainly because it would likely introduce too many moving parts to the same repo.
62+
63+
## Links
64+
N/A

0 commit comments

Comments
 (0)