NOTE: As of July 30th 2024 this application is no longer actively developed.
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 install
at 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.
Releases are automated with a combination of GitHub Actions, release-please, and conventionalcommits.org. Every package within this monorepo is published to a separate package on NPM.
How releases work:
- When a PR is merged with a conventional commit title (ex.
feat: added new Pill component
) an automated chore/release PR will be created(will start with "chore:"). The automation will determine which packages had changes and will generate a release for each package(ie. if bothcdc-react
andcdc-react-icons
had changes, then two PRs would be created). - The automated chore/release PR can be merged once the build passes. This PR will automatically update the related
package.json
files and create release notes inCHANGELOG.md
. Be sure to keep the title of the merge commit the same as the initial PR commit title. An example ofcdc-react
automated release PR- #145 - Once the chore/release PR has been merged, a release will be created in GitHub and the new version will be published to NPM.
Note: cdc-react
currently depends on cdc-react-icons
so it's best to modify the chore/release PR to manually update this if cdc-react-icons
has had a new update.
Release notes and the CHANGELOG are automatically generated based on commit messages that are following conventional commits.
Example:
git commit -m "feat: added profile updates"
git push
and create GitHub PR with namefeat: added profile updates
- Get approval / builds passing
- Squash and merge with name
feat: added profile updates
- Verify automatic chore/release PR created. It will have a name like
chore(main): release cdc-react X.X.X
- Confirm changelog and package.json changes
- Merge chore/release PR
- Verify GitHub release is created, and npmjs.com is updated with latest version
Manual publishing with npm publish
should be avoided. When doing a manual release though be sure to update all related package.json
versions, the changelog, and GitHub releases.
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.