Skip to content

Commit 14bc756

Browse files
authored
chore(DS-462): Add rails-server local dev workflow (#464)
1 parent 3da2452 commit 14bc756

File tree

6 files changed

+498
-25
lines changed

6 files changed

+498
-25
lines changed

README.md

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
# 🌤️ What is the goal of the design system?
22

3-
The goal of the design system is to achieve visual and experiential consistency throughout the app while streamlining the design and implementation process. The design system should contain all reusable components, one-off variations, and guidelines that are used to build up the existing and future screens of our application. It should direct us to be mindful of when we're consciously diverging from the established system.
3+
The goal of the design system is to achieve visual and experiential consistency throughout the app while streamlining the design and implementation process. The design system should contain all reusable components, one-off variations, and guidelines that are used to build up the existing and future screens of our application. It should direct us to be mindful of when we're consciously diverging from the established system.
44

55
## References and inspiration
66
- [Carbon - IBM](https://www.carbondesignsystem.com/)
7-
- [Material Design](https://material.io/design)
7+
- [Material Design](https://material.io/design)
88
- [Primer - Github](https://primer.style/)
99
- [Ant Design](https://ant.design/)
1010

1111
# Updating
1212

1313
## 🕰️ When do we update the design system?
1414

15-
💚 **Scenario: We need a new component in the design system that is already in the Figma DS, and adding the new component is straightforward and will not significantly affect timeline of the effort.**
15+
💚 **Scenario: We need a new component in the design system that is already in the Figma DS, and adding the new component is straightforward and will not significantly affect timeline of the effort.**
1616

17-
We should go ahead and add the new component into Storybook and use the new component in the design.
17+
We should go ahead and add the new component into Storybook and use the new component in the design.
1818

19-
⏲️ **Scenario: We need a new component in the design system that is already in the Figma DS, but adding the new component will affect timeline for the effort.**
19+
⏲️ **Scenario: We need a new component in the design system that is already in the Figma DS, but adding the new component will affect timeline for the effort.**
2020

21-
We should build the component in a way that will allow for simple transfer into the design system. Adding the component into the design system should be a follow-on task immediately after the effort.
21+
We should build the component in a way that will allow for simple transfer into the design system. Adding the component into the design system should be a follow-on task immediately after the effort.
2222

23-
🧠 **Scenario: We have a situation where a new component would improve the usability of our design, but it is not yet defined in the Figma DS or in Storybook.**
23+
🧠 **Scenario: We have a situation where a new component would improve the usability of our design, but it is not yet defined in the Figma DS or in Storybook.**
2424

2525
These often pop up in the #design-review channel and decisions will depend on designer and development bandwidth. We should strive to make considered designs that continue to push the usability of our app forward while building brand consistency. If there is alignment on a design need, we should add the new component or variation to the Figma DS and add the new component into the design system. If we do not have bandwidth to align on a new design and add the variation to the design system, we should do the best we can with existing patterns.
2626

2727
## Who makes design system decisions?
2828

29-
Designers can make proposals to update the design system at any point. These changes are submitted to #design-review, and other designers can weigh in with thoughts. There should be a general consensus on why and how the design system should be changed to better suit our needs. Wen is responsible for weighing input and proposing a path forward, looping in JH when necessary.
29+
Designers can make proposals to update the design system at any point. These changes are submitted to #design-review, and other designers can weigh in with thoughts. There should be a general consensus on why and how the design system should be changed to better suit our needs. Wen is responsible for weighing input and proposing a path forward, looping in JH when necessary.
3030

31-
On the development side, Dave and Rachel oversee how components are organized and implemented to be put into use most effectively.
31+
On the development side, Dave and Rachel oversee how components are organized and implemented to be put into use most effectively.
3232

3333
## How do we decide whether something is one-off or when the component should be updated universally?
3434

35-
Development-wise, I think we should always strive for universal changes if components are being updated. However, some changes are easily made with confidence that we won't cause issues with the app, while others will require more QA.
35+
Development-wise, I think we should always strive for universal changes if components are being updated. However, some changes are easily made with confidence that we won't cause issues with the app, while others will require more QA.
3636

3737
### Safe to update:
3838

@@ -48,13 +48,13 @@ Development-wise, I think we should always strive for universal changes if compo
4848

4949
## How can we include time for updating components during cycle work?
5050

51-
Keeping the design system relevant is important for consistency in our app. Core product requirements should still take priority, but we should make the design system updates necessary for each effort before tackling nice-to-haves.
51+
Keeping the design system relevant is important for consistency in our app. Core product requirements should still take priority, but we should make the design system updates necessary for each effort before tackling nice-to-haves.
5252

5353
## ✏️ How do we write stories and documentation?
5454

55-
- For every component, we typically separate each variant out into its own story that gets exported.
55+
- For every component, we typically separate each variant out into its own story that gets exported.
5656
- Documentation lives in `Component.mdx` which references stories defined in `Component.stories.jsx`. See documentation style here in [Stories with arbitrary MDX](https://github.com/storybookjs/storybook/blob/master/addons/docs/docs/recipes.md#csf-stories-with-arbitrary-mdx).
57-
- See our [Storybook Notion Doc](https://www.notion.so/userinterviews1/Storybook-9a3585db57514ec783e39c78518ad5e6) for examples.
57+
- See our [Storybook Notion Doc](https://www.notion.so/userinterviews1/Storybook-9a3585db57514ec783e39c78518ad5e6) for examples.
5858

5959
# Future additions to this document
6060

@@ -72,7 +72,7 @@ How do we determine whether it's a major, minor, or patch release?
7272
# Developer Resources
7373

7474
## Initial Setup
75-
After cloning the repo, obtain a `.npmrc` file from another developer. This file contains authorization tokens for any private
75+
After cloning the repo, obtain a `.npmrc` file from another developer. This file contains authorization tokens for any private
7676
node packages.
7777

7878
## Available Scripts
@@ -93,6 +93,18 @@ Runs the jest test suite
9393
### `yarn lint`
9494

9595
Runs ESLint to report on any style violations
96+
97+
### `yarn rs:link`
98+
99+
Creates symlinks for packages needed to develop/debug against our `rails-server` repository.
100+
101+
### `yarn rs:link:watch`
102+
103+
Trigger a production build when files are changed.
104+
105+
### `yarn rs:unlink`
106+
107+
Remove symlinked packages.
96108
### Visual testing
97109

98110
1. Join BrowserStack (ask Brian for link)
@@ -143,3 +155,29 @@ This package uses [Semantic versioning](https://semver.org/), which requires ver
143155
* Run `git log $(git describe --tags --abbrev=0)..HEAD --oneline` to get a list of all commits since the latest release and copy these into the "Describe this release" field.
144156
* Upload the binary that was created from running `npm pack`.
145157
* Publish release.
158+
159+
## Developing against the Rails Server repo
160+
161+
### Starting up development
162+
1. run these commands inside the root of the DS repo:
163+
````bash
164+
yarn rs:link && yarn rs:link:watch
165+
````
166+
💡 at this point you should see a nodemon process running
167+
168+
2. run these commands inside the root of the RS repo:
169+
````bash
170+
bin/link-ds
171+
````
172+
### Wrapping up development
173+
1. run these commands inside the root of the RS repo:
174+
````bash
175+
bin/unlink-ds
176+
````
177+
2. run these commands inside the root of the DS repo:
178+
````bash
179+
yarn rs:unlink
180+
````
181+
182+
#### 🤔 Snags
183+
- you'll have to manually refresh your browser tab, after the automatic refresh, to see your expected changes.

bin/link-rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
yarn link
4+
cd node_modules/react
5+
yarn link
6+
cd ../../node_modules/react-dom
7+
yarn link

bin/unlink-rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
unlink()
4+
{
5+
local package_name="${2:-$1}"
6+
7+
output=$(eval "yarn unlink $1")
8+
9+
echo "$output"
10+
echo "== $package_name unlinked =="
11+
}
12+
13+
unlink '' 'DS package'
14+
unlink 'react'
15+
unlink 'react-dom'
16+
17+
yarn install --force

nodemon.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"exec": "yarn build",
3+
"ext": "js,json,jsx,scss",
4+
"verbose": true,
5+
"watch": [
6+
"scss",
7+
"src"
8+
]
9+
}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"build-storybook-docs": "build-storybook -s public --docs",
1616
"deploy-storybook": "storybook-to-ghpages",
1717
"prepublishOnly": "yarn build",
18+
"rs:link": "bin/link-rs",
19+
"rs:link:watch": "./node_modules/nodemon/bin/nodemon.js",
20+
"rs:unlink": "bin/unlink-rs",
1821
"test": "jest"
1922
},
2023
"eslintConfig": {
@@ -98,6 +101,7 @@
98101
"eslint-utils": "^1.4.3",
99102
"jest": "^26.6.3",
100103
"node-sass": "4.13.1",
104+
"nodemon": "^2.0.15",
101105
"prop-types": "^15.6.1",
102106
"react": "16.14.0",
103107
"react-copy-to-clipboard": "^5.0.2",

0 commit comments

Comments
 (0)