@nextsparkjs/core 0.1.0-beta.68 → 0.1.0-beta.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/settings/layouts/SettingsSidebar.d.ts.map +1 -1
- package/dist/components/settings/layouts/SettingsSidebar.js +14 -0
- package/dist/components/ui/index.d.ts +7 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +7 -0
- package/dist/components/ui/skeleton-dashboard.d.ts +32 -0
- package/dist/components/ui/skeleton-dashboard.d.ts.map +1 -0
- package/dist/components/ui/skeleton-dashboard.js +69 -0
- package/dist/components/ui/skeleton-detail.d.ts.map +1 -1
- package/dist/components/ui/skeleton-detail.js +0 -1
- package/dist/components/ui/skeleton-features.d.ts +27 -0
- package/dist/components/ui/skeleton-features.d.ts.map +1 -0
- package/dist/components/ui/skeleton-features.js +90 -0
- package/dist/components/ui/skeleton-form.d.ts.map +1 -1
- package/dist/components/ui/skeleton-form.js +0 -1
- package/dist/components/ui/skeleton-list.d.ts.map +1 -1
- package/dist/components/ui/skeleton-list.js +0 -1
- package/dist/components/ui/skeleton-public.d.ts +26 -0
- package/dist/components/ui/skeleton-public.d.ts.map +1 -0
- package/dist/components/ui/skeleton-public.js +61 -0
- package/dist/components/ui/skeleton-settings.d.ts +54 -0
- package/dist/components/ui/skeleton-settings.d.ts.map +1 -0
- package/dist/components/ui/skeleton-settings.js +332 -0
- package/dist/components/ui/skeleton.d.ts +23 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +46 -2
- package/dist/contexts/TeamContext.d.ts +2 -0
- package/dist/contexts/TeamContext.d.ts.map +1 -1
- package/dist/contexts/TeamContext.js +78 -68
- package/dist/hooks/usePrefetch.d.ts +43 -0
- package/dist/hooks/usePrefetch.d.ts.map +1 -0
- package/dist/hooks/usePrefetch.js +56 -0
- package/dist/lib/actions/index.d.ts +27 -14
- package/dist/lib/actions/index.d.ts.map +1 -1
- package/dist/lib/actions/index.js +19 -1
- package/dist/lib/actions/team.actions.d.ts +107 -0
- package/dist/lib/actions/team.actions.d.ts.map +1 -0
- package/dist/lib/actions/team.actions.js +220 -0
- package/dist/lib/actions/user.actions.d.ts +99 -0
- package/dist/lib/actions/user.actions.d.ts.map +1 -0
- package/dist/lib/actions/user.actions.js +149 -0
- package/dist/messages/de/devtools.json +4 -0
- package/dist/messages/de/index.d.ts +4 -0
- package/dist/messages/de/index.d.ts.map +1 -1
- package/dist/messages/en/devtools.json +16 -0
- package/dist/messages/en/index.d.ts +16 -0
- package/dist/messages/en/index.d.ts.map +1 -1
- package/dist/messages/es/devtools.json +4 -0
- package/dist/messages/es/index.d.ts +4 -0
- package/dist/messages/es/index.d.ts.map +1 -1
- package/dist/messages/fr/devtools.json +4 -0
- package/dist/messages/fr/index.d.ts +4 -0
- package/dist/messages/fr/index.d.ts.map +1 -1
- package/dist/messages/it/devtools.json +4 -0
- package/dist/messages/it/index.d.ts +4 -0
- package/dist/messages/it/index.d.ts.map +1 -1
- package/dist/messages/pt/devtools.json +4 -0
- package/dist/messages/pt/index.d.ts +4 -0
- package/dist/messages/pt/index.d.ts.map +1 -1
- package/dist/nextspark-entities.d.ts +59 -0
- package/dist/styles/classes.json +15 -2
- package/dist/styles/ui.css +1 -1
- package/dist/templates/app/(public)/[...slug]/page.tsx +2 -1
- package/dist/templates/app/(public)/docs/[section]/[page]/page.tsx +1 -1
- package/dist/templates/app/api/devtools/config/entities/route.ts +2 -1
- package/dist/templates/app/api/user/plan-flags/route.ts +1 -1
- package/dist/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +4 -2
- package/dist/templates/app/dashboard/(main)/layout.tsx +2 -1
- package/dist/templates/app/dashboard/(main)/loading.tsx +5 -0
- package/dist/templates/app/dashboard/features/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/billing/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/password/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/plans/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/profile/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/security/loading.tsx +5 -0
- package/dist/templates/app/dashboard/settings/teams/loading.tsx +5 -0
- package/dist/templates/app/devtools/config/page.tsx +1 -1
- package/dist/templates/app/devtools/page.tsx +1 -1
- package/dist/templates/app/devtools/tests/[[...path]]/page.tsx +1 -1
- package/dist/templates/contents/themes/starter/messages/de/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/de/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/en/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/en/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/es/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/es/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/fr/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/fr/index.ts +15 -0
- package/dist/templates/contents/themes/starter/messages/it/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/it/index.ts +13 -0
- package/dist/templates/contents/themes/starter/messages/pt/common.json +4 -1
- package/dist/templates/contents/themes/starter/messages/pt/index.ts +13 -0
- package/dist/templates/contents/themes/starter/styles/globals.css +3 -1
- package/dist/templates/contents/themes/starter/templates/(dashboard)/analytics/loading.tsx +5 -0
- package/dist/templates/contents/themes/starter/templates/(public)/loading.tsx +5 -0
- package/dist/templates/next.config.mjs +5 -0
- package/dist/templates/{middleware.ts → proxy.ts} +5 -6
- package/globals.css +54 -0
- package/nextspark-entities.d.ts +59 -0
- package/package.json +14 -13
- package/scripts/build/registry/discovery/api-presets.mjs +20 -12
- package/scripts/build/registry/generators/api-presets-registry.mjs +18 -5
- package/scripts/build/registry/generators/block-registry.mjs +14 -3
- package/scripts/build/registry/generators/docs-registry.mjs +21 -3
- package/scripts/build/registry/generators/translation-registry.mjs +16 -7
- package/scripts/build/theme.mjs +2 -1
- package/templates/app/(public)/[...slug]/page.tsx +2 -1
- package/templates/app/(public)/docs/[section]/[page]/page.tsx +1 -1
- package/templates/app/api/auth/[...all]/route.ts +13 -5
- package/templates/app/api/devtools/config/entities/route.ts +2 -1
- package/templates/app/api/user/plan-flags/route.ts +1 -1
- package/templates/app/api/v1/[entity]/[id]/child/[childType]/[childId]/route.ts +4 -2
- package/templates/app/dashboard/(main)/layout.tsx +2 -1
- package/templates/app/dashboard/(main)/loading.tsx +5 -0
- package/templates/app/dashboard/features/loading.tsx +5 -0
- package/templates/app/dashboard/settings/api-keys/loading.tsx +5 -0
- package/templates/app/dashboard/settings/billing/loading.tsx +5 -0
- package/templates/app/dashboard/settings/invoices/loading.tsx +5 -0
- package/templates/app/dashboard/settings/loading.tsx +5 -0
- package/templates/app/dashboard/settings/notifications/loading.tsx +5 -0
- package/templates/app/dashboard/settings/password/loading.tsx +5 -0
- package/templates/app/dashboard/settings/plans/loading.tsx +5 -0
- package/templates/app/dashboard/settings/profile/loading.tsx +5 -0
- package/templates/app/dashboard/settings/security/loading.tsx +5 -0
- package/templates/app/dashboard/settings/teams/loading.tsx +5 -0
- package/templates/app/devtools/config/page.tsx +1 -1
- package/templates/app/devtools/page.tsx +1 -1
- package/templates/app/devtools/tests/[[...path]]/page.tsx +1 -1
- package/templates/contents/themes/starter/config/app.config.ts +8 -7
- package/templates/contents/themes/starter/messages/de/common.json +4 -1
- package/templates/contents/themes/starter/messages/de/index.ts +15 -0
- package/templates/contents/themes/starter/messages/en/common.json +4 -1
- package/templates/contents/themes/starter/messages/en/index.ts +15 -0
- package/templates/contents/themes/starter/messages/es/common.json +4 -1
- package/templates/contents/themes/starter/messages/es/index.ts +15 -0
- package/templates/contents/themes/starter/messages/fr/common.json +4 -1
- package/templates/contents/themes/starter/messages/fr/index.ts +15 -0
- package/templates/contents/themes/starter/messages/it/common.json +4 -1
- package/templates/contents/themes/starter/messages/it/index.ts +13 -0
- package/templates/contents/themes/starter/messages/pt/common.json +4 -1
- package/templates/contents/themes/starter/messages/pt/index.ts +13 -0
- package/templates/contents/themes/starter/styles/globals.css +3 -1
- package/templates/contents/themes/starter/templates/(dashboard)/analytics/loading.tsx +5 -0
- package/templates/contents/themes/starter/templates/(public)/loading.tsx +5 -0
- package/templates/next.config.mjs +5 -0
- package/templates/pnpm-workspace.yaml +5 -0
- package/templates/{middleware.ts → proxy.ts} +5 -6
- package/tests/jest/setup.ts +5 -0
- package/dist/presets/plugin/.env.example.template +0 -19
|
@@ -45,7 +45,8 @@ function getEntityConfigs(): Record<string, EntityConfig> {
|
|
|
45
45
|
const registry = getEntityRegistry()
|
|
46
46
|
const configs: Record<string, EntityConfig> = {}
|
|
47
47
|
for (const [key, entry] of Object.entries(registry)) {
|
|
48
|
-
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
configs[key] = (entry as any).config as EntityConfig
|
|
49
50
|
}
|
|
50
51
|
return configs
|
|
51
52
|
}
|
|
@@ -16,7 +16,7 @@ interface DocsPageProps {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export async function generateStaticParams() {
|
|
19
|
-
const params = []
|
|
19
|
+
const params: Array<{ section: string; page: string }> = []
|
|
20
20
|
|
|
21
21
|
// Generate params for public docs only
|
|
22
22
|
for (const section of DOCS_REGISTRY.public) {
|
|
@@ -60,7 +60,8 @@ export const GET = withRateLimitTier(async (request: Request) => {
|
|
|
60
60
|
const registry = getEntityRegistry();
|
|
61
61
|
|
|
62
62
|
for (const [, entry] of Object.entries(registry)) {
|
|
63
|
-
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
const config = (entry as any).config;
|
|
64
65
|
if (!isEntityConfig(config)) continue;
|
|
65
66
|
|
|
66
67
|
entities.push({
|
|
@@ -219,7 +219,7 @@ export const POST = withRateLimitTier(async (request: NextRequest) => {
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
const { updates } = validation.data
|
|
222
|
-
const results = []
|
|
222
|
+
const results: Array<{ success: boolean; userId: string; plan?: boolean; flags?: boolean; error?: string }> = []
|
|
223
223
|
|
|
224
224
|
// Process each update
|
|
225
225
|
for (const update of updates) {
|
|
@@ -94,9 +94,11 @@ export const PUT = withRateLimitTier(async (
|
|
|
94
94
|
|
|
95
95
|
// Handle relation-multi fields - store as JSONB array of IDs
|
|
96
96
|
if (field?.type === 'relation-multi') {
|
|
97
|
-
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
+
let relationIds: any[] = []
|
|
98
99
|
if (Array.isArray(value)) {
|
|
99
|
-
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
|
+
relationIds = value.map((item: any) =>
|
|
100
102
|
typeof item === 'object' && item && 'id' in item ? item.id : item
|
|
101
103
|
).filter(id => id && String(id).trim() !== '')
|
|
102
104
|
}
|
|
@@ -61,7 +61,8 @@ async function DefaultMainDashboardLayout({
|
|
|
61
61
|
children: React.ReactNode
|
|
62
62
|
}) {
|
|
63
63
|
// Get entities directly from the imported registry
|
|
64
|
-
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
65
|
+
const allEntities = Object.values(ENTITY_REGISTRY).map(entry => (entry as any).config)
|
|
65
66
|
// Filter to only include full EntityConfig (not child entities)
|
|
66
67
|
const entities = allEntities.filter(isEntityConfig)
|
|
67
68
|
const serializedEntities: SerializableEntityConfig[] = entities.map(serializeEntityConfig)
|
|
@@ -9,7 +9,7 @@ import { getTranslations } from "next-intl/server";
|
|
|
9
9
|
* Provides read-only view with JSON formatting and copy functionality.
|
|
10
10
|
*/
|
|
11
11
|
export default async function DevConfigPage() {
|
|
12
|
-
const t = await getTranslations('
|
|
12
|
+
const t = await getTranslations('devtools.config');
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<div className="space-y-6" data-cy="devtools-config-page">
|
|
@@ -10,7 +10,7 @@ import { getTranslations } from "next-intl/server";
|
|
|
10
10
|
* Shows overview of available sections in the dev area.
|
|
11
11
|
*/
|
|
12
12
|
export default async function DevHomePage() {
|
|
13
|
-
const t = await getTranslations('
|
|
13
|
+
const t = await getTranslations('devtools');
|
|
14
14
|
const tCommon = await getTranslations('common');
|
|
15
15
|
|
|
16
16
|
const sections = [
|
|
@@ -19,7 +19,7 @@ interface DevTestsPageProps {
|
|
|
19
19
|
*/
|
|
20
20
|
export default async function DevTestsPage({ params }: DevTestsPageProps) {
|
|
21
21
|
const { path } = await params;
|
|
22
|
-
const t = await getTranslations("
|
|
22
|
+
const t = await getTranslations("devtools.tests");
|
|
23
23
|
|
|
24
24
|
// Convert path array to string (e.g., ['auth', 'login.bdd.md'] -> 'auth/login.bdd.md')
|
|
25
25
|
const initialPath = path?.join("/") || null;
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"delete": "Löschen",
|
|
9
9
|
"edit": "Bearbeiten",
|
|
10
10
|
"create": "Erstellen",
|
|
11
|
-
"search":
|
|
11
|
+
"search": {
|
|
12
|
+
"placeholder": "Suchen...",
|
|
13
|
+
"label": "Suchen"
|
|
14
|
+
},
|
|
12
15
|
"noResults": "Keine Ergebnisse gefunden",
|
|
13
16
|
"confirm": "Bestätigen",
|
|
14
17
|
"back": "Zurück",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import analytics from './analytics.json'
|
|
2
|
+
import common from './common.json'
|
|
3
|
+
import features from './features.json'
|
|
4
|
+
import home from './home.json'
|
|
5
|
+
import navigation from './navigation.json'
|
|
6
|
+
import public_ from './public.json'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
analytics,
|
|
10
|
+
common,
|
|
11
|
+
features,
|
|
12
|
+
home,
|
|
13
|
+
navigation,
|
|
14
|
+
public: public_
|
|
15
|
+
} as const
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import analytics from './analytics.json'
|
|
2
|
+
import common from './common.json'
|
|
3
|
+
import features from './features.json'
|
|
4
|
+
import home from './home.json'
|
|
5
|
+
import navigation from './navigation.json'
|
|
6
|
+
import public_ from './public.json'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
analytics,
|
|
10
|
+
common,
|
|
11
|
+
features,
|
|
12
|
+
home,
|
|
13
|
+
navigation,
|
|
14
|
+
public: public_
|
|
15
|
+
} as const
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"delete": "Eliminar",
|
|
9
9
|
"edit": "Editar",
|
|
10
10
|
"create": "Crear",
|
|
11
|
-
"search":
|
|
11
|
+
"search": {
|
|
12
|
+
"placeholder": "Buscar...",
|
|
13
|
+
"label": "Buscar"
|
|
14
|
+
},
|
|
12
15
|
"noResults": "No se encontraron resultados",
|
|
13
16
|
"confirm": "Confirmar",
|
|
14
17
|
"back": "Volver",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import analytics from './analytics.json'
|
|
2
|
+
import common from './common.json'
|
|
3
|
+
import features from './features.json'
|
|
4
|
+
import home from './home.json'
|
|
5
|
+
import navigation from './navigation.json'
|
|
6
|
+
import public_ from './public.json'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
analytics,
|
|
10
|
+
common,
|
|
11
|
+
features,
|
|
12
|
+
home,
|
|
13
|
+
navigation,
|
|
14
|
+
public: public_
|
|
15
|
+
} as const
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"delete": "Supprimer",
|
|
9
9
|
"edit": "Modifier",
|
|
10
10
|
"create": "Créer",
|
|
11
|
-
"search":
|
|
11
|
+
"search": {
|
|
12
|
+
"placeholder": "Rechercher...",
|
|
13
|
+
"label": "Rechercher"
|
|
14
|
+
},
|
|
12
15
|
"noResults": "Aucun résultat trouvé",
|
|
13
16
|
"confirm": "Confirmer",
|
|
14
17
|
"back": "Retour",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import analytics from './analytics.json'
|
|
2
|
+
import common from './common.json'
|
|
3
|
+
import features from './features.json'
|
|
4
|
+
import home from './home.json'
|
|
5
|
+
import navigation from './navigation.json'
|
|
6
|
+
import public_ from './public.json'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
analytics,
|
|
10
|
+
common,
|
|
11
|
+
features,
|
|
12
|
+
home,
|
|
13
|
+
navigation,
|
|
14
|
+
public: public_
|
|
15
|
+
} as const
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import analytics from './analytics.json'
|
|
2
|
+
import common from './common.json'
|
|
3
|
+
import features from './features.json'
|
|
4
|
+
import home from './home.json'
|
|
5
|
+
import navigation from './navigation.json'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
analytics,
|
|
9
|
+
common,
|
|
10
|
+
features,
|
|
11
|
+
home,
|
|
12
|
+
navigation
|
|
13
|
+
} as const
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"delete": "Excluir",
|
|
9
9
|
"edit": "Editar",
|
|
10
10
|
"create": "Criar",
|
|
11
|
-
"search":
|
|
11
|
+
"search": {
|
|
12
|
+
"placeholder": "Pesquisar...",
|
|
13
|
+
"label": "Pesquisar"
|
|
14
|
+
},
|
|
12
15
|
"noResults": "Nenhum resultado encontrado",
|
|
13
16
|
"confirm": "Confirmar",
|
|
14
17
|
"back": "Voltar",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import analytics from './analytics.json'
|
|
2
|
+
import common from './common.json'
|
|
3
|
+
import features from './features.json'
|
|
4
|
+
import home from './home.json'
|
|
5
|
+
import navigation from './navigation.json'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
analytics,
|
|
9
|
+
common,
|
|
10
|
+
features,
|
|
11
|
+
home,
|
|
12
|
+
navigation
|
|
13
|
+
} as const
|
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
IMPORTS
|
|
11
11
|
============================================= */
|
|
12
12
|
@import "tailwindcss";
|
|
13
|
-
@import "@nextsparkjs/core/styles/ui.css";
|
|
14
13
|
@import "@nextsparkjs/core/styles/utilities.css";
|
|
15
14
|
@import "@nextsparkjs/core/styles/docs.css";
|
|
16
15
|
@source "../../../**/*.{js,ts,jsx,tsx}";
|
|
16
|
+
/* Core package: monorepo (short path) + npm projects (long path) */
|
|
17
|
+
@source "../node_modules/@nextsparkjs/core/dist/**/*.js";
|
|
18
|
+
@source "../../../../node_modules/@nextsparkjs/core/dist/**/*.js";
|
|
17
19
|
|
|
18
20
|
/* =============================================
|
|
19
21
|
THEME VARIABLES - LIGHT MODE (OKLCH)
|
|
@@ -10,6 +10,11 @@ const withNextIntl = createNextIntlPlugin('./i18n.ts');
|
|
|
10
10
|
|
|
11
11
|
/** @type {import('next').NextConfig} */
|
|
12
12
|
const nextConfig = {
|
|
13
|
+
// Ignore TypeScript build errors - needed until DTS generation is enabled for @nextsparkjs/core
|
|
14
|
+
// Without this, production builds fail due to missing declaration files for deep imports
|
|
15
|
+
typescript: {
|
|
16
|
+
ignoreBuildErrors: true,
|
|
17
|
+
},
|
|
13
18
|
transpilePackages: ['@nextsparkjs/core'],
|
|
14
19
|
serverExternalPackages: ['handlebars'],
|
|
15
20
|
experimental: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NextSpark
|
|
2
|
+
* NextSpark Proxy (Next.js 16+)
|
|
3
3
|
*
|
|
4
4
|
* Handles authentication, route protection, and user context injection.
|
|
5
|
+
* Note: In Next.js 16, "middleware" was renamed to "proxy" with nodejs runtime.
|
|
5
6
|
*
|
|
6
7
|
* Key responsibilities:
|
|
7
8
|
* 1. Theme middleware override support
|
|
@@ -14,7 +15,6 @@
|
|
|
14
15
|
*/
|
|
15
16
|
import { betterFetch } from '@better-fetch/fetch'
|
|
16
17
|
import { NextRequest, NextResponse } from 'next/server'
|
|
17
|
-
// Edge-compatible imports (do NOT use lib/services or lib/auth - they have Node.js dependencies)
|
|
18
18
|
import {
|
|
19
19
|
hasThemeMiddleware,
|
|
20
20
|
executeThemeMiddleware,
|
|
@@ -22,8 +22,7 @@ import {
|
|
|
22
22
|
} from '@nextsparkjs/core/lib/middleware'
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* Session type for
|
|
26
|
-
* We can't import from @nextsparkjs/core/lib/auth because it has Node.js dependencies
|
|
25
|
+
* Session type for proxy (inline definition)
|
|
27
26
|
*/
|
|
28
27
|
interface Session {
|
|
29
28
|
user: {
|
|
@@ -65,7 +64,7 @@ function isPublicPath(pathname: string): boolean {
|
|
|
65
64
|
)
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
export async function
|
|
67
|
+
export async function proxy(request: NextRequest) {
|
|
69
68
|
const { pathname } = request.nextUrl
|
|
70
69
|
|
|
71
70
|
// 1. Check for theme middleware override
|
|
@@ -178,7 +177,7 @@ export async function middleware(request: NextRequest) {
|
|
|
178
177
|
request: { headers: requestHeaders },
|
|
179
178
|
})
|
|
180
179
|
} catch (error) {
|
|
181
|
-
console.error('
|
|
180
|
+
console.error('Proxy error:', error)
|
|
182
181
|
const loginUrl = new URL('/login', request.url)
|
|
183
182
|
loginUrl.searchParams.set('callbackUrl', pathname)
|
|
184
183
|
return NextResponse.redirect(loginUrl)
|
package/globals.css
CHANGED
|
@@ -292,6 +292,60 @@ body {
|
|
|
292
292
|
@apply my-8 border-border;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
+
/* =============================================
|
|
296
|
+
SKELETON - INP OPTIMIZED ANIMATIONS
|
|
297
|
+
High-performance skeleton loading states
|
|
298
|
+
============================================= */
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* GPU-accelerated skeleton pulse animation
|
|
302
|
+
* Uses opacity with will-change hint for smooth GPU-composited animation
|
|
303
|
+
* Respects prefers-reduced-motion for accessibility
|
|
304
|
+
*/
|
|
305
|
+
@keyframes skeleton-pulse {
|
|
306
|
+
0%, 100% {
|
|
307
|
+
opacity: 1;
|
|
308
|
+
}
|
|
309
|
+
50% {
|
|
310
|
+
opacity: 0.5;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Skeleton animation class - GPU accelerated */
|
|
315
|
+
.animate-skeleton-pulse {
|
|
316
|
+
animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
317
|
+
will-change: opacity;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Respect reduced motion preference */
|
|
321
|
+
@media (prefers-reduced-motion: reduce) {
|
|
322
|
+
.animate-skeleton-pulse {
|
|
323
|
+
animation: none;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* CSS Containment for skeleton elements
|
|
329
|
+
* Isolates layout/paint calculations to improve INP
|
|
330
|
+
*/
|
|
331
|
+
.skeleton-contained {
|
|
332
|
+
contain: content;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Skeleton container with content-visibility optimization
|
|
337
|
+
* Skips rendering of off-screen skeleton items
|
|
338
|
+
*/
|
|
339
|
+
.skeleton-container {
|
|
340
|
+
contain: layout style;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/* Apply content-visibility to direct children for virtualization effect */
|
|
344
|
+
.skeleton-container > * {
|
|
345
|
+
content-visibility: auto;
|
|
346
|
+
contain-intrinsic-size: auto 100px;
|
|
347
|
+
}
|
|
348
|
+
|
|
295
349
|
/* =============================================
|
|
296
350
|
THEME SYSTEM - BUILD-TIME LOADING
|
|
297
351
|
Custom theme CSS is automatically injected based on activeTheme config
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient type declarations for @nextsparkjs/core entity configs
|
|
3
|
+
*
|
|
4
|
+
* These declarations provide TypeScript with type information for
|
|
5
|
+
* deep imports to entity config files when DTS generation is disabled.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This file must NOT have any imports to work as global declarations.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// EntityConfig type for reference (simplified version for ambient declarations)
|
|
11
|
+
interface AmbientEntityConfig {
|
|
12
|
+
slug: string
|
|
13
|
+
enabled: boolean
|
|
14
|
+
names: {
|
|
15
|
+
singular: string
|
|
16
|
+
plural: string
|
|
17
|
+
}
|
|
18
|
+
icon?: unknown
|
|
19
|
+
access?: {
|
|
20
|
+
public?: boolean
|
|
21
|
+
api?: boolean
|
|
22
|
+
metadata?: boolean
|
|
23
|
+
shared?: boolean
|
|
24
|
+
basePath?: string
|
|
25
|
+
}
|
|
26
|
+
ui?: {
|
|
27
|
+
dashboard?: {
|
|
28
|
+
showInMenu?: boolean
|
|
29
|
+
showInTopbar?: boolean
|
|
30
|
+
}
|
|
31
|
+
public?: {
|
|
32
|
+
hasArchivePage?: boolean
|
|
33
|
+
hasSinglePage?: boolean
|
|
34
|
+
}
|
|
35
|
+
features?: {
|
|
36
|
+
searchable?: boolean
|
|
37
|
+
sortable?: boolean
|
|
38
|
+
filterable?: boolean
|
|
39
|
+
bulkOperations?: boolean
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
table?: {
|
|
43
|
+
name?: string
|
|
44
|
+
columns?: unknown[]
|
|
45
|
+
relations?: unknown
|
|
46
|
+
}
|
|
47
|
+
schemas?: {
|
|
48
|
+
create?: unknown
|
|
49
|
+
update?: unknown
|
|
50
|
+
}
|
|
51
|
+
fields?: unknown[]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Core entity: patterns
|
|
55
|
+
declare module '@nextsparkjs/core/entities/patterns/patterns.config' {
|
|
56
|
+
export const patternsEntityConfig: AmbientEntityConfig
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Add more core entities here as needed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextsparkjs/core",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.69",
|
|
4
4
|
"description": "NextSpark - The complete SaaS framework for Next.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "NextSpark <hello@nextspark.dev>",
|
|
@@ -288,9 +288,21 @@
|
|
|
288
288
|
"tests/jest/__mocks__",
|
|
289
289
|
"globals.css",
|
|
290
290
|
"theme-styles.css",
|
|
291
|
+
"nextspark-entities.d.ts",
|
|
291
292
|
"README.md",
|
|
292
293
|
"scripts"
|
|
293
294
|
],
|
|
295
|
+
"scripts": {
|
|
296
|
+
"postinstall": "node scripts/postinstall.mjs || true",
|
|
297
|
+
"build": "tsup && pnpm build:dts && pnpm build:ui-css",
|
|
298
|
+
"build:js": "tsup",
|
|
299
|
+
"build:dts": "tsc -p tsconfig.dts.json || echo '⚠️ DTS generation completed with some type errors (partial coverage)'",
|
|
300
|
+
"build:ui-css": "node scripts/build/build-ui-css.mjs",
|
|
301
|
+
"dev": "tsup --watch",
|
|
302
|
+
"test": "jest",
|
|
303
|
+
"test:watch": "jest --watch",
|
|
304
|
+
"test:coverage": "jest --coverage"
|
|
305
|
+
},
|
|
294
306
|
"peerDependencies": {
|
|
295
307
|
"next": ">=14.0.0",
|
|
296
308
|
"react": ">=18.0.0",
|
|
@@ -386,16 +398,5 @@
|
|
|
386
398
|
"tailwind-merge": "^3.3.1",
|
|
387
399
|
"uuid": "^13.0.0",
|
|
388
400
|
"zod": "^4.1.5"
|
|
389
|
-
},
|
|
390
|
-
"scripts": {
|
|
391
|
-
"postinstall": "node scripts/postinstall.mjs || true",
|
|
392
|
-
"build": "tsup && pnpm build:dts && pnpm build:ui-css",
|
|
393
|
-
"build:js": "tsup",
|
|
394
|
-
"build:dts": "tsc -p tsconfig.dts.json || echo '⚠️ DTS generation completed with some type errors (partial coverage)'",
|
|
395
|
-
"build:ui-css": "node scripts/build/build-ui-css.mjs",
|
|
396
|
-
"dev": "tsup --watch",
|
|
397
|
-
"test": "jest",
|
|
398
|
-
"test:watch": "jest --watch",
|
|
399
|
-
"test:coverage": "jest --coverage"
|
|
400
401
|
}
|
|
401
|
-
}
|
|
402
|
+
}
|