exile.watch engineering
  • exile.watch engineering blog
  • April 2024
    • Why doesn't Dependabot update package.json?
  • March 2024
    • The savior amidst the chaos of dependency updates - Dependabot
    • Why project's local setup instructions are not part of README?
    • Leveraging Lefthook to enforce commit guidelines at exile.watch
    • The package manager of exile.watch
    • Lerna - the hidden powerhouse of exile.watch
      • 1. Separate repository and monorepo tool
      • 2. A module bundler - the fun begins
      • 3. Module registry (a place where packages get to chill)
      • 4. Versioning, Publishing, and Configuring lerna.json for Commit Conventions
      • 5. Some automation magic using the (Lerna) CLI
      • 6. How does one test lerna packages at exile.watch: locally and in the real world
    • To open source or to not open source
    • exile.watch architecture
Powered by GitBook
On this page
  • 1. npm link and npm link @exile-watch/<package>
  • 2. yalc
  • 3. Preview publish

Was this helpful?

  1. March 2024
  2. Lerna - the hidden powerhouse of exile.watch

6. How does one test lerna packages at exile.watch: locally and in the real world

5 min read

Previous5. Some automation magic using the (Lerna) CLINextTo open source or to not open source

Last updated 1 year ago

Was this helpful?

This page is part of list - 6/7


The final part explores how to effectively operate within this environment, focusing not only on local development but also on verifying the correct publication of prereleased packages.

As a starting point, I recommend reading The package manager of exile.watch first. In it, I discuss package linking across all the package managers I evaluated, ultimately choosing npm as my go-to option.

Utilizing npm link and npm link @exile-watch/<package> is the straightforward approach that works well most of the time—despite the occasional hiccup when symlinks go out of sync, which isn't a frequent issue and can be managed.

I've detailed the challenges with this method in the previously mentioned post about package managers for those interested in digging deeper.

A significant limitation emerges with chain linking.

Why does this matter?

For exile.watch, where each package serves as a comprehensive boilerplate focusing on distinct functionalities and configurations, this limitation complicates the testing process in consumer projects, making it a tedious task to ensure package compatibility.

So, outside of using npm link, how do we test a package in its consumer environment?

Enter our homebuilt automated prerelease system, which versions each release based on the commit hash.

This method is as close as it gets to real-world testing.

Why?

Because it evaluates the package post-bundling, ensuring the changes behave as expected.

Occasionally, local modifications might not carry over after bundling, leading to errors from unsupported syntax (this is a skill issue of mine by sometimes being a dummy :))


(WIP) Next on the line: Dependabot


1.

2.

Yalc offers a solution akin to npm link, presenting a viable option for linking packages, though its success rate varies (see ).

When it comes to integrating Yalc with Next.js, the reliability dips even further, as evidenced by mixed results (see and the mirrored issue on the Vercel repository).

Yalc falls short in resolving dependencies of dependencies (see ).

3.

. (I won't elaborate how this action works under the hood here as it deserves it's own post - for now here is the which highlights what each step is responsible for).

The links below won't redirect you to the initial page so here you have it for the conclusion of these parts:

npm link and npm link @exile-watch/<package>
yalc
#217
#188
#35110
#95
Preview publish
You can see it in action here
sub-actions section
Lerna impact on exile.watch
The toolkit I needed to make it all happen
exile.watch logo