kizlo 0.1.0 → 0.1.1

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.
@@ -1,66 +0,0 @@
1
- import { isSeeded } from "../wp/utils.js";
2
- import { composeDown, composeStop, composeUp } from "../wp/docker.js";
3
- import { withSpinner } from "../utils.js";
4
- import { log } from "../daemon/logger.js";
5
- import { resolveTestConfig } from "../daemon/config.js";
6
- import { runSeeds } from "../wp/setup.js";
7
- import { defineCommand } from "citty";
8
-
9
- //#region src/cli/commands/wp.ts
10
- /** Boot the stack and seed it once (idempotent — skips seeding if already seeded). */
11
- async function bringUp(cwd) {
12
- const cfg = await resolveTestConfig(cwd);
13
- process.env.WP_PORT = String(cfg.port);
14
- await withSpinner("Starting WordPress test stack", composeUp, "WordPress test stack ready");
15
- if (await isSeeded()) {
16
- log.info("Stack already seeded — skipping seed.");
17
- return;
18
- }
19
- await withSpinner("Seeding WordPress", () => runSeeds({
20
- port: cfg.port,
21
- fixtures: cfg.fixtures
22
- }), "WordPress seeded");
23
- log.success(`Stack ready on http://localhost:${cfg.port} — credentials at ${cfg.credentialsPath}`);
24
- }
25
- const up = defineCommand({
26
- meta: {
27
- name: "up",
28
- description: "Start the WordPress test stack and seed it if needed"
29
- },
30
- async run() {
31
- await bringUp(process.cwd());
32
- }
33
- });
34
- const reset = defineCommand({
35
- meta: {
36
- name: "reset",
37
- description: "Wipe the database and reseed a fresh WordPress test stack"
38
- },
39
- async run() {
40
- await withSpinner("Wiping WordPress database", () => composeDown({ volumes: true }), "Database wiped");
41
- await bringUp(process.cwd());
42
- }
43
- });
44
- const stop = defineCommand({
45
- meta: {
46
- name: "stop",
47
- description: "Stop the WordPress test stack, keeping the database volume"
48
- },
49
- async run() {
50
- await withSpinner("Stopping WordPress test stack", composeStop, "Stack stopped (volumes kept)");
51
- }
52
- });
53
- const wp = defineCommand({
54
- meta: {
55
- name: "wp",
56
- description: "Manage the WordPress test stack (advanced: up | reset | stop)"
57
- },
58
- subCommands: {
59
- up,
60
- reset,
61
- stop
62
- }
63
- });
64
-
65
- //#endregion
66
- export { wp };