When contributing or participating in discussions, ensure that you are following our contributor code of conduct
This repository is a mono repo that utilises pnpm workspaces, meaning multiple npm packages are contained within the packages directory.
It is recommended to also use NVM to manage node versions. NVM will use the correct version set in .nvmrc by running nvm use
Clone the repository git clone git@github.com:dpc-sdp/ripple.git then run pnpm install to install all dependencies.
There are three main ways to develop within Ripple Framework; working on isolated Ripple components within storybook, working Tide integration packages or layers utilizing the example nuxt app, and working on standalone npm packages.
Development for the core ui components (@dpc-sdp/ripple-ui-core), form ui components (@dpc-sdp/ripple-ui-forms) and maps ui components (@dpc-sdp/ripple-ui-maps) is done within storybook. To get started just run:
pnpm run storybookThis will open a browser window with the storybook instance running. All UI components within these packages have an accompanying storybook story. For a good example component that contains stories and cypress component tests please see RplAccordion.
New components can be scaffolded using the CLI tool, for example:
npx @dpc-sdp/nuxt-ripple-cli add component [DIRECTORY] --name {NAME} --prefix {PREFIX}
For more information on using the CLI please see @dpc-sdp/nuxt-ripple-cli
For more on contributing to Tide packages, please see Ripple Framework.
Ripple uses Prettier to allow developers to spend less time worrying about conforming to a specific code style. It's recommended that you set up Prettier in your IDE to format your work on save.
ESLint is also used to improve code quality, linting can be run with pnpm run lint.
Ripple uses Conventional Commits to encourage meaningful commit messages. This is also for building the Ripple changelogs automatically.
Commitlint is used to enforce the Conventional Commit format.
An example of a well-formed commit message is:
fix(@dpc-sdp/ripple-ui-core): fixed table font size for paragraphs and lists
Ripple uses the BEM (block, element, modifier) methodology to help structure CSS and avoid naming conflicts.
All ripple classes provided by ripple are prefixed by rpl- to prevent conflicts with CSS in other projects or libraries. For example:
- Component class name:
.rpl-[component-name] - Element class name:
.rpl-[component-name]__[element-name] - Modifier class name:
.rpl-[component-name]--[modifier-name]
Linting is handled by eslint and stylelint; note stylelint is currently scoped to @dpc-sdp/ripple-ui-core
pnpm run lintUnit tests are important as they help us secure our processes, ensuring that the most critical parts of our projects are protected from accidental mistakes or oversights in development.
All unit tests are handled by Vitest, and can be run with:
pnpm run test:unitComponent tests are run using Cypress's component testing feature and are used for Vue component testing.
The core component tests @dpc-sdp/ripple-ui-core can be run using:
pnpm run test:components-coreWe also have component testing for the @dpc-sdp/ripple-ui-forms and @dpc-sdp/ripple-ui-maps packages:
pnpm run test:components-forms
pnpm run test:components-mapsThe core Ripple directory structure is as follows:
- docs (the documentation site)
- examples (example applications)
- packages (this is where all npm packages are stored)
- ripple-ui-core
- ripple-ui-forms
- ripple-ui-maps
- etc
Ripple uses release-please to automate releases based on Conventional Commits. The release process is handled entirely through GitHub Actions.
When changes are merged to the main branch, release-please automatically:
-
Creates or updates a release PR containing:
- Version bumps for all affected packages based on conventional commits
- Updated CHANGELOG.md files
- Updated package.json versions
-
When you merge the release PR, the workflow automatically:
- Publishes all packages to GitHub Package Registry with the
latesttag - Creates GitHub Releases with auto-generated release notes
- Publishes all packages to GitHub Package Registry with the
Version bumping rules:
feat:commits → minor version bump (e.g., 2.46.0 → 2.47.0)fix:,perf:commits → patch version bump (e.g., 2.46.0 → 2.46.1)BREAKING CHANGE:or!in commit → major version bump (e.g., 2.46.0 → 3.0.0)
Alpha releases are automatically published when changes are pushed to release/* branches. These are pre-release versions for testing:
-
Each push to a
release/*branch automatically:- Builds all packages
- Bumps versions to
{current-version}-alpha.{git-hash}(e.g.,2.46.0-alpha.abc1234) - Publishes to GitHub Package Registry with the
alphatag
-
Alpha releases:
- Do not create GitHub Releases
- Do not update CHANGELOGs
- Are tagged as
alphain npm (install withnpm install @dpc-sdp/package@alpha)
Ripple uses automated backporting to help maintain release branches. To backport a merged PR:
-
Add a label to the merged PR in the format:
backport release/X.Y- Example:
backport release/2.46will backport to therelease/2.46branch
- Example:
-
The backport workflow will automatically:
- Create a new PR targeting the specified branch
- Cherry-pick the commits from the original PR
- Link back to the original PR
-
Review and merge the backport PR as normal
If the backport fails due to conflicts, you'll need to manually create the backport PR and resolve conflicts.
After backporting fixes to a release branch, you can publish a patch release without merging back to main:
-
Merge the backport PR to the release branch (e.g.,
release/2.46)- This automatically publishes alpha versions for testing (e.g.,
2.46.0-alpha.abc1234)
- This automatically publishes alpha versions for testing (e.g.,
-
Trigger the Patch Release workflow when ready to publish:
- Go to Actions → "Patch Release" → "Run workflow"
- Enter the release branch name (e.g.,
release/2.46) - Click "Run workflow"
-
Review and merge the release PR:
- Release-please creates a PR on the release branch with version bump (e.g.,
2.46.0→2.46.1) - Review the PR to verify the changes and version
- Merge the PR to publish the patch release
- Release-please creates a PR on the release branch with version bump (e.g.,
-
Packages are published:
- All packages published to GitHub Package Registry with the
latesttag - GitHub Release created with patch version (e.g.,
2.46.1) - Release branch maintains its own version history separate from main
- All packages published to GitHub Package Registry with the
This allows you to maintain multiple release lines simultaneously. For example:
mainbranch continues with new features (2.47.0, 2.48.0, etc.)release/2.46can receive bug fixes (2.46.1, 2.46.2, etc.)release/2.45can receive critical security patches (2.45.3, 2.45.4, etc.)