Repository navigation
refactor: merge @authup/client-web-slim into @authup/server-core - #3011
Conversation
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughRemoves the standalone Changes
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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-slimfrom 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 fromdist/ui. - Updated server-core HTTP asset middleware +
/authorizecontroller 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.
There was a problem hiding this comment.
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/srcimports a subpath like@authup/core-http-kit/testingor@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/testingper 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 fromapps/client-webtopackages/client-web-kitto avoid cross-app coupling.Lines 23–26 import directly from
apps/client-web/assets/css/, creating a dependency fromapps/server-coreto another app's assets. This violates the monorepo boundary (apps shouldn't depend on each other) and would break isolated builds ofapps/server-corealone.
packages/client-web-kitalready exists as the shared client-web component library and already exportsdist/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: simplifydefineConfigform and confirmssr.noExternal: trueis intended.The function callback isn't using the
ConfigEnvargument, 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 (includingvue,pinia,@vuelidate/*,bootstrap, etc.) intodist/ui/server. That's the right choice for an embedded SSR module loaded byapps/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
⛔ Files ignored due to path filters (1)
package-lock.jsonis 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.jsonDEPENDENCY_GRAPH.mdLICENSEapps/client-web-slim/CHANGELOG.mdapps/client-web-slim/package.jsonapps/client-web-slim/tsconfig.jsonapps/client-web-slim/vite.config.jsapps/server-core/package.jsonapps/server-core/src/adapters/http/controllers/workflows/authorize/module.tsapps/server-core/src/adapters/http/middleware/built-in/assets.tsapps/server-core/src/path.tsapps/server-core/test/app/http.tsapps/server-core/test/unit/adapters/http/middleware/built-in/assets.spec.tsapps/server-core/tsdown.config.tsapps/server-core/ui/index.htmlapps/server-core/ui/src/App.vueapps/server-core/ui/src/app.tsapps/server-core/ui/src/client.tsapps/server-core/ui/src/di.tsapps/server-core/ui/src/pages/authorize.vueapps/server-core/ui/src/server.tsapps/server-core/ui/src/types.tsapps/server-core/ui/src/window.tsapps/server-core/ui/tsconfig.jsonapps/server-core/ui/vite.config.tsdocs/src/.vitepress/config.mjsdocs/src/sdks/javascript/client-web-kit/testing.mdrelease-please-config.jsontsconfig.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
Summary by CodeRabbit
Documentation
Chores