Repository navigation
Connections refactor, phase B (8/10): move exported connection file code into src/connections/ - #2349
Merged
Conversation
Phase B (8/10) of the connections refactor (aws#2298). Move the exported connection file code into src/connections/: parseConnectionFile (and the ExportedConnectionFile type), saveConfigurationToFile, and useImportConnectionFile (from modules/AvailableConnections/), with their tests, the byte-exact golden test, and its __fixtures__. Importers switch to @/connections. saveConfigurationToFile keeps its default export and is re-exported from the module index as a named export. Inside the module, core is imported by specific path (entities, ConfigurationProvider, StateProvider/storageAtoms), never the @/core barrel. No renames, byte-identical bodies; the golden fixtures are unchanged. Also update two stale path references the move left behind: docs/agents/testing.md and the shared-file-envelope ADR.
mjuarros
marked this pull request as ready for review
October 1, 2026 22:53
kmcginnes
approved these changes
Oct 2, 2026
kmcginnes
pushed a commit
that referenced
this pull request
Oct 2, 2026
…ecycle hooks into src/connections/ (#2350) Phase B, PR 9 of #2298. Pure refactor, no behavior change. Follows #2349 (PR 8). ## What this does Moves the remaining connection code into `src/connections/`, via `git mv` (history preserved, bodies byte-identical, no renames): - `defaultConnection.ts` (from `core/`) - `useActivateConnection` (from `core/StateProvider/`) - `useDeleteConfig` / `useDeleteActiveConfiguration` (from `src/hooks/`) plus their tests. Importers switch to `@/connections`. Inside the module, the lifecycle hooks read and write the persisted atoms via the specific `@/core/StateProvider/storageAtoms` path, never the `@/core` barrel. ## Default export `useActivateConnection` keeps its `export default` in the file and is re-exported from the module index as a **named** export (`export { default as useActivateConnection }`) — the same pattern used for `saveConfigurationToFile` in PR 8. Its two default-importers switched to the named import. ## Compatibility (per the epic's hard rules) - Persisted atoms stay in `storageAtoms.ts`; the hooks read/write the same atoms, no init cycle (verified: the `storageAtoms`/`storedConnectionShapes` preload tests pass). - `defaultConnection`'s server fetch + Zod validation (`DefaultConnectionDataSchema`) is byte-identical — not weakened. - No symbol renames; storage keys and field names unchanged. ## Verification - `pnpm checks` green (lint, format, types across all 4 workspace projects). - `pnpm test` green — 3150 tests / 241 files. - The `useDeleteConfig` (deletes from all four atom maps) and `mapToConnection` behaviors were verified by mutation — both go red when the moved logic is broken, against independent literals. - `AppStatusLoader.test.tsx` spies on `fetchDefaultConnection` via the concrete module (`@/connections/defaultConnection`), and interception through the barrel-imported production call was confirmed by mutation. ## Blocked features None.
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.
Phase B, PR 8 of #2298. Pure refactor, no behavior change. Follows #2348 (PR 7).
What this does
Moves the Exported Connection File code into
src/connections/, viagit mv(history preserved, bodies byte-identical, no renames):parseConnectionFile+ theExportedConnectionFiletype (fromutils/)saveConfigurationToFile(fromutils/)useImportConnectionFile(frommodules/AvailableConnections/)connectionFileGoldenFiles.test.tsand its__fixtures__/(the golden test now exercises connections-module code, so it moves with the module)Importers switch to
@/connections. Inside the module, core is imported by specific path (@/core/entities,@/core/ConfigurationProvider,@/core/StateProvider/storageAtoms,@/core/StateProvider/appStore), never the@/corebarrel.Default export
saveConfigurationToFilekeeps itsexport defaultin the file and is re-exported from the module index as a named export (export { default as saveConfigurationToFile }) — the same patterncore/ConfigurationProvider/index.tsandutils/index.tsalready use. The two former default-importers switched to the named import.Compatibility (per the epic's hard rules)
R100pure renames; the byte-exact export golden test passes unchanged in its new home.storageAtoms.ts;useImportConnectionFilereads them via the specificstorageAtomspath (no new init cycle).Verification
pnpm checksgreen (lint, format, types across all 4 workspace projects).pnpm testgreen — 3150 tests / 241 files.urlvalue turns it red against the un-edited?rawfixture bytes.storageAtoms/storedConnectionShapespreload tests pass.Also updates two stale path references the move left behind (
docs/agents/testing.md, the shared-file-envelope ADR).Blocked features
None.