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

@vandebron/windmolen

v18.4.1

Published

Vandebron's styleguide for web

Downloads

2,113

Readme

Netlify Status

How to install

Run the following command using npm

npm install @vandebron/windmolen

If you prefer Yarn, use the following command instead

yarn add @vandebron/windmolen

Demo

A storybook reference of the component library can be found here windmolen.netlify.com . Hosted on Netlify.

Usage

Import the CSS file

Note: it is necessary to do this step otherwise the styles will not be applied, you can import it into the project entry point.

import '@vandebron/windmolen/dist/index.css';

Now you can import the components that you want to use:

import { Container, H1, Paragraph } '@vandebron/windmolen';

Development

Link another repository for live testing

It can be very helpful to see your changes to Windmolen components directly reflected in another project you're working on. To set this up you should follow the following steps.

  1. Set this package folder as source for your yarn symlink connection
yarn link
  1. Go to the project where you'd like to consume this package and run:
yarn link @vandebron/windmolen
  1. And finally, start the Windmolen bundler in watch mode
yarn start

Note:

this can be unlinked again with yarn unlink and yarn unlink @vandebron/windmolen

Additional note:

After replacing webpack with Vite there may be issues when sym-linking Windmolen with the apps projects within the Vandebron monorepo. If you encounter issues and you are not seeing your changes you can try the following:

  1. Go to apps/config/vite.config.base.ts in the Vandebron monorepo.
  2. Update the fs.allow array. Add the relative path to your local Windmolen repository as a new entry. For instance, if you have both Windmolen and the monorepo repositories contained within the same root folder, the path will look like '../../../windmolen'.
  3. Add a new property optimizeDeps to the root level of config: optimizeDeps: { include: ['@vandebron/windmolen'] }
  4. Make sure you do not commit these changes!. They must be reset once you have finished your testing.

Work on Storybook stories

When changing stories in Storybook you might want to see your changes reflected directly. To do so run the Storybook development server that will run locally with

yarn storybook

Tests and verification

The repository knows three methods to guard code quality.

  1. yarn types - will initiate a TS compiler typecheck
  2. yarn lint - will analyze the code based on the set linting rules
  3. yarn test - will start the Jest test runner, which mostly works with automatically generated tests

All of these stages are invoked before any git push and can also be triggered manually with the command

yarn verify

Publishing

Storybook

Storybook is automatically build based on the HEAD version on the master branch. Any push made there will trigger a new build on Netlify.

Windmolen

To publish a new version of the Windmolen package, first merge your branch to master. Next, pull master on your local machine and then run the following commands:

# Use the appropriate version bump. See https://semver.org/ for details
./deploy.py (major|minor|patch)

# You will require publishing rights on NPM for this
npm publish

git push && git push --tags

Alpha or Beta releases

If you want to deploy an Alpha or Beta version do the following:

npm version prerelease --preid=(alpha|beta)
npm publish --tag (alpha|beta)

For example, if you want to bump the version from 3.2.0 to an alpha release of the next patch version (i.e. 3.2.1), you would do the following:

npm version prerelease --preid=alpha
npm publish --tag alpha

Creating a new icon

To create a new icon you must follow these steps:

Exporting from Figma

  1. Find the icon in the 'Design System' file on Figma
    • From a design, you can follow a link to the design system from the 'Inspect' tab in the right side bar
  2. Select the icon in the libary
    • Make sure you have selected the most upper layer of the icon
  3. In the sidebar on the right, select the 'Export' tab and export to SVG
    • You can use the preview to see if you selected the right thing

Optimizing SVG

  1. Go to https://jakearchibald.github.io/svgomg/
  2. Click on Paste markup and paste the SVG code
  3. Enable the "Prefer viewBox to width/height" feature in the menu on the right side of the page
    • The viewBox attribute was previously added manually, this is not necessary when the aforementioned feature is enabled
  4. The icon will be rendered, click on the Copy as text button (it's above the download button)
  5. Go to your prefered text editor and paste the code
  6. Change all fill= and stroke= attributes that have a specific color to currentColor, so that the final result is e.g. fill="currentColor".
    • Leave any attribute that is set to none, for example stroke="none" since that part of the image is probably meant to be empty

Adding the icon to the project

  1. Create a new SVG file inside src/assets/icons, remember that the icon's name will be the name that you will use after to use it. (p.s: my-new-icon.svg will be <Icon name="my-new-icon" />)
  2. Run the following command to convert the SVG icons into react components.
node scripts/convert-icons.js
  1. Update src/components/Icon/icons.ts using the name of the new icon.