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

@spscommerce/sps-styles

v2.1.0

Published

A tool for SPS Commerce UI Engineers.

Downloads

1

Readme

SPS Styles

SPS Commerce Version

This repo is home to both a library (@spscommerce/sps-styles) and a pattern library application to showcase them. The styles themselves use Bootstrap 4 as a foundation. The pattern library application is a customized instance of Fabricator. The scss folder at the root of the project contains overrides and extensions of the Bootstrap library to makes elements look the way we want.

Using @spscommerce/sps-styles in your app

There are currently several ways to add our styles into your UI.

Option 1: Use a link tag to our CDN

Put a link tag in the head of your index.html that points to our cdn:

<link rel="stylesheet" type="text/css" href="https://cdn.dev.spsc.io/web/framework/styles/sps-styles/SEMVER_RELEASE/index.css">

Note We have implemented semantic versioning based off git commit messages. You should use conventional commit style commit messages when merging PRs into this repository to ensure that a version is released upon merge.

Option 2: Install from NPM or Yarn

1. Ensure you have access to jFrog Artifactory

Ensure you have access to and have locally configured our jFrog Artifactory private npm repository and installed in your CI. The Drone jFrog Npm Plugin is super easy to use.

2. Install using npm or yarn

npm install @spscommerce/sps-styles or yarn add @spscommerce/sps-styles

3. Import it into your application

Assuming you are using a webpack based build system, open your root CSS file add this line to the top @import '~@spscommerce/sps-styles/dist/index.css';

Tip: The ~ tells your build system (webpack/parcel) to look inside node_modules. You could also provide a path to node_modules. Yet another alternative is to import the css directly using JavaScript instead using import '@spscommerce/sps-styles/dist/index.css';. Lastly, JSPM offers a similar ability to import css using require() plus an exclamation point on the end of the path to a css file.

Contributing Quick Start

To contribute to this library you can follow these steps.

  • Fork and clone this repo
  • Ensure you have access to and have locally configured our jFrog Artifactory private npm repository.
  • Install node.js version 7.10.1 or greater
  • Install project dependencies
    • Run npm install
  • Finally run the app
    • Run npm start
    • Navigate to http://localhost:3000. The app will automatically reload if you change any of the source files.

Linking ui-angular or ui-react to local SPS Styles

When you build SPS Styles, the compiled CSS is located at dist > assets > toolkit > styles > toolkit.css. This file becomes index.css in the deployed artifact. So to link your locally checked out ui-angular or ui-react to your local SPS Styles, you need to create a link from node_modules > @spscommerce > sps-styles > index.css to the path of the file created when building SPS Styles.

Mac:

cd /path/to/ui-angular-or-react/node_modules/\@spscommerce/sps-styles
rm index.css
ln -s /path/to/sps-styles/dist/assets/toolkit/styles/toolkit.css index.css

Windows (run CMD as administrator):

cd path\to\ui-angular-or-react\node_modules\"@spscommerce"\sps-styles
del index.css
mklink index.css path\to\sps-styles\dist\assets\toolkit\styles\toolkit.css

Now, if you run npm start in SPS Styles, when it automatically rebuilds changes you make here, those changes should also be reflected in ui-angular and/or ui-react.

Commit Message Format

We are using semantic release on this repo, so please follow the commit message format described in their readme.

Build & Deploy

Building

Building is all automated via Docker and Drone. For more information see the build documentation.

Deploying

Deploying is all done via the SPS Drone Deploy Pipeline. For more information see the deploy documentation.

Accessibility Testing

Basic Accessibility testing can be done against the pattern library using Pa11y. You can run against localhost by serving the app (npm start), and then in another console running 'node accessibility-test.js local'. Alternatively, you can run against any build version with 'node accessibility-test.js [version]', where version is the version set in the package.json and can be found as the release names in git. (ex. 'node accessibility-test.js 0.36.0').

Changelog

We use the format recommended here: https://keepachangelog.com/en/1.0.0/

  • Basically call out the types of changes in different sections.

Recommend Reading