kizlo 0.28.0 → 0.30.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/dist/adapters/geo.cloudflare.d.ts +1 -1
- package/dist/adapters/geo.cloudflare.js +1 -1
- package/dist/adapters/request-context.d.ts +12 -0
- package/dist/adapters/types.d.ts +2 -0
- package/dist/adapters/types.js +1 -0
- package/dist/cli/commands/_setup.js +1 -1
- package/dist/cli/commands/dev.js +82 -37
- package/dist/cli/daemon/lock.js +62 -19
- package/dist/cli/daemon/watch.js +1 -1
- package/dist/cli/process-owner.js +27 -25
- package/dist/cli/wp/compose/export.php +82 -0
- package/dist/cli/wp/docker.d.ts +6 -2
- package/dist/cli/wp/docker.js +12 -5
- package/dist/cli/wp/export.js +355 -0
- package/dist/cli/wp/session.js +33 -10
- package/dist/cli/wp/watchdog.js +18 -19
- package/dist/context.d.ts +13 -30
- package/dist/context.js +15 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/integrations/nextjs/api.d.ts +13 -0
- package/dist/integrations/nextjs/api.js +17 -0
- package/dist/integrations/tanstack-start/react/cloudflare/cache-policy.js +15 -0
- package/dist/integrations/tanstack-start/react/cloudflare/cache.d.ts +34 -0
- package/dist/integrations/tanstack-start/react/cloudflare/cache.js +82 -0
- package/dist/integrations/tanstack-start/react/cookies.js +20 -0
- package/dist/integrations/tanstack-start/react/integration.d.ts +25 -0
- package/dist/integrations/tanstack-start/react/integration.js +18 -0
- package/dist/integrations/tanstack-start/react/middleware.d.ts +9 -0
- package/dist/integrations/tanstack-start/react/middleware.js +32 -0
- package/dist/integrations/tanstack-start/react/request-context.d.ts +8 -0
- package/dist/integrations/tanstack-start/react/request-context.js +24 -0
- package/dist/kizlo.d.ts +5 -4
- package/dist/kizlo.js +27 -16
- package/dist/nextjs/server.d.ts +2 -1
- package/dist/nextjs/server.js +2 -1
- package/dist/package.js +1 -1
- package/dist/page/schema.d.ts +3 -3
- package/dist/post/schema.d.ts +7 -7
- package/dist/procedures.d.ts +8 -8
- package/dist/seo/schema.d.ts +5 -5
- package/dist/tanstack-start/react/cloudflare.d.ts +27 -0
- package/dist/tanstack-start/react/cloudflare.js +33 -0
- package/dist/tanstack-start/react/server.d.ts +14 -0
- package/dist/tanstack-start/react/server.js +13 -0
- package/dist/test.d.ts +2 -2
- package/dist/test.js +2 -2
- package/dist/wordpress/endpoint.d.ts +3 -4
- package/dist/wordpress/index.d.ts +1 -1
- package/package.json +16 -20
- package/dist/cloudflare/vinext.d.ts +0 -7
- package/dist/cloudflare/vinext.js +0 -44
- package/dist/cloudflare.d.ts +0 -3
- package/dist/cloudflare.js +0 -4
- package/dist/integrations/cloudflare/integration.d.ts +0 -8
- package/dist/integrations/cloudflare/integration.js +0 -16
- package/dist/integrations/cloudflare/request-context.d.ts +0 -9
- package/dist/integrations/cloudflare/request-context.js +0 -58
package/dist/procedures.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ declare const CORE_PROCEDURES: {
|
|
|
44
44
|
include?: string | number | (string | number)[] | undefined;
|
|
45
45
|
offset?: string | number | undefined;
|
|
46
46
|
order?: "asc" | "desc" | undefined;
|
|
47
|
-
orderby?: "
|
|
47
|
+
orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "modified" | "relevance" | "include_slugs" | undefined;
|
|
48
48
|
searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
|
|
49
49
|
slug?: string | string[] | undefined;
|
|
50
50
|
taxRelation?: "AND" | "OR" | undefined;
|
|
@@ -99,7 +99,7 @@ declare const CORE_PROCEDURES: {
|
|
|
99
99
|
include?: string | number | (string | number)[] | undefined;
|
|
100
100
|
offset?: string | number | undefined;
|
|
101
101
|
order?: "asc" | "desc" | undefined;
|
|
102
|
-
orderby?: "
|
|
102
|
+
orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "modified" | "relevance" | "include_slugs" | "menu_order" | undefined;
|
|
103
103
|
searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
|
|
104
104
|
slug?: string | string[] | undefined;
|
|
105
105
|
parent?: string | number | (string | number)[] | undefined;
|
|
@@ -136,7 +136,7 @@ declare const CORE_PROCEDURES: {
|
|
|
136
136
|
exclude?: string | number | (string | number)[] | undefined;
|
|
137
137
|
include?: string | number | (string | number)[] | undefined;
|
|
138
138
|
order?: "asc" | "desc" | undefined;
|
|
139
|
-
orderBy?: "description" | "
|
|
139
|
+
orderBy?: "description" | "count" | "id" | "slug" | "name" | "include" | "include_slugs" | "term_group" | undefined;
|
|
140
140
|
hideEmpty?: string | boolean | undefined;
|
|
141
141
|
parent?: string | number | undefined;
|
|
142
142
|
post?: string | number | undefined;
|
|
@@ -172,7 +172,7 @@ declare const CORE_PROCEDURES: {
|
|
|
172
172
|
exclude?: string | number | (string | number)[] | undefined;
|
|
173
173
|
include?: string | number | (string | number)[] | undefined;
|
|
174
174
|
order?: "asc" | "desc" | undefined;
|
|
175
|
-
orderBy?: "description" | "
|
|
175
|
+
orderBy?: "description" | "count" | "id" | "slug" | "name" | "include" | "include_slugs" | "term_group" | undefined;
|
|
176
176
|
hideEmpty?: string | boolean | undefined;
|
|
177
177
|
post?: string | number | undefined;
|
|
178
178
|
slug?: string | string[] | undefined;
|
|
@@ -241,7 +241,7 @@ declare const CORE_PROCEDURES: {
|
|
|
241
241
|
sitemaps: {
|
|
242
242
|
list: Procedure<"internal", {}, {
|
|
243
243
|
key: string;
|
|
244
|
-
type: "
|
|
244
|
+
type: "post_type" | "taxonomy" | "author";
|
|
245
245
|
pages: number;
|
|
246
246
|
lastmod: string;
|
|
247
247
|
}[], DefinedErrorMapLike>;
|
|
@@ -249,7 +249,7 @@ declare const CORE_PROCEDURES: {
|
|
|
249
249
|
origin: string;
|
|
250
250
|
sitemaps: {
|
|
251
251
|
key: string;
|
|
252
|
-
type: "
|
|
252
|
+
type: "post_type" | "taxonomy" | "author";
|
|
253
253
|
pages: number;
|
|
254
254
|
lastmod: string;
|
|
255
255
|
}[];
|
|
@@ -292,7 +292,7 @@ declare const CORE_PROCEDURES: {
|
|
|
292
292
|
include?: string | number | (string | number)[] | undefined;
|
|
293
293
|
offset?: string | number | undefined;
|
|
294
294
|
order?: "asc" | "desc" | undefined;
|
|
295
|
-
orderby?: "
|
|
295
|
+
orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "relevance" | "include_slugs" | "menu_order" | undefined;
|
|
296
296
|
searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
|
|
297
297
|
slug?: string | string[] | undefined;
|
|
298
298
|
taxRelation?: "AND" | "OR" | undefined;
|
|
@@ -371,7 +371,7 @@ declare const CORE_PROCEDURES: {
|
|
|
371
371
|
include?: string | number | (string | number)[] | undefined;
|
|
372
372
|
offset?: string | number | undefined;
|
|
373
373
|
order?: "asc" | "desc" | undefined;
|
|
374
|
-
orderby?: "
|
|
374
|
+
orderby?: "date" | "id" | "slug" | "parent" | "title" | "author" | "include" | "relevance" | "include_slugs" | "menu_order" | undefined;
|
|
375
375
|
searchColumns?: ("post_title" | "post_content" | "post_excerpt")[] | undefined;
|
|
376
376
|
slug?: string | string[] | undefined;
|
|
377
377
|
taxRelation?: "AND" | "OR" | undefined;
|
package/dist/seo/schema.d.ts
CHANGED
|
@@ -108,17 +108,17 @@ declare const Seo: z.ZodObject<{
|
|
|
108
108
|
type Seo = z.infer<typeof Seo>;
|
|
109
109
|
declare const CONTENT_TYPES: readonly ["post_type", "taxonomy", "author"];
|
|
110
110
|
declare const ContentType: z.ZodEnum<{
|
|
111
|
-
author: "author";
|
|
112
111
|
post_type: "post_type";
|
|
113
112
|
taxonomy: "taxonomy";
|
|
113
|
+
author: "author";
|
|
114
114
|
}>;
|
|
115
115
|
type ContentType = z.infer<typeof ContentType>;
|
|
116
116
|
declare const Sitemap: z.ZodObject<{
|
|
117
117
|
key: z.ZodString;
|
|
118
118
|
type: z.ZodEnum<{
|
|
119
|
-
author: "author";
|
|
120
119
|
post_type: "post_type";
|
|
121
120
|
taxonomy: "taxonomy";
|
|
121
|
+
author: "author";
|
|
122
122
|
}>;
|
|
123
123
|
pages: z.ZodNumber;
|
|
124
124
|
lastmod: z.ZodString;
|
|
@@ -127,9 +127,9 @@ type Sitemap = z.infer<typeof Sitemap>;
|
|
|
127
127
|
declare const SitemapList: z.ZodArray<z.ZodObject<{
|
|
128
128
|
key: z.ZodString;
|
|
129
129
|
type: z.ZodEnum<{
|
|
130
|
-
author: "author";
|
|
131
130
|
post_type: "post_type";
|
|
132
131
|
taxonomy: "taxonomy";
|
|
132
|
+
author: "author";
|
|
133
133
|
}>;
|
|
134
134
|
pages: z.ZodNumber;
|
|
135
135
|
lastmod: z.ZodString;
|
|
@@ -140,9 +140,9 @@ declare const SitemapIndex: z.ZodObject<{
|
|
|
140
140
|
sitemaps: z.ZodArray<z.ZodObject<{
|
|
141
141
|
key: z.ZodString;
|
|
142
142
|
type: z.ZodEnum<{
|
|
143
|
-
author: "author";
|
|
144
143
|
post_type: "post_type";
|
|
145
144
|
taxonomy: "taxonomy";
|
|
145
|
+
author: "author";
|
|
146
146
|
}>;
|
|
147
147
|
pages: z.ZodNumber;
|
|
148
148
|
lastmod: z.ZodString;
|
|
@@ -174,9 +174,9 @@ declare const SitemapUrlList: z.ZodArray<z.ZodObject<{
|
|
|
174
174
|
type SitemapUrlList = z.infer<typeof SitemapUrlList>;
|
|
175
175
|
declare const ListSitemapUrlInputBase: z.ZodObject<{
|
|
176
176
|
type: z.ZodEnum<{
|
|
177
|
-
author: "author";
|
|
178
177
|
post_type: "post_type";
|
|
179
178
|
taxonomy: "taxonomy";
|
|
179
|
+
author: "author";
|
|
180
180
|
}>;
|
|
181
181
|
page: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
182
182
|
}, z.core.$strip>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { GeoAdapter } from "../../adapters/geo.js";
|
|
2
|
+
import { Integration } from "../../shared/integration.js";
|
|
3
|
+
import "../../index.js";
|
|
4
|
+
import { CdnHeadersOptions, CloudflareCacheBinding, CloudflareCacheResult, createCdnHeaders, revalidateTag, revalidateUrl } from "../../integrations/tanstack-start/react/cloudflare/cache.js";
|
|
5
|
+
|
|
6
|
+
//#region src/integrations/tanstack-start/react/cloudflare.d.ts
|
|
7
|
+
interface ExecutionContext {
|
|
8
|
+
cache?: CloudflareCacheBinding;
|
|
9
|
+
waitUntil(promise: Promise<unknown>): void;
|
|
10
|
+
}
|
|
11
|
+
/** Cloudflare connection metadata, using TanStack Start's existing request scope. */
|
|
12
|
+
declare function geoCloudflare(): GeoAdapter;
|
|
13
|
+
/** Add Cloudflare connection metadata; caching remains an explicit response policy. */
|
|
14
|
+
declare function cloudflare(): Integration<"cloudflare", Record<never, never>>;
|
|
15
|
+
/** Forward native Worker values to Start, default to no caching and encode explicit cache tags. */
|
|
16
|
+
declare function withCloudflare<Env, Context extends ExecutionContext = ExecutionContext>(handler: {
|
|
17
|
+
fetch(request: Request, options: {
|
|
18
|
+
context: {
|
|
19
|
+
env: Env;
|
|
20
|
+
executionCtx: Context;
|
|
21
|
+
};
|
|
22
|
+
}): Response | Promise<Response>;
|
|
23
|
+
}): {
|
|
24
|
+
fetch(request: Request, env: Env, executionCtx: Context): Promise<Response>;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type CdnHeadersOptions, type CloudflareCacheBinding, type CloudflareCacheResult, cloudflare, createCdnHeaders, geoCloudflare, revalidateTag, revalidateUrl, withCloudflare };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cloudflareConnInfo } from "../../adapters/cloudflare-connection.js";
|
|
2
|
+
import { FRAMEWORK_INTEGRATION_ORDER } from "../../shared/constants.js";
|
|
3
|
+
import { createIntegration } from "../../shared/integration.js";
|
|
4
|
+
import { getStartRequestContext } from "../../integrations/tanstack-start/react/request-context.js";
|
|
5
|
+
import { applyCloudflareHeaders, createCdnHeaders, revalidateTag, revalidateUrl } from "../../integrations/tanstack-start/react/cloudflare/cache.js";
|
|
6
|
+
|
|
7
|
+
//#region src/integrations/tanstack-start/react/cloudflare.ts
|
|
8
|
+
/** Cloudflare connection metadata, using TanStack Start's existing request scope. */
|
|
9
|
+
function geoCloudflare() {
|
|
10
|
+
return { getConnInfo(request) {
|
|
11
|
+
return cloudflareConnInfo((request ?? getStartRequestContext()?.request)?.headers);
|
|
12
|
+
} };
|
|
13
|
+
}
|
|
14
|
+
/** Add Cloudflare connection metadata; caching remains an explicit response policy. */
|
|
15
|
+
function cloudflare() {
|
|
16
|
+
return createIntegration({
|
|
17
|
+
id: "cloudflare",
|
|
18
|
+
order: FRAMEWORK_INTEGRATION_ORDER,
|
|
19
|
+
adapters: { geo: geoCloudflare() }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** Forward native Worker values to Start, default to no caching and encode explicit cache tags. */
|
|
23
|
+
function withCloudflare(handler) {
|
|
24
|
+
return { async fetch(request, env, executionCtx) {
|
|
25
|
+
return applyCloudflareHeaders(request, await handler.fetch(request, { context: {
|
|
26
|
+
env,
|
|
27
|
+
executionCtx
|
|
28
|
+
} }));
|
|
29
|
+
} };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { cloudflare, createCdnHeaders, geoCloudflare, revalidateTag, revalidateUrl, withCloudflare };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WEB_MANIFEST_ROUTE } from "../../brand/manifest.js";
|
|
2
|
+
import { renderJsonLd } from "../../seo/utils.js";
|
|
3
|
+
import { LinkDescriptor, MetaDescriptor, RouteHead, ScriptDescriptor, resolvePageHead } from "../../integrations/tanstack-start/metadata.js";
|
|
4
|
+
import { ServerRoute, ServerRouteContext, getServerBaseUrl } from "../../integrations/tanstack-start/utils.js";
|
|
5
|
+
import { ApiHandlers, KizloHandler, createApiHandlers } from "../../integrations/tanstack-start/api.js";
|
|
6
|
+
import { TanstackStartOptions } from "../../integrations/tanstack-start/integration.js";
|
|
7
|
+
import { createManifestRoute } from "../../integrations/tanstack-start/manifest.js";
|
|
8
|
+
import { createRobotsRoute } from "../../integrations/tanstack-start/robots.js";
|
|
9
|
+
import { resolveRootHead } from "../../integrations/tanstack-start/root-head.js";
|
|
10
|
+
import { createSitemapRedirectRoute, createSitemapRoute } from "../../integrations/tanstack-start/sitemap.js";
|
|
11
|
+
import "../server.js";
|
|
12
|
+
import { tanstackStart } from "../../integrations/tanstack-start/react/integration.js";
|
|
13
|
+
import { MiddlewareMatcher, matchMiddleware } from "../../integrations/tanstack-start/react/middleware.js";
|
|
14
|
+
export { ApiHandlers, KizloHandler, LinkDescriptor, MetaDescriptor, MiddlewareMatcher, RouteHead, ScriptDescriptor, ServerRoute, ServerRouteContext, TanstackStartOptions, WEB_MANIFEST_ROUTE, createApiHandlers, createManifestRoute, createRobotsRoute, createSitemapRedirectRoute, createSitemapRoute, getServerBaseUrl, matchMiddleware, renderJsonLd, resolvePageHead, resolveRootHead, tanstackStart };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WEB_MANIFEST_ROUTE } from "../../brand/manifest.js";
|
|
2
|
+
import { renderJsonLd } from "../../seo/utils.js";
|
|
3
|
+
import { getServerBaseUrl } from "../../integrations/tanstack-start/utils.js";
|
|
4
|
+
import { resolvePageHead } from "../../integrations/tanstack-start/metadata.js";
|
|
5
|
+
import { createApiHandlers } from "../../integrations/tanstack-start/api.js";
|
|
6
|
+
import { createManifestRoute } from "../../integrations/tanstack-start/manifest.js";
|
|
7
|
+
import { createRobotsRoute } from "../../integrations/tanstack-start/robots.js";
|
|
8
|
+
import { resolveRootHead } from "../../integrations/tanstack-start/root-head.js";
|
|
9
|
+
import { createSitemapRedirectRoute, createSitemapRoute } from "../../integrations/tanstack-start/sitemap.js";
|
|
10
|
+
import { tanstackStart } from "../../integrations/tanstack-start/react/integration.js";
|
|
11
|
+
import { matchMiddleware } from "../../integrations/tanstack-start/react/middleware.js";
|
|
12
|
+
|
|
13
|
+
export { WEB_MANIFEST_ROUTE, createApiHandlers, createManifestRoute, createRobotsRoute, createSitemapRedirectRoute, createSitemapRoute, getServerBaseUrl, matchMiddleware, renderJsonLd, resolvePageHead, resolveRootHead, tanstackStart };
|
package/dist/test.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DevPluginSource, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, JsonValue, LocalPlugin, PluginSource, SeedContext, SettleContext, TestAdminUser, TestCredentials, TestUser, defineFixture, isLocalPlugin } from "./cli/wp/types.js";
|
|
2
2
|
import { APACHE_LISTEN_CONF, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, DEFAULT_WORDPRESS_TAG, INTROSPECTION_META_REL, LOCAL_DIR_REL, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, UPLOADS_INI, githubRelease, kizloRelease } from "./cli/wp/constants.js";
|
|
3
|
-
import { DockerStack, DockerStatus, RunResult, Stack, StackStatus, compose, composeDown, composePull, composeStop, composeUp, createStack, dockerAvailable, dockerHint, dockerStatus, runningProjectContainers, stackStatus, stopProjectContainers, wpCli, wpEval } from "./cli/wp/docker.js";
|
|
3
|
+
import { DockerStack, DockerStatus, RunResult, Stack, StackStatus, compose, composeDown, composePull, composeStop, composeUp, createStack, docker, dockerAvailable, dockerHint, dockerStatus, runningProjectContainers, stackStatus, stopProjectContainers, wpCli, wpEval } from "./cli/wp/docker.js";
|
|
4
4
|
import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, isSeeded, recordedPort, resolvePluginSource, settleFixtures } from "./cli/wp/utils.js";
|
|
5
5
|
import { TestAuthAdapterUser, toTestUser } from "./test/users.js";
|
|
6
6
|
import { testAuthAdapter } from "./test/auth.js";
|
|
@@ -8,4 +8,4 @@ import { CAPTCHA_TEST_TOKEN_PASS, captchaMock } from "./test/captcha.js";
|
|
|
8
8
|
import { menuFixture } from "./menu/fixture.js";
|
|
9
9
|
import { postFixture } from "./post/fixture.js";
|
|
10
10
|
import { coreFixtures } from "./test/fixtures.js";
|
|
11
|
-
export { APACHE_LISTEN_CONF, CAPTCHA_TEST_TOKEN_PASS, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, DEFAULT_WORDPRESS_TAG, DevPluginSource, DockerStack, DockerStatus, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, INTROSPECTION_META_REL, JsonValue, LOCAL_DIR_REL, LocalPlugin, OPCACHE_INI, PluginSource, REMAP_ENTRYPOINT, RunResult, SEED_MARKER_OPTION, SEED_VERSION, SeedContext, SettleContext, Stack, StackStatus, TEST_ADMIN, TEST_USER, TestAdminUser, TestAuthAdapterUser, TestCredentials, TestUser, UPLOADS_INI, activateLocalPlugin, captchaMock, compose, composeDown, composePull, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, dockerAvailable, dockerHint, dockerStatus, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, runningProjectContainers, settleFixtures, stackStatus, stopProjectContainers, testAuthAdapter, toTestUser, wpCli, wpEval };
|
|
11
|
+
export { APACHE_LISTEN_CONF, CAPTCHA_TEST_TOKEN_PASS, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, DEFAULT_WORDPRESS_TAG, DevPluginSource, DockerStack, DockerStatus, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, INTROSPECTION_META_REL, JsonValue, LOCAL_DIR_REL, LocalPlugin, OPCACHE_INI, PluginSource, REMAP_ENTRYPOINT, RunResult, SEED_MARKER_OPTION, SEED_VERSION, SeedContext, SettleContext, Stack, StackStatus, TEST_ADMIN, TEST_USER, TestAdminUser, TestAuthAdapterUser, TestCredentials, TestUser, UPLOADS_INI, activateLocalPlugin, captchaMock, compose, composeDown, composePull, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, docker, dockerAvailable, dockerHint, dockerStatus, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, runningProjectContainers, settleFixtures, stackStatus, stopProjectContainers, testAuthAdapter, toTestUser, wpCli, wpEval };
|
package/dist/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineFixture, isLocalPlugin } from "./cli/wp/types.js";
|
|
2
2
|
import { APACHE_LISTEN_CONF, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, DEFAULT_WORDPRESS_TAG, INTROSPECTION_META_REL, LOCAL_DIR_REL, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, UPLOADS_INI, githubRelease, kizloRelease } from "./cli/wp/constants.js";
|
|
3
|
-
import { compose, composeDown, composePull, composeStop, composeUp, createStack, dockerAvailable, dockerHint, dockerStatus, runningProjectContainers, stackStatus, stopProjectContainers, wpCli, wpEval } from "./cli/wp/docker.js";
|
|
3
|
+
import { compose, composeDown, composePull, composeStop, composeUp, createStack, docker, dockerAvailable, dockerHint, dockerStatus, runningProjectContainers, stackStatus, stopProjectContainers, wpCli, wpEval } from "./cli/wp/docker.js";
|
|
4
4
|
import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, isSeeded, recordedPort, resolvePluginSource, settleFixtures } from "./cli/wp/utils.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 { postFixture } from "./post/fixture.js";
|
|
|
9
9
|
import { coreFixtures } from "./test/fixtures.js";
|
|
10
10
|
import { toTestUser } from "./test/users.js";
|
|
11
11
|
|
|
12
|
-
export { APACHE_LISTEN_CONF, CAPTCHA_TEST_TOKEN_PASS, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, DEFAULT_WORDPRESS_TAG, INTROSPECTION_META_REL, LOCAL_DIR_REL, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, UPLOADS_INI, activateLocalPlugin, captchaMock, compose, composeDown, composePull, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, dockerAvailable, dockerHint, dockerStatus, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, runningProjectContainers, settleFixtures, stackStatus, stopProjectContainers, testAuthAdapter, toTestUser, wpCli, wpEval };
|
|
12
|
+
export { APACHE_LISTEN_CONF, CAPTCHA_TEST_TOKEN_PASS, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, DEFAULT_WORDPRESS_TAG, INTROSPECTION_META_REL, LOCAL_DIR_REL, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, UPLOADS_INI, activateLocalPlugin, captchaMock, compose, composeDown, composePull, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, docker, dockerAvailable, dockerHint, dockerStatus, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, runningProjectContainers, settleFixtures, stackStatus, stopProjectContainers, testAuthAdapter, toTestUser, wpCli, wpEval };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { WP_Endpoint, WP_EndpointDefinition, WP_RequestBuild, WP_RequestParts } from "./types.js";
|
|
2
|
+
import "./transport.js";
|
|
3
3
|
|
|
4
4
|
//#region src/wordpress/endpoint.d.ts
|
|
5
5
|
|
|
@@ -28,6 +28,5 @@ declare function wpEndpoint<TInput, TResult>(definition: WP_EndpointDefinition):
|
|
|
28
28
|
* caller never validated.
|
|
29
29
|
*/
|
|
30
30
|
declare function buildWordPressRequest(definition: WP_EndpointDefinition, input: WP_RequestParts): WP_RequestBuild;
|
|
31
|
-
declare function createWordPressClient<TEndpoints extends object>(transport: WordPressTransport, endpoints: TEndpoints): WP_Client<TEndpoints> & WordPressTransport;
|
|
32
31
|
//#endregion
|
|
33
|
-
export { buildWordPressRequest,
|
|
32
|
+
export { buildWordPressRequest, wpEndpoint };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WP_Error } from "./error.js";
|
|
2
2
|
import { ActiveWordPressClient, WP_CallOptions, WP_Client, WP_CommonErrorCode, WP_CurrencyFormat, WP_CustomFields, WP_CustomFieldsPath, WP_Endpoint, WP_EndpointData, WP_EndpointDefinition, WP_EndpointError, WP_EndpointInput, WP_EndpointPath, WP_EndpointResult, WP_ErrorData, WP_Failure, WP_List, WP_ListMetadata, WP_RequestBuild, WP_RequestContentType, WP_RequestInput, WP_RequestMethod, WP_RequestParts, WP_ResponseContentType, WP_Result, WP_Schema, WP_Success, WP_TransportFailure, WP_TypedHeaders, WordPressClientRegistry, WordPressCredentials, WordPressCustomFieldsRegistry, WordPressEndpointRegistry, WordPressSchemaRegistry } from "./types.js";
|
|
3
3
|
import { WordPressTransport, WordPressTransportOptions, WordPressTransportResult } from "./transport.js";
|
|
4
|
-
import { buildWordPressRequest,
|
|
4
|
+
import { buildWordPressRequest, wpEndpoint } from "./endpoint.js";
|
|
5
5
|
import { isWordPressResourceError } from "./utils.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kizlo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A headless WordPress framework for TypeScript.",
|
|
6
6
|
"keywords": [
|
|
@@ -58,18 +58,6 @@
|
|
|
58
58
|
"default": "./dist/test.js"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
"./cloudflare": {
|
|
62
|
-
"import": {
|
|
63
|
-
"types": "./dist/cloudflare.d.ts",
|
|
64
|
-
"default": "./dist/cloudflare.js"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"./cloudflare/vinext": {
|
|
68
|
-
"import": {
|
|
69
|
-
"types": "./dist/cloudflare/vinext.d.ts",
|
|
70
|
-
"default": "./dist/cloudflare/vinext.js"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
61
|
"./node": {
|
|
74
62
|
"import": {
|
|
75
63
|
"types": "./dist/node.d.ts",
|
|
@@ -111,6 +99,18 @@
|
|
|
111
99
|
"types": "./dist/tanstack-start/server.d.ts",
|
|
112
100
|
"default": "./dist/tanstack-start/server.js"
|
|
113
101
|
}
|
|
102
|
+
},
|
|
103
|
+
"./tanstack-start/react/server": {
|
|
104
|
+
"import": {
|
|
105
|
+
"types": "./dist/tanstack-start/react/server.d.ts",
|
|
106
|
+
"default": "./dist/tanstack-start/react/server.js"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"./tanstack-start/react/cloudflare": {
|
|
110
|
+
"import": {
|
|
111
|
+
"types": "./dist/tanstack-start/react/cloudflare.d.ts",
|
|
112
|
+
"default": "./dist/tanstack-start/react/cloudflare.js"
|
|
113
|
+
}
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"files": [
|
|
@@ -145,14 +145,13 @@
|
|
|
145
145
|
"zod": "^4.3.6"
|
|
146
146
|
},
|
|
147
147
|
"peerDependencies": {
|
|
148
|
-
"@tanstack/react-router": "^1.
|
|
149
|
-
"@tanstack/react-start": "^1.
|
|
148
|
+
"@tanstack/react-router": "^1.170.41",
|
|
149
|
+
"@tanstack/react-start": "^1.168.60",
|
|
150
150
|
"astro": "^7.0.0",
|
|
151
151
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
152
152
|
"react": "^18.0.0 || ^19.0.0",
|
|
153
153
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
154
|
-
"typescript": "^5.0.0"
|
|
155
|
-
"vite": "^8.0.0"
|
|
154
|
+
"typescript": "^5.0.0"
|
|
156
155
|
},
|
|
157
156
|
"peerDependenciesMeta": {
|
|
158
157
|
"@tanstack/react-router": {
|
|
@@ -175,9 +174,6 @@
|
|
|
175
174
|
},
|
|
176
175
|
"typescript": {
|
|
177
176
|
"optional": true
|
|
178
|
-
},
|
|
179
|
-
"vite": {
|
|
180
|
-
"optional": true
|
|
181
177
|
}
|
|
182
178
|
}
|
|
183
179
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "vite";
|
|
2
|
-
|
|
3
|
-
//#region src/integrations/cloudflare/vinext.d.ts
|
|
4
|
-
/** Capture Cloudflare context inside each Vinext stage, including cache misses and regeneration. */
|
|
5
|
-
declare function cloudflareVinext(): Plugin;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { cloudflareVinext };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
//#region src/integrations/cloudflare/vinext.ts
|
|
2
|
-
const stages = new Map([["vinext/server/request-stage", ["loadVinextRequestStage", "handleRequestStage"]], ["vinext/server/response-stage", ["loadVinextResponseStage", "handleResponseStage"]]]);
|
|
3
|
-
/** Capture Cloudflare context inside each Vinext stage, including cache misses and regeneration. */
|
|
4
|
-
function cloudflareVinext() {
|
|
5
|
-
const modules = /* @__PURE__ */ new Map();
|
|
6
|
-
return {
|
|
7
|
-
name: "kizlo:cloudflare-vinext",
|
|
8
|
-
enforce: "pre",
|
|
9
|
-
async resolveId(source, importer) {
|
|
10
|
-
const stage = stages.get(source);
|
|
11
|
-
if (!stage) return null;
|
|
12
|
-
const resolved = await this.resolve(source, importer, { skipSelf: true });
|
|
13
|
-
if (!resolved) return this.error(`Cannot resolve ${source}. Use a Vinext release exposing the public stage loaders.`);
|
|
14
|
-
const id = `\0kizlo:cloudflare:${resolved.id}`;
|
|
15
|
-
modules.set(id, {
|
|
16
|
-
original: resolved.id,
|
|
17
|
-
loader: stage[0],
|
|
18
|
-
handler: stage[1]
|
|
19
|
-
});
|
|
20
|
-
return id;
|
|
21
|
-
},
|
|
22
|
-
load(id) {
|
|
23
|
-
const stage = modules.get(id);
|
|
24
|
-
if (!stage) return null;
|
|
25
|
-
return `
|
|
26
|
-
import { withCloudflareRequest } from "kizlo/cloudflare";
|
|
27
|
-
import { ${stage.loader} as loadStage } from ${JSON.stringify(stage.original)};
|
|
28
|
-
export * from ${JSON.stringify(stage.original)};
|
|
29
|
-
export async function ${stage.loader}(...args) {
|
|
30
|
-
const stage = await loadStage(...args);
|
|
31
|
-
return {
|
|
32
|
-
...stage,
|
|
33
|
-
${stage.handler}(request, ...args) {
|
|
34
|
-
return withCloudflareRequest(request, () => stage.${stage.handler}(request, ...args));
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
//#endregion
|
|
44
|
-
export { cloudflareVinext };
|
package/dist/cloudflare.d.ts
DELETED
package/dist/cloudflare.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Integration } from "../../shared/integration.js";
|
|
2
|
-
import "../../index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/integrations/cloudflare/integration.d.ts
|
|
5
|
-
/** Supply Cloudflare connection info independently of the frontend framework or WordPress host. */
|
|
6
|
-
declare function cloudflare(): Integration<"cloudflare", Record<never, never>>;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { cloudflare };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FRAMEWORK_INTEGRATION_ORDER } from "../../shared/constants.js";
|
|
2
|
-
import { createIntegration } from "../../shared/integration.js";
|
|
3
|
-
import { geoCloudflare } from "./request-context.js";
|
|
4
|
-
|
|
5
|
-
//#region src/integrations/cloudflare/integration.ts
|
|
6
|
-
/** Supply Cloudflare connection info independently of the frontend framework or WordPress host. */
|
|
7
|
-
function cloudflare() {
|
|
8
|
-
return createIntegration({
|
|
9
|
-
id: "cloudflare",
|
|
10
|
-
order: FRAMEWORK_INTEGRATION_ORDER,
|
|
11
|
-
adapters: { geo: geoCloudflare() }
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { cloudflare };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GeoAdapter } from "../../adapters/geo.js";
|
|
2
|
-
|
|
3
|
-
//#region src/integrations/cloudflare/request-context.d.ts
|
|
4
|
-
/** Read an explicit Cloudflare request or the active Worker entry context, without framework headers. */
|
|
5
|
-
declare function geoCloudflare(): GeoAdapter;
|
|
6
|
-
/** Wrap the complete Worker fetch handler, including SSR and streamed response production. */
|
|
7
|
-
declare function withCloudflareRequest(request: Request, handle: () => Response | Promise<Response>): Promise<Response>;
|
|
8
|
-
//#endregion
|
|
9
|
-
export { geoCloudflare, withCloudflareRequest };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { cloudflareConnInfo } from "../../adapters/cloudflare-connection.js";
|
|
2
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
|
|
4
|
-
//#region src/integrations/cloudflare/request-context.ts
|
|
5
|
-
const requests = new AsyncLocalStorage();
|
|
6
|
-
/** Read an explicit Cloudflare request or the active Worker entry context, without framework headers. */
|
|
7
|
-
function geoCloudflare() {
|
|
8
|
-
return { getConnInfo: (request) => request ? cloudflareConnInfo(request.headers) : { ...requests.getStore()?.connection ?? cloudflareConnInfo() } };
|
|
9
|
-
}
|
|
10
|
-
/** Wrap the complete Worker fetch handler, including SSR and streamed response production. */
|
|
11
|
-
function withCloudflareRequest(request, handle) {
|
|
12
|
-
const store = { connection: cloudflareConnInfo(request.headers) };
|
|
13
|
-
return requests.run(store, async () => {
|
|
14
|
-
try {
|
|
15
|
-
const response = await handle();
|
|
16
|
-
if (!response.body || response.status === 101) {
|
|
17
|
-
store.connection = null;
|
|
18
|
-
return response;
|
|
19
|
-
}
|
|
20
|
-
const reader = response.body.getReader();
|
|
21
|
-
const body = new ReadableStream({
|
|
22
|
-
pull(controller) {
|
|
23
|
-
return requests.run(store, async () => {
|
|
24
|
-
try {
|
|
25
|
-
const { value, done } = await reader.read();
|
|
26
|
-
if (done) {
|
|
27
|
-
store.connection = null;
|
|
28
|
-
reader.releaseLock();
|
|
29
|
-
controller.close();
|
|
30
|
-
} else controller.enqueue(value);
|
|
31
|
-
} catch (error) {
|
|
32
|
-
store.connection = null;
|
|
33
|
-
reader.releaseLock();
|
|
34
|
-
controller.error(error);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
cancel(reason) {
|
|
39
|
-
return requests.run(store, async () => {
|
|
40
|
-
try {
|
|
41
|
-
await reader.cancel(reason);
|
|
42
|
-
} finally {
|
|
43
|
-
store.connection = null;
|
|
44
|
-
reader.releaseLock();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}, { highWaterMark: 0 });
|
|
49
|
-
return new Response(body, response);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
store.connection = null;
|
|
52
|
-
throw error;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
export { geoCloudflare, withCloudflareRequest };
|