-
-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Refactor #31
Changes from 8 commits
bac56d4
715a5e6
7abd5fc
f4f6e38
89eab1a
01c4b09
2cce34b
e04bede
10faa41
4a06599
5636047
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| 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" | ||
| } | ||
| } | ||
| } | ||
| } | ||
Large diffs are not rendered by default.
This file was deleted.
| 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" | ||
| } | ||
| } |
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate required environment variables. The loader relies on 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| 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("&")}`; | ||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix URL construction to handle edge cases. The URL construction has several potential issues:
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("&")}`;
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect path to image loader file. The Apply this diff to correct the path: - loaderFile: "./imgLoader.ts",
+ loaderFile: "./src/imgLoader.ts",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| }, | ||||||
| reactCompiler: true, | ||||||
| }; | ||||||
|
|
||||||
| export default withNextIntl(nextConfig); | ||||||
This file was deleted.
| 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", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update React DOM types to match React DOM 19. The project uses Apply this diff: - "@types/react-dom": "^18",
+ "@types/react-dom": "^19",Then regenerate your lockfile and run the typechecker to verify compatibility. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "tailwindcss": "^4.1.7", | ||||||
| "typescript": "^5" | ||||||
| } | ||||||
| } | ||||||
| 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; |
| 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"] | ||
| } |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify
files.includesnegation supportConfirm Biome v2.2 supports negation with
!infiles.includes. If not, switch tofiles.ignorefor.next,dist,build, andnode_modules.🌐 Web query:
💡 Result:
Short answer: Yes — Biome supports negated patterns starting with "!" in files.includes (but you must precede them with a "**" include). For generated/output folders prefer the force-ignore "!!" syntax so they are completely excluded from indexing. Node modules are ignored by default. [1][2][3]
Recommended biome.json snippet (concise):
{
"files": {
"includes": [
"",
"!/.next",
"!!/dist",
"!!/build",
"!**/node_modules"
]
}
}
Notes:
Update
files.includespatterns to use proper glob syntax and force-ignore for build outputsThe negation patterns lack the required path prefix. Update to:
Use
!!(force-ignore) fordistandbuildto prevent indexing of generated output folders. Add**/before each negation pattern for correct glob matching.🤖 Prompt for AI Agents