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

@liquid-labs/liq-integrations

v1.0.0-alpha.2

Published

Enables integrations plugins for a @liquid-labs/plugable-express server.

Downloads

3

Readme

liq-integrations

Enables integrations plugins for plugable-express based servers.

Installation

From a plugable express server:

catalyst server plugins handlers add -- npmName=@liquid-labs/liq-integrations

Where 'catalyst' may be replaced by the CLI for the particular pluggable server.

Usage

Once installed, you can then install integrations like this:

catalyst server plugins integrations add -- npmName=@liquid-labs/liq-integrations-issues-github

Where 'catalyst' may be replaced by the CLI for the particular pluggable server.

Integrations overview

This section is aimed primarily at those seeking a deeper understanding of how integrations work; e.g., integration developers. Casual users can skip this section.

Structure

An integration spec defines a single integration:

  • hooks: an object containing hook functions referenced by name. The hook functions are what are ultimately executed by IntegrationsManager.callHook(). Every integration which is a providerFor a particular thing will define the same set of hooks. The hooks are "what the integration can do".
  • name: a simple name describing the integration spec. (The use of name is still in flux and may be dropped.)
  • npmName: the name of the package providing the integrations.
  • providerFor: a noun or verb naming the thing (e.g. 'tickets'). The providerFor value is used by IntegrationsManager.callHook() to for first-level selection of possible integration providers.
  • providerTest: a test function which decides whether this integration fits this project. The provider test always receives pkgJSON, which is the package.json value for the project being acted upon and may receive additional arguments depending on the providerFor type.

Flow

  1. 'liq-integrations' setup() adds sets up app.ext.integrations = new IntegrationsManager().
  2. 'lig-integrations' setup() calls the registerIntegrationsPlugin() function exported by each installed integrations plugin package. Each plugin registers its integrations.
  3. When an integration is required (e.g., to create a pull request), instead of calling a function directly, IntegrationsManager.callHook() is invoked with the following parameters:
  • providerFor: a string naming the integration basic domain / purpose (e.g., 'pull requests')
  • providerArgs: a parameter object containing the pkgJSON for the project in question and (depending on the providerFor type) possibly additional arguments.
  • hook: the name of the specific hook in the integrations to be invoked (e.g., 'createOrUpdatePullRequest').
  • hookArgs: a parameter object containing arguments particular to the hook.
  1. The IntegrationsManager.callHook() will filter the available integrations based on providerFor and then the itnegaritons providerTest. Once found, the integrations hook is invoked with the caller's hookArgs. If no applicable integration is found, then an exception is raised.

Note in theory, it would be possible to find an integration based on the hook name alone but we retain providerFor as it clarifies things and to make determination of providerArgs cotnent more clear in particular. There is also the thought that it helps avoid hook name collisions in future.