DEV Community

Cover image for Installing EmberJS v2 addons from GitHub forks using PNPM
Michal Bryxí
Michal Bryxí

Posted on

1

Installing EmberJS v2 addons from GitHub forks using PNPM

The problem

If you're using PNPM as a package manager for your EmberJS project and you find yourself in a need to install a v2 addon from git(hub) fork (because you have a branch with patched version), then you might find that GitHub URLs in package.json tricks don't work for you.

The analysis

Reason for this is because v2 addons are a monorepo and we're still in the phase where pretty much every tool out there lacks good support/DX for monorepos.

There are different possible solutions for different cases:

  • gitpkg.vercel.app - Using sub folders of a repo as yarn/npm dependencies made easy.
  • pnpm patch - Prepare a package for patching
  • patch-package - Lets app authors instantly make and keep fixes to npm dependencies.

But if you happen to use PNPM in your project you might get away with providing a customised git URL.

The solution

Let's assume I have a patch branch of ember-highcharts that has latest commit of SHA: 7995a3e7d2203ce174c39e186acc9257d883bf61. The web URL is:

https://github.com/MichalBryxi/ember-highcharts/tree/7995a3e7d2203ce174c39e186acc9257d883bf61
Enter fullscreen mode Exit fullscreen mode

I can add this patched fork to my project as follows:

pnpm add -D 'github:MichalBryxi/ember-highcharts#7995a3e7d2203ce174c39e186acc9257d883bf61&path:ember-highcharts'
Enter fullscreen mode Exit fullscreen mode

Where:

  • github: Shorthand for pnpm to know where the code is hosted
  • MichalBryxi - My github namespace
  • ember-highcharts - Name of the repo (my fork)
  • 7995a3e7d2203ce174c39e186acc9257d883bf61 - respective commit that contains the patch I'm interested in
  • path:ember-highcharts - In this v2 addon the ember-highcharts subdirectory contains the code for the addon

Conclusion

With PNPM it is possible to install EmberJS v2 addons, or any other packages living in monorepos, from GitHub forks.

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay