2.81.0 • Published 1 day ago

@dossier/mithra-ui v2.81.0

Weekly downloads
875
License
UNLICENSED
Repository
-
Last release
1 day ago

Mithra UI

React component library for the Dossier design system

Getting started

Set up local development environment:

  1. Run yarn
  2. Run yarn run build-lib to generate the version file.
  3. Run yarn start to start the dev server.

The local dev server gives you a live-reloaded version of the mithra documentation, that you can use to test components while working on them.

If you don't use yarn, you can use npm instead, or install Yarn 1.

Other useful commands:

  • yarn run build-lib
  • yarn run build-doc
  • yarn run import-icons

Technology stack

Development and branches

Development happens in feature branches, for example feature/MU-123-add-context-menu. These are merged by pull request to release branches, for example release/v2.next. There is one combined development/release branch for each major version. Later version branches include changes from earlier versions; for example, v1 is included (merged) into v2, but not vice versa.

When making changes that affect users of the library, please add a concise comment about the change at the top of the CHANGELOG file.

To determine which release branch a feature should be merged to, use SemVer (breaking changes next major, non-breaking changes next minor or patch).

Code style

We use automatic code formatting with Prettier. You should set this up with your editor when contributing.

VS Code: The project already contains configuration that makes the editor format on save, but you must install the Prettier extension. This will be prompted when you open the project.

IntelliJ: Intall the Prettier extension, and choose the node_modules Prettier in its settings.

Releasing packages

Don't follow the steps below unless you know what you're doing.

Steps to release on npm:

  • Checkout the correct release branch with your changes.
  • Run the appropriate npm version major|minor|patch to update package.json and create a tagged commit.
  • Push the resulting git tag to bitbucket (git push --tags).
  • This triggers the npm publish pipeline, which is irreversible. It also rebuilds and deploys the docs site.

Image snapshot testing

The image snapshot tests take screenshots of test layouts using puppeteer and jest. The images are then compared with previous snapshots using jest-image-snapshot. If a test fails, you will get a visual diff. These tests run automatically in a bitbucket pipeline for all pull requests. If they fail, you can download the diff images for the failed tests in an artifact from bitbucket.

You can run the tests locally using yarn run test:local, however, you will most likely need to run this command inside a docker container, because font rendering may be different on your machine and the one that generated the snapshot image. There are tasks to build and run a local docker test container that is consistent with the CI pipeline environment in the package.json scripts.

Importing icons from Figma

  1. Select the icons in Figma and batch export everything as svg.
  2. Create a folder in the project root called ./iconBuildSrc
  3. Extract the downloaded zip into the iconBuildSrc
  4. Run yarn run import-icons
  5. Modify src/lib/assets/icons/icons/index.js as needed if the categories have changed
  6. Voilà. Delicious icons.

Docker images

  • Chrome.dockerfile is used to build the docker image with the necessary dependencies for running the tests.
  • Test.dockerfile is used to create a local image that is based on Chrome.dockerfile but with the project files included. This image is used to run the tests in a consistent environment outside of the operation system.
  • docker-compose.yml is used to start the local docker container with the test image and include the right source code.

Before you start you should make sure your docker is logged into dossier docker repo. You can do this by running the following command:

docker login docker.dossier.no --username {NEXUS_USERNAME} -p {NEXUS_PASSWORD}

Running the tests in the docker container

If you want to run the tests in the docker container, run the following:

# Run tests in the container
yarn test:docker-run

Updating chrome docker image

If you need to add some dependencies to the docker image, you should update the Chrome.dockerfile and then build the image.

Building and publishing the chrome docker image

The image described in Dockerfile.chrome needs to be published to a Docker repository so that it will be available in the Bitbucket pipeline.

To build the docker image, run the following:

yarn test:docker-build

To publish the image, run the following:

yarn test:docker-publish
2.81.0

1 day ago

2.80.4

17 days ago

2.80.3

18 days ago

2.80.2

18 days ago

2.80.1

27 days ago

2.80.0

1 month ago

2.79.1

2 months ago

2.79.0

2 months ago

2.78.0

3 months ago

2.77.1

3 months ago

2.77.0

