@djangocfg/nextjs 2.1.10 → 2.1.14

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/index.d.mts CHANGED
@@ -3,8 +3,6 @@ export { HealthCheck, HealthConfig, createHealthHandler } from './health/index.m
3
3
  export { OgImageHandlerConfig, createOgImageDynamicRoute, createOgImageHandler } from './og-image/index.mjs';
4
4
  export { DefaultTemplate, LightTemplate, OgImageTemplateProps } from './og-image/components/index.mjs';
5
5
  export { FontConfig, OgImageMetadataOptions, OgImageUrlParams, createFontLoader, createOgImageMetadataGenerator, createOgImageUrlBuilder, decodeBase64, encodeBase64, generateOgImageMetadata, generateOgImageUrl, getAbsoluteOgImageUrl, loadGoogleFont, loadGoogleFonts, parseOgImageData, parseOgImageUrl } from './og-image/utils/index.mjs';
6
- export { SubmitContactFormOptions, SubmitContactFormResult, submitContactForm } from './contact/index.mjs';
7
- export { ContactRouteOptions, POST, createContactRoute } from './contact/route.mjs';
8
6
  export { BreadcrumbItem, MenuGroup, MenuItem, NavigationItem, NavigationSection, RouteDefinition, RouteMetadata, defineRoute, findRoute, findRouteByPattern, getPageTitle, getUnauthenticatedRedirect, isActive, redirectToAuth, routesToMenuItems } from './navigation/index.mjs';
9
7
  export { BaseNextConfigOptions, CompressionPluginOptions, DEFAULT_OPTIMIZE_PACKAGES, DEFAULT_TRANSPILE_PACKAGES, DJANGOCFG_PACKAGES, DJANGO_CFG_BANNER, DevStartupPlugin, DevStartupPluginOptions, InstallOptions, InstallProgress, MissingPackage, OPTIONAL_PACKAGES, PACKAGE_NAME, PEER_DEPENDENCIES, PackageDefinition, PackageVersion, UpdateOptions, addCompressionPlugins, buildInstallCommand, buildSingleInstallCommand, checkAndInstallPackages, checkAndUpdatePackages, checkForUpdate, checkForUpdates, checkPackages, createBaseNextConfig, deepMerge, detectPackageManager, fetchLatestVersion, getApiUrl, getBasePath, getCurrentVersion, getInstalledVersion, getMissingPackages, getOutdatedPackages, getPackagesForContext, getSiteUrl, getUpdateCommand, installPackages, installPackagesWithProgress, isCI, isCompressionAvailable, isDev, isPackageInstalled, isProduction, isStaticBuild, printVersionInfo, resetDevStartupState, resetInstallerPreferences, resetUpdaterPreferences, updatePackagesWithProgress } from './config/index.mjs';
10
8
  export { A as AI_DOCS_HINT, c as AI_HINT, b as MCP_API_URL, M as MCP_BASE_URL, a as MCP_SERVER_URL } from './constants-HezbftFb.mjs';
@@ -14,6 +12,5 @@ import 'next/server';
14
12
  import 'next/og';
15
13
  import 'react';
16
14
  import 'next';
17
- import '@djangocfg/api/server';
18
15
  import 'lucide-react';
19
16
  import 'webpack';
