|
1 | | -# UZH BF Design System |
| 1 | +# UZH DF Design System |
2 | 2 |
|
3 | | -This design system is created and maintained by the IT dev-ops team at the Teaching Center of the department of Banking and Finance at the University of Zurich. It simplifies the shared use of commonly used components in our web-development projects with corporate colors already included. |
| 3 | +This design system is created and maintained by the IT dev-ops team at the Teaching Center of the Department of Finance at the University of Zurich. It simplifies the shared use of commonly used components in our web-development projects with corporate colors already included. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Node.js version 22 (as specified in the project configuration) |
| 8 | +- pnpm 10.12.1+ (recommended) or npm |
4 | 9 |
|
5 | 10 | ## Local Development |
6 | 11 |
|
7 | | -In order to see how the components look, corresponding `.stories.tsx` files are added for each component and their content can be observed through the Ladle platform, accessibly locally on `localhost:61000` when running: |
| 12 | +This project uses a monorepo structure with Turbo for build orchestration and Ladle for component development. |
| 13 | + |
| 14 | +To see how the components look, corresponding `.stories.mdx` files are added for each component and their content can be observed through the Ladle platform, accessible locally on `localhost:61000/design-system` when running: |
8 | 15 |
|
9 | 16 | ```bash |
| 17 | +# Using pnpm (recommended) |
| 18 | +pnpm run dev |
| 19 | + |
| 20 | +# Using npm |
10 | 21 | npm run dev |
11 | 22 | ``` |
12 | 23 |
|
| 24 | +In addition to the visible component stories (implemented with Ladle), all MDX-story files also contain an extensive summary of the component's properties, including types, default values, and descriptions (as a comment). This part is meant to be scraped by Context7 (https://context7.com/uzh-bf/design-system), generating an importable MCP for the UZH DF design system. After adding new components / making significant changes to the corresponding interfaces, consider updating / re-generating these sections and triggering a new indexing run in Context7. |
| 25 | + |
| 26 | +### Additional Development Commands |
| 27 | + |
| 28 | +```bash |
| 29 | +# Build all packages |
| 30 | +pnpm run build # or npm run build |
| 31 | + |
| 32 | +# Run linting |
| 33 | +pnpm run lint # or npm run lint |
| 34 | + |
| 35 | +# Run type checking |
| 36 | +pnpm run check # or npm run check |
| 37 | + |
| 38 | +# Format code |
| 39 | +pnpm run format # or npm run format |
| 40 | + |
| 41 | +# Check formatting |
| 42 | +pnpm run format:check # or npm run format:check |
| 43 | +``` |
| 44 | + |
13 | 45 | ## Deployment |
14 | 46 |
|
15 | | -Once you want to re-deploy the package with updates, make sure that all linting errors are fixed and all parts of the new or modified component are exported properly. If this is the case, merge (and squash) all your changes into the main branch, pull the branch to your computer and run: |
| 47 | +Once you want to re-deploy the package with updates, make sure that all linting errors are fixed and all parts of the new or modified component are exported properly. |
| 48 | + |
| 49 | +**Important:** Before pushing or merging content to the main branch, run the build command to ensure that the generated type files are consistent with the component implementations: |
16 | 50 |
|
17 | 51 | ```bash |
| 52 | +# Using pnpm (recommended) |
| 53 | +pnpm run build |
| 54 | + |
| 55 | +# Using npm |
| 56 | +npm run build |
| 57 | +``` |
| 58 | + |
| 59 | +If this is the case, merge (and squash) all your changes into the main branch, pull the branch to your computer and run: |
| 60 | + |
| 61 | +```bash |
| 62 | +# Using pnpm (recommended) |
| 63 | +pnpm run release:dry |
| 64 | +pnpm run release |
| 65 | + |
| 66 | +# Using npm |
| 67 | +npm run release:dry |
18 | 68 | npm run release |
19 | 69 | ``` |
20 | 70 |
|
21 | | -Once this release command was successful, you can push it to GitHub: |
| 71 | +Once this release command was successful, you can push it to GitHub with the displayed command: |
22 | 72 |
|
23 | 73 | ```bash |
24 | 74 | git push --follow-tags origin main |
25 | 75 | ``` |
26 | 76 |
|
27 | | -This repository is set up to automatically deploy the package to npm under the following domain: `https://github.com/uzh-bf/design-system/pkgs/npm/design-system` |
| 77 | +### Automatic Deployments |
| 78 | + |
| 79 | +This repository is configured with automatic deployments: |
| 80 | + |
| 81 | +- **GitHub Pages**: All pushes to the main branch are automatically deployed to GitHub Pages through CI actions, making the component documentation and examples accessible online. |
| 82 | +- **NPM Package**: The repository is set up to automatically deploy the package to npm under the following domain: `https://github.com/uzh-bf/design-system/pkgs/npm/design-system` |
28 | 83 |
|
29 | 84 | ## Installing the package |
30 | 85 |
|
31 | | -As with all npm packages, components from the design-system can be easily installed through the following command: |
| 86 | +As with all npm packages, components from the design-system can be easily installed using either npm or pnpm: |
32 | 87 |
|
33 | 88 | ```bash |
| 89 | +# Using npm |
34 | 90 | npm install @uzh-bf/design-system |
| 91 | + |
| 92 | +# Using pnpm (recommended) |
| 93 | +pnpm install @uzh-bf/design-system |
35 | 94 | ``` |
0 commit comments