@nextsparkjs/core 0.1.0-beta.136 → 0.1.0-beta.138
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/dashboard/block-editor/array-field.d.ts.map +1 -1
- package/dist/components/dashboard/block-editor/array-field.js +11 -0
- package/dist/lib/translations/registry.d.ts +5 -0
- package/dist/lib/translations/registry.d.ts.map +1 -1
- package/dist/lib/translations/registry.js +1 -0
- package/dist/providers/static-intl-provider.d.ts +9 -0
- package/dist/providers/static-intl-provider.d.ts.map +1 -0
- package/dist/providers/static-intl-provider.js +9 -0
- package/dist/styles/classes.json +1 -1
- package/dist/templates/app/(auth)/auth-error/page.tsx +0 -1
- package/dist/templates/app/(auth)/forgot-password/page.tsx +0 -1
- package/dist/templates/app/(auth)/layout.tsx +4 -1
- package/dist/templates/app/(auth)/login/page.tsx +0 -1
- package/dist/templates/app/(auth)/reset-password/page.tsx +0 -1
- package/dist/templates/app/(auth)/signup/page.tsx +10 -2
- package/dist/templates/app/(auth)/verify-email/page.tsx +0 -1
- package/dist/templates/app/(public)/[...slug]/page.tsx +15 -2
- package/dist/templates/app/(public)/layout.tsx +4 -1
- package/dist/templates/app/api/csp-report/route.ts +13 -9
- package/dist/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +3 -21
- package/dist/templates/app/dashboard/(main)/[entity]/page.tsx +3 -22
- package/dist/templates/app/dashboard/settings/password/page.tsx +0 -1
- package/dist/templates/app/devtools/blocks/page.tsx +10 -1
- package/dist/templates/app/devtools/config/page.tsx +10 -1
- package/dist/templates/app/devtools/features/page.tsx +10 -1
- package/dist/templates/app/devtools/flows/page.tsx +10 -1
- package/dist/templates/app/devtools/page.tsx +10 -1
- package/dist/templates/app/devtools/tags/page.tsx +10 -1
- package/dist/templates/app/devtools/tests/[[...path]]/page.tsx +10 -1
- package/dist/templates/app/layout.ppr.tsx +105 -0
- package/dist/templates/app/superadmin/docs/[section]/[page]/page.tsx +3 -5
- package/dist/templates/next.config.mjs +3 -0
- package/package.json +2 -2
- package/scripts/build/registry/__tests__/translation-registry-ppr.test.mjs +118 -0
- package/scripts/build/registry/generators/translation-registry.mjs +113 -2
- package/templates/app/(auth)/auth-error/page.tsx +0 -1
- package/templates/app/(auth)/forgot-password/page.tsx +0 -1
- package/templates/app/(auth)/layout.tsx +4 -1
- package/templates/app/(auth)/login/page.tsx +0 -1
- package/templates/app/(auth)/reset-password/page.tsx +0 -1
- package/templates/app/(auth)/signup/page.tsx +10 -2
- package/templates/app/(auth)/verify-email/page.tsx +0 -1
- package/templates/app/(public)/[...slug]/page.tsx +15 -2
- package/templates/app/(public)/layout.tsx +4 -1
- package/templates/app/api/csp-report/route.ts +13 -9
- package/templates/app/dashboard/(main)/[entity]/[id]/page.tsx +3 -21
- package/templates/app/dashboard/(main)/[entity]/page.tsx +3 -22
- package/templates/app/dashboard/settings/password/page.tsx +0 -1
- package/templates/app/devtools/blocks/page.tsx +10 -1
- package/templates/app/devtools/config/page.tsx +10 -1
- package/templates/app/devtools/features/page.tsx +10 -1
- package/templates/app/devtools/flows/page.tsx +10 -1
- package/templates/app/devtools/page.tsx +10 -1
- package/templates/app/devtools/tags/page.tsx +10 -1
- package/templates/app/devtools/tests/[[...path]]/page.tsx +10 -1
- package/templates/app/layout.ppr.tsx +105 -0
- package/templates/app/superadmin/docs/[section]/[page]/page.tsx +3 -5
- package/templates/next.config.mjs +3 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Suspense } from "react";
|
|
1
2
|
import { TagsOverview } from "@nextsparkjs/core/components/devtools/TagsOverview";
|
|
2
3
|
import { Tag } from "lucide-react";
|
|
3
4
|
import { getTranslations } from "next-intl/server";
|
|
@@ -8,7 +9,7 @@ import { getTranslations } from "next-intl/server";
|
|
|
8
9
|
* Displays all test tags organized by category.
|
|
9
10
|
* Provides search and copy-to-clipboard functionality.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
async function DevTagsPageContent() {
|
|
12
13
|
const t = await getTranslations("devtools.tags");
|
|
13
14
|
|
|
14
15
|
return (
|
|
@@ -29,3 +30,11 @@ export default async function DevTagsPage() {
|
|
|
29
30
|
</div>
|
|
30
31
|
);
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
export default function DevTagsPage() {
|
|
35
|
+
return (
|
|
36
|
+
<Suspense fallback={null}>
|
|
37
|
+
<DevTagsPageContent />
|
|
38
|
+
</Suspense>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Suspense } from "react";
|
|
1
2
|
import { TestCasesViewer } from "@nextsparkjs/core/components/devtools";
|
|
2
3
|
import { FileText } from "lucide-react";
|
|
3
4
|
import { getTranslations } from "next-intl/server";
|
|
@@ -17,7 +18,7 @@ interface DevTestsPageProps {
|
|
|
17
18
|
* - /dev/tests/auth/login-logout.bdd.md → File selected
|
|
18
19
|
* - /dev/tests/page-builder/admin/block-editor.bdd.md → Nested file
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
async function DevTestsPageContent({ params }: DevTestsPageProps) {
|
|
21
22
|
const { path } = await params;
|
|
22
23
|
const t = await getTranslations("dev.tests");
|
|
23
24
|
|
|
@@ -45,3 +46,11 @@ export default async function DevTestsPage({ params }: DevTestsPageProps) {
|
|
|
45
46
|
</div>
|
|
46
47
|
);
|
|
47
48
|
}
|
|
49
|
+
|
|
50
|
+
export default function DevTestsPage({ params }: DevTestsPageProps) {
|
|
51
|
+
return (
|
|
52
|
+
<Suspense fallback={null}>
|
|
53
|
+
<DevTestsPageContent params={params} />
|
|
54
|
+
</Suspense>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root Layout — PPR-compatible (Partial Prerendering)
|
|
3
|
+
*
|
|
4
|
+
* Fully static: no async data fetching in the root layout.
|
|
5
|
+
* The PPR static shell (html/body/fonts/content) renders instantly from CDN.
|
|
6
|
+
*
|
|
7
|
+
* Prerequisites:
|
|
8
|
+
* - Next.js 16.2.2+ with cacheComponents: true in next.config
|
|
9
|
+
* - Run `pnpm build:registries` to generate PPR exports
|
|
10
|
+
* - See docs/migration-ppr.md for full migration guide
|
|
11
|
+
*
|
|
12
|
+
* Key differences from the default async layout:
|
|
13
|
+
* - Layout is sync (not async) — enables PPR static shell
|
|
14
|
+
* - Uses StaticIntlProvider instead of NextIntlClientProvider
|
|
15
|
+
* - Messages/locale/theme mode are pre-merged at build time via registry
|
|
16
|
+
* - No PluginService.initializeAll() — plugins initialize on-demand
|
|
17
|
+
*
|
|
18
|
+
* Generated by @nextspark/core
|
|
19
|
+
* Regenerate with: npx nextspark generate
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { Metadata } from "next"
|
|
23
|
+
import { Suspense } from "react"
|
|
24
|
+
import { Geist, Geist_Mono } from "next/font/google"
|
|
25
|
+
|
|
26
|
+
import "./globals.css"
|
|
27
|
+
import { getBillingResourceHints } from "@nextsparkjs/core/lib/billing/gateways/factory"
|
|
28
|
+
import { StaticIntlProvider } from "@nextsparkjs/core/providers/static-intl-provider"
|
|
29
|
+
import { QueryProvider } from "@nextsparkjs/core/providers/query-provider"
|
|
30
|
+
import { ThemeProvider as NextThemeProvider } from "@nextsparkjs/core/providers/theme-provider"
|
|
31
|
+
import { ThemeProvider as CustomThemeProvider } from "@nextsparkjs/core/lib/theme/ThemeProvider"
|
|
32
|
+
import { TeamProvider } from "@nextsparkjs/core/contexts/TeamContext"
|
|
33
|
+
import { SubscriptionProvider } from "@nextsparkjs/core/contexts/SubscriptionContext"
|
|
34
|
+
import { Toaster } from "@nextsparkjs/core/components/ui/sonner"
|
|
35
|
+
import { getMetadataOrDefault } from '@nextsparkjs/core/lib/template-resolver'
|
|
36
|
+
import { DEFAULT_LOCALE, DEFAULT_THEME_MODE, STATIC_MESSAGES } from '@nextsparkjs/registries/translation-registry'
|
|
37
|
+
|
|
38
|
+
const geistSans = Geist({
|
|
39
|
+
variable: "--font-geist-sans",
|
|
40
|
+
subsets: ["latin"],
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const geistMono = Geist_Mono({
|
|
44
|
+
variable: "--font-geist-mono",
|
|
45
|
+
subsets: ["latin"],
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const defaultMetadata: Metadata = {
|
|
49
|
+
title: "NextSpark App",
|
|
50
|
+
description: "Built with NextSpark",
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const metadata: Metadata = getMetadataOrDefault(
|
|
54
|
+
'app/layout.tsx',
|
|
55
|
+
defaultMetadata
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
export default function RootLayout({
|
|
59
|
+
children,
|
|
60
|
+
}: Readonly<{
|
|
61
|
+
children: React.ReactNode
|
|
62
|
+
}>) {
|
|
63
|
+
return (
|
|
64
|
+
<html lang={DEFAULT_LOCALE} suppressHydrationWarning>
|
|
65
|
+
<head>
|
|
66
|
+
{(() => {
|
|
67
|
+
const hints = getBillingResourceHints()
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
{hints.preconnect.map((domain) => (
|
|
71
|
+
<link key={`pre-${domain}`} rel="preconnect" href={domain} />
|
|
72
|
+
))}
|
|
73
|
+
{[...hints.preconnect, ...hints.dnsPrefetch].map((domain) => (
|
|
74
|
+
<link key={`dns-${domain}`} rel="dns-prefetch" href={domain} />
|
|
75
|
+
))}
|
|
76
|
+
</>
|
|
77
|
+
)
|
|
78
|
+
})()}
|
|
79
|
+
</head>
|
|
80
|
+
<body
|
|
81
|
+
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
82
|
+
>
|
|
83
|
+
<StaticIntlProvider locale={DEFAULT_LOCALE} messages={STATIC_MESSAGES}>
|
|
84
|
+
<NextThemeProvider
|
|
85
|
+
attribute="class"
|
|
86
|
+
defaultTheme={DEFAULT_THEME_MODE}
|
|
87
|
+
enableSystem={DEFAULT_THEME_MODE === 'system'}
|
|
88
|
+
disableTransitionOnChange
|
|
89
|
+
>
|
|
90
|
+
<CustomThemeProvider>
|
|
91
|
+
<QueryProvider>
|
|
92
|
+
<TeamProvider>
|
|
93
|
+
<SubscriptionProvider>
|
|
94
|
+
<main>{children}</main>
|
|
95
|
+
<Suspense><Toaster position="bottom-left" /></Suspense>
|
|
96
|
+
</SubscriptionProvider>
|
|
97
|
+
</TeamProvider>
|
|
98
|
+
</QueryProvider>
|
|
99
|
+
</CustomThemeProvider>
|
|
100
|
+
</NextThemeProvider>
|
|
101
|
+
</StaticIntlProvider>
|
|
102
|
+
</body>
|
|
103
|
+
</html>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
@@ -39,12 +39,10 @@ export async function generateMetadata({ params }: SuperadminDocsPageProps): Pro
|
|
|
39
39
|
const page = section.pages.find(p => p.slug === pageSlug)
|
|
40
40
|
if (!page) return { title: 'Page Not Found' }
|
|
41
41
|
|
|
42
|
-
const
|
|
43
|
-
const { metadata } = await parseMarkdownFile(filePath)
|
|
44
|
-
|
|
42
|
+
const title = page.title || pageSlug.replace(/-/g, ' ')
|
|
45
43
|
return {
|
|
46
|
-
title: `${
|
|
47
|
-
description:
|
|
44
|
+
title: `${title} | Admin Docs`,
|
|
45
|
+
description: `Admin documentation for ${title}`,
|
|
48
46
|
robots: 'noindex, nofollow'
|
|
49
47
|
}
|
|
50
48
|
}
|