From 40eb1e0a4aa537a7411464ba1199aeb0111907ff Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 11:28:51 +0000 Subject: [PATCH 1/3] Initial plan From dd7a071fb8061007fe5ca0a5cc9f372e5c33cd66 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 11:31:27 +0000 Subject: [PATCH 2/3] fix: address Node.js version requirements and metadata validation - Remove hardcoded openGraph.url to let it derive from metadataBase - Add validation for NEXT_PUBLIC_SITE_URL to ensure valid URL format - Update README badge from Node.js 18+ to 18.18.0+ - Add engines.node field to package.json (>=18.18.0) - Update CI workflow to use Node 18.18.x instead of 18.x Co-authored-by: dawidope <1847552+dawidope@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- README.md | 2 +- package.json | 3 +++ src/app/layout.tsx | 20 ++++++++++++++++---- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94fad9c..90d033d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: ['18.x', '20.x'] + node-version: ['18.18.x', '20.x'] steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index d057f70..003737b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # deAPI Tester [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![Node.js 18+](https://img.shields.io/badge/Node.js-18%2B-green.svg)](https://nodejs.org/) +[![Node.js 18.18.0+](https://img.shields.io/badge/Node.js-18.18.0%2B-green.svg)](https://nodejs.org/) [![Next.js 15](https://img.shields.io/badge/Next.js-15-black.svg)](https://nextjs.org/) [![Docker](https://img.shields.io/badge/Docker-ready-blue.svg)](https://www.docker.com/) diff --git a/package.json b/package.json index 0adc4b2..ffc85f5 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "url": "https://deapi.ai" }, "license": "MIT", + "engines": { + "node": ">=18.18.0" + }, "repository": { "type": "git", "url": "https://github.com/deapi-ai/deapi-tester.git" diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a836226..bfdb090 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,10 +2,23 @@ import type { Metadata } from 'next'; import './globals.css'; import { Providers } from '@/components/Providers'; +function getMetadataBaseUrl(): string { + const siteUrl = process.env.NEXT_PUBLIC_SITE_URL; + if (!siteUrl) { + return 'http://localhost:3000'; + } + // Ensure URL has a protocol + if (!/^https?:\/\//i.test(siteUrl)) { + console.warn( + `NEXT_PUBLIC_SITE_URL missing protocol, defaulting to localhost: ${siteUrl}` + ); + return 'http://localhost:3000'; + } + return siteUrl; +} + export const metadata: Metadata = { - metadataBase: new URL( - process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000' - ), + metadataBase: new URL(getMetadataBaseUrl()), title: 'deAPI Tester — Test AI Inference Endpoints', description: 'Local developer tool for testing deAPI.ai endpoints. Generate images, videos, audio and more with dynamic forms, async job tracking, and result preview.', @@ -24,7 +37,6 @@ export const metadata: Metadata = { description: 'Test deAPI.ai endpoints locally with dynamic forms, async job tracking, price calculator and result preview.', type: 'website', - url: 'https://github.com/deapi-ai/deapi-tester', siteName: 'deAPI Tester', images: ['/og-image.png'], }, From 403d7fdc45719b72dea78f635262163f520ee95f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Feb 2026 11:32:22 +0000 Subject: [PATCH 3/3] refine: improve warning message clarity for invalid NEXT_PUBLIC_SITE_URL Co-authored-by: dawidope <1847552+dawidope@users.noreply.github.com> --- src/app/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index bfdb090..422927f 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -10,7 +10,7 @@ function getMetadataBaseUrl(): string { // Ensure URL has a protocol if (!/^https?:\/\//i.test(siteUrl)) { console.warn( - `NEXT_PUBLIC_SITE_URL missing protocol, defaulting to localhost: ${siteUrl}` + `NEXT_PUBLIC_SITE_URL ('${siteUrl}') missing protocol. Using default: http://localhost:3000` ); return 'http://localhost:3000'; }