Urgent.News

What's breaking now, across thousands of outlets.

Tech

A pipeline with seams

The word "plugin" usually means one of two things. Either a plugin is a whole subsystem with its own configuration language (Nx executors), or it is a callback bolted to one event the tool happened to expose. vx uses the word the way Vite does: the core is a pipeline, every stage has a named hook, and a plugin is an object that implements the hooks it needs. The stages config → discover → project…

The word "plugin" typically refers to two concepts. It can be a standalone system with its own configuration or a callback linked to a specific tool event. vx operates similarly to Vite, where the core functions as a pipeline, and each stage has predefined hooks. A plugin is an object configured to fulfill the required hooks. The stages encompass the sequence: config → discover → project → graph → key → fingerprint → schedule → admit → executor / cache → telemetry setup and teardown.

Commands in vx introduce a verb, while plugins define the actions within specific hooks. The configuration can be adjusted via the config hook, project tasks managed through the project hook, and task dependencies altered using the graph hook. Each task is assigned a unique cache key via the key hook. The fingerprint hook manages the lockfile, generating a fingerprint for each project.

The schedule hook assigns a priority to each task ready for execution. The admit hook verifies local dispatches against existing tasks; if denied, the task is halted. The executor hook determines where a task's command is run. The cache hook manages where project artifacts are stored. Telemetry hooks receive plain data records without altering behavior.

Setup occurs once per run, post-planning stages and prior to the initial task. Commands add a CLI verb; using a verb that matches a core verb results in refusal. Teardown occurs at the end of the run, flushing and closing all resources.

Plugins are defined using definePlugin(import.meta, hooks), with the plugin's name derived from its package name imported from import.meta. The order of declaration within vx.workspace.ts dictates the order of execution for all components. Each hook accommodates a specific functionality, ensuring the core remains versatile and adaptable.

Plugins like turbo(), lockfile, schedule-history, reapi, otel, ci, and mcp offer diverse capabilities, from migrating from turbo.json, managing lockfiles, and handling schedule history, to providing remote cache and execution, telemetry export, coding agent support, and model context protocol services. Each plugin operates independently, importing the core only through vx's public interface, thereby ensuring minimal interference and maintainability.

The plugin architecture is designed to enhance flexibility, allowing for seamless integration of new functionalities without compromising core stability.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A key with nothing to run

Some inputs belong to no command. Test fixtures, a shared config, or the source of a dependency that needs no build: a task should re-run when they change, but nothing has to run for them on their…

  • Fixtures lack command association and don't run independently
  • Altering fixtures triggers test failure, other changes re-run
  • Migration requires this change to vx's task handling

More from Friday 9 October →