@sibyllinesoft/arbiter 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +222 -0
- package/dist/cli.js +28718 -0
- package/dist/templates/plopfiles/__tests__/build-systems.test.ts +730 -0
- package/dist/templates/plopfiles/__tests__/e2e.test.ts +451 -0
- package/dist/templates/plopfiles/__tests__/generation.test.ts +384 -0
- package/dist/templates/plopfiles/__tests__/linting.test.ts +854 -0
- package/dist/templates/plopfiles/__tests__/modules.test.ts +278 -0
- package/dist/templates/plopfiles/__tests__/smoke.test.ts +619 -0
- package/dist/templates/plopfiles/__tests__/templates.test.ts +341 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/module.js +43 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/.air.toml.hbs +30 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/cmd/server/main.go.hbs +50 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/go.mod.hbs +9 -0
- package/dist/templates/plopfiles/_modules/backends/go-chi/templates/internal/handlers/health.go.hbs +51 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/module.js +38 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/build.gradle.kts.hbs +37 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/settings.gradle.kts.hbs +1 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/kotlin/Application.kt.hbs +44 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/kotlin/routes/Health.kt.hbs +41 -0
- package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/resources/logback.xml.hbs +11 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/module.js +54 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/templates/src/index.ts.hbs +37 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/templates/src/routes/health.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/backends/node-express/templates/tsconfig.json.hbs +18 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/module.js +56 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/index.ts.hbs +30 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/health.ts.hbs +64 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/index.ts.hbs +38 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/tsconfig.json.hbs +20 -0
- package/dist/templates/plopfiles/_modules/backends/node-hono/templates/typedoc.json.hbs +25 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/module.js +65 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/__init__.py.hbs +1 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/config.py.hbs +28 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/main.py.hbs +40 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/routers/__init__.py.hbs +1 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/routers/health.py.hbs +24 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/pyproject.toml.hbs +40 -0
- package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/requirements.txt.hbs +6 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/module.js +44 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/Cargo.toml.hbs +23 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/src/health.rs.hbs +41 -0
- package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/src/main.rs.hbs +57 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/module.js +33 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-alb.tf.hbs +92 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-ecs.tf.hbs +84 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-iam.tf.hbs +60 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-vpc.tf.hbs +106 -0
- package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws.tf.hbs +56 -0
- package/dist/templates/plopfiles/_modules/cloud/azure/module.js +31 -0
- package/dist/templates/plopfiles/_modules/cloud/azure/templates/azure-container-apps.tf.hbs +99 -0
- package/dist/templates/plopfiles/_modules/cloud/azure/templates/azure.tf.hbs +54 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/module.js +43 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/src/types.d.ts.hbs +6 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/src/worker.ts.hbs +51 -0
- package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/wrangler.toml.hbs +36 -0
- package/dist/templates/plopfiles/_modules/cloud/gcp/module.js +31 -0
- package/dist/templates/plopfiles/_modules/cloud/gcp/templates/gcp-cloudrun.tf.hbs +89 -0
- package/dist/templates/plopfiles/_modules/cloud/gcp/templates/gcp.tf.hbs +62 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/module.js +51 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/src/lib/supabase.ts.hbs +25 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/src/types/supabase.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/config.toml.hbs +71 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/functions/hello/index.ts.hbs +34 -0
- package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/migrations/00000000000000_init.sql.hbs +60 -0
- package/dist/templates/plopfiles/_modules/composer.js +180 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/drizzle.config.ts.hbs +10 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/module.js +53 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/templates/index.ts.hbs +15 -0
- package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/templates/schema.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/module.js +51 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/forge.config.ts.hbs +38 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/package.json.hbs +22 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/src/main.ts.hbs +48 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/src/preload.ts.hbs +18 -0
- package/dist/templates/plopfiles/_modules/desktop/electron/templates/tsconfig.json.hbs +14 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/module.js +38 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/Cargo.toml.hbs +20 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/build.rs.hbs +3 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/src/main.rs.hbs +30 -0
- package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/tauri.conf.json.hbs +44 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/module.js +61 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/architecture/components.md.hbs +37 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/architecture/overview.md.hbs +43 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/contributing/development.md.hbs +164 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/contributing/guidelines.md.hbs +50 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/configuration.md.hbs +37 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/installation.md.hbs +53 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/quickstart.md.hbs +39 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/index.md.hbs +44 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/javascripts/extra.js.hbs +23 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/stylesheets/extra.css.hbs +51 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/mkdocs.yml.hbs +141 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/requirements-docs.txt.hbs +15 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/scripts/aggregate-docs.mjs.hbs +188 -0
- package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/scripts/gen_ref_pages.py.hbs +54 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/module.js +60 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/index.html.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/nginx.conf.hbs +31 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/postcss.config.js.hbs +6 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/App.tsx.hbs +12 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/index.css.hbs +25 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/main.tsx.hbs +18 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/pages/Home.tsx.hbs +31 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tailwind.config.js.hbs +8 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tsconfig.json.hbs +25 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tsconfig.node.json.hbs +10 -0
- package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/vite.config.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/module.js +51 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/index.html.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/postcss.config.js.hbs +6 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/App.tsx.hbs +12 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/index.css.hbs +3 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/index.tsx.hbs +21 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/pages/Home.tsx.hbs +34 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/tailwind.config.js.hbs +8 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/tsconfig.json.hbs +24 -0
- package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/vite.config.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/module.js +54 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/index.html.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/postcss.config.js.hbs +6 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/App.vue.hbs +9 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/index.css.hbs +3 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/main.ts.hbs +14 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/pages/Home.vue.hbs +27 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/router.ts.hbs +13 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/tailwind.config.js.hbs +8 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/tsconfig.json.hbs +25 -0
- package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/vite.config.ts.hbs +21 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/module.js +52 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/Dockerfile.backend.hbs +32 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/Dockerfile.frontend.hbs +31 -0
- package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/docker-compose.yml.hbs +97 -0
- package/dist/templates/plopfiles/_modules/infra/github-actions/module.js +24 -0
- package/dist/templates/plopfiles/_modules/infra/github-actions/templates/.github/workflows/ci.yml.hbs +78 -0
- package/dist/templates/plopfiles/_modules/infra/github-actions/templates/.github/workflows/deploy.yml.hbs +60 -0
- package/dist/templates/plopfiles/_modules/infra/just/module.js +26 -0
- package/dist/templates/plopfiles/_modules/infra/just/templates/justfile.hbs +205 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/module.js +30 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/deployment.yaml.hbs +48 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/ingress.yaml.hbs +23 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/kustomization.yaml.hbs +11 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/service.yaml.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/dev/deployment-patch.yaml.hbs +17 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/dev/kustomization.yaml.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/prod/deployment-patch.yaml.hbs +17 -0
- package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/prod/kustomization.yaml.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/module.js +30 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/.gitignore.hbs +5 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/Pulumi.dev.yaml.hbs +3 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/Pulumi.yaml.hbs +7 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/index.ts.hbs +26 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/package.json.hbs +12 -0
- package/dist/templates/plopfiles/_modules/infra/pulumi/templates/tsconfig.json.hbs +16 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/module.js +31 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/.gitignore.hbs +12 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/main.tf.hbs +34 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/outputs.tf.hbs +15 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/terraform.tfvars.example.hbs +6 -0
- package/dist/templates/plopfiles/_modules/infra/terraform/templates/variables.tf.hbs +30 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/module.js +38 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/build.gradle.kts.hbs +102 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/proguard-rules.pro.hbs +20 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/AndroidManifest.xml.hbs +25 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ApiClient.kt.hbs +38 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/App.kt.hbs +116 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/MainActivity.kt.hbs +28 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Color.kt.hbs +11 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Theme.kt.hbs +55 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Type.kt.hbs +31 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/res/values/strings.xml.hbs +3 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/res/values/themes.xml.hbs +4 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/build.gradle.kts.hbs +6 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/gradle.properties.hbs +4 -0
- package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/settings.gradle.kts.hbs +18 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/module.js +36 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/.env.hbs +1 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/main.dart.hbs +29 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/screens/home_screen.dart.hbs +88 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/services/api_service.dart.hbs +61 -0
- package/dist/templates/plopfiles/_modules/mobile/flutter/templates/pubspec.yaml.hbs +25 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/module.js +39 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/App.swift.hbs +10 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/AccentColor.colorset/Contents.json.hbs +11 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/AppIcon.appiconset/Contents.json.hbs +13 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/Contents.json.hbs +6 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/ContentView.swift.hbs +13 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Services/APIClient.swift.hbs +58 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/DetailsView.swift.hbs +22 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/HomeView.swift.hbs +62 -0
- package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App.xcodeproj/project.pbxproj.hbs +363 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/module.js +36 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app/_layout.tsx.hbs +16 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app/index.tsx.hbs +66 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app.json.hbs +37 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/package.json.hbs +29 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/src/lib/api.ts.hbs +52 -0
- package/dist/templates/plopfiles/_modules/mobile/react-native/templates/tsconfig.json.hbs +11 -0
- package/dist/templates/plopfiles/_modules/quality/biome/module.js +44 -0
- package/dist/templates/plopfiles/_modules/quality/biome/templates/biome.json.hbs +126 -0
- package/dist/templates/plopfiles/_modules/quality/clippy/module.js +40 -0
- package/dist/templates/plopfiles/_modules/quality/clippy/templates/clippy.toml.hbs +29 -0
- package/dist/templates/plopfiles/_modules/quality/clippy/templates/rustfmt.toml.hbs +44 -0
- package/dist/templates/plopfiles/_modules/quality/golangci-lint/module.js +40 -0
- package/dist/templates/plopfiles/_modules/quality/golangci-lint/templates/.golangci.yml.hbs +199 -0
- package/dist/templates/plopfiles/_modules/quality/ruff/module.js +43 -0
- package/dist/templates/plopfiles/_modules/quality/ruff/templates/mypy.ini.hbs +48 -0
- package/dist/templates/plopfiles/_modules/quality/ruff/templates/ruff.toml.hbs +111 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/module.js +54 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/.storybook/main.ts.hbs +44 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/.storybook/preview.ts.hbs +68 -0
- package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/src/stories/Button.stories.tsx.hbs +158 -0
- package/dist/templates/plopfiles/_modules/types.ts +98 -0
- package/dist/templates/plopfiles/full-stack/plopfile.js +132 -0
- package/dist/templates/plopfiles/full-stack/templates/gitignore.hbs +44 -0
- package/dist/templates/plopfiles/full-stack/templates/package.json.hbs +21 -0
- package/dist/templates/plopfiles/presets/cli-go/module.js +43 -0
- package/dist/templates/plopfiles/presets/cli-go/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-go/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/cli-node/module.js +45 -0
- package/dist/templates/plopfiles/presets/cli-node/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-node/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/cli-python/module.js +43 -0
- package/dist/templates/plopfiles/presets/cli-python/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-python/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/cli-rust/module.js +43 -0
- package/dist/templates/plopfiles/presets/cli-rust/templates/README.md.hbs +42 -0
- package/dist/templates/plopfiles/presets/cli-rust/templates/config.json.hbs +9 -0
- package/dist/templates/plopfiles/presets/loader.js +125 -0
- package/dist/templates/plopfiles/typescript-service/plopfile.js +186 -0
- package/dist/templates/plopfiles/typescript-service/templates/Dockerfile.hbs +29 -0
- package/dist/templates/plopfiles/typescript-service/templates/README.md.hbs +85 -0
- package/dist/templates/plopfiles/typescript-service/templates/config.ts.hbs +15 -0
- package/dist/templates/plopfiles/typescript-service/templates/db/index.ts.hbs +19 -0
- package/dist/templates/plopfiles/typescript-service/templates/db/schema.ts.hbs +16 -0
- package/dist/templates/plopfiles/typescript-service/templates/index.ts.hbs +89 -0
- package/dist/templates/plopfiles/typescript-service/templates/package.json.hbs +36 -0
- package/dist/templates/plopfiles/typescript-service/templates/routes/health.ts.hbs +61 -0
- package/dist/templates/plopfiles/typescript-service/templates/routes/index.ts.hbs +35 -0
- package/dist/templates/plopfiles/typescript-service/templates/tsconfig.json.hbs +24 -0
- package/dist/templates/plopfiles/typescript-service/templates/types.ts.hbs +28 -0
- package/dist/templates/typescript/component.module.css.tpl +6 -0
- package/dist/templates/typescript/component.test.tsx.tpl +9 -0
- package/dist/templates/typescript/component.tsx.tpl +17 -0
- package/dist/templates/typescript/component.types.ts.tpl +3 -0
- package/dist/templates/typescript/project/nextjs/app/globals.css.tpl +10 -0
- package/dist/templates/typescript/project/nextjs/app/layout.tsx.tpl +15 -0
- package/dist/templates/typescript/project/nextjs/app/page.tsx.tpl +8 -0
- package/dist/templates/typescript/project/nextjs/babel.config.js.tpl +8 -0
- package/dist/templates/typescript/project/nextjs/jest.config.js.tpl +10 -0
- package/dist/templates/typescript/project/nextjs/jest.setup.ts.tpl +6 -0
- package/dist/templates/typescript/project/nextjs/next-env.d.ts.tpl +5 -0
- package/dist/templates/typescript/project/nextjs/next.config.js.tpl +9 -0
- package/dist/templates/typescript/project/nextjs/package.json.tpl +1 -0
- package/dist/templates/typescript/project/nextjs/tsconfig.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/App.css.tpl +8 -0
- package/dist/templates/typescript/project/vite/App.tsx.tpl +17 -0
- package/dist/templates/typescript/project/vite/index.css.tpl +8 -0
- package/dist/templates/typescript/project/vite/index.html.tpl +13 -0
- package/dist/templates/typescript/project/vite/main.tsx.tpl +10 -0
- package/dist/templates/typescript/project/vite/package.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/test-setup.ts.tpl +1 -0
- package/dist/templates/typescript/project/vite/tsconfig.build.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/tsconfig.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/tsconfig.node.json.tpl +1 -0
- package/dist/templates/typescript/project/vite/vite.config.ts.tpl +18 -0
- package/dist/templates/typescript/service.api.ts.tpl +27 -0
- package/dist/templates/typescript/service.class.ts.tpl +28 -0
- package/dist/templates/typescript/service.handler.ts.tpl +42 -0
- package/dist/templates/typescript/service.schema.ts.tpl +16 -0
- package/package.json +95 -0
- package/templates/typescript/component.module.css.tpl +6 -0
- package/templates/typescript/component.test.tsx.tpl +9 -0
- package/templates/typescript/component.tsx.tpl +17 -0
- package/templates/typescript/component.types.ts.tpl +3 -0
- package/templates/typescript/project/nextjs/app/globals.css.tpl +10 -0
- package/templates/typescript/project/nextjs/app/layout.tsx.tpl +15 -0
- package/templates/typescript/project/nextjs/app/page.tsx.tpl +8 -0
- package/templates/typescript/project/nextjs/babel.config.js.tpl +8 -0
- package/templates/typescript/project/nextjs/jest.config.js.tpl +10 -0
- package/templates/typescript/project/nextjs/jest.setup.ts.tpl +6 -0
- package/templates/typescript/project/nextjs/next-env.d.ts.tpl +5 -0
- package/templates/typescript/project/nextjs/next.config.js.tpl +9 -0
- package/templates/typescript/project/nextjs/package.json.tpl +1 -0
- package/templates/typescript/project/nextjs/tsconfig.json.tpl +1 -0
- package/templates/typescript/project/vite/App.css.tpl +8 -0
- package/templates/typescript/project/vite/App.tsx.tpl +17 -0
- package/templates/typescript/project/vite/index.css.tpl +8 -0
- package/templates/typescript/project/vite/index.html.tpl +13 -0
- package/templates/typescript/project/vite/main.tsx.tpl +10 -0
- package/templates/typescript/project/vite/package.json.tpl +1 -0
- package/templates/typescript/project/vite/test-setup.ts.tpl +1 -0
- package/templates/typescript/project/vite/tsconfig.build.json.tpl +1 -0
- package/templates/typescript/project/vite/tsconfig.json.tpl +1 -0
- package/templates/typescript/project/vite/tsconfig.node.json.tpl +1 -0
- package/templates/typescript/project/vite/vite.config.ts.tpl +18 -0
- package/templates/typescript/service.api.ts.tpl +27 -0
- package/templates/typescript/service.class.ts.tpl +28 -0
- package/templates/typescript/service.handler.ts.tpl +42 -0
- package/templates/typescript/service.schema.ts.tpl +16 -0
package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/scripts/aggregate-docs.mjs.hbs
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Documentation Aggregator
|
|
4
|
+
*
|
|
5
|
+
* Collects documentation from all subprojects and builds a unified docs site.
|
|
6
|
+
* Supports TSDoc/JSDoc extraction for TypeScript/JavaScript projects.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { existsSync, mkdirSync, cpSync, readdirSync, statSync, readFileSync, writeFileSync } from 'node:fs';
|
|
10
|
+
import { join, dirname, basename, relative } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const projectRoot = join(__dirname, '..');
|
|
15
|
+
const docsDir = join(projectRoot, 'docs');
|
|
16
|
+
|
|
17
|
+
// Subproject directories to scan for docs
|
|
18
|
+
const subprojectDirs = [
|
|
19
|
+
{{#each modules}}
|
|
20
|
+
'{{this}}',
|
|
21
|
+
{{/each}}
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
// File patterns to look for documentation
|
|
25
|
+
const docPatterns = [
|
|
26
|
+
'README.md',
|
|
27
|
+
'CHANGELOG.md',
|
|
28
|
+
'docs/**/*.md',
|
|
29
|
+
'api-docs/**/*.md',
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Copy documentation files from subproject to main docs
|
|
34
|
+
*/
|
|
35
|
+
function aggregateSubprojectDocs(subproject) {
|
|
36
|
+
const subprojectPath = join(projectRoot, subproject);
|
|
37
|
+
const targetPath = join(docsDir, 'reference', subproject);
|
|
38
|
+
|
|
39
|
+
if (!existsSync(subprojectPath)) {
|
|
40
|
+
console.warn(`Subproject not found: ${subproject}`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Create target directory
|
|
45
|
+
mkdirSync(targetPath, { recursive: true });
|
|
46
|
+
|
|
47
|
+
// Copy README as index
|
|
48
|
+
const readmePath = join(subprojectPath, 'README.md');
|
|
49
|
+
if (existsSync(readmePath)) {
|
|
50
|
+
cpSync(readmePath, join(targetPath, 'index.md'));
|
|
51
|
+
console.log(` Copied README from ${subproject}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Copy docs folder if exists
|
|
55
|
+
const subDocsPath = join(subprojectPath, 'docs');
|
|
56
|
+
if (existsSync(subDocsPath) && statSync(subDocsPath).isDirectory()) {
|
|
57
|
+
cpSync(subDocsPath, targetPath, { recursive: true });
|
|
58
|
+
console.log(` Copied docs/ from ${subproject}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Generate API reference from TypeScript/JavaScript
|
|
62
|
+
const srcPath = join(subprojectPath, 'src');
|
|
63
|
+
if (existsSync(srcPath)) {
|
|
64
|
+
generateApiReference(srcPath, join(targetPath, 'api'));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Generate API reference from source files
|
|
70
|
+
*/
|
|
71
|
+
function generateApiReference(srcPath, outputPath) {
|
|
72
|
+
mkdirSync(outputPath, { recursive: true });
|
|
73
|
+
|
|
74
|
+
const files = findSourceFiles(srcPath);
|
|
75
|
+
const apiIndex = [];
|
|
76
|
+
|
|
77
|
+
for (const file of files) {
|
|
78
|
+
const relativePath = relative(srcPath, file);
|
|
79
|
+
const docs = extractDocs(file);
|
|
80
|
+
|
|
81
|
+
if (docs.length > 0) {
|
|
82
|
+
const mdContent = generateMarkdown(relativePath, docs);
|
|
83
|
+
const outputFile = join(outputPath, relativePath.replace(/\.[jt]sx?$/, '.md'));
|
|
84
|
+
|
|
85
|
+
mkdirSync(dirname(outputFile), { recursive: true });
|
|
86
|
+
writeFileSync(outputFile, mdContent);
|
|
87
|
+
|
|
88
|
+
apiIndex.push({ path: relativePath, exports: docs.map(d => d.name) });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Generate API index
|
|
93
|
+
if (apiIndex.length > 0) {
|
|
94
|
+
const indexContent = generateApiIndex(apiIndex);
|
|
95
|
+
writeFileSync(join(outputPath, 'index.md'), indexContent);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Find all TypeScript/JavaScript source files
|
|
101
|
+
*/
|
|
102
|
+
function findSourceFiles(dir, files = []) {
|
|
103
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
104
|
+
|
|
105
|
+
for (const entry of entries) {
|
|
106
|
+
const fullPath = join(dir, entry.name);
|
|
107
|
+
|
|
108
|
+
if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules') {
|
|
109
|
+
findSourceFiles(fullPath, files);
|
|
110
|
+
} else if (entry.isFile() && /\.[jt]sx?$/.test(entry.name) && !entry.name.includes('.test.') && !entry.name.includes('.spec.')) {
|
|
111
|
+
files.push(fullPath);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return files;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Extract documentation from source file (basic TSDoc/JSDoc parser)
|
|
120
|
+
*/
|
|
121
|
+
function extractDocs(filePath) {
|
|
122
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
123
|
+
const docs = [];
|
|
124
|
+
|
|
125
|
+
// Match JSDoc/TSDoc comments followed by exports
|
|
126
|
+
const docPattern = /\/\*\*\s*([\s\S]*?)\s*\*\/\s*(?:export\s+(?:async\s+)?(?:function|const|class|interface|type)\s+(\w+))/g;
|
|
127
|
+
|
|
128
|
+
let match;
|
|
129
|
+
while ((match = docPattern.exec(content)) !== null) {
|
|
130
|
+
const [, docContent, name] = match;
|
|
131
|
+
docs.push({
|
|
132
|
+
name,
|
|
133
|
+
description: parseDocComment(docContent),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return docs;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Parse JSDoc comment into structured data
|
|
142
|
+
*/
|
|
143
|
+
function parseDocComment(comment) {
|
|
144
|
+
const lines = comment.split('\n').map(l => l.replace(/^\s*\*\s?/, '').trim());
|
|
145
|
+
return lines.filter(l => !l.startsWith('@')).join('\n').trim();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Generate Markdown from documentation
|
|
150
|
+
*/
|
|
151
|
+
function generateMarkdown(path, docs) {
|
|
152
|
+
let content = `# ${basename(path, '.ts')}\n\n`;
|
|
153
|
+
content += `Source: \`${path}\`\n\n`;
|
|
154
|
+
|
|
155
|
+
for (const doc of docs) {
|
|
156
|
+
content += `## ${doc.name}\n\n`;
|
|
157
|
+
content += `${doc.description || 'No description available.'}\n\n`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return content;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Generate API index page
|
|
165
|
+
*/
|
|
166
|
+
function generateApiIndex(apiIndex) {
|
|
167
|
+
let content = '# API Reference\n\n';
|
|
168
|
+
content += 'Auto-generated API documentation.\n\n';
|
|
169
|
+
|
|
170
|
+
for (const { path, exports } of apiIndex) {
|
|
171
|
+
const mdPath = path.replace(/\.[jt]sx?$/, '.md');
|
|
172
|
+
content += `## [${basename(path)}](${mdPath})\n\n`;
|
|
173
|
+
content += exports.map(e => `- \`${e}\``).join('\n') + '\n\n';
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return content;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Main execution
|
|
180
|
+
console.log('Aggregating documentation from subprojects...\n');
|
|
181
|
+
|
|
182
|
+
for (const subproject of subprojectDirs) {
|
|
183
|
+
console.log(`Processing: ${subproject}`);
|
|
184
|
+
aggregateSubprojectDocs(subproject);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
console.log('\nDocumentation aggregation complete!');
|
|
188
|
+
console.log('Run "mkdocs serve" to preview the docs.');
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Generate API reference pages for MkDocs.
|
|
4
|
+
|
|
5
|
+
This script is run by mkdocs-gen-files plugin to auto-generate
|
|
6
|
+
API documentation from Python source code.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
import mkdocs_gen_files
|
|
12
|
+
|
|
13
|
+
# Python source directories to document
|
|
14
|
+
SRC_DIRS = [
|
|
15
|
+
"backend/app",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
nav = mkdocs_gen_files.Nav()
|
|
19
|
+
|
|
20
|
+
for src_dir in SRC_DIRS:
|
|
21
|
+
src_path = Path(src_dir)
|
|
22
|
+
|
|
23
|
+
if not src_path.exists():
|
|
24
|
+
continue
|
|
25
|
+
|
|
26
|
+
for path in sorted(src_path.rglob("*.py")):
|
|
27
|
+
# Skip private modules and tests
|
|
28
|
+
if path.name.startswith("_") or "test" in path.name:
|
|
29
|
+
continue
|
|
30
|
+
|
|
31
|
+
module_path = path.relative_to(src_path.parent).with_suffix("")
|
|
32
|
+
doc_path = path.relative_to(src_path.parent).with_suffix(".md")
|
|
33
|
+
full_doc_path = Path("reference", doc_path)
|
|
34
|
+
|
|
35
|
+
parts = tuple(module_path.parts)
|
|
36
|
+
|
|
37
|
+
if parts[-1] == "__init__":
|
|
38
|
+
parts = parts[:-1]
|
|
39
|
+
doc_path = doc_path.with_name("index.md")
|
|
40
|
+
full_doc_path = full_doc_path.with_name("index.md")
|
|
41
|
+
|
|
42
|
+
if not parts:
|
|
43
|
+
continue
|
|
44
|
+
|
|
45
|
+
nav[parts] = doc_path.as_posix()
|
|
46
|
+
|
|
47
|
+
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
|
|
48
|
+
identifier = ".".join(parts)
|
|
49
|
+
fd.write(f"::: {identifier}\n")
|
|
50
|
+
|
|
51
|
+
mkdocs_gen_files.set_edit_path(full_doc_path, path)
|
|
52
|
+
|
|
53
|
+
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
|
|
54
|
+
nav_file.writelines(nav.build_literate_nav())
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React + Vite Frontend Module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { dirname, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
export default function (data) {
|
|
12
|
+
const frontendDir = data.frontendDir || "frontend";
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: "addMany",
|
|
17
|
+
destination: `{{projectDir}}/${frontendDir}`,
|
|
18
|
+
base: templatesDir,
|
|
19
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
20
|
+
stripExtensions: ["hbs"],
|
|
21
|
+
data,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const description = "React frontend with Vite, TypeScript, and Tailwind CSS";
|
|
27
|
+
|
|
28
|
+
export const dependencies = {
|
|
29
|
+
react: "^18.2.0",
|
|
30
|
+
"react-dom": "^18.2.0",
|
|
31
|
+
"react-router-dom": "^6.20.0",
|
|
32
|
+
"@tanstack/react-query": "^5.0.0",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const devDependencies = {
|
|
36
|
+
"@types/react": "^18.2.0",
|
|
37
|
+
"@types/react-dom": "^18.2.0",
|
|
38
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
39
|
+
autoprefixer: "^10.4.0",
|
|
40
|
+
postcss: "^8.4.0",
|
|
41
|
+
tailwindcss: "^3.4.0",
|
|
42
|
+
typescript: "^5.3.0",
|
|
43
|
+
vite: "^5.0.0",
|
|
44
|
+
"@biomejs/biome": "^1.9.0",
|
|
45
|
+
typedoc: "^0.27.0",
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const scripts = {
|
|
49
|
+
"dev:frontend": "vite --config frontend/vite.config.ts",
|
|
50
|
+
"build:frontend": "vite build --config frontend/vite.config.ts",
|
|
51
|
+
"preview:frontend": "vite preview --config frontend/vite.config.ts",
|
|
52
|
+
"lint:frontend": "biome check frontend",
|
|
53
|
+
"lint:frontend:fix": "biome check --write frontend",
|
|
54
|
+
"test:frontend": "vitest run --config frontend/vite.config.ts",
|
|
55
|
+
"docs:frontend": "typedoc --out docs/api/frontend frontend/src",
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const envVars = {
|
|
59
|
+
VITE_API_URL: "http://localhost:3000",
|
|
60
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>{{titleCase name}}</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
server {
|
|
2
|
+
listen 80;
|
|
3
|
+
server_name localhost;
|
|
4
|
+
root /usr/share/nginx/html;
|
|
5
|
+
index index.html;
|
|
6
|
+
|
|
7
|
+
# Handle SPA routing
|
|
8
|
+
location / {
|
|
9
|
+
try_files $uri $uri/ /index.html;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
# Proxy API requests to backend
|
|
13
|
+
location /api {
|
|
14
|
+
proxy_pass http://{{kebabCase name}}-backend:3000;
|
|
15
|
+
proxy_http_version 1.1;
|
|
16
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
17
|
+
proxy_set_header Connection 'upgrade';
|
|
18
|
+
proxy_set_header Host $host;
|
|
19
|
+
proxy_cache_bypass $http_upgrade;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
# Cache static assets
|
|
23
|
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
|
|
24
|
+
expires 1y;
|
|
25
|
+
add_header Cache-Control "public, immutable";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# Gzip compression
|
|
29
|
+
gzip on;
|
|
30
|
+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
|
31
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
7
|
+
line-height: 1.5;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
|
|
10
|
+
color-scheme: light dark;
|
|
11
|
+
color: rgba(255, 255, 255, 0.87);
|
|
12
|
+
background-color: #242424;
|
|
13
|
+
|
|
14
|
+
font-synthesis: none;
|
|
15
|
+
text-rendering: optimizeLegibility;
|
|
16
|
+
-webkit-font-smoothing: antialiased;
|
|
17
|
+
-moz-osx-font-smoothing: grayscale;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (prefers-color-scheme: light) {
|
|
21
|
+
:root {
|
|
22
|
+
color: #213547;
|
|
23
|
+
background-color: #ffffff;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const API_URL = import.meta.env.VITE_API_URL || "";
|
|
2
|
+
|
|
3
|
+
class ApiClient {
|
|
4
|
+
private baseUrl: string;
|
|
5
|
+
|
|
6
|
+
constructor(baseUrl: string) {
|
|
7
|
+
this.baseUrl = baseUrl;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
private async request(path: string, options: RequestInit = {}) {
|
|
11
|
+
const url = `${this.baseUrl}${path}`;
|
|
12
|
+
const response = await fetch(url, {
|
|
13
|
+
...options,
|
|
14
|
+
headers: {
|
|
15
|
+
"Content-Type": "application/json",
|
|
16
|
+
...options.headers,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (!response.ok) {
|
|
21
|
+
throw new Error(`API error: ${response.status} ${response.statusText}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get(path: string, options?: RequestInit) {
|
|
28
|
+
return this.request(path, { ...options, method: "GET" });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
post(path: string, data?: unknown, options?: RequestInit) {
|
|
32
|
+
return this.request(path, {
|
|
33
|
+
...options,
|
|
34
|
+
method: "POST",
|
|
35
|
+
body: data ? JSON.stringify(data) : undefined,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
put(path: string, data?: unknown, options?: RequestInit) {
|
|
40
|
+
return this.request(path, {
|
|
41
|
+
...options,
|
|
42
|
+
method: "PUT",
|
|
43
|
+
body: data ? JSON.stringify(data) : undefined,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
delete(path: string, options?: RequestInit) {
|
|
48
|
+
return this.request(path, { ...options, method: "DELETE" });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const api = new ApiClient(API_URL);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom/client";
|
|
3
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
+
import { BrowserRouter } from "react-router-dom";
|
|
5
|
+
import { App } from "./App";
|
|
6
|
+
import "./index.css";
|
|
7
|
+
|
|
8
|
+
const queryClient = new QueryClient();
|
|
9
|
+
|
|
10
|
+
ReactDOM.createRoot(document.getElementById("root")!).render(
|
|
11
|
+
<React.StrictMode>
|
|
12
|
+
<QueryClientProvider client={queryClient}>
|
|
13
|
+
<BrowserRouter>
|
|
14
|
+
<App />
|
|
15
|
+
</BrowserRouter>
|
|
16
|
+
</QueryClientProvider>
|
|
17
|
+
</React.StrictMode>
|
|
18
|
+
);
|
package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/pages/Home.tsx.hbs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { api } from "../lib/api";
|
|
3
|
+
|
|
4
|
+
export function Home() {
|
|
5
|
+
const { data: health, isLoading, error } = useQuery({
|
|
6
|
+
queryKey: ["health"],
|
|
7
|
+
queryFn: () => api.get("/health").then((res) => res.json()),
|
|
8
|
+
retry: false,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="container mx-auto px-4 py-8">
|
|
13
|
+
<h1 className="text-4xl font-bold mb-6">{{titleCase name}}</h1>
|
|
14
|
+
|
|
15
|
+
<div className="bg-white rounded-lg shadow p-6">
|
|
16
|
+
<h2 className="text-xl font-semibold mb-4">API Status</h2>
|
|
17
|
+
{isLoading && <p className="text-gray-500">Checking API...</p>}
|
|
18
|
+
{error && (
|
|
19
|
+
<p className="text-red-500">
|
|
20
|
+
API not reachable. Make sure the backend is running.
|
|
21
|
+
</p>
|
|
22
|
+
)}
|
|
23
|
+
{health && (
|
|
24
|
+
<p className="text-green-500">
|
|
25
|
+
API is healthy: {JSON.stringify(health)}
|
|
26
|
+
</p>
|
|
27
|
+
)}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"jsx": "react-jsx",
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"baseUrl": ".",
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": ["./src/*"]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"include": ["src"],
|
|
24
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
resolve: {
|
|
8
|
+
alias: {
|
|
9
|
+
"@": path.resolve(__dirname, "./src"),
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
server: {
|
|
13
|
+
port: 5173,
|
|
14
|
+
proxy: {
|
|
15
|
+
"/api": {
|
|
16
|
+
target: process.env.VITE_API_URL || "http://localhost:3000",
|
|
17
|
+
changeOrigin: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solid + Vite Frontend Module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { dirname, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
10
|
+
|
|
11
|
+
export default function (data) {
|
|
12
|
+
const frontendDir = data.frontendDir || "frontend";
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: "addMany",
|
|
17
|
+
destination: `{{projectDir}}/${frontendDir}`,
|
|
18
|
+
base: templatesDir,
|
|
19
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
20
|
+
stripExtensions: ["hbs"],
|
|
21
|
+
data,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const description = "SolidJS frontend with Vite, TypeScript, and Tailwind CSS";
|
|
27
|
+
|
|
28
|
+
export const dependencies = {
|
|
29
|
+
"solid-js": "^1.8.0",
|
|
30
|
+
"@solidjs/router": "^0.10.0",
|
|
31
|
+
"@tanstack/solid-query": "^5.0.0",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const devDependencies = {
|
|
35
|
+
"vite-plugin-solid": "^2.8.0",
|
|
36
|
+
autoprefixer: "^10.4.0",
|
|
37
|
+
postcss: "^8.4.0",
|
|
38
|
+
tailwindcss: "^3.4.0",
|
|
39
|
+
typescript: "^5.3.0",
|
|
40
|
+
vite: "^5.0.0",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const scripts = {
|
|
44
|
+
"dev:frontend": "vite --config frontend/vite.config.ts",
|
|
45
|
+
"build:frontend": "vite build --config frontend/vite.config.ts",
|
|
46
|
+
"preview:frontend": "vite preview --config frontend/vite.config.ts",
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const envVars = {
|
|
50
|
+
VITE_API_URL: "http://localhost:3000",
|
|
51
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>{{titleCase name}}</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/index.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* @refresh reload */
|
|
2
|
+
import { render } from "solid-js/web";
|
|
3
|
+
import { Router } from "@solidjs/router";
|
|
4
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/solid-query";
|
|
5
|
+
import App from "./App";
|
|
6
|
+
import "./index.css";
|
|
7
|
+
|
|
8
|
+
const queryClient = new QueryClient();
|
|
9
|
+
|
|
10
|
+
const root = document.getElementById("root");
|
|
11
|
+
|
|
12
|
+
render(
|
|
13
|
+
() => (
|
|
14
|
+
<QueryClientProvider client={queryClient}>
|
|
15
|
+
<Router>
|
|
16
|
+
<App />
|
|
17
|
+
</Router>
|
|
18
|
+
</QueryClientProvider>
|
|
19
|
+
),
|
|
20
|
+
root!
|
|
21
|
+
);
|