Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dev and staging environments for a Javascript SDK

I have a Javascript SDK that is published to NPM. I also have a Vue app that uses the SDK and I need to be able to test them together in different pre-prod environments (e.g. staging). My questions are:

  1. What is the best way to manage pre-production versions of the SDK? It doesn't seem good to put them on the public NPM, since they only need to be accessible to my team.
  2. What is the best way to manage the different environments for the app that uses the SDK to allow for easy switching of environments when testing.
like image 429
Anna Avatar asked Oct 15 '22 21:10

Anna


2 Answers

  1. You can use a private npm-registry that proxies to npmjs. Checkout https://verdaccio.org/

  2. You can publish your sdk package with tags like dev, stg and in your app use those tagged versions based on env

like image 140
acetheninja Avatar answered Oct 23 '22 02:10

acetheninja


You can use the local version of the javascript SDK package (pulled down from a shared devlopment git branch) in your vue app using npm link https://docs.npmjs.com/cli/v7/commands/npm-link

like image 22
g.carey Avatar answered Oct 23 '22 01:10

g.carey