chore: rename package from @hykocx/zen to @zen/core
Update all references across source files, documentation, and configuration to reflect the new package scope and name. This includes updating `.npmrc` registry config, install instructions, module examples, and all import path comments throughout the codebase.
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
* server-side code (which includes database imports) into client components.
|
||||
*
|
||||
* Usage:
|
||||
* import { getDashboardStats, getModuleDashboardStats } from '@hykocx/zen/admin/actions';
|
||||
* import { getDashboardStats, getModuleDashboardStats } from '@zen/core/admin/actions';
|
||||
*/
|
||||
|
||||
export { getDashboardStats } from './actions/statsActions.js';
|
||||
export { getAllModuleDashboardStats as getModuleDashboardStats } from '@hykocx/zen/modules/actions';
|
||||
export { getAllModuleDashboardStats as getModuleDashboardStats } from '@zen/core/modules/actions';
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
*
|
||||
* ```javascript
|
||||
* // app/(admin)/admin/[...admin]/page.js
|
||||
* import { protectAdmin } from '@hykocx/zen/admin';
|
||||
* import { getDashboardStats, getModuleDashboardStats } from '@hykocx/zen/admin/actions';
|
||||
* import { AdminPagesClient } from '@hykocx/zen/admin/pages';
|
||||
* import { protectAdmin } from '@zen/core/admin';
|
||||
* import { getDashboardStats, getModuleDashboardStats } from '@zen/core/admin/actions';
|
||||
* import { AdminPagesClient } from '@zen/core/admin/pages';
|
||||
*
|
||||
* export default async function AdminPage({ params }) {
|
||||
* const { user } = await protectAdmin();
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
'use server';
|
||||
|
||||
import { query } from '@hykocx/zen/database';
|
||||
import { query } from '@zen/core/database';
|
||||
|
||||
/**
|
||||
* Get total number of users
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { Card, Input, Button } from '../../../../shared/components';
|
||||
import { useToast } from '@hykocx/zen/toast';
|
||||
import { useToast } from '@zen/core/toast';
|
||||
|
||||
const ProfilePage = ({ user: initialUser }) => {
|
||||
const toast = useToast();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Button, Card, Input, Select, Loading } from '../../../../shared/components';
|
||||
import { useToast } from '@hykocx/zen/toast';
|
||||
import { useToast } from '@zen/core/toast';
|
||||
|
||||
/**
|
||||
* User Edit Page Component
|
||||
|
||||
@@ -4,7 +4,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Card, Table, StatusBadge, Pagination, Button } from '../../../../shared/components';
|
||||
import { PencilEdit01Icon } from '../../../../shared/Icons.js';
|
||||
import { useToast } from '@hykocx/zen/toast';
|
||||
import { useToast } from '@zen/core/toast';
|
||||
|
||||
const UsersPageClient = () => {
|
||||
const router = useRouter();
|
||||
|
||||
@@ -9,8 +9,8 @@ export { protectAdmin, isAdmin } from './middleware/protect.js';
|
||||
// Component exports (for catch-all routes)
|
||||
export { AdminPagesClient, AdminPagesLayout } from './pages.js';
|
||||
|
||||
// NOTE: Server-only navigation builder is in '@hykocx/zen/admin/navigation'
|
||||
// NOTE: Server-only navigation builder is in '@zen/core/admin/navigation'
|
||||
// Do NOT import from this file to avoid bundling database code into client
|
||||
|
||||
// NOTE: Admin server actions are exported separately to avoid bundling issues
|
||||
// Import them from '@hykocx/zen/admin/actions' instead
|
||||
// Import them from '@zen/core/admin/actions' instead
|
||||
|
||||
@@ -17,7 +17,7 @@ import { redirect } from 'next/navigation';
|
||||
*
|
||||
* @example
|
||||
* // In a server component:
|
||||
* import { protectAdmin } from '@hykocx/zen/admin';
|
||||
* import { protectAdmin } from '@zen/core/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 '@hykocx/zen/admin';
|
||||
* import { isAdmin } from '@zen/core/admin';
|
||||
*
|
||||
* export default async function Page() {
|
||||
* const admin = await isAdmin();
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
* IMPORTANT: This file is NOT bundled to ensure it shares the same registry instance
|
||||
* that was populated during module discovery.
|
||||
*
|
||||
* IMPORTANT: We import from '@hykocx/zen' (main package) to use the same registry
|
||||
* IMPORTANT: We import from '@zen/core' (main package) to use the same registry
|
||||
* instance that was populated during initializeZen(). DO NOT import from
|
||||
* '@hykocx/zen/core/modules' as that's a separate bundle with its own registry.
|
||||
* '@zen/core/core/modules' as that's a separate bundle with its own registry.
|
||||
*
|
||||
* IMPORTANT: Navigation data must be serializable (no functions/components).
|
||||
* Icons are passed as string names and resolved on the client.
|
||||
*/
|
||||
|
||||
// Import from the main package to use the same registry as discovery
|
||||
import { moduleSystem } from '@hykocx/zen';
|
||||
import { moduleSystem } from '@zen/core';
|
||||
const { getAllAdminNavigation } = moduleSystem;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,18 +5,18 @@
|
||||
* Users can simply re-export this in their app/admin/[...admin]/page.js:
|
||||
*
|
||||
* ```javascript
|
||||
* export { default } from '@hykocx/zen/admin/page';
|
||||
* export { default } from '@zen/core/admin/page';
|
||||
* ```
|
||||
*
|
||||
* This eliminates the need to manually import and pass all actions and props.
|
||||
*/
|
||||
|
||||
import { AdminPagesLayout, AdminPagesClient } from '@hykocx/zen/admin/pages';
|
||||
import { protectAdmin } from '@hykocx/zen/admin';
|
||||
import { buildNavigationSections } from '@hykocx/zen/admin/navigation';
|
||||
import { getDashboardStats, getModuleDashboardStats } from '@hykocx/zen/admin/actions';
|
||||
import { logoutAction } from '@hykocx/zen/auth/actions';
|
||||
import { getAppName, getModulesConfig, getAppConfig, moduleSystem } from '@hykocx/zen';
|
||||
import { AdminPagesLayout, AdminPagesClient } from '@zen/core/admin/pages';
|
||||
import { protectAdmin } from '@zen/core/admin';
|
||||
import { buildNavigationSections } from '@zen/core/admin/navigation';
|
||||
import { getDashboardStats, getModuleDashboardStats } from '@zen/core/admin/actions';
|
||||
import { logoutAction } from '@zen/core/auth/actions';
|
||||
import { getAppName, getModulesConfig, getAppConfig, moduleSystem } from '@zen/core';
|
||||
|
||||
const { getAdminPage } = moduleSystem;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user