-
Notifications
You must be signed in to change notification settings - Fork 2
Multi Component Repos
One repository can hold several Dataverse projects at once — a plug-in, its web resources, a PCF control, the solution that ships them — each with its own folder and its own settings, all sharing one connection. This is how most real solutions end up structured, and the panel is built for it.
A component is any folder containing a dataverse-powertools.json. Discovery walks the workspace and
lists them all, root first. A single-project repo is simply the case where the only component is the root.
my-solution/
dataverse-powertools.json ← root: the connection, prefix, environment
MyPlugins/
dataverse-powertools.json ← a Plugins component
webresources/
dataverse-powertools.json ← a Web Resources component
MyControl/
dataverse-powertools.json ← a PCF component
solution/
dataverse-powertools.json ← a Solutions component
Each component gets its own card in the panel, with only the buttons that apply to its type.
A subfolder component inherits the root's connection, tenant, publisher prefix and environment. Its own file only holds what is specific to it. That means:
- you connect once, at the root, and every component uses it;
- switching the root to another environment moves every component with it;
- there is one place to look when something is pointed at the wrong org.
Do not paste a connection string into a subfolder component's file to "make it explicit." A component that carries its own connection is treated as self-contained and stops following the root, so a later environment switch silently leaves it behind. The extension is careful never to write inherited fields into a component's file for exactly this reason.
+ Add Component… in the panel, then pick the type. Two cases worth knowing:
- Your project is currently at the workspace root and you want to add a second one: the wizard offers to move the existing project into a subfolder first, leaving a connection-only root. Accept it — that is the layout everything else assumes.
- You already have subfolder components: the new one is created alongside them and inherits the root connection.
Commands resolve their target in this order, so the answer is predictable:
- An explicit target — you clicked a button on a component's card, or ran the command from a file's CodeLens or the Explorer context menu. That component wins.
- Exactly one component of the right type — used automatically. A repo with one plug-in never asks.
- Several of the right type, no explicit target — inferred from the active editor when the open file belongs to one of them; otherwise you get a quick pick.
- None of the right type — if the root's own settings claim that type (a pre-discovery layout), the command runs there; otherwise it explains rather than doing nothing.
The practical habit: have the file you care about open, or click the button on the card you mean.
Two plug-in components (or two web-resource components) in one repo is a supported layout, and each keeps its own build, its own tests and its own Test Explorer entries. Tests from one never appear under the other, and running one does not run the other.
Anything environment-wide — the plug-in trace log level, captured profiles, the connection itself — is a property of the environment, not of a component, so it reads the same from any card. Anything project-shaped — build, deploy, tests, typings, early-bound — is per component.
A command asked me which component to use, and I did not expect it — you have more than one of that type and no explicit target. Open a file in the one you mean, or use its card's button.
One component deploys to the wrong environment — check whether its own dataverse-powertools.json
contains a connectionString. If it does, it is self-contained and no longer following the root; remove
that field to restore inheritance.
A component's card is missing — it needs a dataverse-powertools.json in its folder. Use + Add
Component… rather than copying a file by hand, so the settings are complete and correct.
The card is collapsed and I cannot see its buttons — multi-component cards open minimised; click the caret to expand.
- Connecting & Authentication — where the connection lives and how it is shared
- Solutions — packaging several components into one deployable solution
- Upgrading Projects — moving a root project into a subfolder