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.
- package/dist/cli/commands/dev.js +82 -0
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/test.js +95 -33
- package/dist/cli/daemon/config.js +66 -6
- package/dist/cli/daemon/generate.js +1 -1
- package/dist/cli/daemon/lock.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/utils.js +17 -2
- package/dist/cli/wp/bootstrap.js +13 -10
- package/dist/cli/wp/byo.js +113 -0
- package/dist/cli/wp/compose/docker-compose.yml +1 -2
- package/dist/cli/wp/compose/opcache.ini +16 -0
- package/dist/cli/wp/compose/override.js +104 -0
- package/dist/cli/wp/compose/override.test.ts +115 -0
- package/dist/cli/wp/compose/override.ts +134 -0
- package/dist/cli/wp/compose/remap-entrypoint.sh +17 -0
- package/dist/cli/wp/constants.js +7 -8
- package/dist/cli/wp/dev.js +144 -0
- package/dist/cli/wp/docker.d.ts +38 -16
- package/dist/cli/wp/docker.js +81 -42
- package/dist/cli/wp/setup.js +1 -1
- package/dist/cli/wp/stack.js +58 -0
- package/dist/cli/wp/types.d.ts +22 -3
- package/dist/cli/wp/types.js +5 -1
- package/dist/cli/wp/utils.d.ts +23 -2
- package/dist/cli/wp/utils.js +45 -3
- package/dist/config.d.ts +49 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/menu/fixture.d.ts +1 -1
- package/dist/package.js +1 -1
- package/dist/post/fixture.d.ts +1 -1
- package/dist/test.d.ts +4 -4
- package/dist/test.js +4 -4
- package/package.json +2 -2
- package/dist/cli/commands/wp.js +0 -66
package/dist/cli/wp/docker.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { COMPOSE } from "./constants.js";
|
|
2
1
|
import { spawn } from "node:child_process";
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
3
|
|
|
4
4
|
//#region src/cli/wp/docker.ts
|
|
5
|
-
function run(cmd, args, opts) {
|
|
5
|
+
function run(cmd, args, env, opts) {
|
|
6
6
|
return new Promise((resolvePromise, reject) => {
|
|
7
|
-
const child = spawn(cmd, args, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const child = spawn(cmd, args, {
|
|
8
|
+
stdio: [
|
|
9
|
+
"pipe",
|
|
10
|
+
"pipe",
|
|
11
|
+
"pipe"
|
|
12
|
+
],
|
|
13
|
+
env
|
|
14
|
+
});
|
|
12
15
|
let stdout = "";
|
|
13
16
|
let stderr = "";
|
|
14
17
|
child.stdout.on("data", (d) => {
|
|
@@ -23,47 +26,83 @@ function run(cmd, args, opts) {
|
|
|
23
26
|
stdout,
|
|
24
27
|
stderr
|
|
25
28
|
}));
|
|
26
|
-
if (opts?.
|
|
29
|
+
if (opts?.inputFile !== void 0) createReadStream(opts.inputFile).on("error", reject).pipe(child.stdin);
|
|
30
|
+
else if (opts?.input !== void 0) child.stdin.end(opts.input);
|
|
27
31
|
else child.stdin.end();
|
|
28
32
|
});
|
|
29
33
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async
|
|
51
|
-
|
|
34
|
+
function bind(stack) {
|
|
35
|
+
const base = [
|
|
36
|
+
"compose",
|
|
37
|
+
"-p",
|
|
38
|
+
stack.project,
|
|
39
|
+
...stack.composeFiles.flatMap((file) => ["-f", file])
|
|
40
|
+
];
|
|
41
|
+
const env = {
|
|
42
|
+
...process.env,
|
|
43
|
+
WP_PORT: String(stack.port)
|
|
44
|
+
};
|
|
45
|
+
const compose$1 = (args, opts) => run("docker", [...base, ...args], env, opts);
|
|
46
|
+
const composeUp$1 = async () => {
|
|
47
|
+
const res = await compose$1([
|
|
48
|
+
"up",
|
|
49
|
+
"-d",
|
|
50
|
+
"--wait"
|
|
51
|
+
]);
|
|
52
|
+
if (res.code !== 0) throw new Error(`docker compose up failed:\n${res.stderr}`);
|
|
53
|
+
};
|
|
54
|
+
const composeDown$1 = async (opts) => {
|
|
55
|
+
const args = ["down"];
|
|
56
|
+
if (opts?.volumes) args.push("-v");
|
|
57
|
+
await compose$1(args);
|
|
58
|
+
};
|
|
59
|
+
const composeStop$1 = async () => {
|
|
60
|
+
await compose$1(["stop"]);
|
|
61
|
+
};
|
|
62
|
+
const wpCli$1 = async (args) => {
|
|
63
|
+
const res = await compose$1([
|
|
64
|
+
"exec",
|
|
65
|
+
"-T",
|
|
66
|
+
"wp-cli",
|
|
67
|
+
"wp",
|
|
68
|
+
...args
|
|
69
|
+
]);
|
|
70
|
+
if (res.code !== 0) throw new Error(`wp ${args.join(" ")} failed:\n${res.stderr || res.stdout}`);
|
|
71
|
+
return res.stdout.replace(/\r/g, "").trim();
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
compose: compose$1,
|
|
75
|
+
composeUp: composeUp$1,
|
|
76
|
+
composeStop: composeStop$1,
|
|
77
|
+
composeDown: composeDown$1,
|
|
78
|
+
wpCli: wpCli$1
|
|
79
|
+
};
|
|
52
80
|
}
|
|
53
81
|
/**
|
|
54
|
-
*
|
|
82
|
+
* The stack the module-level helpers target. `createStack` sets it so fixtures —
|
|
83
|
+
* which call the public `wpCli`/`compose` with no stack — hit whatever stack the
|
|
84
|
+
* running command activated (the test stack during seeding).
|
|
55
85
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return res.stdout.replace(/\r/g, "").trim();
|
|
86
|
+
let active = null;
|
|
87
|
+
/** Build a stack-bound docker helper and mark it active for the bare helpers below. */
|
|
88
|
+
function createStack(stack) {
|
|
89
|
+
active = stack;
|
|
90
|
+
return bind(stack);
|
|
91
|
+
}
|
|
92
|
+
function activeStack() {
|
|
93
|
+
if (!active) throw new Error("No active kizlo stack — createStack() must run first.");
|
|
94
|
+
return bind(active);
|
|
66
95
|
}
|
|
96
|
+
/** `docker compose <args>` against the active stack. */
|
|
97
|
+
const compose = (args, opts) => activeStack().compose(args, opts);
|
|
98
|
+
/** Bring the active stack's services up detached and wait for health checks. */
|
|
99
|
+
const composeUp = () => activeStack().composeUp();
|
|
100
|
+
/** Tear the active stack down, optionally removing volumes. */
|
|
101
|
+
const composeDown = (opts) => activeStack().composeDown(opts);
|
|
102
|
+
/** `docker compose stop` — halt the active stack's containers but keep volumes. */
|
|
103
|
+
const composeStop = () => activeStack().composeStop();
|
|
104
|
+
/** Run a wp-cli command against the active stack's warm `wp-cli` container. */
|
|
105
|
+
const wpCli = (args) => activeStack().wpCli(args);
|
|
67
106
|
|
|
68
107
|
//#endregion
|
|
69
|
-
export { compose, composeDown, composeStop, composeUp, wpCli };
|
|
108
|
+
export { compose, composeDown, composeStop, composeUp, createStack, wpCli };
|
package/dist/cli/wp/setup.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WordPressService } from "../../wordpress/service.js";
|
|
2
2
|
import { credentialsPath } from "./utils.js";
|
|
3
3
|
import { bootstrapWp } from "./bootstrap.js";
|
|
4
|
-
import { dirname } from "node:path";
|
|
5
4
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
5
|
+
import { dirname } from "node:path";
|
|
6
6
|
|
|
7
7
|
//#region src/cli/wp/setup.ts
|
|
8
8
|
/**
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { isLocalPlugin } from "./types.js";
|
|
2
|
+
import { COMPOSE_FILE } from "./constants.js";
|
|
3
|
+
import { writeDevOverride, writeTestOverride } from "./compose/override.js";
|
|
4
|
+
|
|
5
|
+
//#region src/cli/wp/stack.ts
|
|
6
|
+
/** The local-plugin dirs to bind-mount, gathered from every fixture's `plugins`. */
|
|
7
|
+
function localMounts(fixtures) {
|
|
8
|
+
return fixtures.flatMap((fixture) => fixture.plugins ?? []).filter(isLocalPlugin).map((plugin) => plugin.path);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The test stack: the base compose file under a `<name>-test` project, plus a generated
|
|
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 the dev stack.
|
|
14
|
+
*/
|
|
15
|
+
function testStack(cfg) {
|
|
16
|
+
const mounts = localMounts(cfg.fixtures);
|
|
17
|
+
const composeFiles = mounts.length ? [COMPOSE_FILE, writeTestOverride(cfg.configDir, mounts)] : [COMPOSE_FILE];
|
|
18
|
+
return {
|
|
19
|
+
project: cfg.project,
|
|
20
|
+
port: cfg.port,
|
|
21
|
+
composeFiles
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The host user to run the dev container as, so bind-mounted files come out owned
|
|
26
|
+
* by you. Only on native Linux, where Docker doesn't remap ownership; `undefined`
|
|
27
|
+
* (a no-op) on macOS/Windows, and when running as root (no benefit).
|
|
28
|
+
*/
|
|
29
|
+
function detectHostUser() {
|
|
30
|
+
if (process.platform !== "linux" || typeof process.getuid !== "function") return void 0;
|
|
31
|
+
const uid = process.getuid();
|
|
32
|
+
if (uid === 0) return void 0;
|
|
33
|
+
return {
|
|
34
|
+
uid,
|
|
35
|
+
gid: typeof process.getgid === "function" ? process.getgid() : uid
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The dev stack: the base compose file plus the generated mount override, under a
|
|
40
|
+
* `<name>-dev` project. Building the stack (re)writes the override so it always
|
|
41
|
+
* matches the current `dev.path` and the `dev.fixtures` local plugins.
|
|
42
|
+
*/
|
|
43
|
+
function devStack(cfg) {
|
|
44
|
+
const override = writeDevOverride(cfg.configDir, {
|
|
45
|
+
wordpressDir: cfg.wordpressDir,
|
|
46
|
+
mounts: localMounts(cfg.fixtures),
|
|
47
|
+
hostUser: detectHostUser(),
|
|
48
|
+
dbPort: cfg.dbPort
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
project: cfg.project,
|
|
52
|
+
port: cfg.port,
|
|
53
|
+
composeFiles: [COMPOSE_FILE, override]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { devStack, testStack };
|
package/dist/cli/wp/types.d.ts
CHANGED
|
@@ -55,12 +55,31 @@ type PluginSource = string | {
|
|
|
55
55
|
name: string;
|
|
56
56
|
source: string;
|
|
57
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* A local plugin directory to bind-mount into the dev stack (`kizlo dev`) instead
|
|
60
|
+
* of installing it. The container gets the live files at
|
|
61
|
+
* `wp-content/plugins/<basename(path)>`, so edits show up without a reinstall, and
|
|
62
|
+
* the plugin is activated by that basename. `path` is relative to the config dir.
|
|
63
|
+
*/
|
|
64
|
+
type LocalPlugin = {
|
|
65
|
+
path: string;
|
|
66
|
+
};
|
|
67
|
+
/** A `kizlo dev` plugin entry: an installable {@link PluginSource} or a {@link LocalPlugin} to mount. */
|
|
68
|
+
type DevPluginSource = PluginSource | LocalPlugin;
|
|
69
|
+
/** True when a dev plugin entry is a local directory to bind-mount, not something to install. */
|
|
70
|
+
declare function isLocalPlugin(plugin: DevPluginSource): plugin is LocalPlugin;
|
|
58
71
|
/** The serializable test layer an extension ships alongside its live extension. */
|
|
59
72
|
interface Fixture {
|
|
60
73
|
/** Namespace key under `TestCredentials.fixtures`. */
|
|
61
74
|
name: string;
|
|
62
|
-
/**
|
|
63
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Plugins this fixture needs active, in order (deps first). Each entry is either
|
|
77
|
+
* an installable {@link PluginSource} (wp.org slug / zip source) or a
|
|
78
|
+
* {@link LocalPlugin} (`{ path }`) bind-mounted live from your repo — the same
|
|
79
|
+
* shape `kizlo dev` mounts, so a fixture can carry your plugin's local source
|
|
80
|
+
* and it behaves identically in the dev and test stacks (no build/zip step).
|
|
81
|
+
*/
|
|
82
|
+
plugins?: DevPluginSource[];
|
|
64
83
|
/** Build this extension's world once during seeding; return created handles. */
|
|
65
84
|
seed?: (ctx: SeedContext) => Promise<Record<string, JsonValue>>;
|
|
66
85
|
/** Revert per-test mutations (teardown); does NOT uninstall plugins or seeded data. */
|
|
@@ -69,4 +88,4 @@ interface Fixture {
|
|
|
69
88
|
/** Identity helper for authoring a `Fixture` with full inference and autocomplete. */
|
|
70
89
|
declare function defineFixture(fixture: Fixture): Fixture;
|
|
71
90
|
//#endregion
|
|
72
|
-
export { Fixture, JsonValue, PluginSource, SeedContext, TestAdminUser, TestCredentials, TestUser, defineFixture };
|
|
91
|
+
export { DevPluginSource, Fixture, JsonValue, LocalPlugin, PluginSource, SeedContext, TestAdminUser, TestCredentials, TestUser, defineFixture, isLocalPlugin };
|
package/dist/cli/wp/types.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
//#region src/cli/wp/types.ts
|
|
2
|
+
/** True when a dev plugin entry is a local directory to bind-mount, not something to install. */
|
|
3
|
+
function isLocalPlugin(plugin) {
|
|
4
|
+
return typeof plugin === "object" && "path" in plugin;
|
|
5
|
+
}
|
|
2
6
|
/** Identity helper for authoring a `Fixture` with full inference and autocomplete. */
|
|
3
7
|
function defineFixture(fixture) {
|
|
4
8
|
return fixture;
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
//#endregion
|
|
8
|
-
export { defineFixture };
|
|
12
|
+
export { defineFixture, isLocalPlugin };
|
package/dist/cli/wp/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginSource, TestCredentials } from "./types.js";
|
|
1
|
+
import { DevPluginSource, PluginSource, TestCredentials } from "./types.js";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/wp/utils.d.ts
|
|
4
4
|
|
|
@@ -16,6 +16,12 @@ import { PluginSource, TestCredentials } from "./types.js";
|
|
|
16
16
|
declare function isSeeded(): Promise<boolean>;
|
|
17
17
|
/** Build a GitHub release-zip URL for `PluginSource.source` (asset named `<tag>.zip`). */
|
|
18
18
|
declare function githubRelease(repo: string, tag: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Download URL for a Kizlo plugin's latest release, served by kizlo.io (it 302s to
|
|
21
|
+
* the current GitHub release asset). Always tracks the newest published version —
|
|
22
|
+
* use {@link githubRelease} instead to pin a specific tag.
|
|
23
|
+
*/
|
|
24
|
+
declare function kizloRelease(slug: string): string;
|
|
19
25
|
/** Resolve a `PluginSource` to the `(name, source)` pair `ensurePlugin` needs. */
|
|
20
26
|
declare function resolvePluginSource(plugin: PluginSource): [name: string, source: string];
|
|
21
27
|
/**
|
|
@@ -25,6 +31,21 @@ declare function resolvePluginSource(plugin: PluginSource): [name: string, sourc
|
|
|
25
31
|
* are absent (i.e. after `wp reset` wipes the volume).
|
|
26
32
|
*/
|
|
27
33
|
declare function ensurePlugin(name: string, source: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Activate a bind-mounted local plugin by its directory basename (the slug the
|
|
36
|
+
* mount lands at under `wp-content/plugins`). Idempotent: the files arrive via the
|
|
37
|
+
* compose bind, so there's nothing to install — just activate if it isn't already.
|
|
38
|
+
*/
|
|
39
|
+
declare function activateLocalPlugin(pluginPath: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Ensure every plugin is active. Installable sources go first so a bind-mounted
|
|
42
|
+
* local plugin that depends on one (e.g. a WooCommerce extension) finds it already
|
|
43
|
+
* present; then each {@link LocalPlugin} is activated by basename. A local plugin
|
|
44
|
+
* whose slug matches an installable (e.g. mounting `kizlo` over the released
|
|
45
|
+
* `kizlo`) is seen as already installed, so `ensurePlugin` activates the live
|
|
46
|
+
* files instead of downloading over them.
|
|
47
|
+
*/
|
|
48
|
+
declare function ensurePlugins(plugins: DevPluginSource[]): Promise<void>;
|
|
28
49
|
/**
|
|
29
50
|
* The directory holding `kizlo.config.*`, found by walking up from `cwd` (falling
|
|
30
51
|
* back to `cwd` when none is found). Anchoring the credentials artifact here —
|
|
@@ -36,4 +57,4 @@ declare function findConfigDir(cwd?: string): string;
|
|
|
36
57
|
declare function credentialsPath(cwd?: string): string;
|
|
37
58
|
declare function getTestCredentials(): TestCredentials;
|
|
38
59
|
//#endregion
|
|
39
|
-
export { credentialsPath, ensurePlugin, findConfigDir, getTestCredentials, githubRelease, isSeeded, resolvePluginSource };
|
|
60
|
+
export { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, resolvePluginSource };
|
package/dist/cli/wp/utils.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isLocalPlugin } from "./types.js";
|
|
2
2
|
import { compose, wpCli } from "./docker.js";
|
|
3
|
-
import {
|
|
3
|
+
import { CONFIG_FILES, CREDENTIALS_REL, SEED_MARKER_OPTION, SEED_VERSION } from "./constants.js";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
+
import { basename, dirname, resolve } from "node:path";
|
|
5
6
|
|
|
6
7
|
//#region src/cli/wp/utils.ts
|
|
7
8
|
/**
|
|
@@ -32,6 +33,14 @@ async function isSeeded() {
|
|
|
32
33
|
function githubRelease(repo, tag) {
|
|
33
34
|
return `https://github.com/${repo}/releases/download/${tag}/${tag}.zip`;
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Download URL for a Kizlo plugin's latest release, served by kizlo.io (it 302s to
|
|
38
|
+
* the current GitHub release asset). Always tracks the newest published version —
|
|
39
|
+
* use {@link githubRelease} instead to pin a specific tag.
|
|
40
|
+
*/
|
|
41
|
+
function kizloRelease(slug) {
|
|
42
|
+
return `https://kizlo.io/plugins/${slug}/download`;
|
|
43
|
+
}
|
|
35
44
|
/** Resolve a `PluginSource` to the `(name, source)` pair `ensurePlugin` needs. */
|
|
36
45
|
function resolvePluginSource(plugin) {
|
|
37
46
|
return typeof plugin === "string" ? [plugin, plugin] : [plugin.name, plugin.source];
|
|
@@ -76,6 +85,39 @@ async function ensurePlugin(name, source) {
|
|
|
76
85
|
]);
|
|
77
86
|
}
|
|
78
87
|
/**
|
|
88
|
+
* Activate a bind-mounted local plugin by its directory basename (the slug the
|
|
89
|
+
* mount lands at under `wp-content/plugins`). Idempotent: the files arrive via the
|
|
90
|
+
* compose bind, so there's nothing to install — just activate if it isn't already.
|
|
91
|
+
*/
|
|
92
|
+
async function activateLocalPlugin(pluginPath) {
|
|
93
|
+
const slug = basename(pluginPath);
|
|
94
|
+
if ((await compose([
|
|
95
|
+
"exec",
|
|
96
|
+
"-T",
|
|
97
|
+
"wp-cli",
|
|
98
|
+
"wp",
|
|
99
|
+
"plugin",
|
|
100
|
+
"is-active",
|
|
101
|
+
slug
|
|
102
|
+
])).code !== 0) await wpCli([
|
|
103
|
+
"plugin",
|
|
104
|
+
"activate",
|
|
105
|
+
slug
|
|
106
|
+
]);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Ensure every plugin is active. Installable sources go first so a bind-mounted
|
|
110
|
+
* local plugin that depends on one (e.g. a WooCommerce extension) finds it already
|
|
111
|
+
* present; then each {@link LocalPlugin} is activated by basename. A local plugin
|
|
112
|
+
* whose slug matches an installable (e.g. mounting `kizlo` over the released
|
|
113
|
+
* `kizlo`) is seen as already installed, so `ensurePlugin` activates the live
|
|
114
|
+
* files instead of downloading over them.
|
|
115
|
+
*/
|
|
116
|
+
async function ensurePlugins(plugins) {
|
|
117
|
+
for (const plugin of plugins) if (!isLocalPlugin(plugin)) await ensurePlugin(...resolvePluginSource(plugin));
|
|
118
|
+
for (const plugin of plugins) if (isLocalPlugin(plugin)) await activateLocalPlugin(plugin.path);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
79
121
|
* The directory holding `kizlo.config.*`, found by walking up from `cwd` (falling
|
|
80
122
|
* back to `cwd` when none is found). Anchoring the credentials artifact here —
|
|
81
123
|
* rather than each process's cwd — is what lets the CLI writer and the test reader
|
|
@@ -102,4 +144,4 @@ function getTestCredentials() {
|
|
|
102
144
|
}
|
|
103
145
|
|
|
104
146
|
//#endregion
|
|
105
|
-
export { credentialsPath, ensurePlugin, findConfigDir, getTestCredentials, githubRelease, isSeeded, resolvePluginSource };
|
|
147
|
+
export { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, resolvePluginSource };
|
package/dist/config.d.ts
CHANGED
|
@@ -2,9 +2,48 @@ import { Fixture } from "./cli/wp/types.js";
|
|
|
2
2
|
import "./test.js";
|
|
3
3
|
|
|
4
4
|
//#region src/config.d.ts
|
|
5
|
-
interface
|
|
5
|
+
interface KizloDevConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Folder where your local WordPress install lives, relative to the config dir.
|
|
8
|
+
* The entire install (core, themes, uploads, plugins) is bind-mounted here, so
|
|
9
|
+
* you browse and edit every file from your file manager and your changes are
|
|
10
|
+
* live. This is your persistent dev site — pick a real, visible folder (e.g.
|
|
11
|
+
* `"wordpress"`), not a hidden one, and don't delete it. `reset` wipes it.
|
|
12
|
+
*/
|
|
13
|
+
path: string;
|
|
6
14
|
/** Published WP port (default 8080). */
|
|
7
15
|
port?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Adopt an existing WordPress site instead of provisioning a blank one. Points at a
|
|
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
|
|
26
|
+
* you can point a SQL client (TablePlus, DBeaver, `mysql`) at the database to
|
|
27
|
+
* 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 stacks
|
|
29
|
+
* or already have MySQL on the default.
|
|
30
|
+
*/
|
|
31
|
+
dbPort?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Code-defined seed data for a **fresh** dev stack — the same {@link Fixture}s the
|
|
34
|
+
* test stack uses, so you can populate your dev site from versioned code instead of a
|
|
35
|
+
* blank install. Each fixture also declares the plugins it needs — wp.org slugs / zip
|
|
36
|
+
* sources to install, or `{ path }` local directories bind-mounted live so your edits
|
|
37
|
+
* show up without a reinstall — which the dev stack ensures every run. Each fixture's
|
|
38
|
+
* `seed` runs once over REST (and may drop to wp-cli) on the first `kizlo dev` and
|
|
39
|
+
* after `kizlo dev reset`; existing stacks are left alone. Mutually exclusive with
|
|
40
|
+
* {@link byo} (which brings its own data).
|
|
41
|
+
*/
|
|
42
|
+
fixtures?: Fixture[];
|
|
43
|
+
}
|
|
44
|
+
interface KizloTestConfig {
|
|
45
|
+
/** Published WP port (default 8889). */
|
|
46
|
+
port?: number;
|
|
8
47
|
/** Extension fixtures to install + seed. */
|
|
9
48
|
fixtures?: Fixture[];
|
|
10
49
|
/**
|
|
@@ -31,9 +70,16 @@ interface KizloGlobalConfig {
|
|
|
31
70
|
* tsconfig at init; omit (or empty) to use relative imports.
|
|
32
71
|
*/
|
|
33
72
|
alias?: string;
|
|
34
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Base name for the local Docker stacks (`<name>-dev`, `<name>-test`). Defaults
|
|
75
|
+
* to the sanitized `package.json` name, falling back to the config dir basename.
|
|
76
|
+
*/
|
|
77
|
+
name?: string;
|
|
78
|
+
/** Local WordPress dev stack used by `kizlo dev`. */
|
|
79
|
+
dev?: KizloDevConfig;
|
|
80
|
+
/** WordPress test environment used by `kizlo test`. */
|
|
35
81
|
test?: KizloTestConfig;
|
|
36
82
|
}
|
|
37
83
|
declare function defineConfig(config: KizloGlobalConfig): KizloGlobalConfig;
|
|
38
84
|
//#endregion
|
|
39
|
-
export { KizloGlobalConfig, KizloTestConfig, defineConfig };
|
|
85
|
+
export { KizloDevConfig, KizloGlobalConfig, KizloTestConfig, defineConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { CommentService } from "./wordpress/comment/service.js";
|
|
|
14
14
|
import { CART_HASH_HEADER_KEY, SAFE_REQUEST_TIMEOUT, UNEXPECTED_BODY_SNIPPET_LENGTH, WC_CORE_BASE, WC_STORE_BASE, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_KIZLO_BASE } from "./wordpress/constants.js";
|
|
15
15
|
import { isWordPressResourceError } from "./wordpress/utils.js";
|
|
16
16
|
import "./wordpress/index.js";
|
|
17
|
+
import { DevPluginSource, Fixture, JsonValue, LocalPlugin, PluginSource, SeedContext, TestAdminUser, TestCredentials, TestUser, defineFixture, isLocalPlugin } from "./cli/wp/types.js";
|
|
17
18
|
import { AuthAdapter, AuthUser, authMock } from "./adapters/auth.js";
|
|
18
19
|
import { CaptchaAdapter, altcha, arkose, friendlyCaptcha, hcaptcha, recaptcha, turnstile } from "./adapters/captcha.js";
|
|
19
20
|
import { ConnInfo, GeoAdapter, geoMock } from "./adapters/geo.js";
|
|
@@ -36,4 +37,4 @@ import { compare, hash, hmac } from "./shared/crypto.js";
|
|
|
36
37
|
import { Identifier, parseIdentifier } from "./shared/identifier.js";
|
|
37
38
|
import { createOrpcRouter } from "./shared/router.js";
|
|
38
39
|
import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
|
|
39
|
-
export { AnyContext, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AnyWebhookEventSchema, AnyWebhookEvents, AuthAdapter, AuthUser, AuthUserFn, CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CaptchaAdapter, CommentService, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CreateKizloOptions, CurrencyFormat, DefinedErrorLike, DefinedErrorMapLike, Environment, EventHandler, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, GeoAdapter, HTTPMethod, Identifier, IdentifierInput, InferExtensionRouter, InferWebhookEventUnion, InvocationScope, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloError, KizloErrorOptions, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LogLevel, LogPayload, Logger, LoggerAdapter, MaybeOptionalOptions, Media, MenuItemService, MenuService, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, PostService, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureHandler, ProcedureOptions, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootRouter, RouterDepthTuple, S2SClient, SAFE_REQUEST_TIMEOUT, SchemaIO, Seo, SeoHead, SeoSchema, ServerContext, Service, ServiceAdapters, ServiceConfig, Sitemap, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, ThrowableErrorFn, ThrowableErrorMap, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, VerifyCaptchaFn, VerifyPreviewTokenFn, WC_CORE_BASE, WC_STORE_BASE, WPK_ListSitemapUrlInput, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapContentType, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, 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, 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_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_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, WebhookHandlerFn, WebhookOptions, WithCommonErrorMap, WordPressCredentials, WordPressService, altcha, arkose, authMock, buildProcedure, combineDetailed, compare, consoleLog, createEventHandler, createExtension, createKizlo, createKizloClient, createMiddleware, createOrpcRouter, createProcedure, createThrowableErrorMap, createWebhookRouter, defineErrorMap, deserializeCurrencyFormat, deserializeListMetadata, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isWordPressResourceError, noopAdapter, parseIdentifier, recaptcha, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
|
|
40
|
+
export { AnyContext, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AnyWebhookEventSchema, AnyWebhookEvents, AuthAdapter, AuthUser, AuthUserFn, CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CaptchaAdapter, CommentService, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CreateKizloOptions, CurrencyFormat, DefinedErrorLike, DefinedErrorMapLike, DevPluginSource, Environment, EventHandler, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, GeoAdapter, HTTPMethod, Identifier, IdentifierInput, InferExtensionRouter, InferWebhookEventUnion, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloError, KizloErrorOptions, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, MaybeOptionalOptions, Media, MenuItemService, MenuService, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, PluginSource, PostService, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureHandler, ProcedureOptions, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootRouter, RouterDepthTuple, S2SClient, SAFE_REQUEST_TIMEOUT, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServerContext, Service, ServiceAdapters, ServiceConfig, Sitemap, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, VerifyCaptchaFn, VerifyPreviewTokenFn, WC_CORE_BASE, WC_STORE_BASE, WPK_ListSitemapUrlInput, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapContentType, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, 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, 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_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_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, WebhookHandlerFn, WebhookOptions, WithCommonErrorMap, WordPressCredentials, WordPressService, altcha, arkose, authMock, buildProcedure, combineDetailed, compare, consoleLog, createEventHandler, createExtension, createKizlo, createKizloClient, createMiddleware, createOrpcRouter, createProcedure, createThrowableErrorMap, createWebhookRouter, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, noopAdapter, parseIdentifier, recaptcha, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { altcha, arkose, friendlyCaptcha, hcaptcha, recaptcha, turnstile } from
|
|
|
3
3
|
import { geoMock } from "./adapters/geo.js";
|
|
4
4
|
import { geoVercelNext } from "./adapters/geo.vercel.js";
|
|
5
5
|
import { consoleLog, noopAdapter } from "./adapters/logger.js";
|
|
6
|
+
import { defineFixture, isLocalPlugin } from "./cli/wp/types.js";
|
|
6
7
|
import { COMMON_ERRORS, KizloError, createThrowableErrorMap, defineErrorMap, isKizloError, toKizloError } from "./shared/error.js";
|
|
7
8
|
import { buildProcedure, combineDetailed, createMiddleware, createProcedure, handleUnexpectedError, schemaType } from "./shared/procedure.js";
|
|
8
9
|
import { createOrpcRouter } from "./shared/router.js";
|
|
@@ -28,4 +29,4 @@ import { createEventHandler, createWebhookRouter } from "./webhook/index.js";
|
|
|
28
29
|
import { Kizlo, createKizlo, resolveKizloConfig } from "./kizlo.js";
|
|
29
30
|
import { createExtension } from "./shared/extension.js";
|
|
30
31
|
|
|
31
|
-
export { CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CommentService, ContentType, Context, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, Media, MenuItemService, MenuService, PostService, PreviewTokenData, PreviewTokenPayload, Robots, RobotsRule, SAFE_REQUEST_TIMEOUT, Seo, SeoHead, SeoSchema, Service, Sitemap, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, WC_CORE_BASE, WC_STORE_BASE, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_Error, WP_KIZLO_BASE, WordPressService, altcha, arkose, authMock, buildProcedure, combineDetailed, compare, consoleLog, createEventHandler, createExtension, createKizlo, createKizloClient, createMiddleware, createOrpcRouter, createProcedure, createThrowableErrorMap, createWebhookRouter, defineErrorMap, deserializeCurrencyFormat, deserializeListMetadata, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isWordPressResourceError, noopAdapter, parseIdentifier, recaptcha, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
|
|
32
|
+
export { CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CommentService, ContentType, Context, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, Media, MenuItemService, MenuService, PostService, PreviewTokenData, PreviewTokenPayload, Robots, RobotsRule, SAFE_REQUEST_TIMEOUT, Seo, SeoHead, SeoSchema, Service, Sitemap, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, WC_CORE_BASE, WC_STORE_BASE, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_Error, WP_KIZLO_BASE, WordPressService, altcha, arkose, authMock, buildProcedure, combineDetailed, compare, consoleLog, createEventHandler, createExtension, createKizlo, createKizloClient, createMiddleware, createOrpcRouter, createProcedure, createThrowableErrorMap, createWebhookRouter, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, noopAdapter, parseIdentifier, recaptcha, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
|
package/dist/menu/fixture.d.ts
CHANGED
package/dist/package.js
CHANGED
package/dist/post/fixture.d.ts
CHANGED
package/dist/test.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { compose, composeDown, composeStop, composeUp, wpCli } from "./cli/wp/docker.js";
|
|
2
|
-
import { Fixture, JsonValue, PluginSource, SeedContext, TestAdminUser, TestCredentials, TestUser, defineFixture } from "./cli/wp/types.js";
|
|
3
|
-
import { credentialsPath, ensurePlugin, findConfigDir, getTestCredentials, githubRelease, isSeeded, resolvePluginSource } from "./cli/wp/utils.js";
|
|
1
|
+
import { DockerStack, RunResult, Stack, compose, composeDown, composeStop, composeUp, createStack, wpCli } from "./cli/wp/docker.js";
|
|
2
|
+
import { DevPluginSource, Fixture, JsonValue, LocalPlugin, PluginSource, SeedContext, TestAdminUser, TestCredentials, TestUser, defineFixture, isLocalPlugin } from "./cli/wp/types.js";
|
|
3
|
+
import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, resolvePluginSource } from "./cli/wp/utils.js";
|
|
4
4
|
import { TestAuthAdapterUser, toTestUser } from "./test/users.js";
|
|
5
5
|
import { testAuthAdapter } from "./test/auth.js";
|
|
6
6
|
import { CAPTCHA_TEST_TOKEN_PASS, captchaMock } from "./test/captcha.js";
|
|
@@ -9,4 +9,4 @@ import { KizloClientTestInstance, getKizloClientTestInstance } from "./test/clie
|
|
|
9
9
|
import { menuFixture } from "./menu/fixture.js";
|
|
10
10
|
import { postFixture } from "./post/fixture.js";
|
|
11
11
|
import { coreFixtures } from "./test/fixtures.js";
|
|
12
|
-
export { CAPTCHA_TEST_TOKEN_PASS, Fixture, JsonValue, KizloClientTestInstance, KizloTestInstance, PluginSource, SeedContext, TestAdminUser, TestAuthAdapterUser, TestCredentials, TestUser, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, credentialsPath, defineFixture, ensurePlugin, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isSeeded, menuFixture, postFixture, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
|
|
12
|
+
export { CAPTCHA_TEST_TOKEN_PASS, DevPluginSource, DockerStack, Fixture, JsonValue, KizloClientTestInstance, KizloTestInstance, LocalPlugin, PluginSource, RunResult, SeedContext, Stack, TestAdminUser, TestAuthAdapterUser, TestCredentials, TestUser, activateLocalPlugin, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, ensurePlugin, ensurePlugins, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
|
package/dist/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { compose, composeDown, composeStop, composeUp, wpCli } from "./cli/wp/docker.js";
|
|
3
|
-
import {
|
|
1
|
+
import { defineFixture, isLocalPlugin } from "./cli/wp/types.js";
|
|
2
|
+
import { compose, composeDown, composeStop, composeUp, createStack, wpCli } from "./cli/wp/docker.js";
|
|
3
|
+
import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, resolvePluginSource } from "./cli/wp/utils.js";
|
|
4
4
|
import { testAuthAdapter } from "./test/auth.js";
|
|
5
5
|
import { CAPTCHA_TEST_TOKEN_PASS, captchaMock } from "./test/captcha.js";
|
|
6
6
|
import { getKizloClientTestInstance } from "./test/client.js";
|
|
@@ -10,4 +10,4 @@ import { coreFixtures } from "./test/fixtures.js";
|
|
|
10
10
|
import { toTestUser } from "./test/users.js";
|
|
11
11
|
import { getKizloTestInstance } from "./test/server.js";
|
|
12
12
|
|
|
13
|
-
export { CAPTCHA_TEST_TOKEN_PASS, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, credentialsPath, defineFixture, ensurePlugin, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isSeeded, menuFixture, postFixture, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
|
|
13
|
+
export { CAPTCHA_TEST_TOKEN_PASS, activateLocalPlugin, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, ensurePlugin, ensurePlugins, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kizlo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A headless WordPress toolkit for TypeScript.",
|
|
6
6
|
"keywords": [
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@clack/prompts": "^1.5.1",
|
|
79
|
-
"@kizlo/shared": "0.1.
|
|
79
|
+
"@kizlo/shared": "0.1.1",
|
|
80
80
|
"@orpc/client": "^1.14.3",
|
|
81
81
|
"@orpc/contract": "^1.14.3",
|
|
82
82
|
"@orpc/openapi": "^1.14.3",
|