GithubHelp home page GithubHelp logo

helemand / cvi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from e-gov/cvi

0.0 0.0 0.0 4.2 MB

Common Visual Identity components built upon the original Veera Design System for Open Source usage.

Home Page: https://e-gov.github.io/cvi/

License: MIT License

Shell 0.19% JavaScript 2.46% TypeScript 73.48% HTML 6.71% Dockerfile 0.38% SCSS 11.87% MDX 4.92%

cvi's Introduction

๐Ÿ“š e-Gov Common Visual Identity (CVI)

This repository includes a shared CSS library, preprocessed with Sass, along with HTML examples based on it. It also houses a user interface (UI) kit in Angular and a typed, tree-shakable icon library.

The CSS has been architectured to be independent of any specific Javascript framework. This makes it possible for contributors to easily integrate component libraries from other frameworks such as React or Vue.js. The Angular UI library has also been constructed free of any dependencies on design systems/frameworks like Bootstrap or Google's Material. This ensures a reduction in dependence on third-party vendors ๐Ÿ› ๏ธ.

๐Ÿš€ Quick Start & Documentation

The CSS framework and Angular component library utilize Storybook for comprehensive documentation and seamless usage.

To get started, you can access the installation instructions and documentation on e-Gov CVI's Storybook:

๐Ÿ“Œ https://e-gov.github.io/cvi/

The styles in this repository take inspiration from the initial Veera Design System, which you can find here:

๐Ÿ”— https://www.figma.com/file/nNCV5kRqdRkS8MOCK1ZbqU/Veera-Design-System

Please note, e-Gov CVI is not Veera. We've taken inspiration from their work, but our approach and implementation are unique ๐Ÿ’ก.

To discuss any issues, suggestions or questions, join our public CVI Signal group.

๐Ÿ› ๏ธ Installation Instructions

Follow these steps to install and integrate our library:

  1. ๐Ÿ“ฅ Add the public Koodivaramu registry to your project by following the instructions provided here.

  2. ๐Ÿ“ฆ Install the necessary package to your project:

  • CSS framework: Use the command npm i --save @egov/cvi-styles
  • Angular components: Use the command npm i --save @egov/cvi-ng
  • React components: Use the command npm i --save @egov/cvi-react
  • Icons: Use the command npm i --save @egov/cvi-icons
  1. ๐Ÿ After installation, import the dependencies into your project. You'll find dedicated instructions for this in the documentation for the CSS framework, Angular components, and icons.

๐Ÿ“ฆ Packages and Artifacts Repository

The built packages are published to the public Koodivaramu repository, from where you can download and add them to your application. You can access it via the following link:

๐Ÿ”— Koodivaramu Repository

In addition, the Storybook Docker image is also published to the Koodivaramu repository:

๐Ÿ”— Storybook Docker Image


๐Ÿค Contributing

If you want to contribute to the Common Visual Identity Component Library, follow these steps:

  1. Create a fork of the repository.
  2. Make changes in your own fork.
  3. Create a pull-request back to this repository.

For more detailed instructions, follow the link below:

๐Ÿ”— GitHub Contribution Guide


๐Ÿ”„ Adding/Updating Packages

When adding/upgrading peer dependencies, ensure that they are also updated in the following files:

  • libs/LIB-NAME/package.json for peerDependencies.
  • libs/LIB-NAME/ng-package.json for dependencies to be packaged with the library.

๐Ÿ“ Commit Message Format

The project follows the conventional commit format convention and uses the semver nx plugin for versioning. Ensure to use the appropriate commit messages.


๐Ÿง‘โ€๐Ÿ’ป Code Style

Angular

Selectors

Use [cvi-component-selector=local-selector-name] naming convention for content projection selectors.

For example, to introduce a content selector that inserts custom content before a title in a panel (eg. fictional PanelComponent/<cvi-ng-panel> component), an appropriate code would be <ng-content select="[cvi-ng-panel=before-title]"></ng-content>.


๐Ÿš€ Running the Storybook

Run the following command to build documentation and start the Storybook locally:

npm run storybook

๐Ÿณ Running Storybook locally in Docker

To run Storybook locally using Docker, follow these steps:

  1. Build the Docker image with the following command:

docker build -f ./libs/storybook/Dockerfile -t cvi-storybook .

  1. Start the Storybook container with the following command:

docker-compose up storybook

  1. Stop the container with the following command:

docker-compose down

  1. the Storybook interface at http://localhost:3005/ in your web browser.

๐Ÿ”Ž Understand your workspace

To see a diagram of the dependencies of your projects, run the following command:

nx graph

This will provide you with an overview of your workspace and how the different projects and libraries are interconnected.

๐Ÿ”จ Using the Nx build system

To learn more about the Nx build system, check out the following resources:

๐Ÿš€ Running Cypress tests against Storybook

To run Cypress tests against Storybook, make sure that Storybook is up and running (see the previous section). Then, run the following command: npm run cypress:ui

This will open up the Cypress visual testing tool. Select E2E Testing to view all component tests. Note that Cypress tests use Angular components in iFrame windows, which is why Storybook needs to be up and running.

๐Ÿš€ Running Chromatic tests

The project uses automatic screenshot testing via Chromatic.

  1. To run the tests, use the following command in your terminal: npm run chromatic
  2. Open the resulting URL and review the visual changes, accepting or denying them in the Chromatic UI.

๐Ÿ’ก Chromatic CI also runs on every push. The action always passes (even when visual changes are detected) except for cases when a story is broken. Contributors and reviewers should check the results of the action (and accept or decline them in the Chromatic UI) by following a link in the build log. ๐Ÿ’ก

Publishing to Chromatic also gives a possibility to share a Storybook link for a specific branch (even non-pushed, if the local npm command is used) in this format:

https://<branch>--6373995e3f280e239470296d.chromatic.com

๐Ÿ™ Thanks

Chromatic

Thanks to Chromatic for providing the visual testing platform that helps us review UI changes and catch visual regressions. ๐ŸŽ‰

cvi's People

Contributors

sa-r-ah avatar siimveskilt avatar certainlyakey avatar ceisipeik-nortal avatar mluik avatar hannesatnrt avatar henrymae avatar mihkelpaloots avatar theonlymarksam avatar helemand avatar ceisipeik avatar keitjrve avatar ivomattus avatar dependabot[bot] avatar 1ahmedyasser avatar ekateriinal avatar seeru-crypto avatar riagit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.