@flisk-sh/flisk 0.0.0-stage → 1.3.189
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/CHANGELOG.md +492 -0
- package/LICENSE +21 -0
- package/README.md +479 -2
- package/Tiltfile +151 -0
- package/cli/bin/flisk.js +42 -0
- package/cli/dist/agent-runtimes/custom.js +335 -0
- package/cli/dist/agent-runtimes/registry.js +34 -0
- package/cli/dist/backend-frameworks/elysia.js +38 -0
- package/cli/dist/backend-frameworks/express.js +49 -0
- package/cli/dist/backend-frameworks/fastify.js +43 -0
- package/cli/dist/backend-frameworks/h3.js +37 -0
- package/cli/dist/backend-frameworks/koa.js +47 -0
- package/cli/dist/backend-frameworks/mcp.js +86 -0
- package/cli/dist/backend-frameworks/nestjs.js +55 -0
- package/cli/dist/backend-frameworks/registry.js +134 -0
- package/cli/dist/backend-frameworks/types.js +1 -0
- package/cli/dist/backend-languages/bun.js +76 -0
- package/cli/dist/backend-languages/go.js +125 -0
- package/cli/dist/backend-languages/node.js +122 -0
- package/cli/dist/backend-languages/python.js +94 -0
- package/cli/dist/backend-languages/registry.js +37 -0
- package/cli/dist/backend-languages/rust.js +82 -0
- package/cli/dist/backend-languages/types.js +1 -0
- package/cli/dist/cli.js +29 -0
- package/cli/dist/commands/__tests__/project-e2e-helpers.js +49 -0
- package/cli/dist/commands/__tests__/ui-loading-screen.test.js +16 -0
- package/cli/dist/commands/agent.js +182 -0
- package/cli/dist/commands/completion-candidates.js +116 -0
- package/cli/dist/commands/completion.js +843 -0
- package/cli/dist/commands/config.js +362 -0
- package/cli/dist/commands/doctor.js +1504 -0
- package/cli/dist/commands/down.js +114 -0
- package/cli/dist/commands/eject.js +108 -0
- package/cli/dist/commands/help.js +152 -0
- package/cli/dist/commands/import.js +164 -0
- package/cli/dist/commands/logs.js +119 -0
- package/cli/dist/commands/maintainers.js +102 -0
- package/cli/dist/commands/mcp.js +28 -0
- package/cli/dist/commands/networks.js +306 -0
- package/cli/dist/commands/project.js +447 -0
- package/cli/dist/commands/projects.js +103 -0
- package/cli/dist/commands/registry.js +53 -0
- package/cli/dist/commands/resource.js +992 -0
- package/cli/dist/commands/resources.js +127 -0
- package/cli/dist/commands/restart.js +89 -0
- package/cli/dist/commands/runtime.js +75 -0
- package/cli/dist/commands/stack.js +171 -0
- package/cli/dist/commands/stacks.js +71 -0
- package/cli/dist/commands/status.js +211 -0
- package/cli/dist/commands/ui.js +725 -0
- package/cli/dist/commands/up.js +609 -0
- package/cli/dist/commands/upgrade.js +840 -0
- package/cli/dist/commands/version.js +10 -0
- package/cli/dist/components/Accessible.js +11 -0
- package/cli/dist/components/BaseTooltip.js +30 -0
- package/cli/dist/components/DetailPanel.js +33 -0
- package/cli/dist/components/FileTree.js +51 -0
- package/cli/dist/components/ResourceSelectInput.js +42 -0
- package/cli/dist/components/ResourceTable.js +35 -0
- package/cli/dist/components/ServiceIssues.js +13 -0
- package/cli/dist/components/TUIHeader.js +27 -0
- package/cli/dist/components/TabBar.js +27 -0
- package/cli/dist/components/Tooltip.js +13 -0
- package/cli/dist/components/index.js +11 -0
- package/cli/dist/components/ui-theme.js +120 -0
- package/cli/dist/config/platform-standards.js +182 -0
- package/cli/dist/frontend-frameworks/lit.js +64 -0
- package/cli/dist/frontend-frameworks/preact.js +62 -0
- package/cli/dist/frontend-frameworks/qwik.js +61 -0
- package/cli/dist/frontend-frameworks/react.js +69 -0
- package/cli/dist/frontend-frameworks/registry.js +83 -0
- package/cli/dist/frontend-frameworks/solid.js +62 -0
- package/cli/dist/frontend-frameworks/svelte.js +67 -0
- package/cli/dist/frontend-frameworks/tanstack-router.js +101 -0
- package/cli/dist/frontend-frameworks/types.js +1 -0
- package/cli/dist/frontend-frameworks/vanilla.js +59 -0
- package/cli/dist/frontend-frameworks/vue.js +72 -0
- package/cli/dist/generator/__tests__/golden-helpers.js +43 -0
- package/cli/dist/generator/extension-fetch.js +291 -0
- package/cli/dist/generator/resource-templates.js +133 -0
- package/cli/dist/generator/template-engine.js +801 -0
- package/cli/dist/index.js +10 -0
- package/cli/dist/mcp/server.js +101 -0
- package/cli/dist/mcp/tools.js +351 -0
- package/cli/dist/program.js +37 -0
- package/cli/dist/types/index.js +38 -0
- package/cli/dist/utils/agent-host.js +36 -0
- package/cli/dist/utils/atomic-write.js +36 -0
- package/cli/dist/utils/bun-floor.js +9 -0
- package/cli/dist/utils/bun-requirement.js +10 -0
- package/cli/dist/utils/cache.js +63 -0
- package/cli/dist/utils/cold-preflight.js +257 -0
- package/cli/dist/utils/command-helpers.js +57 -0
- package/cli/dist/utils/constants.js +160 -0
- package/cli/dist/utils/discovery-context.js +71 -0
- package/cli/dist/utils/discovery-paths.js +93 -0
- package/cli/dist/utils/docker.js +34 -0
- package/cli/dist/utils/doctor-crashloop.js +161 -0
- package/cli/dist/utils/doctor-fix.js +391 -0
- package/cli/dist/utils/doctor-host.js +66 -0
- package/cli/dist/utils/doctor-report.js +78 -0
- package/cli/dist/utils/doctor-runtime.js +880 -0
- package/cli/dist/utils/doctor-starlark.js +132 -0
- package/cli/dist/utils/doctor-wiring.js +698 -0
- package/cli/dist/utils/down-cleanup.js +125 -0
- package/cli/dist/utils/env-validator.js +266 -0
- package/cli/dist/utils/errors.js +175 -0
- package/cli/dist/utils/exec-async.js +31 -0
- package/cli/dist/utils/file-helpers.js +104 -0
- package/cli/dist/utils/formatting.js +165 -0
- package/cli/dist/utils/generated-paths.js +51 -0
- package/cli/dist/utils/help-command.js +11 -0
- package/cli/dist/utils/host-port-config.js +140 -0
- package/cli/dist/utils/host-port-plan.js +100 -0
- package/cli/dist/utils/json-output.js +29 -0
- package/cli/dist/utils/machine-output.js +33 -0
- package/cli/dist/utils/paths.js +43 -0
- package/cli/dist/utils/platform.js +58 -0
- package/cli/dist/utils/port-assignment.js +75 -0
- package/cli/dist/utils/port-conflict-fix.js +25 -0
- package/cli/dist/utils/port-fallback-notice.js +17 -0
- package/cli/dist/utils/port-listener-probe.js +20 -0
- package/cli/dist/utils/project-config-defaults.js +17 -0
- package/cli/dist/utils/project-features.js +91 -0
- package/cli/dist/utils/project-templates.js +32 -0
- package/cli/dist/utils/prompt.js +97 -0
- package/cli/dist/utils/resource-features.js +184 -0
- package/cli/dist/utils/resource-kind.js +9 -0
- package/cli/dist/utils/schema-version-gate.js +45 -0
- package/cli/dist/utils/search-status.js +12 -0
- package/cli/dist/utils/secret-redaction.js +73 -0
- package/cli/dist/utils/service-config-checks.js +189 -0
- package/cli/dist/utils/service-manifest.js +254 -0
- package/cli/dist/utils/service-runtime-state.js +66 -0
- package/cli/dist/utils/service-urls.js +112 -0
- package/cli/dist/utils/services.js +360 -0
- package/cli/dist/utils/shared-infra.js +45 -0
- package/cli/dist/utils/shared-platform-postgres.js +232 -0
- package/cli/dist/utils/single-flight.js +21 -0
- package/cli/dist/utils/smoke.js +401 -0
- package/cli/dist/utils/spinner.js +40 -0
- package/cli/dist/utils/stack-features.js +15 -0
- package/cli/dist/utils/stack-status.js +14 -0
- package/cli/dist/utils/startup-report.js +78 -0
- package/cli/dist/utils/status-message.js +21 -0
- package/cli/dist/utils/status-ports.js +33 -0
- package/cli/dist/utils/suggestions.js +63 -0
- package/cli/dist/utils/tar.js +46 -0
- package/cli/dist/utils/tdk-version.js +51 -0
- package/cli/dist/utils/terminal-layout.js +19 -0
- package/cli/dist/utils/tilt-events.js +194 -0
- package/cli/dist/utils/tilt-logs.js +61 -0
- package/cli/dist/utils/tilt-port-owner.js +63 -0
- package/cli/dist/utils/tilt-process.js +54 -0
- package/cli/dist/utils/tilt-resource-state.js +32 -0
- package/cli/dist/utils/tilt-startup.js +49 -0
- package/cli/dist/utils/tilt-unreachable-message.js +9 -0
- package/cli/dist/utils/tilt.js +104 -0
- package/cli/dist/utils/ui-keymap.js +129 -0
- package/cli/dist/utils/ui-service-state.js +34 -0
- package/cli/dist/utils/up-only.js +28 -0
- package/cli/dist/utils/up-readiness.js +118 -0
- package/cli/dist/utils/url-actions.js +103 -0
- package/cli/dist/utils/validation.js +62 -0
- package/cli/dist/utils/which.js +56 -0
- package/cli/dist/utils/windows-doctor.js +176 -0
- package/cli/dist-bundle/chunk-6EA4DGCY.js +2 -0
- package/cli/dist-bundle/chunk-BZ4H7MM4.js +3 -0
- package/cli/dist-bundle/chunk-QWYXYAX6.js +510 -0
- package/cli/dist-bundle/cli.js +2017 -0
- package/cli/dist-bundle/cold-preflight-MM46GFQA.js +2 -0
- package/cli/dist-bundle/devtools-ZUHXW33W.js +5 -0
- package/cli/dist-bundle/extension-fetch-J4FFH7TJ.js +2 -0
- package/cli/package.json +83 -0
- package/cli/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
- package/cli/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
- package/cli/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
- package/cli/templates/.tiltignore.hbs +72 -0
- package/cli/templates/TILT_RESOURCE_DEFAULTS.star.hbs +220 -0
- package/cli/templates/TILT_TECH_STACK.star.hbs +149 -0
- package/cli/templates/Tiltfile.hbs +381 -0
- package/cli/templates/spec.master.hbs +192 -0
- package/discovery/AGENTS.md +362 -0
- package/discovery/TILT_DISCOVERY.star +429 -0
- package/discovery/Tiltfile +58 -0
- package/discovery/config.star +265 -0
- package/discovery/constants.star +167 -0
- package/discovery/deterministic.star +213 -0
- package/discovery/discovery_daemon.star +193 -0
- package/discovery/discovery_orchestrator.star +492 -0
- package/discovery/filtering.star +7 -0
- package/discovery/identity-management-backend/service.yaml +26 -0
- package/discovery/identity-management-frontend/service.yaml +29 -0
- package/discovery/identity-sdk/service.yaml +9 -0
- package/discovery/incremental_discovery.star +215 -0
- package/discovery/indexing.star +9 -0
- package/discovery/json_manifest_scanner.star +57 -0
- package/discovery/libraries.star +48 -0
- package/discovery/loading.star +25 -0
- package/discovery/manifest/constants.star +106 -0
- package/discovery/manifest/loading.star +418 -0
- package/discovery/manifest/normalize.star +289 -0
- package/discovery/manifest/validation.star +110 -0
- package/discovery/normalization.star +13 -0
- package/discovery/registry.star +562 -0
- package/discovery/resource_snapshot.py +384 -0
- package/discovery/resource_snapshot.star +145 -0
- package/discovery/schemas.star +3 -0
- package/discovery/services/platform/cdc/debezium/nats-connector/service.yaml +9 -0
- package/discovery/services/platform/cdc/nats-http-bridge/service.yaml +9 -0
- package/discovery/services/platform/orchestrator/orchestrator-glue-backend/service.yaml +26 -0
- package/discovery/services/platform/synthetic-monitor/service.yaml +9 -0
- package/discovery/test_resource_snapshot.py +253 -0
- package/discovery/validation.star +80 -0
- package/discovery/versioning.star +3 -0
- package/engine/AGENTS.md +706 -0
- package/engine/README.md +31 -0
- package/engine/REFACTORING_MANIFEST_SYSTEM.md +974 -0
- package/engine/Tiltfile +86 -0
- package/engine/assets/docker/golden-layers.Dockerfile +204 -0
- package/engine/assets/docker/wake-gateway/Dockerfile +28 -0
- package/engine/assets/docker/wake-gateway/decide.test.ts +177 -0
- package/engine/assets/docker/wake-gateway/decide.ts +135 -0
- package/engine/assets/docker/wake-gateway/server.ts +363 -0
- package/engine/assets/scripts/cleanup-completed-migrator-images.sh +39 -0
- package/engine/assets/scripts/cleanup-tilt-images.sh +122 -0
- package/engine/assets/scripts/mac-m1-resource-monitor.sh +123 -0
- package/engine/config.star +5 -0
- package/engine/entrypoint.star +101 -0
- package/engine/lifecycle/orchestrator.star +263 -0
- package/engine/paths.star +719 -0
- package/engine/schemas/project-schema.json +147 -0
- package/engine/schemas/service-schema.json +537 -0
- package/engine/scripts/README.md +89 -0
- package/engine/scripts/build-and-publish-lib.sh +207 -0
- package/engine/scripts/check-lib-publish.sh +87 -0
- package/engine/scripts/debug-container.sh +265 -0
- package/engine/scripts/generate-manifest.sh +200 -0
- package/engine/spec.master +702 -0
- package/engine/spec.master.example +341 -0
- package/engine/topologies/README.md +33 -0
- package/engine/topologies/platform/docker/AGENTS.md +59 -0
- package/engine/topologies/platform/docker/auth/auth.star +207 -0
- package/engine/topologies/platform/docker/build/frontend_build_plan.star +65 -0
- package/engine/topologies/platform/docker/build/golden_image.star +37 -0
- package/engine/topologies/platform/docker/build/golden_image_build.star +144 -0
- package/engine/topologies/platform/docker/build/golden_image_constants.star +100 -0
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +263 -0
- package/engine/topologies/platform/docker/compose/compose.star +637 -0
- package/engine/topologies/platform/docker/compose/compose_helpers.star +54 -0
- package/engine/topologies/platform/docker/compose/traefik_standalone.star +171 -0
- package/engine/topologies/platform/docker/config/bunignore.star +144 -0
- package/engine/topologies/platform/docker/config/dockerignore.star +152 -0
- package/engine/topologies/platform/docker/config/healthcheck.star +58 -0
- package/engine/topologies/platform/docker/constants.star +211 -0
- package/engine/topologies/platform/docker/dockerfile/dockerfile.star +56 -0
- package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +264 -0
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +76 -0
- package/engine/topologies/platform/docker/index.star +40 -0
- package/engine/topologies/platform/docker/layers/bun_helpers.star +25 -0
- package/engine/topologies/platform/docker/layers/infisical/index.star +42 -0
- package/engine/topologies/platform/docker/layers/infisical/infisical_docker.star +264 -0
- package/engine/topologies/platform/docker/layers/l1_base_layers.star +89 -0
- package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +147 -0
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +229 -0
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +282 -0
- package/engine/topologies/platform/docker/layers/prisma/constants.star +138 -0
- package/engine/topologies/platform/docker/layers/prisma/db_readiness.star +98 -0
- package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +131 -0
- package/engine/topologies/platform/docker/layers/prisma/migrate_script.star +100 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_build.star +128 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +205 -0
- package/engine/topologies/platform/docker/layers/prisma/secret_resolution.star +121 -0
- package/engine/topologies/platform/docker/networking/api_path_constants.star +206 -0
- package/engine/topologies/platform/docker/networking/sablier_container_cycle.star +31 -0
- package/engine/topologies/platform/docker/networking/traefik.star +266 -0
- package/engine/topologies/platform/docker/networking/traefik_constants.star +148 -0
- package/engine/topologies/platform/docker/networking/traefik_helpers.star +162 -0
- package/engine/topologies/platform/docker/networking/traefik_static_routes.star +165 -0
- package/engine/topologies/platform/docker/secrets/env_secrets.star +74 -0
- package/engine/topologies/platform/docker/secrets/infisical.star +109 -0
- package/engine/topologies/platform/net/AGENTS.md +64 -0
- package/engine/topologies/platform/net/proxy.star +6 -0
- package/engine/topologies/platform/registries/local.star +6 -0
- package/engine/topologies/platform/registries/verdaccio_loader.star +20 -0
- package/engine/topologies/platform/security/AGENTS.md +49 -0
- package/engine/topologies/platform/security/secrets.star +241 -0
- package/engine/topologies/platform/state/AGENTS.md +64 -0
- package/engine/topologies/platform/state/relational.star +6 -0
- package/engine/topologies/tilt/common/AGENTS.md +59 -0
- package/engine/topologies/tilt/common/utils.star +409 -0
- package/engine/topologies/tilt/common/utils_debug.star +71 -0
- package/engine/topologies/tilt/common/utils_deterministic.star +170 -0
- package/engine/topologies/tilt/common/utils_docker_networks.star +54 -0
- package/engine/topologies/tilt/common/utils_env.star +92 -0
- package/engine/topologies/tilt/common/utils_output.star +99 -0
- package/engine/topologies/tilt/config/AGENTS.md +68 -0
- package/engine/topologies/tilt/config/defaults.star +5 -0
- package/engine/topologies/tilt/config/feature_flags.star +12 -0
- package/engine/topologies/tilt/config/global.star +57 -0
- package/engine/topologies/tilt/config/profiles.star +398 -0
- package/engine/topologies/tilt/generators/agents_md.star +64 -0
- package/engine/topologies/tilt/generators/api_gateway.star +147 -0
- package/engine/topologies/tilt/generators/index.star +126 -0
- package/engine/topologies/tilt/generators/infisical/README.md +424 -0
- package/engine/topologies/tilt/generators/infisical/examples.star +314 -0
- package/engine/topologies/tilt/generators/infisical/index.star +59 -0
- package/engine/topologies/tilt/generators/infisical/machine_identity.star +422 -0
- package/engine/topologies/tilt/generators/infisical/organization.star +536 -0
- package/engine/topologies/tilt/generators/infisical/path_manager.star +478 -0
- package/engine/topologies/tilt/generators/infisical/secrets_generator.star +422 -0
- package/engine/topologies/tilt/generators/nginx_conf.star +145 -0
- package/engine/topologies/tilt/generators/npmrc.star +132 -0
- package/engine/topologies/tilt/generators/tsconfig.star +25 -0
- package/engine/topologies/tilt/generators/typescript/backend_library_tsconfig.star +73 -0
- package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +137 -0
- package/engine/topologies/tilt/generators/typescript/common.star +9 -0
- package/engine/topologies/tilt/generators/typescript/frontend_library_tsconfig.star +78 -0
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +140 -0
- package/engine/topologies/tilt/generators/typescript/include.star +25 -0
- package/engine/topologies/tilt/generators/typescript/playwright_config.star +42 -0
- package/engine/topologies/tilt/generators/typescript/prisma_config.star +51 -0
- package/engine/topologies/tilt/generators/validators.star +868 -0
- package/engine/topologies/tilt/generators/vite/backend.star +80 -0
- package/engine/topologies/tilt/generators/vite/frameworks/lit.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/preact.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/qwik.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/react.star +128 -0
- package/engine/topologies/tilt/generators/vite/frameworks/solid.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/svelte.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/vanilla.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/vue.star +94 -0
- package/engine/topologies/tilt/generators/vite/frontend.star +153 -0
- package/engine/topologies/tilt/generators/vite/generators.star +45 -0
- package/engine/topologies/tilt/generators/vite/helpers.star +256 -0
- package/engine/topologies/tilt/generators/vite/library.star +67 -0
- package/engine/topologies/tilt/generators/vite/sdk.star +75 -0
- package/engine/topologies/tilt/generators/vite/templates.star +460 -0
- package/engine/topologies/tilt/generators/vite_config.star +24 -0
- package/engine/topologies/tilt/manifest/AGENTS.md +61 -0
- package/engine/topologies/tilt/manifest/README.md +679 -0
- package/engine/topologies/tilt/manifest/__init__.star +220 -0
- package/engine/topologies/tilt/manifest/constants.star +262 -0
- package/engine/topologies/tilt/manifest/errors.star +268 -0
- package/engine/topologies/tilt/manifest/integration.star +348 -0
- package/engine/topologies/tilt/manifest/json_to_yaml.py +61 -0
- package/engine/topologies/tilt/manifest/loader.star +239 -0
- package/engine/topologies/tilt/manifest/mapper.star +229 -0
- package/engine/topologies/tilt/manifest/parser.star +490 -0
- package/engine/topologies/tilt/manifest/schema.star +502 -0
- package/engine/topologies/tilt/manifest/tests/test_integration.star +278 -0
- package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +475 -0
- package/engine/topologies/tilt/manifest/tests/test_manifest.star +319 -0
- package/engine/topologies/tilt/manifest/tests/test_validator.star +472 -0
- package/engine/topologies/tilt/manifest/validator.star +744 -0
- package/engine/topologies/tilt/manifest/yaml_to_json.py +20 -0
- package/engine/topologies/tilt/resources/AGENTS.md +71 -0
- package/engine/topologies/tilt/resources/build_concurrency.star +56 -0
- package/engine/topologies/tilt/resources/conditions.star +5 -0
- package/engine/topologies/tilt/resources/databases.star +246 -0
- package/engine/topologies/tilt/resources/declaration.star +5 -0
- package/engine/topologies/tilt/resources/deps.star +5 -0
- package/engine/topologies/tilt/resources/infra-loader.star +504 -0
- package/engine/topologies/tilt/resources/libs.star +32 -0
- package/engine/topologies/tilt/resources/libs_discovery.star +104 -0
- package/engine/topologies/tilt/resources/libs_paths.star +81 -0
- package/engine/topologies/tilt/resources/libs_resource_definition.star +153 -0
- package/engine/topologies/tilt/resources/libs_setup.star +166 -0
- package/engine/topologies/tilt/resources/libs_tsconfig.star +39 -0
- package/engine/topologies/tilt/resources/orchestrator/apply.star +79 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +864 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_manifest_orchestration.star +90 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +150 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_resource_validation.star +38 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_runtime_flags.star +46 -0
- package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +193 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/AGENTS.md +75 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/index.star +23 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/resolver.star +136 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/env.star +219 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/frontend.star +172 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +577 -0
- package/engine/topologies/tilt/resources/orchestrator/helpers.star +35 -0
- package/engine/topologies/tilt/resources/orchestrator.star +56 -0
- package/engine/topologies/tilt/resources/ordering.star +5 -0
- package/engine/topologies/tilt/resources/shared-platform-postgres.star +30 -0
- package/engine/topologies/tilt/resources/triggers.star +5 -0
- package/engine/topologies/tilt/resources/watchers.star +304 -0
- package/engine/where-things-live.star +719 -0
- package/examples/tdk-example/LICENSE +21 -0
- package/examples/tdk-example/README.md +23 -0
- package/examples/tdk-example/TILT_SERVICE_DEFAULTS.star +42 -0
- package/examples/tdk-example/TILT_TECH_STACK.star +67 -0
- package/examples/tdk-example/Tiltfile +25 -0
- package/examples/tdk-example/services/platform/messaging/docker-compose.yml +26 -0
- package/examples/tdk-example/services/shop/orders-api/package.json +20 -0
- package/examples/tdk-example/services/shop/orders-api/service.json +14 -0
- package/examples/tdk-example/services/shop/orders-api/src/index.ts +81 -0
- package/examples/tdk-example/services/shop/orders-app/index.html +12 -0
- package/examples/tdk-example/services/shop/orders-app/package.json +23 -0
- package/examples/tdk-example/services/shop/orders-app/public/.gitkeep +0 -0
- package/examples/tdk-example/services/shop/orders-app/service.json +9 -0
- package/examples/tdk-example/services/shop/orders-app/src/main.tsx +9 -0
- package/examples/tdk-example/services/shop/orders-app/src/orders.tsx +67 -0
- package/examples/tdk-example/services/shop/orders-app/src/style.css +15 -0
- package/examples/tdk-example/services/shop/orders-worker/package.json +18 -0
- package/examples/tdk-example/services/shop/orders-worker/service.json +13 -0
- package/examples/tdk-example/services/shop/orders-worker/src/index.ts +33 -0
- package/ext/Tiltfile +66 -0
- package/ext/ide-components/README.md +221 -0
- package/ext/ide-components/code_viewer/server.py +208 -0
- package/ext/ide-components/config_inspector/server.py +1052 -0
- package/ext/ide-components/file_browser/server.py +287 -0
- package/ext/ide-components/shared/config_service.py +471 -0
- package/ext/ide-components/shared/file_utils.py +300 -0
- package/ext/ide-components/shared/http_utils.py +234 -0
- package/ext/ide-components/shared/static/styles.css +1334 -0
- package/ext/ide-components/shared/syntax_highlighter.py +142 -0
- package/ext/ide-components/shared/template_engine.py +125 -0
- package/ext/ide-components/shared/templates/base.html +121 -0
- package/ext/ide-components/shared/test_config_service.py +328 -0
- package/ext/ide-components/shared/tilt_integration.py +160 -0
- package/ext/ui-enhancements/cron-status-server.sh +51 -0
- package/ext/ui-enhancements/cron-status-tracker.sh +148 -0
- package/ext/ui-enhancements/extension.yaml +36 -0
- package/ext/ui-enhancements/tiltfile.py +101 -0
- package/ext/ui-enhancements/ui/cron-jobs-tab.css +396 -0
- package/ext/ui-enhancements/ui/help-panel.css +279 -0
- package/ext/ui-enhancements/ui/icons.css +125 -0
- package/ext/ui-enhancements/ui/tooltips.css +114 -0
- package/package.json +94 -4
- package/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
- package/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
- package/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
- package/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
- package/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
- package/specs/specs/TILT_SERVICE_DEFAULTS.star +207 -0
- package/specs/specs/TILT_TECH_STACK.star +161 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# AGENTS.md - Networking & Proxy
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Traefik reverse proxy, networking configuration, and service routing.
|
|
6
|
+
|
|
7
|
+
## Key Files
|
|
8
|
+
|
|
9
|
+
### Traefik
|
|
10
|
+
- **`proxy.star`** - Traefik configuration generation
|
|
11
|
+
- **`labels.star`** - Docker labels for Traefik routing
|
|
12
|
+
|
|
13
|
+
### Network Management
|
|
14
|
+
- **`network.star`** - Docker network setup
|
|
15
|
+
- **`hosts.star`** - /etc/hosts file management
|
|
16
|
+
|
|
17
|
+
## Common Tasks
|
|
18
|
+
|
|
19
|
+
### Generate Traefik labels
|
|
20
|
+
```starlark
|
|
21
|
+
load("./proxy.star", "generate_traefik_labels")
|
|
22
|
+
labels = generate_traefik_labels(
|
|
23
|
+
resource_name="order-management-backend",
|
|
24
|
+
port=4000,
|
|
25
|
+
host="order.backend.{project}.localhost",
|
|
26
|
+
path_prefix="/api/orders"
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Output
|
|
31
|
+
```python
|
|
32
|
+
{
|
|
33
|
+
"traefik.enable": "true",
|
|
34
|
+
"traefik.http.routers.order-management-backend.rule": "Host(`order.backend.{project}.localhost`) && PathPrefix(`/api/orders`)",
|
|
35
|
+
"traefik.http.routers.order-management-backend.entrypoints": "web",
|
|
36
|
+
"traefik.http.services.order-management-backend.loadbalancer.server.port": "4000"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Architecture
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Internet/localhost
|
|
44
|
+
↓
|
|
45
|
+
Traefik (port 80/443)
|
|
46
|
+
↓
|
|
47
|
+
Routes to services by Host/Path
|
|
48
|
+
↓
|
|
49
|
+
Service containers
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Integration
|
|
53
|
+
|
|
54
|
+
- Called by `resources/` when creating service resources
|
|
55
|
+
- Used by `platform/docker/` for Docker Compose generation
|
|
56
|
+
- Labels applied to docker_build and docker_compose
|
|
57
|
+
|
|
58
|
+
## Local Development
|
|
59
|
+
|
|
60
|
+
Services accessible at:
|
|
61
|
+
- `{service}.backend.{project}.localhost`
|
|
62
|
+
- `{service}.frontend.{project}.localhost`
|
|
63
|
+
|
|
64
|
+
Managed in `/etc/hosts` automatically.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# 📦 VERDACCIO (NPM Registry) - loader (free-tier stub)
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# Path: engine/topologies/platform/registries/verdaccio_loader.star
|
|
7
|
+
# =============================================================================
|
|
8
|
+
# The real loader (stands up the Verdaccio private npm registry container and
|
|
9
|
+
# wires it into the project's Docker network) is part of a paid Flisk license.
|
|
10
|
+
# When a valid license grants the "verdaccio" resource,
|
|
11
|
+
# cli/src/generator/template-engine.ts (vendorTdkExtension) overwrites this
|
|
12
|
+
# file with the licensed version fetched via extension-fetch.ts before Tilt
|
|
13
|
+
# loads it. Same function signature either way, so nothing else in the
|
|
14
|
+
# loader pipeline changes.
|
|
15
|
+
# =============================================================================
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def load_verdaccio(_should_enable, _root_prefix="", _env_file=None):
|
|
19
|
+
"""Free-tier stub - see module header. Always skipped."""
|
|
20
|
+
print("ℹ️ Verdaccio skipped — requires a Flisk Premium license (run `flisk upgrade`)")
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# AGENTS.md - Security & Secrets
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Secrets management, Infisical integration, and security configuration.
|
|
6
|
+
|
|
7
|
+
## Key Files
|
|
8
|
+
|
|
9
|
+
### Secrets Management
|
|
10
|
+
- **`infisical.star`** - Infisical secrets provider integration
|
|
11
|
+
- **`secrets.star`** - Generic secrets handling
|
|
12
|
+
- **`encryption.star`** - Encryption utilities
|
|
13
|
+
|
|
14
|
+
### Configuration
|
|
15
|
+
- **`tokens.star`** - Token generation and validation
|
|
16
|
+
- **`keys.star`** - Key management
|
|
17
|
+
|
|
18
|
+
## Common Tasks
|
|
19
|
+
|
|
20
|
+
### Load secrets from Infisical
|
|
21
|
+
```starlark
|
|
22
|
+
load("./infisical.star", "Infisical")
|
|
23
|
+
secrets = Infisical.load_secrets(resource_name, environment)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Get database credentials
|
|
27
|
+
```starlark
|
|
28
|
+
load("./infisical.star", "Infisical")
|
|
29
|
+
db_url = Infisical.get_database_url(resource_name)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Integration
|
|
33
|
+
|
|
34
|
+
- Called by `resources/` when setting up service environment
|
|
35
|
+
- Used in Docker Compose for injecting secrets
|
|
36
|
+
- Part of service startup chain
|
|
37
|
+
|
|
38
|
+
## Local Development
|
|
39
|
+
|
|
40
|
+
Without Infisical, falls back to:
|
|
41
|
+
- Environment variables
|
|
42
|
+
- Default values in `spec.master`
|
|
43
|
+
|
|
44
|
+
## Security Notes
|
|
45
|
+
|
|
46
|
+
- Never commit real secrets
|
|
47
|
+
- Use Infisical for production
|
|
48
|
+
- Local development uses safe defaults
|
|
49
|
+
- Secrets injected at runtime, not in images
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Copyright (c) 2026 Flisk contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# 🔐 INFISICAL SECURITY MODULE
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# Centralizes Infisical secrets management configuration
|
|
7
|
+
# =============================================================================
|
|
8
|
+
#
|
|
9
|
+
# This module provides:
|
|
10
|
+
# - Infrastructure loading (Infisical containers)
|
|
11
|
+
# - Secret injection configuration for services
|
|
12
|
+
# - Machine identity management
|
|
13
|
+
# - Organization and path management
|
|
14
|
+
#
|
|
15
|
+
# Usage:
|
|
16
|
+
# load("../../platform/security/secrets.star", "Secrets")
|
|
17
|
+
#
|
|
18
|
+
# # Load Infisical infrastructure
|
|
19
|
+
# Secrets.load_infra(should_enable_fn)
|
|
20
|
+
#
|
|
21
|
+
# # Configure service secrets
|
|
22
|
+
# config = Secrets.configure_service("my-service", "/services/my-service")
|
|
23
|
+
# =============================================================================
|
|
24
|
+
|
|
25
|
+
# Infrastructure loader
|
|
26
|
+
load("../../tilt/resources/infra-loader.star", _Infra="Infra")
|
|
27
|
+
|
|
28
|
+
# Generators
|
|
29
|
+
load("../../tilt/generators/infisical/index.star", _Infisical="Infisical")
|
|
30
|
+
|
|
31
|
+
# Docker layers integration
|
|
32
|
+
load("../../platform/docker/layers/infisical/index.star", "InfisicalLayers")
|
|
33
|
+
|
|
34
|
+
# =============================================================================
|
|
35
|
+
# Infrastructure Loading
|
|
36
|
+
# =============================================================================
|
|
37
|
+
|
|
38
|
+
def _load_infra(should_enable):
|
|
39
|
+
"""Load Infisical infrastructure containers."""
|
|
40
|
+
return _Infra.load_infisical(should_enable)
|
|
41
|
+
|
|
42
|
+
# =============================================================================
|
|
43
|
+
# Resource Secret Configuration
|
|
44
|
+
# =============================================================================
|
|
45
|
+
|
|
46
|
+
def _configure_service(resource_name, secret_path, resource_type="backend", command=None):
|
|
47
|
+
"""
|
|
48
|
+
Configure secret injection for a resource.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
resource_name: Name of the resource
|
|
52
|
+
secret_path: Infisical path (e.g., "/services/my-service")
|
|
53
|
+
resource_type: Type of resource (backend, frontend, worker, etc.)
|
|
54
|
+
command: Entrypoint command (optional)
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
Configuration dict for the resource
|
|
58
|
+
"""
|
|
59
|
+
return _Infisical.Secrets.generate_for_service(
|
|
60
|
+
resource_name=resource_name,
|
|
61
|
+
secret_path=secret_path,
|
|
62
|
+
resource_type=resource_type,
|
|
63
|
+
command=command,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def _configure_services_batch(services_config):
|
|
67
|
+
"""
|
|
68
|
+
Configure secrets for multiple resources.
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
services_config: List of dicts with resource configuration
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Dict mapping resource names to configurations
|
|
75
|
+
"""
|
|
76
|
+
return _Infisical.Secrets.generate_for_services_batch(services_config)
|
|
77
|
+
|
|
78
|
+
# =============================================================================
|
|
79
|
+
# Path Management
|
|
80
|
+
# =============================================================================
|
|
81
|
+
|
|
82
|
+
def _plan_resource_path(resource_name, resource_type="backend"):
|
|
83
|
+
"""Plan Infisical path for a resource."""
|
|
84
|
+
return _Infisical.Paths.plan_resource_path(resource_name, resource_type)
|
|
85
|
+
|
|
86
|
+
def _plan_batch_paths(resource_names, resource_type="backend"):
|
|
87
|
+
"""Plan paths for multiple resources."""
|
|
88
|
+
return _Infisical.Paths.plan_batch_resource_paths(resource_names, resource_type)
|
|
89
|
+
|
|
90
|
+
def _get_known_resource_path(resource_name):
|
|
91
|
+
"""Get predefined path for a known resource."""
|
|
92
|
+
return _Infisical.Paths.get_known_resource_path(resource_name)
|
|
93
|
+
|
|
94
|
+
# =============================================================================
|
|
95
|
+
# Machine Identity
|
|
96
|
+
# =============================================================================
|
|
97
|
+
|
|
98
|
+
def _generate_machine_identity(identity_name, access_paths=None, project_id=None):
|
|
99
|
+
"""
|
|
100
|
+
Generate machine identity configuration.
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
identity_name: Name of the machine identity
|
|
104
|
+
access_paths: List of paths the identity can access
|
|
105
|
+
project_id: Project ID
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
Machine identity configuration
|
|
109
|
+
"""
|
|
110
|
+
return _Infisical.Identity.generate_universal_auth(
|
|
111
|
+
identity_name=identity_name,
|
|
112
|
+
access_paths=access_paths,
|
|
113
|
+
project_id=project_id,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def _get_development_machine(project_id=None):
|
|
117
|
+
"""Get development machine identity configuration."""
|
|
118
|
+
return _Infisical.Identity.generate_development_machine(
|
|
119
|
+
identity_name="dev-machine",
|
|
120
|
+
project_id=project_id,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
def _get_ci_machine(project_id=None):
|
|
124
|
+
"""Get CI/CD machine identity configuration."""
|
|
125
|
+
return _Infisical.Identity.generate_ci_machine(project_id=project_id)
|
|
126
|
+
|
|
127
|
+
# =============================================================================
|
|
128
|
+
# Organization Setup
|
|
129
|
+
# =============================================================================
|
|
130
|
+
|
|
131
|
+
def _generate_org_config(org_name=None, environments=None, resource_names=None):
|
|
132
|
+
"""
|
|
133
|
+
Generate organization configuration.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
org_name: Organization name
|
|
137
|
+
environments: List of environment names
|
|
138
|
+
resource_names: List of service names
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
Organization configuration dict
|
|
142
|
+
"""
|
|
143
|
+
return _Infisical.Org.generate_config(
|
|
144
|
+
org_name=org_name,
|
|
145
|
+
env_names=environments,
|
|
146
|
+
resource_names=resource_names,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
# =============================================================================
|
|
150
|
+
# Predefined Services Configuration
|
|
151
|
+
# =============================================================================
|
|
152
|
+
|
|
153
|
+
# Project-specific service configurations should be defined in .tdk/project.json
|
|
154
|
+
# This dict is kept for backward compatibility but should be empty for generic Flisk CLI
|
|
155
|
+
PREDEFINED_RESOURCES = {}
|
|
156
|
+
|
|
157
|
+
def _get_predefined_resource_config(resource_name):
|
|
158
|
+
"""Get predefined configuration for a known resource."""
|
|
159
|
+
return PREDEFINED_RESOURCES.get(resource_name)
|
|
160
|
+
|
|
161
|
+
def _configure_predefined_service(resource_name, command=None):
|
|
162
|
+
"""
|
|
163
|
+
Configure a predefined resource by name.
|
|
164
|
+
|
|
165
|
+
Args:
|
|
166
|
+
resource_name: Name of the predefined resource
|
|
167
|
+
command: Entrypoint command (optional)
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
Resource configuration or None if not predefined
|
|
171
|
+
"""
|
|
172
|
+
config = _get_predefined_resource_config(resource_name)
|
|
173
|
+
if not config:
|
|
174
|
+
return None
|
|
175
|
+
|
|
176
|
+
return _configure_service(
|
|
177
|
+
resource_name=resource_name,
|
|
178
|
+
secret_path=config["path"],
|
|
179
|
+
resource_type=config["type"],
|
|
180
|
+
command=command,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
# =============================================================================
|
|
184
|
+
# Batch Configuration for All Resources
|
|
185
|
+
# =============================================================================
|
|
186
|
+
|
|
187
|
+
def _configure_all_predefined_services(command=None):
|
|
188
|
+
"""
|
|
189
|
+
Configure all predefined resources.
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
command: Default entrypoint command (optional)
|
|
193
|
+
|
|
194
|
+
Returns:
|
|
195
|
+
Dict mapping resource names to configurations
|
|
196
|
+
"""
|
|
197
|
+
results = {}
|
|
198
|
+
|
|
199
|
+
for resource_name in PREDEFINED_RESOURCES:
|
|
200
|
+
config = _configure_predefined_service(resource_name, command)
|
|
201
|
+
if config:
|
|
202
|
+
results[resource_name] = config
|
|
203
|
+
|
|
204
|
+
return results
|
|
205
|
+
|
|
206
|
+
# =============================================================================
|
|
207
|
+
# Public API
|
|
208
|
+
# =============================================================================
|
|
209
|
+
|
|
210
|
+
Secrets = struct(
|
|
211
|
+
# Infrastructure
|
|
212
|
+
load_infra=_load_infra,
|
|
213
|
+
|
|
214
|
+
# Resource configuration
|
|
215
|
+
configure_service=_configure_service,
|
|
216
|
+
configure_services_batch=_configure_services_batch,
|
|
217
|
+
configure_predefined_service=_configure_predefined_service,
|
|
218
|
+
configure_all_predefined_services=_configure_all_predefined_services,
|
|
219
|
+
|
|
220
|
+
# Path management
|
|
221
|
+
plan_resource_path=_plan_resource_path,
|
|
222
|
+
plan_batch_paths=_plan_batch_paths,
|
|
223
|
+
get_known_resource_path=_get_known_resource_path,
|
|
224
|
+
|
|
225
|
+
# Machine identity
|
|
226
|
+
generate_machine_identity=_generate_machine_identity,
|
|
227
|
+
get_development_machine=_get_development_machine,
|
|
228
|
+
get_ci_machine=_get_ci_machine,
|
|
229
|
+
|
|
230
|
+
# Organization
|
|
231
|
+
generate_org_config=_generate_org_config,
|
|
232
|
+
|
|
233
|
+
# Constants
|
|
234
|
+
PREDEFINED_RESOURCES=PREDEFINED_RESOURCES,
|
|
235
|
+
|
|
236
|
+
# Direct access to submodules
|
|
237
|
+
Infisical=_Infisical,
|
|
238
|
+
|
|
239
|
+
# Docker layers integration
|
|
240
|
+
Layers=InfisicalLayers,
|
|
241
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# AGENTS.md - Database & State Management
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
PostgreSQL database virtualization, per-service database provisioning, and state management.
|
|
6
|
+
|
|
7
|
+
## Key Files
|
|
8
|
+
|
|
9
|
+
### Database Provisioning
|
|
10
|
+
- **`relational.star`** - Main database provisioning logic
|
|
11
|
+
- **`compose.star`** - Docker Compose entries for databases
|
|
12
|
+
|
|
13
|
+
### Prisma Integration
|
|
14
|
+
- **`prisma/migrate_script.star`** - Migration script generation
|
|
15
|
+
- **`prisma/db_readiness.star`** - Database readiness checks
|
|
16
|
+
- **`prisma/prisma_build.star`** - Prisma in Docker builds
|
|
17
|
+
- **`prisma/prisma_runtime.star`** - Prisma client in runtime
|
|
18
|
+
|
|
19
|
+
### Utilities
|
|
20
|
+
- **`utils.star`** - Database utilities
|
|
21
|
+
- **`constants.star`** - Database constants (ports, users)
|
|
22
|
+
|
|
23
|
+
## Common Tasks
|
|
24
|
+
|
|
25
|
+
### Provision database for service
|
|
26
|
+
```starlark
|
|
27
|
+
load("./relational.star", "provision_database")
|
|
28
|
+
compose_entry = provision_database("order-management-backend", "{project}_order")
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Get database URL
|
|
32
|
+
```starlark
|
|
33
|
+
load("./relational.star", "get_database_url")
|
|
34
|
+
url = get_database_url("order-management-backend")
|
|
35
|
+
# Returns: postgresql://postgres:postgres@order-management-backend-db:5432/{project}_order
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Wait for database
|
|
39
|
+
```starlark
|
|
40
|
+
load("./prisma/db_readiness.star", "wait_for_db")
|
|
41
|
+
script = wait_for_db(db_url, timeout=30)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Architecture
|
|
45
|
+
|
|
46
|
+
Each service with `databaseName` in manifest gets:
|
|
47
|
+
1. PostgreSQL container in Docker Compose
|
|
48
|
+
2. Volume for persistence
|
|
49
|
+
3. Readiness check before migrations
|
|
50
|
+
4. Dedicated port mapping (avoids conflicts)
|
|
51
|
+
|
|
52
|
+
## Integration
|
|
53
|
+
|
|
54
|
+
- Called by `resources/deps.star` - when setting up service dependencies
|
|
55
|
+
- Used by `platform/docker/` - for Docker Compose generation
|
|
56
|
+
- Part of service resource dependencies chain
|
|
57
|
+
|
|
58
|
+
## Database Naming
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
{project}_{domain} // e.g., {project}_order, {project}_user
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Each domain gets one database shared by its services (backend, migrator, etc).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# AGENTS.md - Common Utilities
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Shared utility functions used across all Tilt topologies.
|
|
6
|
+
|
|
7
|
+
## Key Files
|
|
8
|
+
|
|
9
|
+
### Core Utilities
|
|
10
|
+
- **`utils.star`** - `Utils` struct with file operations, path manipulation
|
|
11
|
+
- **`paths.star`** - Path utilities, path joining, normalization
|
|
12
|
+
- **`strings.star`** - String manipulation helpers
|
|
13
|
+
|
|
14
|
+
### Tilt Helpers
|
|
15
|
+
- **`tilt.star`** - Tilt-specific utilities
|
|
16
|
+
- **`debug.star`** - Debug logging, tracing
|
|
17
|
+
|
|
18
|
+
## Common Tasks
|
|
19
|
+
|
|
20
|
+
### Read JSON file
|
|
21
|
+
```starlark
|
|
22
|
+
load("./utils.star", "Utils")
|
|
23
|
+
content = Utils.read_json_file(path)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Check if path exists
|
|
27
|
+
```starlark
|
|
28
|
+
load("./utils.star", "Utils")
|
|
29
|
+
exists = Utils.path_exists(path)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Join paths
|
|
33
|
+
```starlark
|
|
34
|
+
load("./utils.star", "Utils")
|
|
35
|
+
full_path = Utils.join_paths(base, relative)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
Most topology modules load this:
|
|
41
|
+
```starlark
|
|
42
|
+
load("../common/utils.star", "Utils")
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Important Notes
|
|
46
|
+
|
|
47
|
+
- These are pure Starlark functions (no Tilt builtins)
|
|
48
|
+
- Safe to use in any context
|
|
49
|
+
- No side effects
|
|
50
|
+
|
|
51
|
+
## Available Functions
|
|
52
|
+
|
|
53
|
+
See `Utils` struct for full list:
|
|
54
|
+
- `read_json_file(path)`
|
|
55
|
+
- `path_exists(path)`
|
|
56
|
+
- `join_paths(base, rel)`
|
|
57
|
+
- `sanitize_name(name)`
|
|
58
|
+
- `extract_domain(path)`
|
|
59
|
+
- `get_relative_path(from, to)`
|