Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bulib-wc

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bulib-wc

collection of web components and styles used at Boston University Libraries

  • 0.1.24
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-19.97%
Maintainers
1
Weekly downloads
 
Created
Source

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/bulib/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.

$ npm publish

that said, we want to make sure that our docs page is updated, so it's recommended to use the following, instead:

$ npm run deploy

if you want to update the docs page before you're finished developing (without publishing the package), you can also update the docs directly via

$ 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. bulib-wc@0.0.92) or the most recently published one (bulib@latest)

<!-- load web components -->
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2.1.3/webcomponents-loader.min.js"></script>
<script src="https://unpkg.com/bulib-wc@0.1.0/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:

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

Keywords

FAQs

Package last updated on 27 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc