Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .dockerignore

This file was deleted.

6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask2agent.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/copilotDiffState.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 40 additions & 22 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.1/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
},
"ignore": [".next/", "out/", ".wrangler/", ".open-next/"]
},
"formatter": {
"enabled": true,
"indentWidth": 4,
"indentStyle": "tab",
"ignore": [".next/", "out/", ".wrangler/", ".open-next/"],
},
"javascript": {
"formatter": {
"bracketSpacing": true
}
}
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!node_modules", "!.next", "!dist", "!build"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"css": {
"parser": {
"tailwindDirectives": true
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noUnknownAtRules": "off"
}
},
"domains": {
"next": "recommended",
"react": "recommended"
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
1,339 changes: 1,339 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

Binary file removed bun.lockb
Binary file not shown.
2 changes: 0 additions & 2 deletions bunfig.toml

This file was deleted.

24 changes: 24 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"registries": {
"@animate-ui": "https://animate-ui.com/r/{name}.json"
}
}
19 changes: 19 additions & 0 deletions imgLoader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const optimizerUrl = process.env.NEXT_PUBLIC_IMAGE_OPTIMIZER_URL || "";
const hostname = process.env.CF_PAGES_URL;
Comment on lines +1 to +2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Validate required environment variables.

The loader relies on NEXT_PUBLIC_IMAGE_OPTIMIZER_URL and CF_PAGES_URL but doesn't validate their presence. If either is undefined or empty in production, the loader will generate malformed URLs, causing image loading failures.

Apply this diff to add validation:

 const optimizerUrl = process.env.NEXT_PUBLIC_IMAGE_OPTIMIZER_URL || "";
 const hostname = process.env.CF_PAGES_URL;
 
