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

@rgbk/dapp

v0.2.0

Published

RigoBlock DApp v2 (frozen)

Downloads

2

Readme

DApp

RigoBlock DApp v2 (frozen)

Folder Structure

.
├── README.md
├── coverage
├── node_modules
├── output
├── dist            // Dist folder will contain the built files for
│                      production use (populated with yarn build)
├── public
│   └── index.html  // Page template
├── src
│   ├── actions
│   ├── components
│   │   ├── _settings
│   │   ├── atoms
│   │   │   └── Link
│   │   │       ├── __snapshots__
│   │   │       ├── index.js
│   │   │       ├── Link.jsx
│   │   │       ├── Link.scss
│   │   │       ├── Link.stories.js
│   │   │       └── Link.test.js
│   │   ├── molecules
│   │   ├── organisms
│   │   └── templates
│   ├── constants
│   ├── epics
│   ├── images
│   ├── pages
│   ├── reducers
│   ├── store
│   ├── api.js    // API instance
│   ├── index.js    // JavaScript entry point
│   ├── registerServiceWorker.js
│   └── setupTests.js // Jest tests setup file
├── test            // Feature tests are located inside this folder
│   └── pages       // Folder for codecept page objects
├── package.json
└── yarn.lock

Available Scripts

In the project directory, you can run:

yarn build

Builds the app for production to the dist folder.

yarn start

Starts an http-server serving the dist folder on port 8080.

yarn dev

Runs the app in the development mode.

Open http://localhost:8080 to view it in the browser.

The page will reload if you make edits.

yarn storybook

Launches Storybook on port 6006

yarn storybook:build

Builds Storybook as static files

yarn test

Launches unit tests and feature tests sequentially.

yarn test:unit

Launches unit tests only and exits upon finishing.

yarn test:unit:debug

Launches unit tests in debug mode.

yarn test:unit:watch

Launches unit tests in interactive mode and listens for changes to the test file.

yarn test:feature

Launches feature tests.

yarn test:feature:debug

Launches feature tests in debug mode.

yarn ganache

Starts up the Ganache-cli with default port, network Id and mnemonic specified in the package.json file

yarn ganache:bootstrap

Deploys all the compiled contracts on Ganache

yarn ganache:seed

Runs the seed script on Ganache

Filename Conventions

Jest will look for test files with this naming:

  • Files with .test.js suffix.

The .test.js file must be located in the same folder of the relative component.

Using the DApp with Ganache

To correctly use the DApp with Ganache, you must use Ganache-CLI via the command yarn ganache and bootstrap the contracts via yarn ganache:bootstrap. After bootstrapping the contract and before starting to make operations, you must go into your MetaMask extension, click on the menu in the top right corner, click settings, and at the bottom select 'Reset Account'.

This procedure is necessary because we always start Ganache with the same network Id, and doing so confuses MetaMask since it remembers the nonce of the transactions. By clicking 'Reset Account' we are effectively syncing the two again.

Note:

The DApp will not work correctly when using Ganache UI, as Reset Account will not correctly sync MetaMask and the Ganache blockchain.

Writing Unit Tests

To create tests, add it() (or test()) blocks with the name of the test and its code. You may optionally wrap them in describe() blocks for logical grouping but this is neither required nor recommended.

Jest provides a built-in expect() global function for making assertions. A basic test could look like this:

import sum from './sum';

it('sums numbers', () => {
  expect(sum(1, 2)).toEqual(3);
  expect(sum(2, 2)).toEqual(4);
});

All expect() matchers supported by Jest are extensively documented here. You can also use jest.fn() and expect(fn).toBeCalled() to create “spies” or mock functions.

Offline Cache

We are using redux-persist and localforage libraries to manage redux store persistence on IndexedDB.

Info on migrations

Feature Tests

Please read the documentation for testing the DApp with CodeceptJS.