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

@openlab/deconf-ui-toolkit

v3.0.3

Published

A UI Library for building decentralised conference platforms. Designed to provide a central homepage for virtual events happening on lots of other services and platforms like YouTube, Zoom, Vimeo or Twitch.

Downloads

424

Readme

deconf-ui-toolkit

A UI Library for building decentralised conference platforms. Designed to provide a central homepage for virtual events happening on lots of other services and platforms like YouTube, Zoom, Vimeo or Twitch.

Deconf Plugin

Clients must implement a plugin to provide logic to components. It should implement DeconfPlugin and be mounted onto Vue.prototype.$deconf You could implement it like this:

import _Vue from 'vue';
import { DeconfPlugin } from '@openlab/deconf-ui-toolkit';

class BespokeDeconfPlugin implements DeconfPlugin {
  static install(Vue: typeof _Vue) {
    Vue.prototype.$deconf = new BespokeDeconfPlugin();
  }

  // Then implement DeconfPlugin methods
}

Component dependency viewer

There is a script to generate a HTML report of the components and their dependencies. It works by parsing the special comments at the top of each component files and parsing the components { ... } section of the default export.

# cd to/this/directory

# Generate a HTML report of each component and i18n, icons, sass variables and child components
node build/dependency-page.mjs > dependencies.html
open dependencies.html

# Generate JSON output
node build/dependency-page.mjs --json > output.json

Contents

Sass Styles

It should export a sass file which you can customise the variables of like:

$primary: rebeccapurple;
$secondary: green;
$family-sans-serif: Helvetica, Avenir;
// etc

@import '~@openlab/deconf-ui-toolkit/toolkit.scss';

I18n

You provide your own I18n module when importing the toolkit which has these strings set (they are all namespaced under deconf):

You can skip strings for sections you aren't using

key

  • ^1 - 1 parameter (e.g. {0})
  • ^2 - 2 parameters (e.g. {0} {1})
  • ^3 - 3 parameters (e.g. {0} {1} {2})
  • ^4 - 4 parameters (e.g. {0} {1} {2} {3})
  • ^5 - 5 parameters (e.g. {0} {1} {2} {3} {5})
  • ^c - count key (e.g. apples | apple | apples) to pluralise based on a count/number

WIP, for full keys used see .storybook/locale.json

General

  • deconf.general.hours - Pluralise hours (^c)
  • deconf.general.minutes - Pluralise minutes (^c)
  • deconf.general.seconds - Pluralise seconds (^c)

Each component to use has a doc comment like this in it. It lets you know what i18n and FontAwesome icons are required, along with what sass variables can be customized.

//
// i18n
// - n/a
//
// icons
// - n/a
//
// sass
// - n/a
//

Routes

The routes that need to be implemented are defined by Routes in src/lib/constants.ts

Scss Variables

Some components expose variables to control how they are styled and coloured. See the vue component in question for more.

All of bulma's variables are also used, in particular:

  • $text-strong - for heavy text
  • $text-light - for light text
  • $weight-bold - to make things bold
  • $size-{n} - to size text
  • $block-spacing - to space elements apart
  • $background - to colour the background

WIP


components are writen in a specific way:

  • MaintainableCss class naming #
  • Global scss (no scoped)
    • global variables with !default for overrides
    • bulma variables where available
  • only default exports from .vue files
  • specific import filenames where not ts/js
  • VSCode "story" snippet for setting up stories
  • ../lib/module for common logic in components
  • ../story-lib/module for common logic in stories
  • prefer verbosity in stories so they are self-enclosed
  • don't use Vue.extend because it ends up with a different global vue which has different routes.

how does the bundler work?

  • rollup is used to compile vue components together into dist/deconf-ui.{esm}.{js,map}
    • scss
      • it currently ignores scss output right now
      • as of rollup-plugin-vue@5 vue processes the sass internally which we can't hook into
      • build/sass-plugin
        • was originally for taking sass requests for rollup and combining into a single file. This works with rollup-plugin-vue@6 but not @5
        • it is now responsible for handling rollup sass requests and completely ignoring everything
    • types
      • I couldn't find a way to get this to output TypeScript types either
  • tsc is used to generate type definitions into dist/types, not bundled
  • build/pull-theme is used to read in vue files, extract the scss contents into dist/theme.scss and combine into a single file
    • this relies on having no scoped vue styles + MaintainableCss class names
    • it also allows scss variables to be exposed

other notes

  • we're using vue2 which storybookjs supports (02/02/2021)