CB Sting DLS
CB Sting DLS is a public React package for the Sting design system.
This repository is publish-only. Source code, tests, and the production build live in a separate local DLS source repository. This package repository only keeps npm metadata and the built dist folder that is published to npm.
For future releases, see Publishing Guide.
Install
npm install cb-sting-dls
Install the required peer dependencies if they are not already present in your app:
npm install react@18 react-dom@18
Usage
Import components from the package root and load the design system stylesheet once in your app shell.
import { SButton } from "cb-sting-dls";
import "cb-sting-dls/sting-react.css";
export function Example() {
return <SButton>Save</SButton>;
}
Sync The Build
Build the source package first:
cd ../cb-react-dls
pnpm --filter @chargebee/sting-tokens build
pnpm --filter sting-react build
Then sync the built files into this publish-only repo:
cd ../cb-sting-dls
npm run sync:dist
If the DLS source repo is not at ../cb-react-dls/packages/sting-react/dist, pass the built folder explicitly:
DLS_DIST_PATH=/absolute/path/to/cb-react-dls/packages/sting-react/dist npm run sync:dist
The sync step requires these files to exist:
dist/index.js
dist/index.d.ts
dist/sting-react.css
Publish
Preview the package contents before publishing:
npm pack --dry-run
Publish to npm. Unscoped npm packages are public by default:
npm publish
Use npm version patch, npm version minor, or npm version major before publishing a new release.