@cloudflare/config 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -13
- package/dist/index.mjs +11 -4
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -588,8 +588,8 @@ declare const TailConsumerSchema: z.ZodObject<{
|
|
|
588
588
|
}, z.core.$strict>;
|
|
589
589
|
/**
|
|
590
590
|
* Input Worker schema — parses Worker definitions from user-authored
|
|
591
|
-
* `cloudflare.config.ts` files. Adds an optional `entrypoint` field to
|
|
592
|
-
* schema.
|
|
591
|
+
* `cloudflare.config.ts` files. Adds an optional string `entrypoint` field to
|
|
592
|
+
* the base schema.
|
|
593
593
|
*/
|
|
594
594
|
declare const InputWorkerSchema: z.ZodObject<{
|
|
595
595
|
name: z.ZodString;
|
|
@@ -741,12 +741,9 @@ declare const InputWorkerSchema: z.ZodObject<{
|
|
|
741
741
|
enabled: z.ZodBoolean;
|
|
742
742
|
}, z.core.$strict>>;
|
|
743
743
|
}, z.core.$strict>]>>>;
|
|
744
|
-
entrypoint: z.ZodOptional<z.
|
|
745
|
-
default: z.ZodString;
|
|
746
|
-
}, z.core.$strict>]>, z.ZodTransform<string, string | {
|
|
747
|
-
default: string;
|
|
748
|
-
}>>>;
|
|
744
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
749
745
|
}, z.core.$strict>;
|
|
746
|
+
type InputWorkerConfig = z.input<typeof InputWorkerSchema>;
|
|
750
747
|
type ParsedInputWorkerConfig = z.output<typeof InputWorkerSchema>;
|
|
751
748
|
/**
|
|
752
749
|
* Input settings schema — parses the account settings at the top level of
|
|
@@ -912,11 +909,7 @@ declare const InputConfigSchema: z.ZodObject<{
|
|
|
912
909
|
enabled: z.ZodBoolean;
|
|
913
910
|
}, z.core.$strict>>;
|
|
914
911
|
}, z.core.$strict>]>>>;
|
|
915
|
-
entrypoint: z.ZodOptional<z.
|
|
916
|
-
default: z.ZodString;
|
|
917
|
-
}, z.core.$strict>]>, z.ZodTransform<string, string | {
|
|
918
|
-
default: string;
|
|
919
|
-
}>>>;
|
|
912
|
+
entrypoint: z.ZodOptional<z.ZodString>;
|
|
920
913
|
}, z.core.$strict>>;
|
|
921
914
|
containers: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
922
915
|
name: z.ZodString;
|
|
@@ -1346,4 +1339,4 @@ declare function loadAndParseConfig(configPath: string, ctx: ConfigContext): Pro
|
|
|
1346
1339
|
/** Load and parse only account settings from the default export. */
|
|
1347
1340
|
declare function loadAndParseConfigSettings(configPath: string, ctx: ConfigContext): Promise<LoadAndParseConfigSettingsResult>;
|
|
1348
1341
|
//#endregion
|
|
1349
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, CloudflareConfig, ConfigContext, type ConfigParseResult, type ConfigSettingsParseResult, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, D1BindingSchema, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectCreatedExportSchema, DurableObjectDeletedExport, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExport, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExport, DurableObjectRenamedExportSchema, DurableObjectTransferredExport, DurableObjectTransferredExportSchema, EmailTrigger, ExportSchema, Exports, FetchTrigger, FlagshipBinding, FlagshipBindingSchema, HyperdriveBinding, HyperdriveBindingSchema, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputConfigSchema, InputContainerSchema, InputSettingsSchema, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndParseConfigResult, type LoadAndParseConfigSettingsResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, type ParsedInputConfig, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputRootConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
|
|
1342
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, AnalyticsEngineDatasetBindingSchema, ArtifactsBinding, AssetsBinding, AssetsSchema, BindingDevOptions, BindingSchema, Bindings, BrowserBinding, BrowserBindingSchema, CloudflareConfig, ConfigContext, type ConfigParseResult, type ConfigSettingsParseResult, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, D1BindingSchema, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectCreatedExportSchema, DurableObjectDeletedExport, DurableObjectDeletedExportSchema, DurableObjectExpectingTransferExport, DurableObjectExpectingTransferExportSchema, DurableObjectRenamedExport, DurableObjectRenamedExportSchema, DurableObjectTransferredExport, DurableObjectTransferredExportSchema, EmailTrigger, ExportSchema, Exports, FetchTrigger, FlagshipBinding, FlagshipBindingSchema, HyperdriveBinding, HyperdriveBindingSchema, ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, InputConfigSchema, InputContainerSchema, InputSettingsSchema, type InputWorkerConfig, InputWorkerSchema, JsonBinding, KVBindingSchema, KnownBindingSchema, KvBinding, type LoadAndParseConfigResult, type LoadAndParseConfigSettingsResult, type LoadConfigResult, LogfwdrBinding, MediaBinding, type ModuleType, ModuleTypeSchema, MtlsCertificateBinding, OutputContainerSchema, OutputRootConfigSchema, OutputWorkerSchema, type ParsedInputConfig, type ParsedInputContainerConfig, type ParsedInputSettingsConfig, type ParsedInputWorkerConfig, type ParsedOutputContainerConfig, type ParsedOutputRootConfig, type ParsedOutputWorkerConfig, PipelineBinding, QueueBinding, QueueBindingSchema, QueueConsumerTrigger, R2Binding, R2BindingSchema, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding, TailConsumerSchema, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnsafeBindingSchema, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerBindingSchema, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerEntrypointExportSchema, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, convertToWranglerConfig, defineConfig, defineContainer, defineWorker, exports, generateTypes, loadAndParseConfig, loadAndParseConfigSettings, loadConfig, registerConfigHooks, resolveAndParseConfig, resolveAndParseConfigSettings, triggers, validateSingletonBindings };
|
package/dist/index.mjs
CHANGED
|
@@ -549,10 +549,10 @@ const BaseWorkerSchema = z.strictObject({
|
|
|
549
549
|
});
|
|
550
550
|
/**
|
|
551
551
|
* Input Worker schema — parses Worker definitions from user-authored
|
|
552
|
-
* `cloudflare.config.ts` files. Adds an optional `entrypoint` field to
|
|
553
|
-
* schema.
|
|
552
|
+
* `cloudflare.config.ts` files. Adds an optional string `entrypoint` field to
|
|
553
|
+
* the base schema.
|
|
554
554
|
*/
|
|
555
|
-
const InputWorkerSchema = BaseWorkerSchema.extend({ entrypoint: z.
|
|
555
|
+
const InputWorkerSchema = BaseWorkerSchema.extend({ entrypoint: z.string().optional() });
|
|
556
556
|
/**
|
|
557
557
|
* Input settings schema — parses the account settings at the top level of
|
|
558
558
|
* `cloudflare.config.ts`.
|
|
@@ -1530,6 +1530,13 @@ async function normalizeWorkerReferences(resolved, resolveDefinition) {
|
|
|
1530
1530
|
env
|
|
1531
1531
|
};
|
|
1532
1532
|
}
|
|
1533
|
+
function normalizeWorkerEntrypoint(resolved) {
|
|
1534
|
+
if (!isRecord(resolved) || !isRecord(resolved.entrypoint) || !("default" in resolved.entrypoint)) return resolved;
|
|
1535
|
+
return {
|
|
1536
|
+
...resolved,
|
|
1537
|
+
entrypoint: resolved.entrypoint.default
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1533
1540
|
async function normalizeContainerReferences(resolved, resolveDefinition, containers) {
|
|
1534
1541
|
const issues = [];
|
|
1535
1542
|
if (!isRecord(resolved) || !isRecord(resolved.exports)) return {
|
|
@@ -1589,7 +1596,7 @@ async function normalizeContainerReferences(resolved, resolveDefinition, contain
|
|
|
1589
1596
|
};
|
|
1590
1597
|
}
|
|
1591
1598
|
async function normalizeWorkerConfig(resolved, resolveDefinition, containers) {
|
|
1592
|
-
return normalizeContainerReferences(await normalizeWorkerReferences(resolved, resolveDefinition), resolveDefinition, containers);
|
|
1599
|
+
return normalizeContainerReferences(await normalizeWorkerReferences(normalizeWorkerEntrypoint(resolved), resolveDefinition), resolveDefinition, containers);
|
|
1593
1600
|
}
|
|
1594
1601
|
function prefixIssues(issues, prefix) {
|
|
1595
1602
|
return issues.map((issue) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Definitions and utilities for configuring Cloudflare Workers and related products. This is not yet stable enough for external use — APIs may change without notice.",
|
|
5
5
|
"homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/config#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"tsdown": "0.16.3",
|
|
37
37
|
"typescript": "5.8.3",
|
|
38
38
|
"vitest": "4.1.0",
|
|
39
|
-
"@cloudflare/workers-
|
|
40
|
-
"@cloudflare/workers-
|
|
39
|
+
"@cloudflare/workers-utils": "0.41.0",
|
|
40
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
41
41
|
},
|
|
42
42
|
"workers-sdk": {
|
|
43
43
|
"prerelease": true
|