@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flutter Mobile 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 mobileDir = data.mobileDir || "mobile";
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
type: "addMany",
|
|
17
|
+
destination: `{{projectDir}}/${mobileDir}`,
|
|
18
|
+
base: templatesDir,
|
|
19
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
20
|
+
stripExtensions: ["hbs"],
|
|
21
|
+
data,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const description = "Flutter mobile app with Dart";
|
|
27
|
+
|
|
28
|
+
export const scripts = {
|
|
29
|
+
"dev:mobile": "cd mobile && flutter run",
|
|
30
|
+
"build:mobile:ios": "cd mobile && flutter build ios",
|
|
31
|
+
"build:mobile:android": "cd mobile && flutter build apk",
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const envVars = {
|
|
35
|
+
FLUTTER_API_URL: "http://localhost:3000",
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
FLUTTER_API_URL=http://localhost:3000
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
|
3
|
+
import 'package:provider/provider.dart';
|
|
4
|
+
import 'services/api_service.dart';
|
|
5
|
+
import 'screens/home_screen.dart';
|
|
6
|
+
|
|
7
|
+
Future<void> main() async {
|
|
8
|
+
await dotenv.load(fileName: ".env");
|
|
9
|
+
runApp(const MyApp());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class MyApp extends StatelessWidget {
|
|
13
|
+
const MyApp({super.key});
|
|
14
|
+
|
|
15
|
+
@override
|
|
16
|
+
Widget build(BuildContext context) {
|
|
17
|
+
return Provider<ApiService>(
|
|
18
|
+
create: (_) => ApiService(),
|
|
19
|
+
child: MaterialApp(
|
|
20
|
+
title: '{{titleCase name}}',
|
|
21
|
+
theme: ThemeData(
|
|
22
|
+
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
|
23
|
+
useMaterial3: true,
|
|
24
|
+
),
|
|
25
|
+
home: const HomeScreen(),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/screens/home_screen.dart.hbs
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
import 'package:provider/provider.dart';
|
|
3
|
+
import '../services/api_service.dart';
|
|
4
|
+
|
|
5
|
+
class HomeScreen extends StatefulWidget {
|
|
6
|
+
const HomeScreen({super.key});
|
|
7
|
+
|
|
8
|
+
@override
|
|
9
|
+
State<HomeScreen> createState() => _HomeScreenState();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class _HomeScreenState extends State<HomeScreen> {
|
|
13
|
+
Map<String, dynamic>? _health;
|
|
14
|
+
bool _loading = true;
|
|
15
|
+
String? _error;
|
|
16
|
+
|
|
17
|
+
@override
|
|
18
|
+
void initState() {
|
|
19
|
+
super.initState();
|
|
20
|
+
_checkHealth();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Future<void> _checkHealth() async {
|
|
24
|
+
final api = context.read<ApiService>();
|
|
25
|
+
try {
|
|
26
|
+
final health = await api.get('/health');
|
|
27
|
+
setState(() {
|
|
28
|
+
_health = health;
|
|
29
|
+
_loading = false;
|
|
30
|
+
});
|
|
31
|
+
} catch (e) {
|
|
32
|
+
setState(() {
|
|
33
|
+
_error = e.toString();
|
|
34
|
+
_loading = false;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@override
|
|
40
|
+
Widget build(BuildContext context) {
|
|
41
|
+
return Scaffold(
|
|
42
|
+
appBar: AppBar(
|
|
43
|
+
title: const Text('{{titleCase name}}'),
|
|
44
|
+
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
|
45
|
+
),
|
|
46
|
+
body: Padding(
|
|
47
|
+
padding: const EdgeInsets.all(16.0),
|
|
48
|
+
child: Column(
|
|
49
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
50
|
+
children: [
|
|
51
|
+
Text(
|
|
52
|
+
'{{titleCase name}}',
|
|
53
|
+
style: Theme.of(context).textTheme.headlineLarge,
|
|
54
|
+
),
|
|
55
|
+
const SizedBox(height: 24),
|
|
56
|
+
Card(
|
|
57
|
+
child: Padding(
|
|
58
|
+
padding: const EdgeInsets.all(16.0),
|
|
59
|
+
child: Column(
|
|
60
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
61
|
+
children: [
|
|
62
|
+
Text(
|
|
63
|
+
'API Status',
|
|
64
|
+
style: Theme.of(context).textTheme.titleLarge,
|
|
65
|
+
),
|
|
66
|
+
const SizedBox(height: 12),
|
|
67
|
+
if (_loading)
|
|
68
|
+
const CircularProgressIndicator()
|
|
69
|
+
else if (_error != null)
|
|
70
|
+
Text(
|
|
71
|
+
'API not reachable. Make sure the backend is running.',
|
|
72
|
+
style: TextStyle(color: Colors.red[700]),
|
|
73
|
+
)
|
|
74
|
+
else
|
|
75
|
+
Text(
|
|
76
|
+
'API is healthy: ${_health.toString()}',
|
|
77
|
+
style: TextStyle(color: Colors.green[700]),
|
|
78
|
+
),
|
|
79
|
+
],
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
),
|
|
83
|
+
],
|
|
84
|
+
),
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/services/api_service.dart.hbs
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import 'dart:convert';
|
|
2
|
+
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
|
3
|
+
import 'package:http/http.dart' as http;
|
|
4
|
+
|
|
5
|
+
class ApiService {
|
|
6
|
+
final String baseUrl;
|
|
7
|
+
|
|
8
|
+
ApiService() : baseUrl = dotenv.env['FLUTTER_API_URL'] ?? 'http://localhost:3000';
|
|
9
|
+
|
|
10
|
+
Future<Map<String, dynamic>> get(String path) async {
|
|
11
|
+
final response = await http.get(
|
|
12
|
+
Uri.parse('$baseUrl$path'),
|
|
13
|
+
headers: {'Content-Type': 'application/json'},
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
if (response.statusCode != 200) {
|
|
17
|
+
throw Exception('API error: ${response.statusCode} ${response.reasonPhrase}');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return jsonDecode(response.body);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Future<Map<String, dynamic>> post(String path, Map<String, dynamic>? data) async {
|
|
24
|
+
final response = await http.post(
|
|
25
|
+
Uri.parse('$baseUrl$path'),
|
|
26
|
+
headers: {'Content-Type': 'application/json'},
|
|
27
|
+
body: data != null ? jsonEncode(data) : null,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if (response.statusCode != 200 && response.statusCode != 201) {
|
|
31
|
+
throw Exception('API error: ${response.statusCode} ${response.reasonPhrase}');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return jsonDecode(response.body);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Future<Map<String, dynamic>> put(String path, Map<String, dynamic>? data) async {
|
|
38
|
+
final response = await http.put(
|
|
39
|
+
Uri.parse('$baseUrl$path'),
|
|
40
|
+
headers: {'Content-Type': 'application/json'},
|
|
41
|
+
body: data != null ? jsonEncode(data) : null,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
if (response.statusCode != 200) {
|
|
45
|
+
throw Exception('API error: ${response.statusCode} ${response.reasonPhrase}');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return jsonDecode(response.body);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Future<void> delete(String path) async {
|
|
52
|
+
final response = await http.delete(
|
|
53
|
+
Uri.parse('$baseUrl$path'),
|
|
54
|
+
headers: {'Content-Type': 'application/json'},
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
if (response.statusCode != 200 && response.statusCode != 204) {
|
|
58
|
+
throw Exception('API error: ${response.statusCode} ${response.reasonPhrase}');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: {{snakeCase name}}
|
|
2
|
+
description: {{titleCase name}} mobile application
|
|
3
|
+
publish_to: 'none'
|
|
4
|
+
version: 0.1.0+1
|
|
5
|
+
|
|
6
|
+
environment:
|
|
7
|
+
sdk: '>=3.2.0 <4.0.0'
|
|
8
|
+
|
|
9
|
+
dependencies:
|
|
10
|
+
flutter:
|
|
11
|
+
sdk: flutter
|
|
12
|
+
http: ^1.1.0
|
|
13
|
+
provider: ^6.1.0
|
|
14
|
+
shared_preferences: ^2.2.0
|
|
15
|
+
flutter_dotenv: ^5.1.0
|
|
16
|
+
|
|
17
|
+
dev_dependencies:
|
|
18
|
+
flutter_test:
|
|
19
|
+
sdk: flutter
|
|
20
|
+
flutter_lints: ^3.0.0
|
|
21
|
+
|
|
22
|
+
flutter:
|
|
23
|
+
uses-material-design: true
|
|
24
|
+
assets:
|
|
25
|
+
- .env
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* iOS Swift Mobile Module
|
|
3
|
+
* Modern iOS app with SwiftUI
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { dirname, resolve } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
11
|
+
|
|
12
|
+
export default function (data) {
|
|
13
|
+
const mobileDir = data.mobileDir || "ios";
|
|
14
|
+
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
type: "addMany",
|
|
18
|
+
destination: `{{projectDir}}/${mobileDir}`,
|
|
19
|
+
base: templatesDir,
|
|
20
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
21
|
+
stripExtensions: ["hbs"],
|
|
22
|
+
data: {
|
|
23
|
+
...data,
|
|
24
|
+
bundleId:
|
|
25
|
+
data.bundleId || `com.example.${data.name.toLowerCase().replace(/[^a-z0-9]/g, "")}`,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const description = "Native iOS app with Swift and SwiftUI";
|
|
32
|
+
|
|
33
|
+
export const scripts = {
|
|
34
|
+
"dev:ios":
|
|
35
|
+
"cd ios && xcodebuild -scheme App -destination 'platform=iOS Simulator,name=iPhone 15' -configuration Debug build",
|
|
36
|
+
"build:ios": "cd ios && xcodebuild -scheme App -configuration Release archive",
|
|
37
|
+
"test:ios":
|
|
38
|
+
"cd ios && xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 15'",
|
|
39
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
struct HealthResponse: Codable {
|
|
4
|
+
let status: String
|
|
5
|
+
let timestamp: String?
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
actor APIClient {
|
|
9
|
+
static let shared = APIClient()
|
|
10
|
+
|
|
11
|
+
private let baseURL: URL
|
|
12
|
+
private let session: URLSession
|
|
13
|
+
private let decoder: JSONDecoder
|
|
14
|
+
|
|
15
|
+
private init() {
|
|
16
|
+
#if DEBUG
|
|
17
|
+
self.baseURL = URL(string: "http://localhost:3000")!
|
|
18
|
+
#else
|
|
19
|
+
self.baseURL = URL(string: "https://api.example.com")!
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
let config = URLSessionConfiguration.default
|
|
23
|
+
config.timeoutIntervalForRequest = 30
|
|
24
|
+
self.session = URLSession(configuration: config)
|
|
25
|
+
|
|
26
|
+
self.decoder = JSONDecoder()
|
|
27
|
+
self.decoder.keyDecodingStrategy = .convertFromSnakeCase
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
func checkHealth() async throws -> HealthResponse {
|
|
31
|
+
let url = baseURL.appendingPathComponent("health/live")
|
|
32
|
+
let (data, response) = try await session.data(from: url)
|
|
33
|
+
|
|
34
|
+
guard let httpResponse = response as? HTTPURLResponse,
|
|
35
|
+
(200...299).contains(httpResponse.statusCode) else {
|
|
36
|
+
throw APIError.invalidResponse
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return try decoder.decode(HealthResponse.self, from: data)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
enum APIError: LocalizedError {
|
|
44
|
+
case invalidResponse
|
|
45
|
+
case networkError(Error)
|
|
46
|
+
case decodingError(Error)
|
|
47
|
+
|
|
48
|
+
var errorDescription: String? {
|
|
49
|
+
switch self {
|
|
50
|
+
case .invalidResponse:
|
|
51
|
+
return "Invalid response from server"
|
|
52
|
+
case .networkError(let error):
|
|
53
|
+
return "Network error: \(error.localizedDescription)"
|
|
54
|
+
case .decodingError(let error):
|
|
55
|
+
return "Failed to decode response: \(error.localizedDescription)"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/DetailsView.swift.hbs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
struct DetailsView: View {
|
|
4
|
+
var body: some View {
|
|
5
|
+
VStack(spacing: 16) {
|
|
6
|
+
Text("Details Screen")
|
|
7
|
+
.font(.title2)
|
|
8
|
+
|
|
9
|
+
Text("Add your content here")
|
|
10
|
+
.foregroundColor(.secondary)
|
|
11
|
+
}
|
|
12
|
+
.padding()
|
|
13
|
+
.navigationTitle("Details")
|
|
14
|
+
.navigationBarTitleDisplayMode(.inline)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#Preview {
|
|
19
|
+
NavigationStack {
|
|
20
|
+
DetailsView()
|
|
21
|
+
}
|
|
22
|
+
}
|
package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/HomeView.swift.hbs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
struct HomeView: View {
|
|
4
|
+
@State private var healthStatus: String?
|
|
5
|
+
@State private var isLoading = false
|
|
6
|
+
|
|
7
|
+
var body: some View {
|
|
8
|
+
VStack(spacing: 24) {
|
|
9
|
+
Text("Welcome to {{titleCase name}}")
|
|
10
|
+
.font(.title)
|
|
11
|
+
.fontWeight(.semibold)
|
|
12
|
+
|
|
13
|
+
Button(action: checkHealth) {
|
|
14
|
+
if isLoading {
|
|
15
|
+
ProgressView()
|
|
16
|
+
.progressViewStyle(CircularProgressViewStyle())
|
|
17
|
+
} else {
|
|
18
|
+
Text("Check API Health")
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.buttonStyle(.borderedProminent)
|
|
22
|
+
.disabled(isLoading)
|
|
23
|
+
|
|
24
|
+
if let status = healthStatus {
|
|
25
|
+
Text("Status: \(status)")
|
|
26
|
+
.foregroundColor(.secondary)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
NavigationLink(destination: DetailsView()) {
|
|
30
|
+
Text("View Details")
|
|
31
|
+
}
|
|
32
|
+
.buttonStyle(.bordered)
|
|
33
|
+
}
|
|
34
|
+
.padding()
|
|
35
|
+
.navigationTitle("{{titleCase name}}")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private func checkHealth() {
|
|
39
|
+
isLoading = true
|
|
40
|
+
|
|
41
|
+
Task {
|
|
42
|
+
do {
|
|
43
|
+
let response = try await APIClient.shared.checkHealth()
|
|
44
|
+
await MainActor.run {
|
|
45
|
+
healthStatus = response.status
|
|
46
|
+
isLoading = false
|
|
47
|
+
}
|
|
48
|
+
} catch {
|
|
49
|
+
await MainActor.run {
|
|
50
|
+
healthStatus = "Error: \(error.localizedDescription)"
|
|
51
|
+
isLoading = false
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#Preview {
|
|
59
|
+
NavigationStack {
|
|
60
|
+
HomeView()
|
|
61
|
+
}
|
|
62
|
+
}
|