Libraries section
The Libraries section lets you develop a shared library locally and see it in the
micros that consume it, without publishing it to a registry. MicroLab builds its artifact
and links it over each consumer’s node_modules. Today it supports npm libraries.
It’s a section with a list + detail pattern (like Micros): on the side, the library catalog; in the center, the editable detail of the selected one.
Add a library
Section titled “Add a library”From the add button (top bar) —also offered in the section’s empty background when there are none yet—:
- Add library — you choose the library repo’s folder.
- Import from Git — clones the repo and adds it, deriving the package name from
its
package.json.
A library’s detail
Section titled “A library’s detail”Identity and build recipe. It saves on its own (autosave with a small delay, like in Micros; it can be disabled in Settings):
- Name and Package (the name of the npm package it produces).
- Build — the command that builds the artifact (
dist) and the artifact path. If you don’t declare them, the npm profile’s are used:npm run build, withdistunder the package’s last segment. - Consumers — the micros that use the library. By default they are detected on their own by scanning who declares that package; you can fix them by hand (comma- separated micro ids).
- Watch changes — automatically rebuilds and relinks when the code changes.
Status and actions
Section titled “Status and actions”Per library:
| Action | What it does |
|---|---|
| Build | Generates the artifact (dist). |
| Link | Copies the artifact over each consumer’s node_modules/<package> (overrides the registry version). |
| Unlink | Restores each consumer’s original version. |
| Watch | Does build + link hot on every change. Needs the live engine. |
Each library’s status (built / not built, linked in N consumers, watching) is shown in the list and in the detail.
Repository (Git)
Section titled “Repository (Git)”Like in Micros, a library’s detail includes its Git: switch branches, do fetch and
pull (--ff-only). Access is read-only (never does push), and if there are
uncommitted changes, MicroLab warns before switching branches or updating.
If the repo is not on disk
Section titled “If the repo is not on disk”If a library’s folder moved, the detail marks it and offers to relocate: you choose the new folder and the path is saved.
Non-invasive
Section titled “Non-invasive”The link only touches node_modules (which is outside Git) and is reverted on unlink or
with an npm ci: MicroLab does not modify the consumer’s repo or the library’s.
Deleting a library from the catalog does not unlink it: if it was linked, unlink it first from the detail.
From the CLI and the MCP
Section titled “From the CLI and the MCP”microlab library list/status/build/link/unlink/watch. The read-only ones
(library_list, library_status) are also available as MCP tools.