feat(next): add next integration package (@aura-stack/next)#141
feat(next): add next integration package (@aura-stack/next)#141halvaradop merged 9 commits intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughReorganized auth exports and adapters: added a Next.js integration package, exposed auth instance handlers/core/api, removed several framework-specific server helpers, updated many import targets to new next/react entry points, and added identity/crypto/shared subpath re-exports across packages. Changes
Sequence Diagram(s)sequenceDiagram
participant Browser
participant NextServer as Next.js Server
participant NextAPI as Next API (packages/next.api)
participant AuthCore as Auth Core (createAuth core / handlers / api)
participant CookieStore as Next CookieStore
Browser->>NextServer: request SSR or sign-in action
NextServer->>NextAPI: call api.getSession() or api.signIn() (reads headers(), cookies())
NextAPI->>AuthCore: forward headers/cookies to auth.api.getSession / auth.api.signIn
AuthCore-->>NextAPI: return session or sign-in response (signInURL / JSON)
NextAPI->>CookieStore: apply/delete Set-Cookie values from response headers
NextAPI-->>NextServer: return session data or redirect
NextServer-->>Browser: render or redirect per response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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.
Actionable comments posted: 7
🧹 Nitpick comments (1)
apps/nextjs/app-router/src/lib/auth.ts (1)
6-10: Avoid hardcodedbaseURLin auth bootstrap.Using a fixed localhost URL can break non-local deployments and makes env-specific config harder to manage.
♻️ Proposed refactor
+const appUrl = process.env.NEXT_PUBLIC_APP_URL ?? process.env.APP_URL ?? "http://localhost:3000" + export const { api, core } = createAuth({ oauth, basePath: "/api/auth", - baseURL: "http://localhost:3000", + baseURL: appUrl, })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/nextjs/app-router/src/lib/auth.ts` around lines 6 - 10, The auth bootstrap currently hardcodes baseURL to "http://localhost:3000" in the createAuth call (exported const { api, core }) which will fail in non-local environments; change createAuth to read the host from an environment variable (e.g., process.env.NEXT_PUBLIC_BASE_URL or process.env.NEXTAUTH_URL) and fall back to a safe default or omit baseURL so it uses relative paths in production, updating the createAuth invocation to use that env var instead of the literal string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/next/README.md`:
- Around line 26-27: The feature list mentions withAuth and toHandler but the
package actually exposes core.handlers in the quick start/API; update the README
bullets to match the exported API by either replacing "withAuth" and "toHandler"
with "core.handlers" (and a short description like "simple handler bridge for
app/api routes") or explicitly document that withAuth/toHandler are aliases that
map to core.handlers; ensure you reference the existing exported symbol
core.handlers and the wrapper names (withAuth, toHandler) so readers know which
API to use.
In `@packages/next/src/createAuth.ts`:
- Around line 1-8: The module createAuth.ts imports directly from
"@aura-stack/auth" (see the createAuth import at top of file), but the next
package's package.json does not list "@aura-stack/auth" as a direct dependency;
add "@aura-stack/auth": "workspace:*" to the dependencies of the
`@aura-stack/next` package.json alongside the existing "@aura-stack/react" entry
so the direct import resolves correctly.
In `@packages/next/src/lib/api.ts`:
- Around line 78-87: The sign-out flow currently always calls redirect(...) when
response.status === 202, which ignores callers passing redirect: false; update
the logic in the signOut function (the block that inspects response.status ===
202 and calls redirect(options?.redirectTo ?? "/")) to only call redirect when
options?.redirect !== false (i.e., respect redirect: false), while still
performing the cookie deletion and using options?.redirectTo when redirect is
allowed.
In `@packages/next/src/oauth/index.ts`:
- Line 1: The re-export path in the top-level export statement is invalid;
update the module specifier in packages/next/src/oauth/index.ts from
"@aura-stack/auth/oauth/index" to "@aura-stack/auth/oauth" so it matches the
package's exported pattern (use the same import used by other framework
packages), ensuring the export line correctly re-exports the OAuth providers.
In `@packages/react/src/index.tsx`:
- Line 5: You changed the public type surface by exporting only User, Session,
AuthConfig, AuthInstance from `@/`@types/core.ts which can break consumers;
restore backward compatibility by re-exporting any previously published type
names as aliases (e.g., export type { OldTypeName as OldTypeName } from "...")
or reintroduce the removed/renamed types in packages/react/src/index.tsx, and if
you intentionally removed/renamed types, prepare a semver-major bump and add a
clear migration note in the release notes describing the old→new type mappings
and examples for updating consumer code.
- Line 4: The package export for OAuth is missing entries so imports like the
one in packages/react/src/index.tsx (exporting builtInOAuthProviders and type
BuiltInOAuthProvider from "@aura-stack/auth/oauth/index") fail; update the
exports map in packages/core/package.json to add explicit entries for "./oauth"
and "./oauth/index" (pointing to the OAuth entry file and its types) so the
symbols builtInOAuthProviders and BuiltInOAuthProvider are resolvable from the
`@aura-stack/auth` package.
In `@packages/react/src/oauth/index.ts`:
- Line 1: Replace the deep-import string "@aura-stack/auth/oauth/index" with the
package's public subpath export (e.g., "@aura-stack/auth/oauth") so tsup can
resolve it; update the export line in packages/react/src/oauth/index.ts (the
export * from "@aura-stack/auth/oauth/index" statement) and fix the identical
deep-import occurrence in the other file where the same string is used (the
export in packages/react/src/index.tsx) to use the public "/oauth" subpath
instead of "/index".
---
Nitpick comments:
In `@apps/nextjs/app-router/src/lib/auth.ts`:
- Around line 6-10: The auth bootstrap currently hardcodes baseURL to
"http://localhost:3000" in the createAuth call (exported const { api, core })
which will fail in non-local environments; change createAuth to read the host
from an environment variable (e.g., process.env.NEXT_PUBLIC_BASE_URL or
process.env.NEXTAUTH_URL) and fall back to a safe default or omit baseURL so it
uses relative paths in production, updating the createAuth invocation to use
that env var instead of the literal string.
🪄 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: 1016b27f-b6ae-47c5-a0b5-f113a5fed639
⛔ Files ignored due to path filters (2)
bun.lockis excluded by!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (38)
apps/elysia/src/lib/auth.tsapps/elysia/src/lib/handler.tsapps/nextjs/app-router/package.jsonapps/nextjs/app-router/src/@types/props.tsapps/nextjs/app-router/src/@types/types.tsapps/nextjs/app-router/src/app/api/auth/[...aura]/route.tsapps/nextjs/app-router/src/components/auth-client.tsxapps/nextjs/app-router/src/components/auth-server.tsxapps/nextjs/app-router/src/components/header.tsxapps/nextjs/app-router/src/components/ui/button.tsxapps/nextjs/app-router/src/contexts/auth.tsxapps/nextjs/app-router/src/lib/auth-client.tsapps/nextjs/app-router/src/lib/auth.tsapps/nextjs/app-router/src/lib/server.tsapps/vercel/tsconfig.jsonpackages/core/src/@types/index.tspackages/core/src/index.tspackages/next/CHANGELOG.mdpackages/next/README.mdpackages/next/deno.jsonpackages/next/package.jsonpackages/next/src/@types/core.tspackages/next/src/client.tspackages/next/src/createAuth.tspackages/next/src/index.tspackages/next/src/lib/api.tspackages/next/src/oauth/index.tspackages/next/tsconfig.jsonpackages/next/tsup.config.tspackages/react/package.jsonpackages/react/src/@types/core.tspackages/react/src/@types/index.tspackages/react/src/@types/types.tspackages/react/src/context.tsxpackages/react/src/hooks.tspackages/react/src/index.tsxpackages/react/src/oauth/index.tspackages/react/test/hooks.test.tsx
💤 Files with no reviewable changes (3)
- apps/elysia/src/lib/handler.ts
- apps/nextjs/app-router/src/@types/types.ts
- apps/nextjs/app-router/src/lib/server.ts
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
packages/core/test/types.test-d.ts (1)
14-15: Keep the public API test on public entrypoints.Importing
OAuthProviderCredentialsfrom@/@types/oauth.tsbypasses the published export surface, so this test will keep passing even if consumers can no longer import that type. If this file is meant to guard the package API, point it at the public subpath instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/test/types.test-d.ts` around lines 14 - 15, The test imports OAuthProviderCredentials from an internal path which bypasses the package export surface; update the import in types.test-d.ts to reference the public export/subpath that re-exports OAuthProviderCredentials (i.e., change the import of OAuthProviderCredentials from "@/@types/oauth.ts" to the package's public entrypoint or public subpath that exposes that type) so the test actually validates the published API surface.packages/core/src/client/client.ts (1)
108-113: Fix misleading CSRF error message inupdateSession.On Line 112, the thrown message references sign-out, but this branch is session update. This makes logs harder to trust.
Proposed patch
- throw new AuthClientError("Failed to fetch CSRF token for sign-out.") + throw new AuthClientError("Failed to fetch CSRF token for session update.")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/client/client.ts` around lines 108 - 113, The thrown AuthClientError message in updateSession incorrectly references "sign-out"; update the error text thrown when getCSRFToken returns falsy to reflect a session update operation (e.g., "Failed to fetch CSRF token for session update.") so logs accurately point to updateSession and not sign-out; change the message in the branch inside the updateSession function where getCSRFToken is called and AuthClientError is thrown.packages/core/src/client/index.ts (1)
1-1: Consider a temporary compatibility bridge for removed client exports.This entrypoint now narrows the public surface. If downstream consumers still import removed symbols from this path, they’ll break immediately. Consider one deprecation cycle with compatibility re-exports.
Compatibility bridge option
-export { createAuthClient, type AuthClientOptions } from "@/client/client.ts" +export { + createAuthClient, + createClient, + type AuthClientOptions, + type AuthClient, + type SignInOptions, + type SignOutOptions, +} from "@/client/client.ts"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/client/index.ts` at line 1, The new index.ts export narrows the public surface by only exporting createAuthClient and AuthClientOptions and may break consumers importing previously exported symbols; add a temporary compatibility bridge by re-exporting the old/removed symbols from this entrypoint (or from their new locations) under the same names so downstream code keeps working, and mark them as deprecated in comments/JS docstrings so consumers migrate; specifically update packages/core/src/client/index.ts to re-export any formerly-public functions/classes/types (in addition to export { createAuthClient, type AuthClientOptions }) and include a short deprecation note for each re-export to be removed in the next major release.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/index.ts`:
- Around line 1-2: The change removed previous root-level re-exports and will
break existing imports from the package root; restore compatibility by
reintroducing the original root-facing exports while keeping the new explicit
paths. Specifically, ensure the package still re-exports createAuth and the
types User, Session, AuthConfig, AuthInstance from the original root entry (so
imports like import { createAuth } from "@aura-stack/auth" continue to work)
while keeping the new "@/createAuth.ts" and "@/@types/index.ts" exports; you can
add compatibility re-exports that forward to the new symbols (retain export {
createAuth } and export type { User, Session, AuthConfig, AuthInstance } at the
root) and document they are transitional for a future breaking release.
In `@packages/react/tsup.config.ts`:
- Line 7: The tsup multi-entry configuration uses entry: ["src",
"!src/index.ts"] but the actual root entry file is src/index.tsx, so the
negation doesn't exclude the intended file; update the exclusion pattern to
"!src/index.tsx" (or remove the negation if you don't intend to exclude the
root) in the tsup config entry array to ensure the correct file is excluded from
the multi-entry build.
---
Nitpick comments:
In `@packages/core/src/client/client.ts`:
- Around line 108-113: The thrown AuthClientError message in updateSession
incorrectly references "sign-out"; update the error text thrown when
getCSRFToken returns falsy to reflect a session update operation (e.g., "Failed
to fetch CSRF token for session update.") so logs accurately point to
updateSession and not sign-out; change the message in the branch inside the
updateSession function where getCSRFToken is called and AuthClientError is
thrown.
In `@packages/core/src/client/index.ts`:
- Line 1: The new index.ts export narrows the public surface by only exporting
createAuthClient and AuthClientOptions and may break consumers importing
previously exported symbols; add a temporary compatibility bridge by
re-exporting the old/removed symbols from this entrypoint (or from their new
locations) under the same names so downstream code keeps working, and mark them
as deprecated in comments/JS docstrings so consumers migrate; specifically
update packages/core/src/client/index.ts to re-export any formerly-public
functions/classes/types (in addition to export { createAuthClient, type
AuthClientOptions }) and include a short deprecation note for each re-export to
be removed in the next major release.
In `@packages/core/test/types.test-d.ts`:
- Around line 14-15: The test imports OAuthProviderCredentials from an internal
path which bypasses the package export surface; update the import in
types.test-d.ts to reference the public export/subpath that re-exports
OAuthProviderCredentials (i.e., change the import of OAuthProviderCredentials
from "@/@types/oauth.ts" to the package's public entrypoint or public subpath
that exposes that type) so the test actually validates the published API
surface.
🪄 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: 7daf6d1c-07bb-4dd3-9409-c5e511691024
⛔ Files ignored due to path filters (3)
bun.lockis excluded by!**/*.lockdeno.lockis excluded by!**/*.lockpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (92)
apps/astro/package.jsonapps/astro/src/@types/props.tsapps/astro/src/@types/types.tsapps/astro/src/contexts/auth.tsxapps/astro/src/lib/auth-client.tsapps/astro/src/lib/auth.tsapps/astro/src/lib/server.tsapps/astro/src/pages/api/auth/[...all].tsapps/nextjs/app-router/src/components/auth-client.tsxapps/nextjs/app-router/src/components/header.tsxapps/nextjs/app-router/src/contexts/auth.tsxapps/nextjs/app-router/src/lib/auth.tsapps/nextjs/pages-router/package.jsonapps/nextjs/pages-router/src/@types/props.tsapps/nextjs/pages-router/src/@types/types.tsapps/nextjs/pages-router/src/components/auth-client.tsxapps/nextjs/pages-router/src/contexts/auth.tsxapps/nextjs/pages-router/src/lib/auth-client.tsapps/nextjs/pages-router/src/lib/auth.tsapps/nextjs/pages-router/src/pages/_app.tsxapps/nextjs/pages-router/src/pages/api/auth/[...aura].tsapps/nextjs/pages-router/src/pages/index.tsxapps/react-router/app/@types/props.tsapps/react-router/app/@types/types.tsapps/react-router/app/actions/auth-server.tsapps/react-router/app/contexts/auth.tsxapps/react-router/app/lib/auth-client.tsapps/react-router/app/lib/auth.tsapps/react-router/app/routes/api.auth.$.tsxapps/react-router/package.jsonapps/tanstack-start/package.jsonapps/tanstack-start/src/@types/props.tsapps/tanstack-start/src/@types/types.tsapps/tanstack-start/src/lib/auth-client.tsapps/tanstack-start/src/lib/auth-server.tsapps/tanstack-start/src/lib/auth.tsapps/tanstack-start/src/routes/api/auth.$.tspackages/core/CHANGELOG.mdpackages/core/deno.jsonpackages/core/package.jsonpackages/core/src/@types/config.tspackages/core/src/@types/session.tspackages/core/src/actions/callback/callback.tspackages/core/src/actions/callback/userinfo.tspackages/core/src/actions/csrfToken/csrfToken.tspackages/core/src/actions/signIn/authorization-url.tspackages/core/src/api/credentials.tspackages/core/src/client/client.tspackages/core/src/client/index.tspackages/core/src/index.tspackages/core/src/session/stateless.tspackages/core/src/shared/crypto.tspackages/core/src/shared/identity.tspackages/core/src/shared/index.tspackages/core/test/actions/callback/access-token.test.tspackages/core/test/actions/callback/callback.test.tspackages/core/test/actions/session/session.test.tspackages/core/test/actions/signOut/signOut.test.tspackages/core/test/actions/updateSession/updateSession.test.tspackages/core/test/api/updateSession.test.tspackages/core/test/env.test.tspackages/core/test/jose.test.tspackages/core/test/secure.test.tspackages/core/test/types.test-d.tspackages/hono/src/createAuth.tspackages/hono/src/index.tspackages/hono/src/oauth/index.tspackages/next/CHANGELOG.mdpackages/next/README.mdpackages/next/deno.jsonpackages/next/package.jsonpackages/next/src/@types/index.tspackages/next/src/_core/crypto.tspackages/next/src/_core/identity.tspackages/next/src/_core/shared.tspackages/next/src/client.tspackages/next/src/createAuth.tspackages/next/src/index.tspackages/next/src/lib/api.tspackages/next/src/oauth/index.tspackages/react/deno.jsonpackages/react/package.jsonpackages/react/src/@types/core.tspackages/react/src/_core/crypto.tspackages/react/src/_core/identity.tspackages/react/src/_core/shared.tspackages/react/src/context.tsxpackages/react/src/hooks.tspackages/react/src/index.tsxpackages/react/src/oauth/index.tspackages/react/src/server.tspackages/react/tsup.config.ts
💤 Files with no reviewable changes (11)
- apps/astro/package.json
- apps/tanstack-start/package.json
- apps/react-router/package.json
- apps/nextjs/pages-router/package.json
- apps/tanstack-start/src/@types/types.ts
- apps/tanstack-start/src/@types/props.ts
- apps/nextjs/pages-router/src/@types/types.ts
- apps/react-router/app/@types/types.ts
- apps/astro/src/@types/types.ts
- apps/astro/src/@types/props.ts
- packages/hono/src/index.ts
✅ Files skipped from review due to trivial changes (46)
- apps/tanstack-start/src/routes/api/auth.$.ts
- apps/nextjs/pages-router/src/components/auth-client.tsx
- apps/nextjs/pages-router/src/pages/api/auth/[...aura].ts
- packages/core/src/session/stateless.ts
- packages/core/test/actions/signOut/signOut.test.ts
- packages/core/test/env.test.ts
- packages/core/src/actions/signIn/authorization-url.ts
- packages/core/test/secure.test.ts
- packages/core/test/actions/callback/access-token.test.ts
- packages/next/src/_core/shared.ts
- apps/react-router/app/routes/api.auth.$.tsx
- packages/react/src/oauth/index.ts
- apps/tanstack-start/src/lib/auth-server.ts
- packages/hono/src/oauth/index.ts
- apps/astro/src/contexts/auth.tsx
- apps/nextjs/pages-router/src/lib/auth-client.ts
- packages/core/src/api/credentials.ts
- apps/react-router/app/contexts/auth.tsx
- packages/core/test/actions/session/session.test.ts
- packages/core/test/actions/updateSession/updateSession.test.ts
- packages/next/CHANGELOG.md
- apps/react-router/app/lib/auth.ts
- packages/core/src/actions/csrfToken/csrfToken.ts
- packages/react/src/_core/identity.ts
- packages/react/src/@types/core.ts
- packages/next/src/@types/index.ts
- packages/core/test/actions/callback/callback.test.ts
- packages/core/src/actions/callback/userinfo.ts
- apps/nextjs/pages-router/src/contexts/auth.tsx
- packages/hono/src/createAuth.ts
- packages/core/test/jose.test.ts
- apps/astro/src/lib/auth.ts
- apps/nextjs/app-router/src/contexts/auth.tsx
- packages/core/src/shared/index.ts
- packages/core/CHANGELOG.md
- packages/core/test/api/updateSession.test.ts
- apps/astro/src/lib/server.ts
- packages/core/src/actions/callback/callback.ts
- apps/astro/src/pages/api/auth/[...all].ts
- packages/next/src/client.ts
- packages/next/README.md
- packages/core/src/@types/config.ts
- apps/nextjs/pages-router/src/@types/props.ts
- packages/react/deno.json
- packages/next/package.json
- packages/next/src/_core/identity.ts
🚧 Files skipped from review as they are similar to previous changes (11)
- packages/react/src/hooks.ts
- packages/next/src/oauth/index.ts
- apps/nextjs/app-router/src/components/header.tsx
- packages/next/src/index.ts
- apps/nextjs/app-router/src/components/auth-client.tsx
- packages/react/src/context.tsx
- apps/nextjs/app-router/src/lib/auth.ts
- packages/next/src/createAuth.ts
- packages/react/src/index.tsx
- packages/next/deno.json
- packages/next/src/lib/api.ts
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/elysia/CHANGELOG.md`:
- Line 13: Fix the grammar and typos in the changelog line: change "Removed and
clean up the types and functions exported from the index `/` entry point to
reduce import nose and introduced `/identity`, `/crypto` and `/shared` as direct
entry points for specific utilities. [`#141`]" to a corrected sentence referencing
the same symbols (index `/`, `/identity`, `/crypto`, `/shared`, PR `#141`); for
example use past-tense and correct wording like "Removed and cleaned up the
types and functions exported from the index `/` entry point to reduce import
noise, and introduced `/identity`, `/crypto`, and `/shared` as direct entry
points for specific utilities." Ensure commas and articles are correct and
replace "import nose" with "import noise" and "clean up" with "cleaned up."
In `@packages/express/CHANGELOG.md`:
- Line 13: Update the changelog entry that currently reads "Removed and clean up
the types and functions exported from the index `/` entry point to reduce import
nose..." by fixing the typo ("import nose" → "import noise") and moving this
bullet out of the "### Added" section into the appropriate "### Changed" or "###
Removed" section to reflect the API removal; ensure the sentence references the
new direct entry points (`/identity`, `/crypto`, `/shared`) and retains the PR
link (`#141`).
In `@packages/express/src/index.ts`:
- Around line 2-3: You removed the root export for builtInOAuthProviders causing
consumers that import builtInOAuthProviders from the package root to break;
restore compatibility by either re-exporting builtInOAuthProviders from the
package root (add export { builtInOAuthProviders } from "@/lib/auth/providers"
alongside the existing exports toExpressResponse and toWebRequest in the
package's index) or update the consumer to import builtInOAuthProviders directly
from its module (the providers module) wherever it currently imports
builtInOAuthProviders from the package root.
In `@packages/hono/CHANGELOG.md`:
- Line 13: Update the release-note bullet that reads "Removed and clean up the
types and functions exported from the index `/` entry point to reduce import
nose and introduced `/identity`, `/crypto` and `/shared` as direct entry points
for specific utilities. [`#141`]" to correct grammar and spelling; replace it with
a sentence like: "Removed and cleaned up the types and functions exported from
the index (`/`) entry point to reduce import noise, and introduced `/identity`,
`/crypto`, and `/shared` as direct entry points for specific utilities. [`#141`]".
Ensure the entry references the same index and entry-point names (`/`,
`/identity`, `/crypto`, `/shared`) and PR number (`#141`).
In `@packages/react/CHANGELOG.md`:
- Line 13: Update the changelog sentence to fix tense and typos: replace
"Removed and clean up the types and functions exported from the index `/` entry
point to reduce import nose and introduced `/identity`, `/crypto` and `/shared`
as direct entry points for specific utilities. [`#141`](...)" with a corrected
version such as "Removed and cleaned up the types and functions exported from
the index (`/`) entry point to reduce import noise, and introduced `/identity`,
`/crypto`, and `/shared` as direct entry points for specific utilities (`#141`)";
ensure the backticks around `/`, `/identity`, `/crypto`, and `/shared` remain
and the PR reference/number is preserved.
🪄 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: e1b78e5e-d061-4ed3-a29e-44af5bc16915
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (27)
packages/elysia/CHANGELOG.mdpackages/elysia/deno.jsonpackages/elysia/package.jsonpackages/elysia/src/_core/crypto.tspackages/elysia/src/_core/identity.tspackages/elysia/src/_core/shared.tspackages/elysia/src/createAuth.tspackages/elysia/src/index.tspackages/elysia/src/oauth/index.tspackages/express/CHANGELOG.mdpackages/express/deno.jsonpackages/express/package.jsonpackages/express/src/_core/crypto.tspackages/express/src/_core/identity.tspackages/express/src/_core/shared.tspackages/express/src/createAuth.tspackages/express/src/index.tspackages/express/test/types.test-d.tspackages/hono/CHANGELOG.mdpackages/hono/deno.jsonpackages/hono/package.jsonpackages/hono/src/_core/crypto.tspackages/hono/src/_core/identity.tspackages/hono/src/_core/shared.tspackages/hono/src/index.tspackages/next/CHANGELOG.mdpackages/react/CHANGELOG.md
✅ Files skipped from review due to trivial changes (16)
- packages/hono/src/_core/shared.ts
- packages/elysia/src/oauth/index.ts
- packages/express/src/_core/identity.ts
- packages/express/src/_core/shared.ts
- packages/elysia/src/_core/identity.ts
- packages/elysia/src/createAuth.ts
- packages/hono/src/_core/identity.ts
- packages/hono/src/_core/crypto.ts
- packages/next/CHANGELOG.md
- packages/express/src/_core/crypto.ts
- packages/express/test/types.test-d.ts
- packages/hono/deno.json
- packages/elysia/deno.json
- packages/express/src/createAuth.ts
- packages/express/deno.json
- packages/elysia/src/_core/crypto.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/hono/src/index.ts
Description
This pull request introduces the
@aura-stack/nextpackage, providing seamless integration with Next.js App Router. The package supports both server-side rendering (SSR) and client-side rendering (CSR) by exposing built-in utilities for each environment.On the server side, the package provides access to the
apiobject for executing authentication flows within server actions and route handlers. On the client side, it leverages the@aura-stack/reactpackage to provide context and hooks for managing authentication state.Note
The
@aura-stack/nextpackage builds on top of@aura-stack/reactfor client-side state management and adds additional utilities to handle server-side flows in Next.js.Additionally, this PR includes a cleanup and reorganization of exports across multiple packages (
core,elysia,express,hono, andreact). The goal is to provide clearer and more minimal entry points, reducing noise and improving discoverability of public APIs.As part of this effort, new structured entry points have been introduced across packages:
/identity/shared/cryptoThe
@aura-stack/reactpackage also introduces a/serverentry point.Key Changes
@aura-stack/nextintegration packageapps/nextjs/app-routerexample to use the new package/identity,/shared, and/cryptoentry points across packages/serverentry point to@aura-stack/reactUsage
Server-Side Rendering (SSR)
Client-Side Rendering (CSR)
Summary by CodeRabbit
New Features
Documentation
Refactor
Style