Skip to content

Seed @thunderid/configure-applications - #4445

Merged
DonOmalVindula merged 1 commit into
thunder-id:mainfrom
DonOmalVindula:seed-configure-applications
Jul 31, 2026
Merged

Seed @thunderid/configure-applications#4445
DonOmalVindula merged 1 commit into
thunder-id:mainfrom
DonOmalVindula:seed-configure-applications

Conversation

@DonOmalVindula

@DonOmalVindula DonOmalVindula commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Purpose

Second step toward extracting the flow builder into frontend/packages/ (see #4425).

The builder's SimulationStepPreview reads application data (useGetApplications + useGetApplication), and gatePreviewTransforms needs the Application type. A package cannot import @/features/..., so those have to live in a package before the builder can move.

This stands up @thunderid/configure-applications and seeds it with only the transitive closure the builder needs — 8 files. The feature's remaining ~220 files stay in the console and migrate later into the package that now exists.

Why this seeding keeps the graph acyclic

applications and flows import each other, so extracting both naively would be circular:

  • applications → flows: 8 modules (the flows-settings tab, create-application signin options)
  • flows → applications: the simulation preview's application data

The seed avoids the cycle because applications/api/, models/ and constants/ contain zero flows imports — all 17 flows-importing files live in pages/, contexts/ and components/, none of which move here. So configure-applications does not depend on the builder while the builder depends on it.

Verified with a cold-cache turbo run build --filter=./packages/*: 22 tasks ordered successfully. Turbo failing to order the builds is the cycle detector.

Approach

What moved (the closure of useGetApplication, useGetApplications and Application):

File Lines
api/useGetApplication.ts 78
api/useGetApplications.ts 100
models/application.ts 352
models/responses.ts 66
models/inbound-auth.ts 143
models/oauth.ts 597
models/token.ts 102
constants/application-query-keys.ts 33

The three models/{inbound-auth,oauth,token} files come along only because application.ts imports them — part of the closure, not a scope expansion. All 8 have tests, which moved too. Depth is preserved, so all 16 files register as renames and the moved files' relative imports resolve unchanged.

Moving application-query-keys now is deliberate: it keeps react-query cache keys identical between configure-flows and the rest of configure-applications, which would silently diverge if duplicated.

Scaffolding came from the repo's own packages/create feature template. The same two template corrections as #4404 were needed: the template emits a populated dependencies block where every real package uses dependencies: {} with everything in peers (this matters because rolldown.config.js derives external from deps + peers), and it references the stale @asgardeo/react scope. Both worth fixing in the template itself.

Peers are exactly what the 8 files import: @tanstack/react-query, @thunderid/contexts, @thunderid/react, react.

No re-export shims (AGENTS.md forbids them), so importers were repointed directly: 150 import statements across 99 files, plus 12 vi.mock/dynamic-import sites.

That rewrite was done by resolving every specifier to an absolute path and rewriting only genuine hits, rather than by pattern-matching module names. That mattered: flows has its own models/responses, and a naive models/responses' pattern would have wrongly rewritten it. It also revealed my file-count estimate was low — the real scope was 99 files, not the ~44 my grep patterns suggested, because they missed deeper relative paths like ../../../../models/oauth.

Mock conversions needed care, since the package exports named rather than default and mocking a whole package replaces all its exports:

  • vi.mock('<module>') and vi.mock('<module>', () => ({default: fn})) became a single vi.mock('@thunderid/configure-applications', async importOriginal => ({...(await importOriginal()), <name>: fn})) per file, so the package's other exports survive.
  • SimulationStepPreview.test.tsx mocked two moved modules; those merged into one package mock with both overrides.
  • const {default: X} = await import(...) became const {<name>: X} = await import(...).

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Verification

  • Package standalone: build, typecheck, lint clean, and 8 test files / 78 tests pass.
  • Console: tsc -b clean, 478 test files / 7562 tests pass, eslint 0 errors, production build succeeds.
  • Cold-cache turbo run build --filter=./packages/*: 22/22, no cycle.
  • pnpm install --frozen-lockfile: clean (39 workspace projects).
  • Gate: flows no longer imports anything from applications except GradientBorderButton, which is the next PR's job.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 138 files, which is 38 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ff8229e-98d8-48d1-8930-beb4c1d8be9b

📥 Commits

Reviewing files that changed from the base of the PR and between 7fe9841 and e57baa9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (138)
  • frontend/apps/console/package.json
  • frontend/apps/console/src/App.tsx
  • frontend/apps/console/src/components/GatePreview/GatePreview.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/EditAdvancedSettings.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/OperationModesSection.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/RedirectURIsSection.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/SecuritySection.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/TokenEndpointAuthMethodSection.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/__tests__/OperationModesSection.test.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/__tests__/SecuritySection.test.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/advanced-settings/__tests__/TokenEndpointAuthMethodSection.test.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/credentials/ClientSecretSection.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/flows/EditFlowsSettings.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/flows/__tests__/EditFlowsSettings.test.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/tokens/AgentAccessTokenSection.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/tokens/EditTokensSettings.tsx
  • frontend/apps/console/src/features/agents/components/edit-agent/tokens/__tests__/EditTokensSettings.test.tsx
  • frontend/apps/console/src/features/agents/constants/delegationGrants.ts
  • frontend/apps/console/src/features/agents/models/agent.ts
  • frontend/apps/console/src/features/applications/api/__tests__/useCreateApplication.test.tsx
  • frontend/apps/console/src/features/applications/api/__tests__/useDeleteApplication.test.tsx
  • frontend/apps/console/src/features/applications/api/__tests__/useRegenerateClientSecret.test.tsx
  • frontend/apps/console/src/features/applications/api/__tests__/useUpdateApplication.test.tsx
  • frontend/apps/console/src/features/applications/api/useCreateApplication.ts
  • frontend/apps/console/src/features/applications/api/useDeleteApplication.ts
  • frontend/apps/console/src/features/applications/api/useRegenerateClientSecret.ts
  • frontend/apps/console/src/features/applications/api/useRegenerateFlowSecret.ts
  • frontend/apps/console/src/features/applications/api/useUpdateApplication.ts
  • frontend/apps/console/src/features/applications/components/ApplicationsList.tsx
  • frontend/apps/console/src/features/applications/components/__tests__/ApplicationsList.test.tsx
  • frontend/apps/console/src/features/applications/components/create-application/__tests__/ConfigureDetails.test.tsx
  • frontend/apps/console/src/features/applications/components/create-application/__tests__/ConfigureSignInOptions.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/AttestationSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/EditAdvancedSettings.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/IdentityAssertionsSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/MetadataSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/OAuth2ConfigSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/AttestationSection.roundtrip.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/AttestationSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/EditAdvancedSettings.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/IdentityAssertionsSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/MetadataSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/OAuth2ConfigSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/AppearanceSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/ContactsSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/EditCustomizationSettings.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/UrlsSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/__tests__/AppearanceSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/__tests__/ContactsSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/__tests__/EditCustomizationSettings.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/customization-settings/__tests__/UrlsSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/AuthenticationFlowSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/EditFlowsSettings.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/RecoveryFlowSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/RegistrationFlowSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/SignOutFlowSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/__tests__/AuthenticationFlowSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/__tests__/EditFlowsSettings.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/__tests__/RecoveryFlowSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/__tests__/RegistrationFlowSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/flows-settings/__tests__/SignOutFlowSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/AccessSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/EditGeneralSettings.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/QuickCopySection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/__tests__/AccessSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/__tests__/EditGeneralSettings.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/__tests__/QuickCopySection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/integration-guides/IntegrationGuides.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/integration-guides/__tests__/IntegrationGuides.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/mcp/McpAccessSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/mcp/McpConnectTab.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/mcp/__tests__/McpAccessSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/mcp/__tests__/McpConnectTab.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/ClientAccessTokenSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/EditTokenSettings.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/EditTokenSettingsTabs.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/ScopeMapper.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/ScopeSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/TokenUserAttributesSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/__tests__/ClientAccessTokenSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/__tests__/EditTokenSettings.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/token-settings/__tests__/EditTokenSettingsTabs.test.tsx
  • frontend/apps/console/src/features/applications/contexts/ApplicationCreate/ApplicationCreateProvider.tsx
  • frontend/apps/console/src/features/applications/models/application-templates.ts
  • frontend/apps/console/src/features/applications/models/requests.ts
  • frontend/apps/console/src/features/applications/pages/ApplicationCreatePage.tsx
  • frontend/apps/console/src/features/applications/pages/ApplicationEditPage.tsx
  • frontend/apps/console/src/features/applications/pages/__tests__/ApplicationCreatePage.test.tsx
  • frontend/apps/console/src/features/applications/pages/__tests__/ApplicationEditPage.test.tsx
  • frontend/apps/console/src/features/applications/utils/__tests__/inferApplicationTemplateTechnologyFromConfig.test.ts
  • frontend/apps/console/src/features/applications/utils/__tests__/oauth2Rules.test.ts
  • frontend/apps/console/src/features/applications/utils/__tests__/resolveApplicationType.test.ts
  • frontend/apps/console/src/features/applications/utils/deriveMcpClientType.ts
  • frontend/apps/console/src/features/applications/utils/getGrantTypeLabel.ts
  • frontend/apps/console/src/features/applications/utils/inferApplicationTemplateTechnologyFromConfig.ts
  • frontend/apps/console/src/features/applications/utils/oauth2Rules.ts
  • frontend/apps/console/src/features/applications/utils/resolveApplicationType.ts
  • frontend/apps/console/src/features/flows/components/visual-flow/SimulationStepPreview.tsx
  • frontend/apps/console/src/features/flows/components/visual-flow/__tests__/SimulationStepPreview.test.tsx
  • frontend/apps/console/src/features/flows/utils/__tests__/gatePreviewTransforms.test.ts
  • frontend/apps/console/src/features/flows/utils/gatePreviewTransforms.ts
  • frontend/apps/console/src/features/groups/components/__tests__/AddMemberDialog.test.tsx
  • frontend/apps/console/src/features/groups/components/edit-group/members-settings/AddMemberDialog.tsx
  • frontend/apps/console/src/features/home/components/StartBuildingSection.tsx
  • frontend/apps/console/src/features/home/components/__tests__/StartBuildingSection.test.tsx
  • frontend/apps/console/src/features/home/components/cards/InviteMembersCard.tsx
  • frontend/apps/console/src/features/roles/components/edit-role/assignments-settings/AddAssignmentDialog.tsx
  • frontend/apps/console/src/features/roles/components/edit-role/assignments-settings/__tests__/AddAssignmentDialog.test.tsx
  • frontend/apps/console/src/layouts/__tests__/DashboardLayout.test.tsx
  • frontend/packages/configure-applications/.editorconfig
  • frontend/packages/configure-applications/.gitignore
  • frontend/packages/configure-applications/.prettierignore
  • frontend/packages/configure-applications/eslint.config.js
  • frontend/packages/configure-applications/package.json
  • frontend/packages/configure-applications/prettier.config.js
  • frontend/packages/configure-applications/rolldown.config.js
  • frontend/packages/configure-applications/src/api/__tests__/useGetApplication.test.tsx
  • frontend/packages/configure-applications/src/api/__tests__/useGetApplications.test.tsx
  • frontend/packages/configure-applications/src/api/useGetApplication.ts
  • frontend/packages/configure-applications/src/api/useGetApplications.ts
  • frontend/packages/configure-applications/src/constants/__tests__/application-query-keys.test.ts
  • frontend/packages/configure-applications/src/constants/application-query-keys.ts
  • frontend/packages/configure-applications/src/index.ts
  • frontend/packages/configure-applications/src/models/__tests__/application.test.ts
  • frontend/packages/configure-applications/src/models/__tests__/inbound-auth.test.ts
  • frontend/packages/configure-applications/src/models/__tests__/oauth.test.ts
  • frontend/packages/configure-applications/src/models/__tests__/responses.test.ts
  • frontend/packages/configure-applications/src/models/__tests__/token.test.ts
  • frontend/packages/configure-applications/src/models/application.ts
  • frontend/packages/configure-applications/src/models/inbound-auth.ts
  • frontend/packages/configure-applications/src/models/oauth.ts
  • frontend/packages/configure-applications/src/models/responses.ts
  • frontend/packages/configure-applications/src/models/token.ts
  • frontend/packages/configure-applications/tsconfig.eslint.json
  • frontend/packages/configure-applications/tsconfig.json
  • frontend/packages/configure-applications/tsconfig.lib.json
  • frontend/packages/configure-applications/tsconfig.spec.json
  • frontend/packages/configure-applications/vitest.config.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DonOmalVindula DonOmalVindula added Type/Improvement frontend Issues related to frontend development labels Jul 31, 2026
Stand up the applications package and move in only the transitive closure
that the flows feature imports: the useGetApplication and
useGetApplications hooks, the application models they depend on, and the
shared query keys. The feature's remaining files stay in the console and
migrate later into the package that now exists.

This is the second step of extracting the flow builder into
frontend/packages. The builder's simulation preview reads application
data, and a package cannot import @/features/..., so those hooks have to
live in a package before the builder can move.

Seeding with api, models and constants keeps the dependency graph acyclic:
none of them import flows, so configure-applications does not depend on
the builder while the builder depends on it.

Moving application-query-keys now keeps cache keys identical between the
two packages, which would silently diverge if duplicated.

Importers are repointed at the package rather than kept working through
re-export shims. The two moved hook tests adopt the mock style the other
packages use, since they now run under the packages' browser-mode vitest.

Refs thunder-id#4425
@DonOmalVindula
DonOmalVindula force-pushed the seed-configure-applications branch from cad0f64 to e57baa9 Compare July 31, 2026 03:41
@DonOmalVindula DonOmalVindula added the trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes label Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@DonOmalVindula
DonOmalVindula enabled auto-merge July 31, 2026 04:46
@DonOmalVindula
DonOmalVindula added this pull request to the merge queue Jul 31, 2026
Merged via the queue into thunder-id:main with commit 97229ac Jul 31, 2026
67 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Issues related to frontend development trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants