## Background
The main process carried three circular import groups that `scripts/circular-references/known-violations.json` had to record:
- `main/git-service.ts` and `sync/git/repo-file-watcher.ts` imported each other because the `WorkspaceFileIssue` type lived in `git-service`, while the watcher that produces those issues imported the type back.
- `main/plugin-window.ts` reached `main/window-utils.ts` for `getMainWindow`, both directly and through `main/prompt-bridge.ts`.
- `main/templating-worker-database.ts` and `plugins/index.ts` imported each other because `plugins/index` lazily imported the sandbox-backed user-plugin export discovery from the main-only templating worker module.
## Changes
- Move `WorkspaceFileIssue` to `sync/git/repo-file-watcher.ts`, which owns the file issues, and update the renderer type imports.
- Add `main/window-registry.ts` to own `browserWindows` and `getMainWindow`, so `plugin-window`, `prompt-bridge` and `templating-db-auth` read the main window without importing `window-utils`. `window-utils` still writes the registry and drives the plugin window directly.
- Add `common/templating/user-plugin-export-discovery.ts` as the registration slot for the sandbox-backed discovery. `main/templating-worker-database` registers its implementation at module load, and `plugins/index` calls the registered function in the main process while keeping the protocol path in renderers. Calling it without registration throws an explicit error.
- Remove the five resolved cycles from `scripts/circular-references/known-violations.json`.
- Register the discovery stub through the new hook in the plugin-load-order QuickJS test, and assert the main-process registration contract in the templating-worker-database test.
## Testing
- `npm run check-cycle-references`: insomnia 13 -> 8 cycles, 0 new.
- `npm run type-check -w insomnia` and eslint on the changed files: clean.
- `npx vitest run` for the plugins suite, the templating-worker-database suites, plugin-window IPC authorization, and the window security/guard tests: 134 passed, 1 skipped.
- `npx vitest run` for the repo-file-watcher and import suites: 75 passed.
- `npm run build:electron-entrypoints`: succeeds.
## References
Follows #10496 in the circular-reference cleanup chain.
## Background
The debug and mock-route routes are imported back by the components they render: the gRPC panes import `GrpcRequestState` from the debug route, and the mock editors and panes import the loader hook and patcher from the mock-route route. The request update action also imports `updateMimeType` from the content-type dropdown, which pulls `use-request` back to the action route. Those edges close six route <-> component cycles.
## Changes
- Move `GrpcMessage`/`GrpcRequestState` to `ui/utils/grpc.ts`; repoint the debug route and the two gRPC panes.
- Move the mock-route loader hook and patcher into `ui/hooks/use-mock-route.ts`. The route keeps its `clientLoader` and `satisfies MockRouteLoaderData`; the components import the neutral hook. The patcher still uses the update action route's generated fetcher.
- Move the pure `updateMimeType`/`newBodyGraphQL` helpers from the content-type dropdown into `common/request-mime-type.ts`, so the action route no longer imports a UI component.
- Remove the six now-resolved entries from `scripts/circular-references/known-violations.json`.
## Testing
- `npm run check-cycle-references`: insomnia 19 -> 13 cycles, 0 new.
- `npm run type-check -w insomnia` and eslint on the changed files: clean.
## References
Follows #10496 in the circular-reference cleanup chain.
* refactor(sidebar): own the project shell in one layout route
`/organization/:organizationId/project` and
`/organization/:organizationId/project/:projectId` each rendered their own copy
of the project shell — panel group, navigation sidebar, project modal — through
two sidebar components, `ProjectNavigationSidebar` and
`EmptyProjectNavigationSidebar`. Because the two are sibling route modules,
gaining or losing the last project in an organization swapped one for the other
and remounted the entire sidebar.
Anything the sidebar owned was dropped at that moment. Most visibly, a Konnect
sync started from an empty organization lost its AbortController as soon as it
created the first project: the Cancel button vanished, the sync kept running
invisibly, and disconnecting afterwards deleted projects the still-running sync
then recreated.
Introduce `organization.$organizationId.project.tsx` as a parent layout owning
the shell. flatRoutes nests both existing children under it automatically, so no
route files are renamed. The children keep only what needs the active project:
the git file issues provider and the outlet context. The two sidebars collapse
into one that already handled an empty project list.
Also move `KonnectSyncResultPanel` out of the `showKonnectSyncIntro` ternary's
else branch. It hosts the Konnect settings modal, and the intro branch's
"Configure" button is what opens it, so nesting it there made that button set
state nothing rendered — leaving an organization with Konnect projects but no
PAT unable to reconnect, across restarts.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore: refresh circular reference baseline
The layout refactor removed two cycles rooted at
`organization.$organizationId.project.$projectId.tsx`, which no longer imports
the navigation sidebar or the sync bar:
...project.$projectId.tsx -> project-navigation-sidebar.tsx -> project-node.tsx -> insomnia-event-stream-context.tsx
...project.$projectId.tsx -> sync-bar.tsx
`check-cycle-references` fails on baseline drift as well as on new cycles, so
the recorded baseline has to drop them. No cycles were added — the regenerated
file differs from the previous one by exactly these two deletions.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* refactor(routes): drop unused project index loader data
`ProjectIndexLoaderData` was exported but referenced nowhere, and nothing read
this route's loader data. The returned `{ projects, projectsCount }` was also
unreachable as anything but `{ [], 0 }` — the loader redirects whenever the
organization has projects, so the only way to reach the return is with none.
Return null instead and drop the interface.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two independent papercuts in the circular reference check, both hit while
investigating a failure on another PR.
`npm run check-cycle-references` could not run on Windows at all. It spawned
the extensionless `node_modules/.bin/depcruise` shim through `execFileSync`,
which Windows cannot launch; the `.cmd` sibling does not help either, since
Node >=18 refuses to spawn `.cmd` without a shell (CVE-2024-27980). Resolve
dependency-cruiser's own entry point and run it with `process.execPath`
instead — no shell, works everywhere.
The check also fails on baseline drift (cycles recorded in the baseline that
no longer exist), which is correct: the baseline is a ratchet, and leaving a
fixed cycle in it would silently keep permitting its reintroduction. But CI
labelled every non-success outcome "New circular references detected", so a PR
that *removed* two cycles was reported as having added some. That cost real
debugging time.
Give the script distinct exit codes — 1 for a new cycle, 2 for drift alone —
and have the workflow capture and map them to separate messages. The failure
behaviour is unchanged; only the wording is now accurate. Renamed the final
step to match what it actually gates on.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
## Summary
- Replaces the madge-based `check-cycle-references` with a `dependency-cruiser`-based check, cruised once per npm workspace package.
- Keeps the checker, dependency-cruiser config, and known-cycle baseline together under `scripts/circular-references/`.
- Uses a committed baseline to grandfather existing cycles while failing on new cycles and stale baseline entries.
- Cleans the existing `insomnia-inso` type cycle by using `insomnia-data`'s `AllTypes` instead of importing the database container type.
- CI explicitly uses Bash for correct `tee`/pipeline failure propagation, safely handles skipped checks, and posts a PR report.
- Dropped `madge`/`.madgerc`, added `dependency-cruiser`.
* remove nunjucks usage from core themes
* adds package downloader script
* adds runtime validation for plugins still using nunjucks
* generateThemeCSS no longer needs to be async
* removes Nunjucks as valid type
* move some operations to main
* move more options to main
* move cookies and multipart
* remove cert legacy migration
* move auth and aws helper
* move certs options to main
* remove libcurl usage from renderer and tidy
* extract oauth2 flow back to renderer
* add parse headers tests
* minimally type req
* organise libcurl-promise by req properties
* minimally type used settings
* tidy up debug timeline
* fix cookie bug
* tasty little parsing function refactor
* doh! trim
* tidy up set cookie method/self review
* extracted functions from set-cookie logic
* refactoring with tests
* formatting after rebase
* clarification of duplicate header support
* tighten up parse headers
* simplify aws signing
* fix app version imports
* fixes#2552:
* updated version script to show more verbose errors in case of a mismatch node version
* added suggested changes
* No output is printed if the node version is aaccurate
* changed colours for the messages to make them more prominent
* Added import from URI ability
* Add protocol handlers
* Fix for keymap setting on read-only mode
* Refactored some main components out
* Protocols shoudl work now
* Some minor implementations
* Some more
* Lots more
* Removed 'backend' alias
* removed all promises
* Removed a bunch of module exports stuff
* Some morE'
* Fix
* custom DNS
* Tests for DNS
* bug fix
* Some small adjustments
* Small stuff