@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,341 @@
|
|
|
1
|
+
#!/usr/bin/env starlark
|
|
2
|
+
# BEFORE/AFTER: Making Tilt Obvious (Zig-Style Explicitness)
|
|
3
|
+
#
|
|
4
|
+
# This file demonstrates how the new spec.master makes the system
|
|
5
|
+
# completely explicit - addressing the Zig developer's critique about
|
|
6
|
+
# "hidden control flow" and "no hidden allocations"
|
|
7
|
+
|
|
8
|
+
# =============================================================================
|
|
9
|
+
# ❌ BEFORE: Implicit, Hidden, Magic
|
|
10
|
+
# =============================================================================
|
|
11
|
+
|
|
12
|
+
# Magic load - where does this file live? Who knows.
|
|
13
|
+
# load("./discovery/registry.star", "get_app_resources")
|
|
14
|
+
|
|
15
|
+
# Magic context - what's inside ctx? Runtime mystery.
|
|
16
|
+
# ctx = Context.build(full_graph, manifest)
|
|
17
|
+
|
|
18
|
+
# Magic path construction - where does this write?
|
|
19
|
+
# output_path = path.join(resource_path, "tsconfig.json")
|
|
20
|
+
|
|
21
|
+
# Magic feature check - is this enabled? Where defined?
|
|
22
|
+
# if features.is_enabled("istio"):
|
|
23
|
+
|
|
24
|
+
# Magic port allocation - algorithm hidden
|
|
25
|
+
# port = allocate_port(resource_name)
|
|
26
|
+
|
|
27
|
+
# Magic dependency resolution - how does this work?
|
|
28
|
+
# deps = resolve_dependencies(manifest)
|
|
29
|
+
|
|
30
|
+
# =============================================================================
|
|
31
|
+
# ✅ AFTER: Explicit, Obvious, No Magic
|
|
32
|
+
# =============================================================================
|
|
33
|
+
|
|
34
|
+
# Load the master spec - ALL paths are explicit constants
|
|
35
|
+
load("{PROJECT_ROOT}/.tilt/spec.master", "SPEC", "CONSTANTS", "VALIDATION", "FEATURES", "OUTPUT", "DEBUG")
|
|
36
|
+
|
|
37
|
+
# 💡 ALTERNATIVE: Use the easier-to-remember alias names
|
|
38
|
+
# Both work identically - use whichever you prefer!
|
|
39
|
+
#
|
|
40
|
+
# load("{PROJECT_ROOT}/.tilt/paths.star", "SPEC", "CONSTANTS", "DEBUG")
|
|
41
|
+
# load("{PROJECT_ROOT}/.tilt/where-things-live.star", "SPEC", "CONSTANTS", "DEBUG")
|
|
42
|
+
#
|
|
43
|
+
# Why aliases? Because "paths" is easier to remember than "spec.master" 😊
|
|
44
|
+
|
|
45
|
+
# Explicit imports - you SEE exactly what files are loaded
|
|
46
|
+
load(SPEC.DISCOVERY.REGISTRY, "get_app_resources", "get_resource_by_name")
|
|
47
|
+
load(SPEC.DISCOVERY.LOADING, "load_manifest")
|
|
48
|
+
load(SPEC.GENERATORS.VITE, "generate_vite_config")
|
|
49
|
+
load(SPEC.GENERATORS.TSCONFIG, "generate_tsconfig")
|
|
50
|
+
load(SPEC.GENERATORS.DOCKERFILE, "generate_dockerfile")
|
|
51
|
+
load(SPEC.GENERATORS.MANIFEST_RESOURCE, "ManifestResource")
|
|
52
|
+
|
|
53
|
+
# EXPLICIT path construction - no hidden logic
|
|
54
|
+
def get_resource_path(resource_name):
|
|
55
|
+
"""Build service path EXPLICITLY from constants."""
|
|
56
|
+
return SPEC.RESOURCES_DIR + "/product/" + resource_name
|
|
57
|
+
|
|
58
|
+
def get_manifest_path(resource_path):
|
|
59
|
+
"""Manifest path is EXPLICIT, not discovered."""
|
|
60
|
+
return resource_path + "/" + RESOURCE_PATTERNS.MANIFEST_FILE
|
|
61
|
+
|
|
62
|
+
def get_output_path(resource_name, filename):
|
|
63
|
+
"""Output path is EXPLICIT, constructed from constants."""
|
|
64
|
+
return OUTPUT.CONFIGS + "/" + resource_name + "/" + filename
|
|
65
|
+
|
|
66
|
+
# =============================================================================
|
|
67
|
+
# EXPLICIT CONFIGURATION GENERATION
|
|
68
|
+
# =============================================================================
|
|
69
|
+
|
|
70
|
+
def generate_resource_configs(resource_name, manifest):
|
|
71
|
+
"""
|
|
72
|
+
Generate configs with EXPLICIT paths and constraints.
|
|
73
|
+
No hidden allocations. No magic context.
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
# EXPLICIT: Validate inputs (Zig-style defensive programming)
|
|
77
|
+
if not resource_name:
|
|
78
|
+
fail("resource_name is empty - explicit validation")
|
|
79
|
+
|
|
80
|
+
if not manifest:
|
|
81
|
+
fail("manifest is empty - explicit validation")
|
|
82
|
+
|
|
83
|
+
# EXPLICIT: Port validation with visible constraints
|
|
84
|
+
port = manifest.get("port")
|
|
85
|
+
if port < VALIDATION.MIN_PORT or port > VALIDATION.MAX_PORT:
|
|
86
|
+
fail("port {} outside valid range [{}-{}]".format(
|
|
87
|
+
port, VALIDATION.MIN_PORT, VALIDATION.MAX_PORT
|
|
88
|
+
))
|
|
89
|
+
|
|
90
|
+
if port in VALIDATION.RESERVED_PORTS:
|
|
91
|
+
fail("port {} is in RESERVED_PORTS list".format(port))
|
|
92
|
+
|
|
93
|
+
# EXPLICIT: Feature check - visible toggle
|
|
94
|
+
if FEATURES.ISTIO_INTEGRATION:
|
|
95
|
+
# 🗓️ ROADMAP: Will generate Istio configs when implemented
|
|
96
|
+
istio_config = generate_istio_config(manifest)
|
|
97
|
+
else:
|
|
98
|
+
# EXPLICIT: Currently using Traefik
|
|
99
|
+
istio_config = None
|
|
100
|
+
|
|
101
|
+
# EXPLICIT: Path construction - you SEE where files go
|
|
102
|
+
resource_path = get_resource_path(resource_name)
|
|
103
|
+
output_dir = get_output_path(resource_name, "")
|
|
104
|
+
|
|
105
|
+
configs = {
|
|
106
|
+
"tsconfig": {
|
|
107
|
+
"input": get_manifest_path(resource_path),
|
|
108
|
+
"output": output_dir + RESOURCE_PATTERNS.GENERATED_TSCONFIG,
|
|
109
|
+
"generator": SPEC.GENERATORS.TSCONFIG,
|
|
110
|
+
},
|
|
111
|
+
"vite": {
|
|
112
|
+
"input": get_manifest_path(resource_path),
|
|
113
|
+
"output": output_dir + RESOURCE_PATTERNS.GENERATED_VITE_CONFIG,
|
|
114
|
+
"generator": SPEC.GENERATORS.VITE,
|
|
115
|
+
},
|
|
116
|
+
"dockerfile": {
|
|
117
|
+
"input": get_manifest_path(resource_path),
|
|
118
|
+
"output": resource_path + "/" + RESOURCE_PATTERNS.DOCKERFILE,
|
|
119
|
+
"generator": SPEC.GENERATORS.DOCKERFILE,
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
# EXPLICIT: Debug output (visible when DEBUG.DUMP_GENERATED_CONFIGS)
|
|
124
|
+
if DEBUG.DUMP_GENERATED_CONFIGS:
|
|
125
|
+
print("[DEBUG] Generated configs for {}:".format(resource_name))
|
|
126
|
+
for name, cfg in configs.items():
|
|
127
|
+
print(" {}: {}".format(name, cfg["output"]))
|
|
128
|
+
|
|
129
|
+
return configs
|
|
130
|
+
|
|
131
|
+
# =============================================================================
|
|
132
|
+
# EXPLICIT SERVICE DISCOVERY (No Magic Globbing)
|
|
133
|
+
# =============================================================================
|
|
134
|
+
|
|
135
|
+
def discover_services_explicit():
|
|
136
|
+
"""
|
|
137
|
+
Discover services with EXPLICIT search paths.
|
|
138
|
+
No hidden glob patterns. Everything visible.
|
|
139
|
+
"""
|
|
140
|
+
discovered = []
|
|
141
|
+
|
|
142
|
+
# EXPLICIT: Iterate declared search paths
|
|
143
|
+
for search_path in DISCOVERY.RESOURCE_SEARCH_PATHS:
|
|
144
|
+
# EXPLICIT: Glob pattern is declared in spec.master
|
|
145
|
+
pattern = search_path + "/" + DISCOVERY.MANIFEST_PATTERNS[0] # service.json
|
|
146
|
+
|
|
147
|
+
# EXPLICIT: Check exclusions
|
|
148
|
+
matches = glob([pattern], exclude=DISCOVERY.EXCLUDE_PATTERNS)
|
|
149
|
+
|
|
150
|
+
for match in matches:
|
|
151
|
+
# EXPLICIT: Construct service info from path
|
|
152
|
+
resource_dir = os.path.dirname(match)
|
|
153
|
+
resource_name = os.path.basename(resource_dir)
|
|
154
|
+
|
|
155
|
+
discovered.append({
|
|
156
|
+
"name": resource_name,
|
|
157
|
+
"path": resource_dir,
|
|
158
|
+
"manifest_path": match,
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
return discovered
|
|
162
|
+
|
|
163
|
+
# =============================================================================
|
|
164
|
+
# EXPLICIT CONTEXT BUILDING (No Black Box)
|
|
165
|
+
# =============================================================================
|
|
166
|
+
|
|
167
|
+
def build_explicit_context(resource_manifest, all_services):
|
|
168
|
+
"""
|
|
169
|
+
Build context EXPLICITLY - every field is visible.
|
|
170
|
+
No mystery black box.
|
|
171
|
+
"""
|
|
172
|
+
ctx = struct(
|
|
173
|
+
# EXPLICIT: Source data
|
|
174
|
+
manifest = resource_manifest,
|
|
175
|
+
all_services = all_services,
|
|
176
|
+
|
|
177
|
+
# EXPLICIT: Computed values (transparent logic)
|
|
178
|
+
resource_name = resource_manifest.get("appName"),
|
|
179
|
+
resource_path = get_resource_path(resource_manifest.get("appName")),
|
|
180
|
+
port = resource_manifest.get("port"),
|
|
181
|
+
|
|
182
|
+
# EXPLICIT: Dependencies (resolved, not hidden)
|
|
183
|
+
dependencies = resolve_explicit_dependencies(
|
|
184
|
+
resource_manifest.get("dependsOn", []),
|
|
185
|
+
all_services
|
|
186
|
+
),
|
|
187
|
+
|
|
188
|
+
# EXPLICIT: System constants
|
|
189
|
+
constants = CONSTANTS,
|
|
190
|
+
validation = VALIDATION,
|
|
191
|
+
features = FEATURES,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
# EXPLICIT: Debug inspection
|
|
195
|
+
if DEBUG.DUMP_CONTEXT_ON_GENERATION:
|
|
196
|
+
print("[DEBUG] Context for {}:".format(ctx.resource_name))
|
|
197
|
+
print(" port: {}".format(ctx.port))
|
|
198
|
+
print(" dependencies: {}".format([d["name"] for d in ctx.dependencies]))
|
|
199
|
+
print(" features enabled: {}".format([f for f in dir(FEATURES) if not f.startswith("_")]))
|
|
200
|
+
|
|
201
|
+
return ctx
|
|
202
|
+
|
|
203
|
+
def resolve_explicit_dependencies(dep_names, all_services):
|
|
204
|
+
"""
|
|
205
|
+
Resolve dependencies EXPLICITLY.
|
|
206
|
+
No hidden graph traversal.
|
|
207
|
+
"""
|
|
208
|
+
resolved = []
|
|
209
|
+
|
|
210
|
+
for dep_name in dep_names:
|
|
211
|
+
# EXPLICIT: Lookup in explicit list
|
|
212
|
+
found = None
|
|
213
|
+
for svc in all_services:
|
|
214
|
+
if svc["name"] == dep_name:
|
|
215
|
+
found = svc
|
|
216
|
+
break
|
|
217
|
+
|
|
218
|
+
if not found:
|
|
219
|
+
fail("Dependency '{}' not found in explicit service list".format(dep_name))
|
|
220
|
+
|
|
221
|
+
# EXPLICIT: Check for circular dependencies
|
|
222
|
+
if dep_name in resolved:
|
|
223
|
+
fail("Circular dependency detected involving '{}'".format(dep_name))
|
|
224
|
+
|
|
225
|
+
resolved.append(found)
|
|
226
|
+
|
|
227
|
+
return resolved
|
|
228
|
+
|
|
229
|
+
# =============================================================================
|
|
230
|
+
# EXPLICIT GENERATION ENTRY POINT
|
|
231
|
+
# =============================================================================
|
|
232
|
+
|
|
233
|
+
def generate_all_explicit():
|
|
234
|
+
"""
|
|
235
|
+
Main generation with EXPLICIT flow.
|
|
236
|
+
Every step is visible. No magic.
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
print("=" * 60)
|
|
240
|
+
print("TILT GENERATION - EXPLICIT MODE")
|
|
241
|
+
print("=" * 60)
|
|
242
|
+
|
|
243
|
+
# EXPLICIT: Step 1 - Discovery
|
|
244
|
+
print("\n[1/5] DISCOVERY")
|
|
245
|
+
print(" Search paths: {}".format(DISCOVERY.RESOURCE_SEARCH_PATHS))
|
|
246
|
+
services = discover_services_explicit()
|
|
247
|
+
print(" Found {} services".format(len(services)))
|
|
248
|
+
for svc in services:
|
|
249
|
+
print(" - {} at {}".format(svc["name"], svc["path"]))
|
|
250
|
+
|
|
251
|
+
# EXPLICIT: Step 2 - Validation
|
|
252
|
+
print("\n[2/5] VALIDATION")
|
|
253
|
+
for svc in services:
|
|
254
|
+
port = svc.get("port", 0)
|
|
255
|
+
if port < VALIDATION.MIN_PORT:
|
|
256
|
+
fail(" ❌ {}: port {} below minimum {}".format(
|
|
257
|
+
svc["name"], port, VALIDATION.MIN_PORT
|
|
258
|
+
))
|
|
259
|
+
print(" ✅ {}: port {} valid".format(svc["name"], port))
|
|
260
|
+
|
|
261
|
+
# EXPLICIT: Step 3 - Context Building
|
|
262
|
+
print("\n[3/5] CONTEXT BUILDING")
|
|
263
|
+
contexts = {}
|
|
264
|
+
for svc in services:
|
|
265
|
+
ctx = build_explicit_context(svc, services)
|
|
266
|
+
contexts[svc["name"]] = ctx
|
|
267
|
+
print(" ✅ {}: context built".format(svc["name"]))
|
|
268
|
+
|
|
269
|
+
# EXPLICIT: Step 4 - Generation
|
|
270
|
+
print("\n[4/5] GENERATION")
|
|
271
|
+
generated = {}
|
|
272
|
+
for svc in services:
|
|
273
|
+
configs = generate_resource_configs(svc["name"], svc)
|
|
274
|
+
generated[svc["name"]] = configs
|
|
275
|
+
print(" ✅ {}: {} configs generated".format(svc["name"], len(configs)))
|
|
276
|
+
|
|
277
|
+
# EXPLICIT: Step 5 - Output
|
|
278
|
+
print("\n[5/5] OUTPUT")
|
|
279
|
+
print(" Output directory: {}".format(OUTPUT.CONFIGS))
|
|
280
|
+
for svc_name, configs in generated.items():
|
|
281
|
+
for cfg_name, cfg in configs.items():
|
|
282
|
+
print(" Writing: {}".format(cfg["output"]))
|
|
283
|
+
# write_file(cfg["output"], cfg["content"])
|
|
284
|
+
|
|
285
|
+
print("\n" + "=" * 60)
|
|
286
|
+
print("GENERATION COMPLETE")
|
|
287
|
+
print(" Services: {}".format(len(services)))
|
|
288
|
+
print(" Configs: {}".format(sum(len(c) for c in generated.values())))
|
|
289
|
+
print(" Output: {}".format(OUTPUT.CONFIGS))
|
|
290
|
+
print("=" * 60)
|
|
291
|
+
|
|
292
|
+
# =============================================================================
|
|
293
|
+
# ZIG-STYLE MANIFESTO APPLIED
|
|
294
|
+
# =============================================================================
|
|
295
|
+
|
|
296
|
+
"""
|
|
297
|
+
WHAT CHANGED:
|
|
298
|
+
|
|
299
|
+
BEFORE (Implicit):
|
|
300
|
+
- Paths discovered at runtime
|
|
301
|
+
- Features checked magically
|
|
302
|
+
- Context is black box
|
|
303
|
+
- Errors at runtime
|
|
304
|
+
|
|
305
|
+
AFTER (Explicit - Zig-style):
|
|
306
|
+
- Paths are CONSTANTS in spec.master
|
|
307
|
+
- Features are EXPLICIT STRUCT toggles
|
|
308
|
+
- Context is EXPLICIT STRUCT (every field visible)
|
|
309
|
+
- Errors at "compile time" (Tiltfile load)
|
|
310
|
+
|
|
311
|
+
PRINCIPLES APPLIED:
|
|
312
|
+
✅ No hidden control flow
|
|
313
|
+
✅ No hidden allocations (paths explicit)
|
|
314
|
+
✅ No magic (everything declared in spec.master)
|
|
315
|
+
✅ Explicit is better than implicit
|
|
316
|
+
✅ Fail fast with clear messages
|
|
317
|
+
|
|
318
|
+
ANSWER TO ZIG DEVELOPER:
|
|
319
|
+
"You wanted obvious. Now it's obvious."
|
|
320
|
+
"Every path is a constant."
|
|
321
|
+
"Every feature is a toggle."
|
|
322
|
+
"Every context field is visible."
|
|
323
|
+
"No magic. No surprises."
|
|
324
|
+
"""
|
|
325
|
+
|
|
326
|
+
# =============================================================================
|
|
327
|
+
# USAGE EXAMPLE
|
|
328
|
+
# =============================================================================
|
|
329
|
+
|
|
330
|
+
# To use in your Tiltfile:
|
|
331
|
+
#
|
|
332
|
+
# load("{}/.tilt/spec.master".format(PROJECT_ROOT), "SPEC", "CONSTANTS")
|
|
333
|
+
#
|
|
334
|
+
# # Now EVERYTHING is explicit and obvious
|
|
335
|
+
# print("Registry path: {}".format(SPEC.DISCOVERY.REGISTRY))
|
|
336
|
+
# print("Max port: {}".format(VALIDATION.MAX_PORT))
|
|
337
|
+
# print("Istio enabled: {}".format(FEATURES.ISTIO_INTEGRATION))
|
|
338
|
+
#
|
|
339
|
+
# # No more guessing where files live
|
|
340
|
+
# # No more wondering what ctx contains
|
|
341
|
+
# # No more hidden feature flags
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Topologies (Incremental Migration)
|
|
3
|
+
status: backlog
|
|
4
|
+
created: 2026-03-31
|
|
5
|
+
updated: 2026-10-18
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Topologies (Incremental Migration)
|
|
9
|
+
|
|
10
|
+
This folder holds the Starlark modules that turn `service.json` manifests into Docker Compose and Tilt resources for local development. Flisk generates these for `flisk up` on your machine; it does not generate Kubernetes deployment manifests.
|
|
11
|
+
|
|
12
|
+
## How a `service.json` becomes running resources
|
|
13
|
+
|
|
14
|
+
Paths below are relative to the repository root. The order is the order things run.
|
|
15
|
+
|
|
16
|
+
1. **Generate the project Tiltfile.** `flisk up` (or `flisk config regenerate`) renders `.tdk/.tdk-out/Tiltfile` from [`cli/templates/Tiltfile.hbs`](../../cli/templates/Tiltfile.hbs). It loads the engine through the root [`Tiltfile`](../../Tiltfile), which re-exports `Manifest`, `Orchestrator`, `Infra` and the rest.
|
|
17
|
+
2. **Discover and validate manifests.** The generated Tiltfile calls `Manifest.load_all(...)`. Discovery, normalization and the field checks live in [`discovery/loading.star`](../../discovery/loading.star), [`discovery/json_manifest_scanner.star`](../../discovery/json_manifest_scanner.star), [`discovery/manifest/normalize.star`](../../discovery/manifest/normalize.star) and [`discovery/manifest/validation.star`](../../discovery/manifest/validation.star). Parsing helpers and constants are in [`tilt/manifest/parser.star`](tilt/manifest/parser.star) and [`tilt/manifest/constants.star`](tilt/manifest/constants.star). The `dependsOn` check you see from `flisk config verify` is in [`cli/src/commands/config.ts`](../../cli/src/commands/config.ts).
|
|
18
|
+
3. **Orchestrate each resource.** The Tiltfile calls `Orchestrator.apply_service(...)`, which reaches [`tilt/resources/orchestrator/apply.star`](tilt/resources/orchestrator/apply.star). For each enabled stack it validates the resource, loads its manifest, registers the Compose resource and, for migrators, registers the migration job. The helpers are the `apply_*.star` files next to it. [`apply_compose_resource_registration.star`](tilt/resources/orchestrator/apply_compose_resource_registration.star) turns `dependsOn` into Tilt `resource_deps`.
|
|
19
|
+
4. **Generate the platform files.** The Docker modules under [`platform/docker/`](platform/docker/) write the files each resource needs: Compose entries in [`compose/compose.star`](platform/docker/compose/compose.star), Dockerfiles in [`dockerfile/dockerfile.star`](platform/docker/dockerfile/dockerfile.star) and the image layers in [`layers/`](platform/docker/layers/). Config generators such as `tsconfig` and Vite are in [`tilt/generators/`](tilt/generators/). Shared infrastructure (Traefik, Postgres) is loaded by [`tilt/resources/infra-loader.star`](tilt/resources/infra-loader.star).
|
|
20
|
+
5. **Read the generated project files.** The output lands in each resource's `.autogenerated/` folder, for example `docker-compose.app.autogenerated.yml` and `Dockerfile.app.autogenerated`. Do not edit these by hand; see [generated files](../../docs/generated-files.md).
|
|
21
|
+
|
|
22
|
+
If you change a field in `service.json`, start at step 2. If a container is built or wired wrongly, start at step 3 or 4.
|
|
23
|
+
|
|
24
|
+
## Layout
|
|
25
|
+
|
|
26
|
+
- `platform/`: Docker (`docker/`), proxy (`net/proxy.star`), shared Postgres (`state/relational.star`), secrets (`security/secrets.star`) and the local registry (`registries/local.star`).
|
|
27
|
+
- `tilt/manifest/`: manifest parsing helpers, validators and constants. See its [README](tilt/manifest/README.md).
|
|
28
|
+
- `tilt/config/`: global config, defaults, focus profiles and feature flags.
|
|
29
|
+
- `tilt/resources/`: databases, libraries, ordering, watchers and the orchestrator.
|
|
30
|
+
- `tilt/generators/`: `tsconfig`, Vite, nginx, `.npmrc` and AGENTS.md generators.
|
|
31
|
+
- `tilt/common/`: shared helpers used by the modules above.
|
|
32
|
+
|
|
33
|
+
Service discovery itself is in the top-level [`discovery/`](../../discovery/) folder, not in this one.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# AGENTS.md - Docker Platform Infrastructure
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Docker image building, golden image layers, and Dockerfile generation for all services.
|
|
6
|
+
|
|
7
|
+
## Key Concepts
|
|
8
|
+
|
|
9
|
+
### Golden Image Architecture (L1-L4)
|
|
10
|
+
```
|
|
11
|
+
L1: Base (Alpine OS with essential tools, runtime environment variables)
|
|
12
|
+
L2: Dependencies (package manifests and installed dependencies, cached)
|
|
13
|
+
L3: Builder (backend compile, frontend build, production dependency pruning)
|
|
14
|
+
L4: Runtime (backend on Bun, frontend on Nginx or Bun static)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Key Files
|
|
18
|
+
|
|
19
|
+
### Golden Images
|
|
20
|
+
- **`build/golden_image.star`** - GoldenImage struct with L1-L4 builders
|
|
21
|
+
- **`build/golden_image_*.star`** - Build, constants, and Dockerfile helpers used by `GoldenImage`
|
|
22
|
+
- **`dockerfile/dockerfile.star`** - Dockerfile generation for apps
|
|
23
|
+
- **`constants.star`** - Docker constants, image names
|
|
24
|
+
|
|
25
|
+
### Layer Building
|
|
26
|
+
- **`layers/l1_base_layers.star`** - Alpine OS base and runtime environment
|
|
27
|
+
- **`layers/l2_dependency_layers.star`** - Dependency installation
|
|
28
|
+
- **`layers/l3_builder_layers.star`** - Build stage
|
|
29
|
+
- **`layers/l4_runtime_layers.star`** - Minimal runtime
|
|
30
|
+
|
|
31
|
+
### Specialized
|
|
32
|
+
- **`layers/prisma/`** - Prisma-specific Docker layers
|
|
33
|
+
- **`generators/golden_docker_generator_v2.star`** - Current generator (v2)
|
|
34
|
+
|
|
35
|
+
## Common Tasks
|
|
36
|
+
|
|
37
|
+
### Generate Dockerfile for service
|
|
38
|
+
```starlark
|
|
39
|
+
load("./dockerfile/dockerfile.star", "generate_app_dockerfile")
|
|
40
|
+
dockerfile = generate_app_dockerfile(res_path, resource_name, cmd = start_command)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Get golden image
|
|
44
|
+
```starlark
|
|
45
|
+
load("./build/golden_image.star", "GoldenImage")
|
|
46
|
+
image = GoldenImage.get_layer("l2")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Integration
|
|
50
|
+
|
|
51
|
+
- Called by `engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star` - when building service resources
|
|
52
|
+
- Used by discovery - to determine Dockerfile paths
|
|
53
|
+
- Outputs to services' `autogenerated/Dockerfile.*.autogenerated`
|
|
54
|
+
|
|
55
|
+
## Important Notes
|
|
56
|
+
|
|
57
|
+
- Golden images use digests for cache invalidation
|
|
58
|
+
- L2 layer caches `node_modules` for faster rebuilds
|
|
59
|
+
- Each service's Dockerfile starts `FROM {project}/golden-image-l4:latest`
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# 🔐 TILT SDK - AUTH CONFIGURATION UTILITIES
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# Path: .tilt/topologies/platform/docker/auth.star
|
|
7
|
+
# Purpose: Centralized authentication configuration helpers for docker-compose
|
|
8
|
+
# and environment file generation across the platform.
|
|
9
|
+
#
|
|
10
|
+
# Design Principle: This module is decoupled from manifest.json structure.
|
|
11
|
+
# It accepts auth configuration as a dictionary parameter and does
|
|
12
|
+
# not know where the config comes from. Callers (env.star, compose.star)
|
|
13
|
+
# are responsible for extracting auth fields from manifest and passing
|
|
14
|
+
# them as the auth_config dict.
|
|
15
|
+
# =============================================================================
|
|
16
|
+
|
|
17
|
+
# Default values for auth configuration.
|
|
18
|
+
#
|
|
19
|
+
# There is deliberately no default JWT secret: a secret that is the same in every project is not a secret. The JWT secret is
|
|
20
|
+
# generated once per project by the CLI into the project `.env` (JWT_SECRET) and Compose reads it from there.
|
|
21
|
+
DEFAULT_AUTH_MODE = 'local-jwt'
|
|
22
|
+
DEFAULT_IDENTITY_RESOURCE_URL = 'http://identity-service:3000'
|
|
23
|
+
|
|
24
|
+
# Shown by Compose when the project `.env` has no JWT_SECRET.
|
|
25
|
+
JWT_SECRET_MISSING_MESSAGE = 'JWT_SECRET is not set. Run `flisk up` (it adds a generated one to the project .env) or add JWT_SECRET to .env'
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _setting(auth_config, key, default):
|
|
29
|
+
"""A configured value, or the default when the key is missing OR present with a None value.
|
|
30
|
+
|
|
31
|
+
Callers build the config dict with every key present and None for anything unset, and `dict.get(key, default)` returns that
|
|
32
|
+
None instead of the default, which used to turn into the literal text `AUTH_MODE=None` in generated files.
|
|
33
|
+
"""
|
|
34
|
+
if not auth_config:
|
|
35
|
+
return default
|
|
36
|
+
value = auth_config.get(key)
|
|
37
|
+
if value == None or value == '':
|
|
38
|
+
return default
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _first_set(*values):
|
|
43
|
+
"""The first value that is not None or an empty string, else None."""
|
|
44
|
+
for value in values:
|
|
45
|
+
if value != None and value != '':
|
|
46
|
+
return value
|
|
47
|
+
return None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def auth_config_from_manifest(manifest):
|
|
51
|
+
"""Build the auth configuration both the env file and the Compose entry use, from one place.
|
|
52
|
+
|
|
53
|
+
The two writers used to build this separately and drifted: the env file read `identityServiceUrl` while Compose read
|
|
54
|
+
`envVars.IDENTITY_RESOURCE_URL`, so setting one field changed only one output.
|
|
55
|
+
|
|
56
|
+
- authMode: the manifest's `authMode`, else `identity-service` when `dependsOn` contains `identity`, else unset (local-jwt).
|
|
57
|
+
- identityServiceUrl: the manifest's `identityServiceUrl`. The deprecated `params` / `envVars` entry named
|
|
58
|
+
`IDENTITY_RESOURCE_URL` is still honoured when the field is absent, so an existing manifest keeps working.
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
manifest: The service manifest dict (may be None)
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
dict: {'authMode': str or None, 'identityServiceUrl': str or None}; None means "use the default"
|
|
65
|
+
"""
|
|
66
|
+
if not manifest:
|
|
67
|
+
return {'authMode': None, 'identityServiceUrl': None}
|
|
68
|
+
|
|
69
|
+
auth_mode = _first_set(
|
|
70
|
+
manifest.get('authMode'),
|
|
71
|
+
'identity-service' if 'identity' in (manifest.get('dependsOn') or []) else None,
|
|
72
|
+
)
|
|
73
|
+
identity_url = _first_set(
|
|
74
|
+
manifest.get('identityServiceUrl'),
|
|
75
|
+
(manifest.get('params') or {}).get('IDENTITY_RESOURCE_URL'),
|
|
76
|
+
(manifest.get('envVars') or {}).get('IDENTITY_RESOURCE_URL'),
|
|
77
|
+
)
|
|
78
|
+
return {'authMode': auth_mode, 'identityServiceUrl': identity_url}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def get_auth_mode(auth_config):
|
|
82
|
+
"""Get auth mode from auth config with default fallback.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
auth_config: Auth configuration dictionary (may be None or empty)
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
str: Auth mode ('local-jwt' or 'identity-service')
|
|
89
|
+
"""
|
|
90
|
+
return _setting(auth_config, 'authMode', DEFAULT_AUTH_MODE)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def get_identity_resource_url(auth_config):
|
|
94
|
+
"""Get identity service URL from auth config with default fallback.
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
auth_config: Auth configuration dictionary (may be None or empty)
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
str: URL for identity service
|
|
101
|
+
"""
|
|
102
|
+
return _setting(auth_config, 'identityServiceUrl', DEFAULT_IDENTITY_RESOURCE_URL)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def get_auth_config(auth_config):
|
|
106
|
+
"""Get complete auth configuration from auth config dict.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
auth_config: Auth configuration dictionary (may be None or empty)
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
struct: Auth configuration with mode and identity_resource_url (the JWT secret lives in the project .env, not here)
|
|
113
|
+
"""
|
|
114
|
+
return struct(
|
|
115
|
+
mode = get_auth_mode(auth_config),
|
|
116
|
+
identity_resource_url = get_identity_resource_url(auth_config),
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def is_local_jwt_mode(auth_config):
|
|
121
|
+
"""Check if auth mode is local-jwt.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
auth_config: Auth configuration dictionary (may be None or empty)
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
bool: True if auth mode is 'local-jwt'
|
|
128
|
+
"""
|
|
129
|
+
return get_auth_mode(auth_config) == 'local-jwt'
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def is_identity_resource_mode(auth_config):
|
|
133
|
+
"""Check if auth mode is identity-service.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
auth_config: Auth configuration dictionary (may be None or empty)
|
|
137
|
+
|
|
138
|
+
Returns:
|
|
139
|
+
bool: True if auth mode is 'identity-service'
|
|
140
|
+
"""
|
|
141
|
+
return get_auth_mode(auth_config) == 'identity-service'
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def generate_docker_compose_auth_env(auth_config):
|
|
145
|
+
"""Generate docker-compose environment variables for auth configuration.
|
|
146
|
+
|
|
147
|
+
This function returns the properly formatted environment variable block
|
|
148
|
+
for docker-compose.yml files based on the auth mode.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
auth_config: Auth configuration dictionary (may be None or empty)
|
|
152
|
+
|
|
153
|
+
Returns:
|
|
154
|
+
str: Formatted auth environment variables for docker-compose
|
|
155
|
+
"""
|
|
156
|
+
auth_mode = get_auth_mode(auth_config)
|
|
157
|
+
identity_resource_url = get_identity_resource_url(auth_config)
|
|
158
|
+
|
|
159
|
+
if auth_mode == 'local-jwt':
|
|
160
|
+
# Required from the project .env (see JWT_SECRET_MISSING_MESSAGE); there is no shared default.
|
|
161
|
+
return """ - AUTH_MODE=local-jwt
|
|
162
|
+
- JWT_SECRET=${JWT_SECRET:?%(message)s}""" % {'message': JWT_SECRET_MISSING_MESSAGE}
|
|
163
|
+
else:
|
|
164
|
+
return """ - AUTH_MODE=identity-service
|
|
165
|
+
- IDENTITY_RESOURCE_URL=${IDENTITY_RESOURCE_URL:-%(identity_resource_url)s}""" % {'identity_resource_url': identity_resource_url}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def generate_env_file_auth_section(auth_config):
|
|
169
|
+
"""Generate .env file auth section content.
|
|
170
|
+
|
|
171
|
+
This function returns the formatted authentication configuration section
|
|
172
|
+
for .env.backend.autogenerated files. These files are generated, checked by
|
|
173
|
+
`flisk config verify` and never carry secrets, so there is no JWT secret here:
|
|
174
|
+
in local-jwt mode Compose takes JWT_SECRET from the project .env.
|
|
175
|
+
|
|
176
|
+
Args:
|
|
177
|
+
auth_config: Auth configuration dictionary (may be None or empty)
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
str: Formatted auth section for .env files
|
|
181
|
+
"""
|
|
182
|
+
auth_mode = get_auth_mode(auth_config)
|
|
183
|
+
identity_resource_url = get_identity_resource_url(auth_config)
|
|
184
|
+
|
|
185
|
+
content = """
|
|
186
|
+
# Authentication Configuration
|
|
187
|
+
# Mode: {auth_mode} (options: local-jwt, identity-service)
|
|
188
|
+
AUTH_MODE={auth_mode}
|
|
189
|
+
""".format(auth_mode=auth_mode)
|
|
190
|
+
|
|
191
|
+
if auth_mode != 'local-jwt':
|
|
192
|
+
content += "IDENTITY_RESOURCE_URL={identity_resource_url}\n".format(identity_resource_url=identity_resource_url)
|
|
193
|
+
|
|
194
|
+
return content
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
# Export all functions as a struct for easy importing
|
|
198
|
+
AuthConfig = struct(
|
|
199
|
+
from_manifest = auth_config_from_manifest,
|
|
200
|
+
get_auth_mode = get_auth_mode,
|
|
201
|
+
get_identity_resource_url = get_identity_resource_url,
|
|
202
|
+
get_auth_config = get_auth_config,
|
|
203
|
+
is_local_jwt_mode = is_local_jwt_mode,
|
|
204
|
+
is_identity_resource_mode = is_identity_resource_mode,
|
|
205
|
+
generate_docker_compose_auth_env = generate_docker_compose_auth_env,
|
|
206
|
+
generate_env_file_auth_section = generate_env_file_auth_section,
|
|
207
|
+
)
|