defineConfig
Define a fully typed kizlo.config.ts for the CLI's dev and test workflows.
defineConfig wraps your kizlo.config.ts so it is fully typed. The config lives at your project root (.js and
.mjs work too). kizlo init writes it for you, and you edit it as your project grows. It configures where your
Kizlo server lives and the local WordPress that kizlo dev and kizlo test provision.
Parameters
defineConfig(config)Prop
Type
local
Local Docker WordPress, off unless set. true enables both stacks with defaults; the object form enables and
configures them, and holds the stack name, the per-branch worktrees toggle, and the two stacks.
Prop
Type
local.dev
The dev stack run by kizlo dev.
Prop
Type
local.test
The test stack run by kizlo test. Its version and fixtures fall back to local.dev unless inherit is
false.
Prop
Type
Returns
The same config object, unchanged. defineConfig is an identity function that exists only to attach types.
Examples
Run local WordPress with local: true, which turns on both stacks with defaults (the install folder is
fixed, so there's nothing else to set). create/init write this when you choose local WordPress:
import { defineConfig } from "kizlo/config"
export default defineConfig({
dir: "src/lib/kizlo",
local: true,
})Reach for the object form to configure the stacks. Give each branch its own local WordPress with
worktrees, so parallel checkouts of the project stop sharing one database:
import { defineConfig } from "kizlo/config"
export default defineConfig({
dir: "src/lib/kizlo",
local: { worktrees: true },
})Both stacks boot current WordPress unless you say otherwise. version takes a Docker Hub tag. Set it on the
dev stack and the test stack inherits it; pin the test stack on its own to prove the oldest version you
support:
import { defineConfig } from "kizlo/config"
export default defineConfig({
dir: "src/lib/kizlo",
local: {
dev: { version: "7.1.0" },
test: { version: "6.8.2-php8.3-apache" },
},
})Seed both from shared fixtures: the dev stack declares them and the test stack inherits them, so a fixture is never added to one and forgotten in the other:
import { defineConfig } from "kizlo/config"
import { blogFixture } from "./fixtures/blog"
export default defineConfig({
dir: "src/lib/kizlo",
alias: "@",
local: {
dev: { fixtures: [blogFixture] },
},
})Generate only the introspection for a package that ships procedures but no
server, by setting dir.introspection and leaving local off:
import { defineConfig } from "kizlo/config"
export default defineConfig({
dir: { introspection: "." },
})