@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,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Flisk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Flisk product example
|
|
2
|
+
|
|
3
|
+
A small working landscape with a Hono API, PostgreSQL, a NATS worker, a Vite UI, and Traefik routes.
|
|
4
|
+
|
|
5
|
+
This is a local demo, not a Helm chart.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
flisk doctor
|
|
9
|
+
flisk project --yes
|
|
10
|
+
flisk up
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Open `http://app.tdk-example.localhost/orders-app/` and create an order, or use the routed API:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
curl -fsS -X POST http://api.tdk-example.localhost/api/orders \
|
|
17
|
+
-H 'content-type: application/json' -d '{"item":"coffee"}'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The API stores each order in PostgreSQL and publishes its id to NATS. The worker consumes the
|
|
21
|
+
event, reads the stored row, and marks it observed. Poll `GET /api/orders/<id>` through the API
|
|
22
|
+
route until `workerSeenAt` is set. `flisk config verify` checks generated output. Stop the landscape
|
|
23
|
+
with `flisk down`.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# TILT_SERVICE_DEFAULTS.star - Platform Runtime Configuration
|
|
3
|
+
# =============================================================================
|
|
4
|
+
|
|
5
|
+
BASE_PORT_FRONTEND = 3000
|
|
6
|
+
BASE_PORT_BACKEND = 4000
|
|
7
|
+
|
|
8
|
+
HEALTH_CHECK_PATH = "/health"
|
|
9
|
+
HEALTH_CHECK_PATH_LIVE = "/health/live"
|
|
10
|
+
HEALTH_CHECK_PATH_READY = "/health/ready"
|
|
11
|
+
HEALTH_CHECK_INTERVAL = 10
|
|
12
|
+
HEALTH_CHECK_TIMEOUT = 5
|
|
13
|
+
HEALTH_CHECK_RETRIES = 3
|
|
14
|
+
|
|
15
|
+
MEMORY_LIMITS = {
|
|
16
|
+
"frontend": 512,
|
|
17
|
+
"backend": 1024,
|
|
18
|
+
"worker": 768,
|
|
19
|
+
"infra": 256,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
DOCKER_BASE_IMAGES = {
|
|
23
|
+
"bun": "oven/bun:1.2",
|
|
24
|
+
"node": "node:20-alpine",
|
|
25
|
+
"nginx": "nginx:alpine",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
NETWORK_PREFIX = "flisk"
|
|
29
|
+
|
|
30
|
+
exports = {
|
|
31
|
+
"BASE_PORT_FRONTEND": BASE_PORT_FRONTEND,
|
|
32
|
+
"BASE_PORT_BACKEND": BASE_PORT_BACKEND,
|
|
33
|
+
"HEALTH_CHECK_PATH": HEALTH_CHECK_PATH,
|
|
34
|
+
"HEALTH_CHECK_PATH_LIVE": HEALTH_CHECK_PATH_LIVE,
|
|
35
|
+
"HEALTH_CHECK_PATH_READY": HEALTH_CHECK_PATH_READY,
|
|
36
|
+
"HEALTH_CHECK_INTERVAL": HEALTH_CHECK_INTERVAL,
|
|
37
|
+
"HEALTH_CHECK_TIMEOUT": HEALTH_CHECK_TIMEOUT,
|
|
38
|
+
"HEALTH_CHECK_RETRIES": HEALTH_CHECK_RETRIES,
|
|
39
|
+
"MEMORY_LIMITS": MEMORY_LIMITS,
|
|
40
|
+
"DOCKER_BASE_IMAGES": DOCKER_BASE_IMAGES,
|
|
41
|
+
"NETWORK_PREFIX": NETWORK_PREFIX,
|
|
42
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# TILT_TECH_STACK.star - Technology Stack Configuration
|
|
3
|
+
# =============================================================================
|
|
4
|
+
|
|
5
|
+
RUNTIME = "bun"
|
|
6
|
+
RUNTIME_VERSION = "1.2"
|
|
7
|
+
|
|
8
|
+
BUNDLER = "vite"
|
|
9
|
+
BUNDLER_VERSION = "5"
|
|
10
|
+
|
|
11
|
+
ORM = "prisma"
|
|
12
|
+
ORM_VERSION = "7"
|
|
13
|
+
|
|
14
|
+
MESSAGING = "nats"
|
|
15
|
+
MESSAGING_VERSION = "2"
|
|
16
|
+
NATS_SERVER = "nats://nats:4222"
|
|
17
|
+
|
|
18
|
+
TESTING = "vitest"
|
|
19
|
+
TESTING_VERSION = "1"
|
|
20
|
+
|
|
21
|
+
LINTING = "biome"
|
|
22
|
+
LINTING_VERSION = "1.5"
|
|
23
|
+
|
|
24
|
+
WEB_FRAMEWORK = "hono"
|
|
25
|
+
WEB_FRAMEWORK_VERSION = "4"
|
|
26
|
+
|
|
27
|
+
CONTAINER_PLATFORM = "docker"
|
|
28
|
+
COMPOSE_VERSION = "3.8"
|
|
29
|
+
|
|
30
|
+
def assert_tech_stack(loaded_stack):
|
|
31
|
+
required = {
|
|
32
|
+
"bundler": BUNDLER,
|
|
33
|
+
"runtime": RUNTIME,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
for key, expected in required.items():
|
|
37
|
+
actual = loaded_stack.get(key)
|
|
38
|
+
if actual != expected:
|
|
39
|
+
fail("Tech stack mismatch: {} should be '{}' but got '{}'".format(
|
|
40
|
+
key, expected, actual
|
|
41
|
+
))
|
|
42
|
+
|
|
43
|
+
print("✅ Tech stack validated: {} / {} / {}".format(
|
|
44
|
+
BUNDLER, RUNTIME, TESTING
|
|
45
|
+
))
|
|
46
|
+
|
|
47
|
+
exports = {
|
|
48
|
+
"RUNTIME": RUNTIME,
|
|
49
|
+
"RUNTIME_VERSION": RUNTIME_VERSION,
|
|
50
|
+
"BUNDLER": BUNDLER,
|
|
51
|
+
"BUNDLER_VERSION": BUNDLER_VERSION,
|
|
52
|
+
"ORM": ORM,
|
|
53
|
+
"ORM_VERSION": ORM_VERSION,
|
|
54
|
+
"MESSAGING": MESSAGING,
|
|
55
|
+
"MESSAGING_VERSION": MESSAGING_VERSION,
|
|
56
|
+
"NATS_SERVER": NATS_SERVER,
|
|
57
|
+
"TESTING": TESTING,
|
|
58
|
+
"TESTING_VERSION": TESTING_VERSION,
|
|
59
|
+
"LINTING": LINTING,
|
|
60
|
+
"LINTING_VERSION": LINTING_VERSION,
|
|
61
|
+
"WEB_FRAMEWORK": WEB_FRAMEWORK,
|
|
62
|
+
"WEB_FRAMEWORK_VERSION": WEB_FRAMEWORK_VERSION,
|
|
63
|
+
"CONTAINER_PLATFORM": CONTAINER_PLATFORM,
|
|
64
|
+
"COMPOSE_VERSION": COMPOSE_VERSION,
|
|
65
|
+
"assert_tech_stack": assert_tech_stack,
|
|
66
|
+
"TECH_STACK": exports,
|
|
67
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Flisk Example Tiltfile
|
|
2
|
+
# Minimal Tiltfile demonstrating Flisk PSR model
|
|
3
|
+
|
|
4
|
+
# Must be set before the extension loads: discovery/constants.star reads it to
|
|
5
|
+
# find this project's spec.master (services/identity, services/appointment)
|
|
6
|
+
# instead of falling back to the beauty-crm monorepo's default scan roots.
|
|
7
|
+
os.environ['TDK_PROJECT_ROOT'] = config.main_dir
|
|
8
|
+
|
|
9
|
+
# Load Flisk extension
|
|
10
|
+
v1alpha1.extension_repo(name='tdk-cli', url='https://github.com/tdk-landscape/tdk-cli')
|
|
11
|
+
v1alpha1.extension(name='tdk-cli', repo_name='tdk-cli', repo_path='')
|
|
12
|
+
|
|
13
|
+
# Load Flisk utilities
|
|
14
|
+
load('ext://tdk-cli', 'Utils', 'Manifest', 'Config')
|
|
15
|
+
|
|
16
|
+
print("🚀 Flisk Example Project")
|
|
17
|
+
print(" Project → Stack → Resource")
|
|
18
|
+
print("")
|
|
19
|
+
|
|
20
|
+
# Default to all services if no args
|
|
21
|
+
config.define_string_list("to-run", args=True)
|
|
22
|
+
cfg = config.parse()
|
|
23
|
+
|
|
24
|
+
# Let Flisk handle service discovery and registration
|
|
25
|
+
# Services are discovered from service.json files automatically
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
services:
|
|
2
|
+
nats:
|
|
3
|
+
image: nats:2.10-alpine
|
|
4
|
+
container_name: tdk_example_nats
|
|
5
|
+
command: ["--jetstream", "--store_dir=/data/jetstream", "--http_port", "8222"]
|
|
6
|
+
restart: unless-stopped
|
|
7
|
+
networks:
|
|
8
|
+
tdk_example_backend:
|
|
9
|
+
aliases:
|
|
10
|
+
- tdk_example_nats
|
|
11
|
+
volumes:
|
|
12
|
+
- tdk_example_nats_data:/data
|
|
13
|
+
healthcheck:
|
|
14
|
+
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8222/healthz"]
|
|
15
|
+
interval: 5s
|
|
16
|
+
timeout: 3s
|
|
17
|
+
start_period: 5s
|
|
18
|
+
retries: 20
|
|
19
|
+
|
|
20
|
+
networks:
|
|
21
|
+
tdk_example_backend:
|
|
22
|
+
external: true
|
|
23
|
+
name: tdk_example_backend
|
|
24
|
+
|
|
25
|
+
volumes:
|
|
26
|
+
tdk_example_nats_data:
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "orders-api",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "bun build src/index.ts --outdir dist --target bun --packages external",
|
|
7
|
+
"start": "bun run dist/index.js",
|
|
8
|
+
"dev": "bun --watch src/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@hono/node-server": "^1.19.0",
|
|
12
|
+
"hono": "^4.9.0",
|
|
13
|
+
"nats": "^2.29.3",
|
|
14
|
+
"pg": "^8.16.3"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^20.0.0",
|
|
18
|
+
"@types/pg": "^8.15.5"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://tdk-landscape.github.io/schema.service.json",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"appName": "orders-api",
|
|
5
|
+
"appType": "backend",
|
|
6
|
+
"stack": "shop",
|
|
7
|
+
"port": 4000,
|
|
8
|
+
"featuresEnabled": ["nats"],
|
|
9
|
+
"params": {
|
|
10
|
+
"NATS_URL": "nats://tdk_example_nats:4222"
|
|
11
|
+
},
|
|
12
|
+
"healthCheckPath": "/health",
|
|
13
|
+
"dependsOn": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { serve } from "@hono/node-server";
|
|
2
|
+
import { connect, type NatsConnection } from "nats";
|
|
3
|
+
import { Hono } from "hono";
|
|
4
|
+
import { Pool } from "pg";
|
|
5
|
+
|
|
6
|
+
const port = Number(process.env.PORT ?? 4000);
|
|
7
|
+
const databaseUrl = process.env.DATABASE_URL;
|
|
8
|
+
const natsUrl = process.env.NATS_URL ?? "nats://tdk_example_nats:4222";
|
|
9
|
+
if (!databaseUrl) throw new Error("DATABASE_URL is required");
|
|
10
|
+
|
|
11
|
+
const pgUrl = new URL(databaseUrl);
|
|
12
|
+
pgUrl.searchParams.delete("schema");
|
|
13
|
+
const db = new Pool({ connectionString: pgUrl.toString() });
|
|
14
|
+
let nats: NatsConnection;
|
|
15
|
+
let workerReady = false;
|
|
16
|
+
|
|
17
|
+
async function connectDependencies(): Promise<void> {
|
|
18
|
+
while (true) {
|
|
19
|
+
try {
|
|
20
|
+
await db.query(`
|
|
21
|
+
CREATE TABLE IF NOT EXISTS demo_orders (
|
|
22
|
+
id bigserial PRIMARY KEY,
|
|
23
|
+
item text NOT NULL,
|
|
24
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
25
|
+
worker_seen_at timestamptz
|
|
26
|
+
)
|
|
27
|
+
`);
|
|
28
|
+
nats = await connect({ servers: natsUrl });
|
|
29
|
+
return;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error("waiting for PostgreSQL and NATS", error);
|
|
32
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const app = new Hono();
|
|
38
|
+
app.use("*", async (c, next) => {
|
|
39
|
+
c.header("Access-Control-Allow-Origin", "*");
|
|
40
|
+
c.header("Access-Control-Allow-Headers", "content-type");
|
|
41
|
+
c.header("Access-Control-Allow-Methods", "GET,POST,OPTIONS");
|
|
42
|
+
await next();
|
|
43
|
+
});
|
|
44
|
+
app.options("*", (c) => c.body(null, 204));
|
|
45
|
+
app.get("/health", (c) => c.json({ ok: true }));
|
|
46
|
+
app.get("/worker-ready", (c) => c.json({ ready: workerReady }, workerReady ? 200 : 503));
|
|
47
|
+
app.get("/", async (c) => {
|
|
48
|
+
const result = await db.query("SELECT id, item, created_at AS \"createdAt\", worker_seen_at AS \"workerSeenAt\" FROM demo_orders ORDER BY id DESC LIMIT 20");
|
|
49
|
+
return c.json({ orders: result.rows });
|
|
50
|
+
});
|
|
51
|
+
app.post("/", async (c) => {
|
|
52
|
+
if (!workerReady) return c.json({ error: "orders worker is not ready" }, 503);
|
|
53
|
+
const body = await c.req.json<{ item?: unknown }>();
|
|
54
|
+
if (typeof body.item !== "string" || body.item.trim().length === 0) {
|
|
55
|
+
return c.json({ error: "item is required" }, 400);
|
|
56
|
+
}
|
|
57
|
+
const result = await db.query(
|
|
58
|
+
"INSERT INTO demo_orders (item) VALUES ($1) RETURNING id, item, created_at AS \"createdAt\", worker_seen_at AS \"workerSeenAt\"",
|
|
59
|
+
[body.item.trim()],
|
|
60
|
+
);
|
|
61
|
+
const order = result.rows[0];
|
|
62
|
+
nats.publish("demo.orders.created", new TextEncoder().encode(String(order.id)));
|
|
63
|
+
return c.json({ order }, 201);
|
|
64
|
+
});
|
|
65
|
+
app.get("/:id", async (c) => {
|
|
66
|
+
const result = await db.query(
|
|
67
|
+
"SELECT id, item, created_at AS \"createdAt\", worker_seen_at AS \"workerSeenAt\" FROM demo_orders WHERE id = $1",
|
|
68
|
+
[c.req.param("id")],
|
|
69
|
+
);
|
|
70
|
+
if (!result.rows[0]) return c.json({ error: "order not found" }, 404);
|
|
71
|
+
return c.json({ order: result.rows[0] });
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
await connectDependencies();
|
|
75
|
+
const readySubscription = nats.subscribe("demo.orders.worker-ready");
|
|
76
|
+
await nats.flush();
|
|
77
|
+
void (async () => {
|
|
78
|
+
for await (const _message of readySubscription) workerReady = true;
|
|
79
|
+
})();
|
|
80
|
+
serve({ fetch: app.fetch, port });
|
|
81
|
+
console.log(`orders-api listening on ${port}`);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Flisk Orders</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "orders-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "vite build",
|
|
7
|
+
"dev": "vite --host 0.0.0.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
11
|
+
"vite": "^7.3.7",
|
|
12
|
+
"react": "^19.1.1",
|
|
13
|
+
"react-dom": "^19.1.1"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/react": "^19.1.16",
|
|
17
|
+
"@types/react-dom": "^19.1.9",
|
|
18
|
+
"typescript": "^5.9.2"
|
|
19
|
+
},
|
|
20
|
+
"overrides": {
|
|
21
|
+
"rollup": "4.64.8"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import "./style.css";
|
|
3
|
+
|
|
4
|
+
type Order = { id: number; item: string; workerSeenAt: string | null };
|
|
5
|
+
const api = `${window.location.protocol}//api.${window.location.hostname.replace(/^app\./, "")}/api/orders`;
|
|
6
|
+
|
|
7
|
+
export function App() {
|
|
8
|
+
const [item, setItem] = useState("coffee");
|
|
9
|
+
const [orders, setOrders] = useState<Order[]>([]);
|
|
10
|
+
const [message, setMessage] = useState("Loading orders…");
|
|
11
|
+
|
|
12
|
+
async function refresh() {
|
|
13
|
+
try {
|
|
14
|
+
const response = await fetch(api);
|
|
15
|
+
const data = (await response.json()) as { orders: Order[] };
|
|
16
|
+
setOrders(data.orders);
|
|
17
|
+
setMessage("API and database are connected");
|
|
18
|
+
} catch {
|
|
19
|
+
setMessage("Waiting for the orders API");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
void refresh();
|
|
25
|
+
const timer = window.setInterval(() => void refresh(), 1500);
|
|
26
|
+
return () => window.clearInterval(timer);
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
async function createOrder(event: React.FormEvent) {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
const response = await fetch(api, {
|
|
32
|
+
method: "POST",
|
|
33
|
+
headers: { "content-type": "application/json" },
|
|
34
|
+
body: JSON.stringify({ item }),
|
|
35
|
+
});
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
setMessage(`Could not create order (${response.status})`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
setMessage("Order saved; waiting for NATS worker observation…");
|
|
41
|
+
await refresh();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<main>
|
|
46
|
+
<p className="eyebrow">Flisk · Hono · PostgreSQL · NATS · Vite · Traefik</p>
|
|
47
|
+
<h1>Order desk</h1>
|
|
48
|
+
<p className="status">{message}</p>
|
|
49
|
+
<form onSubmit={createOrder}>
|
|
50
|
+
<label htmlFor="item">What should the worker process?</label>
|
|
51
|
+
<div className="row">
|
|
52
|
+
<input id="item" value={item} onChange={(event) => setItem(event.target.value)} />
|
|
53
|
+
<button type="submit">Create order</button>
|
|
54
|
+
</div>
|
|
55
|
+
</form>
|
|
56
|
+
<h2>Persisted orders</h2>
|
|
57
|
+
<ul>
|
|
58
|
+
{orders.map((order) => (
|
|
59
|
+
<li key={order.id}>
|
|
60
|
+
<span>#{order.id} · {order.item}</span>
|
|
61
|
+
<strong>{order.workerSeenAt ? "Worker observed" : "Queued"}</strong>
|
|
62
|
+
</li>
|
|
63
|
+
))}
|
|
64
|
+
</ul>
|
|
65
|
+
</main>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
:root { font-family: Inter, ui-sans-serif, system-ui, sans-serif; color: #13231e; background: #edf2ee; }
|
|
2
|
+
* { box-sizing: border-box; }
|
|
3
|
+
body { margin: 0; min-width: 320px; }
|
|
4
|
+
main { width: min(720px, calc(100% - 32px)); margin: 12vh auto; padding: 40px; background: white; border: 1px solid #d8e1dc; border-radius: 18px; box-shadow: 0 20px 60px #163c2512; }
|
|
5
|
+
.eyebrow { color: #537363; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
|
|
6
|
+
h1 { margin: 12px 0; font-size: clamp(38px, 8vw, 64px); letter-spacing: -.06em; }
|
|
7
|
+
.status { color: #587064; }
|
|
8
|
+
label { display: block; margin: 28px 0 8px; font-weight: 650; }
|
|
9
|
+
.row { display: flex; gap: 10px; }
|
|
10
|
+
input { min-width: 0; flex: 1; padding: 12px 14px; border: 1px solid #cad7cf; border-radius: 8px; font: inherit; }
|
|
11
|
+
button { padding: 12px 18px; border: 0; border-radius: 8px; color: white; background: #176447; font: inherit; font-weight: 700; cursor: pointer; }
|
|
12
|
+
h2 { margin-top: 34px; font-size: 18px; }
|
|
13
|
+
ul { display: grid; gap: 8px; padding: 0; list-style: none; }
|
|
14
|
+
li { display: flex; justify-content: space-between; gap: 12px; padding: 12px; background: #f4f7f4; border-radius: 8px; }
|
|
15
|
+
li strong { color: #176447; }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "orders-worker",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "bun build src/index.ts --outdir dist --target bun --packages external",
|
|
7
|
+
"start": "bun run dist/index.js",
|
|
8
|
+
"dev": "bun --watch src/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"nats": "^2.29.3",
|
|
12
|
+
"pg": "^8.16.3"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/node": "^20.0.0",
|
|
16
|
+
"@types/pg": "^8.15.5"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://tdk-landscape.github.io/schema.service.json",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"appName": "orders-worker",
|
|
5
|
+
"appType": "worker",
|
|
6
|
+
"stack": "shop",
|
|
7
|
+
"port": 4001,
|
|
8
|
+
"featuresEnabled": ["nats"],
|
|
9
|
+
"params": {
|
|
10
|
+
"NATS_URL": "nats://tdk_example_nats:4222"
|
|
11
|
+
},
|
|
12
|
+
"dependsOn": ["orders-api"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { connect, type NatsConnection } from "nats";
|
|
2
|
+
import { Pool } from "pg";
|
|
3
|
+
|
|
4
|
+
const databaseUrl = process.env.DATABASE_URL;
|
|
5
|
+
const natsUrl = process.env.NATS_URL ?? "nats://tdk_example_nats:4222";
|
|
6
|
+
if (!databaseUrl) throw new Error("DATABASE_URL is required");
|
|
7
|
+
|
|
8
|
+
const pgUrl = new URL(databaseUrl);
|
|
9
|
+
pgUrl.searchParams.delete("schema");
|
|
10
|
+
const db = new Pool({ connectionString: pgUrl.toString() });
|
|
11
|
+
let nc: NatsConnection | undefined;
|
|
12
|
+
while (!nc) {
|
|
13
|
+
try {
|
|
14
|
+
nc = await connect({ servers: natsUrl });
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error("waiting for NATS", error);
|
|
17
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const subscription = nc.subscribe("demo.orders.created", { queue: "orders-workers" });
|
|
21
|
+
await nc.flush();
|
|
22
|
+
nc.publish("demo.orders.worker-ready", new Uint8Array());
|
|
23
|
+
console.log("orders-worker subscribed to demo.orders.created");
|
|
24
|
+
|
|
25
|
+
for await (const message of subscription) {
|
|
26
|
+
const id = new TextDecoder().decode(message.data);
|
|
27
|
+
const result = await db.query(
|
|
28
|
+
"UPDATE demo_orders SET worker_seen_at = now() WHERE id = $1 RETURNING id, item",
|
|
29
|
+
[id],
|
|
30
|
+
);
|
|
31
|
+
if (result.rows[0]) console.log(`worker observed order ${id}: ${result.rows[0].item}`);
|
|
32
|
+
else console.error(`worker received unknown order ${id}`);
|
|
33
|
+
}
|
package/ext/Tiltfile
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# 🎯 FLISK-EXT - Extensions and IDE Components
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# This is the Tiltfile entry point for the tdk-ext repo.
|
|
5
|
+
# It exports UI enhancements and IDE components.
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# v1alpha1.extension_repo(name='tdk-ext', url='https://github.com/tdk-landscape/tdk-ext')
|
|
9
|
+
# load('ext://tdk-ext', 'get_ide_components_path', ...)
|
|
10
|
+
# =============================================================================
|
|
11
|
+
|
|
12
|
+
# =============================================================================
|
|
13
|
+
# UI ENHANCEMENTS (simplified for repos-only)
|
|
14
|
+
# =============================================================================
|
|
15
|
+
def load_ui_enhancements(config):
|
|
16
|
+
"""
|
|
17
|
+
Load UI enhancements configuration.
|
|
18
|
+
Simplified version for pure extension loading.
|
|
19
|
+
"""
|
|
20
|
+
enable_tooltips = config.get('enable_tooltips', True)
|
|
21
|
+
enable_icons = config.get('enable_icons', True)
|
|
22
|
+
enable_help_panel = config.get('enable_help_panel', True)
|
|
23
|
+
enable_cron_jobs_tab = config.get('enable_cron_jobs_tab', True)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
print(" - Tooltips: " + ("enabled" if enable_tooltips else "disabled"))
|
|
27
|
+
print(" - Icons: " + ("enabled" if enable_icons else "disabled"))
|
|
28
|
+
print(" - Help Panel: " + ("enabled" if enable_help_panel else "disabled"))
|
|
29
|
+
print(" - Cron Jobs Tab: " + ("enabled" if enable_cron_jobs_tab else "disabled"))
|
|
30
|
+
|
|
31
|
+
# =============================================================================
|
|
32
|
+
# IDE COMPONENTS PATHS
|
|
33
|
+
# =============================================================================
|
|
34
|
+
|
|
35
|
+
def get_ide_components_path():
|
|
36
|
+
"""Return the path to IDE components."""
|
|
37
|
+
return './ide-components'
|
|
38
|
+
|
|
39
|
+
def get_file_browser_script():
|
|
40
|
+
"""Return the path to file browser server script."""
|
|
41
|
+
return './ide-components/file_browser/server.py'
|
|
42
|
+
|
|
43
|
+
def get_code_viewer_script():
|
|
44
|
+
"""Return the path to code viewer server script."""
|
|
45
|
+
return './ide-components/code_viewer/server.py'
|
|
46
|
+
|
|
47
|
+
def get_config_inspector_script():
|
|
48
|
+
"""Return the path to config inspector server script."""
|
|
49
|
+
return './ide-components/config_inspector/server.py'
|
|
50
|
+
|
|
51
|
+
def get_code_executor_script():
|
|
52
|
+
"""Return the path to code executor server script."""
|
|
53
|
+
return './ide-components/code_executor/server.py'
|
|
54
|
+
|
|
55
|
+
# =============================================================================
|
|
56
|
+
# PORTS
|
|
57
|
+
# =============================================================================
|
|
58
|
+
|
|
59
|
+
IDE_PORTS = {
|
|
60
|
+
'file_browser': 9765,
|
|
61
|
+
'code_viewer': 9766,
|
|
62
|
+
'config_inspector': 9767,
|
|
63
|
+
'code_executor': 9768,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
print("✅ Flisk Extensions loaded: UI enhancements and IDE components")
|