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

@prisma/lens

v0.0.473

Published

Prisma's design system

Downloads

1,014

Readme

Prisma Lens

npm (scoped) chromatic

Prisma Lens is a Design System, Guidelines and Component Library for the family of Prisma projects and products. Both this document and the actual artefacts are a living system that aims to be evolving incrementally and often.

Principles

  • Set up for change. The changes to the system should never be dreaded and small, incremental changes should never be expensive to make. The properties that are built with the system should support this philosophy.
  • Highly atomic - The individual components of the system should be as simple and generic as possible but not more - there should never be a component with only one usage site in the system
  • Visually low level - The system should be recognizable at the level of typography and spacing, to make sure we have flexible theming options
  • Code as source of truth - it's more likely that there's going to be some sort of syncing happening from github / react elements to figma than the other way around. What's shipped or in this repository is the system, and also the deliverable. It is on the designers to make tools to support that easier.

Artifacts

Base Theme

Should loosely follow the theme spec with following elements

  • Color primitives (spectrums)
  • Usage colors
  • Typography
  • Spacing
  • ...

Individual websites and products should extend this theme with overrides, ideally at the level of usage values and not primitives.

Iconography

  • Font Awesome

    See all the icons at the Font Awesome website. You'll need to set an environment variable called FONTAWESOME_NPM_AUTH_TOKEN for using the fonts on the website. The value for this token can found in 1Password as Font Awesome NPM Token in Webdev vault.

Local Development

Prisma Lens uses Storybook as a preview mechanism for local development.

yarn dev

You can also use the VSCode task named dev to do the same thing. (Cmd + Shift + P > Tasks: Run Task > dev)

Code Style

Publishing

Publishes to NPM happen automatically when you push to the main branch, either directly, or via a pull request merge.

To publish manually, you should:

npm login # Login to NPM
yarn version patch # Bump up the version
yarn publish # Publish package

To test changes in a local dependent project you can use yalc (https://www.npmjs.com/package/yalc). Install yalc with npm i yalc -g Inside this project root:

yalc publish # Copies the new package version into `~/.yalc`

Inside the dependent project root:

yalc add @prisma/lens@<versionNumber> # Injects the new package from the `~/.yalc` store into the project's package.json
yarn

You should be able to see your changes. Careful not to commit changes to the dependent project's package.json.

Usage in other Prisma projects

Integrating Lens into your project is as simple as wrapping your top level component with LensProvider.

import { LensProvider } from "@prisma/lens"

function YourRootComponent() {
  return <LensProvider>{/* Rest of your app */}</LensProvider>
}

LensProvider takes care of loading styles, fonts, and additional setup needed for SSR.

If your project uses Tailwind, Lens also exports a Tailwind preset that may be imported from @prisma/lens/tailwind. You should add this to your tailwind.config.js. This ensures that all colors etc. in your project match up with Lens.

// tailwind.config.js
module.exports = {
  presets: [require("@prisma/lens/tailwind")],
}