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

musora-content-services

v1.0.119

Published

A package for Musoras content services

Downloads

2,228

Readme

Musora Content Services

Welcome to the musora-content-services repository. This package provides a collection of utility functions designed to fetch and manage content from our Sanity Studio. These functions are tailored to interact with our Sanity backend, allowing you to easily retrieve, filter, and manipulate content for use in various applications.

Setup

To set up the Musora Content Services project for local development, follow these steps:

  • Pull the latest railenvironment php-8-3-upgrade branch changes
  • In the railenvironment directory, start up the container with the ./rrr.sh command
  • Run r setup musora-content-services
  • Run npm install --save-dev jest
  • Create a new .env file in the root of the project and copy the contents from 1Password "musora-content-services .env"

You're now set for doing basic development and running tests through npm. To set up an even better developer experience, you can also do the following:

  • Find the location of node within the container by running which node in your terminal (inside the rrr shell)
    • This should be something along the lines of /home/.nvm/versions/node/v20.14.0/bin/node
  • Add the Node interpreter to your IDE. The following steps are for PHPStorm:
    • Go to File > Settings
    • Under Languages & Frameworks, click on Node.js
    • Under the Node interpreter dropdown, click "Add..." and select "Add Remote..."
    • In the next window, choose the Docker option
      • Set the Server to Docker
      • For the Image name, use the dropdown to select railenvironment_docker-manager:latest (this is the docker image that we're in when running the rrr shell)
      • For the Node.js interpreter path, paste in the path from step 1 (e.g. /home/.nvm/versions/node/v20.14.0/bin/node)
    • Apply the changes and click OK
  • You now have a Node interpreter set up that will assist in linting, tests, etc.

Features

  • Fetch Content by ID: Retrieve specific content items using their unique Railcontent ID.
  • Fetch All Songs: Get a list of all songs for a brand with pagination and search capabilities.
  • Filter Options: Generate filtering options based on difficulty, genre, and more.
  • Fetch Related Content: Easily fetch related lessons, songs, and content items.
  • Sanity Integration: Simplified interaction with the Sanity API using customizable configurations.

Installation

To install the package, use npm:

npm install musora-content-services

Publishing Package Updates

To publish a new version to NPM run,

./publish.sh

Symlinking

To link this package to the MWP repo for local development run,

./link_mcs.sh

If either of these commands fail due to permissions,

chmod +x <command>

Publish Documentation

This repo uses JSDoc to generate API documentation. To update the docs, run:

npm run doc

GitHub Page Documentation

https://railroadmedia.github.io/musora-content-services/

Run tests

Ensure that the setup process has been completed, including copying .env file from 1Password "musora-content-services .env" and having jest installed (npm install --save-dev jest). To run the full test suite, simply run the following:

npm test

You can also filter down to specific tests with the -- -t="..." option. e.g. you can run the userContext test suite with npm test -- -t="userContext" or just the contentLiked test with npm test -- -t="contentLiked"