Lightning.Adaptors.Local (Lightning v2.19.0)

View Source

Filesystem implementation of Lightning.Adaptors.Strategy.

Serves adaptor metadata, schemas, and icons from an on-disk OpenFn adaptors monorepo checkout. Selected by ADAPTORS_STRATEGY=local with ADAPTORS_LOCAL_REPO=/path/to/adaptors at the runtime-config layer; this module only reads the resolved paths via Lightning.Adaptors.Config.strategy_opts(__MODULE__)[:paths], an ordered list of root directories.

Each callback walks the filesystem afresh. Caching is the Store's job.

Layout

Walks packages/*/ under each configured root, reads each subdirectory's package.json for the authoritative name and version. Directories with missing or unparseable package.json are skipped with Logger.warning so a malformed entry never crashes boot. Multiple directories sharing the same name within one root are collapsed into one record: latest_version is the highest semver and versions lists every on-disk path in that root.

When the same name appears under more than one configured root, the earliest root in the list wins outright: its version directories are used and the other root's are ignored entirely, not merged in, and a single Logger.warning names every shadowed package once per scan.

A checkout with no packages in it lists {:ok, []}: the directory is readable and really is empty, which is a different thing from an npm org listing that comes back with nothing in it.