Consuming Never-Ending Support packages
Guide for setting up npm-based applications to consume Never-Ending Support (NES) packages
Overview
Setting up your npm-based application(s) to consume Never-Ending Support (NES).
There are 3 things to configure to consume an NES package, well technically 4 but since we are tech people and not business people we're going to ignore the sales/token acquisition process. Anyway on to the those 3 steps:
- Configure a
.npmrc
file in the root of your project - Update your current dependencies to point to the NES versions
- Configure an "overrides" section of your package.json
Explanations
Why do I need to set 3 things to use NES packages?
A brief explanation of each of the steps above and the purpose they serve should answer that question.
.npmrc
The purpose of a .npmrc
file is to provide configuration to the npm command line tool. This allows npm (or other package manager tools like yarn and pnpm) to know about the NES repository to be able to retrieve NES versions of the packages you are using. The values set within there define the URI for the repository hosting @neverendingsupport
scoped packages. The other information provided there is an authentication token associated with this URI to ensure your access to the NES packages.
dependencies
The dependencies will have a minor change, in that the keys will not change but the version will be updated. This allows your code to use the same imports that it currently does. The new version will look something like this:
npm
represents that the dependency is an npm package@neverendingsupport/pkg
is the name of the NES hosted libraryversion
is the version of the NES hosted library
overrides
The overrides to replace a package in your dependency tree with another version, or another package entirely. These ensure that all packages that depend (directly or transitively) on the old package will use the NES version of the package instead.