Testing NPM Packages Locally
In tandem with my Wasp app, I'm developing a library of 3D components for visualizing robots. Also, I need to test my own fixes to the Viam robotics framework TypeScript API. What is the best way to test local npm packages using Wasp? BTW, here is the excellent Medium article I found on the subject, but uses the npm CLI: https://medium.com/@oresoftware/node-js-how-to-test-your-new-npm-module-without-publishing-it-every-5-minutes-3b6f8e0491dd
Medium
Node.js — How to test your new NPM module without publishing it eve...
Because every module I used/installed came from the NPM registry, I had never loaded a local NPM module before, even though I had even…
4 Replies
You can specify the package version as a path to the local folder. Something like this:
Where
some-local-package
is the folder of the package containing the package.json
file
Where the /tmp/deps-test/packages/some-local-package
is the absolute path to the folder on your machinevery cool!
is it possible to include npm module from a repository ?
in npm, this is possible by using
Hey, sorry for the late response, but since Wasp maps it's deps config to
package.json
directly you can install packages via Git as well.
For example npm install git+https://github.com/organisation/repo.git#tag
results with this line in package.json
usually:
This means you can add the same thing in Wasp by adding this to dependencies
array: