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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@servicetitan/anvil2-ext-common

v0.3.14

Published

<h1 align="center"> Anvil2 Extended Common </h1>

Readme

The Anvil2 Extended Common library is an open contribution area for components, hooks, and other code that extends Anvil2. This is maintained by the larger ServiceTitan engineering organization with support from the Design System team.

Getting Started

Installation

We recommend installing the Common package by running the following npm command (or the equivalent yarn/pnpm command) in your project folder:

npm install @servicetitan/anvil2-ext-common

[!NOTE] This package requires @servicetitan/anvil2 as a peerDependency, so make sure that is installed as well, and meets the version requirement in this package's package.json.

Usage

Components and hooks can be imported as named exports from the package root:

import { useConfirmDialog } from "@servicetitan/anvil2-ext-common";

Contribution Guide

This extended common library is meant to be a place for contributions that extend the Anvil2 library, but that don't necessarily make sense to live inside of Anvil2. Do you have a wrapper to connect a component to MobX or formstate or to a specific backend API? Do you have a shorthand to reduce the boilerplate for one of your common use cases? This is the place for those kinds of contributions!

This library can also be used as a place to test new ideas and features that are proposed to be added to Anvil2 in the future, but that need more validation or testing. Code in the common library is not required to be 100% stable to allow for these kind of experimental contributions and to serve as a more open area for testing ideas.

The Design System team intends to give guidance and help with maintaining contributions here, but contributions to this package aren't intended to meet the same standards as Anvil2 code.

Prerequisites

This monorepo requires Node >= 22 and pnpm >= 10. To install pnpm, please follow the installation instructions at: https://pnpm.io/installation

Setting up your local repo

Install the dependencies from the top-level project root directory:

pnpm install

To make sure everything is installed and working properly, we recommend running a build. This command will also build Anvil2 and its dependencies, so it might take a few minutes:

pnpm build:common

Development

To run our Storybook, you can use the following script from the root of the repo:

pnpm storybook:common

Our ext-common Storybook will be hosted at http://localhost:8008/.

[!NOTE] For more information about using Storybook, see their docs.

Adding a new component or hook

Directory structure

- src
  - components
    - MyNewComponent
      - internal
        - SomeInternalCode.ts
      - MyNewComponent.tsx
      - MyNewComponent.stories.tsx
      - MyNewComponent.test.tsx
      - index.ts
    index.ts

To add a new component, you would start by added a new folder in the src/components directory for your component. Inside that folder, in addition to the files for your component, you'll want to add an index.ts file where you export everything you want to be publicly accessible (component, proptypes, context, etc). Code that is not intended to be public can be organized into an internal subdirectory.

Then in the src/components/index.ts file, you'll want to add the export for your new component to make sure it gets exported along with all the other components.

export * from "./SomeExistingComponent";
export * from "./MyNewComponent";

To add new stories to the existing Storybook, you'll need to add a file that ends in *.stories.tsx or *.mdx.

To add new unit tests to the existing Vitest run, you'll need to add a file that ends in *.test.tsx or test.ts.

Adding a new top-level folder in src

To add a new top-level folder in the src directory works very similarly, just another level higher. You would create a new folder under src:

- src
  - components
  - hooks
  - mynewcategory
  index.ts

...and then add your new folder's exports to the src/index.ts file:

export * from "./components";
export * from "./hooks";
export * from "./mynewcategory";

Making a pull request

Changesets

We use Changesets to create release notes and manage our release versioning.

When you are ready to create a PR to release a change to this package, run:

pnpm changeset

Follow the steps and use appropriate semantic version for your change.

Changeset message format

Please format your changelog with name of the relevant components, hooks, or other code in brackets at the start of the changelog, such as:

---
"@servicetitan/anvil2": patch
---

[TextField] Update padding for `TextField` `prefix` and `suffix`

For more details, see our internal docs on changeset formatting.

Other useful scripts

From the root of the monorepo, you can run the following to run scripts specifically for the common library:

pnpm build:common
pnpm lint:common   # run ESLint
pnpm test:common   # run Vitest
pnpm clean         # clear build outputs
pnpm nuke          # clear build outputs and node_modules