npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@duke-office-research-informatics/dracs

v1.5.1-0

Published

Duke Research Application Component System v1.0.10

Downloads

234

Readme

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 [email protected]: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://[email protected]:duke-office-research-informatics/dracs.git#DEV_BRANCH"