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

@inthepocket/hubble-mirror

v1.0.3

Published

The heart of the Hubble Design System

Downloads

128

Readme

Hubble Mirror logo

LICENSE Releases Last commit Latest release

Hubble mirror is the core of the hubble system, it is used to apply the HST system to a specific project.

Prerequisites

  • A recent node version (node@8 recommended)

Usage

Automatic install in a project

Use the provided install script and run this from your project root to create the required files for hubble-mirror:

# Install for a generic project:
$ curl -o- https://storage.googleapis.com/hubble-static/install_hubble-mirror.sh?latest=true | bash

# Install for an iOS project
$ curl -o- https://storage.googleapis.com/hubble-static/install_hubble-mirror.sh?latest=true | bash -s -- --platform ios

# Show help for the installer script
$ curl -o- https://storage.googleapis.com/hubble-static/install_hubble-mirror.sh?latest=true | bash -s -- --help

# Alternatively, download install_hubble-mirror.sh from this repo, modify and run it:
$ chmod +x install_hubble-mirror.sh
$ ./install_hubble-mirror.sh --help

Manual install in a project

npm i @inthepocket/hubble-mirror

Create a .hubble-mirror.json

  • The .hubble-mirror.json file should be in the root of the project
  • The relative paths inside .hubble-mirror.json should always be defined relative to its position (best to put it at the root of the project)
  • Data structure:
{
  "source": {
    "assets": ".hubble/src/design-systems-demo/assets",
    "hst": ".hubble/src/design-systems-demo/hubble.json"
  },
  "postProcess": "hubble-postprocess.sh",
  "target": {
    "assets": "/assets",
    "hst": "./hst.json"
  },
  "deployPreview": {
    "publishDirectory": "/build",
    "previewUrl": "hubble-mirror-domain-preview-url"
  }
}

Available scripts

Hubble process

Process the current .hubble config and assets into the project. hubble-mirror:process

Hubble post-process

Run your custom made postprocess script. To handle the changes specific to your project. For example:

  • auto generate css
  • auto generate xml files for your android project
  • update color files
  • update links inside your source files where needed

Create a file somewhere inside your root directory: postprocess.sh, specify its location in the .hubble-mirror.json file and run hubble-mirror:postProcess.

Make sure this file is executable, if postprocess.sh is not executable by a shell, the process will fail!

Hubble deployPreview

Deploy the processed changes on a preview url with surge. Run hubble-mirror:deployPreview.

Optionally add:

  • domainsuffix: the domain on which we deploy with a unique suffix, for example the jenkins build number
  • rootDir: the absolute path to the root directory where the hubble-mirror file can be found (default to the current directory)

Conventions:

  • add a hubble:buildPreview script inside the package.json if you need a custom build step for your website
  • add SURGE_LOGIN and SURGE_TOKEN as process environment variables to be able to publish with surge
  • add the directory you want to publish to the .hubble-mirror.json
  • add the previewUrl you want to the .hubble-mirror.json
    • this will be concatenated with the optional domainsuffix and .surge.sh
    • to become for example: https://hubble-mirror-domain-preview-url-build_25.surge.sh
  • add the baseUrl if you have a paid version of surge
    • this will be concatenated with the optional domainsuffix
    • to become for example: https://hubble-mirror-domain-preview-url-build_25.inthepocket.design

Create Pull Request

To autogenerate a Pull Request on your repo, we've added a utility script: hubble-mirror:createPR

Optionally add:

  • domainsuffix: the domain on which we deploy with a unique suffix, for example the jenkins build number
  • rootDir: the absolute path to the root directory where the hubble-mirror file can be found (default to the current directory)
  • commitMessage: the title of the PR
  • changelog: the description of the PR
  • commitDate: the date related to the PR
  • branch: the bitbucket source branch
  • repo: the bitbucket repoPath

Development

Releasing

Bump version correctly, then run the release run-script. It will test the code before publishing and tag it with the correct git tag.

# To go from 0.0.4 to 0.1.0

$ npm version minor
$ npm run release

If you are making changes to the install script, make sure to deploy it. This sends the script + its assets to a public Google Cloud bucket. You will need gsutil installed, must be logged in with it and have access to the hubble-static bucket

$ npm run deploy:install-script