From 75cb702a34795eca3b4c1ce0010020d4d717f84a Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 4 Jun 2026 05:47:38 +0000 Subject: [PATCH 1/5] Initial commit for the issue #69 From e77571f1b6fc419e36f433e4bda540467cd414b8 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 10 Jun 2026 06:37:34 +0000 Subject: [PATCH 2/5] Initial commit for the issue #71 From 92314a7f0bdcbbce82e596ba24f8e601297bf346 Mon Sep 17 00:00:00 2001 From: amirahosbr Date: Wed, 10 Jun 2026 15:26:48 +0800 Subject: [PATCH 3/5] fix: correct state update logic in App component - Changed the state update function in the App component from using `state += 1` to `state + 1` for proper state management in React. --- config/templates/integration/vite/react/src/app.tsx.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/templates/integration/vite/react/src/app.tsx.tmpl b/config/templates/integration/vite/react/src/app.tsx.tmpl index d949692..04efc31 100644 --- a/config/templates/integration/vite/react/src/app.tsx.tmpl +++ b/config/templates/integration/vite/react/src/app.tsx.tmpl @@ -4,7 +4,7 @@ const App = () => { const [count, setCount] = useState(0); const handleClick = () => { - setCount((state) => state += 1); + setCount((state) => state + 1); } return ( From e4fcb6b53be46100e5516445b8bdcebd3672e06b Mon Sep 17 00:00:00 2001 From: amirahosbr Date: Tue, 7 Jul 2026 10:33:11 +0800 Subject: [PATCH 4/5] feat: add Cloudflare deployment support for Astro base - inject @astrojs/cloudflare adapter in astro.config when deploying to cloudflare-pages/workers, and add the Astro wrangler.jsonc config block - auto-add @astrojs/cloudflare devDependency for Astro + Cloudflare - fix eslint deps: globals and typescript-eslint now required for all eslint projects; React plugins gated on IsReactInt (covers astro-react) - template .gitignore files as .gitignore.tmpl so they render correctly - bump @biomejs/biome 2.4.15 -> 2.5.0 - add type="button" to React button templates Co-Authored-By: Claude Opus 4.8 (1M context) --- config/registry.json | 4 ++-- .../base/astro/{.gitignore => .gitignore.tmpl} | 13 +++++++++++++ .../templates/base/astro/astro.config.mjs.tmpl | 16 +++++++++++----- .../base/nuxt/{.gitignore => .gitignore.tmpl} | 14 ++++++++++++-- .../base/vite/{.gitignore => .gitignore.tmpl} | 13 +++++++++++++ .../cloudflare-workers/wrangler.jsonc.tmpl | 15 +++++++++++++++ config/templates/fmt/biome/biome.json.tmpl | 2 +- .../astro/react/src/components/react/button.tsx | 2 +- .../integration/vite/react/src/app.tsx.tmpl | 2 +- .../linter/eslint/eslint.config.mjs.tmpl | 2 ++ pkg/packagejson.go | 15 ++++++++++++--- 11 files changed, 83 insertions(+), 15 deletions(-) rename config/templates/base/astro/{.gitignore => .gitignore.tmpl} (64%) rename config/templates/base/nuxt/{.gitignore => .gitignore.tmpl} (57%) rename config/templates/base/vite/{.gitignore => .gitignore.tmpl} (63%) diff --git a/config/registry.json b/config/registry.json index cf6c9ae..b465bee 100644 --- a/config/registry.json +++ b/config/registry.json @@ -195,7 +195,7 @@ "format": "biome format --write ." }, "devDependencies": { - "@biomejs/biome": "2.4.15" + "@biomejs/biome": "2.5.0" } } }, @@ -236,7 +236,7 @@ "lint": "biome lint ." }, "devDependencies": { - "@biomejs/biome": "2.4.15" + "@biomejs/biome": "2.5.0" } } }, diff --git a/config/templates/base/astro/.gitignore b/config/templates/base/astro/.gitignore.tmpl similarity index 64% rename from config/templates/base/astro/.gitignore rename to config/templates/base/astro/.gitignore.tmpl index 16d54bb..b86c1a0 100644 --- a/config/templates/base/astro/.gitignore +++ b/config/templates/base/astro/.gitignore.tmpl @@ -19,6 +19,19 @@ pnpm-debug.log* # macOS-specific files .DS_Store +._* # jetbrains setting folder .idea/ + +# cloudflare / wrangler +.wrangler/ +.dev.vars + +# playwright +test-results/ +playwright-report/ +.playwright-mcp/ + +# lighthouse ci +.lighthouseci/ diff --git a/config/templates/base/astro/astro.config.mjs.tmpl b/config/templates/base/astro/astro.config.mjs.tmpl index ddb0345..877449f 100644 --- a/config/templates/base/astro/astro.config.mjs.tmpl +++ b/config/templates/base/astro/astro.config.mjs.tmpl @@ -9,6 +9,9 @@ import react from '@astrojs/react'; {{- if eq .CSS "tailwindcss"}} import tailwindcss from "@tailwindcss/vite"; {{- end}} +{{- if or (eq .Deployment "cloudflare-pages") (eq .Deployment "cloudflare-workers")}} +import cloudflare from '@astrojs/cloudflare'; +{{- end}} // https://astro.build/config export default defineConfig({ @@ -19,13 +22,16 @@ export default defineConfig({ MICROCMS_SERVICE_DOMAIN: envField.string({ context: 'server', access: 'secret'}), {{- end}} } - } -{{- if or (eq .Base "astro-vue") (eq .Base "astro-react")}} + }, + {{- if or (eq .Deployment "cloudflare-pages") (eq .Deployment "cloudflare-workers")}} + adapter: cloudflare(), + {{- end}} + {{- if or (eq .Base "astro-vue") (eq .Base "astro-react")}} integrations: [{{if eq .Base "astro-vue"}}vue(){{end}}{{if eq .Base "astro-react"}}react(){{end}}], -{{- end}} -{{- if eq .CSS "tailwindcss"}}, + {{- end}} + {{- if eq .CSS "tailwindcss"}} vite: { plugins: [tailwindcss()], }, -{{- end}} + {{- end}} }); diff --git a/config/templates/base/nuxt/.gitignore b/config/templates/base/nuxt/.gitignore.tmpl similarity index 57% rename from config/templates/base/nuxt/.gitignore rename to config/templates/base/nuxt/.gitignore.tmpl index 9cdea45..ca12357 100644 --- a/config/templates/base/nuxt/.gitignore +++ b/config/templates/base/nuxt/.gitignore.tmpl @@ -15,11 +15,21 @@ logs # Misc .DS_Store +._* .fleet .idea -# Wrangler -.wrangler +# cloudflare / wrangler +.wrangler/ +.dev.vars + +# playwright +test-results/ +playwright-report/ +.playwright-mcp/ + +# lighthouse ci +.lighthouseci/ # Local env files .env diff --git a/config/templates/base/vite/.gitignore b/config/templates/base/vite/.gitignore.tmpl similarity index 63% rename from config/templates/base/vite/.gitignore rename to config/templates/base/vite/.gitignore.tmpl index a547bf3..285aea6 100644 --- a/config/templates/base/vite/.gitignore +++ b/config/templates/base/vite/.gitignore.tmpl @@ -17,8 +17,21 @@ dist-ssr !.vscode/extensions.json .idea .DS_Store +._* *.suo *.ntvs* *.njsproj *.sln *.sw? + +# cloudflare / wrangler +.wrangler/ +.dev.vars + +# playwright +test-results/ +playwright-report/ +.playwright-mcp/ + +# lighthouse ci +.lighthouseci/ diff --git a/config/templates/deploy/cloudflare-workers/wrangler.jsonc.tmpl b/config/templates/deploy/cloudflare-workers/wrangler.jsonc.tmpl index 400b4f3..077b79c 100644 --- a/config/templates/deploy/cloudflare-workers/wrangler.jsonc.tmpl +++ b/config/templates/deploy/cloudflare-workers/wrangler.jsonc.tmpl @@ -12,6 +12,21 @@ "enabled": true } } +{{- else if .Base.IsAstro}} +{ + "$schema": "./node_modules/wrangler/config-schema.json", + "name": "{{.ProjectName}}", + "main": "@astrojs/cloudflare/entrypoints/server", + "compatibility_date": "{{.Date}}", + "compatibility_flags": ["nodejs_compat"], + "assets": { + "directory": "./dist", + "binding": "ASSETS" + }, + "observability": { + "enabled": true + } +} {{- else}} { "$schema": "./node_modules/wrangler/config-schema.json", diff --git a/config/templates/fmt/biome/biome.json.tmpl b/config/templates/fmt/biome/biome.json.tmpl index da871c3..0d3b9d0 100644 --- a/config/templates/fmt/biome/biome.json.tmpl +++ b/config/templates/fmt/biome/biome.json.tmpl @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.4.15/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.0/schema.json", "files": { "includes": [ "**", diff --git a/config/templates/integration/astro/react/src/components/react/button.tsx b/config/templates/integration/astro/react/src/components/react/button.tsx index 88e30e9..ae13799 100644 --- a/config/templates/integration/astro/react/src/components/react/button.tsx +++ b/config/templates/integration/astro/react/src/components/react/button.tsx @@ -10,7 +10,7 @@ const Button = () => { Count: {count} - diff --git a/config/templates/integration/vite/react/src/app.tsx.tmpl b/config/templates/integration/vite/react/src/app.tsx.tmpl index 04efc31..9fd2e6a 100644 --- a/config/templates/integration/vite/react/src/app.tsx.tmpl +++ b/config/templates/integration/vite/react/src/app.tsx.tmpl @@ -16,7 +16,7 @@ const App = () => { Count: {{ "{ count }" }} - + ); diff --git a/config/templates/linter/eslint/eslint.config.mjs.tmpl b/config/templates/linter/eslint/eslint.config.mjs.tmpl index 86fe819..ff5fc0c 100644 --- a/config/templates/linter/eslint/eslint.config.mjs.tmpl +++ b/config/templates/linter/eslint/eslint.config.mjs.tmpl @@ -1,7 +1,9 @@ import js from '@eslint/js' import globals from 'globals' +{{- if .Base.IsReactInt}} import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' +{{- end}} import tseslint from 'typescript-eslint' import { defineConfig, globalIgnores } from 'eslint/config' diff --git a/pkg/packagejson.go b/pkg/packagejson.go index a9f2503..3f87731 100644 --- a/pkg/packagejson.go +++ b/pkg/packagejson.go @@ -175,12 +175,16 @@ func applyCrossCuttingRules(pkg *packageJSON, cfg ProjectConfig) { pkg.DevDependencies["prettier-plugin-astro"] = "0.14.1" } - // eslint + vite-react → extra React eslint plugins - if cfg.Linter == "eslint" && cfg.Base == "vite-react" { + // eslint → globals and typescript-eslint always required by eslint.config.mjs + if cfg.Linter == "eslint" { pkg.DevDependencies["globals"] = "^17.4.0" + pkg.DevDependencies["typescript-eslint"] = "^8.58.0" + } + + // eslint + react integration → React eslint plugins + if cfg.Linter == "eslint" && cfg.Base.IsReactInt() { pkg.DevDependencies["eslint-plugin-react-hooks"] = "^7.0.1" pkg.DevDependencies["eslint-plugin-react-refresh"] = "^0.5.2" - pkg.DevDependencies["typescript-eslint"] = "^8.58.0" } // veevalidate + zod → @vee-validate/zod adapter @@ -198,4 +202,9 @@ func applyCrossCuttingRules(pkg *packageJSON, cfg ProjectConfig) { pkg.DevDependencies["vite"] = "^6.3.5" } + // astro + cloudflare -> @astrojs/cloudflare adapter + if cfg.Base.IsAstro() && (cfg.Deployment == "cloudflare-pages" || cfg.Deployment == "cloudflare-workers") { + pkg.DevDependencies["@astrojs/cloudflare"] = "^13.0.0" + } + } From a816eefce909b29b58e7e8381d5ffdc4b11eaaef Mon Sep 17 00:00:00 2001 From: amirahosbr Date: Tue, 7 Jul 2026 10:40:33 +0800 Subject: [PATCH 5/5] fix: correct inverted registry guard in GetIntegration GetIntegration returned an error whenever the registry WAS loaded (inverted nil check), so IsReactInt/IsVueInt always returned false. This regressed the eslint React-plugin rule for vite-react and blocked it for astro-react. Fix the guard and add an entry nil-check. Co-Authored-By: Claude Opus 4.8 (1M context) --- pkg/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/config.go b/pkg/config.go index b0a34bd..39ae432 100644 --- a/pkg/config.go +++ b/pkg/config.go @@ -87,11 +87,14 @@ func (b BaseFramework) IsVite() bool { } func (b BaseFramework) GetIntegration() (BaseIntegration, error) { - if globalRegistry != nil { + if globalRegistry == nil { return BaseIntegration(""), errors.New("unable to read registry") } entry := globalRegistry.GetBase(string(b)) + if entry == nil { + return BaseIntegration(""), errors.New("unknown base framework") + } return BaseIntegration(entry.Integration), nil }