@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,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terraform Infrastructure 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
|
+
return [
|
|
13
|
+
{
|
|
14
|
+
type: "addMany",
|
|
15
|
+
destination: "{{projectDir}}/infra/terraform",
|
|
16
|
+
base: templatesDir,
|
|
17
|
+
templateFiles: `${templatesDir}/**/*.hbs`,
|
|
18
|
+
stripExtensions: ["hbs"],
|
|
19
|
+
data,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const description = "Terraform infrastructure as code";
|
|
25
|
+
|
|
26
|
+
export const scripts = {
|
|
27
|
+
"tf:init": "cd infra/terraform && terraform init",
|
|
28
|
+
"tf:plan": "cd infra/terraform && terraform plan",
|
|
29
|
+
"tf:apply": "cd infra/terraform && terraform apply",
|
|
30
|
+
"tf:destroy": "cd infra/terraform && terraform destroy",
|
|
31
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
# Add your cloud provider here
|
|
6
|
+
# aws = {
|
|
7
|
+
# source = "hashicorp/aws"
|
|
8
|
+
# version = "~> 5.0"
|
|
9
|
+
# }
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
# Backend configuration - uncomment and configure for remote state
|
|
13
|
+
# backend "s3" {
|
|
14
|
+
# bucket = "{{kebabCase name}}-terraform-state"
|
|
15
|
+
# key = "state/terraform.tfstate"
|
|
16
|
+
# region = "us-east-1"
|
|
17
|
+
# }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
# Provider configuration
|
|
21
|
+
# provider "aws" {
|
|
22
|
+
# region = var.region
|
|
23
|
+
# }
|
|
24
|
+
|
|
25
|
+
# Local variables
|
|
26
|
+
locals {
|
|
27
|
+
project_name = "{{kebabCase name}}"
|
|
28
|
+
environment = var.environment
|
|
29
|
+
common_tags = {
|
|
30
|
+
Project = local.project_name
|
|
31
|
+
Environment = local.environment
|
|
32
|
+
ManagedBy = "terraform"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
output "project_name" {
|
|
2
|
+
description = "Project name"
|
|
3
|
+
value = local.project_name
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
output "environment" {
|
|
7
|
+
description = "Current environment"
|
|
8
|
+
value = var.environment
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
# Add more outputs as you create resources
|
|
12
|
+
# output "app_url" {
|
|
13
|
+
# description = "Application URL"
|
|
14
|
+
# value = aws_lb.main.dns_name
|
|
15
|
+
# }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
variable "environment" {
|
|
2
|
+
description = "Deployment environment (dev, staging, prod)"
|
|
3
|
+
type = string
|
|
4
|
+
default = "dev"
|
|
5
|
+
|
|
6
|
+
validation {
|
|
7
|
+
condition = contains(["dev", "staging", "prod"], var.environment)
|
|
8
|
+
error_message = "Environment must be one of: dev, staging, prod."
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
variable "region" {
|
|
13
|
+
description = "Cloud provider region"
|
|
14
|
+
type = string
|
|
15
|
+
default = "us-east-1"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
variable "app_port" {
|
|
19
|
+
description = "Application port"
|
|
20
|
+
type = number
|
|
21
|
+
default = 3000
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
variable "instance_count" {
|
|
25
|
+
description = "Number of application instances"
|
|
26
|
+
type = number
|
|
27
|
+
default = 1
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
# Add more variables as needed for your infrastructure
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Android Kotlin Mobile Module
|
|
3
|
+
* Modern Android app with Jetpack Compose
|
|
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 || "android";
|
|
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
|
+
packageName:
|
|
25
|
+
data.packageName || `com.example.${data.name.toLowerCase().replace(/[^a-z0-9]/g, "")}`,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const description = "Native Android app with Kotlin and Jetpack Compose";
|
|
32
|
+
|
|
33
|
+
export const scripts = {
|
|
34
|
+
"dev:android": "cd android && ./gradlew installDebug",
|
|
35
|
+
"build:android": "cd android && ./gradlew assembleRelease",
|
|
36
|
+
"test:android": "cd android && ./gradlew test",
|
|
37
|
+
"lint:android": "cd android && ./gradlew lint",
|
|
38
|
+
};
|
package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/build.gradle.kts.hbs
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
id("com.android.application")
|
|
3
|
+
id("org.jetbrains.kotlin.android")
|
|
4
|
+
id("org.jetbrains.kotlin.plugin.serialization")
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
android {
|
|
8
|
+
namespace = "{{packageName}}"
|
|
9
|
+
compileSdk = 34
|
|
10
|
+
|
|
11
|
+
defaultConfig {
|
|
12
|
+
applicationId = "{{packageName}}"
|
|
13
|
+
minSdk = 26
|
|
14
|
+
targetSdk = 34
|
|
15
|
+
versionCode = 1
|
|
16
|
+
versionName = "1.0.0"
|
|
17
|
+
|
|
18
|
+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
19
|
+
vectorDrawables {
|
|
20
|
+
useSupportLibrary = true
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
buildConfigField("String", "API_BASE_URL", "\"${project.findProperty("API_BASE_URL") ?: "http://10.0.2.2:3000"}\"")
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
buildTypes {
|
|
27
|
+
release {
|
|
28
|
+
isMinifyEnabled = true
|
|
29
|
+
isShrinkResources = true
|
|
30
|
+
proguardFiles(
|
|
31
|
+
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
32
|
+
"proguard-rules.pro"
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
compileOptions {
|
|
38
|
+
sourceCompatibility = JavaVersion.VERSION_17
|
|
39
|
+
targetCompatibility = JavaVersion.VERSION_17
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
kotlinOptions {
|
|
43
|
+
jvmTarget = "17"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
buildFeatures {
|
|
47
|
+
compose = true
|
|
48
|
+
buildConfig = true
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
composeOptions {
|
|
52
|
+
kotlinCompilerExtensionVersion = "1.5.7"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
packaging {
|
|
56
|
+
resources {
|
|
57
|
+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
dependencies {
|
|
63
|
+
// Compose BOM
|
|
64
|
+
val composeBom = platform("androidx.compose:compose-bom:2024.01.00")
|
|
65
|
+
implementation(composeBom)
|
|
66
|
+
androidTestImplementation(composeBom)
|
|
67
|
+
|
|
68
|
+
// Core
|
|
69
|
+
implementation("androidx.core:core-ktx:1.12.0")
|
|
70
|
+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
|
|
71
|
+
implementation("androidx.activity:activity-compose:1.8.2")
|
|
72
|
+
|
|
73
|
+
// Compose
|
|
74
|
+
implementation("androidx.compose.ui:ui")
|
|
75
|
+
implementation("androidx.compose.ui:ui-graphics")
|
|
76
|
+
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
77
|
+
implementation("androidx.compose.material3:material3")
|
|
78
|
+
|
|
79
|
+
// Navigation
|
|
80
|
+
implementation("androidx.navigation:navigation-compose:2.7.6")
|
|
81
|
+
|
|
82
|
+
// Networking
|
|
83
|
+
implementation("io.ktor:ktor-client-android:2.3.7")
|
|
84
|
+
implementation("io.ktor:ktor-client-content-negotiation:2.3.7")
|
|
85
|
+
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.7")
|
|
86
|
+
|
|
87
|
+
// Serialization
|
|
88
|
+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2")
|
|
89
|
+
|
|
90
|
+
// Coroutines
|
|
91
|
+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
|
|
92
|
+
|
|
93
|
+
// Testing
|
|
94
|
+
testImplementation("junit:junit:4.13.2")
|
|
95
|
+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
|
96
|
+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
|
97
|
+
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
|
98
|
+
|
|
99
|
+
// Debug
|
|
100
|
+
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
101
|
+
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
|
102
|
+
}
|
package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/proguard-rules.pro.hbs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Kotlin serialization
|
|
2
|
+
-keepattributes *Annotation*, InnerClasses
|
|
3
|
+
-dontnote kotlinx.serialization.AnnotationsKt
|
|
4
|
+
-keepclassmembers class kotlinx.serialization.json.** {
|
|
5
|
+
*** Companion;
|
|
6
|
+
}
|
|
7
|
+
-keepclasseswithmembers class kotlinx.serialization.json.** {
|
|
8
|
+
kotlinx.serialization.KSerializer serializer(...);
|
|
9
|
+
}
|
|
10
|
+
-keep,includedescriptorclasses class {{packageName}}.**$$serializer { *; }
|
|
11
|
+
-keepclassmembers class {{packageName}}.** {
|
|
12
|
+
*** Companion;
|
|
13
|
+
}
|
|
14
|
+
-keepclasseswithmembers class {{packageName}}.** {
|
|
15
|
+
kotlinx.serialization.KSerializer serializer(...);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
# Ktor
|
|
19
|
+
-keep class io.ktor.** { *; }
|
|
20
|
+
-keepclassmembers class io.ktor.** { volatile <fields>; }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
+
|
|
6
|
+
<application
|
|
7
|
+
android:allowBackup="true"
|
|
8
|
+
android:icon="@mipmap/ic_launcher"
|
|
9
|
+
android:label="@string/app_name"
|
|
10
|
+
android:roundIcon="@mipmap/ic_launcher_round"
|
|
11
|
+
android:supportsRtl="true"
|
|
12
|
+
android:theme="@style/Theme.{{pascalCase name}}"
|
|
13
|
+
android:usesCleartextTraffic="true">
|
|
14
|
+
<activity
|
|
15
|
+
android:name=".MainActivity"
|
|
16
|
+
android:exported="true"
|
|
17
|
+
android:theme="@style/Theme.{{pascalCase name}}">
|
|
18
|
+
<intent-filter>
|
|
19
|
+
<action android:name="android.intent.action.MAIN" />
|
|
20
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
21
|
+
</intent-filter>
|
|
22
|
+
</activity>
|
|
23
|
+
</application>
|
|
24
|
+
|
|
25
|
+
</manifest>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
package {{packageName}}
|
|
2
|
+
|
|
3
|
+
import io.ktor.client.*
|
|
4
|
+
import io.ktor.client.call.*
|
|
5
|
+
import io.ktor.client.engine.android.*
|
|
6
|
+
import io.ktor.client.plugins.contentnegotiation.*
|
|
7
|
+
import io.ktor.client.request.*
|
|
8
|
+
import io.ktor.serialization.kotlinx.json.*
|
|
9
|
+
import kotlinx.serialization.Serializable
|
|
10
|
+
import kotlinx.serialization.json.Json
|
|
11
|
+
|
|
12
|
+
@Serializable
|
|
13
|
+
data class HealthResponse(
|
|
14
|
+
val status: String,
|
|
15
|
+
val timestamp: String? = null
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
object ApiClient {
|
|
19
|
+
private val client = HttpClient(Android) {
|
|
20
|
+
install(ContentNegotiation) {
|
|
21
|
+
json(Json {
|
|
22
|
+
ignoreUnknownKeys = true
|
|
23
|
+
isLenient = true
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private val baseUrl = BuildConfig.API_BASE_URL
|
|
29
|
+
|
|
30
|
+
suspend fun checkHealth(): Result<HealthResponse> {
|
|
31
|
+
return try {
|
|
32
|
+
val response = client.get("$baseUrl/health/live")
|
|
33
|
+
Result.success(response.body())
|
|
34
|
+
} catch (e: Exception) {
|
|
35
|
+
Result.failure(e)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
package {{packageName}}
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.layout.*
|
|
4
|
+
import androidx.compose.material3.*
|
|
5
|
+
import androidx.compose.runtime.*
|
|
6
|
+
import androidx.compose.ui.Alignment
|
|
7
|
+
import androidx.compose.ui.Modifier
|
|
8
|
+
import androidx.compose.ui.unit.dp
|
|
9
|
+
import androidx.navigation.compose.NavHost
|
|
10
|
+
import androidx.navigation.compose.composable
|
|
11
|
+
import androidx.navigation.compose.rememberNavController
|
|
12
|
+
|
|
13
|
+
@Composable
|
|
14
|
+
fun App() {
|
|
15
|
+
val navController = rememberNavController()
|
|
16
|
+
|
|
17
|
+
NavHost(navController = navController, startDestination = "home") {
|
|
18
|
+
composable("home") {
|
|
19
|
+
HomeScreen(
|
|
20
|
+
onNavigateToDetails = { navController.navigate("details") }
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
composable("details") {
|
|
24
|
+
DetailsScreen(
|
|
25
|
+
onNavigateBack = { navController.popBackStack() }
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@OptIn(ExperimentalMaterial3Api::class)
|
|
32
|
+
@Composable
|
|
33
|
+
fun HomeScreen(onNavigateToDetails: () -> Unit) {
|
|
34
|
+
var healthStatus by remember { mutableStateOf<String?>(null) }
|
|
35
|
+
var isLoading by remember { mutableStateOf(false) }
|
|
36
|
+
|
|
37
|
+
Scaffold(
|
|
38
|
+
topBar = {
|
|
39
|
+
TopAppBar(title = { Text("{{titleCase name}}") })
|
|
40
|
+
}
|
|
41
|
+
) { padding ->
|
|
42
|
+
Column(
|
|
43
|
+
modifier = Modifier
|
|
44
|
+
.fillMaxSize()
|
|
45
|
+
.padding(padding)
|
|
46
|
+
.padding(16.dp),
|
|
47
|
+
horizontalAlignment = Alignment.CenterHorizontally,
|
|
48
|
+
verticalArrangement = Arrangement.Center
|
|
49
|
+
) {
|
|
50
|
+
Text(
|
|
51
|
+
text = "Welcome to {{titleCase name}}",
|
|
52
|
+
style = MaterialTheme.typography.headlineMedium
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
Spacer(modifier = Modifier.height(24.dp))
|
|
56
|
+
|
|
57
|
+
Button(
|
|
58
|
+
onClick = {
|
|
59
|
+
isLoading = true
|
|
60
|
+
// TODO: Call API
|
|
61
|
+
healthStatus = "Connected"
|
|
62
|
+
isLoading = false
|
|
63
|
+
},
|
|
64
|
+
enabled = !isLoading
|
|
65
|
+
) {
|
|
66
|
+
if (isLoading) {
|
|
67
|
+
CircularProgressIndicator(
|
|
68
|
+
modifier = Modifier.size(16.dp),
|
|
69
|
+
strokeWidth = 2.dp
|
|
70
|
+
)
|
|
71
|
+
} else {
|
|
72
|
+
Text("Check API Health")
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
healthStatus?.let {
|
|
77
|
+
Spacer(modifier = Modifier.height(16.dp))
|
|
78
|
+
Text("Status: $it")
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Spacer(modifier = Modifier.height(24.dp))
|
|
82
|
+
|
|
83
|
+
OutlinedButton(onClick = onNavigateToDetails) {
|
|
84
|
+
Text("View Details")
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@OptIn(ExperimentalMaterial3Api::class)
|
|
91
|
+
@Composable
|
|
92
|
+
fun DetailsScreen(onNavigateBack: () -> Unit) {
|
|
93
|
+
Scaffold(
|
|
94
|
+
topBar = {
|
|
95
|
+
TopAppBar(
|
|
96
|
+
title = { Text("Details") },
|
|
97
|
+
navigationIcon = {
|
|
98
|
+
IconButton(onClick = onNavigateBack) {
|
|
99
|
+
Text("<")
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
) { padding ->
|
|
105
|
+
Column(
|
|
106
|
+
modifier = Modifier
|
|
107
|
+
.fillMaxSize()
|
|
108
|
+
.padding(padding)
|
|
109
|
+
.padding(16.dp),
|
|
110
|
+
horizontalAlignment = Alignment.CenterHorizontally,
|
|
111
|
+
verticalArrangement = Arrangement.Center
|
|
112
|
+
) {
|
|
113
|
+
Text("Details Screen")
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package {{packageName}}
|
|
2
|
+
|
|
3
|
+
import android.os.Bundle
|
|
4
|
+
import androidx.activity.ComponentActivity
|
|
5
|
+
import androidx.activity.compose.setContent
|
|
6
|
+
import androidx.activity.enableEdgeToEdge
|
|
7
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
8
|
+
import androidx.compose.material3.MaterialTheme
|
|
9
|
+
import androidx.compose.material3.Surface
|
|
10
|
+
import androidx.compose.ui.Modifier
|
|
11
|
+
import {{packageName}}.ui.theme.AppTheme
|
|
12
|
+
|
|
13
|
+
class MainActivity : ComponentActivity() {
|
|
14
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
15
|
+
super.onCreate(savedInstanceState)
|
|
16
|
+
enableEdgeToEdge()
|
|
17
|
+
setContent {
|
|
18
|
+
AppTheme {
|
|
19
|
+
Surface(
|
|
20
|
+
modifier = Modifier.fillMaxSize(),
|
|
21
|
+
color = MaterialTheme.colorScheme.background
|
|
22
|
+
) {
|
|
23
|
+
App()
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package {{packageName}}.ui.theme
|
|
2
|
+
|
|
3
|
+
import androidx.compose.ui.graphics.Color
|
|
4
|
+
|
|
5
|
+
val Purple80 = Color(0xFFD0BCFF)
|
|
6
|
+
val PurpleGrey80 = Color(0xFFCCC2DC)
|
|
7
|
+
val Pink80 = Color(0xFFEFB8C8)
|
|
8
|
+
|
|
9
|
+
val Purple40 = Color(0xFF6650a4)
|
|
10
|
+
val PurpleGrey40 = Color(0xFF625b71)
|
|
11
|
+
val Pink40 = Color(0xFF7D5260)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
package {{packageName}}.ui.theme
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.os.Build
|
|
5
|
+
import androidx.compose.foundation.isSystemInDarkTheme
|
|
6
|
+
import androidx.compose.material3.*
|
|
7
|
+
import androidx.compose.runtime.Composable
|
|
8
|
+
import androidx.compose.runtime.SideEffect
|
|
9
|
+
import androidx.compose.ui.graphics.toArgb
|
|
10
|
+
import androidx.compose.ui.platform.LocalContext
|
|
11
|
+
import androidx.compose.ui.platform.LocalView
|
|
12
|
+
import androidx.core.view.WindowCompat
|
|
13
|
+
|
|
14
|
+
private val DarkColorScheme = darkColorScheme(
|
|
15
|
+
primary = Purple80,
|
|
16
|
+
secondary = PurpleGrey80,
|
|
17
|
+
tertiary = Pink80
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
private val LightColorScheme = lightColorScheme(
|
|
21
|
+
primary = Purple40,
|
|
22
|
+
secondary = PurpleGrey40,
|
|
23
|
+
tertiary = Pink40
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
@Composable
|
|
27
|
+
fun AppTheme(
|
|
28
|
+
darkTheme: Boolean = isSystemInDarkTheme(),
|
|
29
|
+
dynamicColor: Boolean = true,
|
|
30
|
+
content: @Composable () -> Unit
|
|
31
|
+
) {
|
|
32
|
+
val colorScheme = when {
|
|
33
|
+
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
|
34
|
+
val context = LocalContext.current
|
|
35
|
+
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
|
36
|
+
}
|
|
37
|
+
darkTheme -> DarkColorScheme
|
|
38
|
+
else -> LightColorScheme
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
val view = LocalView.current
|
|
42
|
+
if (!view.isInEditMode) {
|
|
43
|
+
SideEffect {
|
|
44
|
+
val window = (view.context as Activity).window
|
|
45
|
+
window.statusBarColor = colorScheme.primary.toArgb()
|
|
46
|
+
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
MaterialTheme(
|
|
51
|
+
colorScheme = colorScheme,
|
|
52
|
+
typography = Typography,
|
|
53
|
+
content = content
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
package {{packageName}}.ui.theme
|
|
2
|
+
|
|
3
|
+
import androidx.compose.material3.Typography
|
|
4
|
+
import androidx.compose.ui.text.TextStyle
|
|
5
|
+
import androidx.compose.ui.text.font.FontFamily
|
|
6
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
7
|
+
import androidx.compose.ui.unit.sp
|
|
8
|
+
|
|
9
|
+
val Typography = Typography(
|
|
10
|
+
bodyLarge = TextStyle(
|
|
11
|
+
fontFamily = FontFamily.Default,
|
|
12
|
+
fontWeight = FontWeight.Normal,
|
|
13
|
+
fontSize = 16.sp,
|
|
14
|
+
lineHeight = 24.sp,
|
|
15
|
+
letterSpacing = 0.5.sp
|
|
16
|
+
),
|
|
17
|
+
titleLarge = TextStyle(
|
|
18
|
+
fontFamily = FontFamily.Default,
|
|
19
|
+
fontWeight = FontWeight.Normal,
|
|
20
|
+
fontSize = 22.sp,
|
|
21
|
+
lineHeight = 28.sp,
|
|
22
|
+
letterSpacing = 0.sp
|
|
23
|
+
),
|
|
24
|
+
labelSmall = TextStyle(
|
|
25
|
+
fontFamily = FontFamily.Default,
|
|
26
|
+
fontWeight = FontWeight.Medium,
|
|
27
|
+
fontSize = 11.sp,
|
|
28
|
+
lineHeight = 16.sp,
|
|
29
|
+
letterSpacing = 0.5.sp
|
|
30
|
+
)
|
|
31
|
+
)
|
package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/settings.gradle.kts.hbs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
pluginManagement {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
gradlePluginPortal()
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
dependencyResolutionManagement {
|
|
10
|
+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
11
|
+
repositories {
|
|
12
|
+
google()
|
|
13
|
+
mavenCentral()
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
rootProject.name = "{{titleCase name}}"
|
|
18
|
+
include(":app")
|