@flisk-sh/flisk 1.3.204 → 1.3.205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/cli/dist/cli.js +32 -9
- package/cli/dist/commands/project.js +4 -2
- package/cli/dist/commands/resource.js +3 -1
- package/cli/dist/utils/colima.js +23 -4
- package/cli/dist/utils/doctor-fix.js +35 -9
- package/cli/dist/utils/machine-output.js +27 -0
- package/cli/dist/utils/project-templates.js +1 -0
- package/cli/dist-bundle/{chunk-BS6G2SLM.js → chunk-4TMLNLYG.js} +1 -1
- package/cli/dist-bundle/{chunk-Z6UD7UZH.js → chunk-5G7E6CO2.js} +1 -1
- package/cli/dist-bundle/chunk-67M3DX6J.js +34 -0
- package/cli/dist-bundle/{chunk-WMF4AFAE.js → chunk-BHQDQQYQ.js} +1 -1
- package/cli/dist-bundle/{chunk-CBFVK3TF.js → chunk-CLQSJP6M.js} +1 -1
- package/cli/dist-bundle/chunk-GIMHTZNR.js +2 -0
- package/cli/dist-bundle/chunk-IQNUVQH5.js +52 -0
- package/cli/dist-bundle/{chunk-RFHMXJTK.js → chunk-P2MFLNY2.js} +1 -1
- package/cli/dist-bundle/{chunk-ZVGY7COV.js → chunk-WVSI4XL5.js} +1 -1
- package/cli/dist-bundle/{chunk-EPBYRJE3.js → chunk-YNJTA77W.js} +1 -1
- package/cli/dist-bundle/chunk-YZRPX76N.js +2 -0
- package/cli/dist-bundle/cli.js +223 -223
- package/cli/dist-bundle/{cold-preflight-FXOZ5SR5.js → cold-preflight-R53YXYOC.js} +1 -1
- package/cli/dist-bundle/{colima-4ID4BGHC.js → colima-SVZX2UML.js} +1 -1
- package/cli/dist-bundle/{open-UQ6DF3XN.js → open-PKNOQQXA.js} +1 -1
- package/cli/dist-bundle/project-I5QVEGNB.js +2 -0
- package/cli/dist-bundle/project-templates-JDRE7AVL.js +2 -0
- package/cli/dist-bundle/{tilt-port-owner-KLNX2ZI2.js → tilt-port-owner-Y5LHXWPS.js} +1 -1
- package/cli/package.json +4 -4
- package/engine/assets/docker/wake-gateway/Dockerfile +1 -1
- package/engine/topologies/platform/docker/compose/compose.star +20 -18
- package/engine/topologies/platform/docker/compose/unsafe_value.star +23 -0
- package/engine/topologies/platform/docker/networking/traefik.star +19 -0
- package/package.json +2 -2
- package/cli/dist-bundle/chunk-GD5676UE.js +0 -52
- package/cli/dist-bundle/chunk-MKJNQTIN.js +0 -2
- package/cli/dist-bundle/chunk-QSPFSZCS.js +0 -34
- package/cli/dist-bundle/project-GTYHCCFG.js +0 -2
- /package/cli/dist-bundle/{devtools-ZUHXW33W.js → devtools-MGITLOWZ.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to the `flisk` CLI. Versions match [npm](https://www.npmjs.com/package/@flisk-sh/flisk?activeTab=versions) and the [binary releases](https://github.com/flisk-sh/releases/releases).
|
|
4
4
|
|
|
5
|
+
## 1.3.195 (2026-10-21)
|
|
6
|
+
|
|
7
|
+
- `flisk demo` and `flisk restaurant` now clone the demo template into a fixed directory (`~/.flisk/flisk-demo/`) instead of creating `tdk-restaurant-example-N` directories in the current workspace. Previous runs are cleaned up automatically. The `restaurant` template still creates a named directory in the current folder when used explicitly.
|
|
8
|
+
|
|
9
|
+
## 1.3.194 (2026-10-21)
|
|
10
|
+
|
|
11
|
+
- `flisk open` now opens the frontend of the project that was started, not the current working directory. The one-command flow (`npx @flisk-sh/flisk demo`) boots the cloned project and opens its frontend automatically.
|
|
12
|
+
|
|
13
|
+
## 1.3.193 (2026-10-21)
|
|
14
|
+
|
|
15
|
+
- New `flisk open` command: opens the first ready frontend in the browser. Works with `--json` output and integrates with the one-command flow.
|
|
16
|
+
|
|
17
|
+
## 1.3.192 (2026-10-21)
|
|
18
|
+
|
|
19
|
+
- Fixed the one-command flow (`npx @flisk-sh/flisk demo`): the cloned project now boots in place and the browser opens when the stack is up. The CLI copy was updated from "tdk" to "Flisk" throughout.
|
|
20
|
+
|
|
21
|
+
## 1.3.191 (2026-10-21)
|
|
22
|
+
|
|
23
|
+
- One command from scratch: `npx @flisk-sh/flisk demo` (or `restaurant`, `saas`, `erp`, etc.) clones a starter, installs the CLI globally, boots the stack, and opens the frontend.
|
|
24
|
+
- CLI rebrand: all user-facing copy changed from "tdk" / "TDK" to "Flisk" / "flisk" (package scope, homepage, repository, command names, error messages, docs).
|
|
25
|
+
- Internal: `cli/src/utils/one-command.ts` added to run the stack and detect the frontend URL.
|
|
26
|
+
|
|
27
|
+
## 1.3.190 (2026-10-21)
|
|
28
|
+
|
|
29
|
+
- Package metadata corrected: `repository`, `bugs`, and `homepage` in `package.json` now point at `flisk-sh/flisk` and `https://flisk.sh` (were still pointing at the decommissioned `tdk-landscape/tdk-cli-core` and `tdk-landscape.github.io`).
|
|
30
|
+
|
|
5
31
|
## 1.3.189 (2026-10-21)
|
|
6
32
|
|
|
7
33
|
- `flisk resource` now reports a malformed `service.json` with the file path and the reason it could not be parsed, instead of a raw JSON error (#1685).
|
package/cli/dist/cli.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Copyright (c) 2026 Flisk Landscape contributors
|
|
3
3
|
// SPDX-License-Identifier: MIT
|
|
4
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
5
|
-
import {
|
|
4
|
+
import { existsSync, readdirSync, rmSync } from "node:fs";
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
6
7
|
import { cwd } from "node:process";
|
|
7
8
|
import chalk from "chalk";
|
|
8
9
|
import { showHelp } from "./commands/help.js";
|
|
@@ -34,14 +35,36 @@ if (templateArg) {
|
|
|
34
35
|
const runtimeNextSteps = formatRuntimeNextSteps(detectRuntimePrerequisites());
|
|
35
36
|
// A second demo in the same folder gets its own directory instead of failing.
|
|
36
37
|
const { nextAvailableProjectDir } = await import("./utils/one-command.js");
|
|
38
|
+
const { PROJECT_TEMPLATES } = await import("./utils/project-templates.js");
|
|
37
39
|
const baseName = templateTargetDir(templateArg, projectArg);
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const fixedDir = projectArg ? undefined : PROJECT_TEMPLATES[templateArg]?.fixedDir;
|
|
41
|
+
let targetName;
|
|
42
|
+
if (fixedDir) {
|
|
43
|
+
// A template with a fixed directory always lands in the same place, so a demo never
|
|
44
|
+
// leaves a new folder behind in whatever folder the command was typed in.
|
|
45
|
+
targetName = join(homedir(), ".flisk", fixedDir);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
targetName = nextAvailableProjectDir(baseName, (candidate) => {
|
|
49
|
+
const path = resolve(cwd(), candidate);
|
|
50
|
+
return existsSync(path) && readdirSync(path).length > 0;
|
|
51
|
+
});
|
|
52
|
+
if (targetName !== baseName) {
|
|
53
|
+
console.log(chalk.gray(`The folder ${baseName} is taken, using ${targetName} instead.`));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const destination = isAbsolute(targetName) ? targetName : resolve(cwd(), targetName);
|
|
57
|
+
if (fixedDir && existsSync(destination)) {
|
|
58
|
+
// The demo owns this directory, so a second run starts from a fresh copy of it.
|
|
59
|
+
if (existsSync(join(destination, ".tdk", "project.json"))) {
|
|
60
|
+
console.log(chalk.gray(`Refreshing the demo in ${destination}...`));
|
|
61
|
+
rmSync(destination, { recursive: true, force: true });
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.log(chalk.yellow(`${destination} already exists and is not a Flisk project.`));
|
|
65
|
+
console.log(chalk.gray(" Remove it, or use --project <dir> to put the demo somewhere else."));
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
45
68
|
}
|
|
46
69
|
await cloneProjectTemplate(templateArg, targetName, runtimeNextSteps);
|
|
47
70
|
const install = ensureGlobalInstall();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { execFileSync } from "node:child_process";
|
|
4
4
|
import { cpSync, existsSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
-
import { basename, dirname, join, resolve } from "node:path";
|
|
5
|
+
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
6
6
|
import { cwd } from "node:process";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
import chalk from "chalk";
|
|
@@ -101,7 +101,9 @@ export async function cloneProjectTemplate(templateName, targetDir, runtimeNextS
|
|
|
101
101
|
if (!isPathSafe(dirName)) {
|
|
102
102
|
errorFactories.invalidPath(dirName).exit();
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
// If targetDir is an absolute path, use it directly as the destination
|
|
105
|
+
// Otherwise resolve it relative to cwd()
|
|
106
|
+
const destination = isAbsolute(dirName) ? dirName : resolve(cwd(), dirName);
|
|
105
107
|
if (existsSync(destination) && readdirSync(destination).length > 0) {
|
|
106
108
|
errorFactories.directoryExists(destination).exit();
|
|
107
109
|
}
|
|
@@ -214,7 +214,9 @@ export function createPackageJson(name, type, frameworkId, prismaEnabled = false
|
|
|
214
214
|
// image's `bun run build` fails with TS2688. ^20 matches the services that build.
|
|
215
215
|
"@types/node": "^20.0.0",
|
|
216
216
|
typescript: "^7.0.2",
|
|
217
|
-
|
|
217
|
+
// The same version the CLI tests itself with (cli/package.json devDependencies.vitest).
|
|
218
|
+
// Dependabot pins it exactly to keep CVE-2026-112950 fixed, and the scaffold follows.
|
|
219
|
+
vitest: "5.0.5",
|
|
218
220
|
"@biomejs/biome": "^2.5.13",
|
|
219
221
|
// vitest 5 peers on vite ^6.4.0 || ^7 || ^8; vite 5 makes `vitest run` fail at startup with
|
|
220
222
|
// ERR_PACKAGE_PATH_NOT_EXPORTED ('./module-runner'), in every resource once it is hoisted.
|
package/cli/dist/utils/colima.js
CHANGED
|
@@ -114,10 +114,13 @@ export function checkColima(deps = defaultDeps()) {
|
|
|
114
114
|
export function planColimaRepair(status, dockerAnswers) {
|
|
115
115
|
if (!status.isColima)
|
|
116
116
|
return undefined;
|
|
117
|
+
// A Lima that is an x86_64 build on Apple Silicon, or a colima CLI that cannot see the VM because of it,
|
|
118
|
+
// needs a native limactl before anything else can start.
|
|
119
|
+
if (status.problem && /x86_64|rosetta|native arch|cannot see it/i.test(status.problem)) {
|
|
120
|
+
return "native-lima";
|
|
121
|
+
}
|
|
117
122
|
if (!status.running)
|
|
118
123
|
return "start";
|
|
119
|
-
if (status.problem?.includes("cannot see it"))
|
|
120
|
-
return "native-lima";
|
|
121
124
|
if (!dockerAnswers)
|
|
122
125
|
return "restart";
|
|
123
126
|
return undefined;
|
|
@@ -125,15 +128,31 @@ export function planColimaRepair(status, dockerAnswers) {
|
|
|
125
128
|
/** Runs a colima command with a native limactl first on PATH, when one is installed. */
|
|
126
129
|
export function nativeLimaPath(env = process.env) {
|
|
127
130
|
const home = env.HOME ?? "";
|
|
131
|
+
// Prefer the Apple Silicon Homebrew location first; an x86_64 limactl must never be treated as native.
|
|
128
132
|
const candidates = [
|
|
133
|
+
"/opt/homebrew/bin",
|
|
129
134
|
home ? `${home}/.local/bin` : "",
|
|
130
135
|
home ? `${home}/bin` : "",
|
|
131
|
-
"/opt/homebrew/bin",
|
|
132
136
|
].filter(Boolean);
|
|
133
137
|
for (const dir of candidates) {
|
|
134
138
|
const candidate = join(dir, "limactl");
|
|
135
139
|
try {
|
|
136
|
-
if (existsSync(candidate))
|
|
140
|
+
if (!existsSync(candidate))
|
|
141
|
+
continue;
|
|
142
|
+
// Verify the binary is actually a native (arm64/aarch64) build, not a Rosetta x86_64 one.
|
|
143
|
+
let archOutput = "";
|
|
144
|
+
try {
|
|
145
|
+
archOutput = execFileSync("file", ["-bL", candidate], {
|
|
146
|
+
encoding: "utf-8",
|
|
147
|
+
timeout: 5_000,
|
|
148
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
// `file` unavailable: fall back to accepting the candidate.
|
|
153
|
+
return dir;
|
|
154
|
+
}
|
|
155
|
+
if (/arm64|aarch64/i.test(archOutput))
|
|
137
156
|
return dir;
|
|
138
157
|
}
|
|
139
158
|
catch {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { execFile, execFileSync } from "node:child_process";
|
|
4
|
-
import { realpathSync, statfsSync } from "node:fs";
|
|
4
|
+
import { existsSync, realpathSync, statfsSync } from "node:fs";
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { promisify } from "node:util";
|
|
@@ -187,6 +187,26 @@ export function createDockerFixDeps(run = runDocker) {
|
|
|
187
187
|
export const dockerFixDeps = createDockerFixDeps();
|
|
188
188
|
/** Starts or restarts Colima, with a native limactl first on PATH when one is installed. */
|
|
189
189
|
async function runColima(action) {
|
|
190
|
+
if (action === "native-lima") {
|
|
191
|
+
let nativeDir = nativeLimaPath();
|
|
192
|
+
if (!nativeDir) {
|
|
193
|
+
// No native limactl on PATH: reinstall Lima through the native Homebrew, which pulls a native build on Apple Silicon.
|
|
194
|
+
const brewBin = existsSync("/opt/homebrew/bin/brew") ? "/opt/homebrew/bin/brew" : "brew";
|
|
195
|
+
await execFilePromise(brewBin, ["reinstall", "lima"], {
|
|
196
|
+
encoding: "utf-8",
|
|
197
|
+
timeout: 300_000,
|
|
198
|
+
});
|
|
199
|
+
nativeDir = nativeLimaPath();
|
|
200
|
+
if (!nativeDir) {
|
|
201
|
+
throw new Error("brew reinstall lima did not provide a native limactl");
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const env = nativeDir
|
|
205
|
+
? { ...process.env, PATH: `${nativeDir}:${process.env.PATH ?? ""}` }
|
|
206
|
+
: process.env;
|
|
207
|
+
await execFilePromise("colima", ["start"], { encoding: "utf-8", timeout: 300_000, env });
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
190
210
|
const nativeDir = nativeLimaPath();
|
|
191
211
|
const env = nativeDir
|
|
192
212
|
? { ...process.env, PATH: `${nativeDir}:${process.env.PATH ?? ""}` }
|
|
@@ -251,10 +271,10 @@ export async function planDoctorFixes(projectName, deps = dockerFixDeps, context
|
|
|
251
271
|
id: "colima:native-lima",
|
|
252
272
|
check: "Colima",
|
|
253
273
|
scope: "host",
|
|
254
|
-
command: nativeDir ? `PATH="${nativeDir}:$PATH" colima
|
|
255
|
-
status:
|
|
274
|
+
command: nativeDir ? `PATH="${nativeDir}:$PATH" colima start` : "brew reinstall lima",
|
|
275
|
+
status: "planned",
|
|
256
276
|
reason: nativeDir
|
|
257
|
-
? `the colima CLI on this PATH cannot see the VM; a native limactl is installed in ${nativeDir}
|
|
277
|
+
? `the colima CLI on this PATH cannot see the VM; a native limactl is installed in ${nativeDir}`
|
|
258
278
|
: "the colima CLI on this PATH cannot see the VM; lima is installed as an x86_64 build (brew reinstall lima)",
|
|
259
279
|
});
|
|
260
280
|
}
|
|
@@ -373,11 +393,17 @@ export async function applyDoctorFixes(actions, options, deps = dockerFixDeps) {
|
|
|
373
393
|
results.push({ ...action, status: "applied", reason: `colima ${what} ran` });
|
|
374
394
|
continue;
|
|
375
395
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
396
|
+
try {
|
|
397
|
+
await deps.colima("native-lima");
|
|
398
|
+
results.push({
|
|
399
|
+
...action,
|
|
400
|
+
status: "applied",
|
|
401
|
+
reason: "native lima repaired and colima started",
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
results.push({ ...action, status: "failed", reason: firstLine(error) });
|
|
406
|
+
}
|
|
381
407
|
continue;
|
|
382
408
|
}
|
|
383
409
|
if (action.id.startsWith("stop-tilt:")) {
|
|
@@ -5,6 +5,33 @@ export const SCHEMA_VERSION = 1;
|
|
|
5
5
|
export function createMachineEnvelope(data, errors = []) {
|
|
6
6
|
return { schemaVersion: SCHEMA_VERSION, data, errors };
|
|
7
7
|
}
|
|
8
|
+
function isMachineError(value) {
|
|
9
|
+
if (typeof value !== "object" || value === null)
|
|
10
|
+
return false;
|
|
11
|
+
const error = value;
|
|
12
|
+
if (typeof error.code !== "string" || typeof error.message !== "string")
|
|
13
|
+
return false;
|
|
14
|
+
if (error.suggestions !== undefined) {
|
|
15
|
+
if (!Array.isArray(error.suggestions))
|
|
16
|
+
return false;
|
|
17
|
+
if (!error.suggestions.every((item) => typeof item === "string"))
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
/** Narrows unknown JSON to the machine-output envelope used by CLI `--json` commands. */
|
|
23
|
+
export function isMachineOutputEnvelope(value) {
|
|
24
|
+
if (typeof value !== "object" || value === null)
|
|
25
|
+
return false;
|
|
26
|
+
const envelope = value;
|
|
27
|
+
if (envelope.schemaVersion !== SCHEMA_VERSION)
|
|
28
|
+
return false;
|
|
29
|
+
if (!("data" in envelope))
|
|
30
|
+
return false;
|
|
31
|
+
if (!Array.isArray(envelope.errors))
|
|
32
|
+
return false;
|
|
33
|
+
return envelope.errors.every(isMachineError);
|
|
34
|
+
}
|
|
8
35
|
export function toMachineError(error) {
|
|
9
36
|
if (error instanceof TdkError) {
|
|
10
37
|
return {
|
|
@@ -3,6 +3,7 @@ export const PROJECT_TEMPLATES = {
|
|
|
3
3
|
demo: {
|
|
4
4
|
repo: "https://github.com/flisk-sh/tdk-restaurant-example.git",
|
|
5
5
|
description: "The demo stack: restaurant ops with reservations, kitchen and floor control",
|
|
6
|
+
fixedDir: "flisk-demo",
|
|
6
7
|
},
|
|
7
8
|
restaurant: {
|
|
8
9
|
repo: "https://github.com/flisk-sh/tdk-restaurant-example.git",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{b as N}from"./chunk-
|
|
2
|
+
import{b as N}from"./chunk-YNJTA77W.js";import{G as O,O as m,Ta as f,c as $,d as C,fa as T,g as U,h as E,k as F,l as P,s as l,x as M}from"./chunk-CLQSJP6M.js";import{execFileSync as de,execSync as ue}from"node:child_process";import{existsSync as R,readdirSync as V,readFileSync as y}from"node:fs";import{basename as le,dirname as me,join as u,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 __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{O as h,Ta as D,Ua as L,fa as _,h as I,k as w,l as A,q as j,qa as x,s as T,x as F}from"./chunk-
|
|
2
|
+
import{O as h,Ta as D,Ua as L,fa as _,h as I,k as w,l as A,q as j,qa as x,s as T,x as F}from"./chunk-CLQSJP6M.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 S,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:"TDK_HTTP_PORT",ingressHttps:"TDK_HTTPS_PORT",postgres:"TDK_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=S(".tdk",".tdk-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=S(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=S(e,G);le(S(e,".tdk",".tdk-out"),{recursive:!0}),pe(r,`${JSON.stringify(t,null,2)}
|
|
4
4
|
`,{encoding:"utf-8",mode:384})}function Qe(e){process.env.TDK_HTTP_PORT=String(e.ingressHttp),process.env.TDK_HTTPS_PORT=String(e.ingressHttps),process.env.TDK_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=["TDK_HTTP_PORT","TDK_HTTPS_PORT","TDK_POSTGRES_PORT"].some(i=>process.env[i]);if(t.inspectDocker===!1&&r&&!s)return r;let n="";try{let i=JSON.parse(K(S(e,".tdk",w),"utf-8"));n=String(i?.project?.name??"tdk-project").replace(/-/g,"_").toLowerCase()}catch{n="tdk_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 $}from"node:child_process";import{existsSync as C,readdirSync as Te,readFileSync as N}from"node:fs";import{createServer as Se}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 b=1e4,z=3e3,be="http://localhost:4873";function X(e){return`'${e.replace(/'/g,"'\\''")}'`}function y(e,t,r,s,n){return process.platform==="win32"?Q(F(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(`
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
+
import{a as O}from"./chunk-GIMHTZNR.js";import{b as N,c as pe,d as q,i as D,j as Y,n as J,o as I,q as C}from"./chunk-BHQDQQYQ.js";import{H as z,J as G,L as E,Na as re,Ra as ae,Sa as se,Ua as ie,V as T,W as B,Wa as ce,Xa as le,Ya as de,aa as f,ba as y,ca as t,d as x,ja as ne,k as U,ka as W,la as V,m as P,s as F}from"./chunk-CLQSJP6M.js";import{b as p}from"./chunk-CF46CD6R.js";import{execFileSync as ye}from"node:child_process";import{cpSync as be,existsSync as b,readdirSync as Se,readFileSync as K,writeFileSync as je}from"node:fs";import{basename as _e,dirname as we,isAbsolute as xe,join as j,resolve as M}from"node:path";import{cwd as ue}from"node:process";import{fileURLToPath as Pe}from"node:url";import{Command as Ee}from"commander";var he="-y, --yes",ke="Skip prompts and confirmations; use defaults";function fe(e,o=ke){return e.option(he,o,!1)}async function ve(e,o=!0){let c=await I({message:e,initial:o});return c||T(),c}function De(e,o=1){e.valid||E(e.error??"Validation failed",o)}function Je(e,o,c,a){return e.dryRun?(a?a():(console.log(`Dry run - ${o}`),console.log(`Would run: ${c}`)),!0):!1}async function Ie(e,o){return await ve(e,!0)?!0:(o&&o(),!1)}var L=new Map;function me(e){e!==void 0?L.delete(e):L.clear()}function ze(e=!1){let o=F(),c=o??"";if(!e){let r=L.get(c);if(r)return r}let{resources:a,problems:l}=o?ae(o):{resources:ie(),problems:[]},d=de(a),n=le(a);se(l);let g=a.filter(r=>!r.stack),m=new Map;for(let r of a)if(r.stack){let _=m.get(r.stack)||[];_.push(r),m.set(r.stack,_)}let k={resources:a,problems:l,stacks:d,stackNames:n,unassignedResources:g,resourcesByStack:m};return L.set(c,k),k}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 TDK_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 ce(e,o)}catch{return[]}}function Ce(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 c=Ce(e),a=o.filter(l=>!c.has(l));return a.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,...a])),a)}function mt(e,o){let c=j(e,".tdk",U);if(!b(c))return[];let a=D(e),l=Q(a,H(e,o));return l.length>0&&N(c,a),l}function Oe(){return Object.values(A).filter(e=>e.enabled_by_default&&e.category==="core").map(e=>e.name)}function Ae(e,o){return o||(O[e]?.repo.split("/").pop()??e).replace(/\.git$/,"")}async function Re(e,o,c){let a=O[e];if(!a){console.log(p.red(`
|
|
3
|
+
\u274C Unknown template: "${e}"`)),console.log(p.yellow(`
|
|
4
|
+
Available templates:`));for(let[n,g]of Object.entries(O))console.log(` ${p.cyan(n)} ${p.gray(`- ${g.description}`)}`);console.log(p.gray("\nOr run `flisk project` with no template for a blank project.")),process.exit(1)}let l=Ae(e,o);re(l)||z.invalidPath(l).exit();let d=xe(l)?l:M(ue(),l);b(d)&&Se(d).length>0&&z.directoryExists(d).exit(),B(`Cloning template: ${e}`),t(`${a.description}
|
|
5
|
+
`,0),t(`Source: ${a.bundledPath?"bundled Flisk example":a.repo}`,0),t(`Destination: ${d}
|
|
6
|
+
`,0);try{if(a.bundledPath){let n=M(we(Pe(new URL("../dist/commands/project.js",import.meta.url).href)),"../../../");be(M(n,a.bundledPath),d,{recursive:!0});let g=_e(d).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 k=j(d,m),r=K(k,"utf-8");je(k,r.replaceAll("tdk_example",g))}}else ye("git",["clone",a.repo,d],{stdio:"inherit"})}catch{E(a.bundledPath?"Bundled example copy failed. Reinstall the Flisk CLI package and try again.":"git clone failed. Check you have git installed and network access.")}me(),console.log(p.green(`
|
|
7
|
+
\u2705 Cloned "${e}" into ${l}/`)),t(`
|
|
8
|
+
Next steps:`,0),t(`1. cd ${l}`),t("2. flisk doctor # check Docker/Tilt are ready"),t("3. flisk up # start the stack"),t(`
|
|
9
|
+
Runtime readiness:`,0);for(let n of c)t(n,0)}var R={version:"1.0",project:{name:"",version:"1.0.0"},phases:{pre_alpha:{name:"Pre-Alpha",description:"Core infrastructure and MVP services",enabledStacks:Oe()},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:{}},ut=fe(new Ee("project")).description("Initialize or validate project-level master configuration").argument("[template]",`Clone a starter example instead of a blank project (${Object.keys(O).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").action(async(e,o)=>{let{assertMachineReadyOrExit:c,detectRuntimePrerequisites:a,formatRuntimeNextSteps:l}=await import("./cold-preflight-R53YXYOC.js");await c({scope:"scaffold"});let d=l(a());if(e){await G(async()=>Re(e,o.path,d));return}await G(async()=>{let n=F();n||(n=ue(),y(`\u{1F680} Initializing new Flisk project...
|
|
10
|
+
`),t(`Location: ${n}
|
|
11
|
+
`,0));let g=j(n,".tdk"),m=j(g,U);if(o.check){let i=P.every(u=>b(j(n,".tdk",".tdk-out",u))),h=b(m);if(i&&h){let u=D(n);f("Project configuration is valid"),t(`Project: ${u.project.name}`,3),t(`Phases: ${Object.keys(u.phases).join(", ")}`,3),process.exit(0)}else{if(console.log(p.yellow("\u26A0\uFE0F Project configuration incomplete:")),h||t(".tdk/project.json (not found)",3),!i)for(let u of P.filter(S=>!b(j(n,".tdk/.tdk-out",S))))t(`.tdk/.tdk-out/${u} (not found)`,3);t("Run `flisk project` to create them."),process.exit(1)}}B("Project Configuration"),t(`Project root: ${n}
|
|
12
|
+
`,0),b(g)||(pe(g),f("Created: .tdk/ directory"));let k=b(m);if(k&&!o.force){f(".tdk/project.json exists");let i=JSON.parse(K(m,"utf-8")),h=D(n),u=H(n),S=Q(h,u);if((S.length>0||!i.phases)&&N(m,h),S.length>0&&t(`Auto-enabled discovered service stacks: ${S.join(", ")}`,0),y(`
|
|
13
|
+
\u{1F4CB} Regenerating master configuration files...
|
|
14
|
+
`),await Y(n),V(n))f("Created: .env (the defaults work as-is)");else{let v=W(n);v.length>0&&f(`Updated: .env (added ${v.join(", ")}; existing values unchanged)`)}let $=q(n);$.length>0&&f(`Added to .gitignore: ${$.join(", ")}`),console.log(p.green(`
|
|
15
|
+
\u2705 Project configuration regenerated!`)),t(`
|
|
16
|
+
Generated in .tdk/.tdk-out/:`,0);for(let v of P)t(`- ${v}`);t(`
|
|
17
|
+
Runtime readiness:`,0);for(let v of d)t(v,0);return}if(k&&o.force&&!o.yes&&(console.log(p.red(`
|
|
18
|
+
\u26A0\uFE0F WARNING: --force will overwrite .tdk/project.json!`)),!await I({message:"This will reset your project configuration. Continue?",initial:!1}))){T();return}let r,_=H(n);if(o.configFile){let i=M(o.configFile);b(i)||E(`Config file not found: ${i}`);let h=K(i,"utf-8");r=JSON.parse(h),f(`Loaded config from: ${i}`)}else if(o.yes)r=JSON.parse(JSON.stringify(R)),r.project.name=n.split("/").pop()||"my-project",console.log(p.gray("Using default configuration (non-interactive mode)"));else{y(`\u{1F4DD} Project Setup Wizard
|
|
19
|
+
`);let i=await J({message:"Project name:",initial:n.split("/").pop()||"my-project",validate:s=>s.trim()!==""||"Project name is required"}),h=await J({message:"Project version:",initial:"1.0.0-alpha"}),u=Object.values(A).filter(s=>s.category==="core"&&s.phase==="pre_alpha"),S=new Set(u.map(s=>s.name)),te=await C({message:"Select Pre-Alpha enabled stacks (core infrastructure):",choices:[...u.map(s=>({title:s.description,value:s.name,selected:s.enabled_by_default})),..._.filter(s=>!S.has(s)).map(s=>({title:`${s} (discovered service stack)`,value:s,selected:!0}))]}),$=await C({message:"Select Alpha enabled stacks (core business):",choices:[{title:"api (Backend API)",value:"api"},{title:"app (Frontend app)",value:"app"}]}),v=await C({message:"Select Beta enabled stacks (extended features):",choices:[{title:"worker (Background jobs)",value:"worker"},{title:"migrator (Database migrations)",value:"migrator"}]}),w=await C({message:"Enable optional infrastructure (high resource):",choices:Object.values(A).filter(s=>s.category==="optional").concat(Object.values(A).filter(s=>s.category==="premium")).map(s=>({title:s.description,value:s.name,selected:s.enabled_by_default}))});y(`
|
|
20
|
+
\u{1F4C2} Service discovery`),t("What: folder patterns Flisk scans for a service.json in each match."),t("Where: type one or more globs, comma-separated."),t("How: saved as discovery.paths in .tdk/project.json - editable later."),t(`Example: ${R.discovery.paths.join(", ")}
|
|
21
|
+
`);let ge=await J({message:"Folders to scan:",initial:R.discovery.paths.join(", ")});r=JSON.parse(JSON.stringify(R)),r.project.name=i,r.project.version=h,r.phases.pre_alpha.enabledStacks=Array.from(new Set(te)),r.phases.alpha.enabledStacks=Array.from(new Set($)),r.phases.beta.enabledStacks=Array.from(new Set(v)),r.optional_infra.monitoring=w.includes("monitoring"),r.optional_infra.elk=w.includes("elk"),r.optional_infra.debezium=w.includes("debezium"),r.optional_infra.golden_image=w.includes("golden_image"),r.optional_infra.verdaccio=w.includes("verdaccio");let oe=ge.split(",").map(s=>s.trim()).filter(s=>s.length>0);r.discovery.paths=oe.length>0?oe:R.discovery.paths}let X=Q(r,_);if(X.length>0&&t(`Auto-enabled discovered service stacks: ${X.join(", ")}`,0),y(`
|
|
22
|
+
\u{1F4CB} Creating project configuration...
|
|
23
|
+
`),N(m,r),f("Created: .tdk/project.json"),t(`\u2192 Project: ${r.project.name}`),y(`
|
|
24
|
+
\u{1F4CB} Generating master configuration files...
|
|
25
|
+
`),await Y(n),y(`
|
|
26
|
+
\u{1F527} Setting up environment variables...
|
|
27
|
+
`),V(n))f("Created: .env (the defaults work as-is)");else{let i=W(n);i.length>0?f(`Updated: .env (added ${i.join(", ")}; existing values unchanged)`):f("Found: .env (environment already configured)")}let Z=ne(n);if(Z.missing.length>0){console.log(p.yellow(`
|
|
28
|
+
\u26A0\uFE0F Missing required environment variables:`));for(let i of Z.missing)t(`- ${i}`,1);t("\u2192 Edit .env and fill in these values before running `flisk up`",1)}let ee=q(n);ee.length>0&&f(`Added to .gitignore: ${ee.join(", ")}`),console.log(p.green(`
|
|
29
|
+
\u2705 Project configuration complete!`)),t(`
|
|
30
|
+
Generated files in .tdk/.tdk-out/:`,0);for(let i of P)t(`- ${i}`);t(`
|
|
31
|
+
Environment configuration:`,0),t("- .env (contains all required variables)"),t(`
|
|
32
|
+
Source file:`,0),t("- .tdk/project.json (edit this to change project structure)"),t(`
|
|
33
|
+
Next steps:`,0),t("1. flisk resource api --type backend --stack app # scaffold a service"),t("2. flisk up app # start it"),t(`
|
|
34
|
+
Runtime readiness:`,0);for(let i of d)t(i,0);t("\nAfter editing .tdk/project.json, run `flisk config regenerate`.",0)})});export{me as a,ze as b,fe as c,De as d,Je as e,Ie as f,mt as g,Ae as h,Re as i,ut as j};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{c as z,e as Q}from"./chunk-42IVF3YT.js";import{Fa as J,Ga as B,Qa as O,Ta as Y,cb as X,d as v,e as k,g as q,ga as L,h as x,i as P,j as F,k as W,l as A,p as d,q as N}from"./chunk-
|
|
2
|
+
import{c as z,e as Q}from"./chunk-42IVF3YT.js";import{Fa as J,Ga as B,Qa as O,Ta as Y,cb as X,d as v,e as k,g as q,ga as L,h as x,i as P,j as F,k as W,l as A,p as d,q as N}from"./chunk-CLQSJP6M.js";import{b as V}from"./chunk-CF46CD6R.js";import{a as $}from"./chunk-6EA4DGCY.js";import{appendFileSync as le,existsSync as C,mkdirSync as fe,readFileSync as de,writeFileSync as Z}from"node:fs";import{dirname as pe,resolve as w}from"node:path";function ft(t,e,n){for(let[r,s]of e.entries())console.log(V.blue(`${s.emoji} ${s.description}...`)),s.type==="json"?me(t,s.filename,s.content):he(t,s.filename,String(s.content)),n&&n(s,r,e.length)}function ue(t,e,n=2){let r=`${JSON.stringify(e,null,n)}
|
|
3
3
|
`;Z(t,r,"utf-8")}function me(t,e,n,r=2){let s=w(t,e);ue(s,n,r)}function U(t,e){Z(t,e,"utf-8")}function he(t,e,n){let r=w(t,e);U(r,n)}function dt(t){C(t)||fe(t,{recursive:!0})}var ge=[".env",".tdk/.tdk-out/",".tdk/.project-id",".tdk/smoke/","node_modules/"];function Se(t){let e=w(t,".gitignore"),n=C(e)?de(e,"utf-8"):"",r=new Set(n.split(`
|
|
4
4
|
`).map(f=>f.trim().replace(/\/$/,""))),s=ge.filter(f=>!r.has(f.replace(/\/$/,"")));if(s.length===0)return[];let c=n&&!n.endsWith(`
|
|
5
5
|
`)?`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
-
import{b as f}from"./chunk-CF46CD6R.js";var ar="Container Runtime",_="bring-your-own";var De="database-management",cr=".tiltignore",Ie="service.json",Q="docker-compose.yml",ur=".autogenerated",Ct="TILT_TECH_STACK.star",Dt="TILT_RESOURCE_DEFAULTS.star",B="project.json",je="package.json",fr=[Ct,Dt,"spec.master"],pr=["backend","frontend","library","sdk","worker","migrator","mcp","agent",_],lr={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"],[_]:[]};var Z=["monitoring","elk","debezium","golden_image","verdaccio"],dr={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"},[_]:{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"}},mr={tiltUi:10350,traefik:8080},ee="https://flisk.sh/docs/quickstart/";var Ne=["node_modules",".git",".tilt",".tilt-engine","dist","build",".prisma",".turbo","coverage","tmp","temp","__tests__","test","tests",".github",".vscode","docs"],Pe=["Dockerfile",Q,"docker-compose.yaml","Tiltfile","vite.config.ts","tsconfig.json","tsconfig.build.json"],It={infra:"\u{1F3D7}\uFE0F",core:"\u{1F527}",api:"\u26A1",app:"\u{1F3A8}",orchestrator:"\u2699\uFE0F"};function hr(e){let t=e.toLowerCase();for(let[n,r]of Object.entries(It))if(t.includes(n))return r;return"\u{1F4E6}"}import{existsSync as Nt}from"node:fs";import{dirname as Pt,join as Ft,resolve as Ue}from"node:path";import{cwd as Ut}from"node:process";var Fe={name:"tdk-cli-internal",private:!0,version:"1.3.204",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/tdk.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 .","lint:fix":"biome check . --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":"^22.0.0","@types/react":"^19.3.0","@vitest/coverage-v8":"^5.0.2",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.0"},engines:{node:">=22.12.0"}};function E(e=Ut()){let t=Ue(e),n=Ue("/");for(;t!==n;){if(Nt(Ft(t,".tdk",B)))return t;let r=Pt(t);if(r===t)break;t=r}return null}var V=null;function Mt(){if(V)return V;let e=Fe;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return V={name:String(t.name??"@flisk-sh/flisk"),version:String(t.version??"0.0.0"),fullPackage:t},V}function wr(){return Mt().version}import{existsSync as Me}from"node:fs";import{delimiter as Le,extname as Be,join as Ve}from"node:path";import{delimiter as br,extname as Lt}from"node:path";function U(){return process.platform==="win32"}function Bt(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Vt(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Gt(e,t){let n=Bt(e),r=Vt(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let o=`tdk-${n}-${r}`;return n==="windows"?`${o}.exe`:o}function Ar(){return Gt(process.platform,process.arch)}function Rr(){return U()?"tdk.exe":"flisk"}function te(e,t=U()){return t?Lt(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function G(e){let t=process.env.PATH??process.env.Path??"",n=U(),r=te(e,n);if(n&&!Be(e))for(let o of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let s=o.toLowerCase();s&&!r.includes(`${e}${s}`)&&r.push(`${e}${s}`)}for(let o of t.split(Le))if(o)for(let s of r){let i=Ve(o,s);if(Me(i))return i}return null}function Ir(e){let t=process.env.PATH??process.env.Path??"",n=U(),r=te(e,n);if(n&&!Be(e))for(let i of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let a=i.toLowerCase();a&&!r.includes(`${e}${a}`)&&r.push(`${e}${a}`)}let o=[],s=new Set;for(let i of t.split(Le))if(i)for(let a of r){let c=Ve(i,a);if(!Me(c))continue;let p=n?c.toLowerCase():c;s.has(p)||(s.add(p),o.push(c))}return o}import{execFileSync as Wt,execSync as Kt}from"node:child_process";var Ge=1e4;function We(){let e=!1;if(process.platform==="win32")try{return Wt(G("docker")??"docker",["ps"],{stdio:"ignore",timeout:Ge,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Kt(t,{stdio:"ignore",timeout:Ge}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function W(e,t){return e[t]??0}function Ht(e,t){let n=Array.from({length:t.length+1},(r,o)=>o);for(let r=1;r<=e.length;r++){let o=[r];for(let s=1;s<=t.length;s++){let i=e[r-1]===t[s-1]?0:1;o[s]=Math.min(W(o,s-1)+1,W(n,s)+1,W(n,s-1)+i)}n=o}return W(n,t.length)}function zt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length-1;n++)if(e[n]!==t[n]&&e[n]===t[n+1]&&e[n+1]===t[n]&&e.slice(0,n)===t.slice(0,n)&&e.slice(n+2)===t.slice(n+2))return!0;return!1}function Ke(e,t){if(e.length<2||t.length===0||t.includes(e))return;let n=e.toLowerCase(),r,o=Number.POSITIVE_INFINITY;for(let s of t){if(s.length===0)continue;let i=s.toLowerCase(),a=zt(n,i)?1:Ht(n,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(n.length,i.length)/3)));a>c||(a<o||a===o&&(r===void 0||s<r))&&(r=s,o=a)}return r}import{spawn as Jt}from"node:child_process";import{join as qt}from"node:path";function Yt(e,t=[],n={}){return new Promise((r,o)=>{let s=[e,...t];n.verbose&&console.log(`Executing: tilt ${s.join(" ")}`);let i=Jt(G("tilt")??"tilt",s,{stdio:n.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:n.timeoutMs}),a="",c="";n.inheritStdio||(i.stdout?.on("data",p=>{a+=p.toString()}),i.stderr?.on("data",p=>{c+=p.toString()})),i.on("close",p=>{r({exitCode:p??1,stdout:a,stderr:c})}),i.on("error",p=>{o(new Error(`Failed to spawn tilt: ${p.message}`))})})}async function He(){try{return(await Yt("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Xt(){let e=E();if(!e)throw $.notInProject();return qt(e,".tdk",".tdk-out","Tiltfile")}function ze(e){let t=Xt();e.push("-f",t)}function Wr(e,t={}){let n=[];return ze(n),t.focusTargets&&t.focusTargets.length>0&&n.push("--",`--focus=${t.focusTargets.join(",")}`),n.push(...e),t.verbose&&!t.quiet&&n.push("--verbose"),t.watch&&n.push("--watch"),n}function Kr(e={}){let t=[];return ze(t),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function Je(e){return e instanceof Error?e.message:String(e)}function Zr(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${Je(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var S=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){oe(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}},re=class extends Error{code;constructor(t=1){super(`process.exit(${t})`),this.name="ProcessExitError",this.code=t}};function ne(e,t,n=!1){let r=new Set;for(let o of e){let s=Ke(o,t);s&&r.add(n?`Did you mean "${s}" for "${o}"?`:`Did you mean "${s}"?`)}return[...r]}var $={tiltNotInstalled:()=>new S("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: ${ee}`]),dockerNotAvailable:()=>new S("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: ${ee}`]),dockerNotResponding:()=>new S("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 S(`Stack "${e}" not found`,[...ne([e],t),"Run `flisk stacks` to see available stacks","Run `flisk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new S(`Resource "${e}" not found`,[...ne([e],t),"Run `flisk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=ne(e,t,e.length>1);return new S(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new S(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new S(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new S("Could not find project root (no .tdk/project.json found)",["Run this from within a Flisk project","Run `flisk project --yes` to initialize a new project"])};function eo(){let e=E();return e||$.notInProject().exit()}function Qt(e){e instanceof S&&e.exit(),oe(Je(e)),process.exit(1)}async function Zt(e,t){try{return await e()}catch(n){if(n instanceof re)throw n;return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),Qt(n)}}async function to(e,t){let n=[],r=We();return r==="unresponsive"?n.push($.dockerNotResponding()):r==="missing"&&n.push($.dockerNotAvailable()),await He()||n.push($.tiltNotInstalled()),n.length>0&&(console.error(f.red(`
|
|
2
|
+
import{b as f}from"./chunk-CF46CD6R.js";var ar="Container Runtime",_="bring-your-own";var De="database-management",cr=".tiltignore",Ie="service.json",Q="docker-compose.yml",ur=".autogenerated",Ct="TILT_TECH_STACK.star",Dt="TILT_RESOURCE_DEFAULTS.star",B="project.json",je="package.json",fr=[Ct,Dt,"spec.master"],pr=["backend","frontend","library","sdk","worker","migrator","mcp","agent",_],lr={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"],[_]:[]};var Z=["monitoring","elk","debezium","golden_image","verdaccio"],dr={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"},[_]:{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"}},mr={tiltUi:10350,traefik:8080},ee="https://flisk.sh/docs/quickstart/";var Ne=["node_modules",".git",".tilt",".tilt-engine","dist","build",".prisma",".turbo","coverage","tmp","temp","__tests__","test","tests",".github",".vscode","docs"],Pe=["Dockerfile",Q,"docker-compose.yaml","Tiltfile","vite.config.ts","tsconfig.json","tsconfig.build.json"],It={infra:"\u{1F3D7}\uFE0F",core:"\u{1F527}",api:"\u26A1",app:"\u{1F3A8}",orchestrator:"\u2699\uFE0F"};function hr(e){let t=e.toLowerCase();for(let[n,r]of Object.entries(It))if(t.includes(n))return r;return"\u{1F4E6}"}import{existsSync as Nt}from"node:fs";import{dirname as Pt,join as Ft,resolve as Ue}from"node:path";import{cwd as Ut}from"node:process";var Fe={name:"tdk-cli-internal",private:!0,version:"1.3.205",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/tdk.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 .","lint:fix":"biome check . --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"}};function E(e=Ut()){let t=Ue(e),n=Ue("/");for(;t!==n;){if(Nt(Ft(t,".tdk",B)))return t;let r=Pt(t);if(r===t)break;t=r}return null}var V=null;function Mt(){if(V)return V;let e=Fe;if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid package.json: expected object");let t=e;return V={name:String(t.name??"@flisk-sh/flisk"),version:String(t.version??"0.0.0"),fullPackage:t},V}function wr(){return Mt().version}import{existsSync as Me}from"node:fs";import{delimiter as Le,extname as Be,join as Ve}from"node:path";import{delimiter as br,extname as Lt}from"node:path";function U(){return process.platform==="win32"}function Bt(e){return e==="linux"?"linux":e==="darwin"?"darwin":e==="win32"?"windows":null}function Vt(e){return e==="x64"?"amd64":e==="arm64"?"arm64":null}function Gt(e,t){let n=Bt(e),r=Vt(t);if(!n||!r||n==="windows"&&r!=="amd64")return null;let o=`tdk-${n}-${r}`;return n==="windows"?`${o}.exe`:o}function Ar(){return Gt(process.platform,process.arch)}function Rr(){return U()?"tdk.exe":"flisk"}function te(e,t=U()){return t?Lt(e)?[e]:[e,`${e}.exe`,`${e}.cmd`,`${e}.bat`]:[e]}function G(e){let t=process.env.PATH??process.env.Path??"",n=U(),r=te(e,n);if(n&&!Be(e))for(let o of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let s=o.toLowerCase();s&&!r.includes(`${e}${s}`)&&r.push(`${e}${s}`)}for(let o of t.split(Le))if(o)for(let s of r){let i=Ve(o,s);if(Me(i))return i}return null}function Ir(e){let t=process.env.PATH??process.env.Path??"",n=U(),r=te(e,n);if(n&&!Be(e))for(let i of(process.env.PATHEXT??".EXE;.CMD;.BAT;.COM").split(";")){let a=i.toLowerCase();a&&!r.includes(`${e}${a}`)&&r.push(`${e}${a}`)}let o=[],s=new Set;for(let i of t.split(Le))if(i)for(let a of r){let c=Ve(i,a);if(!Me(c))continue;let p=n?c.toLowerCase():c;s.has(p)||(s.add(p),o.push(c))}return o}import{execFileSync as Wt,execSync as Kt}from"node:child_process";var Ge=1e4;function We(){let e=!1;if(process.platform==="win32")try{return Wt(G("docker")??"docker",["ps"],{stdio:"ignore",timeout:Ge,windowsHide:!0}),"running"}catch(t){return t.code==="ETIMEDOUT"?"unresponsive":"missing"}for(let t of["docker ps","colima status","podman ps"])try{return Kt(t,{stdio:"ignore",timeout:Ge}),"running"}catch(n){n.code==="ETIMEDOUT"&&(e=!0)}return e?"unresponsive":"missing"}function W(e,t){return e[t]??0}function Ht(e,t){let n=Array.from({length:t.length+1},(r,o)=>o);for(let r=1;r<=e.length;r++){let o=[r];for(let s=1;s<=t.length;s++){let i=e[r-1]===t[s-1]?0:1;o[s]=Math.min(W(o,s-1)+1,W(n,s)+1,W(n,s-1)+i)}n=o}return W(n,t.length)}function zt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length-1;n++)if(e[n]!==t[n]&&e[n]===t[n+1]&&e[n+1]===t[n]&&e.slice(0,n)===t.slice(0,n)&&e.slice(n+2)===t.slice(n+2))return!0;return!1}function Ke(e,t){if(e.length<2||t.length===0||t.includes(e))return;let n=e.toLowerCase(),r,o=Number.POSITIVE_INFINITY;for(let s of t){if(s.length===0)continue;let i=s.toLowerCase(),a=zt(n,i)?1:Ht(n,i),c=Math.max(1,Math.min(2,Math.floor(Math.max(n.length,i.length)/3)));a>c||(a<o||a===o&&(r===void 0||s<r))&&(r=s,o=a)}return r}import{spawn as Jt}from"node:child_process";import{join as qt}from"node:path";function Yt(e,t=[],n={}){return new Promise((r,o)=>{let s=[e,...t];n.verbose&&console.log(`Executing: tilt ${s.join(" ")}`);let i=Jt(G("tilt")??"tilt",s,{stdio:n.inheritStdio?"inherit":"pipe",shell:!1,windowsHide:process.platform==="win32",timeout:n.timeoutMs}),a="",c="";n.inheritStdio||(i.stdout?.on("data",p=>{a+=p.toString()}),i.stderr?.on("data",p=>{c+=p.toString()})),i.on("close",p=>{r({exitCode:p??1,stdout:a,stderr:c})}),i.on("error",p=>{o(new Error(`Failed to spawn tilt: ${p.message}`))})})}async function He(){try{return(await Yt("version",[],{inheritStdio:!1,timeoutMs:1e4})).exitCode===0}catch{return!1}}function Xt(){let e=E();if(!e)throw $.notInProject();return qt(e,".tdk",".tdk-out","Tiltfile")}function ze(e){let t=Xt();e.push("-f",t)}function Wr(e,t={}){let n=[];return ze(n),t.focusTargets&&t.focusTargets.length>0&&n.push("--",`--focus=${t.focusTargets.join(",")}`),n.push(...e),t.verbose&&!t.quiet&&n.push("--verbose"),t.watch&&n.push("--watch"),n}function Kr(e={}){let t=[];return ze(t),e.focusTargets&&e.focusTargets.length>0&&t.push("--",`--focus=${e.focusTargets.join(",")}`),t}function Je(e){return e instanceof Error?e.message:String(e)}function Zr(e,t){if(process.env.TDK_VERBOSE){let n=t!==void 0?`: ${Je(t)}`:"";console.warn(f.gray(`${e}${n}`))}}var S=class extends Error{suggestions;exitCode;constructor(t,n=[],r=1){super(t),this.name="TdkError",this.suggestions=n,this.exitCode=r}display(){oe(this.message,void 0,this.suggestions)}exit(){this.display(),process.exit(this.exitCode)}},re=class extends Error{code;constructor(t=1){super(`process.exit(${t})`),this.name="ProcessExitError",this.code=t}};function ne(e,t,n=!1){let r=new Set;for(let o of e){let s=Ke(o,t);s&&r.add(n?`Did you mean "${s}" for "${o}"?`:`Did you mean "${s}"?`)}return[...r]}var $={tiltNotInstalled:()=>new S("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: ${ee}`]),dockerNotAvailable:()=>new S("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: ${ee}`]),dockerNotResponding:()=>new S("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 S(`Stack "${e}" not found`,[...ne([e],t),"Run `flisk stacks` to see available stacks","Run `flisk stack` to assign resources to a stack"]),resourceNotFound:(e,t=[])=>new S(`Resource "${e}" not found`,[...ne([e],t),"Run `flisk resources` to list all resources","Check the resource name spelling"]),unknownServices:(e,t)=>{let n=ne(e,t,e.length>1);return new S(`Unknown service ${e.join(", ")}. Valid names: ${t.join(", ")}`,n,2)},directoryExists:e=>new S(`Directory already exists: ${e}`,["Use `--path` to specify a different location","Remove the existing directory if no longer needed"]),invalidPath:e=>new S(`Invalid path: ${e}`,["Path must be within the project directory",'Path cannot contain special characters like <>:"|?*']),notInProject:()=>new S("Could not find project root (no .tdk/project.json found)",["Run this from within a Flisk project","Run `flisk project --yes` to initialize a new project"])};function eo(){let e=E();return e||$.notInProject().exit()}function Qt(e){e instanceof S&&e.exit(),oe(Je(e)),process.exit(1)}async function Zt(e,t){try{return await e()}catch(n){if(n instanceof re)throw n;return t?.verbose&&n instanceof Error&&n.stack&&console.error(f.gray(n.stack)),Qt(n)}}async function to(e,t){let n=[],r=We();return r==="unresponsive"?n.push($.dockerNotResponding()):r==="missing"&&n.push($.dockerNotAvailable()),await He()||n.push($.tiltNotInstalled()),n.length>0&&(console.error(f.red(`
|
|
3
3
|
Flisk can't start - missing prerequisites:
|
|
4
4
|
`)),n.forEach((o,s)=>{s>0&&console.error(""),o.display()}),console.error(f.gray("\nRun `flisk doctor` for a full environment check.")),process.exit(1)),Zt(e,t)}function no(e,t=1,n){oe(e,void 0,n),process.exit(t)}function oe(e,t,n){if(console.error(f.red(`\u274C ${e}`)),t&&console.error(f.gray(` ${t}`)),n&&n.length>0){console.error(f.yellow(`
|
|
5
5
|
\u{1F4A1} Suggestions:`));for(let r of n)console.error(f.cyan(` \u2192 ${r}`))}}function ro(e,t){console.error(f.red(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
+
var s={demo:{repo:"https://github.com/flisk-sh/tdk-restaurant-example.git",description:"The demo stack: restaurant ops with reservations, kitchen and floor control",fixedDir:"flisk-demo"},restaurant:{repo:"https://github.com/flisk-sh/tdk-restaurant-example.git",description:"Restaurant ops: reservations, kitchen, floor control (Hono + Vite + Bun)"},saas:{repo:"https://github.com/flisk-sh/tdk-saas-starter.git",description:"SaaS starter: account dashboard and a working checkout button (Hono + Vite + Bun)"},erp:{repo:"https://github.com/flisk-sh/tdk-erp-system.git",description:"Enterprise ERP: 100 microservices across 7 business domains"},"user-management":{repo:"https://github.com/flisk-sh/tdk-user-management.git",description:"User/auth management services"},ecommerce:{repo:"https://github.com/flisk-sh/tdk-ecommerce-example.git",description:"Vue 3 storefront and Hono catalog API (needs Flisk 1.3.75+ for --framework vue)"},example:{repo:"https://github.com/flisk-sh/tdk-example.git",bundledPath:"examples/tdk-example",description:"Hono + Postgres + NATS worker + Vite example with a routed write path"},"agent-stack":{repo:"https://github.com/flisk-sh/tdk-agent-stack.git",description:"AI agent stack: Bun agent + MCP tool server + Postgres + NATS"}};function r(e){let t=e[2];if(!(!t||t.startsWith("-")))return t in s?t:void 0}export{s as a,r as b};
|