@flisk-sh/flisk 0.0.0-stage → 1.3.190
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-CLCUIDBH.js +510 -0
- package/cli/dist-bundle/cli.js +2017 -0
- package/cli/dist-bundle/cold-preflight-SY26O2IG.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,490 @@
|
|
|
1
|
+
# Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# 📋 MANIFEST MODULE - PARSER
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# Path: .tilt/topologies/tilt/manifest/parser.star
|
|
7
|
+
# Purpose: JSON parsing and manifest normalization
|
|
8
|
+
# Status: Phase 2 of manifest system refactoring
|
|
9
|
+
# =============================================================================
|
|
10
|
+
|
|
11
|
+
# === INLINED CONSTANTS for pure extension loading ===
|
|
12
|
+
ORM = "prisma"
|
|
13
|
+
DEFAULTS = {}
|
|
14
|
+
|
|
15
|
+
# === END INLINED CONSTANTS ===
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
load("./constants.star",
|
|
19
|
+
"MANIFEST_DEFAULTS",
|
|
20
|
+
"MANIFEST_FILENAME",
|
|
21
|
+
"VALID_APP_TYPES",
|
|
22
|
+
"DEFAULT_SYNCS",
|
|
23
|
+
"AUTOGENERATED_CONFIG_PATHS",
|
|
24
|
+
"TRAEFIK_DEFAULTS",
|
|
25
|
+
)
|
|
26
|
+
load("./schema.star", "ManifestSchema")
|
|
27
|
+
load("./errors.star", "ManifestErrors")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def parse(content, path=""):
|
|
31
|
+
"""
|
|
32
|
+
Parse JSON content into manifest dict.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
content: Raw JSON string
|
|
36
|
+
path: Optional path for error context
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
struct(
|
|
40
|
+
manifest=None, # Parsed manifest dict or None
|
|
41
|
+
error=None, # Error message or None
|
|
42
|
+
warnings=[], # List of warning messages
|
|
43
|
+
)
|
|
44
|
+
"""
|
|
45
|
+
warnings = []
|
|
46
|
+
|
|
47
|
+
if not content or not str(content).strip():
|
|
48
|
+
return struct(
|
|
49
|
+
manifest=None,
|
|
50
|
+
error="Empty content provided",
|
|
51
|
+
warnings=warnings,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Parse JSON
|
|
55
|
+
manifest = decode_json(content)
|
|
56
|
+
|
|
57
|
+
if manifest == None:
|
|
58
|
+
error = ManifestErrors.new(
|
|
59
|
+
message="Failed to parse JSON" + (" in " + path if path else ""),
|
|
60
|
+
category=ManifestErrors.CATEGORY['PARSE'],
|
|
61
|
+
severity=ManifestErrors.SEVERITY['ERROR'],
|
|
62
|
+
context={'path': path} if path else {},
|
|
63
|
+
)
|
|
64
|
+
return struct(
|
|
65
|
+
manifest=None,
|
|
66
|
+
error=ManifestErrors.format(error),
|
|
67
|
+
warnings=warnings,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# Note: 'dependencies' field is no longer supported, use 'dependsOn'
|
|
71
|
+
|
|
72
|
+
return struct(
|
|
73
|
+
manifest=manifest,
|
|
74
|
+
error=None,
|
|
75
|
+
warnings=warnings,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Characters allowed in the string fields that are written into generated Compose, Traefik and NATS config as they are. A line break
|
|
79
|
+
# or YAML syntax in one of them adds keys to the generated service (GHSA-phgf-pww4-7jxc). Keep in step with GENERATED_STRING_FIELDS
|
|
80
|
+
# in cli/src/utils/service-manifest.ts.
|
|
81
|
+
_ALPHANUM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
|
82
|
+
_PATH_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789/-"
|
|
83
|
+
_GENERATED_STRING_RULES = [
|
|
84
|
+
# (field path, allowed characters, required first character or "")
|
|
85
|
+
(['healthCheckPath'], _PATH_CHARS, '/'),
|
|
86
|
+
(['traefik', 'host'], _ALPHANUM + '.-', ''),
|
|
87
|
+
(['traefik', 'pathPrefix'], _PATH_CHARS, '/'),
|
|
88
|
+
(['traefik', 'healthCheck'], _PATH_CHARS, '/'),
|
|
89
|
+
(['nats', 'queueGroup'], _ALPHANUM + '_.-', ''),
|
|
90
|
+
(['databaseName'], _ALPHANUM + '_-', ''),
|
|
91
|
+
(['stack'], _ALPHANUM + '_-', ''),
|
|
92
|
+
(['image'], _ALPHANUM + '._/:@-', ''),
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
def generated_string_error(manifest, resource_path=""):
|
|
96
|
+
"""
|
|
97
|
+
Return an error message if a value that is written into generated config has unsafe characters, else None.
|
|
98
|
+
|
|
99
|
+
The value is not echoed, because it may contain the line break that makes it dangerous.
|
|
100
|
+
"""
|
|
101
|
+
for keys, allowed, first in _GENERATED_STRING_RULES:
|
|
102
|
+
value = manifest
|
|
103
|
+
for key in keys:
|
|
104
|
+
value = value.get(key) if type(value) == "dict" else None
|
|
105
|
+
if value == None or value == "":
|
|
106
|
+
continue
|
|
107
|
+
field = '.'.join(keys)
|
|
108
|
+
where = " in " + resource_path if resource_path else ""
|
|
109
|
+
if type(value) != "string":
|
|
110
|
+
return "MANIFEST ERROR: '{}' must be a string{}".format(field, where)
|
|
111
|
+
if first and not value.startswith(first):
|
|
112
|
+
return "MANIFEST ERROR: '{}' must start with '{}'{}".format(field, first, where)
|
|
113
|
+
for c in value.elems():
|
|
114
|
+
if c not in allowed:
|
|
115
|
+
return "MANIFEST ERROR: '{}' has characters that are not allowed (no spaces, line breaks or YAML syntax){}".format(field, where)
|
|
116
|
+
return _line_break_error(manifest, resource_path)
|
|
117
|
+
|
|
118
|
+
# Line breaks (including the Unicode ones YAML 1.1 honours) and other control characters.
|
|
119
|
+
_LINE_BREAK_OR_CONTROL = [chr(i) for i in range(32)] + [chr(127), "\u0085", "
", "
"]
|
|
120
|
+
|
|
121
|
+
def _has_line_break(text):
|
|
122
|
+
for bad in _LINE_BREAK_OR_CONTROL:
|
|
123
|
+
if bad in text:
|
|
124
|
+
return True
|
|
125
|
+
return False
|
|
126
|
+
|
|
127
|
+
def _line_break_error(manifest, resource_path):
|
|
128
|
+
"""
|
|
129
|
+
Many more values than _GENERATED_STRING_RULES reach generated config (port, appName, dockerfile, buildContext, basePath, envVars,
|
|
130
|
+
...). A key can only be added through a line break, so no string key or value may contain one. `smoke` is skipped: it is never
|
|
131
|
+
written into generated config. Keep in step with lineBreakErrors in cli/src/utils/service-manifest.ts.
|
|
132
|
+
"""
|
|
133
|
+
where = " in " + resource_path if resource_path else ""
|
|
134
|
+
pending = [(value, key) for key, value in manifest.items() if key != 'smoke']
|
|
135
|
+
for key in manifest.keys():
|
|
136
|
+
if type(key) == "string" and _has_line_break(key):
|
|
137
|
+
return "MANIFEST ERROR: a key contains a line break{}".format(where)
|
|
138
|
+
# Starlark has no recursion or while loops; a service.json never nests anywhere near this many values.
|
|
139
|
+
for _ in range(100000):
|
|
140
|
+
if not pending:
|
|
141
|
+
return None
|
|
142
|
+
value, field = pending.pop()
|
|
143
|
+
if type(value) == "string":
|
|
144
|
+
if _has_line_break(value):
|
|
145
|
+
return "MANIFEST ERROR: '{}' must not contain line breaks or control characters{}".format(field, where)
|
|
146
|
+
elif type(value) == "list":
|
|
147
|
+
for index, item in enumerate(value):
|
|
148
|
+
pending.append((item, "{}[{}]".format(field, index)))
|
|
149
|
+
elif type(value) == "dict":
|
|
150
|
+
for key, item in value.items():
|
|
151
|
+
if type(key) == "string" and _has_line_break(key):
|
|
152
|
+
return "MANIFEST ERROR: a key in '{}' contains a line break{}".format(field, where)
|
|
153
|
+
pending.append((item, "{}.{}".format(field, key)))
|
|
154
|
+
return "MANIFEST ERROR: service.json is nested too deeply{}".format(where)
|
|
155
|
+
|
|
156
|
+
def normalize(manifest, resource_path=""):
|
|
157
|
+
"""
|
|
158
|
+
Normalize manifest with default values and computed fields.
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
manifest: Raw parsed manifest dict
|
|
162
|
+
resource_path: Resource directory path for context
|
|
163
|
+
|
|
164
|
+
Returns:
|
|
165
|
+
Normalized manifest dict with all fields populated
|
|
166
|
+
"""
|
|
167
|
+
normalized = {}
|
|
168
|
+
warnings = []
|
|
169
|
+
|
|
170
|
+
# Copy all existing fields
|
|
171
|
+
for key, value in manifest.items():
|
|
172
|
+
normalized[key] = value
|
|
173
|
+
|
|
174
|
+
unsafe_field_error = generated_string_error(normalized, resource_path)
|
|
175
|
+
if unsafe_field_error:
|
|
176
|
+
fail(unsafe_field_error)
|
|
177
|
+
|
|
178
|
+
# 1. Apply defaults for missing fields
|
|
179
|
+
for field, default_value in MANIFEST_DEFAULTS.items():
|
|
180
|
+
if field not in normalized or normalized[field] == None:
|
|
181
|
+
normalized[field] = default_value
|
|
182
|
+
|
|
183
|
+
# 2. Compute derived fields
|
|
184
|
+
|
|
185
|
+
# Compute appType from path if missing
|
|
186
|
+
if not normalized.get('appType'):
|
|
187
|
+
normalized['appType'] = _determine_app_type(normalized, resource_path)
|
|
188
|
+
|
|
189
|
+
# A bring-your-own service may not speak HTTP (a database, a mail relay). Its health path is optional, so do not invent /health
|
|
190
|
+
# for it. Only an explicit healthCheckPath in service.json gives it one.
|
|
191
|
+
if normalized['appType'] == 'bring-your-own' and 'healthCheckPath' not in manifest:
|
|
192
|
+
normalized.pop('healthCheckPath', None)
|
|
193
|
+
|
|
194
|
+
# Compute stack from path if missing
|
|
195
|
+
if not normalized.get('stack'):
|
|
196
|
+
extracted = extract_stack_from_path(resource_path)
|
|
197
|
+
normalized['stack'] = extracted
|
|
198
|
+
|
|
199
|
+
# Compute syncs if not provided
|
|
200
|
+
if normalized.get('syncs') == None or normalized.get('syncs') == []:
|
|
201
|
+
normalized['syncs'] = _compute_syncs(
|
|
202
|
+
normalized['appType'],
|
|
203
|
+
normalized.get('featuresEnabled', [])
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
# Compute backendName for frontends if missing
|
|
207
|
+
if normalized['appType'] == 'frontend' and not normalized.get('backendName'):
|
|
208
|
+
app_name = normalized.get('appName', '')
|
|
209
|
+
if app_name.endswith('-frontend'):
|
|
210
|
+
normalized['backendName'] = app_name.replace('-frontend', '-backend')
|
|
211
|
+
|
|
212
|
+
# Normalize environment variables
|
|
213
|
+
if not normalized.get('envVars'):
|
|
214
|
+
normalized['envVars'] = {}
|
|
215
|
+
|
|
216
|
+
# Normalize dependsOn
|
|
217
|
+
if 'dependencies' in manifest and not normalized.get('dependsOn'):
|
|
218
|
+
normalized['dependsOn'] = manifest['dependencies']
|
|
219
|
+
if not normalized.get('dependsOn'):
|
|
220
|
+
normalized['dependsOn'] = []
|
|
221
|
+
|
|
222
|
+
# 3. Set up Traefik configuration defaults
|
|
223
|
+
if not normalized.get('traefik'):
|
|
224
|
+
normalized['traefik'] = {}
|
|
225
|
+
|
|
226
|
+
# Ensure traefik has pathPrefix - REQUIRED field
|
|
227
|
+
if not normalized['traefik'].get('pathPrefix'):
|
|
228
|
+
app_name = normalized.get('appName', 'unknown')
|
|
229
|
+
resource_path = normalized.get('_resource_path', 'unknown')
|
|
230
|
+
|
|
231
|
+
# Fail loudly - pathPrefix is required
|
|
232
|
+
error_msg = """MANIFEST ERROR: Missing required 'traefik.pathPrefix' in {}
|
|
233
|
+
|
|
234
|
+
Resource: {}
|
|
235
|
+
File: service.json
|
|
236
|
+
|
|
237
|
+
To fix, add:
|
|
238
|
+
"traefik": {{
|
|
239
|
+
"pathPrefix": "/api/v1/YOUR-PATH"
|
|
240
|
+
}}
|
|
241
|
+
|
|
242
|
+
Example:
|
|
243
|
+
"traefik": {{
|
|
244
|
+
"pathPrefix": "/api/v1/order-management"
|
|
245
|
+
}}""".format(resource_path, app_name)
|
|
246
|
+
fail(error_msg)
|
|
247
|
+
|
|
248
|
+
# Add default priority if not set
|
|
249
|
+
if 'priority' not in normalized['traefik']:
|
|
250
|
+
normalized['traefik']['priority'] = TRAEFIK_DEFAULTS['priority']
|
|
251
|
+
|
|
252
|
+
# 4. Add internal metadata
|
|
253
|
+
normalized['_manifest'] = manifest # Original manifest
|
|
254
|
+
normalized['_resource_path'] = resource_path
|
|
255
|
+
normalized['_normalized'] = True
|
|
256
|
+
|
|
257
|
+
return normalized
|
|
258
|
+
|
|
259
|
+
def extract_resource_path(manifest_path):
|
|
260
|
+
"""
|
|
261
|
+
Extract resource directory path from manifest file path.
|
|
262
|
+
|
|
263
|
+
Args:
|
|
264
|
+
manifest_path: Path to manifest JSON file
|
|
265
|
+
|
|
266
|
+
Returns:
|
|
267
|
+
Resource directory path
|
|
268
|
+
"""
|
|
269
|
+
# Remove manifest filename
|
|
270
|
+
if manifest_path.endswith("/" + MANIFEST_FILENAME):
|
|
271
|
+
return manifest_path[:-len("/" + MANIFEST_FILENAME)]
|
|
272
|
+
|
|
273
|
+
# If it's just a filename, try to find the directory
|
|
274
|
+
parts = manifest_path.rsplit("/", 1)
|
|
275
|
+
if len(parts) == 2 and parts[1] == MANIFEST_FILENAME:
|
|
276
|
+
return parts[0]
|
|
277
|
+
|
|
278
|
+
return manifest_path
|
|
279
|
+
|
|
280
|
+
def extract_stack_from_path(resource_path):
|
|
281
|
+
"""
|
|
282
|
+
Extract stack from resource path.
|
|
283
|
+
|
|
284
|
+
Args:
|
|
285
|
+
resource_path: Resource directory path
|
|
286
|
+
|
|
287
|
+
Returns:
|
|
288
|
+
Stack string from manifest (e.g., 'identity', 'booking')
|
|
289
|
+
"""
|
|
290
|
+
parts = resource_path.split("/")
|
|
291
|
+
|
|
292
|
+
# Expected path: services/product/{stack}/{resource-name}
|
|
293
|
+
if len(parts) >= 4 and parts[0] == "services" and parts[1] == "product":
|
|
294
|
+
stack = parts[2]
|
|
295
|
+
# Handle special cases
|
|
296
|
+
if stack == "profile":
|
|
297
|
+
return "identity"
|
|
298
|
+
if stack == "order-planner":
|
|
299
|
+
return "order-planner"
|
|
300
|
+
return stack
|
|
301
|
+
|
|
302
|
+
# Fallback: try to extract from resource name
|
|
303
|
+
if len(parts) >= 1:
|
|
304
|
+
resource_name = parts[-1]
|
|
305
|
+
# Extract stack from resource name (e.g., {stack}-management-backend -> {stack})
|
|
306
|
+
name_parts = resource_name.split("-")
|
|
307
|
+
if len(name_parts) >= 1:
|
|
308
|
+
return name_parts[0]
|
|
309
|
+
|
|
310
|
+
return "unknown"
|
|
311
|
+
|
|
312
|
+
def _determine_app_type(manifest, resource_path):
|
|
313
|
+
"""
|
|
314
|
+
Determine app type from manifest or resource path.
|
|
315
|
+
|
|
316
|
+
Args:
|
|
317
|
+
manifest: Manifest dict
|
|
318
|
+
resource_path: Resource directory path
|
|
319
|
+
|
|
320
|
+
Returns:
|
|
321
|
+
App type string ('frontend', 'backend', 'library', etc.)
|
|
322
|
+
"""
|
|
323
|
+
# Check if manifest has explicit appType
|
|
324
|
+
if manifest.get("appType") and manifest["appType"] in VALID_APP_TYPES:
|
|
325
|
+
return manifest["appType"]
|
|
326
|
+
|
|
327
|
+
# Extract from path
|
|
328
|
+
dir_name = resource_path.split("/")[-1] if resource_path else ""
|
|
329
|
+
|
|
330
|
+
if dir_name.endswith("-frontend"):
|
|
331
|
+
return "frontend"
|
|
332
|
+
if dir_name.endswith("-backend"):
|
|
333
|
+
return "backend"
|
|
334
|
+
if dir_name.endswith("-migrator"):
|
|
335
|
+
return "migrator"
|
|
336
|
+
if dir_name.endswith("-sdk"):
|
|
337
|
+
return "sdk"
|
|
338
|
+
|
|
339
|
+
# Default to backend
|
|
340
|
+
return "backend"
|
|
341
|
+
|
|
342
|
+
def _compute_syncs(app_type, features):
|
|
343
|
+
"""
|
|
344
|
+
Compute default sync paths based on app type and features.
|
|
345
|
+
|
|
346
|
+
Args:
|
|
347
|
+
app_type: App type string
|
|
348
|
+
features: List of feature strings
|
|
349
|
+
|
|
350
|
+
Returns:
|
|
351
|
+
List of sync paths
|
|
352
|
+
"""
|
|
353
|
+
syncs = []
|
|
354
|
+
|
|
355
|
+
# Start with default syncs for app type
|
|
356
|
+
if app_type in DEFAULT_SYNCS:
|
|
357
|
+
syncs.extend(DEFAULT_SYNCS[app_type])
|
|
358
|
+
|
|
359
|
+
# Add feature-specific syncs
|
|
360
|
+
if ORM in features and app_type == "backend":
|
|
361
|
+
if ORM not in syncs:
|
|
362
|
+
syncs.append(ORM)
|
|
363
|
+
|
|
364
|
+
# Remove duplicates while preserving order
|
|
365
|
+
seen = {}
|
|
366
|
+
unique_syncs = []
|
|
367
|
+
for sync in syncs:
|
|
368
|
+
if sync not in seen:
|
|
369
|
+
seen[sync] = True
|
|
370
|
+
unique_syncs.append(sync)
|
|
371
|
+
|
|
372
|
+
return unique_syncs
|
|
373
|
+
|
|
374
|
+
def parse_traefik_config(manifest):
|
|
375
|
+
"""
|
|
376
|
+
Parse and normalize Traefik configuration.
|
|
377
|
+
|
|
378
|
+
Args:
|
|
379
|
+
manifest: Manifest dict
|
|
380
|
+
|
|
381
|
+
Returns:
|
|
382
|
+
Normalized Traefik config dict
|
|
383
|
+
"""
|
|
384
|
+
traefik = manifest.get('traefik', {})
|
|
385
|
+
|
|
386
|
+
normalized_traefik = {
|
|
387
|
+
'pathPrefix': traefik.get('pathPrefix', ''),
|
|
388
|
+
'host': traefik.get('host', ''),
|
|
389
|
+
'priority': traefik.get('priority', TRAEFIK_DEFAULTS['priority']),
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return normalized_traefik
|
|
393
|
+
|
|
394
|
+
def merge_manifests(base, overlay):
|
|
395
|
+
"""
|
|
396
|
+
Merge two manifest dicts (for inheritance patterns).
|
|
397
|
+
|
|
398
|
+
Args:
|
|
399
|
+
base: Base manifest dict
|
|
400
|
+
overlay: Overlay manifest dict
|
|
401
|
+
|
|
402
|
+
Returns:
|
|
403
|
+
Merged manifest dict
|
|
404
|
+
"""
|
|
405
|
+
merged = {}
|
|
406
|
+
|
|
407
|
+
# Start with base
|
|
408
|
+
for key, value in base.items():
|
|
409
|
+
merged[key] = value
|
|
410
|
+
|
|
411
|
+
# Overlay takes precedence
|
|
412
|
+
for key, value in overlay.items():
|
|
413
|
+
# Special handling for nested dicts (like traefik, envVars)
|
|
414
|
+
if key in merged and type(merged[key]) == "dict" and type(value) == "dict":
|
|
415
|
+
merged[key] = {}
|
|
416
|
+
for k, v in merged[key].items():
|
|
417
|
+
merged[key][k] = v
|
|
418
|
+
for k, v in value.items():
|
|
419
|
+
merged[key][k] = v
|
|
420
|
+
else:
|
|
421
|
+
merged[key] = value
|
|
422
|
+
|
|
423
|
+
return merged
|
|
424
|
+
|
|
425
|
+
def get_normalized_manifest(manifest, resource_path=""):
|
|
426
|
+
"""
|
|
427
|
+
Convenience function to parse and normalize in one call.
|
|
428
|
+
|
|
429
|
+
Args:
|
|
430
|
+
manifest: Raw manifest (dict or JSON string)
|
|
431
|
+
resource_path: Resource directory path
|
|
432
|
+
|
|
433
|
+
Returns:
|
|
434
|
+
struct(
|
|
435
|
+
manifest=None, # Normalized manifest or None
|
|
436
|
+
error=None, # Error message or None
|
|
437
|
+
warnings=[], # List of warnings
|
|
438
|
+
)
|
|
439
|
+
"""
|
|
440
|
+
# If it's a string, parse it
|
|
441
|
+
if type(manifest) == "string":
|
|
442
|
+
parse_result = parse(manifest, resource_path)
|
|
443
|
+
if parse_result.error:
|
|
444
|
+
return parse_result
|
|
445
|
+
manifest = parse_result.manifest
|
|
446
|
+
warnings = parse_result.warnings
|
|
447
|
+
else:
|
|
448
|
+
warnings = []
|
|
449
|
+
|
|
450
|
+
# Normalize
|
|
451
|
+
normalized = normalize(manifest, resource_path)
|
|
452
|
+
|
|
453
|
+
return struct(
|
|
454
|
+
manifest=normalized,
|
|
455
|
+
error=None,
|
|
456
|
+
warnings=warnings,
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
def get_resource_type_description(manifest):
|
|
460
|
+
"""
|
|
461
|
+
Get human-readable resource type description.
|
|
462
|
+
|
|
463
|
+
Args:
|
|
464
|
+
manifest: Manifest dict
|
|
465
|
+
|
|
466
|
+
Returns:
|
|
467
|
+
String description
|
|
468
|
+
"""
|
|
469
|
+
app_type = manifest.get('appType', 'unknown')
|
|
470
|
+
stack = manifest.get('stack', 'unknown')
|
|
471
|
+
name = manifest.get('appName', 'unknown')
|
|
472
|
+
|
|
473
|
+
return "{stack}/{app_type}/{name}".format(
|
|
474
|
+
stack=stack,
|
|
475
|
+
app_type=app_type,
|
|
476
|
+
name=name,
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
# Export parser functions
|
|
480
|
+
ManifestParser = struct(
|
|
481
|
+
parse=parse,
|
|
482
|
+
normalize=normalize,
|
|
483
|
+
generated_string_error=generated_string_error,
|
|
484
|
+
extract_resource_path=extract_resource_path,
|
|
485
|
+
extract_stack=extract_stack_from_path,
|
|
486
|
+
parse_traefik=parse_traefik_config,
|
|
487
|
+
merge=merge_manifests,
|
|
488
|
+
get_normalized=get_normalized_manifest,
|
|
489
|
+
get_description=get_resource_type_description,
|
|
490
|
+
)
|