@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,102 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
export const MIN_MAINTAINERS = 3;
|
|
7
|
+
export const MIN_COMPANIES = 2;
|
|
8
|
+
const REQUIRED_COLUMNS = ["name", "github id", "company"];
|
|
9
|
+
const PLACEHOLDER_COMPANIES = new Set(["", "tbd", "unknown", "tdk-landscape"]);
|
|
10
|
+
function splitRow(line) {
|
|
11
|
+
return line
|
|
12
|
+
.trim()
|
|
13
|
+
.replace(/^\|/, "")
|
|
14
|
+
.replace(/\|$/, "")
|
|
15
|
+
.split("|")
|
|
16
|
+
.map((cell) => cell.trim());
|
|
17
|
+
}
|
|
18
|
+
export function parseMaintainers(markdown) {
|
|
19
|
+
const lines = markdown.split(/\r?\n/);
|
|
20
|
+
const headerIndex = lines.findIndex((line) => {
|
|
21
|
+
if (!line.includes("|"))
|
|
22
|
+
return false;
|
|
23
|
+
const cells = splitRow(line).map((cell) => cell.toLowerCase());
|
|
24
|
+
return REQUIRED_COLUMNS.every((column) => cells.includes(column));
|
|
25
|
+
});
|
|
26
|
+
if (headerIndex === -1) {
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
error: "table with columns Name, GitHub id, Company not found",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const header = splitRow(lines[headerIndex]).map((cell) => cell.toLowerCase());
|
|
33
|
+
const nameAt = header.indexOf("name");
|
|
34
|
+
const githubAt = header.indexOf("github id");
|
|
35
|
+
const companyAt = header.indexOf("company");
|
|
36
|
+
const rows = [];
|
|
37
|
+
for (const line of lines.slice(headerIndex + 1)) {
|
|
38
|
+
if (!line.includes("|"))
|
|
39
|
+
break;
|
|
40
|
+
const cells = splitRow(line);
|
|
41
|
+
if (cells.every((cell) => /^:?-+:?$/.test(cell)))
|
|
42
|
+
continue;
|
|
43
|
+
rows.push({
|
|
44
|
+
name: cells[nameAt] ?? "",
|
|
45
|
+
githubId: cells[githubAt] ?? "",
|
|
46
|
+
company: cells[companyAt] ?? "",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return { ok: true, rows };
|
|
50
|
+
}
|
|
51
|
+
export function evaluateMaintainers(rows) {
|
|
52
|
+
const seen = new Set();
|
|
53
|
+
const valid = rows.filter((row) => {
|
|
54
|
+
const id = row.githubId.toLowerCase();
|
|
55
|
+
if (!row.name || !id || seen.has(id) || PLACEHOLDER_COMPANIES.has(row.company.toLowerCase())) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
seen.add(id);
|
|
59
|
+
return true;
|
|
60
|
+
});
|
|
61
|
+
const companies = new Set(valid.map((row) => row.company.toLowerCase()));
|
|
62
|
+
const missingPeople = Math.max(0, MIN_MAINTAINERS - valid.length);
|
|
63
|
+
const missingCompanies = Math.max(0, MIN_COMPANIES - companies.size);
|
|
64
|
+
return {
|
|
65
|
+
eligible: missingPeople === 0 && missingCompanies === 0,
|
|
66
|
+
people: valid.length,
|
|
67
|
+
companies: companies.size,
|
|
68
|
+
missingPeople,
|
|
69
|
+
missingCompanies,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function runMaintainersCheck(file) {
|
|
73
|
+
const path = resolve(file);
|
|
74
|
+
if (!existsSync(path)) {
|
|
75
|
+
return { exitCode: 1, output: `${file} not found` };
|
|
76
|
+
}
|
|
77
|
+
const parsed = parseMaintainers(readFileSync(path, "utf8"));
|
|
78
|
+
if (!parsed.ok) {
|
|
79
|
+
return { exitCode: 1, output: `${file}: ${parsed.error}` };
|
|
80
|
+
}
|
|
81
|
+
const report = evaluateMaintainers(parsed.rows);
|
|
82
|
+
if (report.eligible) {
|
|
83
|
+
return {
|
|
84
|
+
exitCode: 0,
|
|
85
|
+
output: `${report.people} maintainers, ${report.companies} companies`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
exitCode: 1,
|
|
90
|
+
output: `not eligible: ${report.people} maintainers (${report.missingPeople} missing), ${report.companies} companies (${report.missingCompanies} missing)`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export const maintainersCommand = new Command("maintainers")
|
|
94
|
+
.description("Maintainer file checks")
|
|
95
|
+
.addCommand(new Command("check")
|
|
96
|
+
.description("Check MAINTAINERS.md lists 3 maintainers from 2 companies (a gate, not a claim of eligibility)")
|
|
97
|
+
.argument("[file]", "maintainers file", "MAINTAINERS.md")
|
|
98
|
+
.action((file) => {
|
|
99
|
+
const { exitCode, output } = runMaintainersCheck(file);
|
|
100
|
+
(exitCode === 0 ? console.log : console.error)(output);
|
|
101
|
+
process.exitCode = exitCode;
|
|
102
|
+
}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { createInterface } from "node:readline";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { createMcpServer } from "../mcp/server.js";
|
|
6
|
+
import { createTdkTools } from "../mcp/tools.js";
|
|
7
|
+
import { getPackageVersion } from "../utils/paths.js";
|
|
8
|
+
export const mcpCommand = new Command("mcp")
|
|
9
|
+
.description("Run a Model Context Protocol server over stdio for coding agents")
|
|
10
|
+
.action(async () => {
|
|
11
|
+
const server = createMcpServer(createTdkTools(), {
|
|
12
|
+
name: "flisk",
|
|
13
|
+
version: getPackageVersion(),
|
|
14
|
+
});
|
|
15
|
+
// Stdout is the protocol channel. Nothing else may write to it; diagnostics go to stderr.
|
|
16
|
+
const lines = createInterface({ input: process.stdin });
|
|
17
|
+
const pending = new Set();
|
|
18
|
+
lines.on("line", (line) => {
|
|
19
|
+
const task = server.handleLine(line).then((response) => {
|
|
20
|
+
if (response)
|
|
21
|
+
process.stdout.write(`${response}\n`);
|
|
22
|
+
});
|
|
23
|
+
pending.add(task);
|
|
24
|
+
void task.finally(() => pending.delete(task));
|
|
25
|
+
});
|
|
26
|
+
await new Promise((resolve) => lines.once("close", resolve));
|
|
27
|
+
await Promise.allSettled(pending);
|
|
28
|
+
});
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { execFileSync, spawn } from "node:child_process";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import { readProjectConfig } from "../generator/template-engine.js";
|
|
7
|
+
import { getStackEmoji } from "../utils/constants.js";
|
|
8
|
+
import { createDiscoveryContext } from "../utils/discovery-context.js";
|
|
9
|
+
import { errorFactories, logVerbose, requireProjectRoot } from "../utils/errors.js";
|
|
10
|
+
import { colorizeByStatus, DEFAULT_BOX_WIDTH, formatBoxLine, formatPadded, getStatusIcon, printBoxedHeader, } from "../utils/formatting.js";
|
|
11
|
+
import { readSavedHostPortPlan } from "../utils/host-port-config.js";
|
|
12
|
+
import { createHostPortPlan } from "../utils/host-port-plan.js";
|
|
13
|
+
import { createMachineEnvelope, writeMachineError } from "../utils/machine-output.js";
|
|
14
|
+
import { findProjectRoot } from "../utils/paths.js";
|
|
15
|
+
import { checkPortStatus } from "../utils/port-assignment.js";
|
|
16
|
+
import { isApiServiceType } from "../utils/resource-kind.js";
|
|
17
|
+
import { resolveServicePath } from "../utils/service-urls.js";
|
|
18
|
+
import { stackExists } from "../utils/services.js";
|
|
19
|
+
import { isValidPort, sanitizeForShell } from "../utils/validation.js";
|
|
20
|
+
import { findOnPath } from "../utils/which.js";
|
|
21
|
+
function execSafe(command, args, options = {}) {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const child = spawn(findOnPath(command) ?? command, args, {
|
|
24
|
+
timeout: options.timeout || 5000,
|
|
25
|
+
shell: false,
|
|
26
|
+
windowsHide: process.platform === "win32",
|
|
27
|
+
});
|
|
28
|
+
let stdout = "";
|
|
29
|
+
let stderr = "";
|
|
30
|
+
child.stdout?.on("data", (data) => {
|
|
31
|
+
stdout += data.toString();
|
|
32
|
+
});
|
|
33
|
+
child.stderr?.on("data", (data) => {
|
|
34
|
+
stderr += data.toString();
|
|
35
|
+
});
|
|
36
|
+
child.on("close", (code) => {
|
|
37
|
+
if (code !== 0) {
|
|
38
|
+
reject(new Error(`Command failed with exit code ${code}: ${stderr}`));
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
resolve(stdout);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
child.on("error", (err) => {
|
|
45
|
+
reject(err);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function determineDefaultDomain() {
|
|
50
|
+
const projectRoot = findProjectRoot();
|
|
51
|
+
if (projectRoot) {
|
|
52
|
+
const projectConfig = readProjectConfig(projectRoot);
|
|
53
|
+
const projectName = projectConfig.project?.name;
|
|
54
|
+
if (projectName && projectName !== "tdk-project") {
|
|
55
|
+
return `${projectName}.localhost`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const domains = new Set();
|
|
59
|
+
try {
|
|
60
|
+
const traefikLabels = execFileSync(findOnPath("docker") ?? "docker", ["ps", "--filter", "label=traefik.enable=true", "--format", "{{.Labels}}"], { encoding: "utf-8", windowsHide: process.platform === "win32" });
|
|
61
|
+
// Capture every Host(`...`) in a rule (multi-host rules included), avoid ReDoS with bounded classes
|
|
62
|
+
const domainRegex = /Host\(`([a-zA-Z0-9_.-]{1,100})`\)/g;
|
|
63
|
+
for (let match = domainRegex.exec(traefikLabels); match !== null; match = domainRegex.exec(traefikLabels)) {
|
|
64
|
+
domains.add(match[1]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
console.warn(chalk.yellow("⚠️ Could not scan Traefik domains (Docker unavailable)"));
|
|
69
|
+
logVerbose("Docker scan error details", err);
|
|
70
|
+
}
|
|
71
|
+
// Filter out service-specific domains (ones that look like individual services)
|
|
72
|
+
// Service domains typically contain the full service name like "myapp-api-frontend.localhost"
|
|
73
|
+
const domainList = Array.from(domains);
|
|
74
|
+
const projectDomains = domainList.filter((domain) => {
|
|
75
|
+
if (/^(app|api)\.[\w-]+\.localhost$/.test(domain))
|
|
76
|
+
return true;
|
|
77
|
+
// Skip domains that look like specific service instances
|
|
78
|
+
// These are long, hyphen-heavy domains for individual services
|
|
79
|
+
const servicePatterns = [
|
|
80
|
+
/\w+-\w+-frontend\.localhost$/,
|
|
81
|
+
/\w+-\w+-backend\.localhost$/,
|
|
82
|
+
/\w+-\w+-worker\.localhost$/,
|
|
83
|
+
/\w+-\w+-migrator\.localhost$/,
|
|
84
|
+
];
|
|
85
|
+
return !servicePatterns.some((pattern) => pattern.test(domain));
|
|
86
|
+
});
|
|
87
|
+
// Prefer project-level domains (shorter, simpler ones)
|
|
88
|
+
if (projectDomains.length > 0) {
|
|
89
|
+
// Sort by length - shortest is likely the project domain
|
|
90
|
+
projectDomains.sort((a, b) => a.length - b.length);
|
|
91
|
+
return projectDomains[0];
|
|
92
|
+
}
|
|
93
|
+
// If only service-specific domains found, extract base from first one
|
|
94
|
+
// e.g., "myapp-api-frontend.localhost" -> try to find "myapp.localhost"
|
|
95
|
+
if (domainList.length > 0) {
|
|
96
|
+
const firstDomain = domainList[0];
|
|
97
|
+
const localhostMatch = firstDomain.match(/([\w-]+)\.localhost$/);
|
|
98
|
+
if (localhostMatch) {
|
|
99
|
+
// If it looks like a service domain, try common project names
|
|
100
|
+
const commonProjects = ["flisk", "project", "app", "api", "myapp"];
|
|
101
|
+
for (const project of commonProjects) {
|
|
102
|
+
const testDomain = `${project}.localhost`;
|
|
103
|
+
if (domainList.includes(testDomain)) {
|
|
104
|
+
return testDomain;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return "localhost";
|
|
110
|
+
}
|
|
111
|
+
async function checkServiceStatus(serviceName, port, url) {
|
|
112
|
+
if (url) {
|
|
113
|
+
try {
|
|
114
|
+
const validUrl = new URL(url);
|
|
115
|
+
if (validUrl.protocol !== "http:" && validUrl.protocol !== "https:") {
|
|
116
|
+
return "stopped";
|
|
117
|
+
}
|
|
118
|
+
const statusCode = await execSafe("curl", ["-s", "-o", "/dev/null", "-w", "%{http_code}", "--max-time", "2", validUrl.toString()], { timeout: 3000 });
|
|
119
|
+
const code = statusCode.trim();
|
|
120
|
+
if (/^[23]\d\d$/.test(code)) {
|
|
121
|
+
return "running";
|
|
122
|
+
}
|
|
123
|
+
if (/^[45]\d\d$/.test(code)) {
|
|
124
|
+
return "stopped";
|
|
125
|
+
}
|
|
126
|
+
// Connection refused or other error - service not accessible
|
|
127
|
+
if (code === "000") {
|
|
128
|
+
return "stopped";
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
console.warn(chalk.yellow(`⚠️ Could not reach ${url} (HTTP check failed)`));
|
|
133
|
+
logVerbose(`HTTP check error details for ${url}`, err);
|
|
134
|
+
return "stopped";
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (port && isValidPort(port)) {
|
|
138
|
+
const portStatus = await checkPortStatus(port);
|
|
139
|
+
if (portStatus === "running") {
|
|
140
|
+
return "running";
|
|
141
|
+
}
|
|
142
|
+
if (portStatus === "unknown") {
|
|
143
|
+
console.warn(chalk.yellow(process.platform === "win32"
|
|
144
|
+
? `⚠️ Could not check port ${port} with the Windows TCP probe`
|
|
145
|
+
: `⚠️ Could not check port ${port} (port probe unavailable)`));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
const containerName = sanitizeForShell(serviceName);
|
|
150
|
+
const result = await execSafe("docker", ["ps", "--filter", `name=${containerName}`, "--format", "{{.Names}}"], { timeout: 5000 });
|
|
151
|
+
if (result && result.trim().length > 0) {
|
|
152
|
+
return "running";
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
console.warn(chalk.yellow(`⚠️ Could not check Docker for ${serviceName}`));
|
|
157
|
+
logVerbose(`Docker check error details for ${serviceName}`, err);
|
|
158
|
+
}
|
|
159
|
+
return "stopped";
|
|
160
|
+
}
|
|
161
|
+
export const networksCommand = new Command("networks")
|
|
162
|
+
.description("Show Traefik-routed URLs for all services")
|
|
163
|
+
.alias("urls")
|
|
164
|
+
.alias("traefik")
|
|
165
|
+
.option("-s, --stack <stack>", "Filter by stack name")
|
|
166
|
+
.option("--json", "Output a versioned JSON response")
|
|
167
|
+
.option("--json-legacy", "Output the legacy JSON array (deprecated)")
|
|
168
|
+
.option("--raw", "Output raw URLs only")
|
|
169
|
+
.action(async (options) => {
|
|
170
|
+
const action = async () => {
|
|
171
|
+
const projectRoot = options.json || options.jsonLegacy ? findProjectRoot() : requireProjectRoot();
|
|
172
|
+
if (!projectRoot) {
|
|
173
|
+
throw errorFactories.notInProject();
|
|
174
|
+
}
|
|
175
|
+
const discovery = createDiscoveryContext();
|
|
176
|
+
if (options.stack && !stackExists(options.stack, discovery.resources)) {
|
|
177
|
+
const error = errorFactories.stackNotFound(options.stack, discovery.stackNames);
|
|
178
|
+
if (options.json || options.jsonLegacy)
|
|
179
|
+
throw error;
|
|
180
|
+
error.exit();
|
|
181
|
+
}
|
|
182
|
+
const savedPlan = readSavedHostPortPlan(projectRoot);
|
|
183
|
+
const hostPortPlan = savedPlan ?? (await createHostPortPlan());
|
|
184
|
+
const httpPort = hostPortPlan.ingressHttp;
|
|
185
|
+
const baseDomain = determineDefaultDomain();
|
|
186
|
+
const bareDomain = baseDomain.replace(/^(app|api)\./, "");
|
|
187
|
+
const appDomain = `app.${bareDomain}`;
|
|
188
|
+
const apiDomain = `api.${bareDomain}`;
|
|
189
|
+
const services = discovery.resources;
|
|
190
|
+
const servicesWithUrls = await Promise.all(services
|
|
191
|
+
.filter((s) => s.config?.appType === "frontend" || isApiServiceType(s.config?.appType))
|
|
192
|
+
.map(async (s) => {
|
|
193
|
+
const resolvedPath = resolveServicePath(s);
|
|
194
|
+
const basePath = resolvedPath.startsWith("/") ? resolvedPath : `/${resolvedPath}`;
|
|
195
|
+
const isBackend = isApiServiceType(s.config?.appType);
|
|
196
|
+
const host = isBackend ? apiDomain : appDomain;
|
|
197
|
+
const url = `http://${host}:${httpPort}${basePath}`;
|
|
198
|
+
const port = s.config?.port;
|
|
199
|
+
const status = await checkServiceStatus(s.name, port, url);
|
|
200
|
+
return {
|
|
201
|
+
name: s.name,
|
|
202
|
+
stack: s.stack,
|
|
203
|
+
basePath,
|
|
204
|
+
url,
|
|
205
|
+
...(process.platform === "win32"
|
|
206
|
+
? { loopbackUrl: `http://127.0.0.1:${httpPort}${basePath}`.replace(/\/$/, "") }
|
|
207
|
+
: {}),
|
|
208
|
+
port,
|
|
209
|
+
status,
|
|
210
|
+
};
|
|
211
|
+
}));
|
|
212
|
+
const filteredServices = options.stack
|
|
213
|
+
? servicesWithUrls.filter((s) => s.stack === options.stack)
|
|
214
|
+
: servicesWithUrls;
|
|
215
|
+
if (options.json || options.jsonLegacy) {
|
|
216
|
+
const output = options.jsonLegacy
|
|
217
|
+
? filteredServices
|
|
218
|
+
: createMachineEnvelope({ services: filteredServices });
|
|
219
|
+
console.log(JSON.stringify(output, null, 2));
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (filteredServices.length === 0) {
|
|
223
|
+
if (options.stack) {
|
|
224
|
+
console.log(chalk.yellow(`⚠️ No routable services found in stack "${options.stack}"`));
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
console.log(chalk.yellow("⚠️ No routable services found"));
|
|
228
|
+
}
|
|
229
|
+
process.exit(0);
|
|
230
|
+
}
|
|
231
|
+
if (options.raw) {
|
|
232
|
+
for (const service of filteredServices) {
|
|
233
|
+
console.log(service.url);
|
|
234
|
+
if (service.loopbackUrl)
|
|
235
|
+
console.log(service.loopbackUrl);
|
|
236
|
+
}
|
|
237
|
+
process.exit(0);
|
|
238
|
+
}
|
|
239
|
+
printBoxedHeader("🌐 TRAEFIK NETWORKS", `Domain: http://${baseDomain}:${httpPort}`, DEFAULT_BOX_WIDTH);
|
|
240
|
+
// Group services by stack using discovery context's stack names for consistent ordering
|
|
241
|
+
const stacks = new Map();
|
|
242
|
+
for (const stackName of discovery.stackNames) {
|
|
243
|
+
const stackServices = filteredServices.filter((s) => s.stack === stackName);
|
|
244
|
+
if (stackServices.length > 0) {
|
|
245
|
+
stacks.set(stackName, stackServices);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Add unstacked services to 'default' group
|
|
249
|
+
const unstackedServices = filteredServices.filter((s) => !s.stack);
|
|
250
|
+
if (unstackedServices.length > 0) {
|
|
251
|
+
stacks.set("default", unstackedServices);
|
|
252
|
+
}
|
|
253
|
+
let isFirstStack = true;
|
|
254
|
+
for (const [stackName, stackServices] of stacks) {
|
|
255
|
+
if (!isFirstStack) {
|
|
256
|
+
console.log();
|
|
257
|
+
}
|
|
258
|
+
isFirstStack = false;
|
|
259
|
+
const emoji = getStackEmoji(stackName);
|
|
260
|
+
const stackTitle = `${emoji} ${stackName.toUpperCase()} STACK`;
|
|
261
|
+
console.log();
|
|
262
|
+
console.log(chalk.bold.white(stackTitle));
|
|
263
|
+
console.log(chalk.gray(formatBoxLine("━", DEFAULT_BOX_WIDTH - 4)));
|
|
264
|
+
for (const service of stackServices) {
|
|
265
|
+
const statusSymbol = getStatusIcon(service.status);
|
|
266
|
+
const statusEmoji = colorizeByStatus(statusSymbol, service.status);
|
|
267
|
+
const namePart = formatPadded(service.name, 22);
|
|
268
|
+
const urlPart = service.status === "running"
|
|
269
|
+
? chalk.cyan.underline(service.url)
|
|
270
|
+
: chalk.gray(service.url); // Gray out URL if stopped
|
|
271
|
+
const statusLabel = service.status !== "running" ? chalk.gray(` [${service.status}]`) : "";
|
|
272
|
+
console.log(` ${statusEmoji} ${chalk.white(namePart)} ${urlPart}${statusLabel}`);
|
|
273
|
+
if (service.loopbackUrl) {
|
|
274
|
+
console.log(` ${chalk.gray(`Loopback: ${service.loopbackUrl} (Host: ${new URL(service.url).hostname})`)}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
console.log();
|
|
279
|
+
console.log(chalk.gray(formatBoxLine("─", DEFAULT_BOX_WIDTH - 2)));
|
|
280
|
+
console.log(chalk.gray("🖱️ Click any URL above to open in browser"));
|
|
281
|
+
console.log(chalk.gray("📊 Status: ") +
|
|
282
|
+
chalk.green("✓ Running") +
|
|
283
|
+
" | " +
|
|
284
|
+
chalk.red("✗ Stopped") +
|
|
285
|
+
" | " +
|
|
286
|
+
chalk.gray("? Unknown"));
|
|
287
|
+
if (baseDomain === "localhost") {
|
|
288
|
+
console.log();
|
|
289
|
+
const projectConfig = readProjectConfig(projectRoot);
|
|
290
|
+
const projectName = projectConfig.project.name;
|
|
291
|
+
console.log(chalk.yellow("💡 Tip: Set custom domain with:"));
|
|
292
|
+
console.log(chalk.cyan(` export TDK_PUBLIC_HOST=${projectName}.localhost`));
|
|
293
|
+
}
|
|
294
|
+
console.log();
|
|
295
|
+
};
|
|
296
|
+
if (options.json || options.jsonLegacy) {
|
|
297
|
+
try {
|
|
298
|
+
await action();
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
writeMachineError(error);
|
|
302
|
+
}
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
await action();
|
|
306
|
+
});
|