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

@holo-host/hclient

v0.3.0

Published

Client side lib injected by holo loader

Downloads

11

Readme

hClient

Build Status

For API documentation for the master branch visit https://holo-host.github.io/hClient.js/module-hClient.html

hClient is the client side library developers must import for their web UI to be Holo enabled. It includes the following functionality: - Key management and generation + Generating temporary readonly keys for browsing + Detecting when authorization is required and prompting the user to signup/login to generate read/write keys - Signing calls and responses - setting up a websocket connection to the interceptor to sign commits on request (the signing wormhole) - Wrapping and unwrapping calls to and from the interceptor such that they look like regular holochain calls

hClient is designed so that UI developers do not need to make any extra considerations when developing for Holo or Holochain. A holochain app that uses hc-web-client can be converted to holo by calling

const hClient = require("hClient");
const holochainClient = require("@holochain/hc-web-client");

holoClient = hClient.makeWebClient(window.holochainclient);

This will return an API compatible holoClient object to make calls with but will included all the relevent hooks to be holo enabled.


The final piece is the login modal. This can be injected into the app UI by calling

hClient.insertLoginHtml();
hClient.registerLoginCallbacks();

This has its own inline scoped CSS and should not interfere with the rest of the application. hClient is then able to trigger this modal to block any further user interaction until they are authenticated.

Running tests

Before trying to run any tests the repo needs to be initialised with

npm install

Unit tests

Unit tests exist for hClient and can be run using:

npm run unit_test

These do not run in a browser environment

Integration tests

The integration of hLoader and hLoader are tested with the resolver.holo.host and saltmine.holo.host set up as mocks. For true integration tests these mocks can be removed in the future. Run the ui-automation tests by running

npm run prepare:integration_tests
npm run integration_test

or instead of npm run integration_test you can use the following to run the integration tests in the interactive cypress test runner

npm run prepare:integration_tests
cd ./integration_tests
npm run test:runner

Publishing

To publish a new release to npm use the following steps. Ensure you are on the master branch then run

  • npm version patch
  • npm publish

This will automatically build, lint, commit and push a new git tag before publishing. You can alternatively use npm version major|minor|patch to increment the correct version number. Please do not modify the version number in the package.json directly.

Contributors

License

This project is licensed under the GPL-3 License - see the LICENSE file for details