kizlo 0.9.0 → 0.10.0
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/LICENSE +201 -21
- package/dist/cli/commands/_setup.js +121 -77
- package/dist/cli/commands/_wiring.js +5 -4
- package/dist/cli/commands/create.js +32 -25
- package/dist/cli/commands/dev.js +63 -71
- package/dist/cli/commands/init.js +93 -103
- package/dist/cli/commands/test.js +34 -34
- package/dist/cli/daemon/config.js +18 -24
- package/dist/cli/presets/base.js +4 -2
- package/dist/cli/presets/nextjs.js +0 -1
- package/dist/cli/presets/template.js +76 -2
- package/dist/cli/utils.js +41 -19
- package/dist/cli/wp/compose/override.js +3 -3
- package/dist/cli/wp/compose/override.test.ts +2 -2
- package/dist/cli/wp/compose/override.ts +3 -3
- package/dist/cli/wp/constants.d.ts +10 -4
- package/dist/cli/wp/constants.js +10 -4
- package/dist/cli/wp/dev.js +13 -58
- package/dist/cli/wp/docker.d.ts +16 -4
- package/dist/cli/wp/docker.js +20 -7
- package/dist/cli/wp/settings.js +1 -1
- package/dist/cli/wp/setup.js +1 -1
- package/dist/cli/wp/stack.js +4 -4
- package/dist/config.d.ts +20 -23
- package/dist/index.d.ts +2 -2
- package/dist/integrations/nextjs/kizlo.server.js +1 -1
- package/dist/integrations/nextjs/utils.js +2 -2
- package/dist/kizlo.d.ts +16 -16
- package/dist/kizlo.js +19 -15
- package/dist/package.js +1 -1
- package/dist/router.d.ts +5 -5
- package/dist/test/server.js +1 -1
- package/dist/test.d.ts +3 -3
- package/dist/test.js +3 -3
- package/package.json +3 -3
- package/dist/cli/wp/byo.js +0 -113
package/dist/cli/utils.js
CHANGED
|
@@ -229,37 +229,59 @@ function envKeysPresent(contents, keys) {
|
|
|
229
229
|
return keys.filter((key) => new RegExp(`^\\s*${key}\\s*=`, "m").test(contents));
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
232
|
+
* The built-in key names, used by the generic `base` preset (no template, no separately-pinned
|
|
233
|
+
* runtime) and as the fallback when a template's manifest declares no `env` section (in-repo before the
|
|
234
|
+
* first stamped release). Real templates carry their own `env`, so this is the standard `KIZLO_*` set.
|
|
235
|
+
*/
|
|
236
|
+
const DEFAULT_ENV_KEYS = {
|
|
237
|
+
baseUrl: "KIZLO_API_URL",
|
|
238
|
+
remote: {
|
|
239
|
+
siteSecret: "KIZLO_WP_SECRET",
|
|
240
|
+
wpUrl: "KIZLO_WP_URL",
|
|
241
|
+
wpUsername: "KIZLO_WP_USERNAME",
|
|
242
|
+
wpPassword: "KIZLO_WP_APP_PASSWORD"
|
|
243
|
+
},
|
|
244
|
+
local: {
|
|
245
|
+
connect: "KIZLO_CONNECT",
|
|
246
|
+
siteSecret: "KIZLO_LOCAL_WP_SECRET",
|
|
247
|
+
wpUrl: "KIZLO_LOCAL_WP_URL",
|
|
248
|
+
wpUsername: "KIZLO_LOCAL_WP_USERNAME",
|
|
249
|
+
wpPassword: "KIZLO_LOCAL_WP_APP_PASSWORD"
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
232
253
|
* The grouped `.env` layout shared by `init` and `dev`, so both write the same sectioned file:
|
|
233
|
-
* a
|
|
234
|
-
*
|
|
235
|
-
* keys are actually being appended get a header, so
|
|
254
|
+
* a connect switch, the API URL, then the remote and local connection blocks. The key names come from
|
|
255
|
+
* the resolved {@link EnvKeys} (the template's `env` contract), so the sections stay labelled correctly
|
|
256
|
+
* whatever a template calls them. Only sections whose keys are actually being appended get a header, so
|
|
257
|
+
* a remote run skips the local block and vice versa.
|
|
236
258
|
*/
|
|
237
|
-
function envGroups(
|
|
259
|
+
function envGroups(envKeys) {
|
|
238
260
|
return [
|
|
239
261
|
{
|
|
240
|
-
comment: "Kizlo
|
|
241
|
-
keys: [
|
|
262
|
+
comment: "Kizlo Connect (local | remote)",
|
|
263
|
+
keys: [envKeys.local.connect]
|
|
242
264
|
},
|
|
243
265
|
{
|
|
244
|
-
comment: "Kizlo
|
|
245
|
-
keys: [
|
|
266
|
+
comment: "Kizlo API URL",
|
|
267
|
+
keys: [envKeys.baseUrl]
|
|
246
268
|
},
|
|
247
269
|
{
|
|
248
|
-
comment: "Kizlo
|
|
270
|
+
comment: "Kizlo Remote",
|
|
249
271
|
keys: [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
272
|
+
envKeys.remote.siteSecret,
|
|
273
|
+
envKeys.remote.wpUrl,
|
|
274
|
+
envKeys.remote.wpUsername,
|
|
275
|
+
envKeys.remote.wpPassword
|
|
254
276
|
]
|
|
255
277
|
},
|
|
256
278
|
{
|
|
257
|
-
comment: "Kizlo
|
|
279
|
+
comment: "Kizlo Local",
|
|
258
280
|
keys: [
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
281
|
+
envKeys.local.siteSecret,
|
|
282
|
+
envKeys.local.wpUrl,
|
|
283
|
+
envKeys.local.wpUsername,
|
|
284
|
+
envKeys.local.wpPassword
|
|
263
285
|
]
|
|
264
286
|
}
|
|
265
287
|
];
|
|
@@ -354,4 +376,4 @@ function groupDefault(subCommandNames, run) {
|
|
|
354
376
|
}
|
|
355
377
|
|
|
356
378
|
//#endregion
|
|
357
|
-
export { addDependencyArgs, availablePackageManagers, detectImportAlias, detectInvokingPackageManager, detectPackageManager, ensureGitignored, envGroups, envKeysPresent, frameworkCreateArgs, getVersion, groupDefault, installArgs, loadEnvFiles, mergeEnv, pickStackPort, resolveModuleImport, runCommandAsync, runCommandCaptured, withSpinner, writeFileIfAbsent };
|
|
379
|
+
export { DEFAULT_ENV_KEYS, addDependencyArgs, availablePackageManagers, detectImportAlias, detectInvokingPackageManager, detectPackageManager, ensureGitignored, envGroups, envKeysPresent, frameworkCreateArgs, getVersion, groupDefault, installArgs, loadEnvFiles, mergeEnv, pickStackPort, resolveModuleImport, runCommandAsync, runCommandCaptured, withSpinner, writeFileIfAbsent };
|
|
@@ -3,10 +3,10 @@ import { basename, dirname, isAbsolute, resolve } from "node:path";
|
|
|
3
3
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
4
4
|
|
|
5
5
|
//#region src/cli/wp/compose/override.ts
|
|
6
|
-
/** Generated
|
|
7
|
-
const OVERRIDE_REL = ".kizlo/
|
|
6
|
+
/** Generated local WordPress override location, relative to the config root. */
|
|
7
|
+
const OVERRIDE_REL = ".kizlo/compose.local.yml";
|
|
8
8
|
/** Generated test override location (plugin mounts only), relative to the config root. */
|
|
9
|
-
const TEST_OVERRIDE_REL = ".kizlo/
|
|
9
|
+
const TEST_OVERRIDE_REL = ".kizlo/compose.test.yml";
|
|
10
10
|
const WP_ROOT = "/var/www/html";
|
|
11
11
|
const PLUGINS_DIR = `${WP_ROOT}/wp-content/plugins`;
|
|
12
12
|
/** Where the dev OPcache config is dropped so the container's PHP picks it up. */
|
|
@@ -20,7 +20,7 @@ describe("writeDevOverride", () => {
|
|
|
20
20
|
|
|
21
21
|
test("bind-mounts the whole install on both services and creates the host dir", () => {
|
|
22
22
|
const file = writeDevOverride(dir, { wordpressDir, mounts: [] })
|
|
23
|
-
expect(file).toBe(path.join(dir, ".kizlo", "
|
|
23
|
+
expect(file).toBe(path.join(dir, ".kizlo", "compose.local.yml"))
|
|
24
24
|
expect(fs.existsSync(wordpressDir)).toBe(true)
|
|
25
25
|
|
|
26
26
|
const body = fs.readFileSync(file, "utf8")
|
|
@@ -89,7 +89,7 @@ describe("writeTestOverride", () => {
|
|
|
89
89
|
|
|
90
90
|
test("mounts local plugin dirs by basename on both services", () => {
|
|
91
91
|
const file = writeTestOverride(dir, ["plugins/kizlo-woocommerce"])
|
|
92
|
-
expect(file).toBe(path.join(dir, ".kizlo", "
|
|
92
|
+
expect(file).toBe(path.join(dir, ".kizlo", "compose.test.yml"))
|
|
93
93
|
|
|
94
94
|
const body = fs.readFileSync(file, "utf8")
|
|
95
95
|
const pluginBind = `- "${path.join(dir, "plugins/kizlo-woocommerce")}:/var/www/html/wp-content/plugins/kizlo-woocommerce"`
|
|
@@ -2,10 +2,10 @@ import { mkdirSync, writeFileSync } from "node:fs"
|
|
|
2
2
|
import { basename, dirname, isAbsolute, resolve } from "node:path"
|
|
3
3
|
import { OPCACHE_INI, REMAP_ENTRYPOINT } from "../constants"
|
|
4
4
|
|
|
5
|
-
/** Generated
|
|
6
|
-
const OVERRIDE_REL = ".kizlo/
|
|
5
|
+
/** Generated local WordPress override location, relative to the config root. */
|
|
6
|
+
const OVERRIDE_REL = ".kizlo/compose.local.yml"
|
|
7
7
|
/** Generated test override location (plugin mounts only), relative to the config root. */
|
|
8
|
-
const TEST_OVERRIDE_REL = ".kizlo/
|
|
8
|
+
const TEST_OVERRIDE_REL = ".kizlo/compose.test.yml"
|
|
9
9
|
|
|
10
10
|
const WP_ROOT = "/var/www/html"
|
|
11
11
|
const PLUGINS_DIR = `${WP_ROOT}/wp-content/plugins`
|
|
@@ -12,13 +12,19 @@ declare function githubRelease(repo: string, tag: string): string;
|
|
|
12
12
|
declare function kizloRelease(slug: string): string;
|
|
13
13
|
/** The docker-compose file shipped alongside this module (in both `src/` and `dist/`). */
|
|
14
14
|
declare const COMPOSE_FILE: string;
|
|
15
|
-
/**
|
|
15
|
+
/** PHP OPcache config, shipped alongside this module and bind-mounted into the local WordPress. */
|
|
16
16
|
declare const OPCACHE_INI: string;
|
|
17
17
|
/** Linux-only entrypoint that retags www-data to the host user (see the script for why). */
|
|
18
18
|
declare const REMAP_ENTRYPOINT: string;
|
|
19
19
|
declare const CONFIG_FILES: string[];
|
|
20
|
-
/**
|
|
21
|
-
declare const CREDENTIALS_REL = ".kizlo/test
|
|
20
|
+
/** Test connection artifact location, relative to the config root. */
|
|
21
|
+
declare const CREDENTIALS_REL = ".kizlo/test.json";
|
|
22
|
+
/**
|
|
23
|
+
* Fixed folder the local WordPress install lives in, relative to the config root. The whole install
|
|
24
|
+
* (core, themes, uploads, plugins) is bind-mounted here; `kizlo dev reset` wipes it. It sits under
|
|
25
|
+
* `.kizlo/` — the single gitignored working dir — so there's no folder to choose or configure.
|
|
26
|
+
*/
|
|
27
|
+
declare const LOCAL_DIR_REL = ".kizlo/local";
|
|
22
28
|
/**
|
|
23
29
|
* DB-side marker written as the final bootstrap step and checked by `isSeeded`.
|
|
24
30
|
* It records that this database holds a completed bootstrap — independent of any
|
|
@@ -32,4 +38,4 @@ declare const DEFAULT_PLUGINS: PluginSource[];
|
|
|
32
38
|
declare const TEST_ADMIN: Omit<TestAdminUser, "id" | "applicationPassword">;
|
|
33
39
|
declare const TEST_USER: Omit<TestUser, "id">;
|
|
34
40
|
//#endregion
|
|
35
|
-
export { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease };
|
|
41
|
+
export { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, LOCAL_DIR_REL, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease };
|
package/dist/cli/wp/constants.js
CHANGED
|
@@ -18,7 +18,7 @@ function kizloRelease(slug) {
|
|
|
18
18
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
19
19
|
/** The docker-compose file shipped alongside this module (in both `src/` and `dist/`). */
|
|
20
20
|
const COMPOSE_FILE = resolve(HERE, "compose/docker-compose.yml");
|
|
21
|
-
/**
|
|
21
|
+
/** PHP OPcache config, shipped alongside this module and bind-mounted into the local WordPress. */
|
|
22
22
|
const OPCACHE_INI = resolve(HERE, "compose/opcache.ini");
|
|
23
23
|
/** Linux-only entrypoint that retags www-data to the host user (see the script for why). */
|
|
24
24
|
const REMAP_ENTRYPOINT = resolve(HERE, "compose/remap-entrypoint.sh");
|
|
@@ -27,8 +27,14 @@ const CONFIG_FILES = [
|
|
|
27
27
|
"kizlo.config.js",
|
|
28
28
|
"kizlo.config.mjs"
|
|
29
29
|
];
|
|
30
|
-
/**
|
|
31
|
-
const CREDENTIALS_REL = ".kizlo/test
|
|
30
|
+
/** Test connection artifact location, relative to the config root. */
|
|
31
|
+
const CREDENTIALS_REL = ".kizlo/test.json";
|
|
32
|
+
/**
|
|
33
|
+
* Fixed folder the local WordPress install lives in, relative to the config root. The whole install
|
|
34
|
+
* (core, themes, uploads, plugins) is bind-mounted here; `kizlo dev reset` wipes it. It sits under
|
|
35
|
+
* `.kizlo/` — the single gitignored working dir — so there's no folder to choose or configure.
|
|
36
|
+
*/
|
|
37
|
+
const LOCAL_DIR_REL = ".kizlo/local";
|
|
32
38
|
/**
|
|
33
39
|
* DB-side marker written as the final bootstrap step and checked by `isSeeded`.
|
|
34
40
|
* It records that this database holds a completed bootstrap — independent of any
|
|
@@ -59,4 +65,4 @@ const TEST_USER = {
|
|
|
59
65
|
};
|
|
60
66
|
|
|
61
67
|
//#endregion
|
|
62
|
-
export { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease };
|
|
68
|
+
export { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, LOCAL_DIR_REL, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease };
|
package/dist/cli/wp/dev.js
CHANGED
|
@@ -3,9 +3,8 @@ import { DEFAULT_PLUGINS, TEST_ADMIN } from "./constants.js";
|
|
|
3
3
|
import { compose, composePull, composeUp, wpCli } from "./docker.js";
|
|
4
4
|
import { ensurePlugins } from "./utils.js";
|
|
5
5
|
import { createAdminAppPassword, seedUsers } from "./bootstrap.js";
|
|
6
|
-
import { prepareByo } from "./byo.js";
|
|
7
6
|
import { join } from "node:path";
|
|
8
|
-
import { existsSync
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
9
8
|
import { networkInterfaces } from "node:os";
|
|
10
9
|
import { randomBytes } from "node:crypto";
|
|
11
10
|
|
|
@@ -19,7 +18,7 @@ function lanAddress() {
|
|
|
19
18
|
for (const ifaces of Object.values(networkInterfaces())) for (const iface of ifaces ?? []) if (iface.family === "IPv4" && !iface.internal) return iface.address;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
|
-
* The URL
|
|
21
|
+
* The URL local WordPress is provisioned at. We prefer the router-assigned LAN address over `localhost`
|
|
23
22
|
* so it's reachable from off the host (the app in a container or on another device). Serving WordPress
|
|
24
23
|
* under the request host is already handled by the container's `WORDPRESS_CONFIG_EXTRA` (it derives
|
|
25
24
|
* `WP_HOME`/`WP_SITEURL` from `HTTP_HOST` per request), so this is only the address we write into `.env`
|
|
@@ -29,7 +28,7 @@ function devUrl(port) {
|
|
|
29
28
|
return `http://${lanAddress() ?? "localhost"}:${port}`;
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
32
|
-
* Seed `dev.fixtures` into
|
|
31
|
+
* Seed `dev.fixtures` into freshly installed local WordPress, reusing the test seeding
|
|
33
32
|
* primitives: seed the default subscriber so `ctx.userId` exists, then run each `seed`
|
|
34
33
|
* over REST. Plugins are already active (`bootstrapDev` ensures them before seeding).
|
|
35
34
|
* The application password is minted only to drive seeding here — it's never printed
|
|
@@ -61,22 +60,18 @@ async function seedDevFixtures(cfg, url) {
|
|
|
61
60
|
return seeded;
|
|
62
61
|
}
|
|
63
62
|
/**
|
|
64
|
-
* Boot
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* stack is left untouched (idempotent reruns).
|
|
63
|
+
* Boot local WordPress via docker + wp-cli. A fresh install is provisioned with a default
|
|
64
|
+
* `wp core install`, then sets permalinks and ensures the `dev.fixtures` plugins (installed
|
|
65
|
+
* sources + bind-mounted locals). An already-provisioned install is left untouched
|
|
66
|
+
* (idempotent reruns).
|
|
69
67
|
*
|
|
70
|
-
* Credentials are an output, not a stored file: a
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* concern.
|
|
68
|
+
* Credentials are an output, not a stored file: a fresh install mints a random admin
|
|
69
|
+
* password and returns it once (to log into wp-admin). No application password is minted —
|
|
70
|
+
* that's a test concern.
|
|
74
71
|
*/
|
|
75
72
|
async function bootstrapDev(cfg) {
|
|
76
73
|
const url = devUrl(cfg.port);
|
|
77
|
-
|
|
78
|
-
const byo = fresh && cfg.byo ? await prepareByo(cfg.byo, cfg.wordpressDir, cfg.configDir) : void 0;
|
|
79
|
-
if (fresh && !byo) await composePull(["wordpress", "wp-cli"]).catch(() => void 0);
|
|
74
|
+
if (!existsSync(join(cfg.wordpressDir, "wp-includes", "version.php"))) await composePull(["wordpress", "wp-cli"]).catch(() => void 0);
|
|
80
75
|
await composeUp();
|
|
81
76
|
const installed = (await compose([
|
|
82
77
|
"exec",
|
|
@@ -87,46 +82,7 @@ async function bootstrapDev(cfg) {
|
|
|
87
82
|
"is-installed"
|
|
88
83
|
])).code === 0;
|
|
89
84
|
let password;
|
|
90
|
-
|
|
91
|
-
if (!installed && byo) {
|
|
92
|
-
imported = true;
|
|
93
|
-
if (byo.prefix !== "wp_") await wpCli([
|
|
94
|
-
"config",
|
|
95
|
-
"set",
|
|
96
|
-
"table_prefix",
|
|
97
|
-
byo.prefix,
|
|
98
|
-
"--type=variable"
|
|
99
|
-
]);
|
|
100
|
-
const imp = await compose([
|
|
101
|
-
"exec",
|
|
102
|
-
"-T",
|
|
103
|
-
"mysql",
|
|
104
|
-
"mysql",
|
|
105
|
-
"-uwordpress",
|
|
106
|
-
"-pwppass",
|
|
107
|
-
"wordpress"
|
|
108
|
-
], { inputFile: byo.sqlPath });
|
|
109
|
-
if (imp.code !== 0) throw new Error(`importing dev.byo database failed:\n${imp.stderr || imp.stdout}`);
|
|
110
|
-
rmSync(byo.sqlPath, { force: true });
|
|
111
|
-
const oldUrl = await wpCli([
|
|
112
|
-
"option",
|
|
113
|
-
"get",
|
|
114
|
-
"siteurl"
|
|
115
|
-
]).catch(() => "");
|
|
116
|
-
if (oldUrl && oldUrl !== url) await wpCli([
|
|
117
|
-
"search-replace",
|
|
118
|
-
oldUrl,
|
|
119
|
-
url,
|
|
120
|
-
"--all-tables",
|
|
121
|
-
"--skip-columns=guid",
|
|
122
|
-
"--report-changed-only"
|
|
123
|
-
]);
|
|
124
|
-
await wpCli([
|
|
125
|
-
"rewrite",
|
|
126
|
-
"flush",
|
|
127
|
-
"--hard"
|
|
128
|
-
]);
|
|
129
|
-
} else if (!installed) {
|
|
85
|
+
if (!installed) {
|
|
130
86
|
password = generatePassword();
|
|
131
87
|
await wpCli([
|
|
132
88
|
"core",
|
|
@@ -146,13 +102,12 @@ async function bootstrapDev(cfg) {
|
|
|
146
102
|
]);
|
|
147
103
|
}
|
|
148
104
|
await ensurePlugins([...DEFAULT_PLUGINS, ...cfg.fixtures.flatMap((fixture) => fixture.plugins ?? [])]);
|
|
149
|
-
const seeded = !installed &&
|
|
105
|
+
const seeded = !installed && cfg.fixtures.length ? await seedDevFixtures(cfg, url) : 0;
|
|
150
106
|
const appPassword = password ? await createAdminAppPassword("kizlo-dev") : void 0;
|
|
151
107
|
return {
|
|
152
108
|
url,
|
|
153
109
|
username: TEST_ADMIN.username,
|
|
154
110
|
dbPort: cfg.dbPort,
|
|
155
|
-
imported,
|
|
156
111
|
seeded,
|
|
157
112
|
appPassword,
|
|
158
113
|
secrets: password ? { password } : void 0
|
package/dist/cli/wp/docker.d.ts
CHANGED
|
@@ -41,10 +41,22 @@ interface RunResult {
|
|
|
41
41
|
stderr: string;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* Docker's readiness in three states, so callers can tell "not installed" from "installed but not
|
|
45
|
+
* running" and say the right thing:
|
|
46
|
+
* - `missing` — the `docker` binary isn't on PATH (`docker --version` errors).
|
|
47
|
+
* - `stopped` — the client is installed but the daemon is unreachable (`docker version` fails).
|
|
48
|
+
* - `running` — the daemon answered, so a stack can boot.
|
|
47
49
|
*/
|
|
50
|
+
type DockerStatus = "missing" | "stopped" | "running";
|
|
51
|
+
/**
|
|
52
|
+
* Probe Docker in two steps: `docker --version` only touches the client (is it installed?), then
|
|
53
|
+
* `docker version` contacts the server (is the daemon up?). Used before any command that needs local
|
|
54
|
+
* WordPress, so the caller can distinguish an install problem from a "start Docker" problem.
|
|
55
|
+
*/
|
|
56
|
+
declare function dockerStatus(): Promise<DockerStatus>;
|
|
57
|
+
/** The one-line fix to print when Docker isn't ready — install it, or start the daemon. */
|
|
58
|
+
declare function dockerHint(status: "missing" | "stopped"): string;
|
|
59
|
+
/** Whether the Docker daemon is reachable — the early check before a command that needs a stack. */
|
|
48
60
|
declare function dockerAvailable(): Promise<boolean>;
|
|
49
61
|
/** Build a stack-bound docker helper and mark it active for the bare helpers below. */
|
|
50
62
|
declare function createStack(stack: Stack): DockerStack;
|
|
@@ -65,4 +77,4 @@ declare const composeStop: (opts?: {
|
|
|
65
77
|
/** Run a wp-cli command against the active stack's warm `wp-cli` container. */
|
|
66
78
|
declare const wpCli: (args: string[]) => Promise<string>;
|
|
67
79
|
//#endregion
|
|
68
|
-
export { DockerStack, RunResult, Stack, compose, composeDown, composePull, composeStop, composeUp, createStack, dockerAvailable, wpCli };
|
|
80
|
+
export { DockerStack, DockerStatus, RunResult, Stack, compose, composeDown, composePull, composeStop, composeUp, createStack, dockerAvailable, dockerHint, dockerStatus, wpCli };
|
package/dist/cli/wp/docker.js
CHANGED
|
@@ -33,17 +33,30 @@ function run(cmd, args, env, opts) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* the
|
|
36
|
+
* Probe Docker in two steps: `docker --version` only touches the client (is it installed?), then
|
|
37
|
+
* `docker version` contacts the server (is the daemon up?). Used before any command that needs local
|
|
38
|
+
* WordPress, so the caller can distinguish an install problem from a "start Docker" problem.
|
|
39
39
|
*/
|
|
40
|
-
async function
|
|
40
|
+
async function dockerStatus() {
|
|
41
|
+
try {
|
|
42
|
+
if ((await run("docker", ["--version"], process.env)).code !== 0) return "missing";
|
|
43
|
+
} catch {
|
|
44
|
+
return "missing";
|
|
45
|
+
}
|
|
41
46
|
try {
|
|
42
|
-
return (await run("docker", ["version"], process.env)).code === 0;
|
|
47
|
+
return (await run("docker", ["version"], process.env)).code === 0 ? "running" : "stopped";
|
|
43
48
|
} catch {
|
|
44
|
-
return
|
|
49
|
+
return "stopped";
|
|
45
50
|
}
|
|
46
51
|
}
|
|
52
|
+
/** The one-line fix to print when Docker isn't ready — install it, or start the daemon. */
|
|
53
|
+
function dockerHint(status) {
|
|
54
|
+
return status === "missing" ? "Docker isn't installed. Install it from https://docs.docker.com/get-docker/, then re-run." : "Docker is installed but not running. Start Docker (Docker Desktop, or `sudo systemctl start docker`) and re-run.";
|
|
55
|
+
}
|
|
56
|
+
/** Whether the Docker daemon is reachable — the early check before a command that needs a stack. */
|
|
57
|
+
async function dockerAvailable() {
|
|
58
|
+
return await dockerStatus() === "running";
|
|
59
|
+
}
|
|
47
60
|
function bind(stack) {
|
|
48
61
|
const base = [
|
|
49
62
|
"compose",
|
|
@@ -131,4 +144,4 @@ const composeStop = (opts) => activeStack().composeStop(opts);
|
|
|
131
144
|
const wpCli = (args) => activeStack().wpCli(args);
|
|
132
145
|
|
|
133
146
|
//#endregion
|
|
134
|
-
export { compose, composeDown, composePull, composeStop, composeUp, createStack, dockerAvailable, wpCli };
|
|
147
|
+
export { compose, composeDown, composePull, composeStop, composeUp, createStack, dockerAvailable, dockerHint, dockerStatus, wpCli };
|
package/dist/cli/wp/settings.js
CHANGED
|
@@ -18,7 +18,7 @@ function originOf(url) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Rewrite a loopback host to `host.docker.internal` so the dockerized WordPress
|
|
21
|
+
* Rewrite a loopback host to `host.docker.internal` so the dockerized local WordPress can reach a
|
|
22
22
|
* Kizlo server on the host (the container's own `localhost` is not the host). Non-loopback hosts (real
|
|
23
23
|
* deployments) and unparseable URLs are returned unchanged.
|
|
24
24
|
*/
|
package/dist/cli/wp/setup.js
CHANGED
|
@@ -8,7 +8,7 @@ import { mkdirSync, writeFileSync } from "node:fs";
|
|
|
8
8
|
/**
|
|
9
9
|
* Phase 2 — after bootstrap, build a `SeedContext` and run each `Fixture.seed`
|
|
10
10
|
* over REST, collecting namespaced fixtures, then write the credentials artifact
|
|
11
|
-
* at `<config-dir>/.kizlo/test
|
|
11
|
+
* at `<config-dir>/.kizlo/test.json`. Returns a teardown that runs
|
|
12
12
|
* each fixture's `cleanup`.
|
|
13
13
|
*/
|
|
14
14
|
async function runSeeds(config) {
|
package/dist/cli/wp/stack.js
CHANGED
|
@@ -10,7 +10,7 @@ function localMounts(fixtures) {
|
|
|
10
10
|
/**
|
|
11
11
|
* The test stack: the base compose file under a `<name>-test` project, plus a generated
|
|
12
12
|
* mount override when any fixture carries a local (`{ path }`) plugin — so the same
|
|
13
|
-
* fixtures bind-mount their live plugin source here exactly as in
|
|
13
|
+
* fixtures bind-mount their live plugin source here exactly as in local WordPress.
|
|
14
14
|
*/
|
|
15
15
|
function testStack(cfg) {
|
|
16
16
|
const mounts = localMounts(cfg.fixtures);
|
|
@@ -36,9 +36,9 @@ function detectHostUser() {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
* `<name>-dev` project. Building
|
|
41
|
-
*
|
|
39
|
+
* Local WordPress: the base compose file plus the generated mount override, under a
|
|
40
|
+
* `<name>-dev` project. Building it (re)writes the override so it always matches the
|
|
41
|
+
* install folder (`.kizlo/local`) and the `dev.fixtures` local plugins.
|
|
42
42
|
*/
|
|
43
43
|
function devStack(cfg) {
|
|
44
44
|
const override = writeDevOverride(cfg.configDir, {
|
package/dist/config.d.ts
CHANGED
|
@@ -4,44 +4,41 @@ import "./test.js";
|
|
|
4
4
|
//#region src/config.d.ts
|
|
5
5
|
interface KizloDevConfig {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `"wordpress"`), not a hidden one, and don't delete it. `reset` wipes it.
|
|
7
|
+
* Run local WordPress under `kizlo dev`. When `true`, `kizlo dev` boots a Docker WordPress in
|
|
8
|
+
* `.kizlo/local` alongside the contract watcher; when unset or `false`, it runs the watcher alone
|
|
9
|
+
* (for a project pointing at your own WordPress). Set for you by `kizlo create` / `kizlo init`
|
|
10
|
+
* when you choose local WordPress.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
local?: boolean;
|
|
14
13
|
/** Published WP port (default 8080). */
|
|
15
14
|
port?: number;
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
18
|
-
* `.tar.gz` archive (path relative to the config dir) whose root holds a `wordpress/`
|
|
19
|
-
* directory (the install) and a single `.sql` dump (the database). Applied when the
|
|
20
|
-
* stack is fresh — the first `kizlo dev`, or after a `kizlo dev reset` — and ignored
|
|
21
|
-
* once the stack is provisioned. Keep the archive outside `path` (reset wipes that).
|
|
22
|
-
*/
|
|
23
|
-
byo?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Host port the dev MySQL is published on (default 3307), bound to `127.0.0.1` so
|
|
16
|
+
* Host port the local WordPress MySQL is published on (default 3307), bound to `127.0.0.1` so
|
|
26
17
|
* you can point a SQL client (TablePlus, DBeaver, `mysql`) at the database to
|
|
27
18
|
* inspect or edit tables directly. Connect with db `wordpress`, user `wordpress`,
|
|
28
|
-
* password `wppass`. Pick a port that's free — change it if you run multiple
|
|
19
|
+
* password `wppass`. Pick a port that's free — change it if you run multiple projects
|
|
29
20
|
* or already have MySQL on the default.
|
|
30
21
|
*/
|
|
31
22
|
dbPort?: number;
|
|
32
23
|
/**
|
|
33
|
-
* Code-defined seed data for a **fresh**
|
|
34
|
-
* test
|
|
24
|
+
* Code-defined seed data for a **fresh** local WordPress — the same {@link Fixture}s the
|
|
25
|
+
* test environment uses, so you can populate your local site from versioned code instead of a
|
|
35
26
|
* blank install. Each fixture also declares the plugins it needs — wp.org slugs / zip
|
|
36
27
|
* sources to install, or `{ path }` local directories bind-mounted live so your edits
|
|
37
|
-
* show up without a reinstall — which
|
|
28
|
+
* show up without a reinstall — which `kizlo dev` ensures every run. Each fixture's
|
|
38
29
|
* `seed` runs once over REST (and may drop to wp-cli) on the first `kizlo dev` and
|
|
39
|
-
* after `kizlo dev reset`; existing
|
|
40
|
-
* {@link byo} (which brings its own data).
|
|
30
|
+
* after `kizlo dev reset`; an existing install is left alone.
|
|
41
31
|
*/
|
|
42
32
|
fixtures?: Fixture[];
|
|
43
33
|
}
|
|
44
34
|
interface KizloTestConfig {
|
|
35
|
+
/**
|
|
36
|
+
* Run local WordPress under `kizlo test`. When `true`, `kizlo test` boots a disposable Docker
|
|
37
|
+
* WordPress, seeds it, and runs your suite against it; when unset or `false`, `kizlo test` just
|
|
38
|
+
* runs your project's test script. Set for you by `kizlo create` / `kizlo init` when you choose
|
|
39
|
+
* local WordPress.
|
|
40
|
+
*/
|
|
41
|
+
local?: boolean;
|
|
45
42
|
/** Published WP port (default 8889). */
|
|
46
43
|
port?: number;
|
|
47
44
|
/** Extension fixtures to install + seed. */
|
|
@@ -75,9 +72,9 @@ interface KizloGlobalConfig {
|
|
|
75
72
|
* to the sanitized `package.json` name, falling back to the config dir basename.
|
|
76
73
|
*/
|
|
77
74
|
name?: string;
|
|
78
|
-
/** Local WordPress
|
|
75
|
+
/** Local WordPress and contract watcher run by `kizlo dev`. */
|
|
79
76
|
dev?: KizloDevConfig;
|
|
80
|
-
/** WordPress test environment
|
|
77
|
+
/** WordPress test environment run by `kizlo test`. */
|
|
81
78
|
test?: KizloTestConfig;
|
|
82
79
|
}
|
|
83
80
|
declare function defineConfig(config: KizloGlobalConfig): KizloGlobalConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ import { COMMON_ERRORS, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, Def
|
|
|
39
39
|
import { AnyMiddleware, ExtractMiddlewareContextOutput, InferMiddlewares, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, createMiddleware } from "./shared/middleware.js";
|
|
40
40
|
import { AnyProcedure, AnyProcedureRouter, BaseHandlerOptions, ExtractParams, ExtractProcedureByScope, InvocationScope, OpenapiPart, Procedure, ProcedureErrors, ProcedureHandler, ProcedureOptions, ResolveParamsPart, ResolvedSchemaInput, ResolvedSchemaOutput, RouterDepthTuple, SchemaIO, buildProcedure, combineDetailed, createProcedure, handleUnexpectedError, schemaType } from "./shared/procedure.js";
|
|
41
41
|
import { AnyExtension, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, InferExtensionRouter, createExtension } from "./shared/extension.js";
|
|
42
|
-
import { AnyKizloConfig, CreateKizloOptions, Kizlo, KizloConfig,
|
|
42
|
+
import { AnyKizloConfig, CreateKizloOptions, Kizlo, KizloConfig, KizloConnect, RootRouter, S2SClient, ServiceAdapters, createKizlo, resolveKizloConfig } from "./kizlo.js";
|
|
43
43
|
import { WEB_MANIFEST_ROUTE, WebManifest, buildWebManifest, createManifestRoute } from "./brand/manifest.js";
|
|
44
44
|
import "./brand/index.js";
|
|
45
45
|
import { KizloClient, KizloClientConfig, createKizloClient } from "./client.js";
|
|
@@ -52,4 +52,4 @@ import { ShaAlgorithm, compare, hash, hmac } from "./shared/crypto.js";
|
|
|
52
52
|
import { Identifier, parseIdentifier } from "./shared/identifier.js";
|
|
53
53
|
import { createOrpcRouter } from "./shared/router.js";
|
|
54
54
|
import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
|
|
55
|
-
export { AnyContext, AnyEventSchema, AnyEvents, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CaptchaAdapter, CategoryService, CommentService, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CookiesStorage, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, Environment, ErrorDefinition, EventHandler, EventHandlerFn, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferExtensionRouter, InferMiddlewares, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloError, KizloErrorOptions,
|
|
55
|
+
export { AnyContext, AnyEventSchema, AnyEvents, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CaptchaAdapter, CategoryService, CommentService, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CookiesStorage, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, Environment, ErrorDefinition, EventHandler, EventHandlerFn, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferExtensionRouter, InferMiddlewares, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloConnect, KizloError, KizloErrorOptions, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, ManifestIcon, MaybeOptionalOptions, Media, MenuItemService, MenuService, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, PageService, PersonSettings, PersonSettingsInput, PluginSource, PostService, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureOptions, ROUTER_MAP, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedIcons, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootRouter, RouterDepthTuple, RouterMap, S2SClient, SAFE_REQUEST_TIMEOUT, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServiceAdapters, Settings, SettingsService, ShaAlgorithm, SiteSettings, SiteSettingsInput, Sitemap, SitemapIndex, SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, SocialProfile, TaxonomySettings, TaxonomySettingsInput, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UNEXPECTED_BODY_SNIPPET_LENGTH, UploadsSettings, UploadsSettingsInput, UserService, VerifyCaptchaFn, VerifyPreviewTokenFn, WC_CORE_BASE, WC_STORE_BASE, WEB_MANIFEST_ROUTE, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapContentType, WPK_SitemapIndex, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CATEGORY_ORDER_BYS, WP_CORE_BASE, WP_Category, WP_CategoryCreateErrorCode, WP_CategoryCreateInput, WP_CategoryDeleteErrorCode, WP_CategoryDeleteInput, WP_CategoryDeleteResponse, WP_CategoryLinks, WP_CategoryListErrorCode, WP_CategoryListInput, WP_CategoryOrderBy, WP_CategoryRetrieveErrorCode, WP_CategoryRetrieveInput, WP_CategoryTaxonomy, WP_CategoryUpdateErrorCode, WP_CategoryUpdateInput, WP_Comment, WP_CommentAvatarUrls, WP_CommentContent, WP_CommentContentInput, WP_CommentCreateErrorCode, WP_CommentCreateInput, WP_CommentDeleteErrorCode, WP_CommentDeleteInput, WP_CommentDeleteResponse, WP_CommentLinks, WP_CommentListErrorCode, WP_CommentListInput, WP_CommentOrderBy, WP_CommentRetrieveErrorCode, WP_CommentRetrieveInput, WP_CommentStatus, WP_CommentStatusFilter, WP_CommentStatusInput, WP_CommentType, WP_CommentUpdateErrorCode, WP_CommentUpdateInput, WP_CommonErrorCode, WP_Context, WP_CurrencyFormat, WP_Error, WP_ErrorData, WP_KIZLO_BASE, WP_Link, WP_List, WP_ListMetadata, WP_ListOrder, WP_MENU_ITEM_ORDER_BYES, WP_MENU_ITEM_TARGETS, WP_MENU_ITEM_TAX_RELATIONS, WP_Menu, WP_MenuCreateErrorCode, WP_MenuCreateInput, WP_MenuDeleteErrorCode, WP_MenuDeleteInput, WP_MenuDeleteResponse, WP_MenuItem, WP_MenuItemCreateErrorCode, WP_MenuItemCreateInput, WP_MenuItemDeleteErrorCode, WP_MenuItemDeleteInput, WP_MenuItemDeleteResponse, WP_MenuItemLinks, WP_MenuItemListErrorCode, WP_MenuItemListInput, WP_MenuItemOrderBy, WP_MenuItemRetrieveErrorCode, WP_MenuItemRetrieveInput, WP_MenuItemStatus, WP_MenuItemStatusFilter, WP_MenuItemTarget, WP_MenuItemTaxRelation, WP_MenuItemTitle, WP_MenuItemTitleInput, WP_MenuItemType, WP_MenuItemUpdateErrorCode, WP_MenuItemUpdateInput, WP_MenuLinks, WP_MenuListErrorCode, WP_MenuListInput, WP_MenuOrderBy, WP_MenuRetrieveErrorCode, WP_MenuRetrieveInput, WP_MenuUpdateErrorCode, WP_MenuUpdateInput, WP_PAGE_ORDER_BYES, WP_PAGE_STATUSES, WP_POST_FORMATS, WP_POST_ORDER_BYES, WP_POST_STATUSES, WP_POST_TAX_RELATIONS, WP_Page, WP_PageCommentStatus, WP_PageContent, WP_PageContentInput, WP_PageCreateErrorCode, WP_PageCreateInput, WP_PageDeleteErrorCode, WP_PageDeleteInput, WP_PageDeleteResponse, WP_PageExcerpt, WP_PageExcerptInput, WP_PageGuid, WP_PageLinks, WP_PageListErrorCode, WP_PageListInput, WP_PageOrderBy, WP_PageRetrieveErrorCode, WP_PageRetrieveInput, WP_PageStatus, WP_PageStatusFilter, WP_PageTitle, WP_PageTitleInput, WP_PageUpdateErrorCode, WP_PageUpdateInput, WP_Post, WP_PostCommentStatus, WP_PostContent, WP_PostContentInput, WP_PostCreateErrorCode, WP_PostCreateInput, WP_PostDeleteErrorCode, WP_PostDeleteInput, WP_PostDeleteResponse, WP_PostExcerpt, WP_PostExcerptInput, WP_PostFormat, WP_PostGuid, WP_PostLinks, WP_PostListErrorCode, WP_PostListInput, WP_PostOrderBy, WP_PostRetrieveErrorCode, WP_PostRetrieveInput, WP_PostStatus, WP_PostStatusFilter, WP_PostTaxRelation, WP_PostTitle, WP_PostTitleInput, WP_PostUpdateErrorCode, WP_PostUpdateInput, WP_RequestInput, WP_Result, WP_TAG_ORDER_BYS, WP_Tag, WP_TagCreateErrorCode, WP_TagCreateInput, WP_TagDeleteErrorCode, WP_TagDeleteInput, WP_TagDeleteResponse, WP_TagLinks, WP_TagListErrorCode, WP_TagListInput, WP_TagOrderBy, WP_TagRetrieveErrorCode, WP_TagRetrieveInput, WP_TagTaxonomy, WP_TagUpdateErrorCode, WP_TagUpdateInput, WP_User, WP_UserAvatarUrls, WP_UserCapabilities, WP_UserCreateErrorCode, WP_UserCreateInput, WP_UserDeleteErrorCode, WP_UserDeleteInput, WP_UserDeleteMeErrorCode, WP_UserDeleteMeInput, WP_UserDeleteMeResponse, WP_UserDeleteResponse, WP_UserLinks, WP_UserListErrorCode, WP_UserListInput, WP_UserOrderBy, WP_UserRetrieveErrorCode, WP_UserRetrieveInput, WP_UserRetrieveMeErrorCode, WP_UserRetrieveMeInput, WP_UserUpdateErrorCode, WP_UserUpdateInput, WP_UserUpdateMeErrorCode, WP_UserUpdateMeInput, WP_UserWho, WebManifest, WebhookOptions, WebhookSettings, WebhookSettingsInput, WithCommonErrorMap, WordPressCredentials, WordPressService, altcha, arkose, authMock, buildProcedure, buildWebManifest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createExtension, createGeoAdapter, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, noopAdapter, parseIdentifier, parseSitemapSlug, recaptcha, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, xmlResponse };
|
|
@@ -39,8 +39,8 @@ function createCachedTextRoute(handler, cacheTag, contentType) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
function getServerBaseUrl() {
|
|
42
|
-
const baseUrl = process.env.
|
|
43
|
-
if (!baseUrl) throw new KizloError("MISSING_ENV_VARIABLE", { message: "Please define
|
|
42
|
+
const baseUrl = process.env.NEXT_PUBLIC_KIZLO_API_URL;
|
|
43
|
+
if (!baseUrl) throw new KizloError("MISSING_ENV_VARIABLE", { message: "Please define NEXT_PUBLIC_KIZLO_API_URL in your .env file." });
|
|
44
44
|
return baseUrl;
|
|
45
45
|
}
|
|
46
46
|
|