3 months ago

2.76.0

3 months ago

2.75.3-0

3 months ago

2.75.2

3 months ago

2.75.1-0

3 months ago

2.75.1

3 months ago

2.75.0

4 months ago

2.74.1-0

4 months ago

2.73.1-1

5 months ago

2.74.0

5 months ago

2.73.1-0

5 months ago

2.73.0

5 months ago

2.72.5-0

5 months ago

2.72.4

5 months ago

2.72.3

5 months ago

2.72.3-1

5 months ago

2.72.2

5 months ago

2.72.1

5 months ago

2.72.0

5 months ago

2.71.2-0

5 months ago

2.69.0

6 months ago

2.69.1

6 months ago

2.60.0

10 months ago

2.68.0

6 months ago

2.68.1

6 months ago

2.71.1

5 months ago

2.71.0

6 months ago

2.69.1-0

6 months ago

2.67.0

7 months ago

2.70.2

6 months ago

2.70.1

6 months ago

2.70.0

6 months ago

2.66.0

7 months ago

2.66.1

7 months ago

2.66.2

7 months ago

2.65.0

7 months ago

2.65.1

7 months ago

2.65.2

7 months ago

2.65.7

7 months ago

2.65.3

7 months ago

2.65.4

7 months ago

2.65.5

7 months ago

2.65.6

7 months ago

2.64.0

8 months ago

2.63.1

8 months ago

2.63.0

8 months ago

2.59.0

10 months ago

2.62.0

8 months ago

2.61.0

9 months ago

2.61.1

9 months ago

2.57.0

11 months ago

2.56.1

11 months ago

2.58.0

11 months ago

2.58.1

11 months ago

2.56.0

1 year ago

2.55.0

1 year ago

2.54.0

1 year ago

2.53.0

1 year ago

2.53.1

1 year ago

2.53.2

1 year ago

2.52.0

1 year ago

2.51.1

1 year ago

2.50.0

1 year ago

2.50.1

1 year ago

2.46.0

1 year ago

2.45.0

1 year ago

2.45.1

1 year ago

2.44.1

1 year ago

2.44.0

1 year ago

2.44.3

1 year ago

2.44.2

1 year ago

2.43.0

1 year ago

2.42.0

1 year ago

2.45.2-0

1 year ago

2.49.0

1 year ago

2.45.2-1

1 year ago

2.48.0

1 year ago

2.47.0

1 year ago

2.39.1

2 years ago

2.39.0

2 years ago

2.38.0

2 years ago

2.41.1

1 year ago

2.37.4

2 years ago

2.40.1

2 years ago

2.40.0

2 years ago

2.37.3

2 years ago

2.37.2

2 years ago

2.37.1

2 years ago

2.37.0

2 years ago

2.36.2-0

2 years ago

2.36.0

2 years ago

2.36.1

2 years ago

2.35.0

2 years ago

2.34.0

2 years ago

2.34.1

2 years ago

2.33.0

2 years ago

2.32.0

2 years ago

2.31.0

2 years ago

2.29.0

2 years ago

2.28.1

2 years ago

2.28.0

2 years ago

2.28.2

2 years ago

2.30.0

2 years ago

2.29.1-rc.0

2 years ago

2.29.1-rc.1

2 years ago

2.27.0

2 years ago

2.26.0

2 years ago

2.25.0

2 years ago

2.24.1

2 years ago

2.24.0

2 years ago

2.19.0

2 years ago

2.22.1

2 years ago

2.22.0

2 years ago

2.22.3

2 years ago

2.22.2

2 years ago

2.18.1

2 years ago

2.18.0

2 years ago

2.21.0

2 years ago

2.21.2

2 years ago

2.21.1

2 years ago

2.21.3

2 years ago

2.17.0

2 years ago

2.17.1

2 years ago

2.20.0

2 years ago

2.20.1

2 years ago

2.23.0

2 years ago

2.15.0-rc.0

2 years ago

2.15.0

2 years ago

2.14.1

2 years ago

2.14.0

2 years ago

2.13.2-rc.6

2 years ago

2.13.2-rc.9

2 years ago

2.13.2-rc.8

2 years ago

