How workday/canvas-kit works
A “Monorepo” container
• That the repository is managed with Lerna, which means each module/package is versioned and managed independently.
• Integration of GitHub Actions (multiple workflow files under the .github/workflows directory) for CI/CD, release, linting, testing, etc.
a. UI Component Modules:
• “modules/react”: This is the heart of the library. Inside, you have multiple packages/subdirectories for individual components (e.g. button, avatar, card, dialog, table, tabs, etc.). Each component package includes implementation (lib/), tests (spec/ and stories/), and documentation demos.
• “modules/labs-react” and “modules/preview-react”: These appear to be experimental or supplementary React packages demonstrating new ideas or previewing upcoming changes.
• “modules/popup-stack”: A specialized module handling popup layering logic.
b. Styles and Theming:
• “modules/styling” and “modules/styling-transform”: These modules provide the utilities to transform and generate CSS/styling rules, convert pixel values to rem, create themes, and perform CSS variable transformations.
c. Documentation and Development Tools:
• “modules/docs”: This module hosts developer documentation, upgrade guides, and technical examples. It is tied in with Storybook configuration (see the .storybook directory and various mdx stories).
• “utils” directory: Contains code generators (“create-component”), custom lint rules, testing helpers, and scripts for dependency checks and publishing. Mark these as auxiliary tools that support the development and maintenance of the library.
d. Non-React or Supporting Modules:
• Modules such as “modules/css” and “modules/labs-css” provide styling assets or CSS-specific utilities.
• “modules/codemod”: Contains scripts designed for upgrading component APIs and code transformations across versions.
Relationships and Interactions
• From documentation (modules/docs) and Storybook configurations (in .storybook and “modules/docs/lib”) point out their role in generating developer-facing demos and guides.
• That the utilities in the “utils” folder support tasks like code generation, linting, dependency version checking, and release processes.
• Various test suites (Cypress tests under “cypress”, Jest tests under “jest”) and point them to each module (especially the React component modules) to represent integration with automated testing.
• That GitHub Actions workflows trigger builds, tests, and releases, and are integrated with the overall monorepo structure.
Additional Details
• That although many component packages share similar internal patterns (exhibited by the similar folder structure with “lib”, “spec”, “stories”), each package may have its own internal dependencies and use of hooks, theming, and styling utilities.