- After checking out the repository, remember to set up
husky
for the first time:
npx husky install
- Install the CSS Var Complete - VS Code Plugin which provides better Intellisense while writing CSS and referencing CSS variables.
# Setup your node environment using nodenv (https://github.com/nodenv/nodenv)
$ nodenv install
# Setup yarn using npm or homebrew (https://brew.sh)
$ brew install yarn # or npm install -g yarn
Description | Command |
---|---|
Install dependencies | yarn install |
Run linter | yarn lint |
Run linter and fix all fixable issues | yarn lint:fix |
Build package | yarn build |
Run the component generator | yarn create-component |
This project uses Git-flow to manage the development workflow. Here's a breakdown of what this means for the design system:
- The
main
always represents the latest production-ready version of the design system. Each commit tomain
indicates a new release (either from changes onrelease
or fromhotfix
). next
represents the unpublished changes for the next release of the design system. These can be standalone commits, or merged in fromfeature
.feature
branches are for standalone/larger product features, and are created using the syntax[FIRSTINITIAL][LASTNAME]/[FEATURE NAME|TICKET NUMBER]
.release
branches are for preparing the next release of the design system fromnext
. Only bug fixes and metadata changes should happen in release branches.hotfix
branches are for urgent fixes that need to be production.
EDS follows the process outlined in this article, which gets into the specifics.
Note: For releasing urgent changes, read about how to publish hot fixes in Publishing. Note: If you suspect your change will be breaking, flag the team ahead of time to discuss any conflicts with EDS release planning.
In order to contribute to EDS, please follow this workflow:
- Create a feature branch from
next
called[FIRSTINITIAL][LASTNAME]/[FEATURE NAME|TICKET NUMBER]
(e.g.ahu/add-tertiary-button
ORaholloway/EDS-1234
) - Do feature work in accordance to the library's code guidelines. EDS uses conventional commits, so each commit should follow commit guidelines reflecting the nature of the work.
- When work is ready for review, issue a pull request into
next
following the pull request guidelines. Tagchanzuckerberg/edu-design-system
as reviewers for every PR. - The library owners and trusted contributors will review the work and suggest revisions or approve the pull request
- Upon approval, feature gets Squash and merged into
next
to be slated for the next library release
A few notes about breaking changes:
- If you anticipate a breaking changes is inbound, let the team know as soon as possible. This is to give everyone a chance to double-check the sequence of commits or create a
release
branch if needed. - Not all breaking changes are equal! Changes removing deprecated components/APIs require careful communication. Changes affecting in-use components also require more scrutiny.
- Consider writing a codemod (using TS Morph) for systematic changes. See examples in src/bin/migrate.
- There may be a way to make the change in a backwards-compatible way. Consider this during implementation, providing some rationale in cases where it is not feasible/practical to do so.
When we need to introduce new tokens to account for customizations or features in new or existing components, for each new token, we use the following process:
- Determine the tier of the new token with design
- Work with design to make sure the token is added to figma with the proper naming format
For example, tokens in figma have a name in the format 'Category/token-name', so we'd want the resulting token in code to resolve to --eds-theme-color-category-token-name
.
- Once completed, add the token to the appropriate JSON file in src/design-tokens
- Lastly, apply to the components according to what is in the design.
When making changes to existing tokens, we want to be mindful not to cause regressions for consumers. We use the following process for updating existing tokens:
- Add in the new token to the corresponding JSON file in src/design-tokens
- For the new token value, use a style dictionary reference, pointing to the old token name (this will generate a css variable when processing CSS as a target).
- Also add a comment which notes the old token is deprecated, and which token is the replacement to use.
For example, if we had a token --eds-theme-color-background-old-name
which we want to change to ---eds-theme-color-background-new-name
, we would set the value of the new token to var(--eds-theme-color-background-old-name)
. We can also add the following key to the JSON file.
"comment": "@deprecated This should not be used in code or design. It will be removed in a future version of EDS. Please use eds-theme-color-new-name instead."
If there is a plan to simply remove a token due to some refactoring, you can remove the suffix suggesting the token to remove at your discretion.
This has the following benefits:
- Users who have added a theme value to
--eds-theme-color-background-old-name
will not have their theme value break upon update. - Users can see which tokens are deprecated via the autogenerated comment in the token files.
- Users can adopt the new token when convenient, and EDS can publish new versions without introducing multiple breaking changes.
- Finally, we replace all uses of the old token with the new token.