Skip to content
4 changes: 2 additions & 2 deletions config/registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"format": "biome format --write ."
},
"devDependencies": {
"@biomejs/biome": "2.4.15"
"@biomejs/biome": "2.5.0"
}
}
},
Expand Down Expand Up @@ -236,7 +236,7 @@
"lint": "biome lint ."
},
"devDependencies": {
"@biomejs/biome": "2.4.15"
"@biomejs/biome": "2.5.0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/
16 changes: 11 additions & 5 deletions config/templates/base/astro/astro.config.mjs.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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}}
});
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/
15 changes: 15 additions & 0 deletions config/templates/deploy/cloudflare-workers/wrangler.jsonc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion config/templates/fmt/biome/biome.json.tmpl
Original file line number Diff line number Diff line change
@@ -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": [
"**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Button = () => {
<span>
Count: {count}
</span>
<button onClick={handleClick}>
<button type="button" onClick={handleClick}>
Click me
</button>
</>
Expand Down
2 changes: 1 addition & 1 deletion config/templates/integration/vite/react/src/app.tsx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const App = () => {
<span>
Count: {{ "{ count }" }}
</span>
<button onClick={handleClick}>Click me</button>
<button type="button" onClick={handleClick}>Click me</button>
</div>
</main>
);
Expand Down
2 changes: 2 additions & 0 deletions config/templates/linter/eslint/eslint.config.mjs.tmpl
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
5 changes: 4 additions & 1 deletion pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
15 changes: 12 additions & 3 deletions pkg/packagejson.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
}

}