For more development details you may have a look at the confluence pages about development details.

Development principles

  1. Avoid including runtime dependencies as much as possible.
  2. Write integration tests with these advices.
  3. Re-use existing helper functions and classes.
  4. Use existing linting and code styles, based on configuration.
  5. Follow the existing structures for documentation, naming and setup.

Development environment and defaults

Many defaults are given by the linting and prettier configurations. But to keep the code base consistent and clean, we have set a certain set of rules:

How to publish a new version to NPM?

Create a Fork, make your changes and create a Pull Request) - or commit your changes to a new branch. From there an admin will create a Pull Request into the origin/main branch. Once Your commits got approved on CI, we will create a Pull Request to merge the changes in to the origin/release branch.

As soon as the Pull Request gets merged into origin/release, a CI/CD server will check all commits and figure out the new NPM Version Number and publish a new version based on the message decorations.

How to create a local package

Run yarn build:pack inside /dnb-eufemia and you get this file: /build/dnb-eufemia-v0.0.0-development.

How to enable lint-staged?

Create a file called .env.local in the root of the repo (side-by-side to the .git folder), and put LINT_STAGED=1 inside:

# File: .env.local

Other development topics