This monorepo is a sandbox environment for developing and testing BigDesign Patterns. There are two packages:
examples-siteis a lightweight site that showcases usage of the patternspatternscontains the components
The patterns are published on npm under bigcommerce-design-patterns so they can be more easily stress tested in apps before being added into the main BigDesign library.
Before running any commands, make sure you have pnpm installed:
npm install -g pnpmRun the example site in dev mode by:
pnpm run devIn dev mode, editing the components within the patterns package will hot-reload the example site, as the site uses the workspace to reference the bigcommerce-design-patterns dependency.
To use the local patterns package in another local project:
- Add the following to the
package.jsonfile in your project (updating the path to the local patterns package):
"bigcommerce-design-patterns": "link:../big-design-patterns-sandbox/packages/patterns",- Run
pnpm installto install the local patterns package, creating a symlink in the local project'snode_modulesdirectory that points to the local patterns package. Your project will use the built files in thedistdirectory of the patterns package, so you'll need to runpnpm run buildin the patterns package to build the files before using them in your project.
If you want to enable hot reloading of the patterns package, you can run pnpm run build:watch in the patterns package folder (big-design-patterns-sandbox/packages/patterns) to watch for changes and rebuild the files on file save.
This repo uses changesets to version the packages in a consistent manner. It also builds a changelog automatically.
To release a new version with changes:
- Run the following command to create a new changeset:
npx @changesets/cliThe CLI will ask you to select which package(s) are being updated and if the packages should have a major or minor bump. After confirming these answers, a new changeset will be created in /.changeset.
-
Commit the generated file in
/.changeset/to your branch and push to GitHub. -
Create a PR with your changes and the changeset.
-
Once the PR is approved and merged into the
mainbranch, the GitHub Action at/.github/workflows/release.ymlwill run, which creates a version bump PR. -
Merging the version bump PR will release the new package version to NPM.