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

@redhat-cloud-services/insights-standalone

v0.3.3

Published

Mock of core insights services complete with keycloak scripts and Webpack config

Downloads

17

Readme

insights-standalone

A minimal standalone backend for cloud.redhat.com useful for frontend developers working offline. Includes a script for starting keycloak with a user user / user, a mocked RBAC/entitlements insights API that includes required static assets, and a helper to create Webpack proxy config for webpack-dev-server.

Usage

This package is intended to be installed as an NPM dependency:

npm install --save-dev @redhat-cloud-services/insights-standalone
package.json

"scripts": {
  "start:backend": "insights-standalone",
  "start:standalone": "npm-run-all --parallel start:backend start"
}

You'll need to modify your webpack config 2 places as well:

webpack.config.js

const { getProxyPaths, getHtmlReplacements } = require('@redhat-cloud-services/insights-standalone');

// If using ESI tags
plugins: [
  new HtmlReplaceWebpackPlugin([
    {
      pattern: '@@env',
      replacement: appDeployment,
    },
    ...(!isProduction ? getHtmlReplacements() : [])
  ]),
]

// To proxy requests to backend
devServer: {
  proxy: getProxyPaths({ webpackPort })
}

Note: The insights-standalone command will clone ci-beta branches of Git repos under your node_modules folder. You can control this behavior:

Usage: insights-standalone [options]

download required static files and serve alongside mock API

Options:
  -V, --version                 output the version number
  -d, --dir <env>               Directory to look for (or clone) repos into (default:
                                "/home/thesm/src/crc/insights-standalone/repos")
  -e, --env <env>               Files to use from cloned repos:
                                ci-beta|ci-stable|qa-beta|qa-stable|prod-beta|prod-stable|nightly-stable
                                (default: "ci-beta")
  -p, --port <port>             Port to run static asset server + mock entitlements on (default: 4000)
  --chrome <path>               Path to serve insights-chrome dist from (default: "insights-chrome-build")
  --landing <path>              Path to serve landing-page-frontend dist from (default:
                                "landing-page-frontend-build")
  --service-config <path>       Path to serve cloud-services-config dist from (default: "cloud-services-config")
  --keycloak-uri <uri>          Uri to inject in insights-chrome (default: "http://localhost:4001")
  --entitlements-config <path>  Path to get entitlements config from for mock entitlements service (default:
                                "entitlements-config")
  --rbac-config <path>          Path to get entitlements config from for mock entitlements service (default:
                                "rbac-config")
  -h, --help                    display help for commandUsage: insights-standalone [options]

Development / Local usage

This package can also be cloned locally and then run. Commands of interest are npm start:api and npm start:keycloak.

Dependencies

This project clones the following repos that contain static assets required for cloud.redhat.com SPAs into the repos folder: