1.5.1-0 • Published 5 months ago

@duke-office-research-informatics/dracs v1.5.1-0

Weekly downloads
39
License
MIT
Repository
github
Last release
5 months ago

README

Duke Research Application Component System v1.0.47

This is the repository for Duke Research Application Component System (DRACS) components.

The documentation is implemented in react-storybookavailable here https://duke-office-research-informatics.github.io/dracs/?path=/story/app-header--header

Each component has a playground in which you can manipulate each prop and see the outcome from the UI, and an info section that tells how to import the component from dracs, how to declare it, and a table that lists all props.

-- with snapshot testing (enzyme-to-json), accessibliity testing (jest-aXe), and style testing (jest-styled-components).

What is this repository for?

Making the DRACS component package available, and providing documentation and testing for DRACS components in the same repo. The documentation application allows people who are interested in using DRACS components to see what each looks like, what it can do via props, and whether or not it is suitable for their needs.

How do I use this library in my application?

  • Make sure that you have node and NPM installed -- and that your app is a react.js application that uses or can use styled-components for styling.
  • install this package via NPM - npm install @duke-office-research-informatics/dracs --save
  • make sure that your application meets DRACS' peerDependencies (react > v16.8.0 , react-dom > v16.8.0, styled-components > v4.0.0, lodash v4.17.4)
  • add styled-components' themeProvider (https://www.styled-components.com/docs/advanced#theming) to the root of your application, using the DRACS theme (import { theme } from 'dracs') as the provided theme, and declare it in your app root like so:
import React from "react";
import ReactDOM from "react-dom";
import { ThemeProvider } from "styled-components";
import { theme } from "@duke-office-research-informatics/dracs";
import App from "path/to/your/app";

ReactDOM.render(
  <ThemeProvider theme={theme}>
    <App />
  </ThemeProvider>,
  document.getElementById("root")
);
  • a css reset is highly recommended -- use the reset in assets/reset.css of this repo for guaranteed interoperablility with DRACS -- or feel free to use your own.
  • start importing and using the components! For more info on component API's, see the documentation provided in this repo.

Special Note: If you are affiliated with a CTSA institution, please provide your name, email address and CTSA institution name. We would like to keep up with these collaborations.

UL1TR002553 Boulware (PI) 05/02/18–4/30/23
Duke CTSA
The Duke CTSA catalyzes the translation of scientific discoveries into health benefits for communities through collaborative research. It provides key infrastructure, resources, and learning opportunities for translational researchers at Duke and its partners. The grant supports research through pilot funding, training and career development, and Cores with expertise in research design, regulatory, biomedical informatics, data sciences, recruitment, participant interactions, community engagement, special populations, team science,  and workforce development.

How do I set up the documentation?

  • Node and NPM are required to run this repo -- please install them if you have not previously.
  • Clone this repo git clone git@github.com:duke-office-research-informatics/dracs.git.
  • Once cloned, enter the root directory and run npm install from your terminal.
  • once the dependencies have installed run npm run storybook from your terminal.
  • the application should be running at localhost:9001.

With Docker and Docker Compose

If you have docker and docker-compose installed, you can build and run dracs in docker.

build and run the service locally
docker-compose build dracs
docker-compose up -d dracs
docker-compose run dracs bash

Service will be running on https://localhost:9091

view or tail the logs from the running dracs service

# just print them once to stdout
docker-compose logs dracs
# tail them until you type ctrl-C
docker-compose logs -f dracs

run with local files mounted into container

You can mount your local files into the running container for live changes. This is an experimental feature, and may not work as well as running node and npm natively. Mounting the local filesystem into the running container definitely imposes a performance penalty, especially when running docker in a Virtual Machine, e.g. Docker For Mac, and Docker For Windows. If you simply want to run the dracs service for documentation, the above commands are preferred.

[ -L docker-compose.override.yml ] || ln -s docker-compose.dev.yml docker-compose.override.yml
docker-compose up -d dracs
docker-compose run dracs bash

One caveat, when you build the dracs image, it does not create node_modules in your local file system. If you do not have node_modules on your local file system, you will need to run the following before any of the above commands will succeed:

[ -L docker-compose.override.yml ] || ln -s docker-compose.dev.yml docker-compose.override.yml
docker-compose run dracs bash
npm install

By default, NODE_ENV is set to development in the Dockerfile. You can change this when you run npm install, e.g.

NODE_ENV=production npm install

cleaning up docker containers

When you are ready to stop the running dracs service, and/or after running any interactive bash containers via docker-compose run, you should stop and clean up these containers. docker-compose provides a single command which accomplishes both:

docker-compose down

If you should ever want to rebuild the docker image from scratch, you can remove the dracs image from your local docker registry, and rebuild:

docker rmi dracs
docker-compose build dracs

Contribution guidelines

  • Contributions are encouraged. Any contribution must be approved via PR and must include the new/update component/feature, and the corresponding documentation and testing.

  • We are currently implementing a test framework for existing dracs components. Once all existing components have been tested, we will add documentation on how to a) document and b) test a DRACS component to further encourage outside contribution.

  • To use a development branch of dracs in your project, add the git repo to your dependencies list in your application's package.json like so : "dracs": "git+ssh://git@github.com:duke-office-research-informatics/dracs.git#DEV_BRANCH"

1.3.0-alpha.6

10 months ago

1.3.0-alpha.5

10 months ago

1.3.0-alpha.7

10 months ago

1.3.0-alpha.9

10 months ago

1.5.1-0

5 months ago

1.3.0-alpha.2

10 months ago

1.3.0-alpha.4

10 months ago

1.3.0-alpha.3

10 months ago

1.4.3

8 months ago

1.4.2

9 months ago

1.4.1

9 months ago

1.4.1-MRHD3601-2

9 months ago

1.4.1-MRHD3601-1

9 months ago

1.3.0-alpha.10

10 months ago

1.4.3-alpha.0

8 months ago

1.3.0

10 months ago

1.5.0-0

6 months ago

1.2.3-alpha.0

10 months ago

1.2.3-alpha.1

10 months ago

1.2.2-alpha.1

10 months ago

1.2.2-alpha.0

10 months ago

1.2.2-alpha.2

10 months ago

1.2.1-alpha.0

10 months ago

1.2.0

12 months ago

1.1.1-alpha.0

1 year ago

1.1.1-alpha.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.47

1 year ago

1.0.46

2 years ago

1.0.46-beta.1

2 years ago

1.0.46-beta.0

2 years ago

1.0.45

3 years ago

1.0.44

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.26

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.58

4 years ago

0.1.57

4 years ago

0.1.56

4 years ago

0.1.55

4 years ago

0.1.54

4 years ago

0.1.53

4 years ago

0.1.52

4 years ago

0.1.51

4 years ago

0.1.50

5 years ago

0.1.49

5 years ago

0.1.48

5 years ago

0.1.47

5 years ago

0.1.46

5 years ago

0.1.45

5 years ago

0.1.44

5 years ago

0.1.43

5 years ago

0.1.42

5 years ago

0.1.41

5 years ago

0.1.40

5 years ago

0.1.39

5 years ago

0.1.38

5 years ago

0.1.37

5 years ago

0.1.36

5 years ago

0.1.35

5 years ago

0.1.34

5 years ago

0.1.33

5 years ago

0.1.32

5 years ago

0.1.31

5 years ago

0.1.30

5 years ago

0.1.29

5 years ago

0.1.28

5 years ago

0.1.27

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

5 years ago

0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago