@powerlines/plugin-cloudflare 0.6.190 → 0.6.191
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/_virtual/_rolldown/runtime.cjs +14 -0
- package/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/components/cloudflare-builtin.cjs +8 -1
- package/dist/components/cloudflare-builtin.mjs +3 -1
- package/dist/components/cloudflare-builtin.mjs.map +1 -1
- package/dist/components/cloudflare-builtin.test.cjs +16 -0
- package/dist/components/cloudflare-builtin.test.d.cts +1 -0
- package/dist/components/cloudflare-builtin.test.d.mts +1 -0
- package/dist/components/cloudflare-builtin.test.mjs +18 -0
- package/dist/components/cloudflare-builtin.test.mjs.map +1 -0
- package/dist/components/env-builtin.cjs +8 -1
- package/dist/components/env-builtin.mjs +3 -1
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/components/env-builtin.test.cjs +16 -0
- package/dist/components/env-builtin.test.d.cts +1 -0
- package/dist/components/env-builtin.test.d.mts +1 -0
- package/dist/components/env-builtin.test.mjs +18 -0
- package/dist/components/env-builtin.test.mjs.map +1 -0
- package/dist/components/worker-entry.cjs +8 -1
- package/dist/components/worker-entry.mjs +3 -1
- package/dist/components/worker-entry.mjs.map +1 -1
- package/dist/components/worker-entry.test.cjs +16 -0
- package/dist/components/worker-entry.test.d.cts +1 -0
- package/dist/components/worker-entry.test.d.mts +1 -0
- package/dist/components/worker-entry.test.mjs +18 -0
- package/dist/components/worker-entry.test.mjs.map +1 -0
- package/dist/helpers/constants.test.cjs +18 -0
- package/dist/helpers/constants.test.d.cts +1 -0
- package/dist/helpers/constants.test.d.mts +1 -0
- package/dist/helpers/constants.test.mjs +20 -0
- package/dist/helpers/constants.test.mjs.map +1 -0
- package/dist/helpers/wrangler.cjs +9 -1
- package/dist/helpers/wrangler.mjs +3 -1
- package/dist/helpers/wrangler.mjs.map +1 -1
- package/dist/helpers/wrangler.test.cjs +16 -0
- package/dist/helpers/wrangler.test.d.cts +1 -0
- package/dist/helpers/wrangler.test.d.mts +1 -0
- package/dist/helpers/wrangler.test.mjs +18 -0
- package/dist/helpers/wrangler.test.mjs.map +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.cjs +1487 -0
- package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs +1473 -0
- package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.cjs +889 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs +888 -0
- package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs +1614 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1594 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.cjs +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.mjs +3 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.mjs +3 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.cjs +923 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs +922 -0
- package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.cjs +391 -0
- package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs +386 -0
- package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.cjs +82 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +82 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.cjs +1358 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs +1357 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.cjs +561 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs +559 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.cjs +37 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs +38 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.cjs +197 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs +181 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.cjs +29 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs +27 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.cjs +77 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs +77 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.cjs +374 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs +374 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.cjs +38 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs +37 -0
- package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs.map +1 -0
- package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.cjs +2978 -0
- package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs +2973 -0
- package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +939 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
- package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.cjs +87 -0
- package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs +87 -0
- package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.cjs +6 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +6 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.cjs +54 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +52 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs +2696 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +2697 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.cjs +47 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +45 -0
- package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -0
- package/dist/types/wrangler.cjs +15 -1
- package/dist/types/wrangler.d.cts.map +1 -1
- package/dist/types/wrangler.d.mts.map +1 -1
- package/dist/types/wrangler.mjs +10 -1
- package/dist/types/wrangler.mjs.map +1 -1
- package/dist/types/wrangler.test.cjs +16 -0
- package/dist/types/wrangler.test.d.cts +1 -0
- package/dist/types/wrangler.test.d.mts +1 -0
- package/dist/types/wrangler.test.mjs +18 -0
- package/dist/types/wrangler.test.mjs.map +1 -0
- package/package.json +114 -17
|
@@ -5,6 +5,19 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
10
|
+
for (var name in all) {
|
|
11
|
+
__defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (!no_symbols) {
|
|
17
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
8
21
|
var __copyProps = (to, from, except, desc) => {
|
|
9
22
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
23
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -26,4 +39,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
39
|
|
|
27
40
|
//#endregion
|
|
28
41
|
|
|
42
|
+
exports.__exportAll = __exportAll;
|
|
29
43
|
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) {
|
|
6
|
+
__defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
if (!no_symbols) {
|
|
12
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { __exportAll };
|
|
@@ -11,6 +11,7 @@ let _powerlines_plugin_alloy_typescript_components_interface_declaration = requi
|
|
|
11
11
|
let _powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
12
12
|
|
|
13
13
|
//#region src/components/cloudflare-builtin.tsx
|
|
14
|
+
var cloudflare_builtin_exports = /* @__PURE__ */ require_runtime.__exportAll({ CloudflareBuiltin: () => CloudflareBuiltin });
|
|
14
15
|
/**
|
|
15
16
|
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
16
17
|
*/
|
|
@@ -914,4 +915,10 @@ return context as CloudflareTestContext<Env>; `
|
|
|
914
915
|
}
|
|
915
916
|
|
|
916
917
|
//#endregion
|
|
917
|
-
exports.CloudflareBuiltin = CloudflareBuiltin;
|
|
918
|
+
exports.CloudflareBuiltin = CloudflareBuiltin;
|
|
919
|
+
Object.defineProperty(exports, 'cloudflare_builtin_exports', {
|
|
920
|
+
enumerable: true,
|
|
921
|
+
get: function () {
|
|
922
|
+
return cloudflare_builtin_exports;
|
|
923
|
+
}
|
|
924
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
import { Show, code, splitProps } from "@alloy-js/core";
|
|
3
4
|
import defu from "defu";
|
|
@@ -8,6 +9,7 @@ import { InterfaceDeclaration, InterfaceMember } from "@powerlines/plugin-alloy/
|
|
|
8
9
|
import { TSDoc, TSDocParam, TSDocReturns } from "@powerlines/plugin-alloy/typescript/components/tsdoc";
|
|
9
10
|
|
|
10
11
|
//#region src/components/cloudflare-builtin.tsx
|
|
12
|
+
var cloudflare_builtin_exports = /* @__PURE__ */ __exportAll({ CloudflareBuiltin: () => CloudflareBuiltin });
|
|
11
13
|
/**
|
|
12
14
|
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
13
15
|
*/
|
|
@@ -911,5 +913,5 @@ return context as CloudflareTestContext<Env>; `
|
|
|
911
913
|
}
|
|
912
914
|
|
|
913
915
|
//#endregion
|
|
914
|
-
export { CloudflareBuiltin };
|
|
916
|
+
export { CloudflareBuiltin, cloudflare_builtin_exports };
|
|
915
917
|
//# sourceMappingURL=cloudflare-builtin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare-builtin.mjs","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n InterfaceDeclaration,\n InterfaceMember\n} from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport type CloudflareBuiltinProps = Partial<BuiltinFileProps> &\n Omit<BuiltinFileProps, \"id\" | \"description\">;\n\n/**\n * Generates the Cloudflare environment configuration module for the Powerlines project.\n */\nexport function CloudflareBuiltin(props: CloudflareBuiltinProps) {\n const [{ imports, children }, rest] = splitProps(props, [\n \"imports\",\n \"children\"\n ]);\n\n return (\n <BuiltinFile\n id=\"cloudflare\"\n description=\"A set of helpful runtime utilities for integrating Cloudflare services.\"\n {...rest}\n imports={defu(\n {\n \"node:async_hooks\": [\"AsyncLocalStorage\"],\n \"@cloudflare/workers-types\": [\n { name: \"Request\", type: true },\n { name: \"Response\", type: true },\n { name: \"ExecutionContext\", type: true },\n { name: \"IncomingRequestCfProperties\", type: true },\n { name: \"ScheduledController\", type: true },\n { name: \"ForwardableEmailMessage\", type: true },\n { name: \"MessageBatch\", type: true },\n { name: \"TailStream\", type: true },\n { name: \"TraceItem\", type: true },\n { name: \"TailStream.TailEvent\", type: true },\n { name: \"TailStream.Onset\", type: true },\n { name: \"TailStream.TailEventHandlerType\", type: true }\n ]\n },\n imports ?? {}\n )}>\n <VarDeclaration\n const\n name=\"globalContextStorage\"\n initializer={code`globalThis as unknown as Record<PropertyKey, unknown>; `}\n />\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n doc=\"An interface representing the runtime context for Cloudflare operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"request\"\n type=\"Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>\"\n doc=\"The incoming Cloudflare request.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the incoming request.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_FETCH_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-fetch\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"fetchContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare fetch context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_FETCH_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareFetchContext>()) as AsyncLocalStorage<CloudflareFetchContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare fetch context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare fetch context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n parameters={[]}\n returnType=\"CloudflareFetchContext<Env, CfHostMetadata>\">\n {code`const context = fetchContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare fetch context is not available. Ensure that you are calling this function within the scope of a Cloudflare fetch request.\");\n}\nreturn context as CloudflareFetchContext<Env, CfHostMetadata>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare fetch context. This is typically used to set up the context for handling a Cloudflare fetch request, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getFetchContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare fetch context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareFetchContext<Env, CfHostMetadata>\"\n },\n {\n name: \"callback\",\n type: \"(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Promise<Response>\"\n }\n ]}\n returnType=\"Promise<Response>\">\n {code`return fetchContextStorage.run(context, () => callback(context.request, context.env, context.ctx)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the runtime context for Cloudflare scheduled operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"controller\"\n type=\"ScheduledController\"\n doc=\"The Cloudflare scheduled controller for the scheduled operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the scheduled operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_SCHEDULED_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-scheduled\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"scheduledContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare scheduled runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_SCHEDULED_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareScheduledContext>()) as AsyncLocalStorage<CloudflareScheduledContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare scheduled runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare scheduled runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareScheduledContext<Env>\">\n {code`const context = scheduledContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare scheduled context is not available. Ensure that you are calling this function within the scope of a Cloudflare scheduled operation.\");\n}\nreturn context as CloudflareScheduledContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare scheduled context. This is typically used to set up the context for handling a Cloudflare scheduled operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getScheduledContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare scheduled context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareScheduledContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareScheduledContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return scheduledContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the runtime context for Cloudflare email operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"message\"\n type=\"ForwardableEmailMessage\"\n doc=\"The Cloudflare email instance for the email operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the email operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_EMAIL_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-email\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"emailContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare email runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_EMAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareEmailContext>()) as AsyncLocalStorage<CloudflareEmailContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare email runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare email runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareEmailContext<Env>\">\n {code`const context = emailContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare email context is not available. Ensure that you are calling this function within the scope of a Cloudflare email operation.\");\n}\nreturn context as CloudflareEmailContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare email context. This is typically used to set up the context for handling a Cloudflare email operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getEmailContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare email context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`A promise that resolves with the result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareEmailContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareEmailContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return emailContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n doc=\"An interface representing the runtime context for Cloudflare queue operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"batch\"\n type=\"MessageBatch<Message>\"\n doc=\"The Cloudflare queue event instance for the queue operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the queue operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_QUEUE_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-queue\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"queueContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare queue runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_QUEUE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareQueueContext>()) as AsyncLocalStorage<CloudflareQueueContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare queue runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare queue runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n parameters={[]}\n returnType=\"CloudflareQueueContext<Message, Env>\">\n {code`const context = queueContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare queue context is not available. Ensure that you are calling this function within the scope of a Cloudflare queue operation.\");\n}\nreturn context as CloudflareQueueContext<Message, Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare queue context. This is typically used to set up the context for handling a Cloudflare queue operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getQueueContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare queue context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareQueueContext<Message, Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareQueueContext<Message, Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return queueContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the tail context for Cloudflare tail operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"events\"\n type=\"TraceItem[]\"\n doc=\"An array of trace items representing the events in the Cloudflare tail context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the tail operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TAIL_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-tail\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"tailContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare tail runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailContext>()) as AsyncLocalStorage<CloudflareTailContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare tail runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare tail runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTailContext<Env>\">\n {code`const context = tailContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare tail context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail operation.\");\n}\nreturn context as CloudflareTailContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare tail context. This is typically used to set up the context for handling a Cloudflare tail operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTailContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare tail context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTailContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTailContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"T\">\n {code`return tailContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the tail context for Cloudflare tail stream operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"event\"\n type=\"TailStream.TailEvent<TailStream.Onset>\"\n doc=\"The tail event associated with the Cloudflare tail stream context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the tail stream operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-tail-stream\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"tailStreamContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare tail stream runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailStreamContext>()) as AsyncLocalStorage<CloudflareTailStreamContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare tail stream runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare tail stream runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTailStreamContext<Env>\">\n {code`const context = tailStreamContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare tail stream context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail stream operation.\");\n}\nreturn context as CloudflareTailStreamContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare tail stream context. This is typically used to set up the context for handling a Cloudflare tail stream operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTailStreamContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare tail stream context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTailStreamContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTailStreamContext<Env>) => Promise<TailStream.TailEventHandlerType>\"\n }\n ]}\n returnType=\"Promise<TailStream.TailEventHandlerType>\">\n {code`return tailStreamContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the trace context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"traces\"\n type=\"TraceItem[]\"\n doc=\"An array of trace items associated with the Cloudflare trace context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the trace operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TRACE_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-trace\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"traceContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare trace runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TRACE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTraceContext>()) as AsyncLocalStorage<CloudflareTraceContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare trace runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare trace runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTraceContext<Env>\">\n {code`const context = traceContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare trace context is not available. Ensure that you are calling this function within the scope of a Cloudflare trace operation.\");\n}\nreturn context as CloudflareTraceContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare trace context. This is typically used to set up the context for handling a Cloudflare trace operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTraceContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare trace context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTraceContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTraceContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return traceContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the test context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"controller\"\n type=\"TestController\"\n doc=\"The test controller associated with the Cloudflare test context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the test operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TEST_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-test\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"testContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare test runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TEST_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTestContext>()) as AsyncLocalStorage<CloudflareTestContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare test runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare test runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTestContext<Env>\">\n {code`const context = testContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare test context is not available. Ensure that you are calling this function within the scope of a Cloudflare test operation.\");\n}\nreturn context as CloudflareTestContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare test context. This is typically used to set up the context for handling a Cloudflare test operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTestContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare test context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTestContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTestContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return testContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6BA,SAAO,kBAAA,OAAA;CACL,MAAK,CAAA,EACL,SACA,YACA,QAAO,WAAW,OAAO,CAAK,WAAW,UAAC,CAAU;CACtD,OAAO,gBAAgB,aAAA,WAAA;;EAEvB,aAAY;CACV,GAAA,MAAK;;GAEL,OAAA,KAAA;IACC,oBAAyB,CAAA,mBAAY;IACtC,6BAAA;KAAA;MACK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ACP,MAAA;QACD,KAAA;OACA,CAAC;OAAC,gBAAgB,iBAAA;QAChB,MAAM;QACR,MAAA;QACD,KAAA;OACD,CAAA;OAAA,gBAAwB,iBAAE;QACzB,MAAK;QACN,MAAA;QACD,KAAS;OACT,CAAA;MAAA;KACA;IACD,CAAA;IAAA,gBAAW,OAAA,CAAA,CAAA;IAAA,gBAAA,gBAAA;KACd,SAAA;KACH,MAAA"}
|
|
1
|
+
{"version":3,"file":"cloudflare-builtin.mjs","names":[],"sources":["../../src/components/cloudflare-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { FunctionDeclaration, VarDeclaration } from \"@alloy-js/typescript\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport {\n BuiltinFile,\n BuiltinFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n InterfaceDeclaration,\n InterfaceMember\n} from \"@powerlines/plugin-alloy/typescript/components/interface-declaration\";\nimport {\n TSDoc,\n TSDocParam,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport defu from \"defu\";\n\nexport type CloudflareBuiltinProps = Partial<BuiltinFileProps> &\n Omit<BuiltinFileProps, \"id\" | \"description\">;\n\n/**\n * Generates the Cloudflare environment configuration module for the Powerlines project.\n */\nexport function CloudflareBuiltin(props: CloudflareBuiltinProps) {\n const [{ imports, children }, rest] = splitProps(props, [\n \"imports\",\n \"children\"\n ]);\n\n return (\n <BuiltinFile\n id=\"cloudflare\"\n description=\"A set of helpful runtime utilities for integrating Cloudflare services.\"\n {...rest}\n imports={defu(\n {\n \"node:async_hooks\": [\"AsyncLocalStorage\"],\n \"@cloudflare/workers-types\": [\n { name: \"Request\", type: true },\n { name: \"Response\", type: true },\n { name: \"ExecutionContext\", type: true },\n { name: \"IncomingRequestCfProperties\", type: true },\n { name: \"ScheduledController\", type: true },\n { name: \"ForwardableEmailMessage\", type: true },\n { name: \"MessageBatch\", type: true },\n { name: \"TailStream\", type: true },\n { name: \"TraceItem\", type: true },\n { name: \"TailStream.TailEvent\", type: true },\n { name: \"TailStream.Onset\", type: true },\n { name: \"TailStream.TailEventHandlerType\", type: true }\n ]\n },\n imports ?? {}\n )}>\n <VarDeclaration\n const\n name=\"globalContextStorage\"\n initializer={code`globalThis as unknown as Record<PropertyKey, unknown>; `}\n />\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n doc=\"An interface representing the runtime context for Cloudflare operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"request\"\n type=\"Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>\"\n doc=\"The incoming Cloudflare request.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the incoming request.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_FETCH_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-fetch\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"fetchContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare fetch context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_FETCH_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareFetchContext>()) as AsyncLocalStorage<CloudflareFetchContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare fetch context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare fetch context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n parameters={[]}\n returnType=\"CloudflareFetchContext<Env, CfHostMetadata>\">\n {code`const context = fetchContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare fetch context is not available. Ensure that you are calling this function within the scope of a Cloudflare fetch request.\");\n}\nreturn context as CloudflareFetchContext<Env, CfHostMetadata>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare fetch context. This is typically used to set up the context for handling a Cloudflare fetch request, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getFetchContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare fetch context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withFetchContext\"\n typeParameters={[\n { name: \"Env\", default: \"CloudflareBindings\" },\n { name: \"CfHostMetadata\", default: \"unknown\" }\n ]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareFetchContext<Env, CfHostMetadata>\"\n },\n {\n name: \"callback\",\n type: \"(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext) => Promise<Response>\"\n }\n ]}\n returnType=\"Promise<Response>\">\n {code`return fetchContextStorage.run(context, () => callback(context.request, context.env, context.ctx)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the runtime context for Cloudflare scheduled operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"controller\"\n type=\"ScheduledController\"\n doc=\"The Cloudflare scheduled controller for the scheduled operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the scheduled operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_SCHEDULED_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-scheduled\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"scheduledContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare scheduled runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_SCHEDULED_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareScheduledContext>()) as AsyncLocalStorage<CloudflareScheduledContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare scheduled runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare scheduled runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareScheduledContext<Env>\">\n {code`const context = scheduledContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare scheduled context is not available. Ensure that you are calling this function within the scope of a Cloudflare scheduled operation.\");\n}\nreturn context as CloudflareScheduledContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare scheduled context. This is typically used to set up the context for handling a Cloudflare scheduled operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getScheduledContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare scheduled context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withScheduledContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareScheduledContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareScheduledContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return scheduledContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the runtime context for Cloudflare email operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"message\"\n type=\"ForwardableEmailMessage\"\n doc=\"The Cloudflare email instance for the email operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the email operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_EMAIL_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-email\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"emailContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare email runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_EMAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareEmailContext>()) as AsyncLocalStorage<CloudflareEmailContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare email runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare email runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareEmailContext<Env>\">\n {code`const context = emailContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare email context is not available. Ensure that you are calling this function within the scope of a Cloudflare email operation.\");\n}\nreturn context as CloudflareEmailContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare email context. This is typically used to set up the context for handling a Cloudflare email operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getEmailContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare email context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`A promise that resolves with the result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withEmailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareEmailContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareEmailContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return emailContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n doc=\"An interface representing the runtime context for Cloudflare queue operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"batch\"\n type=\"MessageBatch<Message>\"\n doc=\"The Cloudflare queue event instance for the queue operation.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the queue operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_QUEUE_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-queue\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"queueContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare queue runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_QUEUE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareQueueContext>()) as AsyncLocalStorage<CloudflareQueueContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare queue runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare queue runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n parameters={[]}\n returnType=\"CloudflareQueueContext<Message, Env>\">\n {code`const context = queueContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare queue context is not available. Ensure that you are calling this function within the scope of a Cloudflare queue operation.\");\n}\nreturn context as CloudflareQueueContext<Message, Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare queue context. This is typically used to set up the context for handling a Cloudflare queue operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getQueueContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare queue context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withQueueContext\"\n typeParameters={[\n { name: \"Message\", default: \"unknown\" },\n { name: \"Env\", default: \"CloudflareBindings\" }\n ]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareQueueContext<Message, Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareQueueContext<Message, Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return queueContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the tail context for Cloudflare tail operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"events\"\n type=\"TraceItem[]\"\n doc=\"An array of trace items representing the events in the Cloudflare tail context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the tail operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TAIL_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-tail\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"tailContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare tail runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TAIL_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailContext>()) as AsyncLocalStorage<CloudflareTailContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare tail runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare tail runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTailContext<Env>\">\n {code`const context = tailContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare tail context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail operation.\");\n}\nreturn context as CloudflareTailContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare tail context. This is typically used to set up the context for handling a Cloudflare tail operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTailContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare tail context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTailContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTailContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTailContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"T\">\n {code`return tailContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the tail context for Cloudflare tail stream operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"event\"\n type=\"TailStream.TailEvent<TailStream.Onset>\"\n doc=\"The tail event associated with the Cloudflare tail stream context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the tail stream operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-tail-stream\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"tailStreamContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare tail stream runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TAIL_STREAM_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTailStreamContext>()) as AsyncLocalStorage<CloudflareTailStreamContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare tail stream runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare tail stream runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTailStreamContext<Env>\">\n {code`const context = tailStreamContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare tail stream context is not available. Ensure that you are calling this function within the scope of a Cloudflare tail stream operation.\");\n}\nreturn context as CloudflareTailStreamContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare tail stream context. This is typically used to set up the context for handling a Cloudflare tail stream operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTailStreamContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare tail stream context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTailStreamContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTailStreamContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTailStreamContext<Env>) => Promise<TailStream.TailEventHandlerType>\"\n }\n ]}\n returnType=\"Promise<TailStream.TailEventHandlerType>\">\n {code`return tailStreamContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the trace context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"traces\"\n type=\"TraceItem[]\"\n doc=\"An array of trace items associated with the Cloudflare trace context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the trace operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TRACE_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-trace\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"traceContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare trace runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TRACE_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTraceContext>()) as AsyncLocalStorage<CloudflareTraceContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare trace runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare trace runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTraceContext<Env>\">\n {code`const context = traceContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare trace context is not available. Ensure that you are calling this function within the scope of a Cloudflare trace operation.\");\n}\nreturn context as CloudflareTraceContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare trace context. This is typically used to set up the context for handling a Cloudflare trace operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTraceContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare trace context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTraceContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTraceContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTraceContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return traceContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"CloudflareTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n doc=\"An interface representing the test context for Cloudflare trace operations, containing relevant information and utilities for performing actions within the Cloudflare environment.\">\n <InterfaceMember\n name=\"controller\"\n type=\"TestController\"\n doc=\"The test controller associated with the Cloudflare test context.\"\n />\n <InterfaceMember\n name=\"env\"\n type=\"Env\"\n doc=\"The Cloudflare environment bindings available during runtime.\"\n />\n <InterfaceMember\n name=\"ctx\"\n type=\"ExecutionContext\"\n doc=\"The Cloudflare execution context for the test operation.\"\n />\n </InterfaceDeclaration>\n <hbr />\n <VarDeclaration\n const\n name=\"CLOUDFLARE_TEST_CONTEXT_KEY\"\n initializer={code`Symbol.for(\"powerlines-cloudflare-test\"); `}\n />\n <hbr />\n <VarDeclaration\n export\n const\n name=\"testContextStorage\"\n doc=\"An AsyncLocalStorage instance for managing the Cloudflare test runtime context.\"\n initializer={code`(globalContextStorage[CLOUDFLARE_TEST_CONTEXT_KEY] ??= new AsyncLocalStorage<CloudflareTestContext>()) as AsyncLocalStorage<CloudflareTestContext>; `}\n />\n <hbr />\n <TSDoc heading=\"Retrieves the current Cloudflare test runtime context from the AsyncLocalStorage. This context contains relevant information and utilities for performing actions within the Cloudflare environment. If no context is currently set, this function will throw an error.\">\n <TSDocReturns>{code`The current Cloudflare test runtime context.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"getTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[]}\n returnType=\"CloudflareTestContext<Env>\">\n {code`const context = testContextStorage.getStore();\nif (!context) {\n throw new Error(\"Cloudflare test context is not available. Ensure that you are calling this function within the scope of a Cloudflare test operation.\");\n}\nreturn context as CloudflareTestContext<Env>; `}\n </FunctionDeclaration>\n <hbr />\n <TSDoc heading=\"Runs a given function within the scope of a Cloudflare test context. This is typically used to set up the context for handling a Cloudflare test operation, ensuring that any code executed within the function has access to the relevant Cloudflare environment information and utilities. The provided context will be available through the `getTestContext` function for any code executed within the callback.\">\n <TSDocParam name=\"context\">{code`The Cloudflare test context to run the function with.`}</TSDocParam>\n <TSDocParam name=\"callback\">{code`The function to execute within the scope of the provided context.`}</TSDocParam>\n <TSDocReturns>{code`The result of the executed function.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"withTestContext\"\n typeParameters={[{ name: \"Env\", default: \"CloudflareBindings\" }]}\n parameters={[\n {\n name: \"context\",\n type: \"CloudflareTestContext<Env>\"\n },\n {\n name: \"callback\",\n type: \"(ctx: CloudflareTestContext<Env>) => Promise<void>\"\n }\n ]}\n returnType=\"Promise<void>\">\n {code`return testContextStorage.run(context, () => callback(context)); `}\n </FunctionDeclaration>\n <Spacing />\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,SAAO,kBAAA,OAAA;CACL,MAAK,CAAA,EACL,SACA,YACA,QAAO,WAAW,OAAO,CAAK,WAAW,UAAC,CAAU;CACtD,OAAO,gBAAgB,aAAA,WAAA;;EAEvB,aAAY;CACV,GAAA,MAAK;;GAEL,OAAA,KAAA;IACC,oBAAyB,CAAA,mBAAY;IACtC,6BAAA;KAAA;MACK,MAAS;MACN,MAAC;KACN;KAAA;MACA,MAAQ;MACT,MAAA;;;MAEK,MAAA;MACJ,MAAA;KACG;KAAE;MACJ,MAAA;MACI,MAAI;KACR;KAAA;MACE,MAAA;MACE,MAAM;KACR;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAA;MACD,MAAA;KACD;KAAA;MACA,MAAA;MACD,MAAA;KACC;KAAA;MACA,MAAM;MACN,MAAA;KACD;IAAA;GACD,GAAC,WAAS,CAAA,CAAA;EACZ;EACA,IAAG,WAAA;GACD,OAAE;IAAA,gBAAA,gBAAA;KACA,SAAM;KACN,MAAA;KACA,aAAW,IAAM;IACnB,CAAC;IAAG,gBAAS,SAAiB,CAAA,CAAA;IAAA,gBAAmB,SAAA,CAAA,CAAA;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OAAA;OAAA,gBAAA,YAAA;QACC,MAAA;QACA,UAAA,IAAA;OACA,CAAA;OAAM,gBAAkB,YAAA;QACpB,MAAI;QACR,UAAa,IAAK;OACnB,CAAA;OAAA,gBAAA,cAAA,EACK,UAAA,IAAA,uCACL,CAAA;MAAK;KACJ;IACF,CAAC;IAAC,gBAAK,qBAAA;KACN,UAAA;KACC,MAAA;KACA,gBAAM,CAAA;MACN,MAAA;MACA,SAAW;KACX,CAAA;KACA,YAAY,CAAA;MACf,MAAS;MACN,MAAI;KACZ,GAAA;MACO,MAAQ;MACP,MAAA;KACD,CAAA;KACA,YAAa;KACZ,UAAC,IAAW;IACd,CAAC;IAAE,gBAAiB,SAAW,CAAA,CAAA;IAAK,gBAAgB,SAAQ,CAAA,CAAA;IAAO,gBAAiB,sBAAqB;KACvG,UAAC;KACD,MAAK;KACN,gBAAA,CAAA;MACC,MAAA;MACA,SAAM;KACN,CAAA;KACA,KAAA;KACA,IAAE,WAAA;MACA,OAAO;OAAC,gBAAS,iBAAA;QACf,MAAM;QACP,MAAA;QACD,KAAA;OACA,CAAC;OAAC,gBAAgB,iBAAA;QAChB,MAAM;QACR,MAAA;QACD,KAAA;OACD,CAAA;OAAA,gBAAwB,iBAAE;QACzB,MAAK;QACN,MAAA;QACD,KAAS;OACT,CAAA;MAAA;KACA;IACD,CAAA;IAAA,gBAAW,OAAA,CAAA,CAAA;IAAA,gBAAA,gBAAA;KACd,SAAA;KACH,MAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_components_cloudflare_builtin = require('./cloudflare-builtin.cjs');
|
|
2
|
+
const require_chunk_artifact = require('../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
|
|
3
|
+
const require_test_DNmyFkvJ = require('../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/components/cloudflare-builtin.test.ts
|
|
6
|
+
require_chunk_artifact.describe("plugins/plugin-cloudflare/src/components/cloudflare-builtin.tsx", () => {
|
|
7
|
+
require_chunk_artifact.it("loads module exports", () => {
|
|
8
|
+
require_test_DNmyFkvJ.globalExpect(require_components_cloudflare_builtin.cloudflare_builtin_exports).toBeDefined();
|
|
9
|
+
require_test_DNmyFkvJ.globalExpect(typeof require_components_cloudflare_builtin.cloudflare_builtin_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
require_chunk_artifact.it("has at least one runtime export", () => {
|
|
12
|
+
require_test_DNmyFkvJ.globalExpect(Object.keys(require_components_cloudflare_builtin.cloudflare_builtin_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cloudflare_builtin_exports } from "./cloudflare-builtin.mjs";
|
|
2
|
+
import { describe, it } from "../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
|
|
3
|
+
import { globalExpect } from "../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/components/cloudflare-builtin.test.ts
|
|
6
|
+
describe("plugins/plugin-cloudflare/src/components/cloudflare-builtin.tsx", () => {
|
|
7
|
+
it("loads module exports", () => {
|
|
8
|
+
globalExpect(cloudflare_builtin_exports).toBeDefined();
|
|
9
|
+
globalExpect(typeof cloudflare_builtin_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
it("has at least one runtime export", () => {
|
|
12
|
+
globalExpect(Object.keys(cloudflare_builtin_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { };
|
|
18
|
+
//# sourceMappingURL=cloudflare-builtin.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudflare-builtin.test.mjs","names":[],"sources":["../../src/components/cloudflare-builtin.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./cloudflare-builtin\";\n\ndescribe(\"plugins/plugin-cloudflare/src/components/cloudflare-builtin.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAmC;EAC/B,aAAO,0BAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,0BAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
|
|
@@ -8,6 +8,7 @@ let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plug
|
|
|
8
8
|
let _powerlines_plugin_env_components_env_builtin = require("@powerlines/plugin-env/components/env-builtin");
|
|
9
9
|
|
|
10
10
|
//#region src/components/env-builtin.tsx
|
|
11
|
+
var env_builtin_exports = /* @__PURE__ */ require_runtime.__exportAll({ CloudflareEnvBuiltin: () => CloudflareEnvBuiltin });
|
|
11
12
|
/**
|
|
12
13
|
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
13
14
|
*/
|
|
@@ -29,4 +30,10 @@ function CloudflareEnvBuiltin(props) {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
//#endregion
|
|
32
|
-
exports.CloudflareEnvBuiltin = CloudflareEnvBuiltin;
|
|
33
|
+
exports.CloudflareEnvBuiltin = CloudflareEnvBuiltin;
|
|
34
|
+
Object.defineProperty(exports, 'env_builtin_exports', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return env_builtin_exports;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
import { Show, code, splitProps } from "@alloy-js/core";
|
|
3
4
|
import defu from "defu";
|
|
@@ -5,6 +6,7 @@ import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
|
|
|
5
6
|
import { EnvBuiltin } from "@powerlines/plugin-env/components/env-builtin";
|
|
6
7
|
|
|
7
8
|
//#region src/components/env-builtin.tsx
|
|
9
|
+
var env_builtin_exports = /* @__PURE__ */ __exportAll({ CloudflareEnvBuiltin: () => CloudflareEnvBuiltin });
|
|
8
10
|
/**
|
|
9
11
|
* Generates the Cloudflare environment configuration module for the Powerlines project.
|
|
10
12
|
*/
|
|
@@ -26,5 +28,5 @@ function CloudflareEnvBuiltin(props) {
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
//#endregion
|
|
29
|
-
export { CloudflareEnvBuiltin };
|
|
31
|
+
export { CloudflareEnvBuiltin, env_builtin_exports };
|
|
30
32
|
//# sourceMappingURL=env-builtin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport {\n EnvBuiltin,\n EnvBuiltinProps\n} from \"@powerlines/plugin-env/components/env-builtin\";\nimport defu from \"defu\";\n\nexport type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, \"defaultConfig\">;\n\n/**\n * Generates the Cloudflare environment configuration module for the Powerlines project.\n */\nexport function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps) {\n const [{ children, imports }, rest] = splitProps(props, [\n \"children\",\n \"imports\"\n ]);\n\n return (\n <EnvBuiltin\n defaultConfig={code`env`}\n {...rest}\n imports={defu(\n {\n \"cloudflare:workers\": [\"env\"]\n },\n imports ?? {}\n )}>\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EnvBuiltin>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"env-builtin.mjs","names":[],"sources":["../../src/components/env-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport {\n EnvBuiltin,\n EnvBuiltinProps\n} from \"@powerlines/plugin-env/components/env-builtin\";\nimport defu from \"defu\";\n\nexport type CloudflareEnvBuiltinProps = Omit<EnvBuiltinProps, \"defaultConfig\">;\n\n/**\n * Generates the Cloudflare environment configuration module for the Powerlines project.\n */\nexport function CloudflareEnvBuiltin(props: CloudflareEnvBuiltinProps) {\n const [{ children, imports }, rest] = splitProps(props, [\n \"children\",\n \"imports\"\n ]);\n\n return (\n <EnvBuiltin\n defaultConfig={code`env`}\n {...rest}\n imports={defu(\n {\n \"cloudflare:workers\": [\"env\"]\n },\n imports ?? {}\n )}>\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EnvBuiltin>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,SAAY,qBAAyB,OAAO;UAE1C,UACC,WACD,QAAA,WAAA,OAAA,CAAA,YAAA,SAAA,CAAA;CACF,OAAO,gBAAS,YAAqB,WAAO,EAC1C,eAAiB,IAAE,MACnB,GAAG,MAAA;EACD,IAAC,UAAO;GACR,OAAA,KAAA,gCAEF,GAAO,WAAA,CAAA,CAAA;EACL;EACA,IAAE,WAAa;GACb,OAAI,CAAI,gBAAA,SAAA,CAAA,CAAA,GAAA,gBAAA,MAAA;IACR,IAAA,OAAa;KACX,OAAA,QAAA,QAAA;IACA;IACC;GACH,CAAC,CAAC;EACJ;CACF,CAAC,CAAC;AACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_components_env_builtin = require('./env-builtin.cjs');
|
|
2
|
+
const require_chunk_artifact = require('../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
|
|
3
|
+
const require_test_DNmyFkvJ = require('../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/components/env-builtin.test.ts
|
|
6
|
+
require_chunk_artifact.describe("plugins/plugin-cloudflare/src/components/env-builtin.tsx", () => {
|
|
7
|
+
require_chunk_artifact.it("loads module exports", () => {
|
|
8
|
+
require_test_DNmyFkvJ.globalExpect(require_components_env_builtin.env_builtin_exports).toBeDefined();
|
|
9
|
+
require_test_DNmyFkvJ.globalExpect(typeof require_components_env_builtin.env_builtin_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
require_chunk_artifact.it("has at least one runtime export", () => {
|
|
12
|
+
require_test_DNmyFkvJ.globalExpect(Object.keys(require_components_env_builtin.env_builtin_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { env_builtin_exports } from "./env-builtin.mjs";
|
|
2
|
+
import { describe, it } from "../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs";
|
|
3
|
+
import { globalExpect } from "../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/components/env-builtin.test.ts
|
|
6
|
+
describe("plugins/plugin-cloudflare/src/components/env-builtin.tsx", () => {
|
|
7
|
+
it("loads module exports", () => {
|
|
8
|
+
globalExpect(env_builtin_exports).toBeDefined();
|
|
9
|
+
globalExpect(typeof env_builtin_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
it("has at least one runtime export", () => {
|
|
12
|
+
globalExpect(Object.keys(env_builtin_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { };
|
|
18
|
+
//# sourceMappingURL=env-builtin.test.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-builtin.test.mjs","names":[],"sources":["../../src/components/env-builtin.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport * as moduleExports from \"./env-builtin\";\n\ndescribe(\"plugins/plugin-cloudflare/src/components/env-builtin.tsx\", () => {\n it(\"loads module exports\", () => {\n expect(moduleExports).toBeDefined();\n expect(typeof moduleExports).toBe(\"object\");\n });\n\n it(\"has at least one runtime export\", () => {\n expect(Object.keys(moduleExports).length).toBeGreaterThan(0);\n });\n});\n"],"mappings":";;;;;;CAGA,GAAA,8BAAmC;EAC/B,aAAO,mBAAQ,EAAO,YAAS;EAC/B,aAAO,OAAA,mBAAe,EAAA,KAAY,QAAC;CACrC,CAAC;CACD,GAAE,yCAAA;;CAEF,CAAA;AACF,CAAC"}
|
|
@@ -12,6 +12,7 @@ let _stryke_path_find = require("@stryke/path/find");
|
|
|
12
12
|
let _stryke_path_replace = require("@stryke/path/replace");
|
|
13
13
|
|
|
14
14
|
//#region src/components/worker-entry.tsx
|
|
15
|
+
var worker_entry_exports = /* @__PURE__ */ require_runtime.__exportAll({ WorkerEntry: () => WorkerEntry });
|
|
15
16
|
/**
|
|
16
17
|
* Generates a [Cloudflare Worker](https://developers.cloudflare.com/workers/runtime-apis/handlers/) entry module for the Powerlines project, providing a runtime context and utilities for integrating with Cloudflare services. This module defines a `CloudflareContext` interface, an `AsyncLocalStorage` instance for managing the context, and helper functions for retrieving and running code within the context. The generated module is designed to be used as a built-in file within the Powerlines environment, allowing developers to easily access Cloudflare-specific functionality in their applications.
|
|
17
18
|
*/
|
|
@@ -200,4 +201,10 @@ function WorkerEntry(props) {
|
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
//#endregion
|
|
203
|
-
exports.WorkerEntry = WorkerEntry;
|
|
204
|
+
exports.WorkerEntry = WorkerEntry;
|
|
205
|
+
Object.defineProperty(exports, 'worker_entry_exports', {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: function () {
|
|
208
|
+
return worker_entry_exports;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
1
2
|
import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
3
|
import { Show, code, computed, splitProps } from "@alloy-js/core";
|
|
3
4
|
import defu from "defu";
|
|
@@ -9,6 +10,7 @@ import { relativePath } from "@stryke/path/find";
|
|
|
9
10
|
import { replaceExtension } from "@stryke/path/replace";
|
|
10
11
|
|
|
11
12
|
//#region src/components/worker-entry.tsx
|
|
13
|
+
var worker_entry_exports = /* @__PURE__ */ __exportAll({ WorkerEntry: () => WorkerEntry });
|
|
12
14
|
/**
|
|
13
15
|
* Generates a [Cloudflare Worker](https://developers.cloudflare.com/workers/runtime-apis/handlers/) entry module for the Powerlines project, providing a runtime context and utilities for integrating with Cloudflare services. This module defines a `CloudflareContext` interface, an `AsyncLocalStorage` instance for managing the context, and helper functions for retrieving and running code within the context. The generated module is designed to be used as a built-in file within the Powerlines environment, allowing developers to easily access Cloudflare-specific functionality in their applications.
|
|
14
16
|
*/
|
|
@@ -197,5 +199,5 @@ function WorkerEntry(props) {
|
|
|
197
199
|
}
|
|
198
200
|
|
|
199
201
|
//#endregion
|
|
200
|
-
export { WorkerEntry };
|
|
202
|
+
export { WorkerEntry, worker_entry_exports };
|
|
201
203
|
//# sourceMappingURL=worker-entry.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.mjs","names":[],"sources":["../../src/components/worker-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts\";\nimport {\n EntryFile,\n EntryFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { relativePath } from \"@stryke/path/find\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { CloudflarePluginContext, CloudflareWorkerEntryModule } from \"../types\";\n\nexport type WorkerEntryProps = Partial<EntryFileProps> &\n Omit<EntryFileProps, \"path\"> & {\n worker: CloudflareWorkerEntryModule;\n };\n\n/**\n * Generates a [Cloudflare Worker](https://developers.cloudflare.com/workers/runtime-apis/handlers/) entry module for the Powerlines project, providing a runtime context and utilities for integrating with Cloudflare services. This module defines a `CloudflareContext` interface, an `AsyncLocalStorage` instance for managing the context, and helper functions for retrieving and running code within the context. The generated module is designed to be used as a built-in file within the Powerlines environment, allowing developers to easily access Cloudflare-specific functionality in their applications.\n */\nexport function WorkerEntry(props: WorkerEntryProps) {\n const [{ worker, children, imports, builtinImports }, rest] = splitProps(\n props,\n [\"worker\", \"children\", \"imports\", \"builtinImports\"]\n );\n\n const context = usePowerlines<CloudflarePluginContext>();\n const entryPath = computed(\n () =>\n `./${replaceExtension(\n relativePath(\n context.entryPath,\n worker.metadata.entry.input?.file || worker.metadata.entry.file\n )\n )}`\n );\n\n return (\n <EntryFile\n path={`worker-${murmurhash(worker.metadata.entry, {\n maxLength: 8\n })}-entry.ts`}\n {...rest}\n imports={defu(\n {\n \"@cloudflare/workers-types\": [\n { name: \"Request\", type: true },\n { name: \"Response\", type: true },\n { name: \"ExecutionContext\", type: true },\n { name: \"IncomingRequestCfProperties\", type: true },\n { name: \"ScheduledController\", type: true },\n { name: \"ForwardableEmailMessage\", type: true },\n { name: \"MessageBatch\", type: true },\n { name: \"TailStream\", type: true },\n { name: \"TraceItem\", type: true },\n { name: \"TailStream.TailEvent\", type: true },\n { name: \"TailStream.Onset\", type: true },\n { name: \"TailStream.TailEventHandlerType\", type: true }\n ],\n [entryPath.value]: \"worker\"\n },\n imports ?? {}\n )}\n builtinImports={defu(\n {\n cloudflare: [\n \"withFetchContext\",\n \"withTailContext\",\n \"withTraceContext\",\n \"withTailStreamContext\",\n \"withScheduledContext\",\n \"withTestContext\",\n \"withEmailContext\",\n \"withQueueContext\"\n ]\n },\n builtinImports ?? {}\n )}>\n {code`export default { `}\n <hbr />\n <Show when={worker.fetch}>\n {code` async fetch(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: CloudflareBindings, ctx: ExecutionContext): Promise<Response> {\n return await withFetchContext({ request, env, ctx }, async (context) => {\n return worker.fetch(context.request, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.tail}>\n {code` async tail(events: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTailContext({ events, env, ctx }, async (context) => {\n return worker.tail(context.events, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.trace}>\n {code` async trace(traces: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTraceContext({ traces, env, ctx }, async (context) => {\n return worker.trace(context.traces, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.tailStream}>\n {code` async tailStream(event: TailStream.TailEvent<TailStream.Onset>, env: CloudflareBindings, ctx: ExecutionContext): Promise<ReadableStream> {\n return await withTailStreamContext({ event, env, ctx }, async (context) => {\n return await worker.tailStream(context.event, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.scheduled}>\n {code` async scheduled(controller: ScheduledController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withScheduledContext({ controller, env, ctx }, async (context) => {\n return worker.scheduled(context.controller, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.test}>\n {code` async test(controller: TestController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTestContext({ controller, env, ctx }, async (context) => {\n return worker.test(context.controller, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.email}>\n {code` async email(message: ForwardableEmailMessage, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withEmailContext({ message, env, ctx }, async (context) => {\n return worker.email(context.message, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.queue}>\n {code` async queue(batch: MessageBatch, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withQueueContext({ batch, env, ctx }, async (context) => {\n return worker.queue(context.batch, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n {code` } satisfies ExportedHandler<CloudflareBindings>; `}\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EntryFile>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker-entry.mjs","names":[],"sources":["../../src/components/worker-entry.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { code, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components\";\nimport { usePowerlines } from \"@powerlines/plugin-alloy/core/contexts\";\nimport {\n EntryFile,\n EntryFileProps\n} from \"@powerlines/plugin-alloy/typescript/components/entry-file\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { relativePath } from \"@stryke/path/find\";\nimport { replaceExtension } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { CloudflarePluginContext, CloudflareWorkerEntryModule } from \"../types\";\n\nexport type WorkerEntryProps = Partial<EntryFileProps> &\n Omit<EntryFileProps, \"path\"> & {\n worker: CloudflareWorkerEntryModule;\n };\n\n/**\n * Generates a [Cloudflare Worker](https://developers.cloudflare.com/workers/runtime-apis/handlers/) entry module for the Powerlines project, providing a runtime context and utilities for integrating with Cloudflare services. This module defines a `CloudflareContext` interface, an `AsyncLocalStorage` instance for managing the context, and helper functions for retrieving and running code within the context. The generated module is designed to be used as a built-in file within the Powerlines environment, allowing developers to easily access Cloudflare-specific functionality in their applications.\n */\nexport function WorkerEntry(props: WorkerEntryProps) {\n const [{ worker, children, imports, builtinImports }, rest] = splitProps(\n props,\n [\"worker\", \"children\", \"imports\", \"builtinImports\"]\n );\n\n const context = usePowerlines<CloudflarePluginContext>();\n const entryPath = computed(\n () =>\n `./${replaceExtension(\n relativePath(\n context.entryPath,\n worker.metadata.entry.input?.file || worker.metadata.entry.file\n )\n )}`\n );\n\n return (\n <EntryFile\n path={`worker-${murmurhash(worker.metadata.entry, {\n maxLength: 8\n })}-entry.ts`}\n {...rest}\n imports={defu(\n {\n \"@cloudflare/workers-types\": [\n { name: \"Request\", type: true },\n { name: \"Response\", type: true },\n { name: \"ExecutionContext\", type: true },\n { name: \"IncomingRequestCfProperties\", type: true },\n { name: \"ScheduledController\", type: true },\n { name: \"ForwardableEmailMessage\", type: true },\n { name: \"MessageBatch\", type: true },\n { name: \"TailStream\", type: true },\n { name: \"TraceItem\", type: true },\n { name: \"TailStream.TailEvent\", type: true },\n { name: \"TailStream.Onset\", type: true },\n { name: \"TailStream.TailEventHandlerType\", type: true }\n ],\n [entryPath.value]: \"worker\"\n },\n imports ?? {}\n )}\n builtinImports={defu(\n {\n cloudflare: [\n \"withFetchContext\",\n \"withTailContext\",\n \"withTraceContext\",\n \"withTailStreamContext\",\n \"withScheduledContext\",\n \"withTestContext\",\n \"withEmailContext\",\n \"withQueueContext\"\n ]\n },\n builtinImports ?? {}\n )}>\n {code`export default { `}\n <hbr />\n <Show when={worker.fetch}>\n {code` async fetch(request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: CloudflareBindings, ctx: ExecutionContext): Promise<Response> {\n return await withFetchContext({ request, env, ctx }, async (context) => {\n return worker.fetch(context.request, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.tail}>\n {code` async tail(events: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTailContext({ events, env, ctx }, async (context) => {\n return worker.tail(context.events, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.trace}>\n {code` async trace(traces: TraceItem[], env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTraceContext({ traces, env, ctx }, async (context) => {\n return worker.trace(context.traces, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.tailStream}>\n {code` async tailStream(event: TailStream.TailEvent<TailStream.Onset>, env: CloudflareBindings, ctx: ExecutionContext): Promise<ReadableStream> {\n return await withTailStreamContext({ event, env, ctx }, async (context) => {\n return await worker.tailStream(context.event, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.scheduled}>\n {code` async scheduled(controller: ScheduledController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withScheduledContext({ controller, env, ctx }, async (context) => {\n return worker.scheduled(context.controller, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.test}>\n {code` async test(controller: TestController, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withTestContext({ controller, env, ctx }, async (context) => {\n return worker.test(context.controller, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.email}>\n {code` async email(message: ForwardableEmailMessage, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withEmailContext({ message, env, ctx }, async (context) => {\n return worker.email(context.message, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n <Show when={worker.queue}>\n {code` async queue(batch: MessageBatch, env: CloudflareBindings, ctx: ExecutionContext): Promise<void> {\n return withQueueContext({ batch, env, ctx }, async (context) => {\n return worker.queue(context.batch, context.env, context.ctx);\n });\n }, `}\n </Show>\n <hbr />\n {code` } satisfies ExportedHandler<CloudflareBindings>; `}\n <Spacing />\n <Show when={Boolean(children)}>{children}</Show>\n </EntryFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,SAAY,YAAgB,OAAG;CAC7B,MAAK,CAAA,EACH,QACD,mBAED,kBACC,QAAU,WAAG,OAAW;EAAA;EAAe;EAAY;EAAW;CAAY,CAAA;CAC3E,MAAA,UAAA,cAAA;CACF,MAAO,YAAS,eAAmB,KAAA,iBAAkB,aAAA,QAAA,WAAA,OAAA,SAAA,MAAA,OAAA,QAAA,OAAA,SAAA,MAAA,IAAA,CAAA,GAAA;CACnD,OAAO,gBAAkB,WAAW,WAAA,EAClC,IAAA,OAAK;EACH,OAAO,UAAG,WAAY,OAAW,SAAA,OAAe,EACnD,WAAA;CAED,EACA,GAAA,MAAM;EACJ,IAAI,UAAA;GACF,OAAK,KAAA;IACH,6BAAY;KAAA;MACV,MAAA;MACA,MAAM;KACR;KAAA;MACA,MAAA;MACL,MAAA;;;MAEM,MAAA;MACJ,MAAA;KACC;KAAK;MACH,MAAA;MACE,MAAM;KACR;KAAE;MACJ,MAAS;MACP,MAAA;KACA;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAI;MACJ,MAAI;KACN;KAAG;MACD,MAAC;MACD,MAAC;KACH;KAAC;MACD,MAAQ;MACT,MAAA;KACD;KAAA;MACE,MAAA;MACE,MAAA;KACF;IA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,CAAA;IAAA,gBAAA,OAAA,CAAA,CAAA;IAAA,IAAA;IAAA,gBAAA,SAAA,CAAA,CAAA;IAAA,gBAAA,MAAA;KACH,IAAA,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_components_worker_entry = require('./worker-entry.cjs');
|
|
2
|
+
const require_chunk_artifact = require('../node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs');
|
|
3
|
+
const require_test_DNmyFkvJ = require('../node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs');
|
|
4
|
+
|
|
5
|
+
//#region src/components/worker-entry.test.ts
|
|
6
|
+
require_chunk_artifact.describe("plugins/plugin-cloudflare/src/components/worker-entry.tsx", () => {
|
|
7
|
+
require_chunk_artifact.it("loads module exports", () => {
|
|
8
|
+
require_test_DNmyFkvJ.globalExpect(require_components_worker_entry.worker_entry_exports).toBeDefined();
|
|
9
|
+
require_test_DNmyFkvJ.globalExpect(typeof require_components_worker_entry.worker_entry_exports).toBe("object");
|
|
10
|
+
});
|
|
11
|
+
require_chunk_artifact.it("has at least one runtime export", () => {
|
|
12
|
+
require_test_DNmyFkvJ.globalExpect(Object.keys(require_components_worker_entry.worker_entry_exports).length).toBeGreaterThan(0);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|