feat: cross-plugin services (ctx.services) and three-class storage scopes#107
Merged
Conversation
Two context-level primitives for plugin interop: - ctx.services — a typed, namespaced cross-plugin service registry (provide/get/whenAvailable, augmentable DevframeServicesRegistry, DF0037 on duplicate providers). Providers ship a types-only augmentation so consumers get full typing without a runtime dependency, and whenAvailable absorbs setup-order differences. - getStorageDir scopes become workspace/project/global: 'workspace' is the committable <workspaceRoot>/.devframe/ dir (team-shared, new), 'project' is the per-checkout node_modules dir (the previous 'workspace' semantics), 'global' stays per-user. All hosts and call sites migrated: scoped project settings and the hub's dock/user settings persist under 'project'. Docs: a Cross-Plugin Services guide page, storage-scope reference on the definition page, the hub host example implements all three scopes, and a DF0037 error page. API snapshots updated.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
antfubot
added a commit
that referenced
this pull request
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Two context-level primitives that let independently-installed plugins cooperate, split out of the data-inspector work (#101, which stacks on this PR):
ctx.services— cross-plugin service registryA typed, namespaced registry on the shared node context: one integration
provide()s a capability, others consume it withget()/whenAvailable()— no package dependency between them. Providers augment theDevframeServicesRegistryinterface, so consumers get full typing from a types-only import;whenAvailablefires immediately or on later provide, making provider/consumer mount order irrelevant. Duplicate ids throw the newDF0037diagnostic. First consumer: the data-inspector's source registry (#101).Storage scopes:
workspace/project/globalgetStorageDirgains a committable class and renames the old one:workspace— committable, team-shared; conventionally<workspaceRoot>/.devframe/(new semantics)project— per-checkout private, undernode_modules(the previous 'workspace' behavior)global— per-user (unchanged)All in-repo hosts and call sites migrated: scoped
projectsettings and the hub's dock/user settings persist underproject; the committableworkspaceclass exists for team-shared plugin state (first use: data-inspector saved queries in #101).Docs
DF0037error pageVerification
683/683 tests (new unit suite for the services host; scope-settings test updated for the storage migration), API snapshots updated (additive), lint/typecheck/build green.
Created with the help of an agent.