Deploy React components to many personal projects

Question

I hope this is a reasonable forum for this question.

I have a library of React components that I've developed that I'd like to use in multiple personal projects. When I update/improve that library I'd like it to allow me to update in all projects where it is used.

I'm using Meteor as a build tool, which will prompt me when there is an update available for a dependency it's using, so I assume it'd be an NPM module or something. It is checked in to GitHub and I don't mind if it's public.

What would be the best way to achieve this?


Show source
| reactjs   | meteor   | npm   2017-01-06 13:01 3 Answers

Answers to Deploy React components to many personal projects ( 3 )

  1. 2017-01-06 14:01

    I know two ways:

    1. Publish your module on NPM
    2. Link using npm link

    For the first one, your module will be public unless you pay NPM for a private module.

    The second one, make your module available locally only (It is used for a development purpose, but it fits your needs).

    https://docs.npmjs.com/cli/link

  2. 2017-01-06 14:01

    If you have your package published on GitHub, you can simply create dependency by linking to tarball/master. If your path is https://github.com/my-nick/my-package, just add to your dependencies in your project's package.json:

    "my-package": "https://github.com/my-nick/my-package/tarball/master"
    

    If you have your package well described (package.json file with name, main and version attributes) it should works after meteor npm install.

    Of course it works for Meteor 1.3 and higher only, lower versions don't support npm.

  3. 2017-01-06 14:01

    I did not use is personally yet, but an frequently mentioned tool for this purpose is https://lernajs.io/, which is e.g. used by create-react-app.

Leave a reply to - Deploy React components to many personal projects

◀ Go back