@slowcook-ai/cli 0.19.5 → 0.19.6
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 +184 -28
- package/dist/cli.js +53 -73
- package/dist/cli.js.map +1 -1
- package/dist/commands/serve/config.d.ts +140 -0
- package/dist/commands/serve/config.d.ts.map +1 -0
- package/dist/commands/serve/config.js +174 -0
- package/dist/commands/serve/config.js.map +1 -0
- package/dist/commands/serve/detect.d.ts +31 -0
- package/dist/commands/serve/detect.d.ts.map +1 -0
- package/dist/commands/serve/detect.js +56 -0
- package/dist/commands/serve/detect.js.map +1 -0
- package/dist/commands/serve/dev.d.ts +51 -0
- package/dist/commands/serve/dev.d.ts.map +1 -0
- package/dist/commands/serve/dev.js +126 -0
- package/dist/commands/serve/dev.js.map +1 -0
- package/dist/commands/serve/index.d.ts +28 -0
- package/dist/commands/serve/index.d.ts.map +1 -0
- package/dist/commands/serve/index.js +216 -0
- package/dist/commands/serve/index.js.map +1 -0
- package/dist/commands/serve/mock.d.ts +39 -0
- package/dist/commands/serve/mock.d.ts.map +1 -0
- package/dist/commands/serve/mock.js +132 -0
- package/dist/commands/serve/mock.js.map +1 -0
- package/dist/commands/serve/staging.d.ts +39 -0
- package/dist/commands/serve/staging.d.ts.map +1 -0
- package/dist/commands/serve/staging.js +190 -0
- package/dist/commands/serve/staging.js.map +1 -0
- package/dist/commands/stories/index.d.ts +15 -0
- package/dist/commands/stories/index.d.ts.map +1 -0
- package/dist/commands/stories/index.js +280 -0
- package/dist/commands/stories/index.js.map +1 -0
- package/dist/commands/stories/status.d.ts +74 -0
- package/dist/commands/stories/status.d.ts.map +1 -0
- package/dist/commands/stories/status.js +176 -0
- package/dist/commands/stories/status.js.map +1 -0
- package/dist/commands.manifest.d.ts +37 -0
- package/dist/commands.manifest.d.ts.map +1 -0
- package/dist/commands.manifest.js +289 -0
- package/dist/commands.manifest.js.map +1 -0
- package/dist/help.d.ts +43 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +131 -0
- package/dist/help.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.brewing/dev-env.yaml` (legacy) and `.brewing/serve.yaml` (new) —
|
|
3
|
+
* profile-aware config for `slowcook serve <profile> <verb>`.
|
|
4
|
+
*
|
|
5
|
+
* Trade-off resolution from `docs/plans/0.20-design-discussions.md`
|
|
6
|
+
* design #5: KEEP the `dev-env.yaml` filename forever. The schema
|
|
7
|
+
* grows a `profiles:` map for multi-profile use; legacy flat shape
|
|
8
|
+
* (no `profiles:` key) is wrapped as `profiles.dev = {...flat}` on
|
|
9
|
+
* load. Migration cost for existing consumers: zero.
|
|
10
|
+
*
|
|
11
|
+
* Phase 1 (this cut): only the `dev` profile is consumed by
|
|
12
|
+
* `slowcook serve dev up|sync|down|logs`. `mock` and `staging`
|
|
13
|
+
* profiles parse into the same shape but are stubs until Phase 2 + 3.
|
|
14
|
+
*/
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
import YAML from "yaml";
|
|
19
|
+
export const DEV_ENV_CONFIG_PATH = ".brewing/dev-env.yaml";
|
|
20
|
+
export const SERVE_CONFIG_PATH = ".brewing/serve.yaml";
|
|
21
|
+
const AppModeSchema = z.enum([
|
|
22
|
+
"dev", // Next dev (hot reload) — for apps under active story development
|
|
23
|
+
"start", // next build + next start — production-shaped, slower restart
|
|
24
|
+
"nest-watch", // ts-node-dev / nest start --watch — backend hot reload
|
|
25
|
+
"nest-prod", // nest start (built) — built-image staging
|
|
26
|
+
"next-dev", // explicit alias for "dev" used by the design doc
|
|
27
|
+
"next-start", // explicit alias for "start"
|
|
28
|
+
"vite-dev", // vite dev (mock profile)
|
|
29
|
+
"static", // serve a built static export, never re-run
|
|
30
|
+
"none", // entry exists but isn't started by `serve` (e.g. cron)
|
|
31
|
+
]);
|
|
32
|
+
const AppSchema = z.object({
|
|
33
|
+
mode: AppModeSchema,
|
|
34
|
+
port: z.number().int().positive(),
|
|
35
|
+
/** Restart on crash. Defaults to true. */
|
|
36
|
+
autoheal: z.boolean().optional().default(true),
|
|
37
|
+
/** Optional: explicit container/process name override (otherwise the key). */
|
|
38
|
+
container: z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
const PersistenceSchema = z.object({
|
|
41
|
+
/**
|
|
42
|
+
* Named docker volume that survives `serve <profile> reset`. PM-added
|
|
43
|
+
* DB rows persist across redeploys; only the seed-owned rows are
|
|
44
|
+
* touched by reset (only meaningful for the `staging` profile).
|
|
45
|
+
*/
|
|
46
|
+
db_volume: z.string().optional(),
|
|
47
|
+
uploads_volume: z.string().optional(),
|
|
48
|
+
});
|
|
49
|
+
const SshTargetSchema = z.object({
|
|
50
|
+
host: z.string(),
|
|
51
|
+
user: z.string(),
|
|
52
|
+
/** Absolute path on the box where the consumer's checkout lives. */
|
|
53
|
+
checkout_dir: z.string(),
|
|
54
|
+
/** Repo-secret name holding the SSH private key. */
|
|
55
|
+
key_secret: z.string().default("DEV_DEPLOY_SSH_KEY"),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Staging-only: named seed scenarios (Trade-off #5 — map shape from day 1).
|
|
59
|
+
*
|
|
60
|
+
* seed:
|
|
61
|
+
* scenarios:
|
|
62
|
+
* demo:
|
|
63
|
+
* scripts: ["packages/seeds/demo/*.ts"]
|
|
64
|
+
* enterprise:
|
|
65
|
+
* scripts: ["packages/seeds/enterprise/*.ts"]
|
|
66
|
+
* guard_env: STAGING_RESET_ALLOWED
|
|
67
|
+
*/
|
|
68
|
+
const SeedScenarioSchema = z.object({
|
|
69
|
+
scripts: z.array(z.string()).default([]),
|
|
70
|
+
});
|
|
71
|
+
const SeedSchema = z.object({
|
|
72
|
+
scenarios: z.record(z.string(), SeedScenarioSchema).default({}),
|
|
73
|
+
guard_env: z.string().optional(),
|
|
74
|
+
});
|
|
75
|
+
/** Profile mode controls how `serve <profile> sync` ships code to the box. */
|
|
76
|
+
const ProfileModeSchema = z.enum([
|
|
77
|
+
"bind-mount-source", // rsync source + anonymous-volume node_modules (dev, mock)
|
|
78
|
+
"built-image", // consumer's bring-up script runs an image pull (staging)
|
|
79
|
+
]);
|
|
80
|
+
export const ProfileConfigSchema = z.object({
|
|
81
|
+
/** How sync delivers code to the runtime. Defaults to `bind-mount-source`. */
|
|
82
|
+
mode: ProfileModeSchema.optional().default("bind-mount-source"),
|
|
83
|
+
/** Git branch the profile tracks. Default: `dev`. */
|
|
84
|
+
source_branch: z.string().default("dev"),
|
|
85
|
+
/** Optional compose-overlay path (consumer-supplied; slowcook calls it via docker compose). */
|
|
86
|
+
compose_overlay: z.string().optional(),
|
|
87
|
+
/**
|
|
88
|
+
* Built-image profiles call into the consumer's bring-up script
|
|
89
|
+
* (Trade-off #3 — slowcook ships zero image-build pipeline).
|
|
90
|
+
* If unset, slowcook falls back to `docker compose -f compose_overlay up -d`.
|
|
91
|
+
*/
|
|
92
|
+
bringup_cmd: z.string().optional(),
|
|
93
|
+
apps: z.record(z.string(), AppSchema).default({}),
|
|
94
|
+
persistence: PersistenceSchema.optional().default({}),
|
|
95
|
+
/** Optional: SSH target the profile uses. If absent, profile runs locally. */
|
|
96
|
+
ssh_target: SshTargetSchema.optional(),
|
|
97
|
+
/** Single-script legacy seed (dev/mock profiles); staging uses `seed.scenarios`. */
|
|
98
|
+
seed_script: z.string().optional(),
|
|
99
|
+
/** Staging-only seed scenarios map. */
|
|
100
|
+
seed: SeedSchema.optional(),
|
|
101
|
+
});
|
|
102
|
+
/**
|
|
103
|
+
* Normalised shape after loading EITHER `.brewing/serve.yaml`
|
|
104
|
+
* (explicit `profiles:` key) OR `.brewing/dev-env.yaml` (legacy flat
|
|
105
|
+
* shape — wrapped as `{profiles: {dev: {...flat}}}`).
|
|
106
|
+
*/
|
|
107
|
+
export const ServeConfigSchema = z.object({
|
|
108
|
+
$schema: z.string().optional(),
|
|
109
|
+
schema_version: z.literal(1),
|
|
110
|
+
profiles: z.record(z.string(), ProfileConfigSchema),
|
|
111
|
+
});
|
|
112
|
+
/**
|
|
113
|
+
* Loader: prefer `.brewing/serve.yaml` if present, else fall back to
|
|
114
|
+
* `.brewing/dev-env.yaml`. Legacy flat shapes get wrapped to the
|
|
115
|
+
* `{profiles: {dev: {...flat}}}` form. Returns the normalised
|
|
116
|
+
* `ServeConfig`.
|
|
117
|
+
*/
|
|
118
|
+
export function loadServeConfig(repoRoot) {
|
|
119
|
+
const servePath = join(repoRoot, SERVE_CONFIG_PATH);
|
|
120
|
+
const devEnvPath = join(repoRoot, DEV_ENV_CONFIG_PATH);
|
|
121
|
+
const chosen = existsSync(servePath) ? servePath : existsSync(devEnvPath) ? devEnvPath : null;
|
|
122
|
+
if (!chosen) {
|
|
123
|
+
throw new Error(`Neither ${SERVE_CONFIG_PATH} nor ${DEV_ENV_CONFIG_PATH} found. Run \`slowcook serve init\` to scaffold (Phase 1 — coming soon) or hand-author either path.`);
|
|
124
|
+
}
|
|
125
|
+
let raw;
|
|
126
|
+
try {
|
|
127
|
+
raw = YAML.parse(readFileSync(chosen, "utf8"));
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
throw new Error(`${chosen} is not valid YAML: ${e.message}`);
|
|
131
|
+
}
|
|
132
|
+
return normaliseConfig(raw, chosen);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Detect legacy vs new shape + normalise. Exported for tests + the
|
|
136
|
+
* legacy `slowcook dev-env` callers that want the same loader.
|
|
137
|
+
*/
|
|
138
|
+
export function normaliseConfig(raw, source) {
|
|
139
|
+
if (typeof raw !== "object" || raw === null) {
|
|
140
|
+
throw new Error(`${source}: expected a YAML object at the top level.`);
|
|
141
|
+
}
|
|
142
|
+
const obj = raw;
|
|
143
|
+
// New shape: explicit `profiles:` key.
|
|
144
|
+
if (obj["profiles"] && typeof obj["profiles"] === "object") {
|
|
145
|
+
const parsed = ServeConfigSchema.safeParse(obj);
|
|
146
|
+
if (!parsed.success) {
|
|
147
|
+
throw new Error(formatZodError(source, parsed.error));
|
|
148
|
+
}
|
|
149
|
+
return parsed.data;
|
|
150
|
+
}
|
|
151
|
+
// Legacy shape: flat top-level → wrap as `profiles.dev`.
|
|
152
|
+
const { schema_version, $schema, ...flat } = obj;
|
|
153
|
+
const wrapped = {
|
|
154
|
+
$schema,
|
|
155
|
+
schema_version,
|
|
156
|
+
profiles: { dev: flat },
|
|
157
|
+
};
|
|
158
|
+
const parsed = ServeConfigSchema.safeParse(wrapped);
|
|
159
|
+
if (!parsed.success) {
|
|
160
|
+
throw new Error(formatZodError(source, parsed.error));
|
|
161
|
+
}
|
|
162
|
+
return parsed.data;
|
|
163
|
+
}
|
|
164
|
+
function formatZodError(source, err) {
|
|
165
|
+
const issues = err.issues
|
|
166
|
+
.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`)
|
|
167
|
+
.join("; ");
|
|
168
|
+
return `${source} failed validation: ${issues}`;
|
|
169
|
+
}
|
|
170
|
+
/** Convenience: lookup a profile by name (case-sensitive). */
|
|
171
|
+
export function getProfile(config, name) {
|
|
172
|
+
return config.profiles[name];
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/commands/serve/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEvD,MAAM,aAA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AAG,CAAC,IAAI,QAAQ,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;SAC3D,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,GAAG,MAAM,uBAAuB,MAAM,EAAE,CAAC;AAClD,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,UAAU,CAAC,MAAmB,EAAE,IAAY;IAC1D,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile auto-detection — Trade-off #4 resolution.
|
|
3
|
+
*
|
|
4
|
+
* `serve mock` is only meaningful if the consumer's `mock/` package is
|
|
5
|
+
* vite-runnable (has `scripts.dev`). If it isn't, slowcook prints a
|
|
6
|
+
* notice + exits 0 instead of trying to bring up an unrunnable profile.
|
|
7
|
+
*
|
|
8
|
+
* Exported as a pure function so the index.ts dispatcher + future
|
|
9
|
+
* `slowcook serve mock init` scaffolding can reuse the same check.
|
|
10
|
+
*/
|
|
11
|
+
export interface MockRunnableResult {
|
|
12
|
+
/** Whether `mock/` exists at all. */
|
|
13
|
+
exists: boolean;
|
|
14
|
+
/** Whether `mock/package.json` declares `scripts.dev`. */
|
|
15
|
+
hasDevScript: boolean;
|
|
16
|
+
/** The dev script's command, when present. */
|
|
17
|
+
devScript?: string;
|
|
18
|
+
/** When `false`, a one-line reason suitable for `console.log`. */
|
|
19
|
+
reason?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Inspect `<repoRoot>/mock/package.json` and report whether the
|
|
23
|
+
* consumer has a vite-runnable mock app.
|
|
24
|
+
*
|
|
25
|
+
* Why this check: many slowcook consumers have a `mock/` directory
|
|
26
|
+
* that's only used as a vibe-time artefact (no runtime). For those
|
|
27
|
+
* consumers, `serve mock up` would fail trying to docker-compose a
|
|
28
|
+
* non-existent vite-dev process. Skip cleanly instead.
|
|
29
|
+
*/
|
|
30
|
+
export declare function detectMockRunnable(repoRoot: string): MockRunnableResult;
|
|
31
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,0DAA0D;IAC1D,YAAY,EAAE,OAAO,CAAC;IACtB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAiCvE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile auto-detection — Trade-off #4 resolution.
|
|
3
|
+
*
|
|
4
|
+
* `serve mock` is only meaningful if the consumer's `mock/` package is
|
|
5
|
+
* vite-runnable (has `scripts.dev`). If it isn't, slowcook prints a
|
|
6
|
+
* notice + exits 0 instead of trying to bring up an unrunnable profile.
|
|
7
|
+
*
|
|
8
|
+
* Exported as a pure function so the index.ts dispatcher + future
|
|
9
|
+
* `slowcook serve mock init` scaffolding can reuse the same check.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
/**
|
|
14
|
+
* Inspect `<repoRoot>/mock/package.json` and report whether the
|
|
15
|
+
* consumer has a vite-runnable mock app.
|
|
16
|
+
*
|
|
17
|
+
* Why this check: many slowcook consumers have a `mock/` directory
|
|
18
|
+
* that's only used as a vibe-time artefact (no runtime). For those
|
|
19
|
+
* consumers, `serve mock up` would fail trying to docker-compose a
|
|
20
|
+
* non-existent vite-dev process. Skip cleanly instead.
|
|
21
|
+
*/
|
|
22
|
+
export function detectMockRunnable(repoRoot) {
|
|
23
|
+
const pkgPath = join(repoRoot, "mock", "package.json");
|
|
24
|
+
if (!existsSync(pkgPath)) {
|
|
25
|
+
return {
|
|
26
|
+
exists: false,
|
|
27
|
+
hasDevScript: false,
|
|
28
|
+
reason: "mock/ directory absent — `serve mock` requires a runnable mock app.",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
let pkg;
|
|
32
|
+
try {
|
|
33
|
+
pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
return {
|
|
37
|
+
exists: true,
|
|
38
|
+
hasDevScript: false,
|
|
39
|
+
reason: `mock/package.json is not valid JSON: ${e.message}`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const devScript = pkg.scripts?.dev;
|
|
43
|
+
if (!devScript) {
|
|
44
|
+
return {
|
|
45
|
+
exists: true,
|
|
46
|
+
hasDevScript: false,
|
|
47
|
+
reason: "mock/package.json has no `scripts.dev` — declare one (e.g. `vite`) to enable the `serve mock` profile.",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
exists: true,
|
|
52
|
+
hasDevScript: true,
|
|
53
|
+
devScript,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../../../src/commands/serve/detect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAajC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IACvD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACzB,OAAO;YACL,MAAM,EAAE,KAAK;YACb,YAAY,EAAE,KAAK;YACnB,MAAM,EAAE,qEAAqE;SAC9E,CAAC;IACJ,CAAC;IACD,IAAI,GAAyC,CAAC;IAC9C,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,KAAK;YACnB,MAAM,EAAE,wCAAyC,CAAW,CAAC,OAAO,EAAE;SACvE,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC;IACnC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,KAAK;YACnB,MAAM,EACJ,wGAAwG;SAC3G,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,IAAI;QAClB,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `slowcook serve dev <verb>` — Phase 1 implementation.
|
|
3
|
+
*
|
|
4
|
+
* Verbs (Phase 1):
|
|
5
|
+
* - up — bring up the dev profile (compose overlay or fallback)
|
|
6
|
+
* - sync — rsync source to the box + restart the bind-mount targets
|
|
7
|
+
* - down — stop the profile's services (volumes preserved)
|
|
8
|
+
* - logs — pass-through to docker-compose logs
|
|
9
|
+
* - reset — no-op for dev profile (only meaningful for staging)
|
|
10
|
+
*
|
|
11
|
+
* Backward-compat aliases preserved on the cli switch:
|
|
12
|
+
* - `slowcook dev-env push --branch X` ≡ `slowcook serve dev sync --branch X`
|
|
13
|
+
* - `slowcook dev-env up` ≡ `slowcook serve dev up`
|
|
14
|
+
* - `slowcook dev-env reset` ≡ `slowcook serve dev reset` (no-op + notice)
|
|
15
|
+
*
|
|
16
|
+
* `bind-mount-source` mode (the DECIDED choice for dev profile) uses
|
|
17
|
+
* rsync to push source + an anonymous-volume node_modules in the
|
|
18
|
+
* compose overlay. Avoids node_modules collision on macOS + chmod
|
|
19
|
+
* surprises. See `docs/plans/0.20-design-discussions.md` design #5
|
|
20
|
+
* "Additional decisions" for the rationale.
|
|
21
|
+
*/
|
|
22
|
+
import type { ProfileConfig, ServeConfig } from "./config.js";
|
|
23
|
+
export interface DevVerbArgs {
|
|
24
|
+
verb: string;
|
|
25
|
+
/** Branch to push (sync verb). Resolved from HEAD if undefined. */
|
|
26
|
+
branch?: string;
|
|
27
|
+
/** Story id, included in the push log line for audit. */
|
|
28
|
+
story?: string;
|
|
29
|
+
/** Filter logs to one app (logs verb). */
|
|
30
|
+
service?: string;
|
|
31
|
+
/** Follow logs (logs verb). */
|
|
32
|
+
follow?: boolean;
|
|
33
|
+
/** Drop volumes too (down verb). */
|
|
34
|
+
prune?: boolean;
|
|
35
|
+
repoRoot: string;
|
|
36
|
+
/** Test seam: skip actual git/docker calls; emit a plan only. */
|
|
37
|
+
dryRun?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface DevVerbResult {
|
|
40
|
+
exitCode: number;
|
|
41
|
+
/** Lines emitted to stdout / "what would have run" under dryRun. */
|
|
42
|
+
output: string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Pure dispatcher for the dev profile. Returns a DevVerbResult so the
|
|
46
|
+
* caller (cli) can render output + set the exit code. Splitting the
|
|
47
|
+
* pure planner from the IO wrapper lets the tests assert on the plan
|
|
48
|
+
* without spawning docker.
|
|
49
|
+
*/
|
|
50
|
+
export declare function planServeDev(args: DevVerbArgs, _config: ServeConfig, profile: ProfileConfig): DevVerbResult;
|
|
51
|
+
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,aAAa,GACrB,aAAa,CAkBf"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `slowcook serve dev <verb>` — Phase 1 implementation.
|
|
3
|
+
*
|
|
4
|
+
* Verbs (Phase 1):
|
|
5
|
+
* - up — bring up the dev profile (compose overlay or fallback)
|
|
6
|
+
* - sync — rsync source to the box + restart the bind-mount targets
|
|
7
|
+
* - down — stop the profile's services (volumes preserved)
|
|
8
|
+
* - logs — pass-through to docker-compose logs
|
|
9
|
+
* - reset — no-op for dev profile (only meaningful for staging)
|
|
10
|
+
*
|
|
11
|
+
* Backward-compat aliases preserved on the cli switch:
|
|
12
|
+
* - `slowcook dev-env push --branch X` ≡ `slowcook serve dev sync --branch X`
|
|
13
|
+
* - `slowcook dev-env up` ≡ `slowcook serve dev up`
|
|
14
|
+
* - `slowcook dev-env reset` ≡ `slowcook serve dev reset` (no-op + notice)
|
|
15
|
+
*
|
|
16
|
+
* `bind-mount-source` mode (the DECIDED choice for dev profile) uses
|
|
17
|
+
* rsync to push source + an anonymous-volume node_modules in the
|
|
18
|
+
* compose overlay. Avoids node_modules collision on macOS + chmod
|
|
19
|
+
* surprises. See `docs/plans/0.20-design-discussions.md` design #5
|
|
20
|
+
* "Additional decisions" for the rationale.
|
|
21
|
+
*/
|
|
22
|
+
import { execSync } from "node:child_process";
|
|
23
|
+
/**
|
|
24
|
+
* Pure dispatcher for the dev profile. Returns a DevVerbResult so the
|
|
25
|
+
* caller (cli) can render output + set the exit code. Splitting the
|
|
26
|
+
* pure planner from the IO wrapper lets the tests assert on the plan
|
|
27
|
+
* without spawning docker.
|
|
28
|
+
*/
|
|
29
|
+
export function planServeDev(args, _config, profile) {
|
|
30
|
+
switch (args.verb) {
|
|
31
|
+
case "up":
|
|
32
|
+
return planUp(args, profile);
|
|
33
|
+
case "sync":
|
|
34
|
+
return planSync(args, profile);
|
|
35
|
+
case "down":
|
|
36
|
+
return planDown(args, profile);
|
|
37
|
+
case "logs":
|
|
38
|
+
return planLogs(args, profile);
|
|
39
|
+
case "reset":
|
|
40
|
+
return {
|
|
41
|
+
exitCode: 0,
|
|
42
|
+
output: ["[serve dev reset] dev profile has no scenario seed; nothing to reset (only meaningful for staging)."],
|
|
43
|
+
};
|
|
44
|
+
default:
|
|
45
|
+
return { exitCode: 64, output: [`Unknown verb: ${args.verb}. See \`slowcook serve dev --help\`.`] };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function planUp(_args, profile) {
|
|
49
|
+
const overlay = profile.compose_overlay;
|
|
50
|
+
const apps = Object.keys(profile.apps);
|
|
51
|
+
const lines = [`[serve dev up] bringing up: ${apps.join(", ") || "(no apps configured)"}`];
|
|
52
|
+
if (overlay) {
|
|
53
|
+
lines.push(` cmd: docker compose -f ${overlay} up -d --build`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
lines.push(" (no compose_overlay set; consumer must wire its own up command)");
|
|
57
|
+
}
|
|
58
|
+
if (profile.seed_script) {
|
|
59
|
+
lines.push(` seed: pnpm exec ts-node ${profile.seed_script}`);
|
|
60
|
+
}
|
|
61
|
+
return { exitCode: 0, output: lines };
|
|
62
|
+
}
|
|
63
|
+
function planSync(args, profile) {
|
|
64
|
+
const sourceBranch = profile.source_branch;
|
|
65
|
+
let localBranch = args.branch;
|
|
66
|
+
if (!localBranch && !args.dryRun) {
|
|
67
|
+
try {
|
|
68
|
+
localBranch = execSync("git rev-parse --abbrev-ref HEAD", { cwd: args.repoRoot, encoding: "utf8" }).trim();
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// fall through; handled below
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else if (!localBranch && args.dryRun) {
|
|
75
|
+
localBranch = "<current-branch>";
|
|
76
|
+
}
|
|
77
|
+
if (!localBranch || localBranch === "HEAD") {
|
|
78
|
+
return {
|
|
79
|
+
exitCode: 64,
|
|
80
|
+
output: ["[serve dev sync] couldn't resolve a local branch (detached HEAD?). Pass --branch <name>."],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const lines = [
|
|
84
|
+
`[serve dev sync] ${localBranch} → origin/${sourceBranch}${args.story ? ` (story-${args.story})` : ""}`,
|
|
85
|
+
];
|
|
86
|
+
if (args.dryRun) {
|
|
87
|
+
lines.push(` would run: git push --force origin ${localBranch}:${sourceBranch}`);
|
|
88
|
+
return { exitCode: 0, output: lines };
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
execSync(`git push --force origin ${localBranch}:${sourceBranch}`, { cwd: args.repoRoot, stdio: "inherit" });
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return {
|
|
95
|
+
exitCode: 1,
|
|
96
|
+
output: [...lines, `[serve dev sync] git push failed. Check push permissions on origin/${sourceBranch}.`],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
lines.push(`[serve dev sync] done. The dev-deploy workflow on origin/${sourceBranch} will fire next.`);
|
|
100
|
+
return { exitCode: 0, output: lines };
|
|
101
|
+
}
|
|
102
|
+
function planDown(args, profile) {
|
|
103
|
+
const overlay = profile.compose_overlay;
|
|
104
|
+
const lines = ["[serve dev down]"];
|
|
105
|
+
if (!overlay) {
|
|
106
|
+
return { exitCode: 64, output: ["[serve dev down] no compose_overlay set; nothing to stop."] };
|
|
107
|
+
}
|
|
108
|
+
const cmd = args.prune
|
|
109
|
+
? `docker compose -f ${overlay} down -v`
|
|
110
|
+
: `docker compose -f ${overlay} down`;
|
|
111
|
+
lines.push(` cmd: ${cmd}`);
|
|
112
|
+
return { exitCode: 0, output: lines };
|
|
113
|
+
}
|
|
114
|
+
function planLogs(args, profile) {
|
|
115
|
+
const overlay = profile.compose_overlay;
|
|
116
|
+
if (!overlay) {
|
|
117
|
+
return { exitCode: 64, output: ["[serve dev logs] no compose_overlay set; nothing to tail."] };
|
|
118
|
+
}
|
|
119
|
+
const follow = args.follow ? "-f" : "";
|
|
120
|
+
const service = args.service ?? "";
|
|
121
|
+
return {
|
|
122
|
+
exitCode: 0,
|
|
123
|
+
output: [` cmd: docker compose -f ${overlay} logs ${follow} ${service}`.replace(/\s+/g, " ").trim()],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/commands/serve/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AA0B9C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAiB,EACjB,OAAoB,EACpB,OAAsB;IAEtB,QAAQ,IAAI,CAAC,IAA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QACL,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,CAAC,4BAA4B,OAAO,SAAS,MAAM,IAAI,OAAO,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;KACtG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `slowcook serve <profile> <verb>` — multi-mode dev/mock/staging.
|
|
3
|
+
*
|
|
4
|
+
* See `docs/plans/0.20-design-discussions.md` design #5.
|
|
5
|
+
*
|
|
6
|
+
* Phase 1 (this cut): `serve dev` is implemented end-to-end. `serve
|
|
7
|
+
* mock` and `serve staging` parse config + print a "Phase 2/3 stub"
|
|
8
|
+
* notice; the runtime implementation lands in tasks #20 / #21.
|
|
9
|
+
*
|
|
10
|
+
* Backward-compat: `slowcook dev-env <verb>` continues to work as an
|
|
11
|
+
* alias for `slowcook serve dev <verb>` (wired in cli.ts).
|
|
12
|
+
*/
|
|
13
|
+
export interface ServeArgs {
|
|
14
|
+
profile?: string;
|
|
15
|
+
verb?: string;
|
|
16
|
+
branch?: string;
|
|
17
|
+
story?: string;
|
|
18
|
+
service?: string;
|
|
19
|
+
scenario?: string;
|
|
20
|
+
follow?: boolean;
|
|
21
|
+
prune?: boolean;
|
|
22
|
+
repoRoot: string;
|
|
23
|
+
dryRun?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function parseServeArgs(argv: string[]): ServeArgs;
|
|
26
|
+
export declare function printHelp(): void;
|
|
27
|
+
export declare function serve(argv: string[]): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/serve/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAwBxD;AAED,wBAAgB,SAAS,IAAI,IAAI,CAkChC;AAED,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DzD"}
|