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

eps-spine-client

v1.0.1

Published

The code to invoke the Spine client

Downloads

2

Readme

NHS EPS Spine Client

Build

This repository contains the code to invoke the Spine client, utilised in https://github.com/NHSDigital/prescriptionsforpatients.

Functionality

This repository encompasses the code for invoking the Spine client, designed for interaction with the Spine API. It serves as a versatile NPM dependency for both https://github.com/NHSDigital/prescriptionsforpatients and the Prescription Tracker application.

Usage

To integrate this into your project, install the package using the following:

  • command line:
npm install @nhs/eps-spine-client
  • package.json:
"@nhs/eps-spine-client": "latest"

Project Structure

  • .devcontainer Contains a dockerfile and vscode devcontainer definition
  • .github Contains github workflows that are used for building and deploying from pull requests and releases
  • scripts Useful scripts
  • src Contains the source code for the project
  • tests Contains the tests for the project

Contributing

Contributions to this project are welcome from anyone, providing that they conform to the guidelines for contribution and the community code of conduct.

Licensing

This code is dual licensed under the MIT license and the OGL (Open Government License). Any new work added to this repository must conform to the conditions of these licenses. In particular this means that this project may not depend on GPL-licensed or AGPL-licensed libraries, as these would violate the terms of those libraries' licenses.

The contents of this repository are protected by Crown Copyright (C).

Development

It is recommended that you use visual studio code and a devcontainer as this will install all necessary components and correct versions of tools and languages.
See https://code.visualstudio.com/docs/devcontainers/containers for details on how to set this up on your host machine.
There is also a workspace file in .vscode that should be opened once you have started the devcontainer. The workspace file can also be opened outside of a devcontainer if you wish.

All commits must be made using signed commits

Once the steps at the link above have been completed. Add to your ~/.gnupg/gpg.conf as below:

use-agent
pinentry-mode loopback

and to your ~/.gnupg/gpg-agent.conf as below:

allow-loopback-pinentry

As described here: https://stackoverflow.com/a/59170001

You will need to create the files, if they do not already exist. This will ensure that your VSCode bash terminal prompts you for your GPG key password.

You can cache the gpg key passphrase by following instructions at https://superuser.com/questions/624343/keep-gnupg-credentials-cached-for-entire-user-session

CI Setup

The GitHub Actions require a secret to exist on the repo called "SONAR_TOKEN". This can be obtained from SonarCloud as described here. You will need the "Execute Analysis" permission for the project (NHSDigital_nhs-eps-spine-client) in order for the token to work.

Pre-commit hooks

Some pre-commit hooks are installed as part of the install above, to run basic lint checks and ensure you can't accidentally commit invalid changes. The pre-commit hook uses python package pre-commit and is configured in the file .pre-commit-config.yaml. A combination of these checks are also run in CI.

Make commands

There are make commands that are run as part of the CI pipeline and help alias some functionality during development.

Install targets

  • install Installs project dependencies

Build targets

  • build Builds the project

Linting and testing

  • lint Performs linting for all code
  • test Runs tests for the project

Clean and deep-clean targets

  • clean Clears up any files that have been generated by building or testing locally
  • deep-clean Runs clean target and also removes any node_modules installed locally

Check licenses

  • check-licenses Checks licenses for all packages used

GitHub folder

This .github folder contains workflows and templates related to github

  • pull_request_template.yml: Template for pull requests
  • dependabot.yml: Dependabot definition file

Workflows are in the .github/workflows folder

  • combine-dependabot-prs.yml: Workflow for combining dependabot pull requests. Runs on demand
  • dependabot_auto_approve_and_merge.yml: Workflow to auto merge dependabot updates
  • pr-link.yaml: This workflow template links Pull Requests to Jira tickets and runs when a pull request is opened
  • pr_title_check.yml: Workflow to check the format of a pull request is compliant with the project standards. See guidelines for contribution for details
  • pull_request.yml: Called when pull request is opened or updated. Runs quality_checks.yml
  • quality_checks.yml: Workflow verifies and enhances code quality through setup, dependencies, checks, and SonarCloud scanning
  • release.yml: Run when code is merged to main branch or a tag starting v is pushed. Calls quality_checks.yml
  • rename_dependabot_prs.yml: Renames dependabot pull requests to comply with project standards

Running a Release

Details of running the release can be found in RELEASE.md