Skip to content

refactor: merge @authup/client-web-slim into @authup/server-core - #3011

Merged
tada5hi merged 4 commits into
masterfrom
refactor/merge-client-web-slim
Apr 25, 2026
Merged

tada5hi merged 4 commits into
masterfrom
refactor/merge-client-web-slim

Conversation

@tada5hi

@tada5hi tada5hi commented Apr 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Documentation

    • Added testing guide for client-web-kit with HTTP client mocking capabilities.
    • Updated architectural documentation reflecting new UI build structure.
  • Chores

    • Removed standalone client application package from the monorepo.
    • Restructured build pipeline with unified UI and server compilation.
    • Updated dependencies and release tooling accordingly.

Copilot AI review requested due to automatic review settings April 25, 2026 07:12
@coderabbitai

coderabbitai Bot commented Apr 25, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@tada5hi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 8 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 8 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f6d73211-16bf-49c2-a6fd-d22b92e47508

📥 Commits

Reviewing files that changed from the base of the PR and between 971e7da and 89da6f4.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .agents/conventions.md
  • .agents/testing.md
  • apps/server-core/tsdown.config.ts
  • docs/src/.vitepress/config.mjs
  • package.json
📝 Walkthrough

Walkthrough

Removes the standalone client-web-slim application and embeds its UI functionality directly within server-core under apps/server-core/ui/. Updates the build pipeline to use Vite for SSR and client builds, replaces all path references, and documents new testing conventions for the embedded consent UI.

Changes

Cohort / File(s) Summary
Client-Web-Slim App Removal
apps/client-web-slim/CHANGELOG.md, apps/client-web-slim/package.json, apps/client-web-slim/tsconfig.json, apps/client-web-slim/vite.config.js
Entirely deleted the standalone app package, including release history, build scripts, and TypeScript/Vite configuration.
Server-Core UI Migration
apps/server-core/ui/src/app.ts, apps/server-core/ui/tsconfig.json, apps/server-core/ui/vite.config.ts
New embedded Vite-built consent UI: added TypeScript config, Vite configuration for SSR/client builds with module resolution aliases, and updated CSS import paths.
Server-Core Build Pipeline
apps/server-core/package.json, apps/server-core/tsdown.config.ts
Replaced build:client with build:ui:server and build:ui:client scripts; added Vue, Vue Router, Pinia, UI component libraries, and validation dependencies; disabled tsdown automatic cleaning to allow top-level cleanup.
Server-Core Path References
apps/server-core/src/path.ts, apps/server-core/src/adapters/http/controllers/workflows/authorize/module.ts, apps/server-core/src/adapters/http/middleware/built-in/assets.ts
Replaced CLIENT_WEB_SLIM_PACKAGE_PATH export with UI_DIST_PATH and UI_SOURCE_PATH; updated authorize controller and asset middleware imports and path usage.
Server-Core Testing
apps/server-core/test/app/http.ts, apps/server-core/test/unit/adapters/http/middleware/built-in/assets.spec.ts
Added baseURL getter to centralize HTTP test client URL construction; new asset middleware test suite verifying UI bundled assets route to UI_DIST_PATH/client.
Documentation and Guidance
.agents/conventions.md, .agents/structure.md, .agents/testing.md, .claude/agents/impact-analysis.md, docs/src/.vitepress/config.mjs, docs/src/sdks/javascript/client-web-kit/testing.md
Formalized testing standards across service/HTTP/UI boundaries; documented SSR testing with createFakeClient; added client-web-kit testing guide; updated documentation navigation.
Configuration Cleanup
LICENSE, .release-please-manifest.json, release-please-config.json, DEPENDENCY_GRAPH.md, tsconfig.json
Removed client-web-slim from release tracking, dependency graph, and module alias paths; updated copyright year to 2021-2026.

Sequence Diagram

sequenceDiagram
    participant Client
    participant AuthorizeEndpoint as Authorize Endpoint<br/>(Server-Core)
    participant SSRRenderer as SSR Renderer
    participant FakeHTTPClient as Fake HTTP Client<br/>(Optional Testing)

    Client->>AuthorizeEndpoint: GET /authorize
    
    alt Production/SSR Path
        AuthorizeEndpoint->>SSRRenderer: Render with real HTTP
        SSRRenderer->>AuthorizeEndpoint: HTML + SSR Manifest
    else Testing Path
        AuthorizeEndpoint->>FakeHTTPClient: Create with mock handlers
        AuthorizeEndpoint->>SSRRenderer: Render with fake HTTP client
        FakeHTTPClient->>SSRRenderer: Respond to mocked requests<br/>(GET /clients/:id, /scopes, etc.)
        SSRRenderer->>AuthorizeEndpoint: HTML + SSR Manifest
    end
    
    AuthorizeEndpoint->>Client: Return rendered consent UI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 The slim client packed its way,
