@flisk-sh/flisk 1.4.1 → 1.4.2
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/README.md +305 -52
- package/cli/dist-bundle/{chunk-RX6O3PG4.js → chunk-3XODDLRJ.js} +1 -1
- package/cli/dist-bundle/{chunk-L6U555CJ.js → chunk-43XWL2PB.js} +1 -1
- package/cli/dist-bundle/{chunk-TZNXL3IO.js → chunk-53L2JN7G.js} +1 -1
- package/cli/dist-bundle/{chunk-VRESY4NR.js → chunk-5F7YP5IR.js} +1 -1
- package/cli/dist-bundle/{chunk-KJOCVAMQ.js → chunk-5QBYM33Q.js} +1 -1
- package/cli/dist-bundle/{chunk-M2R464RM.js → chunk-DU2BN46C.js} +1 -1
- package/cli/dist-bundle/{chunk-SRN64OPO.js → chunk-ETKUVKJ2.js} +2 -2
- package/cli/dist-bundle/{chunk-7IXBBU27.js → chunk-I7TGIK5N.js} +1 -1
- package/cli/dist-bundle/{chunk-UJXR6MZ2.js → chunk-IGN5UC3P.js} +1 -1
- package/cli/dist-bundle/{chunk-7HR5PVOD.js → chunk-MWOVYIBB.js} +1 -1
- package/cli/dist-bundle/{chunk-DUNCELUK.js → chunk-YHYRGWUH.js} +1 -1
- package/cli/dist-bundle/{chunk-BB5BZ37Y.js → chunk-YNCBBJ4V.js} +1 -1
- package/cli/dist-bundle/cli.js +3 -3
- package/cli/dist-bundle/{cold-preflight-BBDDHWRV.js → cold-preflight-ZOPR7PWJ.js} +1 -1
- package/cli/dist-bundle/{demo-stage-HIHO4VV3.js → demo-stage-OHNTP2UJ.js} +1 -1
- package/cli/dist-bundle/{open-W3QX35R6.js → open-XROJ6YEY.js} +1 -1
- package/cli/dist-bundle/project-7PTIOHGF.js +2 -0
- package/cli/dist-bundle/{services-RGTQ2LXC.js → services-BIMF6MVU.js} +1 -1
- package/cli/dist-bundle/{tilt-port-owner-6DO7OJRR.js → tilt-port-owner-ZY5M2JC4.js} +1 -1
- package/cli/package.json +1 -1
- package/package.json +2 -1
- package/cli/dist-bundle/project-FW5LL2KM.js +0 -2
package/README.md
CHANGED
|
@@ -1,24 +1,145 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
# Flisk
|
|
3
|
+
# Flisk: your whole stack, running locally with one command
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ask your AI agent for an app, or type four commands yourself.<br />Flisk sets up the containers, database, routing, and secrets, wires them together, and keeps them in sync as you change things.
|
|
6
6
|
|
|
7
7
|
<img src="https://raw.githubusercontent.com/flisk-sh/.github/main/profile/header-flisk.svg" alt="Flisk: your whole stack, running locally with one command." width="100%">
|
|
8
8
|
|
|
9
|
+
[](https://discord.gg/Sjhb3tnq3)
|
|
10
|
+
[](https://www.npmjs.com/package/@flisk-sh/flisk) [](https://www.npmjs.com/package/@flisk-sh/flisk) [](https://github.com/flisk-sh/flisk/stargazers) [](LICENSE)
|
|
11
|
+
|
|
12
|
+
<a href="https://trendshift.io/repositories/266432?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-266432" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/266432/weekly?language=Starlark" alt="flisk-sh%2Fflisk | Trendshift" width="250" height="55"/></a>
|
|
13
|
+
|
|
14
|
+
<img src="docs/assets/demo-ai.svg" alt="An AI coding agent builds a small online shop with Flisk and runs it locally" width="900" />
|
|
15
|
+
|
|
16
|
+
<sub>An illustrative agent session. The Flisk commands, and the service list and URLs Flisk prints, come from a real run. Copy the prompt from <a href="#with-your-ai-agent">Try it</a>.</sub>
|
|
17
|
+
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
## Trusted by
|
|
21
|
+
|
|
22
|
+
<table align="center">
|
|
23
|
+
<tr><td align="center" valign="middle"><a href="https://www.linkedin.com/company/lekast/"><img src="docs/assets/trusted-by/lekast.png" alt="Lekast" height="64"></a></td><td align="center" valign="middle"><a href="https://medium.com/@mfin.services"><img src="docs/assets/trusted-by/mfin-services.png" alt="MFin Services" height="64"></a></td><td align="center" valign="middle"><a href="https://www.linkedin.com/company/makeofferio"><img src="docs/assets/trusted-by/makeoffer.png" alt="MakeOffer" height="64"></a></td><td align="center" valign="middle"><a href="https://redmoon.digital/"><img src="docs/assets/trusted-by/redmoon-digital.png" alt="RedMoon.Digital" height="64"></a></td></tr>
|
|
24
|
+
</table>
|
|
25
|
+
|
|
26
|
+
<p align="center"><sub>Teams that run <code>flisk up</code> on their own code, listed with their consent. <a href="docs/project/ADOPTERS.md">See all adopters</a> or <a href="https://github.com/flisk-sh/flisk/issues/new?template=we-use-flisk.yml">add yours</a>.</sub></p>
|
|
27
|
+
|
|
28
|
+
## Try it
|
|
29
|
+
|
|
30
|
+
### With your AI agent
|
|
31
|
+
|
|
32
|
+
Install Flisk, then paste a prompt into your coding agent. Claude Code, Codex, Cursor, GitHub Copilot, and any other agent that can run commands will work. Every block below has a copy button.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g @flisk-sh/flisk
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**The prompt from the demo:**
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
Build me a small online shop with a storefront and an orders API, and run it on my laptop with Flisk.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Your agent creates the project, adds each part, and starts it. If something is missing on your computer, `flisk doctor` tells it what to fix.
|
|
45
|
+
|
|
46
|
+
<details>
|
|
47
|
+
<summary>More prompts to copy</summary>
|
|
48
|
+
|
|
49
|
+
**Add a service to a project you already have**
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
Use Flisk to add a backend service called payments-api to my shop stack, then start the stack and give me the URLs.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Build an AI agent with tools and a database**
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
Use Flisk to scaffold an AI agent, an MCP tools server, and a database in one stack called shop, then start it and tell me how to talk to the agent.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Something is not working**
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
Run flisk doctor, explain every problem in plain words, and fix what you can. Then start my stack with flisk up.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**See what is running**
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
Use flisk status to tell me which services are running, which are unhealthy, and what URL each one has.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Stop everything**
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Stop my Flisk stack with flisk down and confirm nothing is left running.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
</details>
|
|
80
|
+
|
|
81
|
+
<details>
|
|
82
|
+
<summary>Connect your agent to Flisk as an MCP server</summary>
|
|
83
|
+
|
|
84
|
+
Add this to your agent's MCP settings:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcpServers": {
|
|
89
|
+
"flisk": { "command": "flisk", "args": ["mcp"] }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The agent can then start the stack, check status, restart a service, and read agent sessions through Flisk tools instead of shell commands. See [use Flisk with your AI agent](#use-flisk-with-your-ai-agent).
|
|
95
|
+
|
|
96
|
+
</details>
|
|
97
|
+
|
|
98
|
+
### In your terminal
|
|
99
|
+
|
|
100
|
+
<p align="center">
|
|
101
|
+
<img src="docs/assets/demo-cli.svg" alt="Four flisk commands create a project, an API, and a website, then start them" width="900" />
|
|
102
|
+
</p>
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm install -g @flisk-sh/flisk
|
|
106
|
+
mkdir my-shop && cd my-shop
|
|
107
|
+
flisk project --yes
|
|
108
|
+
flisk resource orders-api --type backend --stack shop --yes
|
|
109
|
+
flisk resource shop-web --type frontend --stack shop --yes
|
|
110
|
+
flisk up shop
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
You get an orders API and a storefront behind one local gateway, with Postgres and live reload. You need Docker, [Tilt](https://docs.tilt.dev/install.html), Node.js 22.12+, and [Bun](https://bun.sh/) 1.2+; `flisk doctor` checks your machine. Prefer to answer questions instead? `npm init create-microservices my-project` asks what to create. See the [quick start](#quick-start) for every option.
|
|
114
|
+
|
|
115
|
+
<div align="center">
|
|
116
|
+
|
|
117
|
+
<p><strong><a href="#quick-start">Quick start</a> · <a href="#why-flisk-cli">Why Flisk</a> · <a href="#examples">Examples</a> · <a href="#installation">Installation</a> · <a href="#faq">FAQ</a> · <a href="#docs">Documentation</a></strong></p>
|
|
118
|
+
|
|
119
|
+
[Website](https://flisk.sh/) · [Quickstart](https://flisk.sh/docs/quickstart/) · [Examples](https://flisk.sh/docs/examples/) · [Awesome Flisk](https://github.com/flisk-sh/awesome-tdk-framework) · [Demo](https://flisk-sh.github.io/flisk-demo-animation/) · [Report a bug](https://github.com/flisk-sh/flisk/issues)
|
|
120
|
+
|
|
121
|
+
<a id="readme-languages"></a>
|
|
122
|
+
|
|
123
|
+
<p align="center">
|
|
124
|
+
|
|
125
|
+
English | [简体中文](docs/README-zh_cn.md) | [繁體中文](docs/README-zh_tw.md) | [日本語](docs/README-ja.md) | [한국어](docs/README-ko.md) | [Türkçe](docs/README-tr.md) | [Tiếng Việt](docs/README-vi.md) | [ไทย](docs/README-th.md) | [Deutsch](docs/README-de.md) | [Español](docs/README-es.md) | [Français](docs/README-fr.md) | [Українська](docs/README-uk.md) | [Polski](docs/README-pl.md) | [Português (Brasil)](docs/README-pt-BR.md) | [العربية](docs/README-ar.md) | [فارسی](docs/README-fa.md) | [Bahasa Indonesia](docs/README-id.md) | [Italiano](docs/README-it.md) | [Ελληνικά](docs/README-el.md) | [മലയാളം](docs/README-ml.md)
|
|
126
|
+
|
|
127
|
+
</p>
|
|
128
|
+
|
|
129
|
+
<details>
|
|
130
|
+
<summary>Test, scale, and security status</summary>
|
|
9
131
|
|
|
10
|
-
[](https://discord.gg/JG6r33HVB)
|
|
11
|
-
[](https://www.npmjs.com/package/@flisk-sh/flisk) [](https://www.npmjs.com/package/@flisk-sh/flisk) [](https://packagephobia.com/result?p=@flisk-sh/flisk) [](https://packagephobia.com/result?p=@flisk-sh/flisk) [](https://github.com/flisk-sh/flisk/stargazers) [](https://ossinsight.io/analyze/flisk-sh/flisk) [](https://x.com/brookservers)
|
|
12
132
|
[](https://github.com/flisk-sh/flisk/actions/workflows/e2e-journeys.yml) [](https://github.com/flisk-sh/flisk/actions/workflows/e2e-scale-full.yml) [](https://github.com/flisk-sh/flisk/actions/workflows/e2e-real-apps.yml) [](https://github.com/flisk-sh/flisk/security/code-scanning) [](https://scorecard.dev/viewer/?uri=github.com/flisk-sh/flisk) [](https://snyk.io/test/github/flisk-sh/flisk) [](https://socket.dev/npm/package/@flisk-sh/flisk/overview)
|
|
13
|
-
[](LICENSE)
|
|
14
133
|
|
|
15
134
|
[](https://github.com/flisk-sh/flisk/actions/runs/39160719471) [](https://github.com/flisk-sh/flisk/actions/runs/39160719471) [](https://github.com/flisk-sh/flisk/actions/runs/39160719471) [](https://github.com/flisk-sh/flisk/actions/runs/39160719471) [](https://github.com/flisk-sh/flisk/actions/runs/39160719471)
|
|
16
135
|
[](https://github.com/flisk-sh/flisk/blob/main/docs/assets/coverage.svg)
|
|
17
136
|
|
|
18
137
|
<sub>ERP fixture scale run on a clean GitHub-hosted runner (4 vCPU, 15 GB RAM), snapshot from [run 39160719471](https://github.com/flisk-sh/flisk/actions/runs/39160719471). The live status is in the ERP fixture scale E2E badge above.</sub>
|
|
19
138
|
|
|
139
|
+
[](https://packagephobia.com/result?p=@flisk-sh/flisk) [](https://packagephobia.com/result?p=@flisk-sh/flisk) [](https://ossinsight.io/analyze/flisk-sh/flisk) [](https://x.com/brookservers)
|
|
140
|
+
|
|
20
141
|
<a href="https://trendshift.io/repositories/266432?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-266432" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/266432/daily?language=Starlark" alt="flisk-sh%2Fflisk | Trendshift" width="250" height="55"/></a>
|
|
21
|
-
|
|
142
|
+
|
|
22
143
|
<p align="center">
|
|
23
144
|
<a href="https://www.bestpractices.dev/projects/15310">
|
|
24
145
|
<img src="https://www.bestpractices.dev/assets/openssf_bestpracticesbadge-a908f4124737f3d6b2c5abc82756bd2a435cff474b45615ce469746c31a4288c.svg" alt="OpenSSF Best Practices" height="80" align="middle" style="vertical-align: middle" />
|
|
@@ -28,19 +149,7 @@ Go from an empty folder to a running tech stack with one command. Built for agen
|
|
|
28
149
|
</a>
|
|
29
150
|
</p>
|
|
30
151
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<a id="readme-languages"></a>
|
|
34
|
-
|
|
35
|
-
<p align="center">
|
|
36
|
-
|
|
37
|
-
English | [简体中文](docs/README-zh_cn.md) | [繁體中文](docs/README-zh_tw.md) | [日本語](docs/README-ja.md) | [한국어](docs/README-ko.md) | [Türkçe](docs/README-tr.md) | [Tiếng Việt](docs/README-vi.md) | [ไทย](docs/README-th.md) | [Deutsch](docs/README-de.md) | [Español](docs/README-es.md) | [Français](docs/README-fr.md) | [Українська](docs/README-uk.md) | [Polski](docs/README-pl.md) | [Português (Brasil)](docs/README-pt-BR.md) | [العربية](docs/README-ar.md) | [فارسی](docs/README-fa.md) | [Bahasa Indonesia](docs/README-id.md) | [Italiano](docs/README-it.md) | [Ελληνικά](docs/README-el.md) | [മലയാളം](docs/README-ml.md)
|
|
38
|
-
|
|
39
|
-
</p>
|
|
40
|
-
|
|
41
|
-
<br />
|
|
42
|
-
|
|
43
|
-
[Website](https://flisk.sh/) · [Quickstart](https://flisk.sh/docs/quickstart/) · [Examples](https://flisk.sh/docs/examples/) · [Awesome Flisk](https://github.com/flisk-sh/awesome-tdk-framework) · [Demo](https://flisk-sh.github.io/flisk-demo-animation/) · [Report a bug](https://github.com/flisk-sh/flisk/issues)
|
|
152
|
+
</details>
|
|
44
153
|
|
|
45
154
|
</div>
|
|
46
155
|
|
|
@@ -114,8 +223,9 @@ Fastest way (recommended): open the [Flisk starter](https://github.com/flisk-sh/
|
|
|
114
223
|
|
|
115
224
|
</details>
|
|
116
225
|
|
|
117
|
-
### ⚡
|
|
118
|
-
|
|
226
|
+
### ⚡ A running stack in about 14 seconds
|
|
227
|
+
|
|
228
|
+
On a one-backend quickstart with warm image layers, `flisk up` reaches a healthy API in 12.8 to 13.8 seconds ([timing notes](docs/benchmarks/quickstart-timing.md)). An 8-service stack settles in 32 to 42 seconds warm and about 4.5 minutes on its first cold build ([benchmark](docs/benchmarks/results/tdk-up-warm-start-2026-10-11/summary.md)). No vendor lock-in and no hand-written plumbing. Flisk works with:
|
|
119
229
|
* **Runtimes & Frameworks:** Bun, Node, Python, Go, Rust, React, Vue, Svelte, Elysia, Fastify, NestJS
|
|
120
230
|
* **Databases & Tooling:** Prisma, Drizzle, Atlas, Dbmate
|
|
121
231
|
* **Messaging & Gateway:** NATS, Traefik
|
|
@@ -134,11 +244,11 @@ flisk up shop
|
|
|
134
244
|
Agents get durable checkpoint volumes that survive `flisk down`, sticky session routing via `x-session-id`, graceful SIGTERM drain during hot reloads, a Docker health check on `/health`, and application-level readiness checks on `/ready`. See the [AI agents guide](docs/agents/ai-agents.md) and [honest comparison with agent frameworks](docs/compare-honest.md#ai-agent-frameworks-and-workflow-engines-libfx-langgraph-mastra-vercel-workflows-temporal).
|
|
135
245
|
|
|
136
246
|
|
|
137
|
-
Flisk
|
|
247
|
+
**What Flisk is:** a local development runtime. Define each service in `service.json` and run `flisk up`. Docker runs the containers, Tilt live-updates them while you code, and Flisk writes the configuration both use. No local Kubernetes is needed.
|
|
138
248
|
|
|
139
|
-
|
|
249
|
+
**What Flisk is not:** a deploy tool or a Compose file. Production deployment stays with Helm, Argo CD, or Kustomize.
|
|
140
250
|
|
|
141
|
-
|
|
251
|
+
Stability: 1.x. The core CLI is MIT and needs no key; Premium is optional. See [what Flisk writes](docs/generated-files.md) and how to check for drift.
|
|
142
252
|
|
|
143
253
|
|
|
144
254
|
> [!IMPORTANT]
|
|
@@ -147,12 +257,6 @@ Docker runs the containers. Tilt watches services and live-updates containers wh
|
|
|
147
257
|
> [official website](https://flisk.sh/). Follow the installation links from these official sources.
|
|
148
258
|
> A similar repository name or copied README does not establish that a download is official.
|
|
149
259
|
|
|
150
|
-
<p align="center"><strong><a href="#quick-start">Quick start</a> · <a href="#why-flisk-cli">Why Flisk</a> · <a href="#examples">Examples</a> · <a href="#installation">Installation</a> · <a href="#faq">FAQ</a> · <a href="#docs">Documentation</a></strong></p>
|
|
151
|
-
|
|
152
|
-
If Flisk helps you run your local stack, a ⭐ on [this repo](https://github.com/flisk-sh/flisk) helps other developers find it.
|
|
153
|
-
|
|
154
|
-
`flisk ui` opens an interactive terminal dashboard for inspecting running services. Move with `↑/↓` or `j/k`, search with `/`, and press `1`–`5` to jump between tabs. See [docs/ui.md](docs/ui.md) for every key binding.
|
|
155
|
-
|
|
156
260
|
## Why Flisk CLI?
|
|
157
261
|
|
|
158
262
|
- **One `service.json` per service.** Flisk generates the Dockerfile, Traefik routing, and Tiltfile from it. You do not hand-write a `docker-compose.yml` or `nginx.conf`.
|
|
@@ -178,6 +282,22 @@ See the [detailed tool comparison](docs/comparison.md) for architectural tradeof
|
|
|
178
282
|
|
|
179
283
|
Production deployment stays with your own tools (Helm, Argo CD, or Kustomize).
|
|
180
284
|
|
|
285
|
+
### Everything is wired together, and stays in sync
|
|
286
|
+
|
|
287
|
+
You do not connect services by hand. Flisk derives each connection from the same `service.json` files and regenerates it when they change.
|
|
288
|
+
|
|
289
|
+
| When you... | Flisk updates |
|
|
290
|
+
| --- | --- |
|
|
291
|
+
| Add a service with `flisk resource` | It is discovered automatically and its stack is enabled on the next `flisk up`. It gets an image build, a Compose entry, gateway routes, a health check, and its own `.autogenerated/` files. |
|
|
292
|
+
| Edit a `service.json` (port, `dependsOn`, features) | The Dockerfile, Compose entry, Traefik labels, and nginx config are regenerated on the next `flisk up`. A hand edit to a generated file is caught as drift before anything starts. |
|
|
293
|
+
| Edit your code | Tilt live-updates the running container. No rebuild step. |
|
|
294
|
+
| Add a backend route | Frontends already point at the API through generated `VITE_API_URL`, `env.ts`, and `api-client.ts`, built from the same hostnames the gateway routes. |
|
|
295
|
+
| Add a database or a second backend | `DATABASE_URL` and the other connection settings are injected into each service's environment. No copying of passwords or hostnames. |
|
|
296
|
+
| Run on a project with an older or missing `.env` | Missing secrets such as `JWT_SECRET` are generated without overwriting your values. |
|
|
297
|
+
| Declare `dependsOn` | Services start in health-checked order. |
|
|
298
|
+
|
|
299
|
+
See [how `flisk up` works](docs/how-flisk-up-works.md) for the full startup sequence.
|
|
300
|
+
|
|
181
301
|
## What you can do with Flisk
|
|
182
302
|
|
|
183
303
|
| You want to | Flisk does | Command |
|
|
@@ -268,33 +388,106 @@ curl http://api.shop.localhost/api/orders/health
|
|
|
268
388
|
|
|
269
389
|
`flisk up` prints the host ports it chose. It uses port 80 when it is free, so URLs carry no port. Otherwise it picks one from 8080-8180, and the URLs it prints include that port (on Linux and WSL2 a non-root user cannot check port 80, so the range is used there). Use the URL `flisk up` prints, or set `FLISK_HTTP_PORT`. A resource named `orders-api` is served at `/api/orders` (a trailing `-api` is dropped); `flisk up` prints the exact URLs.
|
|
270
390
|
|
|
271
|
-
|
|
272
|
-
<img src="docs/assets/demo.svg" alt="Flisk scaffolding a backend and a frontend, then listing the stack" width="900" />
|
|
273
|
-
<br /><br />
|
|
274
|
-
<em>Scaffolding a backend and frontend, then listing the stack.</em>
|
|
275
|
-
</p>
|
|
391
|
+
### What Flisk writes for you
|
|
276
392
|
|
|
277
|
-
|
|
393
|
+
You write one `service.json` per service. For the two-service shop above, Flisk writes the rest at three levels: the project, the stack, and each service.
|
|
278
394
|
|
|
279
|
-
|
|
395
|
+
```text
|
|
396
|
+
my-shop/
|
|
397
|
+
├── .env # generated DB_PASSWORD and JWT_SECRET
|
|
398
|
+
├── .flisk/
|
|
399
|
+
│ ├── project.json # project settings (yours to edit)
|
|
400
|
+
│ └── .flisk-out/ # PROJECT LEVEL
|
|
401
|
+
│ ├── Tiltfile # what Tilt runs
|
|
402
|
+
│ ├── docker-compose.traefik.yml # local gateway, bound to 127.0.0.1
|
|
403
|
+
│ ├── golden-layers.Dockerfile # shared base image layers
|
|
404
|
+
│ ├── TILT_TECH_STACK.star # tech stack settings
|
|
405
|
+
│ ├── TILT_RESOURCE_DEFAULTS.star # service defaults
|
|
406
|
+
│ ├── spec.master # project spec by stack
|
|
407
|
+
│ └── flisk-cli-ext/ # pinned copy of the Flisk engine
|
|
408
|
+
├── shared-platform-engineering/
|
|
409
|
+
│ └── docker-templates/ # container entrypoint scripts
|
|
410
|
+
└── services/
|
|
411
|
+
├── platform/database-management/
|
|
412
|
+
│ └── docker-compose.yml # Postgres 16
|
|
413
|
+
└── shop/
|
|
414
|
+
├── .autogenerated/ # STACK LEVEL
|
|
415
|
+
│ └── docker-compose.app.autogenerated.yml # every service in the stack
|
|
416
|
+
├── orders-api/
|
|
417
|
+
│ ├── service.json # you write this
|
|
418
|
+
│ └── .autogenerated/ # SERVICE LEVEL: 14 files
|
|
419
|
+
└── shop-web/
|
|
420
|
+
├── service.json # you write this
|
|
421
|
+
└── .autogenerated/ # SERVICE LEVEL: 18 files
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
The stack's Compose file is the part you would otherwise write by hand. For these two services it holds the image builds, environment, 33 Traefik routing labels, four networks, health checks, and CPU and memory limits. An excerpt:
|
|
425
|
+
|
|
426
|
+
```yaml
|
|
427
|
+
orders-api:
|
|
428
|
+
environment:
|
|
429
|
+
- DATABASE_URL=postgresql://my_shop:${DB_PASSWORD}@my_shop_postgres:5432/my_shop_shop?schema=public
|
|
430
|
+
- JWT_SECRET=${JWT_SECRET:?JWT_SECRET is not set. Run `flisk up` ...}
|
|
431
|
+
labels:
|
|
432
|
+
- "traefik.http.routers.orders-api-project.rule=Host(`api.my-shop.localhost`) && PathPrefix(`/api/orders`)"
|
|
433
|
+
- "traefik.http.middlewares.orders-api-strip-prefix-project.stripprefix.prefixes=/api/orders"
|
|
434
|
+
- "traefik.http.services.orders-api.loadbalancer.healthcheck.path=/health"
|
|
435
|
+
healthcheck:
|
|
436
|
+
test: ["CMD", "curl", "-f", "--max-time", "5", "http://localhost:4000/health"]
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Secrets come from the project `.env` by default: `flisk project` generates a random database password and JWT secret, and `.env` is added to `.gitignore`. Set `FLISK_SECRET_PROVIDER=infisical` to read secrets from [Infisical](https://infisical.com/) instead ([environment](docs/environment.md)).
|
|
440
|
+
|
|
441
|
+
<details>
|
|
442
|
+
<summary>Every file in each service's <code>.autogenerated/</code> folder</summary>
|
|
280
443
|
|
|
281
444
|
```text
|
|
282
|
-
|
|
283
|
-
├──
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
445
|
+
shop-web/.autogenerated/
|
|
446
|
+
├── Dockerfile.app.autogenerated # app image
|
|
447
|
+
├── Dockerfile.app.autogenerated.dockerignore # build context
|
|
448
|
+
├── nginx.autogenerated.conf # serves the build, routes API requests
|
|
449
|
+
├── vite.config.frontend.autogenerated.ts # dev server
|
|
450
|
+
├── vite.config.build.autogenerated.ts # production build
|
|
451
|
+
├── tsconfig.autogenerated.json # TypeScript, host
|
|
452
|
+
├── tsconfig.docker.autogenerated.json # TypeScript, container
|
|
453
|
+
├── .npmrc.autogenerated # package registry, host
|
|
454
|
+
├── .npmrc.docker.autogenerated # package registry, container
|
|
455
|
+
├── bunfig.autogenerated.toml # Bun settings, host
|
|
456
|
+
├── bunfig.docker.autogenerated.toml # Bun settings, container
|
|
457
|
+
├── .env.frontend.autogenerated # frontend environment
|
|
458
|
+
├── env.ts # API URL for your imports
|
|
459
|
+
├── api-client.ts # client for the frontend's API route
|
|
460
|
+
├── api-index.ts # re-exports the client and URL
|
|
461
|
+
├── service.yaml # Tilt's projection of service.json
|
|
462
|
+
├── validation-report.autogenerated.json # preflight validation result
|
|
463
|
+
├── AGENTS.md # tells coding agents not to edit here
|
|
464
|
+
└── .flisk-contract/ # snapshots for drift checks
|
|
291
465
|
```
|
|
292
466
|
|
|
293
|
-
|
|
467
|
+
```text
|
|
468
|
+
orders-api/.autogenerated/
|
|
469
|
+
├── Dockerfile.app.autogenerated # app image
|
|
470
|
+
├── Dockerfile.app.autogenerated.dockerignore # build context
|
|
471
|
+
├── vite.config.backend.autogenerated.ts # server build
|
|
472
|
+
├── prisma.config.autogenerated.ts # database client
|
|
473
|
+
├── tsconfig.autogenerated.json # TypeScript, host
|
|
474
|
+
├── tsconfig.docker.autogenerated.json # TypeScript, container
|
|
475
|
+
├── .npmrc.autogenerated # package registry, host
|
|
476
|
+
├── .npmrc.docker.autogenerated # package registry, container
|
|
477
|
+
├── bunfig.autogenerated.toml # Bun settings, host
|
|
478
|
+
├── bunfig.docker.autogenerated.toml # Bun settings, container
|
|
479
|
+
├── .env.backend.autogenerated # backend environment
|
|
480
|
+
├── service.yaml # Tilt's projection of service.json
|
|
481
|
+
├── validation-report.autogenerated.json # preflight validation result
|
|
482
|
+
├── AGENTS.md # tells coding agents not to edit here
|
|
483
|
+
└── .flisk-contract/ # snapshots for drift checks
|
|
484
|
+
```
|
|
294
485
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
</
|
|
486
|
+
A stack with a database migrator also gets `docker-compose.migrator.autogenerated.yml` in the stack folder, and the migrator gets its own `Dockerfile.migrator.autogenerated`.
|
|
487
|
+
|
|
488
|
+
</details>
|
|
489
|
+
|
|
490
|
+
You never write an nginx config, a Dockerfile, a Compose file, or Traefik labels for this stack. `flisk up` regenerates these files when `service.json` changes and refuses to start if one was edited by hand. Python, Go, and Rust services, and optional features such as Playwright, get their own sets; the [generated-files guide](docs/generated-files.md) lists them and explains the drift checks.
|
|
298
491
|
|
|
299
492
|
If Helm, Compose, or your existing Tilt setup already gives you a working local environment, keep using it. Flisk CLI is for engineers managing several services who want a clear local service contract and one command to start the stack.
|
|
300
493
|
|
|
@@ -305,7 +498,8 @@ See [how Flisk compares to alternative dev tools](docs/comparison.md), [how Flis
|
|
|
305
498
|
Use `flisk ui` to inspect stacks and resources. Arrow keys or `j`/`k` move the
|
|
306
499
|
selection; `g`/`G` or Home/End jump to the first/last item, and PageUp/PageDown
|
|
307
500
|
move one visible page. `/` searches; navigation letters remain search text
|
|
308
|
-
while searching.
|
|
501
|
+
while searching. Press `1`–`5` to jump between tabs. The selected row stays
|
|
502
|
+
visible when the terminal is resized. See [docs/ui.md](docs/ui.md) for every key binding.
|
|
309
503
|
|
|
310
504
|
## Update Flisk
|
|
311
505
|
|
|
@@ -359,6 +553,7 @@ Set `FLISK_DEBUG=1` before running `flisk up --verbose` to include Starlark debu
|
|
|
359
553
|
|
|
360
554
|
## Docs
|
|
361
555
|
|
|
556
|
+
- [Flisk 101: a 13-lab course for beginners](docs/101/README.md)
|
|
362
557
|
- [CLI command cheat sheet](cli/README.md#cheat-sheet)
|
|
363
558
|
- [Mega cheat sheet: every command and flag](docs/cheat-sheet.md)
|
|
364
559
|
- [Documentation index](docs/README.md)
|
|
@@ -477,7 +672,65 @@ Then run `flisk doctor` and retry the same task. If the problem persists, [open
|
|
|
477
672
|
|
|
478
673
|
## Contributing and license
|
|
479
674
|
|
|
480
|
-
Contributions are welcome.
|
|
675
|
+
Contributions are welcome. **First step: [say hello on Discord](https://discord.gg/Sjhb3tnq3)**, tell us what you want to work on, and we will point you to a good first task. Then start with [CONTRIBUTING.md](.github/CONTRIBUTING.md) and the [contributor guide](docs/contributing/README.md). For the project structure, see the [architecture and repository map](docs/project-overview.md). To review pull requests, see [Review a pull request](docs/contributing/04-review-a-pr.md). Report security issues using [SECURITY.md](.github/SECURITY.md).
|
|
676
|
+
|
|
677
|
+
### Contributors
|
|
678
|
+
|
|
679
|
+
Thank you to everyone who has shipped code, docs, and fixes to Flisk since July 2026. Every merged change makes the local stack better for the next developer.
|
|
680
|
+
|
|
681
|
+
<table>
|
|
682
|
+
<tr>
|
|
683
|
+
<td align="center"><a href="https://github.com/kburym"><img src="https://github.com/kburym.png?size=80" width="64" alt="kburym" /><br /><sub><b>kburym</b></sub></a></td>
|
|
684
|
+
<td align="center"><a href="https://github.com/odykyi"><img src="https://github.com/odykyi.png?size=80" width="64" alt="odykyi" /><br /><sub><b>odykyi</b></sub></a></td>
|
|
685
|
+
<td align="center"><a href="https://github.com/sb123sb123"><img src="https://github.com/sb123sb123.png?size=80" width="64" alt="sb123sb123" /><br /><sub><b>sb123sb123</b></sub></a></td>
|
|
686
|
+
<td align="center"><a href="https://github.com/AK-Lmn"><img src="https://github.com/AK-Lmn.png?size=80" width="64" alt="AK-Lmn" /><br /><sub><b>AK-Lmn</b></sub></a></td>
|
|
687
|
+
<td align="center"><a href="https://github.com/yoreva-01"><img src="https://github.com/yoreva-01.png?size=80" width="64" alt="yoreva-01" /><br /><sub><b>yoreva-01</b></sub></a></td>
|
|
688
|
+
<td align="center"><a href="https://github.com/minutechreview"><img src="https://github.com/minutechreview.png?size=80" width="64" alt="minutechreview" /><br /><sub><b>minutechreview</b></sub></a></td>
|
|
689
|
+
</tr>
|
|
690
|
+
<tr>
|
|
691
|
+
<td align="center"><a href="https://github.com/Delfi2007"><img src="https://github.com/Delfi2007.png?size=80" width="64" alt="Delfi2007" /><br /><sub><b>Delfi2007</b></sub></a></td>
|
|
692
|
+
<td align="center"><a href="https://github.com/Ghifariezra"><img src="https://github.com/Ghifariezra.png?size=80" width="64" alt="Ghifariezra" /><br /><sub><b>Ghifariezra</b></sub></a></td>
|
|
693
|
+
<td align="center"><a href="https://github.com/Huang-404-Q"><img src="https://github.com/Huang-404-Q.png?size=80" width="64" alt="Huang-404-Q" /><br /><sub><b>Huang-404-Q</b></sub></a></td>
|
|
694
|
+
<td align="center"><a href="https://github.com/dbdefault"><img src="https://github.com/dbdefault.png?size=80" width="64" alt="dbdefault" /><br /><sub><b>dbdefault</b></sub></a></td>
|
|
695
|
+
<td align="center"><a href="https://github.com/Rohith-Saran"><img src="https://github.com/Rohith-Saran.png?size=80" width="64" alt="Rohith-Saran" /><br /><sub><b>Rohith-Saran</b></sub></a></td>
|
|
696
|
+
<td align="center"><a href="https://github.com/aazminu"><img src="https://github.com/aazminu.png?size=80" width="64" alt="aazminu" /><br /><sub><b>aazminu</b></sub></a></td>
|
|
697
|
+
</tr>
|
|
698
|
+
<tr>
|
|
699
|
+
<td align="center"><a href="https://github.com/xiehuanyi"><img src="https://github.com/xiehuanyi.png?size=80" width="64" alt="xiehuanyi" /><br /><sub><b>xiehuanyi</b></sub></a></td>
|
|
700
|
+
<td align="center"><a href="https://github.com/NimoCao"><img src="https://github.com/NimoCao.png?size=80" width="64" alt="NimoCao" /><br /><sub><b>NimoCao</b></sub></a></td>
|
|
701
|
+
<td align="center"><a href="https://github.com/rahul05ranjan"><img src="https://github.com/rahul05ranjan.png?size=80" width="64" alt="rahul05ranjan" /><br /><sub><b>rahul05ranjan</b></sub></a></td>
|
|
702
|
+
<td align="center"><a href="https://github.com/krishna2707"><img src="https://github.com/krishna2707.png?size=80" width="64" alt="krishna2707" /><br /><sub><b>krishna2707</b></sub></a></td>
|
|
703
|
+
<td align="center"><a href="https://github.com/arxh80"><img src="https://github.com/arxh80.png?size=80" width="64" alt="arxh80" /><br /><sub><b>arxh80</b></sub></a></td>
|
|
704
|
+
<td align="center"><a href="https://github.com/tnalbant"><img src="https://github.com/tnalbant.png?size=80" width="64" alt="tnalbant" /><br /><sub><b>tnalbant</b></sub></a></td>
|
|
705
|
+
</tr>
|
|
706
|
+
<tr>
|
|
707
|
+
<td align="center"><a href="https://github.com/sunny-kavixo"><img src="https://github.com/sunny-kavixo.png?size=80" width="64" alt="sunny-kavixo" /><br /><sub><b>sunny-kavixo</b></sub></a></td>
|
|
708
|
+
<td align="center"><a href="https://github.com/sohammkk"><img src="https://github.com/sohammkk.png?size=80" width="64" alt="sohammkk" /><br /><sub><b>sohammkk</b></sub></a></td>
|
|
709
|
+
<td align="center"><a href="https://github.com/sinhaananya812-star"><img src="https://github.com/sinhaananya812-star.png?size=80" width="64" alt="sinhaananya812-star" /><br /><sub><b>sinhaananya812-star</b></sub></a></td>
|
|
710
|
+
<td align="center"><a href="https://github.com/jay23606"><img src="https://github.com/jay23606.png?size=80" width="64" alt="jay23606" /><br /><sub><b>jay23606</b></sub></a></td>
|
|
711
|
+
<td align="center"><a href="https://github.com/floatyserve"><img src="https://github.com/floatyserve.png?size=80" width="64" alt="floatyserve" /><br /><sub><b>floatyserve</b></sub></a></td>
|
|
712
|
+
<td align="center"><a href="https://github.com/eddyflores100-lang"><img src="https://github.com/eddyflores100-lang.png?size=80" width="64" alt="eddyflores100-lang" /><br /><sub><b>eddyflores100-lang</b></sub></a></td>
|
|
713
|
+
</tr>
|
|
714
|
+
<tr>
|
|
715
|
+
<td align="center"><a href="https://github.com/denisvmedia"><img src="https://github.com/denisvmedia.png?size=80" width="64" alt="denisvmedia" /><br /><sub><b>denisvmedia</b></sub></a></td>
|
|
716
|
+
<td align="center"><a href="https://github.com/amritkang165"><img src="https://github.com/amritkang165.png?size=80" width="64" alt="amritkang165" /><br /><sub><b>amritkang165</b></sub></a></td>
|
|
717
|
+
<td align="center"><a href="https://github.com/airdropia"><img src="https://github.com/airdropia.png?size=80" width="64" alt="airdropia" /><br /><sub><b>airdropia</b></sub></a></td>
|
|
718
|
+
<td align="center"><a href="https://github.com/adity982"><img src="https://github.com/adity982.png?size=80" width="64" alt="adity982" /><br /><sub><b>adity982</b></sub></a></td>
|
|
719
|
+
<td align="center"><a href="https://github.com/YuuGR1337"><img src="https://github.com/YuuGR1337.png?size=80" width="64" alt="YuuGR1337" /><br /><sub><b>YuuGR1337</b></sub></a></td>
|
|
720
|
+
<td align="center"><a href="https://github.com/WilsonSoetomo"><img src="https://github.com/WilsonSoetomo.png?size=80" width="64" alt="WilsonSoetomo" /><br /><sub><b>WilsonSoetomo</b></sub></a></td>
|
|
721
|
+
</tr>
|
|
722
|
+
<tr>
|
|
723
|
+
<td align="center"><a href="https://github.com/Vignesh2662006"><img src="https://github.com/Vignesh2662006.png?size=80" width="64" alt="Vignesh2662006" /><br /><sub><b>Vignesh2662006</b></sub></a></td>
|
|
724
|
+
<td align="center"><a href="https://github.com/Samueldavidddsc"><img src="https://github.com/Samueldavidddsc.png?size=80" width="64" alt="Samueldavidddsc" /><br /><sub><b>Samueldavidddsc</b></sub></a></td>
|
|
725
|
+
<td align="center"><a href="https://github.com/Murphyvon"><img src="https://github.com/Murphyvon.png?size=80" width="64" alt="Murphyvon" /><br /><sub><b>Murphyvon</b></sub></a></td>
|
|
726
|
+
<td align="center"><a href="https://github.com/KeuqS"><img src="https://github.com/KeuqS.png?size=80" width="64" alt="KeuqS" /><br /><sub><b>KeuqS</b></sub></a></td>
|
|
727
|
+
<td align="center"><a href="https://github.com/Golden007-prog"><img src="https://github.com/Golden007-prog.png?size=80" width="64" alt="Golden007-prog" /><br /><sub><b>Golden007-prog</b></sub></a></td>
|
|
728
|
+
<td align="center"><a href="https://github.com/GeoCeff"><img src="https://github.com/GeoCeff.png?size=80" width="64" alt="GeoCeff" /><br /><sub><b>GeoCeff</b></sub></a></td>
|
|
729
|
+
</tr>
|
|
730
|
+
<tr>
|
|
731
|
+
<td align="center"><a href="https://github.com/Enard52"><img src="https://github.com/Enard52.png?size=80" width="64" alt="Enard52" /><br /><sub><b>Enard52</b></sub></a></td>
|
|
732
|
+
</tr>
|
|
733
|
+
</table>
|
|
481
734
|
|
|
482
735
|
Flisk is MIT-licensed; see [LICENSE](LICENSE). The [license boundary](docs/project/GOVERNANCE.md#license-boundary-and-donation-scope) says which code is MIT and which is downloaded with a key.
|
|
483
736
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{a as A}from"./chunk-
|
|
2
|
+
import{a as A}from"./chunk-53L2JN7G.js";import{ga as _}from"./chunk-5F7YP5IR.js";import{f as u,m as S}from"./chunk-YNCBBJ4V.js";import{existsSync as w,readFileSync as h}from"node:fs";import{join as i}from"node:path";var O=["postgres",u],y=["pre_alpha","alpha","beta","out_of_scope"];function D(e){return O.includes(e)}function b(e){try{return JSON.parse(h(i(e,".flisk",S),"utf-8"))}catch{return}}function l(e){try{return w(e)?h(e,"utf-8"):void 0}catch{return}}function k(e,n){let s=r=>{let t=r;for(;t<e.length&&/\s/.test(e[t]);)t+=1;return t},a=0;for(;;){let r=e.indexOf(n,a);if(r===-1)return;let t=s(r+n.length);if(e[t]==="="&&(t=s(t+1),e[t]==="[")){let o=e.indexOf("]",t+1);return o===-1?void 0:[...e.slice(t+1,o).matchAll(/"([^"]+)"|'([^']+)'/g)].map(f=>f[1]??f[2]??"")}a=r+n.length}}function N(e){let n=i(e,".flisk",".flisk-out","Tiltfile"),s=l(n);if(s)return k(s,"ALWAYS_ENABLED_INFRA")}function M(e){let n=i(e,".flisk",".flisk-out","spec.master"),s=l(n);if(s!==void 0)return/"database-management"\s*:\s*True/.test(s)}function x(e){let n=i(e,".flisk",".flisk-out"),s=l(i(n,"Tiltfile")),a=l(i(n,"spec.master")),r=l(i(n,"flisk-cli-ext","discovery","config.star")),t=l(i(n,"flisk-cli-ext","engine","topologies","tilt","config","profiles.star"));if(!s||!a||!r||!t)return!1;let o=a.match(/PRE_ALPHA_RESOURCES\s*=\s*\{([^}]*)\}/)?.[1],f=k(r,"CORE_INFRA");return/FOCUS_MODE\s*,\s*FOCUS_ENABLED_ALL\s*,\s*FOCUS_ENABLED_RESOURCES\s*=\s*Config\.apply_focus\(cfg\)/.test(s)&&/if FOCUS_MODE and FOCUS_ENABLED_ALL\s*:/.test(s)&&/"[^"]+"\s*:\s*True|'[^']+'\s*:\s*True/.test(o??"")&&(f?.includes("postgres")??!1)&&/["']postgres["']\s*:\s*["']database-management["']/.test(r)&&/for infra in CORE_INFRA_EXPORT\s*:/.test(t)&&/needed\[INFRA_STACK_MAP_EXPORT\[infra\]\]\s*=\s*True/.test(t)}function C(e){let n=b(e);if(!n)return!1;let s=n.phases??{};for(let r of y){let t=s[r]?.enabledStacks;if(Array.isArray(t)&&t.includes(u))return!0}let a=n.always_enabled_infra??A;return Array.isArray(a)&&a.includes(u)}function L(e,n){let s=new Set;for(let t of O)s.add(t);for(let t of n)s.add(t.name),t.stack&&s.add(t.stack);let a=b(e);if(a){let t=a.phases??{};for(let f of y){let d=t[f]?.enabledStacks;if(Array.isArray(d))for(let c of d)s.add(c)}let o=a.always_enabled_infra??A;if(Array.isArray(o))for(let f of o)s.add(f)}let r=N(e);if(Array.isArray(r))for(let t of r)s.add(t);return s}function $(e,n=_(e)){let s=C(e),a=N(e),r=Array.isArray(a)&&a.includes(u),t=M(e)===!0,o=s||r||t,f=!s&&x(e),d=L(e,n),c=[],E=[];for(let p of n){let P=p.config?.dependsOn??[],g=!1;for(let m of P){if(D(m)){g=!0;continue}d.has(m)||E.push({resource:p.name,name:m})}g&&c.push(p.name)}let T=o||c.length>0,F=o?"feature":c.length>0?"dependsOn":"none";return{featureOn:o,featureOnFromProjectJson:s,featureOnFromTiltfile:r,featureOnFromSpecMaster:t,focusWouldEnableDatabaseManagement:f,dependsOnUsers:c,willStart:T,reason:F,unknownDependsOnNames:E}}export{O as a,$ as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{o as mt,u as ht}from"./chunk-
|
|
2
|
+
import{o as mt,u as ht}from"./chunk-MWOVYIBB.js";import{f as O,g as gt,h as kt,i as St,j as se,k as yt,l as wt,m as xt,n as Pt,o as bt,p as ne,q as vt,s as Dt,t as $t}from"./chunk-IGN5UC3P.js";import{c as ft}from"./chunk-K6SOCO6V.js";import{b as W,c as Ct,d as K}from"./chunk-3J6XI3NX.js";import{a as dt,f as pt,g as te,j as Nt,k as Tt,l as Et,m as Rt,o as Ot,p as be,q as ve,r as _t,s as De,t as $e,u as jt,v as Ce,w as At}from"./chunk-YHYRGWUH.js";import{A as rt,B as we,C as Q,D as ot,E as Z,I as xe,J as it,K as ee,L as at,M as ct,O as lt,P as ut,Q as Pe,a as C,ga as w,t as st,x as nt}from"./chunk-5F7YP5IR.js";import{C as b,D as et,L as tt,b as h,d as v,j as A,m as H,n as G,o as Se,q as ye,x as g,y as Ze}from"./chunk-YNCBBJ4V.js";import{execFileSync as _s}from"node:child_process";import{readFileSync as Jr}from"node:fs";import{join as zr}from"node:path";import{execFileSync as sr,execSync as gs}from"node:child_process";import{existsSync as $,readdirSync as xs,readFileSync as B}from"node:fs";import{join as x,normalize as pe,relative as fe}from"node:path";import{Command as nr}from"commander";import{existsSync as Ms}from"node:fs";var re="docs/agent-hosts.md",Ne=`WebContainers cannot run Flisk: there is no Docker daemon or Tilt. Run \`flisk up\` on a machine with Docker. See ${re}.`,Ft=`Docker is not reachable from this Dev Container. Mount the host Docker socket (-v /var/run/docker.sock:/var/run/docker.sock) or add the docker-outside-of-docker feature to devcontainer.json, then retry. Docker-in-docker is not supported. See ${re}.`;function Hs(){return{env:process.env,versions:process.versions,platform:process.platform,fileExists:Ms}}function It(e=Hs()){let{env:t,versions:s,platform:n,fileExists:r}=e;return s.webcontainer?{kind:"webcontainer",canUp:!1}:t.CODESPACES==="true"?{kind:"codespaces",canUp:!0}:t.REMOTE_CONTAINERS||r("/.dockerenv")&&t.DEVCONTAINER?{kind:"devcontainer",canUp:!0}:n==="win32"?{kind:"native-windows",canUp:t.FLISK_ALLOW_NATIVE_WINDOWS==="1"}:n==="linux"&&t.WSL_DISTRO_NAME?{kind:"wsl2",canUp:!0}:{kind:"local",canUp:!0}}function Lt(e){return e==="devcontainer"||e==="codespaces"}function oe(e){return e.some(t=>st(t.config?.appType)||t.config?.appType==="frontend"||t.config?.appType==="worker")}import{existsSync as Ws,readFileSync as Bs}from"node:fs";import{join as Vs,relative as Mt,resolve as Ht,sep as Us}from"node:path";var Gs=2,Wt=["services/*/*"];function Bt(e){return e.split(Us).filter(Boolean)}function Ks(e,t){let s=0,n=0,r=-1,o=0;for(;n<t.length;)if(s<e.length&&e[s]!=="*"&&(e[s]==="?"||e[s]===t[n]))s++,n++;else if(s<e.length&&e[s]==="*")r=s++,o=n;else if(r!==-1)s=r+1,n=++o;else return!1;for(;s<e.length&&e[s]==="*";)s++;return s===e.length}function qs(e,t){return e.length===t.length&&e.every((s,n)=>Ks(s,t[n]))}function Te(e){let t=Vs(e,".flisk",H);if(!Ws(t))return Wt;try{let s=JSON.parse(Bs(t,"utf-8"))?.discovery?.paths;if(Array.isArray(s)&&s.every(n=>typeof n=="string"))return s}catch{}return Wt}function ie(e,t,s){let n=Bt(Mt(e,Ht(e,t)));return s.some(r=>{let o=Bt(Mt(e,Ht(e,r)));for(let i=0;i<=Gs;i++){let a=n.length-i;if(a>0&&qs(o,n.slice(0,a)))return!0}return!1})}function lo(e,t,s,n){let r=Te(e);if(ie(e,t,r))return{path:t};let o=`services/${s}/${n}`;return ie(e,o,r)?{path:o,adjustedFrom:t}:{path:t}}import{execFile as Js}from"node:child_process";import{promisify as zs}from"node:util";var Xs=zs(Js),Ys=1e4,Qs=5,Vt=10*6e4,Zs=3,en=200,tn=async e=>{let{stdout:t,stderr:s}=await Xs("docker",e,{encoding:"utf-8",timeout:Ys,windowsHide:!0});return`${t}${s}`};function sn(e,t){let s=Nt(t).toLowerCase(),n=e.replace(/-/g,"_").toLowerCase();return n===s||n.startsWith(`${s}_`)}function nn(e,t=Date.now()){if(e.status==="restarting")return!0;if(e.restartCount<Qs)return!1;if(e.status==="running"){let n=Date.parse(e.startedAt);return Number.isNaN(n)||t-n<Vt}let s=Date.parse(e.finishedAt??"");return e.exitCode!==0&&!Number.isNaN(s)&&t-s<Vt}function rn(e,t){let s=/database "([^"]+)" does not exist/i.exec(e);return s?`database "${s[1]}" does not exist: re-run the project's database provisioning (flisk up) or create it`:/Cannot find module|MODULE_NOT_FOUND|module not found/i.test(e)?"a module is missing from the image: rebuild it (flisk up --force) after checking the resource's dependencies":/EADDRINUSE|address already in use/i.test(e)?"the port inside the container is already in use: check for two processes started by the same command":/ECONNREFUSED|connection refused|could not connect/i.test(e)?"a dependency is not reachable: check that the service it connects to is running and healthy":/\b(?:environment variable|env var)\b.*\b(?:missing|not set|required|undefined)\b/i.test(e)||/\b[A-Z][A-Z0-9_]{2,}\b (?:is )?(?:not set|required|missing)\b/.test(e)?"a required environment variable is missing: check the project's .env":t.exitCode===137?"killed (exit 137), usually out of memory: raise the container's memory limit":null}function on(e){let t=[];for(let s of e.split(/\r?\n/)){let[n,r,o,i,a,c]=s.split(" ");!n||r===void 0||t.push({name:n.replace(/^\//,""),restartCount:Number(r)||0,status:o??"",startedAt:i??"",exitCode:Number(a)||0,finishedAt:c??""})}return t}async function Ut(e,t=[],s=tn,n=Date.now()){let r="Crash-looping containers",o;try{o=(await s(["ps","-a","--format",'{{.ID}} {{.Label "com.docker.compose.project"}}'])).split(/\r?\n/).map(m=>m.split(" ")).filter(([m,d])=>m&&d&&sn(d,e)).map(([m])=>m)}catch{return{name:r,didPass:!0,isSkipped:!0,message:"Docker not available - skipped crash-loop check"}}if(o.length===0)return{name:r,didPass:!0,isSkipped:!0,message:"No project containers to check"};let i;try{i=on(await s(["inspect","--format","{{.Name}} {{.RestartCount}} {{.State.Status}} {{.State.StartedAt}} {{.State.ExitCode}} {{.State.FinishedAt}}",...o]))}catch{return{name:r,didPass:!0,isSkipped:!0,message:"Containers changed while checking - skipped crash-loop check"}}let a=i.filter(f=>nn(f,n));if(a.length===0)return{name:r,didPass:!0,message:"No project container is crash-looping"};let c=[],l=new Set;for(let f of a){let m="";try{m=await s(["logs","--tail",String(Zs),f.name])}catch{}let d=Q(m,t).split(/\r?\n/).map(k=>k.trim().slice(0,en)).filter(Boolean),S=rn(m,f);S&&l.add(S),c.push([`${f.name}: ${f.status}, restarted ${f.restartCount} times`,...d.map(k=>` | ${k}`)].join(`
|
|
3
3
|
`))}return{name:r,didPass:!1,message:`${a.length} container${a.length===1?" is":"s are"} crash-looping:
|
|
4
4
|
${c.join(`
|
|
5
5
|
`)}`,fix:[...l,"Read the full log: docker logs <container>"].join("; ")}}import{execFile as yn,execFileSync as wn}from"node:child_process";import{existsSync as xn,realpathSync as Xt,statfsSync as Pn}from"node:fs";import{homedir as bn}from"node:os";import{join as vn}from"node:path";import{promisify as Dn}from"node:util";import{statfsSync as an}from"node:fs";import{homedir as cn}from"node:os";var ae="Disk Space",ln=1024**3,un=2,Ee=10,Gt=["Free disk space, then retry: flisk doctor"," docker system prune -af # unused images and build cache (needs Docker running)"," npm cache clean --force"," bun pm cache rm"," brew cleanup -s"].join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{f as A}from"./chunk-
|
|
2
|
+
import{f as A}from"./chunk-YNCBBJ4V.js";var o=[A,"proxy"];export{o as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{N as q,b as f,e as G,h as xe,i as Ee,m as ke,n as we,r as z,u as ve,v as be,x as T}from"./chunk-
|
|
2
|
+
import{N as q,b as f,e as G,h as xe,i as Ee,m as ke,n as we,r as z,u as ve,v as be,x as T}from"./chunk-YNCBBJ4V.js";import st,{existsSync as O,readdirSync as nn,readFileSync as rn,statSync as ce}from"node:fs";import{dirname as on,join as w}from"node:path";var j=class{data;options;constructor(t){this.data=new Map,this.options=t}has(t){let n=this.data.get(t);return n?Date.now()-n.timestamp>this.options.ttlMs?(this.data.delete(t),!1):!0:!1}get(t){if(this.has(t))return this.data.get(t)?.value}set(t,n){this.data.set(t,{value:n,timestamp:Date.now()})}delete(t){this.data.delete(t)}clear(){this.data.clear()}keys(){let t=[];for(let n of this.data.keys())this.has(n)&&t.push(n);return t}size(){return this.keys().length}};function Te(e){let t=0;return{isValid(){return Date.now()-t<e},markUpdated(){t=Date.now()},reset(){t=0}}}function ct(e,t,n){return e===1?t:n||`${t}s`}function Re(e,t,n){return`${e} ${ct(e,t,n)}`}var ut={month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"};function Sn(e){return new Date(e).toLocaleString("en-US",ut)}function yn(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"})}var K={success:{color:"green",icon:"\u2713",chalkFn:f.green},error:{color:"red",icon:"\u2717",chalkFn:f.red},warning:{color:"yellow",icon:"\u25CB",chalkFn:f.yellow},unknown:{color:"gray",icon:"?",chalkFn:f.gray}};function H(e){if(!e)return"unknown";let t=e.toLowerCase();return t==="ready"||t==="healthy"||t==="active"||t==="running"?"success":t==="error"||t==="failed"||t==="critical"||t==="stopped"?"error":t==="pending"||t==="starting"||t==="building"||t==="degraded"?"warning":"unknown"}function $n(e){return K[H(e)].color}function xn(e){return K[H(e)].icon}function En(e,t){return K[H(t)].chalkFn(e)}var ft={resources:{singular:"resource",command:"flisk resource <name>",context:`
|
|
3
3
|
To create a resource:`},stacks:{singular:"stack",command:"flisk stack <stack-name>",context:`
|
|
4
4
|
To create a stack, use:`},services:{singular:"service",command:"flisk resource <name>",context:`
|
|
5
5
|
To create a service:`},"stack-services":{singular:"service",command:"flisk resource <name> --stack <stack-name>",context:`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{E as C,t as $}from"./chunk-
|
|
2
|
+
import{E as C,t as $}from"./chunk-YNCBBJ4V.js";var g=class extends Error{kind;constructor(i,a){super(i),this.kind=a,this.name="TiltEventsLoadError"}};function m(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)?n:null}var w="\x1B",k="\x07",I=new RegExp(`${w}(?:\\[[0-?]*[ -/]*[@-~]|\\][^${k}${w}]*(?:${k}|${w}\\\\)?|[@-Z\\\\-_])`,"g"),O=new RegExp("[\\u0000-\\u0008\\u000b-\\u001f\\u007f-\\u009f]","g");function U(n){return n.replace(I,"").replace(O,"")}function r(n){return typeof n!="string"?void 0:U(n).trim()||void 0}function _(n){return Array.isArray(n)?n.flatMap(i=>{let a=r(i);return a?[a]:[]}):[]}function L(n){let i=m(n);if(!i||!Array.isArray(i.items))throw new Error("Tilt returned an invalid UIResource list");let a=[],e=[];for(let s of i.items){let u=m(s),N=m(u?.metadata),t=r(N?.name);if(!u||!t)continue;let c=m(u.status);a.push({name:t,runtimeStatus:r(c?.runtimeStatus),updateStatus:r(c?.updateStatus),hasPendingChanges:typeof c?.hasPendingChanges=="boolean"?c.hasPendingChanges:void 0});let x=Array.isArray(c?.buildHistory)?c.buildHistory:[];for(let[d,A]of x.entries()){let o=m(A);if(!o)continue;let f=r(o.error),l=_(o.warnings),p=[f,...l].filter(S=>!!S),h=r(o.spanID);e.push({id:`${t}:build:${h??String(d)}`,resourceName:t,kind:f?"failed":l.length?"warning":"success",title:f?"Build failed":l.length?"Build completed with warnings":"Build completed",occurredAt:r(o.finishTime)??r(o.startTime),details:p.length?p.join("; "):void 0})}let T=m(c?.currentBuild);T&&e.push({id:`${t}:current-build`,resourceName:t,kind:"running",title:"Build in progress",occurredAt:r(T.startTime)});let b=r(c?.pendingBuildSince);!T&&(c?.queued===!0||b)&&e.push({id:`${t}:queued`,resourceName:t,kind:"warning",title:"Update queued",occurredAt:b});let y=r(c?.lastDeployTime),E=y?Date.parse(y):Number.NaN,R=e.some(d=>d.resourceName===t&&d.kind==="success"&&d.occurredAt!==void 0&&Date.parse(d.occurredAt)===E);y&&!R&&e.push({id:`${t}:last-deploy`,resourceName:t,kind:"success",title:"Last deployed",occurredAt:y});let B=Array.isArray(c?.conditions)?c.conditions:[];for(let[d,A]of B.entries()){let o=m(A);if(!o)continue;let f=r(o.type),l=r(o.status),p=r(o.reason),h=r(o.message);if(!f&&!p&&!h||l==="True"&&!p&&!h)continue;let S=[p,h].filter(D=>!!D).join(": ");e.push({id:`${t}:condition:${d}:${f??"status"}`,resourceName:t,kind:l==="False"?"warning":"status",title:`Condition ${f??"status"}${l?`: ${l}`:""}`,occurredAt:r(o.lastTransitionTime),details:S||void 0})}}return e.sort((s,u)=>{if(s.kind==="running"&&u.kind!=="running")return-1;if(u.kind==="running"&&s.kind!=="running")return 1;let N=s.occurredAt?Date.parse(s.occurredAt):Number.NaN,t=u.occurredAt?Date.parse(u.occurredAt):Number.NaN;return Number.isNaN(N)?Number.isNaN(t)?s.resourceName.localeCompare(u.resourceName):1:Number.isNaN(t)?-1:t-N}),{resources:a,events:e}}async function q(){let n=process.env.TILT_PORT??String($.tiltUi),i;try{i=await C("get",["uiresources","-o","json","--port",n],{inheritStdio:!1,timeoutMs:1e4})}catch(e){let s=e instanceof Error?e.message:String(e),u=/ENOENT|not found|no such file|connection refused|failed to connect|could not connect|unable to connect|Tilt is not running/i.test(s)?"unavailable":"error";throw new g(s,u)}if(i.exitCode!==0){let e=i.stderr.trim()||`tilt get exited with code ${i.exitCode}`,s=/connection refused|failed to connect|could not connect|unable to connect|Tilt is not running|no running Tilt/i.test(e)?"unavailable":"error";throw new g(e,s)}let a;try{a=JSON.parse(i.stdout)}catch{throw new g("Tilt returned invalid UIResource JSON","error")}try{return L(a)}catch(e){throw new g(e instanceof Error?e.message:"Tilt returned an invalid UIResource list","error")}}export{g as a,U as b,q as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{b}from"./chunk-MINZ25AC.js";import{g as m,r as T}from"./chunk-
|
|
2
|
+
import{b}from"./chunk-MINZ25AC.js";import{g as m,r as T}from"./chunk-YHYRGWUH.js";import{a as S}from"./chunk-3XODDLRJ.js";import{F as k,H as $,ea as x,p as y,q as w}from"./chunk-5F7YP5IR.js";import{b as n,f as d,m as g,x as h}from"./chunk-YNCBBJ4V.js";import{Command as R}from"commander";import{readFileSync as N}from"node:fs";import{join as O}from"node:path";function F(o){let e=o.config;return e?Array.isArray(e.featuresEnabled)&&e.featuresEnabled.includes(d)?!0:(Array.isArray(e.dependsOn)?e.dependsOn:[]).some(a=>S.includes(a)):!1}function J(o,e){let s=o.replace(/-/g,"_"),a=[];for(let t of[...e].sort((r,c)=>r.name.localeCompare(c.name))){let r=t.resources.filter(F).map(c=>c.name);r.length!==0&&a.push({name:`${s}_${t.name.replace(/-/g,"_")}`,stack:t.name,services:r.sort()})}return a.length===0?null:{name:"postgres",databases:a}}function E(o){try{let e=JSON.parse(N(O(o,".flisk",g),"utf-8"));return typeof e?.project?.name=="string"?e.project.name:null}catch{return null}}var P=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function A(o){let e=process.stderr,s=e.isTTY===!0,a=0,t=o,r,c=()=>e.write(`\r\x1B[2K${n.cyan(P[a])} ${t}`);s?(c(),r=setInterval(()=>{a=(a+1)%P.length,c()},80)):e.write(`- ${t}
|
|
3
3
|
`);let l=(i,u)=>{r&&clearInterval(r),e.write(`${s?"\r\x1B[2K":""}${i} ${u??t}
|
|
4
4
|
`)};return{get text(){return t},set text(i){t=i,s||e.write(`- ${t}
|
|
5
5
|
`)},succeed:i=>l(n.green("\u2714"),i),fail:i=>l(n.red("\u2716"),i),warn:i=>l(n.yellow("\u26A0"),i)}}async function j(o){let{resources:e}=x(o),s=await m(o,{inspectDocker:!1}),{appBase:a}=k(s?.ingressHttp,o);return e.filter(t=>t.config?.appType==="frontend").map(t=>({name:t.name,url:`${a}${$(t)}`}))}async function v(o,e=2e3){try{return(await fetch(o,{signal:AbortSignal.timeout(e)})).status<500}catch{return!1}}async function D(o,e=3e4,s){if(o.length===0)return;let a=Date.now();for(;;){for(let r of o)if(await v(r.url))return r;let t=Date.now()-a;if(t>=e)return;s?.(t),await new Promise(r=>setTimeout(r,2e3))}}async function te(o,e=0,s){let a=await j(o);return D(a,e,s)}async function C(o){let e=o??h();if(!e)return console.log(n.yellow("Not in a Flisk project, so there is no frontend to open.")),console.log(n.gray("Run `flisk project --yes` first, or `flisk open` inside a project.")),null;let s=await j(e);if(s.length===0)return console.log(n.yellow("This project has no frontend service to open.")),console.log(n.gray("Start the stack with `flisk up` and add a frontend with `flisk resource`.")),null;let a=E(e);y(`Opening the first frontend of ${a??"this project"}`);for(let l of s)console.log(n.gray(` - ${l.name}: ${l.url}`));let t=A("Waiting for the frontend to answer..."),r=await D(s,12e4,l=>{t.text=`Waiting for the frontend to answer... ${Math.round(l/1e3)}s`});if(!r){t.fail("No frontend answered yet.");let i=(await m(e,{inspectDocker:!1}))?.ingressHttp,u=i?await T(i)==="in-use":!1;if(i&&!u){console.log(n.yellow(`The stack is running, but this machine cannot reach port ${i}.`)),console.log(n.gray(" Docker is not publishing the port to the host."));let{checkColima:f}=await import("./colima-GBURKN54.js"),p=f();p.isColima&&!p.running?(console.log(n.gray(` ${p.problem??"The Colima VM is not running"}`)),console.log(n.gray(` Fix: ${p.fix??"colima start"}`))):console.log(n.gray(" Restart the Docker runtime (Docker Desktop or Colima), then run `flisk open` again."))}else console.log(n.yellow("The stack is not serving the frontend yet.")),console.log(n.gray(" - Start the stack in another terminal: flisk up")),console.log(n.gray(" - Then run this again: flisk open"));for(let f of s)console.log(n.gray(` - ${f.name}: ${f.url}`));return null}t.succeed(`The frontend is up: ${r.name}`);let c=await b(r.url);return console.log(c?n.green(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{a as C}from"./chunk-YL56J2WX.js";import{b as N,c as de,d as V,o as D,p as Y,t as J,u as L,w as O}from"./chunk-
|
|
2
|
+
import{a as C}from"./chunk-YL56J2WX.js";import{b as N,c as de,d as V,o as D,p as Y,t as J,u as L,w as O}from"./chunk-MWOVYIBB.js";import{$ as ie,ea as ae,fa as se,h as T,ha as ce,i as B,ja as le,ka as fe,la as pe,o as h,p as b,q as t,x as re,y as G,z as W}from"./chunk-5F7YP5IR.js";import{N as U,P as z,R as E,b as g,f as x,m as M,o as P,x as F}from"./chunk-YNCBBJ4V.js";import{execFileSync as Se}from"node:child_process";import{cpSync as je,existsSync as S,readdirSync as _e,readFileSync as K,writeFileSync as we}from"node:fs";import{basename as xe,dirname as Pe,isAbsolute as Ee,join as _,resolve as q}from"node:path";import{cwd as he}from"node:process";import{fileURLToPath as Oe}from"node:url";import{Command as Ce}from"commander";var ve="-y, --yes",ye="Skip prompts and confirmations; use defaults";function ue(e,o=ye){return e.option(ve,o,!1)}async function be(e,o=!0){let l=await L({message:e,initial:o});return l||T(),l}function Le(e,o=1){e.valid||E(e.error??"Validation failed",o)}function Ie(e,o,l,s){return e.dryRun?(s?s():(console.log(`Dry run - ${o}`),console.log(`Would run: ${l}`)),!0):!1}async function qe(e,o){return await be(e,!0)?!0:(o&&o(),!1)}var I=new Map;function me(e){e!==void 0?I.delete(e):I.clear()}function Be(e=!1){let o=F(),l=o??"";if(!e){let p=I.get(l);if(p)return p}let{resources:s,problems:f}=o?ae(o):{resources:ce(),problems:[]},u=pe(s),n=fe(s);se(f);let r=s.filter(p=>!p.stack),d=new Map;for(let p of s)if(p.stack){let a=d.get(p.stack)||[];a.push(p),d.set(p.stack,a)}let m={resources:s,problems:f,stacks:u,stackNames:n,unassignedResources:r,resourcesByStack:d};return I.set(l,m),m}var A={proxy:{name:"proxy",description:"Traefik reverse proxy and API gateway for routing all services",category:"core",phase:"pre_alpha",enabled_by_default:!0,dependsOn:[]},verdaccio:{name:"verdaccio",description:"Verdaccio npm registry for package management and local publishing (Premium - requires FLISK_LICENSE_KEY)",category:"premium",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[]},[x]:{name:x,description:"PostgreSQL database for data persistence and SQL operations",category:"core",phase:"pre_alpha",enabled_by_default:!0,dependsOn:[]},monitoring:{name:"monitoring",description:"SigNoz or SkyWalking observability platform for monitoring and tracing",category:"optional",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[x]},elk:{name:"elk",description:"Elasticsearch, Logstash, Kibana stack for log aggregation and analysis",category:"optional",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[]},debezium:{name:"debezium",description:"Change Data Capture for real-time data streaming from databases",category:"optional",phase:"pre_alpha",enabled_by_default:!1,dependsOn:[x]},"golden-image":{name:"golden-image",description:"Pre-built Docker image layer for faster builds and smaller deployments",category:"optional",phase:"pre_alpha",enabled_by_default:!0,dependsOn:[]}};function H(e,o){try{return le(e,o)}catch{return[]}}function Ae(e){return new Set([...e.phases.pre_alpha.enabledStacks,...e.phases.alpha.enabledStacks,...e.phases.beta.enabledStacks,...e.phases.out_of_scope.enabledStacks])}function Q(e,o){let l=Ae(e),s=o.filter(f=>!l.has(f));return s.length===0?(e.phases.pre_alpha.enabledStacks=Array.from(new Set(e.phases.pre_alpha.enabledStacks)),[]):(e.phases.pre_alpha.enabledStacks=Array.from(new Set([...e.phases.pre_alpha.enabledStacks,...s])),s)}function gt(e,o){let l=_(e,".flisk",M);if(!S(l))return[];let s=D(e),f=Q(s,H(e,o));return f.length>0&&N(l,s),f}function $e(){return Object.values(A).filter(e=>e.enabled_by_default&&e.category==="core").map(e=>e.name)}function Re(e,o){return o||(C[e]?.repo.split("/").pop()??e).replace(/\.git$/,"")}function ge(e){return e.split(`
|
|
3
3
|
`).map(l=>l.trim()).filter(Boolean).pop()??"unknown error"}async function Fe(e,o,l,s={}){let f=C[e];if(!f){console.log(g.red(`
|
|
4
4
|
\u274C Unknown template: "${e}"`)),console.log(g.yellow(`
|
|
5
5
|
Available templates:`));for(let[r,d]of Object.entries(C))console.log(` ${g.cyan(r)} ${g.gray(`- ${d.description}`)}`);console.log(g.gray("\nOr run `flisk project` with no template for a blank project.")),process.exit(1)}let u=Re(e,o);ie(u)||U.invalidPath(u).exit();let n=Ee(u)?u:q(he(),u);S(n)&&_e(n).length>0&&U.directoryExists(n).exit(),s.quiet||(B(`Cloning template: ${e}`),t(`${f.description}
|
|
@@ -7,7 +7,7 @@ Available templates:`));for(let[r,d]of Object.entries(C))console.log(` ${g.cyan
|
|
|
7
7
|
`,0));try{if(f.bundledPath){let r=q(Pe(Oe(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");je(q(r,f.bundledPath),n,{recursive:!0});let d=xe(n).replace(/-/g,"_");for(let m of["services/platform/messaging/docker-compose.yml","services/shop/orders-api/service.json","services/shop/orders-api/src/index.ts","services/shop/orders-worker/service.json","services/shop/orders-worker/src/index.ts"]){let p=_(n,m),a=K(p,"utf-8");we(p,a.replaceAll("flisk_example",d))}}else Se("git",["clone",f.repo,n],{stdio:["ignore","pipe","pipe"],encoding:"utf-8"})}catch(r){let d=r instanceof Error?r.message:String(r),m=f.bundledPath?`Bundled example copy failed (${ge(d)}). Reinstall the Flisk CLI package and try again.`:`git clone failed: ${ge(d)}. Check you have git installed and network access.`;if(s.quiet)throw new Error(m);E(m)}if(me(),!s.quiet){console.log(g.green(`
|
|
8
8
|
\u2705 Cloned "${e}" into ${u}/`)),t(`
|
|
9
9
|
Next steps:`,0),t(`1. cd ${u}`),t("2. flisk doctor # check Docker/Tilt are ready"),t("3. flisk up # start the stack"),t(`
|
|
10
|
-
Runtime readiness:`,0);for(let r of l)t(r,0)}}var $={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:$e()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},ht=ue(new Ce("project")).description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(C).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--config-file <path>","Load project config from existing JSON file").option("-q, --quiet","Only print what fails; used by `flisk demo`",!1).action(async(e,o)=>{let{assertMachineReadyOrExit:l,detectRuntimePrerequisites:s,formatRuntimeNextSteps:f}=await import("./cold-preflight-
|
|
10
|
+
Runtime readiness:`,0);for(let r of l)t(r,0)}}var $={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:$e()},alpha:{name:"Alpha",description:"Essential business services",enabledStacks:[]},beta:{name:"Beta",description:"Extended features",enabledStacks:[]},out_of_scope:{name:"Out of Scope",description:"Future releases",enabledStacks:[]}},optional_infra:{monitoring:!1,elk:!1,debezium:!1,golden_image:!0,verdaccio:!1},discovery:{paths:["services/*/*"]},overrides:{}},ht=ue(new Ce("project")).description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(C).join(", ")})`).option("--path <dir>","Directory to clone the template into (default: the template's repo name)").option("--check","Check if master configs exist and are in sync").option("--force","Overwrite existing configuration (dangerous)").option("--config-file <path>","Load project config from existing JSON file").option("-q, --quiet","Only print what fails; used by `flisk demo`",!1).action(async(e,o)=>{let{assertMachineReadyOrExit:l,detectRuntimePrerequisites:s,formatRuntimeNextSteps:f}=await import("./cold-preflight-ZOPR7PWJ.js");await l({scope:"scaffold"});let u=f(s()),n=!!o.quiet;if(e){await z(async()=>Fe(e,o.path,u,{quiet:n}));return}await z(async()=>{let r=F();r||(r=he(),n||(b(`\u{1F680} Initializing new Flisk project...
|
|
11
11
|
`),t(`Location: ${r}
|
|
12
12
|
`,0)));let d=_(r,".flisk"),m=_(d,M);if(o.check){let c=P.every(k=>S(_(r,".flisk",".flisk-out",k))),v=S(m);if(c&&v){let k=D(r);h("Project configuration is valid"),t(`Project: ${k.project.name}`,3),t(`Phases: ${Object.keys(k.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(g.yellow("\u26A0\uFE0F Project configuration incomplete:")),v||t(".flisk/project.json (not found)",3),!c)for(let k of P.filter(j=>!S(_(r,".flisk/.flisk-out",j))))t(`.flisk/.flisk-out/${k} (not found)`,3);t("Run `flisk project` to create them."),process.exit(1)}}n||(B("Project Configuration"),t(`Project root: ${r}
|
|
13
13
|
`,0)),S(d)||(de(d),n||h("Created: .flisk/ directory"));let p=S(m);if(p&&!o.force){n||h(".flisk/project.json exists");let c=JSON.parse(K(m,"utf-8")),v=D(r),k=H(r),j=Q(v,k);if((j.length>0||!c.phases)&&N(m,v),j.length>0&&!n&&t(`Auto-enabled discovered service stacks: ${j.join(", ")}`,0),n||b(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{r as c}from"./chunk-
|
|
2
|
+
import{r as c}from"./chunk-IGN5UC3P.js";import{execFileSync as u}from"node:child_process";import{realpathSync as l}from"node:fs";import{resolve as p}from"node:path";var m=(o,t)=>u(o,t,{encoding:"utf-8",stdio:"pipe",timeout:5e3,windowsHide:!0});function a(o,t=process.platform,e=m){if(t==="win32")return null;try{let s=e("lsof",["-nP",`-iTCP:${o}`,"-sTCP:LISTEN","-t"]).split(/\r?\n/).map(r=>r.trim()).filter(Boolean);for(let r of s){let n=e("ps",["-p",r,"-o","command="]).trim(),[i]=c(`${r} ${n}`);if(i)return i}}catch{}return null}function f(o){try{return l(o)}catch{return p(o)}}function d(o,t){return o!==null&&f(o.root)!==f(t)}async function P(o,t,e,s=a){let r={running:[],foreign:[]};for(let n of o){if(!await e(n))continue;let i=s(n);i&&d(i,t)?r.foreign.push({port:n,root:i.root}):r.running.push(n)}return r}export{a,d as b,P as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{b as N}from"./chunk-
|
|
2
|
+
import{b as N}from"./chunk-3XODDLRJ.js";import{a as m,ga as f,t as T}from"./chunk-5F7YP5IR.js";import{C as M,L as O,e as $,f as C,i as U,j as E,m as F,n as P,x as u}from"./chunk-YNCBBJ4V.js";import{execFileSync as de,execSync as le}from"node:child_process";import{existsSync as R,readdirSync as V,readFileSync as y}from"node:fs";import{basename as ue,dirname as me,join as l,relative as k}from"node:path";function Oe(t){return I(t,!1)}function Ne(t){return I(t,!0)}function I(t,e){return`import { Hono } from 'hono';
|
|
3
3
|
${e?`import { sql } from 'drizzle-orm';
|
|
4
4
|
import { db } from './db.js';
|
|
5
5
|
`:""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{c as se,e as ie}from"./chunk-K6SOCO6V.js";import{a as oe}from"./chunk-
|
|
2
|
+
import{c as se,e as ie}from"./chunk-K6SOCO6V.js";import{a as oe}from"./chunk-53L2JN7G.js";import{T as te,U as ne,ca as K,ga as re,u as G}from"./chunk-5F7YP5IR.js";import{b as Q,f as w,g as k,i as Z,j as I,k as C,l as U,m as ee,n as F,s as u,t as M}from"./chunk-YNCBBJ4V.js";import{a as O}from"./chunk-KJZUBHLO.js";import{appendFileSync as Te,existsSync as H,mkdirSync as _e,readFileSync as be,writeFileSync as ae}from"node:fs";import{dirname as ve,resolve as x}from"node:path";function _t(t,e,n){for(let[r,s]of e.entries())console.log(Q.blue(`${s.emoji} ${s.description}...`)),s.type==="json"?xe(t,s.filename,s.content):Ie(t,s.filename,String(s.content)),n&&n(s,r,e.length)}function we(t,e,n=2){let r=`${JSON.stringify(e,null,n)}
|
|
3
3
|
`;ae(t,r,"utf-8")}function xe(t,e,n,r=2){let s=x(t,e);we(s,n,r)}function q(t,e){ae(t,e,"utf-8")}function Ie(t,e,n){let r=x(t,e);q(r,n)}function bt(t){H(t)||_e(t,{recursive:!0})}var Fe=[".env",".flisk/.flisk-out/",".flisk/.project-id",".flisk/smoke/","node_modules/"];function Re(t){let e=x(t,".gitignore"),n=H(e)?be(e,"utf-8"):"",r=new Set(n.split(`
|
|
4
4
|
`).map(d=>d.trim().replace(/\/$/,""))),s=Fe.filter(d=>!r.has(d.replace(/\/$/,"")));if(s.length===0)return[];let l=n&&!n.endsWith(`
|
|
5
5
|
`)?`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{E as x,a as h,ga as j,ha as D,t as _}from"./chunk-
|
|
2
|
+
import{E as x,a as h,ga as j,ha as D,t as _}from"./chunk-5F7YP5IR.js";import{C as L,j as N,m as w,n as A,t as F,x as T}from"./chunk-YNCBBJ4V.js";import{execFileSync as B}from"node:child_process";import{existsSync as de,mkdirSync as le,readFileSync as K,realpathSync as fe,writeFileSync as pe}from"node:fs";import{join as b,resolve as he,sep as me}from"node:path";import{createServer as ie}from"node:net";import{connect as oe}from"node:net";function U(e,t=500){return new Promise(r=>{let s=oe({port:e,host:"127.0.0.1"}),n=o=>{s.destroy(),r(o)};s.setTimeout(t,()=>n(!1)),s.once("connect",()=>n(!0)),s.once("error",()=>n(!1))})}var ae={ingressHttp:{start:8080,end:8180},ingressHttps:{start:8443,end:8543},postgres:{start:15432,end:15532}},v={ingressHttp:"FLISK_HTTP_PORT",ingressHttps:"FLISK_HTTPS_PORT",postgres:"FLISK_POSTGRES_PORT"},H={ingressHttp:80,ingressHttps:443,postgres:5432},E={ingressHttp:H.ingressHttp,ingressHttps:H.ingressHttps};function ce(e,t){return e==="EACCES"&&t==="darwin"}async function O(e){return await U(e)?!1:new Promise(t=>{let r=ie();r.once("error",s=>{t(ce(s.code,process.platform))}),r.listen(e,"127.0.0.1",()=>r.close(()=>t(!0)))})}function ue(e,t){let r=Number(t);if(!Number.isInteger(r)||r<1||r>65535)throw new Error(`${e} must be an integer between 1 and 65535 (received ${JSON.stringify(t)})`);return r}async function R(e={}){let t=e.env??process.env,r=e.isAvailable??O,s={ingressHttp:!1,ingressHttps:!1,postgres:!1},n={ingressHttp:"",ingressHttps:"",postgres:""},o={explicit:s},a=new Set;for(let c of["ingressHttp","ingressHttps","postgres"]){let u=t[v[c]],i=u!==void 0&&u.trim()!=="",d=e.ranges?.[c]??ae[c],l=E[c],f=i?[ue(v[c],u)]:[...l===void 0?[]:[l],...Array.from({length:d.end-d.start+1},(g,k)=>d.start+k)],m;for(let g of f)if(!a.has(g)){if(await r(g)){m=g;break}if(i)throw new Error(`${v[c]}=${g} is already in use. Choose a free host port and retry.`)}if(m===void 0)throw new Error(`No available host port in ${d.start}-${d.end} for ${c}. Set ${v[c]} to a free port and retry.`);a.add(m),o[c]=m,s[c]=i,n[c]=i?"explicit override":m===l?"requested port is free":`selected from fallback range ${d.start}-${d.end}`}return{...o,requested:{...H},reason:n}}function Ve(e){return`Host ports: HTTP ${e.ingressHttp}, HTTPS ${e.ingressHttps}, Postgres ${e.postgres}`}var G=b(".flisk",".flisk-out","host-ports.json");function ge(e,t,r){return e.split(`
|
|
3
3
|
`).some(s=>{let[n="",o=""]=s.split("|"),a=n.toLowerCase(),c=t.toLowerCase();return(a.startsWith(`${c}_`)||a.startsWith(`${c}-`))&&o.includes(`:${r}->`)})}function V(e){let t=b(e,G);if(!de(t))return null;try{let r=JSON.parse(K(t,"utf-8"));if(!r||typeof r!="object")return null;let s=r;return!Number.isInteger(s.ingressHttp)||!Number.isInteger(s.ingressHttps)||!Number.isInteger(s.postgres)||!s.requested||!s.explicit||!s.reason?null:s}catch{return null}}function Ye(e,t){let r=b(e,G);le(b(e,".flisk",".flisk-out"),{recursive:!0}),pe(r,`${JSON.stringify(t,null,2)}
|
|
4
4
|
`,{encoding:"utf-8",mode:384})}function Qe(e){process.env.FLISK_HTTP_PORT=String(e.ingressHttp),process.env.FLISK_HTTPS_PORT=String(e.ingressHttps),process.env.FLISK_POSTGRES_PORT=String(e.postgres)}var ke="com.docker.compose.project.working_dir";function Pe(e,t,r){let s=new Set([he(t)]);try{s.add(fe(t))}catch{}return e.split(`
|
|
5
5
|
`).some(n=>{let[,o="",a=""]=n.split("|");return!a||!o.includes(`:${r}->`)?!1:[...s].some(c=>a===c||a.startsWith(`${c}${me}`))})}function Xe(e,t,r=()=>B("docker",["ps","--format",`{{.Names}}|{{.Ports}}|{{.Label "${ke}"}}`],{encoding:"utf-8",timeout:5e3})){let s=V(e);if(!s||s.ingressHttp===t)return t;try{if(Pe(r(),e,s.ingressHttp))return s.ingressHttp}catch{}return t}async function et(e,t={}){let r=V(e),s=["FLISK_HTTP_PORT","FLISK_HTTPS_PORT","FLISK_POSTGRES_PORT"].some(i=>process.env[i]);if(t.inspectDocker===!1&&r&&!s)return r;let n="";try{let i=JSON.parse(K(b(e,".flisk",w),"utf-8"));n=String(i?.project?.name??"flisk-project").replace(/-/g,"_").toLowerCase()}catch{n="flisk_project"}let o="";if(t.inspectDocker!==!1)try{o=B("docker",["ps","--format","{{.Names}}|{{.Ports}}"],{encoding:"utf-8",timeout:5e3})}catch{}let a=i=>ge(o,n,i),c=t.isPortFree??O,u=async i=>await c(i)||a(i);if(r&&!s){for(let i of[r.ingressHttp,r.ingressHttps,r.postgres])if(!await u(i))return R({isAvailable:u});for(let[i,d]of Object.entries(E)){let l=r[i];if(d!==void 0&&l!==d&&await u(d))return R({isAvailable:u})}return r}return R({isAvailable:u})}import{execFileSync as Q,execSync as S}from"node:child_process";import{existsSync as I,readdirSync as Se,readFileSync as C}from"node:fs";import{createServer as Te}from"node:net";import{join as P}from"node:path";function W(e,t){return e==="pending"||e==="in_progress"||e==="none"||t==="pending"||t==="none"}var J="container is running, but its health check is failing";function M(e){let t=e?.runtimeStatus??"";if(t!=="ok")return t;let r=e?.composeResourceInfo?.healthStatus;return r==="unhealthy"?"error":r==="starting"?"pending":t}var y=1e4,z=3e3,be="http://localhost:4873";function X(e){return`'${e.replace(/'/g,"'\\''")}'`}function $(e,t,r,s,n){return process.platform==="win32"&&e===S?Q(L(t)??t,r,{...n,windowsHide:!0}):e(s,n)}var ye=[80,443];function $e(e){return e.replace(/-/g,"_")}function we(e,t){let r=new Set(t),s=[];for(let n of e.split(`
|
|
@@ -3,7 +3,7 @@ function G(e,t,r){let o=e.indexOf(t);if(o===-1)return e;let n=t.length,s=0,i="";
|
|
|
3
3
|
`:`
|
|
4
4
|
`)+r,n=o+1,o=e.indexOf(`
|
|
5
5
|
`,n)}while(o!==-1);return s+=e.slice(n),s}var Y=(e=0)=>t=>`\x1B[${t+e}m`,S=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,I=(e=0)=>(t,r,o)=>`\x1B[${38+e};2;${t};${r};${o}m`,he=e=>`\x1B[58;5;${e<90?e-30:e-90+8}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],underlineDouble:["4:2",24],underlineCurly:["4:3",24],underlineDotted:["4:4",24],underlineDashed:["4:5",24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},underlineColor:{underlineBlack:["58;5;0",59],underlineRed:["58;5;1",59],underlineGreen:["58;5;2",59],underlineYellow:["58;5;3",59],underlineBlue:["58;5;4",59],underlineMagenta:["58;5;5",59],underlineCyan:["58;5;6",59],underlineWhite:["58;5;7",59],underlineBlackBright:["58;5;8",59],underlineGray:["58;5;8",59],underlineGrey:["58;5;8",59],underlineRedBright:["58;5;9",59],underlineGreenBright:["58;5;10",59],underlineYellowBright:["58;5;11",59],underlineBlueBright:["58;5;12",59],underlineMagentaBright:["58;5;13",59],underlineCyanBright:["58;5;14",59],underlineWhiteBright:["58;5;15",59]}},K=Object.keys(l.modifier),_=Object.keys(l.color),N=Object.keys(l.bgColor),ge=Object.keys(l.underlineColor),H=[..._,...N];function be(){let e=new Map;for(let[t,r]of Object.entries(l)){for(let[o,n]of Object.entries(r))l[o]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[o]=l[o],e.set(Number.parseInt(n[0],10),n[1]);Object.defineProperty(l,t,{value:r,enumerable:!1})}return Object.defineProperty(l,"codes",{value:e,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.underlineColor.close="\x1B[59m",l.color.ansi=Y(),l.color.ansi256=S(),l.color.ansi16m=I(),l.bgColor.ansi=Y(10),l.bgColor.ansi256=S(10),l.bgColor.ansi16m=I(10),l.underlineColor.ansi=he,l.underlineColor.ansi256=S(20),l.underlineColor.ansi16m=I(20),Object.defineProperties(l,{rgbToAnsi256:{value(t,r,o){return t===r&&r===o?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(o/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[\da-f]{6}|[\da-f]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[o]=r;o.length===3&&(o=[...o].map(s=>s+s).join(""));let n=Number.parseInt(o,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>l.rgbToAnsi256(...l.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,o,n;if(t>=232)r=((t-232)*10+8)/255,o=r,n=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,o=Math.floor(a/6)/5,n=a%6/5}let s=Math.max(r,o,n)*2;if(s===0)return 30;let i=30+(Math.round(n)<<2|Math.round(o)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(t,r,o)=>l.ansi256ToAnsi(l.rgbToAnsi256(t,r,o)),enumerable:!1},hexToAnsi:{value:t=>l.ansi256ToAnsi(l.hexToAnsi256(t)),enumerable:!1}}),l}var xe=be(),m=xe;import j from"node:process";import Ee from"node:os";import W from"node:tty";function d(e,t=globalThis.Deno?globalThis.Deno.args:j.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",o=t.indexOf(r+e),n=t.indexOf("--");return o!==-1&&(n===-1||o<n)}var{env:c}=j,R;d("no-color")||d("no-colors")||d("color=false")||d("color=never")?R=0:(d("color")||d("colors")||d("color=true")||d("color=always"))&&(R=1);function z(){return/^\d+$/.test(c.FORCE_COLOR)}function Te(){if("FORCE_COLOR"in c){if(c.FORCE_COLOR==="false")return 0;if(c.FORCE_COLOR==="true"||c.FORCE_COLOR.length===0)return 1;if(z())return Math.min(Number.parseInt(c.FORCE_COLOR,10),3)}}function Ce(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Re(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let o=Te();o!==void 0&&(R=o);let n=r?R:o;if(n===0)return 0;if(r){if(d("color=16m")||d("color=full")||d("color=truecolor"))return 3;if(d("color=256"))return 2}if(n!==void 0&&z())return n;if("TF_BUILD"in c&&"AGENT_NAME"in c)return 1;if(e&&!t&&n===void 0)return 0;let s=n||0;if(c.TERM==="dumb")return s;if(j.platform==="win32"){let i=Ee.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in c)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(i=>i in c)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in c)||c.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in c)return/^(?:9\.0*[1-9]\d*\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0;if(c.COLORTERM==="truecolor"||c.TERM==="xterm-kitty"||c.TERM==="xterm-ghostty"||c.TERM==="wezterm")return 3;if("TERM_PROGRAM"in c){let i=Number.parseInt((c.TERM_PROGRAM_VERSION||"").split(".",1)[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(?:color)?$/i.test(c.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)||"COLORTERM"in c?1:s}function J(e,t={}){let r=Re(e,{streamIsTTY:e&&e.isTTY,...t});return Ce(r)}var ke={stdout:J({isTTY:W.isatty(1)}),stderr:J({isTTY:W.isatty(2)})},X=ke;var{stdout:q,stderr:Q}=X,b=Symbol("GENERATOR"),x=Symbol("STYLER"),y=Symbol("IS_EMPTY"),k=Symbol("LEVEL"),E=Object.create(null),Z=e=>{if(!Number.isSafeInteger(e)||e<0||e>3)throw new Error("The `level` should be an integer from 0 to 3")},ye={enumerable:!0,get(){return this[k]},set(e){Z(e),this[k]=e}},Oe=(e,t={})=>{t.level!==void 0&&Z(t.level);let r=q?q.level:0;e[k]=t.level===void 0?r:t.level};var ve=e=>{let t=(...r)=>r.join(" ");return Oe(t,e),Object.setPrototypeOf(t,T.prototype),t};function T(e){return ve(e)}Object.setPrototypeOf(T.prototype,Function.prototype);for(let[e,t]of Object.entries(m))E[e]={get(){let r=M(this,ee(t.open,t.close,this[x]),this[y]);return Object.defineProperty(this,e,{value:r}),r}};E.visible={get(){let e=M(this,this[x],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Ae=(e,t)=>{let r=m[t];if(e==="rgb"){let n=(i,a,u)=>r.ansi(m.rgbToAnsi(i,a,u));return[n,n,(i,a,u)=>r.ansi256(m.rgbToAnsi256(i,a,u)),r.ansi16m]}if(e==="hex"){let n=i=>r.ansi(m.hexToAnsi(i));return[n,n,i=>r.ansi256(m.hexToAnsi256(i)),i=>r.ansi16m(...m.hexToRgb(i))]}let o=n=>r.ansi(m.ansi256ToAnsi(n));return[o,o,r.ansi256,r.ansi256]},we=["rgb","hex","ansi256"];for(let e of we){let t=e[0].toUpperCase()+e.slice(1);for(let[r,o]of[[e,"color"],["bg"+t,"bgColor"],["underline"+t,"underlineColor"]]){let{close:n}=m[o],s=Ae(e,o);E[r]={get(){let i=function(a,u,f){let me=s[this.level](a,u,f);return M(this,ee(me,n,this[x]),this[y])};return Object.defineProperty(this,r,{value:i}),i}}}}var Se=Object.defineProperties(()=>{},{...E,level:{enumerable:!0,get(){return this[b].level},set(e){this[b].level=e}}}),ee=(e,t,r)=>{let o,n;return r===void 0?(o=e,n=t):(o=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:o,closeAll:n,parent:r}},M=(e,t,r)=>{let o=(...n)=>n.length===1?F(o,""+n[0]):n.length===2?F(o,`${n[0]??""} ${n[1]??""}`):F(o,n.join(" "));return Object.setPrototypeOf(o,Se),o[b]=e[b]??e,o[x]=t,o[y]=r,o},F=(e,t)=>{if(e[b][k]<=0||!t)return e[y]?"":t;let r=e[x];if(r===void 0)return t;let{openAll:o,closeAll:n}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=G(t,r.close,r.open),r=r.parent;let s=t.indexOf(`
|
|
6
|
-
`);return s!==-1&&(t=V(t,n,o,s)),o+t+n};Object.defineProperties(T.prototype,{...E,level:ye});var Ie=T(),ut=T({level:Q?Q.level:0});var h=Ie;var te={name:"flisk-cli-internal",private:!0,version:"1.4.1",description:"Flisk CLI \u2014 start services on your machine.",keywords:["flisk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/flisk-sh/flisk#readme",bugs:{url:"https://github.com/flisk-sh/flisk/issues"},repository:{type:"git",url:"git+https://github.com/flisk-sh/flisk.git",directory:"cli"},license:"MIT",author:"Flisk Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{flisk:"bin/flisk.js"},files:["dist","dist-bundle","bin","templates","README.md","Tiltfile","engine","discovery","specs","ext","!ext/ide-components/code_executor","shared-platform-engineering/docker-templates"],scripts:{build:"tsc && node scripts/bundle.mjs","build:watch":"tsc --watch","check:dist":"npm run build && ../scripts/check-cli-dist.sh",lint:"biome check . ../tests/generated ../tests/runtime-layout","lint:fix":"biome check . ../tests/generated ../tests/runtime-layout --write",typecheck:"tsc --project tsconfig.typecheck.json",clean:"rm -rf dist",dev:"bun run build:watch",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage --coverage.reportOnFailure --coverage.reporter=text --coverage.reporter=html --coverage.reporter=json-summary --coverage.reporter=json --coverage.reportsDirectory=coverage --reporter=default --reporter=json --outputFile.json=test-results/vitest.json",prepack:"../scripts/stage-npm-engine.sh && npm run build"},dependencies:{commander:"^15.0.0",handlebars:"^4.7.8"},devDependencies:{"@biomejs/biome":"^2.5.13","@types/node":"^26.6.5","@types/react":"^19.3.0","@vitest/coverage-v8":"5.0.5",ajv:"^8.17.1",chalk:"^6.0.1",esbuild:"^0.28.2",ink:"^8.0.0",knip:"^6.38.0",react:"^19.3.0","react-devtools-core":"^8.0.0",typescript:"^7.0.2",vite:"^8.3.3",vitest:"5.0.5"},engines:{node:">=22.12.0"}};var mt="Container Runtime",P="bring-your-own";var ht="database-management",gt=".tiltignore",bt="service.json",Ne="docker-compose.yml",xt=".autogenerated",je="TILT_TECH_STACK.star",Fe="TILT_RESOURCE_DEFAULTS.star",re="project.json",Et="package.json",Tt=[je,Fe,"spec.master"],Ct=["backend","frontend","library","sdk","worker","migrator","mcp","agent",P],Rt={backend:["dev","build","start"],worker:["dev","build","start"],migrator:["dev","build","start"],mcp:["dev","build","start"],agent:["dev","build","start"],frontend:["dev","build"],library:["dev","build"],sdk:["dev","build"],[P]:[]};var kt=["monitoring","elk","debezium","golden_image","verdaccio"],yt={frontend:{base:3e3,min:3e3,max:3999,range:"3000-3999"},backend:{base:4e3,min:4e3,max:4999,range:"4000-4999"},mcp:{base:4e3,min:4e3,max:5999,range:"4000-5999"},agent:{base:4e3,min:4e3,max:5999,range:"4000-5999"},[P]:{base:4e3,min:4e3,max:5999,range:"4000-5999"},worker:{base:6e3,min:6e3,max:6999,range:"6000-6999"},health:{base:5e3,min:5e3,max:5999,range:"5000-5999"},migrator:{base:7e3,min:7e3,max:7999,range:"7000-7999"}},Ot={tiltUi:10350,traefik:8080},B="https://flisk.sh/docs/quickstart/";var vt=["node_modules",".git",".tilt",".tilt-engine","dist","build",".prisma",".turbo","coverage","tmp","temp","__tests__","test","tests",".github",".vscode","docs"],At=["Dockerfile",Ne,"docker-compose.yaml","Tiltfile","vite.config.ts","tsconfig.json","tsconfig.build.json"],Me={infra:"\u{1F3D7}\uFE0F",core:"\u{1F527}",api:"\u26A1",app:"\u{1F3A8}",orchestrator:"\u2699\uFE0F"};function wt(e){let t=e.toLowerCase();for(let[r,o]of Object.entries(Me))if(t.includes(r))return o;return"\u{1F4E6}"}import{existsSync as Pe}from"node:fs";import{dirname as Be,join as De,resolve as oe}from"node:path";import{cwd as Le}from"node:process";function v(e=Le()){let t=oe(e),r=oe("/");for(;t!==r;){if(Pe(De(t,".flisk",re)))return t;let o=Be(t);if(o===t)break;t=o}return null}var O=null;function $e(){if(O)return O;let e=te;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return O={name:String(t.name??"@flisk-sh/flisk"),version:String(t.version??"0.0.0"),fullPackage:t},O}function Mt(){return $e().version}import{existsSync as ne}from"node:fs";import{delimiter as se,extname as ie,join as le}from"node:path";import{delimiter as Dt,extname as Ue}from"node:path";function C(){return process.platform==="win32"}function Ge(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Ve(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Ye(e,t){let r=Ge(e),o=Ve(t);if(!r||!o||r==="windows"&&o!=="amd64")return null;let n=`tdk-${r}-${o}`;return r==="windows"?`${n}.exe`:n}function Lt(){return Ye(process.platform,process.arch)}function $t(){return C()?"flisk.exe":"flisk"}function D(e,t=C()){return t?Ue(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function A(e){let t=process.env.PATH??process.env.Path??"",r=C(),o=D(e,r);if(r&&!ie(e))for(let n of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let s=n.toLowerCase();s&&!o.includes(`${e}${s}`)&&o.push(`${e}${s}`)}for(let n of t.split(se))if(n)for(let s of o){let i=le(n,s);if(ne(i))return i}return null}function Kt(e){let t=process.env.PATH??process.env.Path??"",r=C(),o=D(e,r);if(r&&!ie(e))for(let i of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let a=i.toLowerCase();a&&!o.includes(`${e}${a}`)&&o.push(`${e}${a}`)}let n=[],s=new Set;for(let i of t.split(se))if(i)for(let a of o){let u=le(i,a);if(!ne(u))continue;let f=r?u.toLowerCase():u;s.has(f)||(s.add(f),n.push(u))}return n}import{execFileSync as Ke,execSync as He}from"node:child_process";var ce=1e4;function ae(){let e=!1;if(process.platform==="win32")try{return Ke(A("docker")??"docker",["ps"],{stdio:"ignore",timeout:ce,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return He(t,{stdio:"ignore",timeout:ce}),"running"}catch(r){r.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function w(e,t){return e[t]??0}function We(e,t){let r=Array.from({length:t.length+1},(o,n)=>n);for(let o=1;o<=e.length;o++){let n=[o];for(let s=1;s<=t.length;s++){let i=e[o-1]===t[s-1]?0:1;n[s]=Math.min(w(n,s-1)+1,w(r,s)+1,w(r,s-1)+i)}r=n}return w(r,t.length)}function Je(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length-1;r++)if(e[r]!==t[r]&&e[r]===t[r+1]&&e[r+1]===t[r]&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+2)===t.slice(r+2))return!0;return!1}function ue(e,t){if(e.length<2||t.length===0||t.includes(e))return;let r=e.toLowerCase(),o,n=Number.POSITIVE_INFINITY;for(let s of t){if(s.length===0)continue;let i=s.toLowerCase(),a=Je(r,i)?1:We(r,i),u=Math.max(1,Math.min(2,Math.floor(Math.max(r.length,i.length)/3)));a>u||(a<n||a===n&&(o===void 0||s<o))&&(o=s,n=a)}return o}import{spawn as ze}from"node:child_process";import{join as Xe}from"node:path";function qe(e,t=[],r={}){return new Promise((o,n)=>{let s=[e,...t];r.verbose&&console.log(`Executing: tilt ${s.join(" ")}`);let i=ze(A("tilt")??"tilt",s,{stdio:r.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:r.timeoutMs}),a="",u="";r.inheritStdio||(i.stdout?.on("data",f=>{a+=f.toString()}),i.stderr?.on("data",f=>{u+=f.toString()})),i.on("close",f=>{o({exitCode:f??1,stdout:a,stderr:u})}),i.on("error",f=>{n(new Error(`Failed to spawn tilt: ${f.message}`))})})}async function fe(){try{return(await qe("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Qe(){let e=v();if(!e)throw g.notInProject();return Xe(e,".flisk",".flisk-out","Tiltfile")}function de(e){let t=Qe();e.push("-f",t)}function rr(e,t={}){let r=[];return de(r),t.focusTargets&&t.focusTargets.length>0&&r.push("--",`--focus=${t.focusTargets.join(",")}`),r.push(...e),t.verbose&&!t.quiet&&r.push("--verbose"),t.watch&&r.push("--watch"),r}function or(e={}){let t=[];return de(t),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function pe(e){return e instanceof Error?e.message:String(e)}function fr(e,t){if(process.env.FLISK_VERBOSE){let r=t!==void 0?`: ${pe(t)}`:"";console.warn(h.gray(`${e}${r}`))}}var p=class extends Error{suggestions;exitCode;constructor(t,r=[],o=1){super(t),this.name="FliskError",this.suggestions=r,this.exitCode=o}display(){U(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}},$=class extends Error{code;constructor(t=1){super(`process.exit(${t})`),this.name="ProcessExitError",this.code=t}};function L(e,t,r=!1){let o=new Set;for(let n of e){let s=ue(n,t);s&&o.add(r?`Did you mean "${s}" for "${n}"?`:`Did you mean "${s}"?`)}return[...o]}var g={tiltNotInstalled:()=>new p("Tilt CLI is not installed",["Install Tilt: `brew install tilt` (macOS)","Or download from: https://docs.tilt.dev/install.html","Verify with: `tilt version`",`Setup guide: ${B}`]),dockerNotAvailable:()=>new p("Docker (or a compatible container runtime) is not running",["Start Docker Desktop, then verify with: `docker ps`","Or start Colima: `colima start`","Or start the Docker service on Linux: `sudo systemctl start docker`",`Setup guide: ${B}`]),dockerNotResponding:()=>new p("Docker is running but not responding (`docker ps` hung for 10s)",["Quit and reopen Docker Desktop, or run `colima restart`","Then verify with: `docker ps`"]),stackNotFound:(e,t=[])=>new p(`Stack "${e}" not found`,[...L([e],t),"Run `flisk stacks` to see available stacks","Run `flisk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new p(`Resource "${e}" not found`,[...L([e],t),"Run `flisk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let r=L(e,t,e.length>1);return new p(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,r,2)},directoryExists:e=>new p(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new p(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new p("Could not find project root (no .flisk/project.json found)",["Run this from within a Flisk project","Run `flisk project --yes` to initialize a new project"])};function dr(){let e=v();return e||g.notInProject().exit()}function Ze(e){e instanceof p&&e.exit(),U(pe(e)),process.exit(1)}async function et(e,t){try{return await e()}catch(r){if(r instanceof $)throw r;return t?.verbose&&r instanceof Error&&r.stack&&console.error(h.gray(r.stack)),Ze(r)}}async function pr(e,t){let r=[],o=ae();return o==="unresponsive"?r.push(g.dockerNotResponding()):o==="missing"&&r.push(g.dockerNotAvailable()),await fe()||r.push(g.tiltNotInstalled()),r.length>0&&(console.error(h.red(`
|
|
6
|
+
`);return s!==-1&&(t=V(t,n,o,s)),o+t+n};Object.defineProperties(T.prototype,{...E,level:ye});var Ie=T(),ut=T({level:Q?Q.level:0});var h=Ie;var te={name:"flisk-cli-internal",private:!0,version:"1.4.2",description:"Flisk CLI \u2014 start services on your machine.",keywords:["flisk","tilt","cli","local-dev","microservices"],homepage:"https://github.com/flisk-sh/flisk#readme",bugs:{url:"https://github.com/flisk-sh/flisk/issues"},repository:{type:"git",url:"git+https://github.com/flisk-sh/flisk.git",directory:"cli"},license:"MIT",author:"Flisk Team",type:"module",main:"./dist/index.js",types:"./dist/index.d.ts",bin:{flisk:"bin/flisk.js"},files:["dist","dist-bundle","bin","templates","README.md","Tiltfile","engine","discovery","specs","ext","!ext/ide-components/code_executor","shared-platform-engineering/docker-templates"],scripts:{build:"tsc && node scripts/bundle.mjs","build:watch":"tsc --watch","check:dist":"npm run build && ../scripts/check-cli-dist.sh",lint:"biome check . ../tests/generated ../tests/runtime-layout","lint:fix":"biome check . ../tests/generated ../tests/runtime-layout --write",typecheck:"tsc --project tsconfig.typecheck.json",clean:"rm -rf dist",dev:"bun run build:watch",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage --coverage.reportOnFailure --coverage.reporter=text --coverage.reporter=html --coverage.reporter=json-summary --coverage.reporter=json --coverage.reportsDirectory=coverage --reporter=default --reporter=json --outputFile.json=test-results/vitest.json",prepack:"../scripts/stage-npm-engine.sh && npm run build"},dependencies:{commander:"^15.0.0",handlebars:"^4.7.8"},devDependencies:{"@biomejs/biome":"^2.5.13","@types/node":"^26.6.5","@types/react":"^19.3.0","@vitest/coverage-v8":"5.0.5",ajv:"^8.17.1",chalk:"^6.0.1",esbuild:"^0.28.2",ink:"^8.0.0",knip:"^6.38.0",react:"^19.3.0","react-devtools-core":"^8.0.0",typescript:"^7.0.2",vite:"^8.3.3",vitest:"5.0.5"},engines:{node:">=22.12.0"}};var mt="Container Runtime",P="bring-your-own";var ht="database-management",gt=".tiltignore",bt="service.json",Ne="docker-compose.yml",xt=".autogenerated",je="TILT_TECH_STACK.star",Fe="TILT_RESOURCE_DEFAULTS.star",re="project.json",Et="package.json",Tt=[je,Fe,"spec.master"],Ct=["backend","frontend","library","sdk","worker","migrator","mcp","agent",P],Rt={backend:["dev","build","start"],worker:["dev","build","start"],migrator:["dev","build","start"],mcp:["dev","build","start"],agent:["dev","build","start"],frontend:["dev","build"],library:["dev","build"],sdk:["dev","build"],[P]:[]};var kt=["monitoring","elk","debezium","golden_image","verdaccio"],yt={frontend:{base:3e3,min:3e3,max:3999,range:"3000-3999"},backend:{base:4e3,min:4e3,max:4999,range:"4000-4999"},mcp:{base:4e3,min:4e3,max:5999,range:"4000-5999"},agent:{base:4e3,min:4e3,max:5999,range:"4000-5999"},[P]:{base:4e3,min:4e3,max:5999,range:"4000-5999"},worker:{base:6e3,min:6e3,max:6999,range:"6000-6999"},health:{base:5e3,min:5e3,max:5999,range:"5000-5999"},migrator:{base:7e3,min:7e3,max:7999,range:"7000-7999"}},Ot={tiltUi:10350,traefik:8080},B="https://flisk.sh/docs/quickstart/";var vt=["node_modules",".git",".tilt",".tilt-engine","dist","build",".prisma",".turbo","coverage","tmp","temp","__tests__","test","tests",".github",".vscode","docs"],At=["Dockerfile",Ne,"docker-compose.yaml","Tiltfile","vite.config.ts","tsconfig.json","tsconfig.build.json"],Me={infra:"\u{1F3D7}\uFE0F",core:"\u{1F527}",api:"\u26A1",app:"\u{1F3A8}",orchestrator:"\u2699\uFE0F"};function wt(e){let t=e.toLowerCase();for(let[r,o]of Object.entries(Me))if(t.includes(r))return o;return"\u{1F4E6}"}import{existsSync as Pe}from"node:fs";import{dirname as Be,join as De,resolve as oe}from"node:path";import{cwd as Le}from"node:process";function v(e=Le()){let t=oe(e),r=oe("/");for(;t!==r;){if(Pe(De(t,".flisk",re)))return t;let o=Be(t);if(o===t)break;t=o}return null}var O=null;function $e(){if(O)return O;let e=te;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return O={name:String(t.name??"@flisk-sh/flisk"),version:String(t.version??"0.0.0"),fullPackage:t},O}function Mt(){return $e().version}import{existsSync as ne}from"node:fs";import{delimiter as se,extname as ie,join as le}from"node:path";import{delimiter as Dt,extname as Ue}from"node:path";function C(){return process.platform==="win32"}function Ge(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Ve(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Ye(e,t){let r=Ge(e),o=Ve(t);if(!r||!o||r==="windows"&&o!=="amd64")return null;let n=`tdk-${r}-${o}`;return r==="windows"?`${n}.exe`:n}function Lt(){return Ye(process.platform,process.arch)}function $t(){return C()?"flisk.exe":"flisk"}function D(e,t=C()){return t?Ue(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function A(e){let t=process.env.PATH??process.env.Path??"",r=C(),o=D(e,r);if(r&&!ie(e))for(let n of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let s=n.toLowerCase();s&&!o.includes(`${e}${s}`)&&o.push(`${e}${s}`)}for(let n of t.split(se))if(n)for(let s of o){let i=le(n,s);if(ne(i))return i}return null}function Kt(e){let t=process.env.PATH??process.env.Path??"",r=C(),o=D(e,r);if(r&&!ie(e))for(let i of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let a=i.toLowerCase();a&&!o.includes(`${e}${a}`)&&o.push(`${e}${a}`)}let n=[],s=new Set;for(let i of t.split(se))if(i)for(let a of o){let u=le(i,a);if(!ne(u))continue;let f=r?u.toLowerCase():u;s.has(f)||(s.add(f),n.push(u))}return n}import{execFileSync as Ke,execSync as He}from"node:child_process";var ce=1e4;function ae(){let e=!1;if(process.platform==="win32")try{return Ke(A("docker")??"docker",["ps"],{stdio:"ignore",timeout:ce,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return He(t,{stdio:"ignore",timeout:ce}),"running"}catch(r){r.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function w(e,t){return e[t]??0}function We(e,t){let r=Array.from({length:t.length+1},(o,n)=>n);for(let o=1;o<=e.length;o++){let n=[o];for(let s=1;s<=t.length;s++){let i=e[o-1]===t[s-1]?0:1;n[s]=Math.min(w(n,s-1)+1,w(r,s)+1,w(r,s-1)+i)}r=n}return w(r,t.length)}function Je(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length-1;r++)if(e[r]!==t[r]&&e[r]===t[r+1]&&e[r+1]===t[r]&&e.slice(0,r)===t.slice(0,r)&&e.slice(r+2)===t.slice(r+2))return!0;return!1}function ue(e,t){if(e.length<2||t.length===0||t.includes(e))return;let r=e.toLowerCase(),o,n=Number.POSITIVE_INFINITY;for(let s of t){if(s.length===0)continue;let i=s.toLowerCase(),a=Je(r,i)?1:We(r,i),u=Math.max(1,Math.min(2,Math.floor(Math.max(r.length,i.length)/3)));a>u||(a<n||a===n&&(o===void 0||s<o))&&(o=s,n=a)}return o}import{spawn as ze}from"node:child_process";import{join as Xe}from"node:path";function qe(e,t=[],r={}){return new Promise((o,n)=>{let s=[e,...t];r.verbose&&console.log(`Executing: tilt ${s.join(" ")}`);let i=ze(A("tilt")??"tilt",s,{stdio:r.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:r.timeoutMs}),a="",u="";r.inheritStdio||(i.stdout?.on("data",f=>{a+=f.toString()}),i.stderr?.on("data",f=>{u+=f.toString()})),i.on("close",f=>{o({exitCode:f??1,stdout:a,stderr:u})}),i.on("error",f=>{n(new Error(`Failed to spawn tilt: ${f.message}`))})})}async function fe(){try{return(await qe("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Qe(){let e=v();if(!e)throw g.notInProject();return Xe(e,".flisk",".flisk-out","Tiltfile")}function de(e){let t=Qe();e.push("-f",t)}function rr(e,t={}){let r=[];return de(r),t.focusTargets&&t.focusTargets.length>0&&r.push("--",`--focus=${t.focusTargets.join(",")}`),r.push(...e),t.verbose&&!t.quiet&&r.push("--verbose"),t.watch&&r.push("--watch"),r}function or(e={}){let t=[];return de(t),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function pe(e){return e instanceof Error?e.message:String(e)}function fr(e,t){if(process.env.FLISK_VERBOSE){let r=t!==void 0?`: ${pe(t)}`:"";console.warn(h.gray(`${e}${r}`))}}var p=class extends Error{suggestions;exitCode;constructor(t,r=[],o=1){super(t),this.name="FliskError",this.suggestions=r,this.exitCode=o}display(){U(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}},$=class extends Error{code;constructor(t=1){super(`process.exit(${t})`),this.name="ProcessExitError",this.code=t}};function L(e,t,r=!1){let o=new Set;for(let n of e){let s=ue(n,t);s&&o.add(r?`Did you mean "${s}" for "${n}"?`:`Did you mean "${s}"?`)}return[...o]}var g={tiltNotInstalled:()=>new p("Tilt CLI is not installed",["Install Tilt: `brew install tilt` (macOS)","Or download from: https://docs.tilt.dev/install.html","Verify with: `tilt version`",`Setup guide: ${B}`]),dockerNotAvailable:()=>new p("Docker (or a compatible container runtime) is not running",["Start Docker Desktop, then verify with: `docker ps`","Or start Colima: `colima start`","Or start the Docker service on Linux: `sudo systemctl start docker`",`Setup guide: ${B}`]),dockerNotResponding:()=>new p("Docker is running but not responding (`docker ps` hung for 10s)",["Quit and reopen Docker Desktop, or run `colima restart`","Then verify with: `docker ps`"]),stackNotFound:(e,t=[])=>new p(`Stack "${e}" not found`,[...L([e],t),"Run `flisk stacks` to see available stacks","Run `flisk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new p(`Resource "${e}" not found`,[...L([e],t),"Run `flisk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let r=L(e,t,e.length>1);return new p(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,r,2)},directoryExists:e=>new p(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new p(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new p("Could not find project root (no .flisk/project.json found)",["Run this from within a Flisk project","Run `flisk project --yes` to initialize a new project"])};function dr(){let e=v();return e||g.notInProject().exit()}function Ze(e){e instanceof p&&e.exit(),U(pe(e)),process.exit(1)}async function et(e,t){try{return await e()}catch(r){if(r instanceof $)throw r;return t?.verbose&&r instanceof Error&&r.stack&&console.error(h.gray(r.stack)),Ze(r)}}async function pr(e,t){let r=[],o=ae();return o==="unresponsive"?r.push(g.dockerNotResponding()):o==="missing"&&r.push(g.dockerNotAvailable()),await fe()||r.push(g.tiltNotInstalled()),r.length>0&&(console.error(h.red(`
|
|
7
7
|
Flisk can't start - missing prerequisites:
|
|
8
8
|
`)),r.forEach((n,s)=>{s>0&&console.error(""),n.display()}),console.error(h.gray("\nRun `flisk doctor` for a full environment check.")),process.exit(1)),et(e,t)}function mr(e,t=1,r){U(e,void 0,r),process.exit(t)}function U(e,t,r){if(console.error(h.red(`\u274C ${e}`)),t&&console.error(h.gray(` ${t}`)),r&&r.length>0){console.error(h.yellow(`
|
|
9
9
|
\u{1F4A1} Suggestions:`));for(let o of r)console.error(h.cyan(` \u2192 ${o}`))}}function hr(e,t){console.error(h.red(`
|
package/cli/dist-bundle/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
3
|
-
import{a as Fu,b as Ti,c as eA,d as zf,e as Sr,f as pm,g as eN,j as tN}from"./chunk-SRN64OPO.js";import{b as iN}from"./chunk-XD3BBFZB.js";import{c as lN}from"./chunk-7IXBBU27.js";import{a as nN,b as oN,c as aN}from"./chunk-KJOCVAMQ.js";import{a as Y2,b as K2,c as Jf,i as X2}from"./chunk-M2R464RM.js";import{b as q2,c as V2}from"./chunk-MINZ25AC.js";import{b as Z2}from"./chunk-YL56J2WX.js";import{C as $2,D as W2,a as En,b as nS,c as xo,d as T2,e as w2,f as b2,g as x2,h as U2,i as O2,j as M2,k as H2,l as G2,m as k2,n as Ff,o as WI,p as L2,q as aS,r as z2,s as j2,t as F2,u as J2,v as iS,w as P2}from"./chunk-L6U555CJ.js";import{a as YI,b as KI,e as d2,f as m2,g as p2,h as E2,i as h2,j as C2,k as B2,l as I2,m as y2,n as Q2,o as Ju,p as qI,q as S2,r as v2,s as VI,t as mm,u as oS,v as XI,w as D2}from"./chunk-7HR5PVOD.js";import{a as Qh,b as s2,c as dm,d as u2,e as JI,h as N2}from"./chunk-UJXR6MZ2.js";import{a as c2,c as f2,d as g2}from"./chunk-K6SOCO6V.js";import"./chunk-3J6XI3NX.js";import{a as i2,b as l2,c as FI,d as A2,e as r2,g as gm,h as ZI,i as PI,l as jf,m as _2,n as $I}from"./chunk-DUNCELUK.js";import{b as R2}from"./chunk-RX6O3PG4.js";import"./chunk-TZNXL3IO.js";import{$ as ZR,A as LR,B as zR,C as PQ,D as $Q,F as HI,G as WQ,H as GI,J as eS,L as jR,N as FR,O as JR,P as YR,Q as Tl,R as yh,S as KR,V as qR,W as VR,X as kI,Y as um,Z as XR,_ as LI,a as qn,aa as PR,b as xR,ba as $R,c as UR,ca as WR,d as Bh,e as rm,ea as zI,f as OR,fa as jI,g as Ih,ga as e2,h as qQ,ha as cm,i as OI,ia as t2,j as MI,k as _I,l as VQ,la as Lf,m as MR,ma as tS,n as sm,na as fm,o as XQ,oa as n2,p as ju,pa as o2,q as Vn,qa as a2,r as _R,s as HR,t as _A,v as GR,w as ZQ,y as kR}from"./chunk-VRESY4NR.js";import{A as DR,B as Am,C as UA,D as RR,E as OA,F as zu,G as NR,H as TR,I as wR,J as ys,K as ci,L as st,M as bR,N as An,O as Aa,P as Mn,Q as xI,R as Ya,S as MA,T as UI,a as yR,b as D,c as Gf,e as Wl,h as kf,j as hh,k as QR,l as SR,m as KQ,n as im,o as lm,p as Ch,s as bI,t as xA,w as vR,x as Dn,y as Nl,z as Is}from"./chunk-BB5BZ37Y.js";import{a as YQ,b as Ko,c as uM,d as ct}from"./chunk-KJZUBHLO.js";var qT=Ko(py=>{"use strict";var zH=Symbol.for("react.transitional.element"),jH=Symbol.for("react.fragment");function KT(n,i,A){var u=null;if(A!==void 0&&(u=""+A),i.key!==void 0&&(u=""+i.key),"key"in i){A={};for(var g in i)g!=="key"&&(A[g]=i[g])}else A=i;return i=A.ref,{$$typeof:zH,type:n,key:u,ref:i!==void 0?i:null,props:A}}py.Fragment=jH;py.jsx=KT;py.jsxs=KT});var lw=Ko(Ut=>{"use strict";var bS=Symbol.for("react.transitional.element"),FH=Symbol.for("react.portal"),JH=Symbol.for("react.fragment"),YH=Symbol.for("react.strict_mode"),KH=Symbol.for("react.profiler"),qH=Symbol.for("react.consumer"),VH=Symbol.for("react.context"),XH=Symbol.for("react.forward_ref"),ZH=Symbol.for("react.suspense"),PH=Symbol.for("react.memo"),$T=Symbol.for("react.lazy"),$H=Symbol.for("react.activity"),WH=Symbol.for("react.view_transition"),VT=Symbol.iterator;function e4(n){return n===null||typeof n!="object"?null:(n=VT&&n[VT]||n["@@iterator"],typeof n=="function"?n:null)}var WT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ew=Object.assign,tw={};function vm(n,i,A){this.props=n,this.context=i,this.refs=tw,this.updater=A||WT}vm.prototype.isReactComponent={};vm.prototype.setState=function(n,i){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,i,"setState")};vm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function nw(){}nw.prototype=vm.prototype;function xS(n,i,A){this.props=n,this.context=i,this.refs=tw,this.updater=A||WT}var US=xS.prototype=new nw;US.constructor=xS;ew(US,vm.prototype);US.isPureReactComponent=!0;var XT=Array.isArray;function wS(){}var Wn={H:null,A:null,T:null,S:null},ow=Object.prototype.hasOwnProperty;function OS(n,i,A){var u=A.ref;return{$$typeof:bS,type:n,key:i,ref:u!==void 0?u:null,props:A}}function t4(n,i){return OS(n.type,i,n.props)}function MS(n){return typeof n=="object"&&n!==null&&n.$$typeof===bS}function n4(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return i[A]})}var ZT=/\/+/g;function TS(n,i){return typeof n=="object"&&n!==null&&n.key!=null?n4(""+n.key):i.toString(36)}function o4(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(wS,wS):(n.status="pending",n.then(function(i){n.status==="pending"&&(n.status="fulfilled",n.value=i)},function(i){n.status==="pending"&&(n.status="rejected",n.reason=i)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Sm(n,i,A,u,g){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var h=!1;if(n===null)h=!0;else switch(p){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case bS:case FH:h=!0;break;case $T:return h=n._init,Sm(h(n._payload),i,A,u,g)}}if(h)return g=g(n),h=u===""?"."+TS(n,0):u,XT(g)?(A="",h!=null&&(A=h.replace(ZT,"$&/")+"/"),Sm(g,i,A,"",function(Q){return Q})):g!=null&&(MS(g)&&(g=t4(g,A+(g.key==null||n&&n.key===g.key?"":(""+g.key).replace(ZT,"$&/")+"/")+h)),i.push(g)),1;h=0;var C=u===""?".":u+":";if(XT(n))for(var I=0;I<n.length;I++)u=n[I],p=C+TS(u,I),h+=Sm(u,i,A,p,g);else if(I=e4(n),typeof I=="function")for(n=I.call(n),I=0;!(u=n.next()).done;)u=u.value,p=C+TS(u,I++),h+=Sm(u,i,A,p,g);else if(p==="object"){if(typeof n.then=="function")return Sm(o4(n),i,A,u,g);throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return h}function Ey(n,i,A){if(n==null)return n;var u=[],g=0;return Sm(n,u,"","",function(p){return i.call(A,p,g++)}),u}function a4(n){if(n._status===-1){var i=n._result,A=i();A.then(function(u){(n._status===0||n._status===-1)&&(n._status=1,n._result=u,A.status===void 0&&(A.status="fulfilled",A.value=u))},function(u){(n._status===0||n._status===-1)&&(n._status=2,n._result=u,A.status===void 0&&(A.status="rejected",A.reason=u))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var PT=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function aw(n){var i=Wn.T,A={};A.types=i!==null?i.types:null,Wn.T=A;try{var u=n(),g=Wn.S;g!==null&&g(A,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&u.then(wS,PT)}catch(p){PT(p)}finally{i!==null&&A.types!==null&&(i.types=A.types),Wn.T=i}}function iw(n){var i=Wn.T;if(i!==null){var A=i.types;A===null?i.types=[n]:A.indexOf(n)===-1&&A.push(n)}else aw(iw.bind(null,n))}var i4={map:Ey,forEach:function(n,i,A){Ey(n,function(){i.apply(this,arguments)},A)},count:function(n){var i=0;return Ey(n,function(){i++}),i},toArray:function(n){return Ey(n,function(i){return i})||[]},only:function(n){if(!MS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Ut.Activity=$H;Ut.Children=i4;Ut.Component=vm;Ut.Fragment=JH;Ut.Profiler=KH;Ut.PureComponent=xS;Ut.StrictMode=YH;Ut.Suspense=ZH;Ut.ViewTransition=WH;Ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Wn;Ut.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Wn.H.useMemoCache(n)}};Ut.addTransitionType=iw;Ut.cache=function(n){return function(){return n.apply(null,arguments)}};Ut.cacheSignal=function(){return null};Ut.cloneElement=function(n,i,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var u=ew({},n.props),g=n.key;if(i!=null)for(p in i.key!==void 0&&(g=""+i.key),i)!ow.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(u[p]=i[p]);var p=arguments.length-2;if(p===1)u.children=A;else if(1<p){for(var h=Array(p),C=0;C<p;C++)h[C]=arguments[C+2];u.children=h}return OS(n.type,g,u)};Ut.createContext=function(n){return n={$$typeof:VH,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:qH,_context:n},n};Ut.createElement=function(n,i,A){var u,g={},p=null;if(i!=null)for(u in i.key!==void 0&&(p=""+i.key),i)ow.call(i,u)&&u!=="key"&&u!=="__self"&&u!=="__source"&&(g[u]=i[u]);var h=arguments.length-2;if(h===1)g.children=A;else if(1<h){for(var C=Array(h),I=0;I<h;I++)C[I]=arguments[I+2];g.children=C}if(n&&n.defaultProps)for(u in h=n.defaultProps,h)g[u]===void 0&&(g[u]=h[u]);return OS(n,p,g)};Ut.createRef=function(){return{current:null}};Ut.forwardRef=function(n){return{$$typeof:XH,render:n}};Ut.isValidElement=MS;Ut.lazy=function(n){return{$$typeof:$T,_payload:{_status:-1,_result:n},_init:a4}};Ut.memo=function(n,i){return{$$typeof:PH,type:n,compare:i===void 0?null:i}};Ut.startTransition=aw;Ut.unstable_useCacheRefresh=function(){return Wn.H.useCacheRefresh()};Ut.use=function(n){return Wn.H.use(n)};Ut.useActionState=function(n,i,A){return Wn.H.useActionState(n,i,A)};Ut.useCallback=function(n,i){return Wn.H.useCallback(n,i)};Ut.useContext=function(n){return Wn.H.useContext(n)};Ut.useDebugValue=function(){};Ut.useDeferredValue=function(n,i){return Wn.H.useDeferredValue(n,i)};Ut.useEffect=function(n,i){return Wn.H.useEffect(n,i)};Ut.useEffectEvent=function(n){return Wn.H.useEffectEvent(n)};Ut.useId=function(){return Wn.H.useId()};Ut.useImperativeHandle=function(n,i,A){return Wn.H.useImperativeHandle(n,i,A)};Ut.useInsertionEffect=function(n,i){return Wn.H.useInsertionEffect(n,i)};Ut.useLayoutEffect=function(n,i){return Wn.H.useLayoutEffect(n,i)};Ut.useMemo=function(n,i){return Wn.H.useMemo(n,i)};Ut.useOptimistic=function(n,i){return Wn.H.useOptimistic(n,i)};Ut.useReducer=function(n,i,A){return Wn.H.useReducer(n,i,A)};Ut.useRef=function(n){return Wn.H.useRef(n)};Ut.useState=function(n){return Wn.H.useState(n)};Ut.useSyncExternalStore=function(n,i,A){return Wn.H.useSyncExternalStore(n,i,A)};Ut.useTransition=function(){return Wn.H.useTransition()};Ut.version="19.3.1"});var Aw=Ko((Nt,hy)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(R,Y){Object.defineProperty(u.prototype,R,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Y[0],Y[1])}})}function i(R){return R===null||typeof R!="object"?null:(R=mt&&R[mt]||R["@@iterator"],typeof R=="function"?R:null)}function A(R,Y){R=(R=R.constructor)&&(R.displayName||R.name)||"ReactClass";var he=R+"."+Y;it[he]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Y,R),it[he]=!0)}function u(R,Y,he){this.props=R,this.context=Y,this.refs=dn,this.updater=he||Dt}function g(){}function p(R,Y,he){this.props=R,this.context=Y,this.refs=dn,this.updater=he||Dt}function h(){}function C(R){return""+R}function I(R){try{C(R);var Y=!1}catch{Y=!0}if(Y){Y=console;var he=Y.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return he.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),C(R)}}function Q(R){if(R==null)return null;if(typeof R=="function")return R.$$typeof===kt?null:R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case tt:return"Fragment";case Ee:return"Profiler";case X:return"StrictMode";case jt:return"Suspense";case gt:return"SuspenseList";case Qe:return"Activity";case rt:return"ViewTransition"}if(typeof R=="object")switch(typeof R.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case Fe:return"Portal";case Ve:return R.displayName||"Context";case Pe:return(R._context.displayName||"Context")+".Consumer";case Yt:var Y=R.render;return R=R.displayName,R||(R=Y.displayName||Y.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case Ae:return Y=R.displayName||null,Y!==null?Y:Q(R.type)||"Memo";case Ct:Y=R._payload,R=R._init;try{return Q(R(Y))}catch{}}return null}function U(R){if(R===tt)return"<>";if(typeof R=="object"&&R!==null&&R.$$typeof===Ct)return"<...>";try{var Y=Q(R);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function O(){var R=Xe.A;return R===null?null:R.getOwner()}function S(){return Error("react-stack-top-frame")}function b(R){if(Gn.call(R,"key")){var Y=Object.getOwnPropertyDescriptor(R,"key").get;if(Y&&Y.isReactWarning)return!1}return R.key!==void 0}function x(R,Y){function he(){uo||(uo=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Y))}he.isReactWarning=!0,Object.defineProperty(R,"key",{get:he,configurable:!0})}function H(){var R=Q(this.type);return ht[R]||(ht[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function j(R,Y,he,G,te,nt){var Ne=he.ref;return R={$$typeof:He,type:R,key:Y,props:he,_owner:G},(Ne!==void 0?Ne:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:H}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(R,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(R,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:nt}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function F(R,Y){return Y=j(R.type,Y,R.props,R._owner,R._debugStack,R._debugTask),R._store&&(Y._store.validated=R._store.validated),Y}function xe(R){de(R)?R._store&&(R._store.validated=1):typeof R=="object"&&R!==null&&R.$$typeof===Ct&&(R._payload.status==="fulfilled"?de(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function de(R){return typeof R=="object"&&R!==null&&R.$$typeof===He}function qe(R){var Y={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(he){return Y[he]})}function Re(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?(I(R.key),qe(""+R.key)):Y.toString(36)}function je(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(h,h):(R.status="pending",R.then(function(Y){R.status==="pending"&&(R.status="fulfilled",R.value=Y)},function(Y){R.status==="pending"&&(R.status="rejected",R.reason=Y)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function et(R,Y,he,G,te){var nt=typeof R;(nt==="undefined"||nt==="boolean")&&(R=null);var Ne=!1;if(R===null)Ne=!0;else switch(nt){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(R.$$typeof){case He:case Fe:Ne=!0;break;case Ct:return Ne=R._init,et(Ne(R._payload),Y,he,G,te)}}if(Ne){Ne=R,te=te(Ne);var Ie=G===""?"."+Re(Ne,0):G;return Gt(te)?(he="",Ie!=null&&(he=Ie.replace(qo,"$&/")+"/"),et(te,Y,he,"",function(kn){return kn})):te!=null&&(de(te)&&(te.key!=null&&(Ne&&Ne.key===te.key||I(te.key)),he=F(te,he+(te.key==null||Ne&&Ne.key===te.key?"":(""+te.key).replace(qo,"$&/")+"/")+Ie),G!==""&&Ne!=null&&de(Ne)&&Ne.key==null&&Ne._store&&!Ne._store.validated&&(he._store.validated=2),te=he),Y.push(te)),1}if(Ne=0,Ie=G===""?".":G+":",Gt(R))for(var Le=0;Le<R.length;Le++)G=R[Le],nt=Ie+Re(G,Le),Ne+=et(G,Y,he,nt,te);else if(Le=i(R),typeof Le=="function")for(Le===R.entries&&(sa||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),sa=!0),R=Le.call(R),Le=0;!(G=R.next()).done;)G=G.value,nt=Ie+Re(G,Le++),Ne+=et(G,Y,he,nt,te);else if(nt==="object"){if(typeof R.then=="function")return et(je(R),Y,he,G,te);throw Y=String(R),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function Ue(R,Y,he){if(R==null)return R;var G=[],te=0;return et(R,G,"","",function(nt){return Y.call(he,nt,te++)}),G}function Be(R){if(R._status===-1){var Y=null,he=null,G=R._ioInfo;G!=null&&(G.start=G.end=performance.now(),G.value=new Promise(function(Ne,Ie){Y=Ne,he=Ie})),G=R._result;var te=G();if(te.then(function(Ne){if(R._status===0||R._status===-1){R._status=1,R._result=Ne;var Ie=R._ioInfo;if(Ie!=null){Ie.end=performance.now();var Le=Ne?.default;Y(Le),Ie.value.status="fulfilled",Ie.value.value=Le}te.status===void 0&&(te.status="fulfilled",te.value=Ne)}},function(Ne){if(R._status===0||R._status===-1){R._status=2,R._result=Ne;var Ie=R._ioInfo;Ie!=null&&(Ie.end=performance.now(),Ie.value.then(h,h),he(Ne),Ie.value.status="rejected",Ie.value.reason=Ne),te.status===void 0&&(te.status="rejected",te.reason=Ne)}}),G=R._ioInfo,G!=null){var nt=te.displayName;typeof nt=="string"&&(G.name=nt)}R._status===-1&&(R._status=0,R._result=te)}if(R._status===1)return G=R._result,G===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
3
|
+
import{a as Fu,b as Ti,c as eA,d as zf,e as Sr,f as pm,g as eN,j as tN}from"./chunk-ETKUVKJ2.js";import{b as iN}from"./chunk-XD3BBFZB.js";import{c as lN}from"./chunk-I7TGIK5N.js";import{a as nN,b as oN,c as aN}from"./chunk-5QBYM33Q.js";import{a as Y2,b as K2,c as Jf,i as X2}from"./chunk-DU2BN46C.js";import{b as q2,c as V2}from"./chunk-MINZ25AC.js";import{b as Z2}from"./chunk-YL56J2WX.js";import{C as $2,D as W2,a as En,b as nS,c as xo,d as T2,e as w2,f as b2,g as x2,h as U2,i as O2,j as M2,k as H2,l as G2,m as k2,n as Ff,o as WI,p as L2,q as aS,r as z2,s as j2,t as F2,u as J2,v as iS,w as P2}from"./chunk-43XWL2PB.js";import{a as YI,b as KI,e as d2,f as m2,g as p2,h as E2,i as h2,j as C2,k as B2,l as I2,m as y2,n as Q2,o as Ju,p as qI,q as S2,r as v2,s as VI,t as mm,u as oS,v as XI,w as D2}from"./chunk-MWOVYIBB.js";import{a as Qh,b as s2,c as dm,d as u2,e as JI,h as N2}from"./chunk-IGN5UC3P.js";import{a as c2,c as f2,d as g2}from"./chunk-K6SOCO6V.js";import"./chunk-3J6XI3NX.js";import{a as i2,b as l2,c as FI,d as A2,e as r2,g as gm,h as ZI,i as PI,l as jf,m as _2,n as $I}from"./chunk-YHYRGWUH.js";import{b as R2}from"./chunk-3XODDLRJ.js";import"./chunk-53L2JN7G.js";import{$ as ZR,A as LR,B as zR,C as PQ,D as $Q,F as HI,G as WQ,H as GI,J as eS,L as jR,N as FR,O as JR,P as YR,Q as Tl,R as yh,S as KR,V as qR,W as VR,X as kI,Y as um,Z as XR,_ as LI,a as qn,aa as PR,b as xR,ba as $R,c as UR,ca as WR,d as Bh,e as rm,ea as zI,f as OR,fa as jI,g as Ih,ga as e2,h as qQ,ha as cm,i as OI,ia as t2,j as MI,k as _I,l as VQ,la as Lf,m as MR,ma as tS,n as sm,na as fm,o as XQ,oa as n2,p as ju,pa as o2,q as Vn,qa as a2,r as _R,s as HR,t as _A,v as GR,w as ZQ,y as kR}from"./chunk-5F7YP5IR.js";import{A as DR,B as Am,C as UA,D as RR,E as OA,F as zu,G as NR,H as TR,I as wR,J as ys,K as ci,L as st,M as bR,N as An,O as Aa,P as Mn,Q as xI,R as Ya,S as MA,T as UI,a as yR,b as D,c as Gf,e as Wl,h as kf,j as hh,k as QR,l as SR,m as KQ,n as im,o as lm,p as Ch,s as bI,t as xA,w as vR,x as Dn,y as Nl,z as Is}from"./chunk-YNCBBJ4V.js";import{a as YQ,b as Ko,c as uM,d as ct}from"./chunk-KJZUBHLO.js";var qT=Ko(py=>{"use strict";var zH=Symbol.for("react.transitional.element"),jH=Symbol.for("react.fragment");function KT(n,i,A){var u=null;if(A!==void 0&&(u=""+A),i.key!==void 0&&(u=""+i.key),"key"in i){A={};for(var g in i)g!=="key"&&(A[g]=i[g])}else A=i;return i=A.ref,{$$typeof:zH,type:n,key:u,ref:i!==void 0?i:null,props:A}}py.Fragment=jH;py.jsx=KT;py.jsxs=KT});var lw=Ko(Ut=>{"use strict";var bS=Symbol.for("react.transitional.element"),FH=Symbol.for("react.portal"),JH=Symbol.for("react.fragment"),YH=Symbol.for("react.strict_mode"),KH=Symbol.for("react.profiler"),qH=Symbol.for("react.consumer"),VH=Symbol.for("react.context"),XH=Symbol.for("react.forward_ref"),ZH=Symbol.for("react.suspense"),PH=Symbol.for("react.memo"),$T=Symbol.for("react.lazy"),$H=Symbol.for("react.activity"),WH=Symbol.for("react.view_transition"),VT=Symbol.iterator;function e4(n){return n===null||typeof n!="object"?null:(n=VT&&n[VT]||n["@@iterator"],typeof n=="function"?n:null)}var WT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ew=Object.assign,tw={};function vm(n,i,A){this.props=n,this.context=i,this.refs=tw,this.updater=A||WT}vm.prototype.isReactComponent={};vm.prototype.setState=function(n,i){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,i,"setState")};vm.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function nw(){}nw.prototype=vm.prototype;function xS(n,i,A){this.props=n,this.context=i,this.refs=tw,this.updater=A||WT}var US=xS.prototype=new nw;US.constructor=xS;ew(US,vm.prototype);US.isPureReactComponent=!0;var XT=Array.isArray;function wS(){}var Wn={H:null,A:null,T:null,S:null},ow=Object.prototype.hasOwnProperty;function OS(n,i,A){var u=A.ref;return{$$typeof:bS,type:n,key:i,ref:u!==void 0?u:null,props:A}}function t4(n,i){return OS(n.type,i,n.props)}function MS(n){return typeof n=="object"&&n!==null&&n.$$typeof===bS}function n4(n){var i={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(A){return i[A]})}var ZT=/\/+/g;function TS(n,i){return typeof n=="object"&&n!==null&&n.key!=null?n4(""+n.key):i.toString(36)}function o4(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status=="string"?n.then(wS,wS):(n.status="pending",n.then(function(i){n.status==="pending"&&(n.status="fulfilled",n.value=i)},function(i){n.status==="pending"&&(n.status="rejected",n.reason=i)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function Sm(n,i,A,u,g){var p=typeof n;(p==="undefined"||p==="boolean")&&(n=null);var h=!1;if(n===null)h=!0;else switch(p){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case bS:case FH:h=!0;break;case $T:return h=n._init,Sm(h(n._payload),i,A,u,g)}}if(h)return g=g(n),h=u===""?"."+TS(n,0):u,XT(g)?(A="",h!=null&&(A=h.replace(ZT,"$&/")+"/"),Sm(g,i,A,"",function(Q){return Q})):g!=null&&(MS(g)&&(g=t4(g,A+(g.key==null||n&&n.key===g.key?"":(""+g.key).replace(ZT,"$&/")+"/")+h)),i.push(g)),1;h=0;var C=u===""?".":u+":";if(XT(n))for(var I=0;I<n.length;I++)u=n[I],p=C+TS(u,I),h+=Sm(u,i,A,p,g);else if(I=e4(n),typeof I=="function")for(n=I.call(n),I=0;!(u=n.next()).done;)u=u.value,p=C+TS(u,I++),h+=Sm(u,i,A,p,g);else if(p==="object"){if(typeof n.then=="function")return Sm(o4(n),i,A,u,g);throw i=String(n),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return h}function Ey(n,i,A){if(n==null)return n;var u=[],g=0;return Sm(n,u,"","",function(p){return i.call(A,p,g++)}),u}function a4(n){if(n._status===-1){var i=n._result,A=i();A.then(function(u){(n._status===0||n._status===-1)&&(n._status=1,n._result=u,A.status===void 0&&(A.status="fulfilled",A.value=u))},function(u){(n._status===0||n._status===-1)&&(n._status=2,n._result=u,A.status===void 0&&(A.status="rejected",A.reason=u))}),n._status===-1&&(n._status=0,n._result=A)}if(n._status===1)return n._result.default;throw n._result}var PT=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function aw(n){var i=Wn.T,A={};A.types=i!==null?i.types:null,Wn.T=A;try{var u=n(),g=Wn.S;g!==null&&g(A,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&u.then(wS,PT)}catch(p){PT(p)}finally{i!==null&&A.types!==null&&(i.types=A.types),Wn.T=i}}function iw(n){var i=Wn.T;if(i!==null){var A=i.types;A===null?i.types=[n]:A.indexOf(n)===-1&&A.push(n)}else aw(iw.bind(null,n))}var i4={map:Ey,forEach:function(n,i,A){Ey(n,function(){i.apply(this,arguments)},A)},count:function(n){var i=0;return Ey(n,function(){i++}),i},toArray:function(n){return Ey(n,function(i){return i})||[]},only:function(n){if(!MS(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Ut.Activity=$H;Ut.Children=i4;Ut.Component=vm;Ut.Fragment=JH;Ut.Profiler=KH;Ut.PureComponent=xS;Ut.StrictMode=YH;Ut.Suspense=ZH;Ut.ViewTransition=WH;Ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Wn;Ut.__COMPILER_RUNTIME={__proto__:null,c:function(n){return Wn.H.useMemoCache(n)}};Ut.addTransitionType=iw;Ut.cache=function(n){return function(){return n.apply(null,arguments)}};Ut.cacheSignal=function(){return null};Ut.cloneElement=function(n,i,A){if(n==null)throw Error("The argument must be a React element, but you passed "+n+".");var u=ew({},n.props),g=n.key;if(i!=null)for(p in i.key!==void 0&&(g=""+i.key),i)!ow.call(i,p)||p==="key"||p==="__self"||p==="__source"||p==="ref"&&i.ref===void 0||(u[p]=i[p]);var p=arguments.length-2;if(p===1)u.children=A;else if(1<p){for(var h=Array(p),C=0;C<p;C++)h[C]=arguments[C+2];u.children=h}return OS(n.type,g,u)};Ut.createContext=function(n){return n={$$typeof:VH,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:qH,_context:n},n};Ut.createElement=function(n,i,A){var u,g={},p=null;if(i!=null)for(u in i.key!==void 0&&(p=""+i.key),i)ow.call(i,u)&&u!=="key"&&u!=="__self"&&u!=="__source"&&(g[u]=i[u]);var h=arguments.length-2;if(h===1)g.children=A;else if(1<h){for(var C=Array(h),I=0;I<h;I++)C[I]=arguments[I+2];g.children=C}if(n&&n.defaultProps)for(u in h=n.defaultProps,h)g[u]===void 0&&(g[u]=h[u]);return OS(n,p,g)};Ut.createRef=function(){return{current:null}};Ut.forwardRef=function(n){return{$$typeof:XH,render:n}};Ut.isValidElement=MS;Ut.lazy=function(n){return{$$typeof:$T,_payload:{_status:-1,_result:n},_init:a4}};Ut.memo=function(n,i){return{$$typeof:PH,type:n,compare:i===void 0?null:i}};Ut.startTransition=aw;Ut.unstable_useCacheRefresh=function(){return Wn.H.useCacheRefresh()};Ut.use=function(n){return Wn.H.use(n)};Ut.useActionState=function(n,i,A){return Wn.H.useActionState(n,i,A)};Ut.useCallback=function(n,i){return Wn.H.useCallback(n,i)};Ut.useContext=function(n){return Wn.H.useContext(n)};Ut.useDebugValue=function(){};Ut.useDeferredValue=function(n,i){return Wn.H.useDeferredValue(n,i)};Ut.useEffect=function(n,i){return Wn.H.useEffect(n,i)};Ut.useEffectEvent=function(n){return Wn.H.useEffectEvent(n)};Ut.useId=function(){return Wn.H.useId()};Ut.useImperativeHandle=function(n,i,A){return Wn.H.useImperativeHandle(n,i,A)};Ut.useInsertionEffect=function(n,i){return Wn.H.useInsertionEffect(n,i)};Ut.useLayoutEffect=function(n,i){return Wn.H.useLayoutEffect(n,i)};Ut.useMemo=function(n,i){return Wn.H.useMemo(n,i)};Ut.useOptimistic=function(n,i){return Wn.H.useOptimistic(n,i)};Ut.useReducer=function(n,i,A){return Wn.H.useReducer(n,i,A)};Ut.useRef=function(n){return Wn.H.useRef(n)};Ut.useState=function(n){return Wn.H.useState(n)};Ut.useSyncExternalStore=function(n,i,A){return Wn.H.useSyncExternalStore(n,i,A)};Ut.useTransition=function(){return Wn.H.useTransition()};Ut.version="19.3.1"});var Aw=Ko((Nt,hy)=>{"use strict";process.env.NODE_ENV!=="production"&&(function(){function n(R,Y){Object.defineProperty(u.prototype,R,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",Y[0],Y[1])}})}function i(R){return R===null||typeof R!="object"?null:(R=mt&&R[mt]||R["@@iterator"],typeof R=="function"?R:null)}function A(R,Y){R=(R=R.constructor)&&(R.displayName||R.name)||"ReactClass";var he=R+"."+Y;it[he]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",Y,R),it[he]=!0)}function u(R,Y,he){this.props=R,this.context=Y,this.refs=dn,this.updater=he||Dt}function g(){}function p(R,Y,he){this.props=R,this.context=Y,this.refs=dn,this.updater=he||Dt}function h(){}function C(R){return""+R}function I(R){try{C(R);var Y=!1}catch{Y=!0}if(Y){Y=console;var he=Y.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&R[Symbol.toStringTag]||R.constructor.name||"Object";return he.call(Y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),C(R)}}function Q(R){if(R==null)return null;if(typeof R=="function")return R.$$typeof===kt?null:R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case tt:return"Fragment";case Ee:return"Profiler";case X:return"StrictMode";case jt:return"Suspense";case gt:return"SuspenseList";case Qe:return"Activity";case rt:return"ViewTransition"}if(typeof R=="object")switch(typeof R.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),R.$$typeof){case Fe:return"Portal";case Ve:return R.displayName||"Context";case Pe:return(R._context.displayName||"Context")+".Consumer";case Yt:var Y=R.render;return R=R.displayName,R||(R=Y.displayName||Y.name||"",R=R!==""?"ForwardRef("+R+")":"ForwardRef"),R;case Ae:return Y=R.displayName||null,Y!==null?Y:Q(R.type)||"Memo";case Ct:Y=R._payload,R=R._init;try{return Q(R(Y))}catch{}}return null}function U(R){if(R===tt)return"<>";if(typeof R=="object"&&R!==null&&R.$$typeof===Ct)return"<...>";try{var Y=Q(R);return Y?"<"+Y+">":"<...>"}catch{return"<...>"}}function O(){var R=Xe.A;return R===null?null:R.getOwner()}function S(){return Error("react-stack-top-frame")}function b(R){if(Gn.call(R,"key")){var Y=Object.getOwnPropertyDescriptor(R,"key").get;if(Y&&Y.isReactWarning)return!1}return R.key!==void 0}function x(R,Y){function he(){uo||(uo=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",Y))}he.isReactWarning=!0,Object.defineProperty(R,"key",{get:he,configurable:!0})}function H(){var R=Q(this.type);return ht[R]||(ht[R]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),R=this.props.ref,R!==void 0?R:null}function j(R,Y,he,G,te,nt){var Ne=he.ref;return R={$$typeof:He,type:R,key:Y,props:he,_owner:G},(Ne!==void 0?Ne:null)!==null?Object.defineProperty(R,"ref",{enumerable:!1,get:H}):Object.defineProperty(R,"ref",{enumerable:!1,value:null}),R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(R,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(R,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(R,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:nt}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R}function F(R,Y){return Y=j(R.type,Y,R.props,R._owner,R._debugStack,R._debugTask),R._store&&(Y._store.validated=R._store.validated),Y}function xe(R){de(R)?R._store&&(R._store.validated=1):typeof R=="object"&&R!==null&&R.$$typeof===Ct&&(R._payload.status==="fulfilled"?de(R._payload.value)&&R._payload.value._store&&(R._payload.value._store.validated=1):R._store&&(R._store.validated=1))}function de(R){return typeof R=="object"&&R!==null&&R.$$typeof===He}function qe(R){var Y={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(he){return Y[he]})}function Re(R,Y){return typeof R=="object"&&R!==null&&R.key!=null?(I(R.key),qe(""+R.key)):Y.toString(36)}function je(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(h,h):(R.status="pending",R.then(function(Y){R.status==="pending"&&(R.status="fulfilled",R.value=Y)},function(Y){R.status==="pending"&&(R.status="rejected",R.reason=Y)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function et(R,Y,he,G,te){var nt=typeof R;(nt==="undefined"||nt==="boolean")&&(R=null);var Ne=!1;if(R===null)Ne=!0;else switch(nt){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(R.$$typeof){case He:case Fe:Ne=!0;break;case Ct:return Ne=R._init,et(Ne(R._payload),Y,he,G,te)}}if(Ne){Ne=R,te=te(Ne);var Ie=G===""?"."+Re(Ne,0):G;return Gt(te)?(he="",Ie!=null&&(he=Ie.replace(qo,"$&/")+"/"),et(te,Y,he,"",function(kn){return kn})):te!=null&&(de(te)&&(te.key!=null&&(Ne&&Ne.key===te.key||I(te.key)),he=F(te,he+(te.key==null||Ne&&Ne.key===te.key?"":(""+te.key).replace(qo,"$&/")+"/")+Ie),G!==""&&Ne!=null&&de(Ne)&&Ne.key==null&&Ne._store&&!Ne._store.validated&&(he._store.validated=2),te=he),Y.push(te)),1}if(Ne=0,Ie=G===""?".":G+":",Gt(R))for(var Le=0;Le<R.length;Le++)G=R[Le],nt=Ie+Re(G,Le),Ne+=et(G,Y,he,nt,te);else if(Le=i(R),typeof Le=="function")for(Le===R.entries&&(sa||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),sa=!0),R=Le.call(R),Le=0;!(G=R.next()).done;)G=G.value,nt=Ie+Re(G,Le++),Ne+=et(G,Y,he,nt,te);else if(nt==="object"){if(typeof R.then=="function")return et(je(R),Y,he,G,te);throw Y=String(R),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function Ue(R,Y,he){if(R==null)return R;var G=[],te=0;return et(R,G,"","",function(nt){return Y.call(he,nt,te++)}),G}function Be(R){if(R._status===-1){var Y=null,he=null,G=R._ioInfo;G!=null&&(G.start=G.end=performance.now(),G.value=new Promise(function(Ne,Ie){Y=Ne,he=Ie})),G=R._result;var te=G();if(te.then(function(Ne){if(R._status===0||R._status===-1){R._status=1,R._result=Ne;var Ie=R._ioInfo;if(Ie!=null){Ie.end=performance.now();var Le=Ne?.default;Y(Le),Ie.value.status="fulfilled",Ie.value.value=Le}te.status===void 0&&(te.status="fulfilled",te.value=Ne)}},function(Ne){if(R._status===0||R._status===-1){R._status=2,R._result=Ne;var Ie=R._ioInfo;Ie!=null&&(Ie.end=performance.now(),Ie.value.then(h,h),he(Ne),Ie.value.status="rejected",Ie.value.reason=Ne),te.status===void 0&&(te.status="rejected",te.reason=Ne)}}),G=R._ioInfo,G!=null){var nt=te.displayName;typeof nt=="string"&&(G.name=nt)}R._status===-1&&(R._status=0,R._result=te)}if(R._status===1)return G=R._result,G===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
4
4
|
|
|
5
5
|
Your code should look like:
|
|
6
6
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -1830,7 +1830,7 @@ Fix: ${C}`),console.error(D.red(`\u2717 ${h}`)),console.error(D.gray(` Fix: ${C
|
|
|
1830
1830
|
`)),MA(u.join(`
|
|
1831
1831
|
`)),A(A5))}function u5(n,i,A=Nl(),u=process.exit){if(i.ignoreVersion){console.warn(D.yellow("Warning: --ignore-version set; minFliskVersion was not checked."));return}let g=z2(n,A);g.status==="none"||g.status==="ok"||(i.onFail?.(`${g.message}
|
|
1832
1832
|
${g.fix}`),MA(`${g.message}
|
|
1833
|
-
${g.fix}`),u(1))}var pO=Symbol("startup-failed");async function c5(n,i,A=process.exit){let u=await Promise.race([n,i.then(()=>pO)]);return u===pO&&A(1),u}function f5(n,i=3e4){return new Promise(A=>{let u=Date.now()+i,g=()=>{let p=n5({host:"127.0.0.1",port:n}),h=!1,C=I=>{h||(h=!0,p.destroy(),I||Date.now()>=u?A(I):setTimeout(g,250))};p.once("connect",()=>C(!0)),p.once("error",()=>C(!1))};g()})}function g5(n,i){if(i===void 0)return;if(!n)throw An.notInProject();let A=iO(n,i);return AO(n),A}function d5(n){let i=n instanceof st?n.suggestions:[];return{failure:{code:n instanceof LA?n.code:"ENV_FILE_INVALID",message:ys(n),...i.length>0?{suggestions:i}:{}},exitCode:n instanceof st?n.exitCode:2}}var EO=new o5("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this flisk is older than minFliskVersion in .flisk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--env-file <path>","Use this project env file for the run instead of .env (for example: --env-file .env.integration)").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,i)=>{let A=i.json?sy("UP_FAILED","flisk up"):void 0;i.json&&(i.quiet=!0);let u=NS(process.env.TILT_PORT);u.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:u.message}]),Ya(u.message));let g=u.port,p=Dn();p&&u5(p,{ignoreVersion:i.ignoreVersion,onFail:b=>A?.({ok:!1},[{code:"FLISK_VERSION_TOO_OLD",message:b}])});let h=p,C;if(i.envFile===void 0&&delete process.env[Q0],i.envFile!==void 0){try{C=g5(h,i.envFile)}catch(b){let{failure:x,exitCode:H}=d5(b);A?.({ok:!1},[x]),Ya(x.message,H,x.suggestions)}if(C&&h){lO(C),i.quiet||console.log(D.gray(`Using env file: ${C.relativePath} (the project .env is not read in this run)`));let b=rO(h,C);b&&console.warn(D.yellow(b))}}let I=i.dryRun?null:await i5();I&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:I}]),Ya(I));let Q=a5(process.platform,process.env.FLISK_ALLOW_NATIVE_WINDOWS);Q&&Ya(Q);let U=Dn(),O;if(U){try{O=zI(U),jI(O.problems)}catch{}O&&uO(U,{resources:O.resources,onInvalid:b=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:b}])})}if(!i.dryRun){let{assertMachineReadyOrExit:b}=await import("./cold-preflight-
|
|
1833
|
+
${g.fix}`),u(1))}var pO=Symbol("startup-failed");async function c5(n,i,A=process.exit){let u=await Promise.race([n,i.then(()=>pO)]);return u===pO&&A(1),u}function f5(n,i=3e4){return new Promise(A=>{let u=Date.now()+i,g=()=>{let p=n5({host:"127.0.0.1",port:n}),h=!1,C=I=>{h||(h=!0,p.destroy(),I||Date.now()>=u?A(I):setTimeout(g,250))};p.once("connect",()=>C(!0)),p.once("error",()=>C(!1))};g()})}function g5(n,i){if(i===void 0)return;if(!n)throw An.notInProject();let A=iO(n,i);return AO(n),A}function d5(n){let i=n instanceof st?n.suggestions:[];return{failure:{code:n instanceof LA?n.code:"ENV_FILE_INVALID",message:ys(n),...i.length>0?{suggestions:i}:{}},exitCode:n instanceof st?n.exitCode:2}}var EO=new o5("up").description("Start all services (optionally filtered by stack)").alias("deploy").argument("[stack-name]","Name of the stack to start (optional - runs all if omitted)").option("-v, --verbose","Enable verbose output",!1).option("-q, --quiet","Suppress non-essential output",!1).option("--dry-run","Show what would be started without starting",!1).option("-f, --force","Kill existing Tilt process before starting",!1).option("--ignore-drift","Start even if generated files differ from service.json",!1).option("--ignore-version","Start even if this flisk is older than minFliskVersion in .flisk/project.json",!1).option("--only <services...>","Start only these services plus what the Tiltfile enables for them (their dependsOn services and shared infrastructure). With a stack, names must belong to that stack; dependencies may cross stacks").option("--env-file <path>","Use this project env file for the run instead of .env (for example: --env-file .env.integration)").option("--json","Print one JSON object on stdout when the stack is ready or the command fails; implies --quiet",!1).action(async(n,i)=>{let A=i.json?sy("UP_FAILED","flisk up"):void 0;i.json&&(i.quiet=!0);let u=NS(process.env.TILT_PORT);u.ok||(A?.({ok:!1},[{code:"INVALID_TILT_PORT",message:u.message}]),Ya(u.message));let g=u.port,p=Dn();p&&u5(p,{ignoreVersion:i.ignoreVersion,onFail:b=>A?.({ok:!1},[{code:"FLISK_VERSION_TOO_OLD",message:b}])});let h=p,C;if(i.envFile===void 0&&delete process.env[Q0],i.envFile!==void 0){try{C=g5(h,i.envFile)}catch(b){let{failure:x,exitCode:H}=d5(b);A?.({ok:!1},[x]),Ya(x.message,H,x.suggestions)}if(C&&h){lO(C),i.quiet||console.log(D.gray(`Using env file: ${C.relativePath} (the project .env is not read in this run)`));let b=rO(h,C);b&&console.warn(D.yellow(b))}}let I=i.dryRun?null:await i5();I&&(A?.({ok:!1},[{code:"HOST_UNSUPPORTED",message:I}]),Ya(I));let Q=a5(process.platform,process.env.FLISK_ALLOW_NATIVE_WINDOWS);Q&&Ya(Q);let U=Dn(),O;if(U){try{O=zI(U),jI(O.problems)}catch{}O&&uO(U,{resources:O.resources,onInvalid:b=>A?.({ok:!1},[{code:"INVALID_SCHEMA_VERSION",message:b}])})}if(!i.dryRun){let{assertMachineReadyOrExit:b}=await import("./cold-preflight-ZOPR7PWJ.js");await b()}let S=async()=>{let b=i.dryRun?Aa():Dn(),x=b??process.cwd(),H=t2(b&&b===U?O:void 0),j,F=[];if((!i.only||n)&&(j=Lf(H),F=j.map(Ae=>Ae.name)),i.only){if(n&&!fm(n,H)){let Qe=An.stackNotFound(n,F);A?.({ok:!1},[nS(Qe).error]),Qe.exit()}let Ae=n?tS(n,H):H,Ct=fO(i.only,Ae);if(Ct.length>0){let Qe=Ae.map(mt=>mt.name),rt=An.unknownServices(Ct,Qe);A?.({ok:!1},[{code:"UNKNOWN_SERVICE",message:rt.message,...rt.suggestions.length>0?{suggestions:rt.suggestions}:{}}]),rt.exit()}}b&&s5(b,{ignoreDrift:i.ignoreDrift,resources:H,onDrift:Ae=>A?.({ok:!1},[{code:"DRIFT_DETECTED",message:Ae}])}),b&&F2(b,{resources:H,onInvalid:Ae=>A?.({ok:!1},[{code:"INVALID_SERVICE_CONFIG",message:Ae}])}),b&&!A&&!i.quiet&&j2(b,H);let xe=await gm(x,{inspectDocker:!i.dryRun});if(!i.dryRun){if(b&&!C){let Qe=kR(x);Qe.length>0&&!i.quiet&&console.log(D.gray(`Added ${Qe.join(", ")} to .env (generated; existing values unchanged)`))}b&&!t5(dO(x,".flisk",".flisk-out","Tiltfile"))&&(i.quiet||console.log(D.gray("No generated Tiltfile yet; generating .flisk/.flisk-out/ ...")),await qI(x,{quiet:i.quiet}));let Ae=v2(x);Ae.length>0&&i.verbose&&!i.quiet&&console.log(D.gray(`Refreshed runtime assets: ${Ae.join(", ")}`));let Ct=eN(x,H);Ct.length>0&&!i.quiet&&console.log(D.gray(`Added ${Ct.join(", ")} to the pre_alpha phase in .flisk/project.json`))}let de,qe,Re=[];if(n){if(de=tS(n,H),de.length===0){let Ae=An.stackNotFound(n,F);A?.({ok:!1},[nS(Ae).error]),Ae.exit()}Re=de.map(Ae=>Ae.name),qe=`stack "${n}"`}else{de=H;let Ae=j??Lf(H);qe=`all stacks (${qn(Ae.length,"stack")}, ${qn(de.length,"service")})`}let je=[];if(i.only){let Ae=gO(i.only,H);de=Ae.selected,je=Ae.dependencies,Re=de.map(Ct=>Ct.name),qe=`${qn(i.only.length,"requested service")}${je.length>0?` plus ${je.join(", ")}`:""}`}i.verbose&&!i.quiet&&console.log(D.gray(`Found ${qn(de.length,"service")} in ${qe}`));let et=de.map(Ae=>Ae.name);if(!i.quiet){console.log(D.blue(`${i.dryRun?"Would start":"Starting"} ${qn(et.length,"service")} from ${qe}...`));for(let mt of et)console.log(D.gray(` - ${mt}`));let{appBase:Ae,apiBase:Ct}=HI(xe.ingressHttp),Qe=de.filter(mt=>mt.config?.appType==="frontend"),rt=de.filter(mt=>_A(mt.config?.appType));if(Qe.length>0){console.log(D.blue(`
|
|
1834
1834
|
\u{1F30D} Frontend URLs:`));for(let mt of Qe){let it=mt.config?.basePath??`/${mt.name}`;console.log(D.gray(` - ${mt.name}: ${Ae}${D.cyan(WQ(it))}`))}}if(rt.length>0){console.log(D.blue(`
|
|
1835
1835
|
\u{1F527} Backend API URLs:`));for(let mt of rt){let it=mt.name.replace(/-api$/,""),Dt=mt.config?.apiPath??`/api/${it}`,pt=mt.config?.sablier,dn=pt?.enable&&pt?.deferStart?D.dim(" (deferred \u2014 starts on first request)"):"";console.log(D.gray(` - ${mt.name}: ${Ct}${D.cyan(WQ(Dt))}${dn}`))}}}let Ue=i.only??(n?[n]:void 0),Be=TR(Re,{verbose:i.verbose,quiet:i.quiet,force:i.force,focusTargets:Ue}),ke=Ue?`tilt up ${Be.join(" ")}`:"tilt up";if(!i.quiet){console.log(D.blue(l2(xe)));for(let Ae of sO(xe))console.log(D.yellow(Ae));console.log(D.gray("Override with FLISK_HTTP_PORT, FLISK_HTTPS_PORT, or FLISK_POSTGRES_PORT."))}if(A&&i.dryRun){A({ok:!0,dryRun:!0,stack:n??null,services:et,...i.only?{requested:i.only,declaredDependencies:je}:{},command:ke});return}if(Sr(i,"not starting services",ke))return;r2(xe),A2(x,xe);let ft=xA.tiltUi,Ze=g??ft,Tt=i.only?[...new Set([ft,Ze])]:[Ze],{running:Qt,foreign:fe}=await lN(Tt,x,async Ae=>await Ff(Ae)!==null);if(fe.length>0&&g!==void 0){let Ae=fe[0],Ct=`TILT_PORT=${Ae?.port} is used by another project's Tilt (${Ae?.root}). Choose a free port, or run flisk down in that project.`;A?.({ok:!1},[{code:"TILT_PORT_IN_USE",message:Ct}]),Ya(Ct)}if(!i.quiet)for(let Ae of fe)console.log(D.yellow(`\u26A0\uFE0F Tilt on port ${Ae.port} belongs to another project (${Ae.root}); this project will use another port.`));let we=i.force&&fe.length===0,Me=jT({runningPorts:Qt,force:we,only:!!i.only});if(Me.action==="already-running"){if(C){let Ct=`A Tilt is already running on port ${Me.ports.join(", ")}. --env-file applies to a new run only: run \`flisk down\` first, or pass --force to replace the running stack.`;A?.({ok:!1},[{code:"ENV_FILE_ALREADY_RUNNING",message:Ct}]),Ya(Ct)}let Ae=`Environment is already running on port ${Me.ports.join(", ")}.`;A?.({ok:!0,alreadyRunning:!0,tiltUrl:`http://localhost:${Me.ports[0]}`}),i.quiet||console.log(D.green(Ae));return}if(Me.action==="only-blocked"){let Ae=`A Tilt is already running on port ${Me.ports.join(", ")}. --only cannot change a running stack's services: run \`flisk down\` first, or pass --force to replace it.`;A?.({ok:!1},[{code:"TILT_ALREADY_RUNNING",message:Ae}]),Ya(Ae)}if(i.only)for(let Ae of Qt)S0(Ae);let Oe=await FT({configuredPort:g,force:we,basePort:ft,findAvailablePort:mT}),He=Oe.port;Oe.autoSwitched&&!i.quiet&&(console.log(D.yellow(`\u26A0\uFE0F Port ${ft} is already in use`)),console.log(D.blue(`\u{1F504} Auto-switching to port ${He}
|
|
1836
1836
|
`))),process.env.TILT_PORT=He.toString(),await JT({force:we,quiet:i.quiet,port:He},{stop:S0,log:Ae=>console.log(D.yellow(Ae)),wait:Ae=>new Promise(Ct=>setTimeout(Ct,Ae))}),i.quiet||(console.log(D.gray(`
|
|
@@ -1868,7 +1868,7 @@ Manual upgrade using a published package:`)),console.log(D.cyan(" npm install
|
|
|
1868
1868
|
`)):(console.log(),await oS({message:"Proceed with upgrade?",initial:!0})||(qQ(),process.exit(0))),console.log();let h=!1;switch(A.method){case"npm":h=await TO();break;case"bun":h=await wO();break;case"git":A.path&&(h=await bO(A.path));break;case"binary":A.path&&p&&(h=await RO(A.path,p));break}if(!h){if(console.error(D.red(`
|
|
1869
1869
|
Upgrade failed`)),A.method==="git")console.log(D.cyan(` Check local changes with: git -C ${A.path} status --short`)),console.log(D.cyan(" Commit or stash them, then retry: flisk upgrade"));else if(A.method==="binary"&&p&&A.path){let I=wi(G1(A.path),"flisk-cli");Is()?console.log(D.cyan(" irm https://flisk.sh/install.ps1 | iex")):(console.log(D.cyan(` curl -fsSL -o ${A.path} ${p.downloadUrl}`)),console.log(D.cyan(` chmod +x ${A.path}`)),console.log(D.cyan(` rm -rf ${I} && mkdir -p ${I}`)),console.log(D.cyan(` curl -fsSL ${p.engineDownloadUrl} | tar -xzf - -C ${I} --strip-components=1`)))}process.exit(1)}console.log();let C=Jf("Verifying upgrade...");try{let I=Ia(UA(Am())??Am(),["version"],{encoding:"utf-8",windowsHide:Is()}).trim();C.succeed(`Verified: now running ${D.green(I)}`),console.log(),console.log(D.green.bold("\u2728 Upgrade complete!")),console.log(D.gray(` Version: ${i} \u2192 ${I}`)),console.log(),console.log(D.cyan.bold("\u{1F4CD} Installation Details:")),A.method==="git"&&A.path?(console.log(D.gray(` Location: ${A.path}`)),console.log(D.gray(" Method: git clone + bun link"))):console.log(D.gray(` Method: ${A.method}`)),console.log(D.gray(` Binary: ${A.path??UA(Am())??"unknown"}`)),console.log(),console.log(D.cyan.bold("\u{1F680} Quick Start:")),console.log(D.white(" flisk --help Show all commands")),console.log(D.white(" flisk networks View service URLs")),console.log(D.white(" flisk doctor Check environment")),I===i&&!n.force&&(console.log(),console.log(D.yellow("\u{1F4A1} Tip: Version appears unchanged. You may need to restart your terminal."))),console.log(),console.log(D.green("Happy coding! \u{1F389}"))}catch(I){C.warn("Could not verify new version"),console.error(D.red(`Verification error: ${ys(I)}`)),console.log(),console.log(D.yellow("\u26A0\uFE0F Upgrade status unknown - verification failed")),console.log(),R5(I)&&A.method!=="git"&&A.path?(console.log(D.yellow("\u{1F4A1} The installed binary isn't executable. Fix it with:")),console.log(D.cyan(` chmod +x ${A.path}`)),console.log(D.white(" then run: flisk version"))):(console.log(D.yellow("\u{1F4A1} Verify manually:")),console.log(D.white(" 1. Restart your terminal")),console.log(D.white(" 2. Run: flisk version")),A.method==="git"&&A.path&&console.log(D.white(` 3. Compare with: git -C ${A.path} rev-parse HEAD`)))}})}var xO=x5();import{Command as U5}from"commander";var UO=new U5("version").description("Display version number").alias("v").action(()=>{console.log(Nl())});function OO(){return[DS,UT,BT,EO,KN,gT,tT,VN,PN,X2,YT,GT,xT,vS,tN,ES,WU,UO,oT,J2,zN,xO,hT,sS,OT]}function MO(){let n=new O5;n.name("flisk").description("Flisk CLI \u2014 start services on your machine.").version(Gf.version,"-v, --version","Display version number").option("--verbose","Enable verbose output",!1).option("--template <name>","Create a project from a starter template in one command (restaurant, saas, erp, ecommerce, example)").option("--project <dir>","Directory to create the project in (default: the template name)").configureOutput({outputError:(i,A)=>A(D.red(i)),writeOut:i=>process.stdout.write(i),writeErr:i=>process.stderr.write(i)}),n.helpCommand("help [command]","Show colorful help").on("--help",()=>{ey(),process.exit(0)}),n.addHelpText("before","");for(let i of OO())n.addCommand(i);return n}function _O(n,i){let[A,u]=n;return A!=="help"||!u||u.startsWith("-")||i.some(p=>p.name()===u||p.aliases().includes(u))?void 0:u}var z1=MO();if(process.argv.length===2){let n=await $2();console.log(W2(n)),console.log(`
|
|
1870
1870
|
Commands: flisk doctor | flisk project --yes | flisk --help`),console.log(`
|
|
1871
|
-
One command from scratch (clones, boots and opens the browser):`),console.log(" npx -y @flisk-sh/flisk@latest demo"),console.log(" npx -y @flisk-sh/flisk@latest restaurant --project=my-stack"),process.exit(n.ok?0:1)}var lg=JO(process.argv,"--template")??Z2(process.argv),kO=JO(process.argv,"--project");if(lg){let{nativeWindowsStackRefusal:n}=await import("./native-windows-BWVEYVPO.js"),i=n(process.platform,process.env.FLISK_ALLOW_NATIVE_WINDOWS);i&&(console.error(D.red(`\u274C ${i}`)),console.error(D.gray(" Run it from Ubuntu in WSL2. Guide: docs/wsl2.md")),process.exit(1));let{cloneProjectTemplate:A,templateTargetDir:u}=await import("./project-
|
|
1871
|
+
One command from scratch (clones, boots and opens the browser):`),console.log(" npx -y @flisk-sh/flisk@latest demo"),console.log(" npx -y @flisk-sh/flisk@latest restaurant --project=my-stack"),process.exit(n.ok?0:1)}var lg=JO(process.argv,"--template")??Z2(process.argv),kO=JO(process.argv,"--project");if(lg){let{nativeWindowsStackRefusal:n}=await import("./native-windows-BWVEYVPO.js"),i=n(process.platform,process.env.FLISK_ALLOW_NATIVE_WINDOWS);i&&(console.error(D.red(`\u274C ${i}`)),console.error(D.gray(" Run it from Ubuntu in WSL2. Guide: docs/wsl2.md")),process.exit(1));let{cloneProjectTemplate:A,templateTargetDir:u}=await import("./project-7PTIOHGF.js"),{assertMachineReadyOrExit:g}=await import("./cold-preflight-ZOPR7PWJ.js");await g({scope:"scaffold"});let{nextAvailableProjectDir:p}=await import("./one-command-VNKQAMFJ.js"),{PROJECT_TEMPLATES:h}=await import("./project-templates-EYSQG2EO.js"),{listFrontendTargets:C,pickReadyFrontend:I}=await import("./open-XROJ6YEY.js"),{discoverResourcesWithProblems:Q}=await import("./services-BIMF6MVU.js"),{openUrl:U}=await import("./url-actions-HXJLBTX6.js"),{createDemoStage:O}=await import("./demo-stage-OHNTP2UJ.js"),S=u(lg,kO),b=kO?void 0:h[lg]?.fixedDir,x=process.argv.includes("--keep"),H;b?H=$m(FO(),".flisk",b):(H=p(S,Qe=>{let rt=HO(GO(),Qe);return R0(rt)&&jO(rt).length>0}),H!==S&&console.log(D.gray(`The folder ${S} is taken, using ${H} instead.`)));let j=G5(H)?H:HO(GO(),H),F=!1;if(b&&R0(j)){R0($m(j,".flisk","project.json"))||(console.log(D.yellow(`${j} already exists and is not a Flisk project.`)),console.log(D.gray(" Remove it, or use --project <dir> to put the demo somewhere else.")),process.exit(1));let Qe=await I(await C(j),0);Qe&&(console.log(D.gray(`The demo is already running: ${Qe.url}`)),await U(Qe.url),process.exit(0)),x?F=!0:_5(j,{recursive:!0,force:!0})}let{checkColima:xe}=await import("./colima-GBURKN54.js"),de=xe();de.isColima&&!de.running&&(console.log(D.yellow(de.problem??"The Colima VM is not running.")),console.log(D.gray(` Fix: ${de.fix??"colima start"}`)),process.exit(1));let qe=[{id:"fetch",label:F?"Reusing the demo":"Fetching the demo",status:"active"},{id:"config",label:"Generating project config",status:"pending"},{id:"deps",label:"Installing dependencies",status:"pending"},{id:"start",label:"Starting services",status:"pending"}],Re=O({title:"Flisk demo",subtitle:`${lg} starter`,phases:qe,servicesReady:0,servicesTotal:0,servicesBuilding:0,elapsedMs:0}),je=(Qe,rt,mt)=>{qe=qe.map(it=>it.id===Qe?{...it,status:rt,elapsedMs:mt??it.elapsedMs}:it),Re.update({phases:qe})},et=[`flisk ${Gf.version} ${lg}`,`cwd: ${j}`],Ue=Date.now();try{F||await A(lg,H,[],{quiet:!0})}catch(Qe){Re.fail(Qe instanceof Error?Qe.message:String(Qe),"Check that git is installed and that you are online, then run the command again."),Re.stop(),process.exit(1)}let Be=P2();je("fetch","done",Date.now()-Ue);let ke=process.argv[1];(!ke||!R0(j))&&(Re.fail("The demo could not find the CLI entry point or the project folder.","Reinstall the Flisk CLI package and run the command again."),Re.stop(),process.exit(1));let{initializeProject:ft,installServiceDependencies:Ze,runStackQuiet:Tt}=await import("./one-command-VNKQAMFJ.js"),Qt=Date.now(),fe=await ft(ke,j);if(et.push("--- project setup ---",fe.output??""),!fe.ok){let Qe=L1(et);Re.fail(fe.error??"The project setup did not finish.","Run `flisk project --yes` in the project folder to see what it printed.",Qe),Re.stop(),process.exit(1)}je("config","done",Date.now()-Qt);let we=Q(j).resources.length;Re.update({servicesTotal:we});let Me=Date.now(),Oe=await Ze(j),He=Oe.filter(Qe=>!Qe.ok);for(let Qe of Oe)et.push(`install ${Qe.dir}: ${Qe.ok?"ok":"failed"}`);He.length>0&&(Re.fail(`${He.length} of ${Oe.length} services could not install their dependencies.`,`Run "bun install" in ${He[0]?.dir??"the failed services"}.`,L1(et)),Re.stop(),process.exit(1)),je("deps","done",Date.now()-Me);let Fe=Date.now();je("start","active");let{readStackProgress:tt}=await import("./stack-progress-NIFM5T2K.js"),{classifyTiltPorts:X}=await import("./tilt-port-owner-ZY5M2JC4.js"),Ee=Array.from({length:10},(Qe,rt)=>10350+rt),Pe=!0,Ve=we;(async()=>{for(;Pe;){try{let{running:Qe}=await X(Ee,j,async rt=>await tt(rt)!==void 0);for(let rt of Qe){let mt=await tt(rt);if(mt){Ve=mt.total,Re.update({servicesReady:mt.ready,servicesTotal:mt.total,servicesBuilding:mt.building});break}}}catch{}await new Promise(Qe=>{setTimeout(Qe,2e3).unref?.()})}})();let Yt=await Tt(ke,j);if(Pe=!1,et.push("--- stack ---",Yt.raw??""),!Yt.ok){let Qe=Yt.data?.tiltUrl??"http://localhost:10350";Re.fail(k5(Yt.raw)??Yt.error??"The stack stopped before it was ready.",`Run \`flisk up\` in the project folder, or watch ${Qe}.`,L1(et)),Re.stop(),process.exit(1)}je("start","done",Date.now()-Fe),Re.update({servicesReady:Ve,servicesTotal:Ve});let jt=await C(j),gt=await I(jt,3e4);gt&&await U(gt.url);let Ae=zO($m(j,".flisk")),Ct=zO(j,["node_modules",".git"]);Re.update({subtitle:`${lg} starter \xB7 ${k1(Ct,"file")} wired`}),Re.finish({urls:(gt?[gt.url,...jt.map(Qe=>Qe.url)]:jt.map(Qe=>Qe.url)).filter((Qe,rt,mt)=>mt.indexOf(Qe)===rt).slice(0,2),summary:`${k1(Ae,"file")} generated \xB7 ${k1(we,"app service")} \xB7 live reload`,hint:"Edit any file and the browser updates.",version:Gf.version}),Re.stop(),Be==="failed"&&console.log(D.gray("\n `flisk` is not on your PATH. Next time, run this command again with npx.")),process.exit(0)}process.argv[2]==="--doctor"&&(process.argv[2]="doctor");process.argv.length===3&&["-h","--help","help"].includes(process.argv[2])&&(ey(),process.exit(0));var LO=_O(process.argv.slice(2),z1.commands);LO&&z1.error(`error: unknown command '${LO}'`,{exitCode:1,code:"commander.unknownCommand"});z1.parse();function JO(n,i){let A=`${i}=`;for(let u=0;u<n.length;u+=1){let g=n[u];if(g.startsWith(A))return g.slice(A.length);if(g===i)return n[u+1]}}function k1(n,i){return`${n} ${i}${n===1?"":"s"}`}function zO(n,i=[]){let A=0,u=g=>{try{for(let p of jO(g,{withFileTypes:!0})){if(i.includes(p.name))continue;let h=$m(g,p.name);p.isDirectory()?u(h):p.isFile()&&(A+=1)}}catch{}};return u(n),A}function k5(n){if(n)for(let i of n.split(`
|
|
1872
1872
|
`)){let A=/^\s*FAIL\s+(.+)$/.exec(i);if(A?.[1])return A[1].trim()}}function L1(n){try{let i=$m(FO(),".flisk","logs");M5(i,{recursive:!0});let A=$m(i,`demo-${new Date().toISOString().replace(/[:.]/g,"-")}.log`);return H5(A,n.join(`
|
|
1873
1873
|
`)),A}catch{return}}
|
|
1874
1874
|
/*! Bundled license information:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{A as d,B as e,C as f,D as g,E as h,F as i,G as j,x as a,y as b,z as c}from"./chunk-
|
|
2
|
+
import{A as d,B as e,C as f,D as g,E as h,F as i,G as j,x as a,y as b,z as c}from"./chunk-43XWL2PB.js";import"./chunk-MWOVYIBB.js";import"./chunk-IGN5UC3P.js";import"./chunk-K6SOCO6V.js";import"./chunk-3J6XI3NX.js";import"./chunk-YHYRGWUH.js";import"./chunk-3XODDLRJ.js";import"./chunk-53L2JN7G.js";import"./chunk-5F7YP5IR.js";import"./chunk-YNCBBJ4V.js";import"./chunk-KJZUBHLO.js";export{c as MACHINE_CHECK_IDS,a as RUNTIME_CHECK_IDS,b as SCAFFOLD_CHECK_IDS,h as assertMachineReadyOrExit,i as detectRuntimePrerequisites,g as formatColdPreflight,j as formatRuntimeNextSteps,d as nodeTooOld,e as requireVerifiedDockerVersions,f as runColdPreflight};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{b as R}from"./chunk-
|
|
2
|
+
import{b as R}from"./chunk-5QBYM33Q.js";import{b as c}from"./chunk-YNCBBJ4V.js";import"./chunk-KJZUBHLO.js";var v=12,_=24,F={plain:e=>e,bold:c.bold,dim:c.gray,ok:c.green,warn:c.yellow,err:c.red},S={pending:"\u25CB",active:"\u25D0",done:"\u2714",failed:"\u2716"},j={pending:"dim",active:"warn",done:"ok",failed:"err"};function o(e){return R(String(e)).replace(/[\n\r\t]/g," ")}function g(e){if(!Number.isFinite(e)||e<0)return"0.0s";if(e<1e4)return`${(e/1e3).toFixed(1)}s`;if(e<6e4)return`${Math.round(e/1e3)}s`;let n=Math.floor(e/6e4),i=Math.round(e%6e4/1e3);return`${n}m ${i}s`}function $(e){return e.reduce((n,i)=>n+i.text.length,0)}function k(e,n){if(n<=0)return[];let i=[],l=0;for(let s of e){if(l>=n)break;let t=n-l;if(s.text.length<=t){i.push(s),l+=s.text.length;continue}i.push({...s,text:`${s.text.slice(0,Math.max(0,t-1))}\u2026`}),l=n}return i}function w(e,n){let i=k(e,n),l=n-$(i);return l<=0?i:[...i,{text:" ".repeat(l),style:"plain"}]}function M(e,n,i){let l=$(n),s=i-l-1;if(s<4)return w(k([...e,...n],i),i);let t=k(e,s),r=i-$(t)-l;return[...t,{text:" ".repeat(Math.max(1,r)),style:"plain"},...n]}function b(e){return[{text:` ${"\u2500".repeat(Math.max(0,e-2))}`,style:"dim"}]}function P(e,n){return M([{text:" ",style:"plain"},{text:S[e.status],style:j[e.status]},{text:" ",style:"plain"},{text:o(e.label),style:e.status==="pending"?"dim":"plain"}],e.elapsedMs===void 0?[]:[{text:g(e.elapsedMs),style:"dim"}],n)}function Y(e){let n=Math.max(0,e.servicesTotal);if(n===0)return"no services found";let l=[`${Math.min(Math.max(0,e.servicesReady),n)} of ${n} services ready`];return e.servicesBuilding>0&&l.push(`${e.servicesBuilding} building`),l.join(" \xB7 ")}function E(e,n=80){let i=Number.isFinite(n)&&n>0?n:80,l=Math.max(_,Math.min(i-1,78)),s=[],t=a=>s.push(w(a,l)),r=()=>t([]);if(e.done){t(M([{text:" ",style:"plain"},{text:"\u2714",style:"ok"},{text:" Your stack is running",style:"ok"}],[{text:g(e.elapsedMs),style:"dim"}],l)),t([{text:" ",style:"plain"},{text:o(e.subtitle),style:"dim"}]),r();for(let a of e.done.urls.slice(0,2))t([{text:" ",style:"plain"},{text:o(a),style:"plain"}]);r(),t(b(l)),t([{text:" ",style:"plain"},{text:o(e.done.summary),style:"plain"}]),t([{text:" ",style:"plain"},{text:o(e.done.hint),style:"dim"}]),r(),t([{text:" ",style:"plain"},{text:`flisk ${o(e.done.version)}`,style:"dim"}])}else if(e.failure){let a=e.phases.find(p=>p.status==="failed");t(M([{text:" ",style:"plain"},{text:"\u2716",style:"err"},{text:" ",style:"plain"},{text:o(a?.label??"The demo stopped"),style:"err"}],[{text:g(e.elapsedMs),style:"dim"}],l)),r(),t([{text:" ",style:"plain"},{text:o(e.failure.message),style:"plain"}]),e.failure.fix&&t([{text:" ",style:"plain"},{text:o(e.failure.fix),style:"dim"}]),r(),t(b(l)),e.detail&&t([{text:" ",style:"plain"},{text:o(e.detail),style:"dim"}]),e.failure.logPath&&t([{text:" ",style:"plain"},{text:`log: ${o(e.failure.logPath)}`,style:"dim"}])}else{t([{text:" ",style:"plain"},{text:o(e.title),style:"bold"}]),t([{text:" ",style:"plain"},{text:o(e.subtitle),style:"dim"}]),r();let a=e.phases.slice(0,4);for(let p of a)t(P(p,l));for(let p=a.length;p<4;p+=1)r();r(),t(b(l)),t([{text:" ",style:"plain"},{text:o(e.detail??""),style:"dim"}]),t(M([{text:" ",style:"plain"},{text:Y(e),style:"plain"}],[{text:g(e.elapsedMs),style:"dim"}],l))}for(;s.length<v;)s.push(w([],l));return s.slice(0,v)}function A(e){return e.map(n=>n.map(i=>i.text).join(""))}function D(e){return e.map(n=>F[n.style](n.text)).join("")}function H(e,n=process.stderr,i=Date.now){let l=n.isTTY===!0,s=i(),t={...e},r=!1,a="",p="",f,T=()=>{let u=!!(t.done||t.failure);return{...t,elapsedMs:u?t.elapsedMs:i()-s}},x=()=>{let u=T(),m=E(u,n.columns??80),y=A(m);if(!l){let h=y.join(`
|
|
3
3
|
`);if(h===p)return;p=h,n.write(`${y.filter(L=>L.trim()!=="").join(`
|
|
4
4
|
`)}
|
|
5
5
|
`);return}let d=y.join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{d as a,e as b,f as c,g as d,h as e,i as f}from"./chunk-
|
|
2
|
+
import{d as a,e as b,f as c,g as d,h as e,i as f}from"./chunk-DU2BN46C.js";import"./chunk-MINZ25AC.js";import"./chunk-YHYRGWUH.js";import"./chunk-3XODDLRJ.js";import"./chunk-53L2JN7G.js";import"./chunk-5F7YP5IR.js";import"./chunk-YNCBBJ4V.js";import"./chunk-KJZUBHLO.js";export{d as findReadyFrontend,b as isFrontendReady,a as listFrontendTargets,f as openCommand,e as openFirstFrontend,c as pickReadyFrontend};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
+
import{g as a,h as b,i as c,j as d}from"./chunk-ETKUVKJ2.js";import"./chunk-YL56J2WX.js";import"./chunk-MWOVYIBB.js";import"./chunk-K6SOCO6V.js";import"./chunk-53L2JN7G.js";import"./chunk-5F7YP5IR.js";import"./chunk-YNCBBJ4V.js";import"./chunk-KJZUBHLO.js";export{c as cloneProjectTemplate,a as enableDiscoveredStacks,d as projectCommand,b as templateTargetDir};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{ca as a,da as b,ea as c,fa as d,ga as e,ha as f,ia as g,ja as h,ka as i,la as j,ma as k,na as l,oa as m,pa as n,qa as o}from"./chunk-
|
|
2
|
+
import{ca as a,da as b,ea as c,fa as d,ga as e,ha as f,ia as g,ja as h,ka as i,la as j,ma as k,na as l,oa as m,pa as n,qa as o}from"./chunk-5F7YP5IR.js";import"./chunk-YNCBBJ4V.js";import"./chunk-KJZUBHLO.js";export{m as clearMetadataCache,f as discoverResources,e as discoverResourcesFromRoot,g as discoverResourcesStrict,c as discoverResourcesWithProblems,a as discoverServiceManifestPaths,h as discoverStackNames,j as discoverStacks,i as getAllStacks,n as getResourceMetadata,k as getResourcesForStack,o as getStackMetadata,b as resetPrintedServiceWarnings,l as stackExists,d as warnAboutSkippedFiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-I7TGIK5N.js";import"./chunk-IGN5UC3P.js";import"./chunk-3XODDLRJ.js";import"./chunk-53L2JN7G.js";import"./chunk-5F7YP5IR.js";import"./chunk-YNCBBJ4V.js";import"./chunk-KJZUBHLO.js";export{c as classifyTiltPorts,a as findTiltPortOwner,b as isForeignTilt};
|
package/cli/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flisk-sh/flisk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Flisk CLI — start services on your machine.",
|
|
5
5
|
"homepage": "https://flisk.sh",
|
|
6
6
|
"repository": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"private": false,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"main": "./cli/dist/types/index.js",
|
|
15
16
|
"workspaces": [
|
|
16
17
|
"cli"
|
|
17
18
|
],
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __fliskRequire}from'node:module';const require=__fliskRequire(import.meta.url);
|
|
2
|
-
import{g as a,h as b,i as c,j as d}from"./chunk-SRN64OPO.js";import"./chunk-YL56J2WX.js";import"./chunk-7HR5PVOD.js";import"./chunk-K6SOCO6V.js";import"./chunk-TZNXL3IO.js";import"./chunk-VRESY4NR.js";import"./chunk-BB5BZ37Y.js";import"./chunk-KJZUBHLO.js";export{c as cloneProjectTemplate,a as enableDiscoveredStacks,d as projectCommand,b as templateTargetDir};
|