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

@jihu-fe/svgs

v2.39.0

Published

SVG Assets for GitLab

Downloads

3,632

Readme

Gitlab SVGs

This repository manages all SVG Assets for GitLab by creating SVG sprites out of icons, and optimizing SVG illustrations.

Previewing the SVG library

Visit the GitLab SVG Previewer website to see, reference, and search through all available icons and illustrations.

Requirements

  • You’ll need yarn and node installed. On a Mac, you can install yarn with brew install yarn.
  • For the first time, or after updating from the main branch, use yarn install to install the latest dependencies.

Commands

yarn run svg - Runs all tasks that are available. You can also run this task to release a new version.

All output is saved to the dist folder where it’s referenced from our main applications.

Adding icons or illustrations

  • If you're adding a third-party logo or trademark, refer to this section.

  • Review the following documentation:

  • Make sure you have the latest from the main branch in your local copy of the gitlab-svgs repository, then create a new local branch.

    # Retrieve the latest updates
    git pull
    # Create a new local branch
    git checkout -b new-branch-name
  • Make sure that your dependencies are up to date by running yarn install.

  • Export the icons or illustrations as a .svg file where:

    • Icons are placed in the sprite_icons folder. Read instructions below on exporting icons.
    • Illustrations are placed in the illustrations/ folder. There are subfolders for illustration categories, like empty states or logos.
  • If you are not compressing an SVG during export, you can use SVGO to optimize it after you export.

    # Optimize our `huge_test.svg` file
    yarn run svgo ./path/to/huge_test.svg
  • After adding the new SVGs, execute the following commands to verify your changes locally at http://localhost:3333/

     # Starts a local server to preview your changes
     yarn run dev
  • Test icons by changing the settings in the Icon configuration panel of the local preview site and ensuring that the icon changes color and size (there are a few icons that intentionally don’t change color).

    Icon configuration panel

  • If you are happy with the new/modified SVG, commit and push all changes (including the ones to the dist folder) and create a merge request.

    # After committing your changes, use this to create a remote branch. A link will then be available to create the merge request.
    git push -u origin new-branch-name
  • Assign the merge request to a maintainer of the GitLab SVGs project. You can find the maintainers on the GitLab project overview page.

Adding third-party logos or trademarks

  1. See the process for adding third-party trademarks to GitLab in the handbook.
  2. Place approved assets in the /illustrations/third-party-logos directory.

Exporting icons from Figma

Icons should only be exported after they have been added to the Pajamas UI Kit in Figma. This ensures that it’s the final version of the icon that gets exported, and the export settings are retained for developer handoff if it’s ever needed.

  1. Confirm that the icon follows the icon design guidelines.
  2. Make sure the parent frame around the icon has no background fill.
  3. Select the icon and in the right properties panel add SVG as the export option. This should be done whether or not you are using the Advanced SVG Export plugin. If you want to optimize the icon during export use the following process, otherwise export the icon via the properties panel and skip to the next step.
    1. Install the Advanced SVG Export plugin. The plugin uses SVGO under the hood. Use the default settings.
    2. Select the icon and run the plugin, exporting to the sprite_icons folder.
    3. Open the resulting SVG file in your text editor and remove fill="none" from the main <svg> element.
  4. After adding the new SVGs, execute the following commands to verify your changes locally at http://localhost:3333/
    # Starts a local server to preview your changes
    yarn run dev

Brand icons for companies or products, which may have specific color requirements, should be named starting with brand-, for example, brand-slack.svg. These icons may have something different than fill="#000" to prevent color from being overridden.

Preview Application

The application for previewing is based on NUXT and is located in the folder svgpreviewer.

You can run it locally through yarn run dev then it will available under http://localhost:3333/.

With yarn run generate you can generate the static output to the public folder.

File icons

This package also bundles file icons based off PKief/vscode-material-icon-theme.

During the CI build, the following steps are done:

  1. vscode-material-icon-theme is downloaded based on the version in build_scripts/file_icons_version.
  2. Then all file types used in src/file_icon_map are copied to the file_icons folder.
  3. From there they are bundled in icons sprites
  4. Unused file icons are copied into file_icons_unused

Publishing a new version

Every time a file is added, deleted, modified or renamed within the sprite_icons or illustrations folders and the change is merged into the main branch, a new minor version of the package is published.

Contributing

GitLab is an open source project and we are happy to accept community contributions. Please refer to CONTRIBUTING.md for details.