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

moda-web-library

v2.15.1

Published

Web prototype build with Node.js, React, Redux, React-Router v4, Redux-JsonApi.

Downloads

3,299

Readme

Node.js Web Prototype

Web prototype build with Node.js, React, Redux, React-Router v4, Redux-JsonApi.

Setup and run locally

  1. Make sure you have node.js and yarn installed
  2. Clone the repo
  3. Run yarn install
  4. Run yarn build to build the app
  5. Run yarn start to start the Node server. You can reach it on http://localhost:9000/new You can disable prerendering with yarn start --prerender=false.
  6. For development, run yarn dev to run the dev server. It will watch changes and hot reload. Open it on http://localhost:8080/new

Running tests

You can run all tests with yarn test. Run a specific test with yarn test [filePath].


Build the library package and use it in mojo (integration/staging/production)

  1. Merge your PR and wait for the new release from semantic-release
  2. Upgrade moda-web-library in your mojo PR and merge it

Build the library package and use it in mojo (sandbox)

  1. Publish a pre-release (e.g. 1.0.0-pre.1) with npm publish --tag pre.
  2. Update package.json in mojo with the new version and push your branch.
  3. Your sandbox now should have the new version of moda-web-librar

Build the library package and use it in mojo (development)

  1. Make sure you have yalc installed globally: npm install --global yalc
  2. Run yarn library:watch
  3. Run yalc add moda-web-library in mojo
  4. Start the rails server
  5. After you're done with development, run yalc remove moda-web-library in mojo

Fetching resources

For resource fetching we use Apollo. See their docs. For non-graphql endpoints, we use apollo-link-rest.

Generating types for Apollo

Run yarn apollo:types:generate to re-generate the Apollo types in src/generated_types.

Using the linter

Running the linter from console is as simple as running yarn lint. To autofix formatting errors, run yarn lint-fix.

Setting up linter in your editor

Most editors have plugins which can highlight lint errors in real time, and autoformat using jsPrettier. The setup is different for each editor, I will provide a guide for SublimeText v3.

  1. Install package control
  2. Install the following packages:
  3. If you would like to autoformat on save, turn on auto_format_on_save in Preferences -> Package Settings -> JsPrettier -> Settings - Default