Design-related assets and shared configs used across the Teamshares family of apps.
Checkout the Working with Shared Repos doc, then ping #engineering-deps
.
Instructions for installing in a new Rails app (note there are many other steps to take to fully align a new app with Teamshares conventions).
-
Add entry to "dependencies" in
package.json
"@teamshares/design-system": "https://github.com/teamshares/design-system.git#main",
-
Include Teamshares styles on the first line of your
application.scss
@import '@teamshares/design-system';
-
Include Teamshares JS near the top of your
application.js
import Teamshares from "@teamshares/design-system/rails-js"; Teamshares.start();
-
Configure build pipeline + linters + cypress
Every file under
configs/
should have a file of the same name in the root of your Rails app that references these shared configs; exact syntax differs for each file, see the existing files in OS or another app (or reach out to#engineering-deps
for guidance).If you use cypress, both
cypress.config.js
andcypress/support/commands.js
should reference the shared configs from this repo.
Instructions on testing changes to this shared package within another full Rails app in development (e.g. to have OS read your local design-system, without having to deploy all changes first) follow (or see this Loom video):
-
From within the design-system directory, tell yarn we want to register it as a local override available for other apps on this computer:
yarn link
You should see output including:
success Registered "@teamshares/design-system".
-
From within the Rails app, configure yarn to use that local version:
yarn link @teamshares/design-system
You should see output including:
success Using linked package for "@teamshares/design-system".
-
Finally (not positive this is necessary) rerun
yarn install
in both directories to make sure all necessary dependencies are installed and linked properly.
That's it! You're all configured.
Once the steps from above have been completed, to actually make changes you'll want to:
-
In the Rails app (e.g.
OS
): Start the Rails server and whatever script needs to be running to compile assets (e.g.yarn dev
). -
Now make a change in this repo and it should show up on the next page refresh in the consuming app (e.g. OS).
When you're done doing local development you can undo this config.
- From within the linked Rails app:
yarn unlink @teamshares/design-system
and thenyarn install --force
to re-install the previously-linked package from remote instead.
Your changes won't go live in any consuming Rails apps until their yarn.lock
is updated to point to the newest-released git SHA (i.e. you merge a PR in that app in which you've run yarn add https://github.com/teamshares/design-system.git#main
).