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

@croud-ui/solid-foundations

v1.20.1

Published

Croud's Solid foundations

Downloads

647

Readme

Solid Foundations

Croud's Solid based component library

Installation

This package uses Yarn to manage the dependencies.

yarn

Storybook

Our components are documented in Storybook.

Netlify publishes the latest version of Storybook when we merge anything into Master. The latest version of Storybook is deployed to the following url

https://croud-solid-foundations.netlify.app

ESBuild

Storybook has traditionally used Webpack to build storybook, but as our repo uses Vite (which is based on esbuild), we are using the experimental storybook-builder-vite builder.

This gives us a massive speed improvment as well as a consistency with the rest of our toolchain, but not everything in the Storybook ecosystem is compatible with this builder yet

Local dev

Use the following command to build Storybook locally for development

yarn storybook

Production build

We can build a production ready version of the storybook locally with the following command, but this will probably only be useful for debugging the production build.

yarn build-storybook

The assets from this build we be output into the storybook-static dir (which is ignored by Git)

Design tokens

Design tokens are generated using theo which allows us to export our tokens in multiple formats.

Defining design tokens

All design tokens are defined in yml format in the ~/src/tokens/config directory.

The design token definitions are broken down, categorised and split out to make it easier to maintain. All new files must be imported into the root index.yml file in order to be processed

Generating design tokens

To generate our design tokens in our desired formats we need to run the following command

yarn tokens:generate

Consuming design tokens

The specifics of how we consume our generated design tokens depends on the language we need to reference them in.

All generated design token files are added to the ~/src/tokens/ directory.

For more info, including guidence on maintaining existing tokens and adding defining new tokens, please refer to the theo docs

Sharing Webcomponents

If we want to port any components from this library to our existing CC monorepo, we will need to compile them as a Web Component. This will allow them to behave as self contained "black boxes" of interactivity within Croud Control.

Defining Web Components

Any customElements defined in the /src/webComponents.tsx file will be bundled into our NPM package There is a handy WebComponentWrapper HOC we should use to handle some common Web Component logic

customElement('some-component', { foo: undefined }, props => (
  <WebComponentWrapper>
    <SomeComponent {...props} />
  </WebComponentWrapper>
))

For more info, see the Solid Element docs

Build NPM package

After we have defined our customElement, we can build a production ready build of our Web Components using the following command

yarn build-npm

The assets from this build we be output into the dist dir (which is ignored by Git)

Publish new package

Bump the package version

npm version [patch, minor, major]

Publish the dist dir to NPM

npm publish