+if (process.env.NODE_ENV !== "development") {
+  if (!optimizerUrl) {
+    throw new Error("NEXT_PUBLIC_IMAGE_OPTIMIZER_URL is required in production");
+  }
+  if (!hostname) {
+    throw new Error("CF_PAGES_URL is required in production");
+  }
+}
+
 export default function ImageLoader({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const optimizerUrl = process.env.NEXT_PUBLIC_IMAGE_OPTIMIZER_URL || "";
const hostname = process.env.CF_PAGES_URL;
const optimizerUrl = process.env.NEXT_PUBLIC_IMAGE_OPTIMIZER_URL || "";
const hostname = process.env.CF_PAGES_URL;
if (process.env.NODE_ENV !== "development") {
if (!optimizerUrl) {
throw new Error("NEXT_PUBLIC_IMAGE_OPTIMIZER_URL is required in production");
}
if (!hostname) {
throw new Error("CF_PAGES_URL is required in production");
}
}
export default function ImageLoader({
🤖 Prompt for AI Agents
In imgLoader.ts around lines 1 to 2, the environment variables
NEXT_PUBLIC_IMAGE_OPTIMIZER_URL and CF_PAGES_URL are read but not validated; add
explicit checks after reading them to ensure they are non-empty strings and
throw a clear, early error (or call a startup logger and exit) if either is
missing so the loader never constructs malformed URLs; include which variable is
missing in the error message and fail fast in production builds to surface
configuration problems immediately.


export default function ImageLoader({
src,
width,
quality,
}: {
src: string;
width: number;
quality: number;
}) {
if (process.env.NODE_ENV === "development") {
return src;
}
const params = [`size=${width}`];
params.push(`quality=${quality || 75}`);
return `${optimizerUrl}/${encodeURIComponent(`${hostname}${src}`)}?${params.join("&")}`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix URL construction to handle edge cases.

The URL construction has several potential issues:

  1. CF_PAGES_URL may not include a protocol (e.g., "example.com" instead of "https://example.com")
  2. Concatenating ${hostname}${src} assumes hostname doesn't end with / and src starts with /
  3. If either assumption is violated, you'll get malformed URLs like "example.com//path" or "example.compath"

Apply this diff to make URL construction more robust:

+  const normalizedHostname = hostname?.replace(/\/$/, "") || "";
+  const normalizedSrc = src.startsWith("/") ? src : `/${src}`;
+  const fullPath = `${normalizedHostname}${normalizedSrc}`;
+
   const params = [`size=${width}`];
   params.push(`quality=${quality || 75}`);
-  return `${optimizerUrl}/${encodeURIComponent(`${hostname}${src}`)}?${params.join("&")}`;
+  return `${optimizerUrl}/${encodeURIComponent(fullPath)}?${params.join("&")}`;

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In imgLoader.ts around line 18, the URL is built by simply concatenating
optimizerUrl, hostname and src which breaks when CF_PAGES_URL lacks a protocol,
or when hostname ends with '/' or src starts with '/' (producing double slashes
or missing slash). Fix by normalizing the host to include a protocol (default to
"https://" if none), normalize/truncate leading/trailing slashes on hostname and
src (or use the URL API to set pathname) so they join with a single slash, and
ensure you pass a properly encoded path to encodeURIComponent or encode the full
URL via new URL(...) before encoding; then rebuild the final optimizer URL using
the normalized base so params.join("&") remains appended correctly.

}
9 changes: 8 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import createNextIntlPlugin from "next-intl/plugin";

const withNextIntl = createNextIntlPlugin();

const nextConfig = {};
const nextConfig = {
output: "export",
images: {
loader: "custom",
loaderFile: "./imgLoader.ts",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Incorrect path to image loader file.

The loaderFile path is set to "./imgLoader.ts", but based on the file structure, the loader is located at "./src/imgLoader.ts". This mismatch will cause a build failure when Next.js attempts to load the custom image loader.

Apply this diff to correct the path:

-    loaderFile: "./imgLoader.ts",
+    loaderFile: "./src/imgLoader.ts",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
loaderFile: "./imgLoader.ts",
loaderFile: "./src/imgLoader.ts",
🤖 Prompt for AI Agents
In next.config.mjs around line 11, the loaderFile path is incorrect
("./imgLoader.ts") and should point to "./src/imgLoader.ts"; update the
loaderFile value to "./src/imgLoader.ts" so Next.js can locate the custom image
loader and avoid build failure.

},
reactCompiler: true,
};

export default withNextIntl(nextConfig);
8 changes: 0 additions & 8 deletions open-next.config.ts

This file was deleted.

108 changes: 56 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
{
"name": "mikn-dev",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "NODE_OPTIONS='--inspect' next dev --turbo",
"format": "biome format --write .",
"lint": "next lint",
"start": "next start",
"preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview",
"deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy",
"upload": "opennextjs-cloudflare build && opennextjs-cloudflare upload",
"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"
},
"dependencies": {
"@opennextjs/cloudflare": "^1.0.4",
"@pixiv/three-vrm": "^3.3.4",
"@pixiv/three-vrm-animation": "^3.3.4",
"@react-three/fiber": "^9.1.2",
"@swetrix/nextjs": "^1.0.1",
"@tailwindcss/postcss": "^4.1.7",
"@types/three": "^0.176.0",
"caniuse-lite": "^1.0.30001664",
"clsx": "^2.1.1",
"daisyui": "^5.0.0",
"motion": "^11.15.0",
"next": "^15.3.2",
"next-intl": "^4.1.0",
"next-themes": "^0.4.4",
"postcss": "^8.5.3",
"react": "^19.1.0",
"react-cookie-consent": "^9.0.0",
"react-dom": "^19.1.0",
"react-icons": "^5.2.1",
"react-use": "^17.6.0",
"sharp": "^0.33.5",
"shiki": "^1.24.4",
"sonner": "^1.7.1",
"tailwind-merge": "^2.6.0",
"tailwind-variants": "^0.3.0",
"three": "^0.176.0"
},
"devDependencies": {
"@biomejs/biome": "^1.5.1",
"@opennextjs/aws": "^3.6.4",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"tailwindcss": "^4.1.7",
"typescript": "^5",
"wrangler": "^4.16.1"
}
"name": "mikn-dev",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev --turbo",
"format": "biome format --write .",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@c15t/nextjs": "^1.7.1",
"@c15t/scripts": "^1.0.0",
"@pixiv/three-vrm": "^3.3.4",
"@pixiv/three-vrm-animation": "^3.3.4",
"@radix-ui/react-slot": "^1.2.3",
"@react-three/drei": "^10.7.6",
"@react-three/fiber": "^9.4.0",
"@swetrix/nextjs": "^1.0.1",
"@tailwindcss/postcss": "^4.1.7",
"@types/three": "^0.176.0",
"babel-plugin-react-compiler": "^1.0.0",
"caniuse-lite": "^1.0.30001664",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"daisyui": "^5.0.0",
"gsap": "^3.13.0",
"lucide-react": "^0.548.0",
"maath": "^0.10.8",
"motion": "^12.23.24",
"next": "^16.0.0",
"next-intl": "^4.4.0",
"next-themes": "^0.4.4",
"postcss": "^8.5.3",
"radix-ui": "^1.4.3",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-icons": "^5.2.1",
"react-use": "^17.6.0",
"sharp": "^0.33.5",
"shiki": "^1.24.4",
"sonner": "^1.7.1",
"tailwind-merge": "^3.3.1",
"tailwind-variants": "^0.3.0",
"tailwindcss-animate": "^1.0.7",
"three": "^0.180.0",
"tw-animate-css": "^1.4.0"
},
"devDependencies": {
"@biomejs/biome": "^2.3.1",
"@types/node": "^20",
"@types/react": "^19.2.2",
"@types/react-dom": "^18",
"tailwindcss": "^4.1.7",
"typescript": "^5"
}
}
6 changes: 3 additions & 3 deletions postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = {
plugins: {
"@tailwindcss/postcss": {},
},
plugins: {
"@tailwindcss/postcss": {},
},
};
export default config;
4 changes: 2 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"]
}
9 changes: 0 additions & 9 deletions src/app/[locale]/about/page.tsx

This file was deleted.

Loading