@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.
Files changed (302) hide show
  1. package/README.md +222 -0
  2. package/dist/cli.js +28718 -0
  3. package/dist/templates/plopfiles/__tests__/build-systems.test.ts +730 -0
  4. package/dist/templates/plopfiles/__tests__/e2e.test.ts +451 -0
  5. package/dist/templates/plopfiles/__tests__/generation.test.ts +384 -0
  6. package/dist/templates/plopfiles/__tests__/linting.test.ts +854 -0
  7. package/dist/templates/plopfiles/__tests__/modules.test.ts +278 -0
  8. package/dist/templates/plopfiles/__tests__/smoke.test.ts +619 -0
  9. package/dist/templates/plopfiles/__tests__/templates.test.ts +341 -0
  10. package/dist/templates/plopfiles/_modules/backends/go-chi/module.js +43 -0
  11. package/dist/templates/plopfiles/_modules/backends/go-chi/templates/.air.toml.hbs +30 -0
  12. package/dist/templates/plopfiles/_modules/backends/go-chi/templates/cmd/server/main.go.hbs +50 -0
  13. package/dist/templates/plopfiles/_modules/backends/go-chi/templates/go.mod.hbs +9 -0
  14. package/dist/templates/plopfiles/_modules/backends/go-chi/templates/internal/handlers/health.go.hbs +51 -0
  15. package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/module.js +38 -0
  16. package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/build.gradle.kts.hbs +37 -0
  17. package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/settings.gradle.kts.hbs +1 -0
  18. package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/kotlin/Application.kt.hbs +44 -0
  19. package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/kotlin/routes/Health.kt.hbs +41 -0
  20. package/dist/templates/plopfiles/_modules/backends/kotlin-ktor/templates/src/main/resources/logback.xml.hbs +11 -0
  21. package/dist/templates/plopfiles/_modules/backends/node-express/module.js +54 -0
  22. package/dist/templates/plopfiles/_modules/backends/node-express/templates/src/index.ts.hbs +37 -0
  23. package/dist/templates/plopfiles/_modules/backends/node-express/templates/src/routes/health.ts.hbs +21 -0
  24. package/dist/templates/plopfiles/_modules/backends/node-express/templates/tsconfig.json.hbs +18 -0
  25. package/dist/templates/plopfiles/_modules/backends/node-hono/module.js +56 -0
  26. package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/index.ts.hbs +30 -0
  27. package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/health.ts.hbs +64 -0
  28. package/dist/templates/plopfiles/_modules/backends/node-hono/templates/src/routes/index.ts.hbs +38 -0
  29. package/dist/templates/plopfiles/_modules/backends/node-hono/templates/tsconfig.json.hbs +20 -0
  30. package/dist/templates/plopfiles/_modules/backends/node-hono/templates/typedoc.json.hbs +25 -0
  31. package/dist/templates/plopfiles/_modules/backends/python-fastapi/module.js +65 -0
  32. package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/__init__.py.hbs +1 -0
  33. package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/config.py.hbs +28 -0
  34. package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/main.py.hbs +40 -0
  35. package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/routers/__init__.py.hbs +1 -0
  36. package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/app/routers/health.py.hbs +24 -0
  37. package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/pyproject.toml.hbs +40 -0
  38. package/dist/templates/plopfiles/_modules/backends/python-fastapi/templates/requirements.txt.hbs +6 -0
  39. package/dist/templates/plopfiles/_modules/backends/rust-axum/module.js +44 -0
  40. package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/Cargo.toml.hbs +23 -0
  41. package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/src/health.rs.hbs +41 -0
  42. package/dist/templates/plopfiles/_modules/backends/rust-axum/templates/src/main.rs.hbs +57 -0
  43. package/dist/templates/plopfiles/_modules/cloud/aws/module.js +33 -0
  44. package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-alb.tf.hbs +92 -0
  45. package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-ecs.tf.hbs +84 -0
  46. package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-iam.tf.hbs +60 -0
  47. package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws-vpc.tf.hbs +106 -0
  48. package/dist/templates/plopfiles/_modules/cloud/aws/templates/aws.tf.hbs +56 -0
  49. package/dist/templates/plopfiles/_modules/cloud/azure/module.js +31 -0
  50. package/dist/templates/plopfiles/_modules/cloud/azure/templates/azure-container-apps.tf.hbs +99 -0
  51. package/dist/templates/plopfiles/_modules/cloud/azure/templates/azure.tf.hbs +54 -0
  52. package/dist/templates/plopfiles/_modules/cloud/cloudflare/module.js +43 -0
  53. package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/src/types.d.ts.hbs +6 -0
  54. package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/src/worker.ts.hbs +51 -0
  55. package/dist/templates/plopfiles/_modules/cloud/cloudflare/templates/wrangler.toml.hbs +36 -0
  56. package/dist/templates/plopfiles/_modules/cloud/gcp/module.js +31 -0
  57. package/dist/templates/plopfiles/_modules/cloud/gcp/templates/gcp-cloudrun.tf.hbs +89 -0
  58. package/dist/templates/plopfiles/_modules/cloud/gcp/templates/gcp.tf.hbs +62 -0
  59. package/dist/templates/plopfiles/_modules/cloud/supabase/module.js +51 -0
  60. package/dist/templates/plopfiles/_modules/cloud/supabase/templates/src/lib/supabase.ts.hbs +25 -0
  61. package/dist/templates/plopfiles/_modules/cloud/supabase/templates/src/types/supabase.ts.hbs +52 -0
  62. package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/config.toml.hbs +71 -0
  63. package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/functions/hello/index.ts.hbs +34 -0
  64. package/dist/templates/plopfiles/_modules/cloud/supabase/templates/supabase/migrations/00000000000000_init.sql.hbs +60 -0
  65. package/dist/templates/plopfiles/_modules/composer.js +180 -0
  66. package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/drizzle.config.ts.hbs +10 -0
  67. package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/module.js +53 -0
  68. package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/templates/index.ts.hbs +15 -0
  69. package/dist/templates/plopfiles/_modules/databases/postgres-drizzle/templates/schema.ts.hbs +21 -0
  70. package/dist/templates/plopfiles/_modules/desktop/electron/module.js +51 -0
  71. package/dist/templates/plopfiles/_modules/desktop/electron/templates/forge.config.ts.hbs +38 -0
  72. package/dist/templates/plopfiles/_modules/desktop/electron/templates/package.json.hbs +22 -0
  73. package/dist/templates/plopfiles/_modules/desktop/electron/templates/src/main.ts.hbs +48 -0
  74. package/dist/templates/plopfiles/_modules/desktop/electron/templates/src/preload.ts.hbs +18 -0
  75. package/dist/templates/plopfiles/_modules/desktop/electron/templates/tsconfig.json.hbs +14 -0
  76. package/dist/templates/plopfiles/_modules/desktop/tauri/module.js +38 -0
  77. package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/Cargo.toml.hbs +20 -0
  78. package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/build.rs.hbs +3 -0
  79. package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/src/main.rs.hbs +30 -0
  80. package/dist/templates/plopfiles/_modules/desktop/tauri/templates/src-tauri/tauri.conf.json.hbs +44 -0
  81. package/dist/templates/plopfiles/_modules/docs/mkdocs/module.js +61 -0
  82. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/architecture/components.md.hbs +37 -0
  83. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/architecture/overview.md.hbs +43 -0
  84. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/contributing/development.md.hbs +164 -0
  85. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/contributing/guidelines.md.hbs +50 -0
  86. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/configuration.md.hbs +37 -0
  87. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/installation.md.hbs +53 -0
  88. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/getting-started/quickstart.md.hbs +39 -0
  89. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/index.md.hbs +44 -0
  90. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/javascripts/extra.js.hbs +23 -0
  91. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/docs/stylesheets/extra.css.hbs +51 -0
  92. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/mkdocs.yml.hbs +141 -0
  93. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/requirements-docs.txt.hbs +15 -0
  94. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/scripts/aggregate-docs.mjs.hbs +188 -0
  95. package/dist/templates/plopfiles/_modules/docs/mkdocs/templates/scripts/gen_ref_pages.py.hbs +54 -0
  96. package/dist/templates/plopfiles/_modules/frontends/react-vite/module.js +60 -0
  97. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/index.html.hbs +13 -0
  98. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/nginx.conf.hbs +31 -0
  99. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/postcss.config.js.hbs +6 -0
  100. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/App.tsx.hbs +12 -0
  101. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/index.css.hbs +25 -0
  102. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/lib/api.ts.hbs +52 -0
  103. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/main.tsx.hbs +18 -0
  104. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/src/pages/Home.tsx.hbs +31 -0
  105. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tailwind.config.js.hbs +8 -0
  106. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tsconfig.json.hbs +25 -0
  107. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/tsconfig.node.json.hbs +10 -0
  108. package/dist/templates/plopfiles/_modules/frontends/react-vite/templates/vite.config.ts.hbs +21 -0
  109. package/dist/templates/plopfiles/_modules/frontends/solid-vite/module.js +51 -0
  110. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/index.html.hbs +13 -0
  111. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/postcss.config.js.hbs +6 -0
  112. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/App.tsx.hbs +12 -0
  113. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/index.css.hbs +3 -0
  114. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/index.tsx.hbs +21 -0
  115. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/lib/api.ts.hbs +52 -0
  116. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/src/pages/Home.tsx.hbs +34 -0
  117. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/tailwind.config.js.hbs +8 -0
  118. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/tsconfig.json.hbs +24 -0
  119. package/dist/templates/plopfiles/_modules/frontends/solid-vite/templates/vite.config.ts.hbs +21 -0
  120. package/dist/templates/plopfiles/_modules/frontends/vue-vite/module.js +54 -0
  121. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/index.html.hbs +13 -0
  122. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/postcss.config.js.hbs +6 -0
  123. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/App.vue.hbs +9 -0
  124. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/index.css.hbs +3 -0
  125. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/lib/api.ts.hbs +52 -0
  126. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/main.ts.hbs +14 -0
  127. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/pages/Home.vue.hbs +27 -0
  128. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/src/router.ts.hbs +13 -0
  129. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/tailwind.config.js.hbs +8 -0
  130. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/tsconfig.json.hbs +25 -0
  131. package/dist/templates/plopfiles/_modules/frontends/vue-vite/templates/vite.config.ts.hbs +21 -0
  132. package/dist/templates/plopfiles/_modules/infra/docker-compose/module.js +52 -0
  133. package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/Dockerfile.backend.hbs +32 -0
  134. package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/Dockerfile.frontend.hbs +31 -0
  135. package/dist/templates/plopfiles/_modules/infra/docker-compose/templates/docker-compose.yml.hbs +97 -0
  136. package/dist/templates/plopfiles/_modules/infra/github-actions/module.js +24 -0
  137. package/dist/templates/plopfiles/_modules/infra/github-actions/templates/.github/workflows/ci.yml.hbs +78 -0
  138. package/dist/templates/plopfiles/_modules/infra/github-actions/templates/.github/workflows/deploy.yml.hbs +60 -0
  139. package/dist/templates/plopfiles/_modules/infra/just/module.js +26 -0
  140. package/dist/templates/plopfiles/_modules/infra/just/templates/justfile.hbs +205 -0
  141. package/dist/templates/plopfiles/_modules/infra/kubernetes/module.js +30 -0
  142. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/deployment.yaml.hbs +48 -0
  143. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/ingress.yaml.hbs +23 -0
  144. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/kustomization.yaml.hbs +11 -0
  145. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/base/service.yaml.hbs +15 -0
  146. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/dev/deployment-patch.yaml.hbs +17 -0
  147. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/dev/kustomization.yaml.hbs +15 -0
  148. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/prod/deployment-patch.yaml.hbs +17 -0
  149. package/dist/templates/plopfiles/_modules/infra/kubernetes/templates/k8s/overlays/prod/kustomization.yaml.hbs +15 -0
  150. package/dist/templates/plopfiles/_modules/infra/pulumi/module.js +30 -0
  151. package/dist/templates/plopfiles/_modules/infra/pulumi/templates/.gitignore.hbs +5 -0
  152. package/dist/templates/plopfiles/_modules/infra/pulumi/templates/Pulumi.dev.yaml.hbs +3 -0
  153. package/dist/templates/plopfiles/_modules/infra/pulumi/templates/Pulumi.yaml.hbs +7 -0
  154. package/dist/templates/plopfiles/_modules/infra/pulumi/templates/index.ts.hbs +26 -0
  155. package/dist/templates/plopfiles/_modules/infra/pulumi/templates/package.json.hbs +12 -0
  156. package/dist/templates/plopfiles/_modules/infra/pulumi/templates/tsconfig.json.hbs +16 -0
  157. package/dist/templates/plopfiles/_modules/infra/terraform/module.js +31 -0
  158. package/dist/templates/plopfiles/_modules/infra/terraform/templates/.gitignore.hbs +12 -0
  159. package/dist/templates/plopfiles/_modules/infra/terraform/templates/main.tf.hbs +34 -0
  160. package/dist/templates/plopfiles/_modules/infra/terraform/templates/outputs.tf.hbs +15 -0
  161. package/dist/templates/plopfiles/_modules/infra/terraform/templates/terraform.tfvars.example.hbs +6 -0
  162. package/dist/templates/plopfiles/_modules/infra/terraform/templates/variables.tf.hbs +30 -0
  163. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/module.js +38 -0
  164. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/build.gradle.kts.hbs +102 -0
  165. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/proguard-rules.pro.hbs +20 -0
  166. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/AndroidManifest.xml.hbs +25 -0
  167. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ApiClient.kt.hbs +38 -0
  168. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/App.kt.hbs +116 -0
  169. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/MainActivity.kt.hbs +28 -0
  170. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Color.kt.hbs +11 -0
  171. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Theme.kt.hbs +55 -0
  172. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/kotlin/com/example/app/ui/theme/Type.kt.hbs +31 -0
  173. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/res/values/strings.xml.hbs +3 -0
  174. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/app/src/main/res/values/themes.xml.hbs +4 -0
  175. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/build.gradle.kts.hbs +6 -0
  176. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/gradle.properties.hbs +4 -0
  177. package/dist/templates/plopfiles/_modules/mobile/android-kotlin/templates/settings.gradle.kts.hbs +18 -0
  178. package/dist/templates/plopfiles/_modules/mobile/flutter/module.js +36 -0
  179. package/dist/templates/plopfiles/_modules/mobile/flutter/templates/.env.hbs +1 -0
  180. package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/main.dart.hbs +29 -0
  181. package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/screens/home_screen.dart.hbs +88 -0
  182. package/dist/templates/plopfiles/_modules/mobile/flutter/templates/lib/services/api_service.dart.hbs +61 -0
  183. package/dist/templates/plopfiles/_modules/mobile/flutter/templates/pubspec.yaml.hbs +25 -0
  184. package/dist/templates/plopfiles/_modules/mobile/ios-swift/module.js +39 -0
  185. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/App.swift.hbs +10 -0
  186. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/AccentColor.colorset/Contents.json.hbs +11 -0
  187. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/AppIcon.appiconset/Contents.json.hbs +13 -0
  188. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Assets.xcassets/Contents.json.hbs +6 -0
  189. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/ContentView.swift.hbs +13 -0
  190. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Services/APIClient.swift.hbs +58 -0
  191. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/DetailsView.swift.hbs +22 -0
  192. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App/Views/HomeView.swift.hbs +62 -0
  193. package/dist/templates/plopfiles/_modules/mobile/ios-swift/templates/App.xcodeproj/project.pbxproj.hbs +363 -0
  194. package/dist/templates/plopfiles/_modules/mobile/react-native/module.js +36 -0
  195. package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app/_layout.tsx.hbs +16 -0
  196. package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app/index.tsx.hbs +66 -0
  197. package/dist/templates/plopfiles/_modules/mobile/react-native/templates/app.json.hbs +37 -0
  198. package/dist/templates/plopfiles/_modules/mobile/react-native/templates/package.json.hbs +29 -0
  199. package/dist/templates/plopfiles/_modules/mobile/react-native/templates/src/lib/api.ts.hbs +52 -0
  200. package/dist/templates/plopfiles/_modules/mobile/react-native/templates/tsconfig.json.hbs +11 -0
  201. package/dist/templates/plopfiles/_modules/quality/biome/module.js +44 -0
  202. package/dist/templates/plopfiles/_modules/quality/biome/templates/biome.json.hbs +126 -0
  203. package/dist/templates/plopfiles/_modules/quality/clippy/module.js +40 -0
  204. package/dist/templates/plopfiles/_modules/quality/clippy/templates/clippy.toml.hbs +29 -0
  205. package/dist/templates/plopfiles/_modules/quality/clippy/templates/rustfmt.toml.hbs +44 -0
  206. package/dist/templates/plopfiles/_modules/quality/golangci-lint/module.js +40 -0
  207. package/dist/templates/plopfiles/_modules/quality/golangci-lint/templates/.golangci.yml.hbs +199 -0
  208. package/dist/templates/plopfiles/_modules/quality/ruff/module.js +43 -0
  209. package/dist/templates/plopfiles/_modules/quality/ruff/templates/mypy.ini.hbs +48 -0
  210. package/dist/templates/plopfiles/_modules/quality/ruff/templates/ruff.toml.hbs +111 -0
  211. package/dist/templates/plopfiles/_modules/storybook/react-storybook/module.js +54 -0
  212. package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/.storybook/main.ts.hbs +44 -0
  213. package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/.storybook/preview.ts.hbs +68 -0
  214. package/dist/templates/plopfiles/_modules/storybook/react-storybook/templates/src/stories/Button.stories.tsx.hbs +158 -0
  215. package/dist/templates/plopfiles/_modules/types.ts +98 -0
  216. package/dist/templates/plopfiles/full-stack/plopfile.js +132 -0
  217. package/dist/templates/plopfiles/full-stack/templates/gitignore.hbs +44 -0
  218. package/dist/templates/plopfiles/full-stack/templates/package.json.hbs +21 -0
  219. package/dist/templates/plopfiles/presets/cli-go/module.js +43 -0
  220. package/dist/templates/plopfiles/presets/cli-go/templates/README.md.hbs +42 -0
  221. package/dist/templates/plopfiles/presets/cli-go/templates/config.json.hbs +9 -0
  222. package/dist/templates/plopfiles/presets/cli-node/module.js +45 -0
  223. package/dist/templates/plopfiles/presets/cli-node/templates/README.md.hbs +42 -0
  224. package/dist/templates/plopfiles/presets/cli-node/templates/config.json.hbs +9 -0
  225. package/dist/templates/plopfiles/presets/cli-python/module.js +43 -0
  226. package/dist/templates/plopfiles/presets/cli-python/templates/README.md.hbs +42 -0
  227. package/dist/templates/plopfiles/presets/cli-python/templates/config.json.hbs +9 -0
  228. package/dist/templates/plopfiles/presets/cli-rust/module.js +43 -0
  229. package/dist/templates/plopfiles/presets/cli-rust/templates/README.md.hbs +42 -0
  230. package/dist/templates/plopfiles/presets/cli-rust/templates/config.json.hbs +9 -0
  231. package/dist/templates/plopfiles/presets/loader.js +125 -0
  232. package/dist/templates/plopfiles/typescript-service/plopfile.js +186 -0
  233. package/dist/templates/plopfiles/typescript-service/templates/Dockerfile.hbs +29 -0
  234. package/dist/templates/plopfiles/typescript-service/templates/README.md.hbs +85 -0
  235. package/dist/templates/plopfiles/typescript-service/templates/config.ts.hbs +15 -0
  236. package/dist/templates/plopfiles/typescript-service/templates/db/index.ts.hbs +19 -0
  237. package/dist/templates/plopfiles/typescript-service/templates/db/schema.ts.hbs +16 -0
  238. package/dist/templates/plopfiles/typescript-service/templates/index.ts.hbs +89 -0
  239. package/dist/templates/plopfiles/typescript-service/templates/package.json.hbs +36 -0
  240. package/dist/templates/plopfiles/typescript-service/templates/routes/health.ts.hbs +61 -0
  241. package/dist/templates/plopfiles/typescript-service/templates/routes/index.ts.hbs +35 -0
  242. package/dist/templates/plopfiles/typescript-service/templates/tsconfig.json.hbs +24 -0
  243. package/dist/templates/plopfiles/typescript-service/templates/types.ts.hbs +28 -0
  244. package/dist/templates/typescript/component.module.css.tpl +6 -0
  245. package/dist/templates/typescript/component.test.tsx.tpl +9 -0
  246. package/dist/templates/typescript/component.tsx.tpl +17 -0
  247. package/dist/templates/typescript/component.types.ts.tpl +3 -0
  248. package/dist/templates/typescript/project/nextjs/app/globals.css.tpl +10 -0
  249. package/dist/templates/typescript/project/nextjs/app/layout.tsx.tpl +15 -0
  250. package/dist/templates/typescript/project/nextjs/app/page.tsx.tpl +8 -0
  251. package/dist/templates/typescript/project/nextjs/babel.config.js.tpl +8 -0
  252. package/dist/templates/typescript/project/nextjs/jest.config.js.tpl +10 -0
  253. package/dist/templates/typescript/project/nextjs/jest.setup.ts.tpl +6 -0
  254. package/dist/templates/typescript/project/nextjs/next-env.d.ts.tpl +5 -0
  255. package/dist/templates/typescript/project/nextjs/next.config.js.tpl +9 -0
  256. package/dist/templates/typescript/project/nextjs/package.json.tpl +1 -0
  257. package/dist/templates/typescript/project/nextjs/tsconfig.json.tpl +1 -0
  258. package/dist/templates/typescript/project/vite/App.css.tpl +8 -0
  259. package/dist/templates/typescript/project/vite/App.tsx.tpl +17 -0
  260. package/dist/templates/typescript/project/vite/index.css.tpl +8 -0
  261. package/dist/templates/typescript/project/vite/index.html.tpl +13 -0
  262. package/dist/templates/typescript/project/vite/main.tsx.tpl +10 -0
  263. package/dist/templates/typescript/project/vite/package.json.tpl +1 -0
  264. package/dist/templates/typescript/project/vite/test-setup.ts.tpl +1 -0
  265. package/dist/templates/typescript/project/vite/tsconfig.build.json.tpl +1 -0
  266. package/dist/templates/typescript/project/vite/tsconfig.json.tpl +1 -0
  267. package/dist/templates/typescript/project/vite/tsconfig.node.json.tpl +1 -0
  268. package/dist/templates/typescript/project/vite/vite.config.ts.tpl +18 -0
  269. package/dist/templates/typescript/service.api.ts.tpl +27 -0
  270. package/dist/templates/typescript/service.class.ts.tpl +28 -0
  271. package/dist/templates/typescript/service.handler.ts.tpl +42 -0
  272. package/dist/templates/typescript/service.schema.ts.tpl +16 -0
  273. package/package.json +95 -0
  274. package/templates/typescript/component.module.css.tpl +6 -0
  275. package/templates/typescript/component.test.tsx.tpl +9 -0
  276. package/templates/typescript/component.tsx.tpl +17 -0
  277. package/templates/typescript/component.types.ts.tpl +3 -0
  278. package/templates/typescript/project/nextjs/app/globals.css.tpl +10 -0
  279. package/templates/typescript/project/nextjs/app/layout.tsx.tpl +15 -0
  280. package/templates/typescript/project/nextjs/app/page.tsx.tpl +8 -0
  281. package/templates/typescript/project/nextjs/babel.config.js.tpl +8 -0
  282. package/templates/typescript/project/nextjs/jest.config.js.tpl +10 -0
  283. package/templates/typescript/project/nextjs/jest.setup.ts.tpl +6 -0
  284. package/templates/typescript/project/nextjs/next-env.d.ts.tpl +5 -0
  285. package/templates/typescript/project/nextjs/next.config.js.tpl +9 -0
  286. package/templates/typescript/project/nextjs/package.json.tpl +1 -0
  287. package/templates/typescript/project/nextjs/tsconfig.json.tpl +1 -0
  288. package/templates/typescript/project/vite/App.css.tpl +8 -0
  289. package/templates/typescript/project/vite/App.tsx.tpl +17 -0
  290. package/templates/typescript/project/vite/index.css.tpl +8 -0
  291. package/templates/typescript/project/vite/index.html.tpl +13 -0
  292. package/templates/typescript/project/vite/main.tsx.tpl +10 -0
  293. package/templates/typescript/project/vite/package.json.tpl +1 -0
  294. package/templates/typescript/project/vite/test-setup.ts.tpl +1 -0
  295. package/templates/typescript/project/vite/tsconfig.build.json.tpl +1 -0
  296. package/templates/typescript/project/vite/tsconfig.json.tpl +1 -0
  297. package/templates/typescript/project/vite/tsconfig.node.json.tpl +1 -0
  298. package/templates/typescript/project/vite/vite.config.ts.tpl +18 -0
  299. package/templates/typescript/service.api.ts.tpl +27 -0
  300. package/templates/typescript/service.class.ts.tpl +28 -0
  301. package/templates/typescript/service.handler.ts.tpl +42 -0
  302. 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
+ });