This is a monorepo for the official CDC Design System catered for ReactJS applications. The overall goal of this project is to create open source, reusable components and libraries to be used across all ReactJS-based web applications built for the CDC.
General disclaimer This repository was created for use by CDC programs to collaborate on public health related projects in support of the CDC mission. GitHub is not hosted by the CDC, but is a third party website used by CDC and its partners to share information and collaborate on software. CDC use of GitHub does not imply an endorsement of any one particular service, product, or enterprise.
This table maps the souce code for each package within this monorepo to the location where it is published to:
| Package | Description | Source code location | NPM Page |
|---|---|---|---|
| CDC React | Library for CDC-styled ReactJS components. | packages/cdc-react | @us-gov-cdc/cdc-react |
| CDC React Icons | Icon library for CDC-styled icons, packaged as individual ReactJS components. | packages/cdc-react-icons | @us-gov-cdc/cdc-react-icons |
Download and install the following software in order to develop and build packages from source:
- NodeJS latest LTS
- Yarn is the main package manager for this monorepo. After installing NodeJS and NPM, install Yarn globally with
npm install -g yarn. - Install all package dependencies by running
yarn installat the root level.
Note: Because this project uses Yarn Workspaces, each package and the root will get a node_modules directory. Common dependencies will be placed in the root level node_modules directory, and package specific dependencies will get installed in the node_modules directory under the package specific's directory.
This project uses Storybook to create a sandbox environment for its components. You can run the Storybook instance with the command yarn storybook.
All packages use ESLint and Prettier to enforce lint and code formatting rules. You can run yarn lint at the root level to run ESLint on all source code files across all packages, or at the package level to scan files for a specific package. This also applies to code style checks, which can be run with yarn format:check.
Each package will have a build script that will be defined in their espected package.json file. This script will typically envolve running the TypeScript compiler against the typescript code, and performing any JS minifying and bundling steps. Vite is used here to take care of this process.
To build a package, you can run yarn build:<package name> at the root level, or yarn build at the package level.
Every package within this monorepo is published to a separate package on NPM. To publish a package, you will first need to create an NPM account and be added to the us-goc-cdc NPM organization. Next, you need to update the version of the package within the package's package.json file, as NPM does not allow previous versions to be overwritten.
Finally, you can perform a manual publish by running npm publish at the package level. This command will upload all files and directories listed in the files property of the package's package.json. This is typically everything in the dist directory.
Note: A CI/CD process will be built in the near-future to automate this publishing process. Once it is complete, it should be the main mechanism for publishing a package. Manual publishing should only be done if the CI/CD pipeline is not usable.
If you are external to the CDC and would like to contribute, please fork this repo and propose changes via a Pull Request against the main branch of the upstream repo.
Please report issues and bugs to the Issues tab for this repo in GitHub.
- CDC GitHub Open Project Request Form [Requires a CDC Office365 login, if you do not have a CDC Office365 please ask a friend who does to submit the request on your behalf. If you're looking for access to the CDCEnt private organization, please use the GitHub Enterprise Cloud Access Request form.]
- Open Practices
- Rules of Behavior
- Thanks and Acknowledgements
- Disclaimer
- Contribution Notice
- Code of Conduct
Describe the purpose of your project. Add additional sections as necessary to help collaborators and potential collaborators understand and use your project.
This repository constitutes a work of the United States Government and is not subject to domestic copyright protection under 17 USC § 105. This repository is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication. All contributions to this repository will be released under the CC0 dedication. By submitting a pull request you are agreeing to comply with this waiver of copyright interest.
The repository utilizes code licensed under the terms of the Apache Software License and therefore is licensed under ASL v2 or later.
This source code in this repository is free: you can redistribute it and/or modify it under the terms of the Apache Software License version 2, or (at your option) any later version.
This source code in this repository is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache Software License for more details.
You should have received a copy of the Apache Software License along with this program. If not, see http://www.apache.org/licenses/LICENSE-2.0.html
The source code forked from other open source projects will inherit its license.
This repository contains only non-sensitive, publicly available data and information. All material and community participation is covered by the Disclaimer and Code of Conduct. For more information about CDC's privacy policy, please visit http://www.cdc.gov/other/privacy.html.
Anyone is encouraged to contribute to the repository by forking and submitting a pull request. (If you are new to GitHub, you might start with a basic tutorial.) By contributing to this project, you grant a world-wide, royalty-free, perpetual, irrevocable, non-exclusive, transferable license to all users under the terms of the Apache Software License v2 or later.
All comments, messages, pull requests, and other submissions received through CDC including this GitHub page may be subject to applicable federal law, including but not limited to the Federal Records Act, and may be archived. Learn more at http://www.cdc.gov/other/privacy.html.
This repository is not a source of government records, but is a copy to increase collaboration and collaborative potential. All government records will be published through the CDC web site.
Please refer to CDC's Template Repository for more information about contributing to this repository, public domain notices and disclaimers, and code of conduct.