@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,619 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smoke Tests
|
|
3
|
+
*
|
|
4
|
+
* Actually generates projects, installs dependencies, and runs builds.
|
|
5
|
+
* These tests are slower and require external tools (bun, npm, cargo, go, etc.)
|
|
6
|
+
*
|
|
7
|
+
* Run with: bun test smoke.test.ts
|
|
8
|
+
* Or skip with: bun test --test-name-pattern "^(?!.*smoke).*$"
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
|
|
12
|
+
import { tmpdir } from "os";
|
|
13
|
+
import { dirname, join } from "path";
|
|
14
|
+
import { fileURLToPath } from "url";
|
|
15
|
+
import { $ } from "bun";
|
|
16
|
+
import { mkdir, mkdtemp, rm, writeFile } from "fs/promises";
|
|
17
|
+
import nodePlop from "node-plop";
|
|
18
|
+
import { composeModules, loadModule } from "../_modules/composer.js";
|
|
19
|
+
|
|
20
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
21
|
+
|
|
22
|
+
// Timeout for slow operations
|
|
23
|
+
const SLOW_TIMEOUT = 120_000; // 2 minutes
|
|
24
|
+
|
|
25
|
+
// Helper to execute plop actions
|
|
26
|
+
async function executePlopActions(
|
|
27
|
+
destPath: string,
|
|
28
|
+
actions: Array<Record<string, unknown>>,
|
|
29
|
+
context: Record<string, unknown>,
|
|
30
|
+
) {
|
|
31
|
+
const plop = await nodePlop(undefined, {
|
|
32
|
+
destBasePath: destPath,
|
|
33
|
+
force: true,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Register helpers on plop's Handlebars instance
|
|
37
|
+
plop.setHelper(
|
|
38
|
+
"kebabCase",
|
|
39
|
+
(str: string) =>
|
|
40
|
+
str
|
|
41
|
+
?.toLowerCase()
|
|
42
|
+
.replace(/\s+/g, "-")
|
|
43
|
+
.replace(/[^a-z0-9-]/g, "") || "",
|
|
44
|
+
);
|
|
45
|
+
plop.setHelper(
|
|
46
|
+
"snakeCase",
|
|
47
|
+
(str: string) =>
|
|
48
|
+
str
|
|
49
|
+
?.toLowerCase()
|
|
50
|
+
.replace(/\s+/g, "_")
|
|
51
|
+
.replace(/[^a-z0-9_]/g, "") || "",
|
|
52
|
+
);
|
|
53
|
+
plop.setHelper("camelCase", (str: string) => {
|
|
54
|
+
if (!str) return "";
|
|
55
|
+
return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_, chr: string) => chr.toUpperCase());
|
|
56
|
+
});
|
|
57
|
+
plop.setHelper("pascalCase", (str: string) => {
|
|
58
|
+
if (!str) return "";
|
|
59
|
+
const camel = str
|
|
60
|
+
.toLowerCase()
|
|
61
|
+
.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr: string) => chr.toUpperCase());
|
|
62
|
+
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
|
63
|
+
});
|
|
64
|
+
plop.setHelper(
|
|
65
|
+
"titleCase",
|
|
66
|
+
(str: string) => str?.replace(/\b\w/g, (char) => char.toUpperCase()) || "",
|
|
67
|
+
);
|
|
68
|
+
plop.setHelper("eq", (a: unknown, b: unknown) => a === b);
|
|
69
|
+
plop.setHelper("ne", (a: unknown, b: unknown) => a !== b);
|
|
70
|
+
plop.setHelper("json", (obj: unknown) => JSON.stringify(obj, null, 2));
|
|
71
|
+
|
|
72
|
+
// Create a generator with the given actions
|
|
73
|
+
plop.setGenerator("temp", {
|
|
74
|
+
description: "temp",
|
|
75
|
+
prompts: [],
|
|
76
|
+
actions: actions as any[],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const gen = plop.getGenerator("temp");
|
|
80
|
+
const results = await gen.runActions(context);
|
|
81
|
+
|
|
82
|
+
if (results.failures && results.failures.length > 0) {
|
|
83
|
+
const errors = results.failures.map((f) => f.error || f.message || String(f)).join("\n");
|
|
84
|
+
throw new Error(`Generation failed:\n${errors}`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return results;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Helper to generate a single module
|
|
91
|
+
async function generateModule(
|
|
92
|
+
category: string,
|
|
93
|
+
moduleName: string,
|
|
94
|
+
destPath: string,
|
|
95
|
+
context: Record<string, unknown>,
|
|
96
|
+
) {
|
|
97
|
+
const mod = await loadModule(category, moduleName);
|
|
98
|
+
const actions = mod.default(context);
|
|
99
|
+
await executePlopActions(destPath, actions, context);
|
|
100
|
+
return mod;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Helper to check if a command exists
|
|
104
|
+
async function commandExists(cmd: string): Promise<boolean> {
|
|
105
|
+
try {
|
|
106
|
+
await $`which ${cmd}`.quiet();
|
|
107
|
+
return true;
|
|
108
|
+
} catch {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
describe("Smoke Tests - Node.js Projects", () => {
|
|
114
|
+
let tempDir: string;
|
|
115
|
+
|
|
116
|
+
beforeAll(async () => {
|
|
117
|
+
tempDir = await mkdtemp(join(tmpdir(), "arbiter-smoke-node-"));
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
afterAll(async () => {
|
|
121
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test(
|
|
125
|
+
"node-hono backend builds and type-checks",
|
|
126
|
+
async () => {
|
|
127
|
+
const projectDir = join(tempDir, "node-hono-test");
|
|
128
|
+
await mkdir(projectDir, { recursive: true });
|
|
129
|
+
|
|
130
|
+
const context = {
|
|
131
|
+
name: "node-hono-test",
|
|
132
|
+
projectDir,
|
|
133
|
+
backendDir: "backend",
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
await generateModule("backends", "node-hono", projectDir, context);
|
|
137
|
+
|
|
138
|
+
// Write package.json to root
|
|
139
|
+
const packageJson = {
|
|
140
|
+
name: "node-hono-test",
|
|
141
|
+
type: "module",
|
|
142
|
+
scripts: {
|
|
143
|
+
typecheck: "tsc -p backend/tsconfig.json --noEmit",
|
|
144
|
+
},
|
|
145
|
+
dependencies: {
|
|
146
|
+
hono: "^4.0.0",
|
|
147
|
+
"@hono/node-server": "^1.8.0",
|
|
148
|
+
},
|
|
149
|
+
devDependencies: {
|
|
150
|
+
"@types/bun": "latest",
|
|
151
|
+
"@types/node": "^20.10.0",
|
|
152
|
+
typescript: "^5.3.0",
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
await writeFile(join(projectDir, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
156
|
+
|
|
157
|
+
// Install and type-check
|
|
158
|
+
const result = await $`cd ${projectDir} && bun install && bun run typecheck 2>&1`.nothrow();
|
|
159
|
+
|
|
160
|
+
// Even if typecheck has warnings, it shouldn't have errors
|
|
161
|
+
expect(result.exitCode).toBeLessThanOrEqual(1);
|
|
162
|
+
},
|
|
163
|
+
SLOW_TIMEOUT,
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
test(
|
|
167
|
+
"node-express backend builds and type-checks",
|
|
168
|
+
async () => {
|
|
169
|
+
const projectDir = join(tempDir, "node-express-test");
|
|
170
|
+
await mkdir(projectDir, { recursive: true });
|
|
171
|
+
|
|
172
|
+
const context = {
|
|
173
|
+
name: "node-express-test",
|
|
174
|
+
projectDir,
|
|
175
|
+
backendDir: "backend",
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
await generateModule("backends", "node-express", projectDir, context);
|
|
179
|
+
|
|
180
|
+
const packageJson = {
|
|
181
|
+
name: "node-express-test",
|
|
182
|
+
type: "module",
|
|
183
|
+
scripts: {
|
|
184
|
+
typecheck: "tsc -p backend/tsconfig.json --noEmit",
|
|
185
|
+
},
|
|
186
|
+
dependencies: {
|
|
187
|
+
express: "^4.18.0",
|
|
188
|
+
cors: "^2.8.5",
|
|
189
|
+
helmet: "^7.1.0",
|
|
190
|
+
"express-rate-limit": "^7.1.0",
|
|
191
|
+
dotenv: "^16.3.0",
|
|
192
|
+
},
|
|
193
|
+
devDependencies: {
|
|
194
|
+
"@types/express": "^4.17.0",
|
|
195
|
+
"@types/cors": "^2.8.0",
|
|
196
|
+
"@types/node": "^20.10.0",
|
|
197
|
+
typescript: "^5.3.0",
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
await writeFile(join(projectDir, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
201
|
+
|
|
202
|
+
const result = await $`cd ${projectDir} && bun install && bun run typecheck 2>&1`.nothrow();
|
|
203
|
+
expect(result.exitCode).toBeLessThanOrEqual(1);
|
|
204
|
+
},
|
|
205
|
+
SLOW_TIMEOUT,
|
|
206
|
+
);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
describe("Smoke Tests - Frontend Projects", () => {
|
|
210
|
+
let tempDir: string;
|
|
211
|
+
|
|
212
|
+
beforeAll(async () => {
|
|
213
|
+
tempDir = await mkdtemp(join(tmpdir(), "arbiter-smoke-frontend-"));
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
afterAll(async () => {
|
|
217
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
test(
|
|
221
|
+
"react-vite frontend type-checks",
|
|
222
|
+
async () => {
|
|
223
|
+
const projectDir = join(tempDir, "react-vite-test");
|
|
224
|
+
await mkdir(projectDir, { recursive: true });
|
|
225
|
+
|
|
226
|
+
const context = {
|
|
227
|
+
name: "react-vite-test",
|
|
228
|
+
projectDir,
|
|
229
|
+
frontendDir: "frontend",
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
await generateModule("frontends", "react-vite", projectDir, context);
|
|
233
|
+
|
|
234
|
+
const packageJson = {
|
|
235
|
+
name: "react-vite-test",
|
|
236
|
+
type: "module",
|
|
237
|
+
scripts: {
|
|
238
|
+
typecheck: "tsc --noEmit -p frontend/tsconfig.json",
|
|
239
|
+
},
|
|
240
|
+
dependencies: {
|
|
241
|
+
react: "^18.2.0",
|
|
242
|
+
"react-dom": "^18.2.0",
|
|
243
|
+
"react-router-dom": "^6.20.0",
|
|
244
|
+
"@tanstack/react-query": "^5.0.0",
|
|
245
|
+
},
|
|
246
|
+
devDependencies: {
|
|
247
|
+
"@types/react": "^18.2.0",
|
|
248
|
+
"@types/react-dom": "^18.2.0",
|
|
249
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
250
|
+
autoprefixer: "^10.4.0",
|
|
251
|
+
postcss: "^8.4.0",
|
|
252
|
+
tailwindcss: "^3.4.0",
|
|
253
|
+
typescript: "^5.3.0",
|
|
254
|
+
vite: "^5.0.0",
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
await writeFile(join(projectDir, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
258
|
+
|
|
259
|
+
const result = await $`cd ${projectDir} && bun install 2>&1`.nothrow();
|
|
260
|
+
expect(result.exitCode).toBe(0);
|
|
261
|
+
},
|
|
262
|
+
SLOW_TIMEOUT,
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
test(
|
|
266
|
+
"vue-vite frontend installs correctly",
|
|
267
|
+
async () => {
|
|
268
|
+
const projectDir = join(tempDir, "vue-vite-test");
|
|
269
|
+
await mkdir(projectDir, { recursive: true });
|
|
270
|
+
|
|
271
|
+
const context = {
|
|
272
|
+
name: "vue-vite-test",
|
|
273
|
+
projectDir,
|
|
274
|
+
frontendDir: "frontend",
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
await generateModule("frontends", "vue-vite", projectDir, context);
|
|
278
|
+
|
|
279
|
+
const packageJson = {
|
|
280
|
+
name: "vue-vite-test",
|
|
281
|
+
type: "module",
|
|
282
|
+
dependencies: {
|
|
283
|
+
vue: "^3.4.0",
|
|
284
|
+
"vue-router": "^4.2.0",
|
|
285
|
+
pinia: "^2.1.0",
|
|
286
|
+
"@tanstack/vue-query": "^5.0.0",
|
|
287
|
+
},
|
|
288
|
+
devDependencies: {
|
|
289
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
290
|
+
typescript: "^5.3.0",
|
|
291
|
+
vite: "^5.0.0",
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
await writeFile(join(projectDir, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
295
|
+
|
|
296
|
+
const result = await $`cd ${projectDir} && bun install 2>&1`.nothrow();
|
|
297
|
+
expect(result.exitCode).toBe(0);
|
|
298
|
+
},
|
|
299
|
+
SLOW_TIMEOUT,
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
test(
|
|
303
|
+
"solid-vite frontend installs correctly",
|
|
304
|
+
async () => {
|
|
305
|
+
const projectDir = join(tempDir, "solid-vite-test");
|
|
306
|
+
await mkdir(projectDir, { recursive: true });
|
|
307
|
+
|
|
308
|
+
const context = {
|
|
309
|
+
name: "solid-vite-test",
|
|
310
|
+
projectDir,
|
|
311
|
+
frontendDir: "frontend",
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
await generateModule("frontends", "solid-vite", projectDir, context);
|
|
315
|
+
|
|
316
|
+
const packageJson = {
|
|
317
|
+
name: "solid-vite-test",
|
|
318
|
+
type: "module",
|
|
319
|
+
dependencies: {
|
|
320
|
+
"solid-js": "^1.8.0",
|
|
321
|
+
"@solidjs/router": "^0.10.0",
|
|
322
|
+
"@tanstack/solid-query": "^5.0.0",
|
|
323
|
+
},
|
|
324
|
+
devDependencies: {
|
|
325
|
+
"vite-plugin-solid": "^2.8.0",
|
|
326
|
+
typescript: "^5.3.0",
|
|
327
|
+
vite: "^5.0.0",
|
|
328
|
+
},
|
|
329
|
+
};
|
|
330
|
+
await writeFile(join(projectDir, "package.json"), JSON.stringify(packageJson, null, 2));
|
|
331
|
+
|
|
332
|
+
const result = await $`cd ${projectDir} && bun install 2>&1`.nothrow();
|
|
333
|
+
expect(result.exitCode).toBe(0);
|
|
334
|
+
},
|
|
335
|
+
SLOW_TIMEOUT,
|
|
336
|
+
);
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
describe("Smoke Tests - Rust Projects", () => {
|
|
340
|
+
let tempDir: string;
|
|
341
|
+
let cargoAvailable: boolean;
|
|
342
|
+
|
|
343
|
+
beforeAll(async () => {
|
|
344
|
+
tempDir = await mkdtemp(join(tmpdir(), "arbiter-smoke-rust-"));
|
|
345
|
+
cargoAvailable = await commandExists("cargo");
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
afterAll(async () => {
|
|
349
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
test(
|
|
353
|
+
"rust-axum backend has valid Cargo.toml",
|
|
354
|
+
async () => {
|
|
355
|
+
const projectDir = join(tempDir, "rust-axum-test");
|
|
356
|
+
await mkdir(projectDir, { recursive: true });
|
|
357
|
+
|
|
358
|
+
const context = {
|
|
359
|
+
name: "rust-axum-test",
|
|
360
|
+
projectDir,
|
|
361
|
+
backendDir: "backend",
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
await generateModule("backends", "rust-axum", projectDir, context);
|
|
365
|
+
|
|
366
|
+
// Check Cargo.toml exists and is valid TOML
|
|
367
|
+
const cargoToml = await Bun.file(join(projectDir, "backend", "Cargo.toml")).text();
|
|
368
|
+
expect(cargoToml).toContain("[package]");
|
|
369
|
+
expect(cargoToml).toContain("axum");
|
|
370
|
+
|
|
371
|
+
if (cargoAvailable) {
|
|
372
|
+
const result = await $`cd ${join(projectDir, "backend")} && cargo check 2>&1`.nothrow();
|
|
373
|
+
// Might fail due to network issues downloading deps, but shouldn't have syntax errors
|
|
374
|
+
expect(result.exitCode).toBeLessThanOrEqual(101);
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
SLOW_TIMEOUT,
|
|
378
|
+
);
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
describe("Smoke Tests - Go Projects", () => {
|
|
382
|
+
let tempDir: string;
|
|
383
|
+
let goAvailable: boolean;
|
|
384
|
+
|
|
385
|
+
beforeAll(async () => {
|
|
386
|
+
tempDir = await mkdtemp(join(tmpdir(), "arbiter-smoke-go-"));
|
|
387
|
+
goAvailable = await commandExists("go");
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
afterAll(async () => {
|
|
391
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
test(
|
|
395
|
+
"go-chi backend has valid go.mod",
|
|
396
|
+
async () => {
|
|
397
|
+
const projectDir = join(tempDir, "go-chi-test");
|
|
398
|
+
await mkdir(projectDir, { recursive: true });
|
|
399
|
+
|
|
400
|
+
const context = {
|
|
401
|
+
name: "go-chi-test",
|
|
402
|
+
projectDir,
|
|
403
|
+
backendDir: "backend",
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
await generateModule("backends", "go-chi", projectDir, context);
|
|
407
|
+
|
|
408
|
+
// Check go.mod exists
|
|
409
|
+
const goMod = await Bun.file(join(projectDir, "backend", "go.mod")).text();
|
|
410
|
+
expect(goMod).toContain("module");
|
|
411
|
+
expect(goMod).toContain("chi");
|
|
412
|
+
|
|
413
|
+
if (goAvailable) {
|
|
414
|
+
const result =
|
|
415
|
+
await $`cd ${join(projectDir, "backend")} && go mod tidy && go build ./... 2>&1`.nothrow();
|
|
416
|
+
expect(result.exitCode).toBe(0);
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
SLOW_TIMEOUT,
|
|
420
|
+
);
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
describe("Smoke Tests - Python Projects", () => {
|
|
424
|
+
let tempDir: string;
|
|
425
|
+
let pythonAvailable: boolean;
|
|
426
|
+
|
|
427
|
+
beforeAll(async () => {
|
|
428
|
+
tempDir = await mkdtemp(join(tmpdir(), "arbiter-smoke-python-"));
|
|
429
|
+
pythonAvailable = await commandExists("python3");
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
afterAll(async () => {
|
|
433
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
test(
|
|
437
|
+
"python-fastapi syntax is valid",
|
|
438
|
+
async () => {
|
|
439
|
+
const projectDir = join(tempDir, "python-fastapi-test");
|
|
440
|
+
await mkdir(projectDir, { recursive: true });
|
|
441
|
+
|
|
442
|
+
const context = {
|
|
443
|
+
name: "python-fastapi-test",
|
|
444
|
+
projectDir,
|
|
445
|
+
backendDir: "backend",
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
await generateModule("backends", "python-fastapi", projectDir, context);
|
|
449
|
+
|
|
450
|
+
// Check pyproject.toml exists
|
|
451
|
+
const pyproject = await Bun.file(join(projectDir, "backend", "pyproject.toml")).text();
|
|
452
|
+
expect(pyproject).toContain("fastapi");
|
|
453
|
+
|
|
454
|
+
if (pythonAvailable) {
|
|
455
|
+
const result =
|
|
456
|
+
await $`python3 -m py_compile ${join(projectDir, "backend/app/main.py")} 2>&1`.nothrow();
|
|
457
|
+
expect(result.exitCode).toBe(0);
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
SLOW_TIMEOUT,
|
|
461
|
+
);
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
describe("Smoke Tests - Infrastructure", () => {
|
|
465
|
+
let tempDir: string;
|
|
466
|
+
|
|
467
|
+
beforeAll(async () => {
|
|
468
|
+
tempDir = await mkdtemp(join(tmpdir(), "arbiter-smoke-infra-"));
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
afterAll(async () => {
|
|
472
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
test(
|
|
476
|
+
"docker-compose.yml is generated correctly",
|
|
477
|
+
async () => {
|
|
478
|
+
const projectDir = join(tempDir, "docker-compose-test");
|
|
479
|
+
await mkdir(projectDir, { recursive: true });
|
|
480
|
+
|
|
481
|
+
const context = {
|
|
482
|
+
name: "docker-compose-test",
|
|
483
|
+
projectDir,
|
|
484
|
+
backendDir: "backend",
|
|
485
|
+
frontendDir: "frontend",
|
|
486
|
+
backend: "node-hono",
|
|
487
|
+
frontend: "react-vite",
|
|
488
|
+
database: "postgres-drizzle",
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
await generateModule("infra", "docker-compose", projectDir, context);
|
|
492
|
+
|
|
493
|
+
// Check docker-compose.yml exists and has expected content
|
|
494
|
+
const dockerCompose = await Bun.file(join(projectDir, "docker-compose.yml")).text();
|
|
495
|
+
expect(dockerCompose).toContain("version:");
|
|
496
|
+
expect(dockerCompose).toContain("services:");
|
|
497
|
+
|
|
498
|
+
if (await commandExists("docker")) {
|
|
499
|
+
const result = await $`cd ${projectDir} && docker compose config 2>&1`.nothrow();
|
|
500
|
+
// Check it parses without YAML errors
|
|
501
|
+
expect(result.stdout.toString() + result.stderr.toString()).not.toMatch(/yaml.*error/i);
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
SLOW_TIMEOUT,
|
|
505
|
+
);
|
|
506
|
+
|
|
507
|
+
test(
|
|
508
|
+
"kubernetes manifests are generated correctly",
|
|
509
|
+
async () => {
|
|
510
|
+
const projectDir = join(tempDir, "k8s-test");
|
|
511
|
+
await mkdir(projectDir, { recursive: true });
|
|
512
|
+
|
|
513
|
+
const context = {
|
|
514
|
+
name: "k8s-test",
|
|
515
|
+
projectDir,
|
|
516
|
+
backendDir: "backend",
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
await generateModule("infra", "kubernetes", projectDir, context);
|
|
520
|
+
|
|
521
|
+
// Check k8s files exist
|
|
522
|
+
const deployment = await Bun.file(join(projectDir, "k8s/base/deployment.yaml")).text();
|
|
523
|
+
expect(deployment).toContain("apiVersion:");
|
|
524
|
+
expect(deployment).toContain("kind: Deployment");
|
|
525
|
+
|
|
526
|
+
if (await commandExists("kubectl")) {
|
|
527
|
+
const result =
|
|
528
|
+
await $`kubectl apply --dry-run=client -f ${join(projectDir, "k8s/base/deployment.yaml")} 2>&1`.nothrow();
|
|
529
|
+
expect(result.exitCode).toBeLessThanOrEqual(1);
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
SLOW_TIMEOUT,
|
|
533
|
+
);
|
|
534
|
+
|
|
535
|
+
test(
|
|
536
|
+
"terraform files are generated correctly",
|
|
537
|
+
async () => {
|
|
538
|
+
const projectDir = join(tempDir, "terraform-test");
|
|
539
|
+
await mkdir(projectDir, { recursive: true });
|
|
540
|
+
|
|
541
|
+
const context = {
|
|
542
|
+
name: "terraform-test",
|
|
543
|
+
projectDir,
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
await generateModule("infra", "terraform", projectDir, context);
|
|
547
|
+
|
|
548
|
+
// Check terraform files exist
|
|
549
|
+
const mainTf = await Bun.file(join(projectDir, "infra/terraform/main.tf")).text();
|
|
550
|
+
expect(mainTf).toContain("terraform");
|
|
551
|
+
expect(mainTf).toContain("required_version");
|
|
552
|
+
|
|
553
|
+
if (await commandExists("terraform")) {
|
|
554
|
+
const result =
|
|
555
|
+
await $`cd ${join(projectDir, "infra/terraform")} && terraform init -backend=false && terraform validate 2>&1`.nothrow();
|
|
556
|
+
// Should at least not have syntax errors
|
|
557
|
+
expect(result.stdout.toString() + result.stderr.toString()).not.toMatch(/Error:/);
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
SLOW_TIMEOUT,
|
|
561
|
+
);
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
describe("Smoke Tests - Cloud Providers", () => {
|
|
565
|
+
let tempDir: string;
|
|
566
|
+
|
|
567
|
+
beforeAll(async () => {
|
|
568
|
+
tempDir = await mkdtemp(join(tmpdir(), "arbiter-smoke-cloud-"));
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
afterAll(async () => {
|
|
572
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
test("cloudflare worker is generated correctly", async () => {
|
|
576
|
+
const projectDir = join(tempDir, "cloudflare-test");
|
|
577
|
+
await mkdir(projectDir, { recursive: true });
|
|
578
|
+
|
|
579
|
+
const context = {
|
|
580
|
+
name: "cloudflare-test",
|
|
581
|
+
projectDir,
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
await generateModule("cloud", "cloudflare", projectDir, context);
|
|
585
|
+
|
|
586
|
+
// Check wrangler.toml exists
|
|
587
|
+
const wranglerToml = await Bun.file(join(projectDir, "wrangler.toml")).text();
|
|
588
|
+
expect(wranglerToml).toContain("name");
|
|
589
|
+
expect(wranglerToml).toContain("main");
|
|
590
|
+
|
|
591
|
+
// Check worker.ts exists
|
|
592
|
+
const workerTs = await Bun.file(join(projectDir, "src/worker.ts")).text();
|
|
593
|
+
expect(workerTs).toContain("fetch");
|
|
594
|
+
expect(workerTs).toContain("Request");
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
test("supabase config is generated correctly", async () => {
|
|
598
|
+
const projectDir = join(tempDir, "supabase-test");
|
|
599
|
+
await mkdir(projectDir, { recursive: true });
|
|
600
|
+
|
|
601
|
+
const context = {
|
|
602
|
+
name: "supabase-test",
|
|
603
|
+
projectDir,
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
await generateModule("cloud", "supabase", projectDir, context);
|
|
607
|
+
|
|
608
|
+
// Check supabase config exists
|
|
609
|
+
const configToml = await Bun.file(join(projectDir, "supabase/config.toml")).text();
|
|
610
|
+
expect(configToml).toContain("[api]");
|
|
611
|
+
expect(configToml).toContain("[auth]");
|
|
612
|
+
|
|
613
|
+
// Check migration exists
|
|
614
|
+
const migration = await Bun.file(
|
|
615
|
+
join(projectDir, "supabase/migrations/00000000000000_init.sql"),
|
|
616
|
+
).text();
|
|
617
|
+
expect(migration.toLowerCase()).toContain("create table");
|
|
618
|
+
});
|
|
619
|
+
});
|