Git Product home page Git Product logo

mod-uk-design-system-copy's Introduction

Build & Test Master GitHub release GitHub license lerna Coverage Storybook

Build web applications that meet the Defence Digital service standards.

Visit the Roadmap board to view the high-level objectives for the MOD.UK Design System. To check on issues currently being completed, view our Tactical board instead.

Releases & versioning

All packages are published to the NPM registry and we adhere to semantic versioning.

Supported technologies

The following view layer libraries are currently supported:

  • React

Component usage guidelines

Please refer to the component demo pages and Storybook to see interactive examples, code snippets and details on how best to consume each of the components.

Installation & quick start

Installation

To install and save to your project's package.json dependencies, run:

# with npm
npm install @defencedigital/fonts @defencedigital/react-component-library styled-components

# ...or with yarn
yarn add @defencedigital/fonts @defencedigital/react-component-library styled-components

Note: styled-components is a required peer dependency and is installed with the above command.

Quick start

Here's a quick example application to get you started:

import React from 'react'
import ReactDOM from 'react-dom'
import '@defencedigital/fonts'
import { GlobalStyleProvider, Button } from '@defencedigital/react-component-library'

function App() {
  return (
    <GlobalStyleProvider>
      <Button variant="primary">
        Hello, World!
      </Button>
     </GlobalStyleProvider>
  )
}

ReactDOM.render(<App />, document.querySelector('#app'))

Monorepo & package management

Splitting up large codebases into separate independently versioned packages is extremely useful for code sharing. However, making changes across many repositories is messy and difficult to track, and testing across repositories gets complicated really fast.

To solve these (and many other) problems, some projects will organize their codebases into multi-package repositories (sometimes called monorepos).

Each package folder has it's own npm package.json and can act like a stand alone project. Yarn workspaces detects dependencies that are held within the monorepo and creates a link between them, so you can work on a react component and see instant updates in Storybook.

Manage dependencies for packages like normal, but remember to use yarn add instead of npm install.

Run locally

You'll need Git and Node.js installed to get this project running.

Note: You will need the active LTS (Long-term support) Node.js version for this project (as specified in .nvmrc)

Fork repository (optional)

If you're an external contributor make sure to fork this project first

Clone repository

git clone [email protected]:Royal-Navy/design-system.git # or clone your own fork

cd design-system

Using nvm (optional)

If you work across multiple Node.js projects there's a good chance they require different Node.js and npm versions.

To enable this we use nvm (Node Version Manager) to switch between versions easily.

  1. Install nvm
  2. Run nvm install in the project directory (this will use .nvmrc)

Scripts

The top level project contains scripts that are then executed for all packages.

  • lint Checks syntax and simple errors in javascript files.
  • test Runs Jest tests in all the packages.
  • build Runs the build script in all packages.

Git hooks

Git commit hooks trigger linting of all staged files when a change is committed.

Prettier

We have configured a set of Prettier options to enforce consistent code formatting.

Browser support

The MOD.UK Design System currently supports all major evergreen browsers.

Licensing

The defencedigital/mod-uk-design-system is licensed under the Apache License 2.0.

Contributing

Read the contributing guidelines.

Thanks

We use Chromatic for visual regression testing.

mod-uk-design-system-copy's People

Contributors

m7kvqbe1 avatar thyhjwb6 avatar antictor avatar jpveooys avatar dependabot[bot] avatar dependabot-preview[bot] avatar hxltrhuxze avatar ahwcikxz avatar foxleigh81 avatar elglup avatar 98dfsj avatar 09txzs1qs avatar markhigham avatar snyk-bot avatar adamledwards avatar fdpe5x4q avatar

Watchers

 avatar  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.