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

studentbeans

v6.21.0

Published

== README

Downloads

5

Readme

StudentBeans

Building

Production Mode

To build the frontend in production mode run make build.

Development Mode

To build the frontend in development mode run make build_dev.

NB: Currently the frontend does not auto-rebuild when a module is changed or when a container is re-started. The build has to be ran every time the JS changes.

Running

To run, simply execute janus run after a janus build.

Seeding data

Running Seeds

Seed are run easily with one single command: make setup.

Generating Barcodes for testing

To generate a barcode for an offer:

  1. docker-compose exec offers bash
  2. cd src
  3. rails c
  4. RedemptionType.find(<insert your type number here>).redemption_details.redeemable_code.update(code: <insert code string here>, barcode_standard: :itf_barcode)

To then obtain the offer simply: RedemptionType.find(373).offer

Then you can obtain the slug, etc for easy navigation to that offer.

Generating data for local venues

To generate the venues data:

  1. Ensure V1 offer data is seeded with make setup
  2. Get yourself an instore offer slug
  3. Get into a rails console with: docker-compose exec offers-v2 bundle exec rails c
  4. Create the V2 offer: offer = FactoryGirl.create(:offer, slug: '<your slug here>')
  5. Create some venues: `venues = FactoryGirl.create_list(:venue, )
  6. Assign the venues to the offer: offer.venues = venues

This should allow you see venues on the offer. You can check the venues returned by visiting the offer page in studentbeans/web with /venues.json appended to the url.

Dependencies

Useful dependencies:

Plinth - @thebeansgroup/plinth - contains:

  1. Verge
  2. Helpers for styles, such as sizes, fonts, colours, etc
  3. Responsive grid components
  4. Components repeatedly used throughout studentbeans: loaders, modals, alerts, etc
  5. SBiD

Offers - @thebeansgroup/stb_offers - contains:

  1. Connect-Specific Components
  2. Components commonly used for offers on studentbeans, such as offer cards, redemptions, etc
  3. Category and company pages

Mounting volumes for dependencies

Mount the required volumes in docker-compose.yml. These are typically:

- .:/app/src
- /app/src/node_modules
- ../../library/plinth:/app/src/node_modules/@thebeansgroup/plinth:ro
- ../../studentbeans/offers:/app/src/node_modules/@thebeansgroup/stb_offers:ro

We mount app/src/node_modules like this to unmount them locally but mount them on the docker machine.

Dependencies for dependencies

Make sure that all the necessary node_modules are in place for the @thebeansgroup dependencies you wish to mount by running a npm install for them first.

Aliases for dependencies

Ensure that the aliases are setup correctly in webpack.alias.js. Some may need to be added as more dependencies are used.

e.g.

"@thebeansgroup/plinth": __dirname + '/node_modules/@thebeansgroup/plinth',
"plinth": __dirname + '/node_modules/@thebeansgroup/plinth'

Ensures that only the version of plinth used is the one within node_modules.

Running Integration tests

  1. Make sure all containers are up and running in sb/web.

  2. Ensure that the test database is setup and that all the necessary tools are installed with: make integration_setup

  3. To setup a listener ready to run the tests against run: make integration_listen

  4. Open up another session, and run make integration_run And this will run the cucumber tests.

NB: Some tests may (i.e. WILL) fail on first run. Identify which tests these are and run them individually with: make integration_run_single FEATURE=<FEATURE_NAME>.feature

e.g. make integration_run_single FEATURE=promo_boxes.feature

Staging

  1. Ensure you have all the correct node modules and gems installed with make prep
  2. Commit any changes to the lockfile or package.json
  3. git push
  4. Stage with make stage