Now nested in the core to stay,
Vite builds consent UI anew,
Fake clients test it through and through,
One app gone, workflows stay! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main refactoring: merging the standalone @authup/client-web-slim package into @authup/server-core as an embedded UI.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/merge-client-web-slim

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 and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the standalone apps/client-web-slim app and embeds its Vite/Vue SSR consent UI directly into apps/server-core/ui, updating server-core build + runtime wiring to serve the UI from dist/ui.

Changes:

  • Removed client-web-slim from workspace config/release metadata and deleted its app files.
  • Added apps/server-core/ui (Vite config, TS config, SSR/client entrypoints, authorize page) and updated server-core to build/serve it from dist/ui.
  • Updated server-core HTTP asset middleware + /authorize controller to use the embedded UI paths; added a regression unit test for asset path correctness.

Reviewed changes

Copilot reviewed 24 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Removes path mapping for deleted @authup/client-web-slim.
release-please-config.json Removes apps/client-web-slim from release automation config.
.release-please-manifest.json Removes apps/client-web-slim version entry.
DEPENDENCY_GRAPH.md Removes client-web-slim nodes/edges.
LICENSE Updates copyright year range.
docs/src/.vitepress/config.mjs Adds “Testing” nav entry for client-web-kit docs.
docs/src/sdks/javascript/client-web-kit/testing.md New documentation page for HTTP-client faking in tests.
apps/server-core/ui/vite.config.ts New Vite config for embedded UI builds.
apps/server-core/ui/tsconfig.json New TS config for embedded UI.
apps/server-core/ui/index.html New UI HTML template for SSR.
apps/server-core/ui/src/* New UI app/SSR/client/hydration utilities and authorize page.
apps/server-core/src/path.ts Replaces client-web-slim paths with UI_DIST_PATH / UI_SOURCE_PATH.
apps/server-core/src/adapters/http/middleware/built-in/assets.ts Serves UI assets from dist/ui/client and mounts Vite dev server rooted at ui/.
apps/server-core/src/adapters/http/controllers/workflows/authorize/module.ts Loads SSR template/manifest/server bundle from embedded UI locations.
apps/server-core/tsdown.config.ts Disables tsdown clean to avoid wiping Vite-built dist/ui.
apps/server-core/package.json Replaces client-web-slim build with embedded UI build scripts; updates deps accordingly.
apps/server-core/test/unit/.../assets.spec.ts Adds unit tests guarding correct UI static asset paths.
apps/server-core/test/app/http.ts Exposes baseURL getter and uses it when constructing test client.
apps/client-web-slim/* (deleted) Removes the old slim Vite app (config, tsconfig, package.json, changelog).
.agents/* and .claude/agents/* Updates internal repo docs to reflect embedded UI + test guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
apps/server-core/ui/tsconfig.json (1)

10-15: Path aliases cover only package roots, not subpaths.

If any code under apps/server-core/ui/src imports a subpath like @authup/core-http-kit/testing or @authup/client-web-kit/..., TypeScript won't resolve it through these aliases. If subpath imports aren't expected here (production UI code shouldn't import /testing per the conventions update), this is fine — otherwise add wildcard variants:

Suggested addition
         "paths": {
             "@authup/client-web-kit": ["../../../packages/client-web-kit/src"],
+            "@authup/client-web-kit/*": ["../../../packages/client-web-kit/src/*"],
             "@authup/kit": ["../../../packages/kit/src"],
+            "@authup/kit/*": ["../../../packages/kit/src/*"],
             "@authup/core-kit": ["../../../packages/core-kit/src"],
+            "@authup/core-kit/*": ["../../../packages/core-kit/src/*"],
             "@authup/core-http-kit": ["../../../packages/core-http-kit/src"]
+            "@authup/core-http-kit": ["../../../packages/core-http-kit/src"],
+            "@authup/core-http-kit/*": ["../../../packages/core-http-kit/src/*"]
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/server-core/ui/tsconfig.json` around lines 10 - 15, The tsconfig "paths"
mapping only covers package roots (the "paths" object with keys like
"@authup/client-web-kit", "@authup/kit", "@authup/core-kit",
"@authup/core-http-kit") and thus won't resolve subpath imports (e.g.
"@authup/core-http-kit/testing"); update the "paths" entries to include wildcard
variants for each alias (for example add "@authup/client-web-kit/*",
"@authup/kit/*", "@authup/core-kit/*", "@authup/core-http-kit/*") and point them
to the corresponding source folder wildcards (e.g.
"../../../packages/<pkg>/src/*") so TypeScript can resolve subpath imports from
the UI project.
apps/server-core/ui/src/app.ts (1)

23-26: Move CSS assets from apps/client-web to packages/client-web-kit to avoid cross-app coupling.

Lines 23–26 import directly from apps/client-web/assets/css/, creating a dependency from apps/server-core to another app's assets. This violates the monorepo boundary (apps shouldn't depend on each other) and would break isolated builds of apps/server-core alone.

packages/client-web-kit already exists as the shared client-web component library and already exports dist/style.css (line 19). Move these CSS files into that package and import from there instead.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/server-core/ui/src/app.ts` around lines 23 - 26, The current direct
imports of CSS from apps/client-web in app.ts (the four imports referencing
'../../../client-web/assets/css/...') create an app-to-app dependency; instead,
move those CSS files into the shared package (packages/client-web-kit) and
import the consolidated stylesheet exported by that package (dist/style.css)
from app.ts. Update app.ts to remove the four ../../../client-web/assets/css/...
imports and replace them with a single import from the client-web-kit package
export (dist/style.css), and ensure the CSS files are copied/merged into
packages/client-web-kit and included in its build so dist/style.css contains the
required rules.
apps/server-core/ui/vite.config.ts (1)

16-31: Optional: simplify defineConfig form and confirm ssr.noExternal: true is intended.

The function callback isn't using the ConfigEnv argument, so this could be a plain config object — export default defineConfig({ ... }) — for slightly less indirection.

Also worth confirming: ssr: { noExternal: true } will bundle every dependency (including vue, pinia, @vuelidate/*, bootstrap, etc.) into dist/ui/server. That's the right choice for an embedded SSR module loaded by apps/server-core, but it does mean any dependency added to the UI graph will be inlined — please double-check there are no dependencies (e.g. native modules) that misbehave when bundled rather than required externally at runtime.

♻️ Optional simplification
-export default defineConfig(() => ({
+export default defineConfig({
     base: '/public/',
     plugins: [
         vuePlugin(),
     ],
     resolve: {
         alias: {
             '@authup/core-kit': path.join(packagesRoot, 'core-kit', 'src'),
             '@authup/core-http-kit': path.join(packagesRoot, 'core-http-kit', 'src'),
             '@authup/kit': path.join(packagesRoot, 'kit', 'src'),
             '@authup/client-web-kit': path.join(packagesRoot, 'client-web-kit', 'src'),
             '@authup/specs': path.join(packagesRoot, 'specs', 'src'),
         },
     },
     ssr: { noExternal: true },
-}));
+});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/server-core/ui/vite.config.ts` around lines 16 - 31, Replace the unused
callback form of defineConfig with a plain config object by changing
defineConfig(() => ({ ... })) to defineConfig({ ... }) to remove unnecessary
indirection; also review and confirm the ssr.noExternal: true setting in the
exported config (ssr.noExternal) is intentional since it will bundle all
dependencies into the server build — if you want some deps external, adjust
ssr.noExternal to false or provide an allowlist/array of packages to exclude
from bundling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/conventions.md:
- Line 33: The mention of "plan 003" in the sentence referencing UI/SSR tests is
undefined and should be removed or replaced with a concrete link; locate the
string "plan 003" in the document (and the related "once implemented" note in
.agents/testing.md) and either delete the "plan 003" reference or swap it for a
specific document or issue link that describes the plan, updating the adjacent
sentence that mentions "UI/SSR tests" and `createFakeClient(handlers)` so it
reads clearly without the opaque reference.

In @.agents/testing.md:
- Around line 64-78: The docs claim a testing pattern using createFakeClient
from `@authup/core-http-kit/testing` and passing httpClient into install(), but
that pattern isn't implemented: Options for install() lacks an httpClient field,
package.json does not export ./testing, and createFakeClient isn't present;
update the testing guide to mark this pattern as "planned" (reference
`@authup/core-http-kit/testing` and createFakeClient) and instead document the
current, supported testing approach (describe existing install() Options fields
like baseURL/pinia/isServer and how to stub or mock HTTP clients currently), or
alternatively implement the missing pieces by adding an httpClient?: HttpClient
to the install() Options type and exporting createFakeClient from
`@authup/core-http-kit` (and adding a ./testing export in package.json) — choose
one fix and make the docs consistent with the code.

In `@apps/server-core/tsdown.config.ts`:
- Around line 11-14: The current tsdown.config.ts sets clean: false which
prevents wiping dist/server and causes stale-output when running build:server
directly; change the build flow so build:server is self-contained by adding a
targeted cleanup (e.g., run rimraf ./dist/server) at the start of the
"build:server" npm script (and any scripts that call it like "cli-dev" /
"cli-dev-src"), or alternatively change tsdown.config.ts to perform scoped
cleaning for the server output only; specifically update the "build:server"
script to run a command that removes only ./dist/server before invoking the
tsdown build so dist/ui remains intact while eliminating orphaned server files.

---

Nitpick comments:
In `@apps/server-core/ui/src/app.ts`:
- Around line 23-26: The current direct imports of CSS from apps/client-web in
app.ts (the four imports referencing '../../../client-web/assets/css/...')
create an app-to-app dependency; instead, move those CSS files into the shared
package (packages/client-web-kit) and import the consolidated stylesheet
exported by that package (dist/style.css) from app.ts. Update app.ts to remove
the four ../../../client-web/assets/css/... imports and replace them with a
single import from the client-web-kit package export (dist/style.css), and
ensure the CSS files are copied/merged into packages/client-web-kit and included
in its build so dist/style.css contains the required rules.

In `@apps/server-core/ui/tsconfig.json`:
- Around line 10-15: The tsconfig "paths" mapping only covers package roots (the
"paths" object with keys like "@authup/client-web-kit", "@authup/kit",
"@authup/core-kit", "@authup/core-http-kit") and thus won't resolve subpath
imports (e.g. "@authup/core-http-kit/testing"); update the "paths" entries to
include wildcard variants for each alias (for example add
"@authup/client-web-kit/*", "@authup/kit/*", "@authup/core-kit/*",
"@authup/core-http-kit/*") and point them to the corresponding source folder
wildcards (e.g. "../../../packages/<pkg>/src/*") so TypeScript can resolve
subpath imports from the UI project.

In `@apps/server-core/ui/vite.config.ts`:
- Around line 16-31: Replace the unused callback form of defineConfig with a
plain config object by changing defineConfig(() => ({ ... })) to defineConfig({
... }) to remove unnecessary indirection; also review and confirm the
ssr.noExternal: true setting in the exported config (ssr.noExternal) is
intentional since it will bundle all dependencies into the server build — if you
want some deps external, adjust ssr.noExternal to false or provide an
allowlist/array of packages to exclude from bundling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2f51cf06-a8c9-407d-8a60-5fc670cf27d0

📥 Commits

Reviewing files that changed from the base of the PR and between 77cff8d and 971e7da.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (33)
  • .agents/conventions.md
  • .agents/structure.md
  • .agents/testing.md
  • .claude/agents/impact-analysis.md
  • .release-please-manifest.json
  • DEPENDENCY_GRAPH.md
  • LICENSE
  • apps/client-web-slim/CHANGELOG.md
  • apps/client-web-slim/package.json
  • apps/client-web-slim/tsconfig.json
  • apps/client-web-slim/vite.config.js
  • apps/server-core/package.json
  • apps/server-core/src/adapters/http/controllers/workflows/authorize/module.ts
  • apps/server-core/src/adapters/http/middleware/built-in/assets.ts
  • apps/server-core/src/path.ts
  • apps/server-core/test/app/http.ts
  • apps/server-core/test/unit/adapters/http/middleware/built-in/assets.spec.ts
  • apps/server-core/tsdown.config.ts
  • apps/server-core/ui/index.html
  • apps/server-core/ui/src/App.vue
  • apps/server-core/ui/src/app.ts
  • apps/server-core/ui/src/client.ts
  • apps/server-core/ui/src/di.ts
  • apps/server-core/ui/src/pages/authorize.vue
  • apps/server-core/ui/src/server.ts
  • apps/server-core/ui/src/types.ts
  • apps/server-core/ui/src/window.ts
  • apps/server-core/ui/tsconfig.json
  • apps/server-core/ui/vite.config.ts
  • docs/src/.vitepress/config.mjs
  • docs/src/sdks/javascript/client-web-kit/testing.md
  • release-please-config.json
  • tsconfig.json
💤 Files with no reviewable changes (8)
  • tsconfig.json
  • apps/client-web-slim/vite.config.js
  • release-please-config.json
  • apps/client-web-slim/package.json
  • apps/client-web-slim/CHANGELOG.md
  • apps/client-web-slim/tsconfig.json
  • DEPENDENCY_GRAPH.md
  • .release-please-manifest.json

Comment thread .agents/conventions.md Resolved
Comment thread .agents/testing.md Resolved
Comment thread apps/server-core/tsdown.config.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants