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

@bostonuniversity/bulib-wc

v0.1.68

Published

collection of web components and styles used at Boston University Libraries

Downloads

36,835

Readme

bulib-wc npm package

collection of web components and customizations used at Boston University Libraries

Description

This repository contains web assets of Boston University Libraries that are used across a variety of our sites and demonstrated in isolation via storybook.

These take a number of forms...

  • site-specific code (css, html, js) contained in sites/
  • cross-platform styles, theming, and icons managed in assets/
  • reusable UI elements (essentially custom widgets) in src/
  • and some pure vanilla javascript helpers (src/_helpers/)

...and depend on a number of technologies...

...towards the end of...

  • making the UI/UX/branding more consistent between platforms
  • enriching and increasing the interactivity of our sites
  • obtaining a greater degree of control and autonomy over our online presence from the vendors

Usage/Workflow

Setup

Install dependencies via node package manager

$ brew install node
$ git clone https://github.com/bu-ist/bulib-wc.git
$ cd bulib-wc
$ npm install

note: additional steps and troublshooting can be found in the wiki

Running Locally

running the following will open up a new tab in your browser at localhost:9001/?path=/story/, and watch for changes.

$ npm run start

you can make changes to existing elements and see them in that running server by navigating to that component in the sidebar. to create a new one, make a new entry in /docs/index.stories.js based off of the existing ones

Building

to build a bundle, run the following, noting that the default will use the rollup.config.js.

$ npm run build

or a bundle with open-wc version (with codesplitting), run:

$ npm run build:owc

you can also build a static copy of the static docs site via:

$ npm run build:storybook

Deploying

We expect to continue to manage versioning this repository with npm, but we want to make sure that updates are synchronized (e.g. our demo site and github tags are all in sync), so we've made a script to help assist with that

$ npm run deploy

we use semantic versioning (semver), and assume by default that you're publishing a patch. If you'd like to specify the level of change you're making (e.g. you want to mark a significant addition in functionality or a milestone in the project) you can specify major or minor as well:

$ npm run deploy [patch, major, minor]

Sometimes you may just want to update the storybook to demonstrate a change before you're finished developing (without publishing a new package for it on NPM) to verify the implementation is correct or desired functionality with a third party (like your advisor). You can update only the storybook by running the following:

$ npm run deploy:storybook

Consuming

We consume the published package over two main CDNs (unkpg, jsdelivr), versioned and deployed using npm and added to each platform via a series of <script> and <link> tags stored in the <head>.

All the web components are imported together from a single index.js file. Unpkg does some mapping here to chain together a number of calls that leverage the module specification. This does the work that a bundler would do, but without the extra build step, transpilation, etc.

note: one can import a specific version (e.g. [email protected]) or the most recently published one (bulib@latest)

<!-- load web components -->
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/[email protected]/webcomponents-loader.min.js"></script>
<script src="https://unpkg.com/[email protected]/src/index.js?module" type="module"></script>

For the css, we have both a shared "bundle" (created via scripts/bundle_css.sh), and site-specific forms for each site_name. These are imported via <link> like the following. Further customizations for each site are in sites/**.css.

NOTE: if you don't include the bundle.min.css stylesheet as well as the index.js?module in a given site, the styling for many components will be broken

<!-- styling -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/bundle.min.css">
<!--link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bulib-wc@latest/dist/{site_name}.css"-->

An example of what all to include in each site's <head> is also available at sites/shared.html.