package/dist/index.mjs CHANGED
@@ -14,14 +14,13 @@ var require_package = __commonJS({
14
14
  "package.json"(exports, module) {
15
15
  module.exports = {
16
16
  name: "@djangocfg/nextjs",
17
- version: "2.1.10",
17
+ version: "2.1.14",
18
18
  description: "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
19
19
  keywords: [
20
20
  "nextjs",
21
21
  "sitemap",
22
22
  "health",
23
23
  "og-image",
24
- "contact",
25
24
  "navigation",
26
25
  "config",
27
26
  "react",
@@ -74,11 +73,6 @@ var require_package = __commonJS({
74
73
  import: "./src/og-image/components/index.ts",
75
74
  default: "./src/og-image/components/index.ts"
76
75
  },
77
- "./contact": {
78
- types: "./src/contact/index.ts",
79
- import: "./src/contact/index.ts",
80
- default: "./src/contact/index.ts"
81
- },
82
76
  "./navigation": {
83
77
  types: "./src/navigation/index.ts",
84
78
  import: "./src/navigation/index.ts",
@@ -119,7 +113,6 @@ var require_package = __commonJS({
119
113
  "ai-docs": "tsx src/ai/cli.ts"
120
114
  },
121
115
  peerDependencies: {
122
- "@djangocfg/api": "workspace:*",
123
116
  next: "^15.5.7"
124
117
  },
125
118
  devDependencies: {
@@ -1065,99 +1058,6 @@ function createOgImageDynamicRoute(config) {
1065
1058
  };
1066
1059
  }
1067
1060
 
1068
- // src/contact/submit.ts
1069
- import { API, MemoryStorageAdapter, Fetchers } from "@djangocfg/api/server";
1070
- async function submitContactForm({
1071
- data,
1072
- apiUrl,
1073
- siteUrl
1074
- }) {
1075
- if (!data.name || !data.email || !data.message) {
1076
- throw new Error("Missing required fields: name, email, message");
1077
- }
1078
- if (!apiUrl) {
1079
- throw new Error("API URL is required");
1080
- }
1081
- const serverApi = new API(apiUrl, {
1082
- storage: new MemoryStorageAdapter()
1083
- });
1084
- const submissionData = {
1085
- ...data,
1086
- site_url: data.site_url || siteUrl
1087
- };
1088
- try {
1089
- const result = await Fetchers.createLeadsSubmitCreate(submissionData, serverApi);
1090
- return {
1091
- success: result.success ?? true,
1092
- message: result.message || "Contact form submitted successfully",
1093
- lead_id: result.lead_id
1094
- };
1095
- } catch (error) {
1096
- if (error instanceof Error) {
1097
- throw new Error(`Failed to submit contact form: ${error.message}`);
1098
- }
1099
- throw new Error("An unexpected error occurred while submitting the contact form");
1100
- }
1101
- }
1102
-
1103
- // src/contact/route.ts
1104
- import { NextResponse as NextResponse3 } from "next/server";
1105
- function createContactRoute(options) {
1106
- return async function POST2(request) {
1107
- try {
1108
- const body = await request.json();
1109
- const apiUrl = body._apiUrl && body._apiUrl !== "" ? body._apiUrl : options?.apiUrl || process.env.NEXT_PUBLIC_API_URL || "";
1110
- if (!apiUrl) {
1111
- return NextResponse3.json(
1112
- {
1113
- success: false,
1114
- message: "API URL not configured. Set NEXT_PUBLIC_API_URL, provide apiUrl option, or pass _apiUrl in request body."
1115
- },
1116
- { status: 500 }
1117
- );
1118
- }
1119
- const { _apiUrl, ...submissionData } = body;
1120
- const response = await submitContactForm({
1121
- data: submissionData,
1122
- apiUrl,
1123
- siteUrl: request.headers.get("origin") || void 0
1124
- });
1125
- return NextResponse3.json(response);
1126
- } catch (error) {
1127
- console.error("Contact form submission error:", error);
1128
- if (error instanceof Error && error.message.includes("Missing required fields")) {
1129
- return NextResponse3.json(
1130
- {
1131
- success: false,
1132
- message: error.message
1133
- },
1134
- { status: 400 }
1135
- );
1136
- }
1137
- if (error instanceof Error) {
1138
- return NextResponse3.json(
1139
- {
1140
- success: false,
1141
- message: error.message || "Failed to submit contact form"
1142
- },
1143
- { status: 500 }
1144
- );
1145
- }
1146
- return NextResponse3.json(
1147
- {
1148
- success: false,
1149
- message: "An unexpected error occurred"
1150
- },
1151
- { status: 500 }
1152
- );
1153
- }
1154
- };
1155
- }
1156
- async function POST(request) {
1157
- const handler = createContactRoute();
1158
- return handler(request);
1159
- }
1160
-
1161
1061
  // src/navigation/utils.ts
1162
1062
  function defineRoute(path, metadata) {
1163
1063
  return {
@@ -1236,7 +1136,6 @@ var DEFAULT_TRANSPILE_PACKAGES = [
1236
1136
  "@djangocfg/ui-core",
1237
1137
  "@djangocfg/ui-nextjs",
1238
1138
  "@djangocfg/layouts",
1239
- "@djangocfg/nextjs",
1240
1139
  "@djangocfg/api",
1241
1140
  "@djangocfg/centrifugo"
1242
1141
  ];
@@ -2266,6 +2165,8 @@ function createBaseNextConfig(options = {}) {
2266
2165
  NEXT_PUBLIC_BASE_PATH: basePath,
2267
2166
  NEXT_PUBLIC_API_URL: apiUrl,
2268
2167
  NEXT_PUBLIC_SITE_URL: siteUrl,
2168
+ // Disable Next.js telemetry (Next.js 15+ uses env var instead of config option)
2169
+ NEXT_TELEMETRY_DISABLED: "1",
2269
2170
  ...options.env
2270
2171
  },
2271
2172
  // Images configuration
@@ -2494,7 +2395,6 @@ export {
2494
2395
  OPTIONAL_PACKAGES,
2495
2396
  PACKAGE_NAME,
2496
2397
  PEER_DEPENDENCIES,
2497
- POST,
2498
2398
  addCompressionPlugins,
2499
2399
  buildInstallCommand,
2500
2400
  buildSingleInstallCommand,
@@ -2504,7 +2404,6 @@ export {
2504
2404
  checkForUpdates,
2505
2405
  checkPackages,
2506
2406
  createBaseNextConfig,
2507
- createContactRoute,
2508
2407
  createFontLoader,
2509
2408
  createHealthHandler,
2510
2409
  createOgImageDynamicRoute,
@@ -2559,7 +2458,6 @@ export {
2559
2458
  resetUpdaterPreferences,
2560
2459
  routesToMenuItems,
2561
2460
  search,
2562
- submitContactForm,
2563
2461
  updatePackagesWithProgress
2564
2462
  };
2565
2463
  //# sourceMappingURL=index.mjs.map