Repository navigation
@thoremin/sdk-ui: the app half of the extension SDK, by dependency inversion (ADR follow-up c, part 2) - #300
Merged
Merged
Conversation
…dependency inversion (ADR follow-up c, part 2) - moved whole into packages/sdk-ui (no app dependency): panel primitives, ExtensionUi types, the named-collection facade, the feature-demand registry, the trainer's sequence store, guidance sinks (TranscriptLine moved beside them) and click player; slugId to @thoremin/sdk/util/ids. Core imports them from the package too (one instance each) - the three that ARE the app become seams: controls() (the hot store), dispatchDialSet/ SetIn/Patch (the command write path) and useDialsSettings (the dials form), resolved at call time to what src/app/store.ts, dispatchDial.ts and dials/useDialsSettings.ts install as they load; setTransient refuses a field no listed extension declares - the extension now imports packages and itself only; the boundary guard's SDK_APP list is gone, and the pure side may never import sdk-ui - the air trainer component tests run only with the air extension listed
…ontrolsFor<typeof AIR_EXTENSION>()), so a typo'd key or wrong value is a type error again; pinned by a type test
This was referenced Oct 5, 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.
Follow-up (c), part 2 of the instruments-as-graphs ADR (#268): the app half of the extension SDK becomes a workspace package,
@thoremin/sdk-ui, by dependency inversion. After this, the air extension imports only packages and its own files. Part 3 moves it intopackages/ext-air.Moved whole (no app dependency)
These moved into
packages/sdk-ui, and core imports them from there too (one instance each):primitives, the extension UItypesnamedCollection(the zodal facade),featureDemand(the app's registry)enroll/{sequenceStore,guidance,click}.TranscriptLinemoved beside the guidance sinks, so they no longer reach into the trainer's store.slugIdwent to@thoremin/sdk/util/ids.Seams (the app itself)
controls()get,setTransient(refuses an undeclared field),setHush,subscribe;controlsStore<S>()for injectable sync loopssrc/app/store.tsdispatchDialSet/SetIn/Patch, the same names the write-path guard readssrc/app/dispatchDial.tsuseDialsSettingssrc/app/dials/useDialsSettings.tsSeams resolve when called, never at import. Calling one before the app has provided it throws, naming the module that provides it.
Guards
packages_puritycoverssdk-ui: React is a peer dependency, and@zodal/*and@thoremin/sdkare declared.SDK_APPlist is gone. An extension imports packages plus itself, and its pure side never imports@thoremin/sdk-ui.setTransientrefusesairGuitarModel/airDrumPatternwhen air is not listed, which is correct. The full run still covers them.controlsFor<typeof ITS_MANIFEST>()(hereairControls). Its dials and transient fields are typed from its own manifest, so a typo'd key or a wrong value is a type error again, as it was against the app's store. A type test pins this.Verified
npm run typecheck(now including sdk-ui's React-free files),typecheck:core,npm test(2441 passed),npm run build,npm run test:core(2334 passed / 87 skipped, bundle check clean): all green.Refs #268.