2.13.2-rc.3

2 years ago

2.13.2-rc.5

2 years ago

2.13.2-rc.4

2 years ago

2.16.0

2 years ago

2.13.2-rc.1

2 years ago

2.13.2-rc.0

2 years ago

2.13.0

2 years ago

2.13.1

2 years ago

2.13.2-rc.2

2 years ago

2.12.0

3 years ago

2.12.1

2 years ago

2.11.0

3 years ago

2.9.2-rc.0

3 years ago

2.10.0

3 years ago

2.8.1

3 years ago

2.8.0

3 years ago

2.9.1

3 years ago

2.9.0

3 years ago

2.9.1-rc.0

3 years ago

2.7.0

3 years ago

2.6.1

3 years ago

2.6.0

3 years ago

2.5.1

3 years ago

2.5.0

3 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.1.0-table.0

3 years ago

2.0.0

3 years ago

2.0.0-rc.5

3 years ago

2.0.0-rc.4

3 years ago

2.0.0-rc.2

3 years ago

2.0.0-rc.3

3 years ago

1.5.2

3 years ago

2.0.0-rc.0

3 years ago

2.0.0-rc.1

3 years ago

1.5.1

3 years ago

1.5.0-rc.0

3 years ago

1.5.0-rc.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

1.0.0-rc.3

3 years ago

1.0.0-rc.4

3 years ago

1.0.0-rc.1

3 years ago

1.0.0-rc.2

3 years ago

1.0.0-rc.0

3 years ago

0.16.0

3 years ago

0.13.6

3 years ago

0.13.7

3 years ago

0.13.8

3 years ago

0.13.9

3 years ago

0.13.0

3 years ago

0.13.1

3 years ago

0.13.2

3 years ago

0.13.3

3 years ago

0.13.4

3 years ago

0.13.5

3 years ago

0.14.0

3 years ago

0.14.1

3 years ago

0.14.2

3 years ago

0.14.3

3 years ago

0.14.4

3 years ago

0.15.0

3 years ago

0.15.1

3 years ago

0.13.12

3 years ago

0.13.11

3 years ago

0.13.10

3 years ago

0.13.13

3 years ago

0.12.2

3 years ago

0.11.6

3 years ago

0.12.0

3 years ago

0.12.1

3 years ago

0.11.3

3 years ago

0.11.5

3 years ago

0.11.2

3 years ago

0.11.0

3 years ago

0.11.1

3 years ago

0.10.18

3 years ago

0.10.19

3 years ago

0.10.17

3 years ago

0.10.16

3 years ago

0.10.14

3 years ago

0.10.15

3 years ago

0.10.10

3 years ago

0.10.11

3 years ago

0.10.12

3 years ago

0.10.13

3 years ago

0.10.9

3 years ago

0.10.6

3 years ago

0.10.8

3 years ago

0.10.5

3 years ago

0.10.4

3 years ago

0.10.2

3 years ago

0.10.3

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.9.1

3 years ago

0.8.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.40

3 years ago

0.4.39

3 years ago

0.4.37

3 years ago

0.4.38

3 years ago

0.4.35

3 years ago

0.4.36

3 years ago

0.4.34

3 years ago

0.4.33

3 years ago

0.4.32

3 years ago

0.4.31

3 years ago

0.4.29

3 years ago

0.4.30

3 years ago

0.4.28

3 years ago

0.4.27

3 years ago

0.4.26

3 years ago

0.4.25

3 years ago

0.4.24

3 years ago

0.4.23

3 years ago

0.4.22

3 years ago

0.4.20

3 years ago

0.4.21

3 years ago

0.4.19

3 years ago

0.4.17

3 years ago

0.4.18

3 years ago

0.4.15

3 years ago

0.4.16

3 years ago

0.4.13

3 years ago

0.4.14

3 years ago

0.4.12

3 years ago

0.4.11

3 years ago

0.4.10

3 years ago

0.4.9

3 years ago

0.4.8

4 years ago

0.4.7

4 years ago

0.4.6

4 years ago

0.4.5

4 years ago

0.4.4

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.3.0

4 years ago

0.4.0

4 years ago

0.1.0

4 years ago