refactor: reorganize package exports under namespaced paths
- Prefix feature exports with `features/` (auth, admin, provider) - Prefix shared exports with `shared/` (components, icons, lib, config, logger, rate-limit) - Add new explicit exports for `shared/logger`, `shared/config`, and `shared/rate-limit` - Update internal imports to use package self-referencing (`@zen/core/shared/*`) instead of relative paths
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Utilities to protect admin routes and require admin role
|
||||
*/
|
||||
|
||||
import { getSession } from '../../auth/actions/authActions.js';
|
||||
import { getSession } from '@zen/core/features/auth/actions';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
/**
|
||||
@@ -17,7 +17,7 @@ import { redirect } from 'next/navigation';
|
||||
*
|
||||
* @example
|
||||
* // In a server component:
|
||||
* import { protectAdmin } from '@zen/core/admin';
|
||||
* import { protectAdmin } from '@zen/core/features/admin';
|
||||
*
|
||||
* export default async function AdminPage() {
|
||||
* const session = await protectAdmin();
|
||||
@@ -47,7 +47,7 @@ async function protectAdmin(options = {}) {
|
||||
* @returns {Promise<boolean>} True if user is admin
|
||||
*
|
||||
* @example
|
||||
* import { isAdmin } from '@zen/core/admin';
|
||||
* import { isAdmin } from '@zen/core/features/admin';
|
||||
*
|
||||
* export default async function Page() {
|
||||
* const admin = await isAdmin();
|
||||
|
||||
Reference in New Issue
Block a user