npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@buildingradar/ui_library

v0.7.1

Published

Welcome to the BR UI Library! This repository uses Vite's library mode to create tree-shakable components. The components are built using Shadcn and Tailwind CSS, and we have a Storybook website to showcase them.

Downloads

1

Readme

BR UI Library

Welcome to the BR UI Library! This repository uses Vite's library mode to create tree-shakable components. The components are built using Shadcn and Tailwind CSS, and we have a Storybook website to showcase them.

Getting Started

This section will guide you on how to set up and work with the BR UI Library repository using pnpm.

Available Commands

  • pnpm dev: Start a simple introductory home page for the UI library locally.
  • pnpm build: Build the components and create a distribution folder.
  • pnpm storybook: Run the Storybook website locally.
  • pnpm lint: Lint the repository according to the configured ESLint rules.
  • pnpm storybook-build: Build the Storybook website and create a static folder for deployment if needed.

Creating New Components

We use Shadcn as the base for our components. Please refer to their documentation for more information on how to leverage this library.

Folder Structure

Ensure your components follow this structure:

src/components/ComponentFolder/Component.tsx

Always create an index.ts file to export the component at the same directory level:

src/components/button/button.tsx
src/components/button/index.ts

Exposing Components

We use a multiple entry approach to export components. Use the following import syntax:

import { Button } from '@br/ui_library/button';

To make this work, add an export entry in package.json:

"exports": {
  "./button": {
    "import": "./dist/button.js",
    "require": "./dist/button.cjs",
    "types": "./dist/button.d.ts"
  }
}

Creating Storybook Stories

Within the src directory, there is a stories folder for all Storybook stories. Follow an existing example or refer to the Storybook documentation for guidance.

Versioning the Package with @changeset/cli

We use @changeset/cli in our Bitbucket CI/CD for versioning.

Workflow

  1. Create a branch for your changes.
  2. Implement the required changes.
  3. IMPORTANT: Run pnpm changeset to add a changeset file indicating your intent to release. If you are not releasing package changes (e.g., just adding a new Storybook story), run pnpm changeset-empty.
  4. Merge the latest main into your branch and create a PR for review.
  5. When the PR is merged into main, CI/CD will detect the changeset files, bump the package version, and create a proper changelog. A new "bump PR" will be generated with these changes for your review and merge.
  6. Once the "bump PR" is merged, CI/CD will publish the package to the npm registry.

Creating intermediary package versions for testing purposes

During development, you may want to publish test versions of the package, to be able to import it in any consumer app.

You have 2 options:

  1. Create a version test and publish it to npm, eg.: if the current version of the package is 0.1.0, you can manually publish a 0.1.0-test.1 and use it temporary until the final version using semver is released using changesets.
  2. Use npm link to make the local package available in your system. More on Npm link here

Conclusion

Thank you for contributing to the BR UI Library. Your efforts help improve the quality and usability of our component library. If you have any questions or need further assistance, please refer to our documentation or contact the maintainers.