@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,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Tool Preset - Node.js/TypeScript
|
|
3
|
+
*
|
|
4
|
+
* Initializes .arbiter/ directory for a Node.js CLI tool or library.
|
|
5
|
+
* Creates minimal structure - use `arbiter sync` to detect packages.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { dirname, resolve } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
13
|
+
|
|
14
|
+
export default function (data) {
|
|
15
|
+
return [
|
|
16
|
+
// Create .arbiter/README.md
|
|
17
|
+
{
|
|
18
|
+
type: "add",
|
|
19
|
+
path: "{{projectDir}}/.arbiter/README.md",
|
|
20
|
+
templateFile: `${templatesDir}/README.md.hbs`,
|
|
21
|
+
data: {
|
|
22
|
+
...data,
|
|
23
|
+
presetId: "cli-node",
|
|
24
|
+
language: "typescript",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
// Create .arbiter/config.json
|
|
28
|
+
{
|
|
29
|
+
type: "add",
|
|
30
|
+
path: "{{projectDir}}/.arbiter/config.json",
|
|
31
|
+
templateFile: `${templatesDir}/config.json.hbs`,
|
|
32
|
+
data: {
|
|
33
|
+
...data,
|
|
34
|
+
presetId: "cli-node",
|
|
35
|
+
language: "typescript",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const id = "cli-node";
|
|
42
|
+
export const name = "CLI Tool (Node.js/TypeScript)";
|
|
43
|
+
export const description = "Command-line tool or library using Node.js/TypeScript/Bun";
|
|
44
|
+
export const language = "typescript";
|
|
45
|
+
export const category = "cli";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: project
|
|
3
|
+
entityId: {{uuid}}
|
|
4
|
+
createdAt: {{timestamp}}
|
|
5
|
+
updatedAt: {{timestamp}}
|
|
6
|
+
preset: {{presetId}}
|
|
7
|
+
language: {{language}}
|
|
8
|
+
tags:
|
|
9
|
+
- cli
|
|
10
|
+
- {{language}}
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# {{name}}
|
|
14
|
+
|
|
15
|
+
Command-line tool built with {{language}}.
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
Run `arbiter sync` to detect packages and create service entities.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
arbiter sync
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Viewing Your Spec
|
|
26
|
+
|
|
27
|
+
- **CLI**: `arbiter list service`, `arbiter list package`
|
|
28
|
+
- **Browser**: `arbiter view` to start documentation server
|
|
29
|
+
- **Obsidian**: Open `.arbiter/` folder as a vault
|
|
30
|
+
|
|
31
|
+
## Adding Entities
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Add a service
|
|
35
|
+
arbiter add service my-service --language {{language}}
|
|
36
|
+
|
|
37
|
+
# Add a task
|
|
38
|
+
arbiter add task "Implement feature X"
|
|
39
|
+
|
|
40
|
+
# Add a group (milestone)
|
|
41
|
+
arbiter add group "v1.0 Release"
|
|
42
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Tool Preset - Python
|
|
3
|
+
*
|
|
4
|
+
* Initializes .arbiter/ directory for a Python CLI tool or library.
|
|
5
|
+
* Creates minimal structure - use `arbiter sync` to detect packages.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { dirname, resolve } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
13
|
+
|
|
14
|
+
export default function (data) {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
type: "add",
|
|
18
|
+
path: "{{projectDir}}/.arbiter/README.md",
|
|
19
|
+
templateFile: `${templatesDir}/README.md.hbs`,
|
|
20
|
+
data: {
|
|
21
|
+
...data,
|
|
22
|
+
presetId: "cli-python",
|
|
23
|
+
language: "python",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: "add",
|
|
28
|
+
path: "{{projectDir}}/.arbiter/config.json",
|
|
29
|
+
templateFile: `${templatesDir}/config.json.hbs`,
|
|
30
|
+
data: {
|
|
31
|
+
...data,
|
|
32
|
+
presetId: "cli-python",
|
|
33
|
+
language: "python",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const id = "cli-python";
|
|
40
|
+
export const name = "CLI Tool (Python)";
|
|
41
|
+
export const description = "Command-line tool or library using Python";
|
|
42
|
+
export const language = "python";
|
|
43
|
+
export const category = "cli";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: project
|
|
3
|
+
entityId: {{uuid}}
|
|
4
|
+
createdAt: {{timestamp}}
|
|
5
|
+
updatedAt: {{timestamp}}
|
|
6
|
+
preset: {{presetId}}
|
|
7
|
+
language: {{language}}
|
|
8
|
+
tags:
|
|
9
|
+
- cli
|
|
10
|
+
- {{language}}
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# {{name}}
|
|
14
|
+
|
|
15
|
+
Command-line tool built with {{language}}.
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
Run `arbiter sync` to detect packages and create service entities.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
arbiter sync
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Viewing Your Spec
|
|
26
|
+
|
|
27
|
+
- **CLI**: `arbiter list service`, `arbiter list package`
|
|
28
|
+
- **Browser**: `arbiter view` to start documentation server
|
|
29
|
+
- **Obsidian**: Open `.arbiter/` folder as a vault
|
|
30
|
+
|
|
31
|
+
## Adding Entities
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Add a service
|
|
35
|
+
arbiter add service my-service --language {{language}}
|
|
36
|
+
|
|
37
|
+
# Add a task
|
|
38
|
+
arbiter add task "Implement feature X"
|
|
39
|
+
|
|
40
|
+
# Add a group (milestone)
|
|
41
|
+
arbiter add group "v1.0 Release"
|
|
42
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Tool Preset - Rust
|
|
3
|
+
*
|
|
4
|
+
* Initializes .arbiter/ directory for a Rust CLI tool or library.
|
|
5
|
+
* Creates minimal structure - use `arbiter sync` to detect packages.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { dirname, resolve } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const templatesDir = resolve(__dirname, "templates");
|
|
13
|
+
|
|
14
|
+
export default function (data) {
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
type: "add",
|
|
18
|
+
path: "{{projectDir}}/.arbiter/README.md",
|
|
19
|
+
templateFile: `${templatesDir}/README.md.hbs`,
|
|
20
|
+
data: {
|
|
21
|
+
...data,
|
|
22
|
+
presetId: "cli-rust",
|
|
23
|
+
language: "rust",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: "add",
|
|
28
|
+
path: "{{projectDir}}/.arbiter/config.json",
|
|
29
|
+
templateFile: `${templatesDir}/config.json.hbs`,
|
|
30
|
+
data: {
|
|
31
|
+
...data,
|
|
32
|
+
presetId: "cli-rust",
|
|
33
|
+
language: "rust",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const id = "cli-rust";
|
|
40
|
+
export const name = "CLI Tool (Rust)";
|
|
41
|
+
export const description = "Command-line tool or library using Rust";
|
|
42
|
+
export const language = "rust";
|
|
43
|
+
export const category = "cli";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: project
|
|
3
|
+
entityId: {{uuid}}
|
|
4
|
+
createdAt: {{timestamp}}
|
|
5
|
+
updatedAt: {{timestamp}}
|
|
6
|
+
preset: {{presetId}}
|
|
7
|
+
language: {{language}}
|
|
8
|
+
tags:
|
|
9
|
+
- cli
|
|
10
|
+
- {{language}}
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# {{name}}
|
|
14
|
+
|
|
15
|
+
Command-line tool built with {{language}}.
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
Run `arbiter sync` to detect packages and create service entities.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
arbiter sync
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Viewing Your Spec
|
|
26
|
+
|
|
27
|
+
- **CLI**: `arbiter list service`, `arbiter list package`
|
|
28
|
+
- **Browser**: `arbiter view` to start documentation server
|
|
29
|
+
- **Obsidian**: Open `.arbiter/` folder as a vault
|
|
30
|
+
|
|
31
|
+
## Adding Entities
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Add a service
|
|
35
|
+
arbiter add service my-service --language {{language}}
|
|
36
|
+
|
|
37
|
+
# Add a task
|
|
38
|
+
arbiter add task "Implement feature X"
|
|
39
|
+
|
|
40
|
+
# Add a group (milestone)
|
|
41
|
+
arbiter add group "v1.0 Release"
|
|
42
|
+
```
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preset Loader
|
|
3
|
+
*
|
|
4
|
+
* Discovers and loads init presets from:
|
|
5
|
+
* 1. Project-level: .arbiter/presets/
|
|
6
|
+
* 2. User-level: ~/.arbiter/presets/
|
|
7
|
+
* 3. Built-in: this directory
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { homedir } from "node:os";
|
|
11
|
+
import { dirname, join, resolve } from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
import { pathExists, readdir } from "fs-extra";
|
|
14
|
+
|
|
15
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get search paths for presets (project → user → builtin)
|
|
19
|
+
*/
|
|
20
|
+
export function getPresetSearchPaths(projectDir) {
|
|
21
|
+
const paths = [];
|
|
22
|
+
|
|
23
|
+
// Project-level presets
|
|
24
|
+
if (projectDir) {
|
|
25
|
+
paths.push(join(projectDir, ".arbiter", "presets"));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// User-level presets
|
|
29
|
+
paths.push(join(homedir(), ".arbiter", "presets"));
|
|
30
|
+
|
|
31
|
+
// Built-in presets
|
|
32
|
+
paths.push(__dirname);
|
|
33
|
+
|
|
34
|
+
return paths;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* List all available presets
|
|
39
|
+
*/
|
|
40
|
+
export async function listPresets(projectDir) {
|
|
41
|
+
const presets = new Map(); // Use Map to handle overrides (first found wins)
|
|
42
|
+
const searchPaths = getPresetSearchPaths(projectDir);
|
|
43
|
+
|
|
44
|
+
for (const basePath of searchPaths) {
|
|
45
|
+
if (!(await pathExists(basePath))) continue;
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const entries = await readdir(basePath, { withFileTypes: true });
|
|
49
|
+
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
if (!entry.isDirectory()) continue;
|
|
52
|
+
if (entry.name.startsWith("_") || entry.name.startsWith(".")) continue;
|
|
53
|
+
if (entry.name === "loader.js") continue;
|
|
54
|
+
|
|
55
|
+
// Check if module.js exists
|
|
56
|
+
const modulePath = join(basePath, entry.name, "module.js");
|
|
57
|
+
if (!(await pathExists(modulePath))) continue;
|
|
58
|
+
|
|
59
|
+
// Only add if not already found (project overrides user overrides builtin)
|
|
60
|
+
if (!presets.has(entry.name)) {
|
|
61
|
+
try {
|
|
62
|
+
const mod = await import(modulePath);
|
|
63
|
+
presets.set(entry.name, {
|
|
64
|
+
id: mod.id || entry.name,
|
|
65
|
+
name: mod.name || entry.name,
|
|
66
|
+
description: mod.description || "",
|
|
67
|
+
language: mod.language,
|
|
68
|
+
category: mod.category,
|
|
69
|
+
path: modulePath,
|
|
70
|
+
source:
|
|
71
|
+
basePath === __dirname
|
|
72
|
+
? "builtin"
|
|
73
|
+
: basePath.includes(".arbiter/presets")
|
|
74
|
+
? "project"
|
|
75
|
+
: "user",
|
|
76
|
+
});
|
|
77
|
+
} catch (err) {
|
|
78
|
+
console.warn(`Warning: Failed to load preset ${entry.name}: ${err.message}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} catch {
|
|
83
|
+
// Directory not readable
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return Array.from(presets.values());
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Load a preset module by ID
|
|
92
|
+
*/
|
|
93
|
+
export async function loadPreset(presetId, projectDir) {
|
|
94
|
+
const searchPaths = getPresetSearchPaths(projectDir);
|
|
95
|
+
|
|
96
|
+
for (const basePath of searchPaths) {
|
|
97
|
+
const modulePath = join(basePath, presetId, "module.js");
|
|
98
|
+
|
|
99
|
+
if (await pathExists(modulePath)) {
|
|
100
|
+
return import(modulePath);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
throw new Error(`Preset not found: ${presetId}`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Execute a preset with the given context
|
|
109
|
+
*/
|
|
110
|
+
export async function executePreset(presetId, context, projectDir) {
|
|
111
|
+
const mod = await loadPreset(presetId, projectDir);
|
|
112
|
+
|
|
113
|
+
if (typeof mod.default !== "function") {
|
|
114
|
+
throw new Error(`Preset ${presetId} does not export a default function`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return mod.default(context);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default {
|
|
121
|
+
getPresetSearchPaths,
|
|
122
|
+
listPresets,
|
|
123
|
+
loadPreset,
|
|
124
|
+
executePreset,
|
|
125
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plop Generator for TypeScript Services
|
|
3
|
+
*
|
|
4
|
+
* Generates a TypeScript service with Express/Hono structure.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export default function (plop) {
|
|
8
|
+
// Case helpers
|
|
9
|
+
plop.setHelper("camelCase", (str) => {
|
|
10
|
+
if (!str) return "";
|
|
11
|
+
return str
|
|
12
|
+
.replace(/[-_\s]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ""))
|
|
13
|
+
.replace(/^(.)/, (c) => c.toLowerCase());
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
plop.setHelper("pascalCase", (str) => {
|
|
17
|
+
if (!str) return "";
|
|
18
|
+
return str
|
|
19
|
+
.replace(/[-_\s]+(.)?/g, (_, c) => (c ? c.toUpperCase() : ""))
|
|
20
|
+
.replace(/^(.)/, (c) => c.toUpperCase());
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
plop.setHelper("kebabCase", (str) => {
|
|
24
|
+
if (!str) return "";
|
|
25
|
+
return str
|
|
26
|
+
.replace(/([a-z])([A-Z])/g, "$1-$2")
|
|
27
|
+
.replace(/[_\s]+/g, "-")
|
|
28
|
+
.toLowerCase();
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
plop.setHelper("snakeCase", (str) => {
|
|
32
|
+
if (!str) return "";
|
|
33
|
+
return str
|
|
34
|
+
.replace(/([a-z])([A-Z])/g, "$1_$2")
|
|
35
|
+
.replace(/[-\s]+/g, "_")
|
|
36
|
+
.toLowerCase();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// Default generator
|
|
40
|
+
plop.setGenerator("default", {
|
|
41
|
+
description: "Generate a TypeScript service",
|
|
42
|
+
prompts: [
|
|
43
|
+
{
|
|
44
|
+
type: "input",
|
|
45
|
+
name: "name",
|
|
46
|
+
message: "Service name:",
|
|
47
|
+
when: (answers) => !answers.name,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: "list",
|
|
51
|
+
name: "framework",
|
|
52
|
+
message: "Framework:",
|
|
53
|
+
choices: ["hono", "express", "fastify"],
|
|
54
|
+
default: "hono",
|
|
55
|
+
when: (answers) => !answers.framework,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "confirm",
|
|
59
|
+
name: "includeDb",
|
|
60
|
+
message: "Include database setup?",
|
|
61
|
+
default: true,
|
|
62
|
+
when: (answers) => answers.includeDb === undefined,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
actions: (data) => {
|
|
66
|
+
const actions = [];
|
|
67
|
+
const basePath = "{{kebabCase name}}";
|
|
68
|
+
|
|
69
|
+
// Package.json
|
|
70
|
+
actions.push({
|
|
71
|
+
type: "add",
|
|
72
|
+
path: `${basePath}/package.json`,
|
|
73
|
+
templateFile: "templates/package.json.hbs",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Main entry
|
|
77
|
+
actions.push({
|
|
78
|
+
type: "add",
|
|
79
|
+
path: `${basePath}/src/index.ts`,
|
|
80
|
+
templateFile: "templates/index.ts.hbs",
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Routes
|
|
84
|
+
actions.push({
|
|
85
|
+
type: "add",
|
|
86
|
+
path: `${basePath}/src/routes/index.ts`,
|
|
87
|
+
templateFile: "templates/routes/index.ts.hbs",
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Health route
|
|
91
|
+
actions.push({
|
|
92
|
+
type: "add",
|
|
93
|
+
path: `${basePath}/src/routes/health.ts`,
|
|
94
|
+
templateFile: "templates/routes/health.ts.hbs",
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// Config
|
|
98
|
+
actions.push({
|
|
99
|
+
type: "add",
|
|
100
|
+
path: `${basePath}/src/config.ts`,
|
|
101
|
+
templateFile: "templates/config.ts.hbs",
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Types
|
|
105
|
+
actions.push({
|
|
106
|
+
type: "add",
|
|
107
|
+
path: `${basePath}/src/types.ts`,
|
|
108
|
+
templateFile: "templates/types.ts.hbs",
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Database setup if requested
|
|
112
|
+
if (data.includeDb) {
|
|
113
|
+
actions.push({
|
|
114
|
+
type: "add",
|
|
115
|
+
path: `${basePath}/src/db/index.ts`,
|
|
116
|
+
templateFile: "templates/db/index.ts.hbs",
|
|
117
|
+
});
|
|
118
|
+
actions.push({
|
|
119
|
+
type: "add",
|
|
120
|
+
path: `${basePath}/src/db/schema.ts`,
|
|
121
|
+
templateFile: "templates/db/schema.ts.hbs",
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Dockerfile
|
|
126
|
+
actions.push({
|
|
127
|
+
type: "add",
|
|
128
|
+
path: `${basePath}/Dockerfile`,
|
|
129
|
+
templateFile: "templates/Dockerfile.hbs",
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// TypeScript config
|
|
133
|
+
actions.push({
|
|
134
|
+
type: "add",
|
|
135
|
+
path: `${basePath}/tsconfig.json`,
|
|
136
|
+
templateFile: "templates/tsconfig.json.hbs",
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
// README
|
|
140
|
+
actions.push({
|
|
141
|
+
type: "add",
|
|
142
|
+
path: `${basePath}/README.md`,
|
|
143
|
+
templateFile: "templates/README.md.hbs",
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
return actions;
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// Component generator
|
|
151
|
+
plop.setGenerator("component", {
|
|
152
|
+
description: "Generate a service component (route, middleware, etc.)",
|
|
153
|
+
prompts: [
|
|
154
|
+
{
|
|
155
|
+
type: "list",
|
|
156
|
+
name: "type",
|
|
157
|
+
message: "Component type:",
|
|
158
|
+
choices: ["route", "middleware", "service", "model"],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
type: "input",
|
|
162
|
+
name: "name",
|
|
163
|
+
message: "Component name:",
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
actions: (data) => {
|
|
167
|
+
const actions = [];
|
|
168
|
+
const folder =
|
|
169
|
+
data.type === "route"
|
|
170
|
+
? "routes"
|
|
171
|
+
: data.type === "middleware"
|
|
172
|
+
? "middleware"
|
|
173
|
+
: data.type === "model"
|
|
174
|
+
? "db"
|
|
175
|
+
: "services";
|
|
176
|
+
|
|
177
|
+
actions.push({
|
|
178
|
+
type: "add",
|
|
179
|
+
path: `src/${folder}/{{kebabCase name}}.ts`,
|
|
180
|
+
templateFile: `templates/component/${data.type}.ts.hbs`,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
return actions;
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
FROM oven/bun:1 AS base
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
|
|
4
|
+
# Install dependencies
|
|
5
|
+
FROM base AS deps
|
|
6
|
+
COPY package.json bun.lockb* ./
|
|
7
|
+
RUN bun install --frozen-lockfile
|
|
8
|
+
|
|
9
|
+
# Build
|
|
10
|
+
FROM base AS builder
|
|
11
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
12
|
+
COPY . .
|
|
13
|
+
RUN bun run build
|
|
14
|
+
|
|
15
|
+
# Production
|
|
16
|
+
FROM base AS runner
|
|
17
|
+
ENV NODE_ENV=production
|
|
18
|
+
|
|
19
|
+
RUN addgroup --system --gid 1001 nodejs
|
|
20
|
+
RUN adduser --system --uid 1001 service
|
|
21
|
+
USER service
|
|
22
|
+
|
|
23
|
+
COPY --from=builder /app/dist ./dist
|
|
24
|
+
COPY --from=builder /app/package.json ./
|
|
25
|
+
|
|
26
|
+
EXPOSE 3000
|
|
27
|
+
ENV PORT=3000
|
|
28
|
+
|
|
29
|
+
CMD ["bun", "run", "start"]
|