This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: supports all Inheritable keys fields (#10)
* feat: supports all Inheritable keys fields * chore: changeset
- Loading branch information
Showing
9 changed files
with
220 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"twrangler": patch | ||
--- | ||
|
||
Support all inheritable key fields | ||
|
||
<https://developers.cloudflare.com/workers/wrangler/configuration/#inheritable-keys> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { z } from "zod"; | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#custom-builds | ||
export const buildSchema = z.object({ | ||
command: z.string().optional(), | ||
cwd: z.string().optional(), | ||
watch_dir: z.union([z.string(), z.array(z.string())]).optional(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { z } from "zod"; | ||
|
||
// ref: https://developers.cloudflare.com/workers/configuration/compatibility-dates | ||
export const compatibilityDateSchema = z.enum([ | ||
"2024-04-29", | ||
"2024-04-03", | ||
"2024-04-01", | ||
"2024-03-26", | ||
"2024-03-18", | ||
"2024-03-04", | ||
"2023-12-01", | ||
"2023-11-08", | ||
"2023-08-15", | ||
"2023-08-01", | ||
"2023-03-14", | ||
"2023-03-01", | ||
"2022-11-30", | ||
"2022-10-31", | ||
"2022-08-04", | ||
"2022-06-01", | ||
"2022-04-05", | ||
"2022-03-21", | ||
"2022-03-08", | ||
"2022-01-31", | ||
"2021-11-10", | ||
"2021-11-03", | ||
]); | ||
|
||
// ref: https://developers.cloudflare.com/workers/configuration/compatibility-dates/#compatibility-flags | ||
export const compatibilityFlagsSchema = z.array( | ||
z.enum([ | ||
"brotli_content_encoding", | ||
"no_brotli_content_encoding", | ||
"rpc", | ||
"unwrap_custom_thenables", | ||
"no_unwrap_custom_thenables", | ||
"fetcher_no_get_put_delete", | ||
"fetcher_has_get_put_delete", | ||
"queues_json_messages", | ||
"no_queues_json_messages", | ||
"no_global_importscripts", | ||
"global_importscripts", | ||
"nodejs_als", | ||
"no_nodejs_als", | ||
"crypto_preserve_public_exponent", | ||
"no_crypto_preserve_public_exponent", | ||
"vectorize_query_metadata_optional", | ||
"vectorize_query_original", | ||
"web_socket_compression", | ||
"no_web_socket_compression", | ||
"strict_crypto_checks", | ||
"no_strict_crypto_checks", | ||
"strict_compression_checks", | ||
"no_strict_compression_checks", | ||
"response_redirect_url_standard", | ||
"response_redirect_url_original", | ||
"dynamic_dispatch_tunnel_exceptions", | ||
"dynamic_dispatch_treat_exceptions_as_500", | ||
"http_headers_getsetcookie", | ||
"no_http_headers_getsetcookie", | ||
"streams_enable_constructors", | ||
"streams_disable_constructors", | ||
"transformstream_enable_standard_constructor", | ||
"transformstream_disable_standard_constructor", | ||
"export_commonjs_default", | ||
"export_commonjs_namespace", | ||
"capture_async_api_throws", | ||
"do_not_capture_async_api_throws", | ||
"url_standard", | ||
"url_original", | ||
"r2_list_honor_include", | ||
"dont_substitute_null_on_type_error", | ||
"substitute_null_on_type_error", | ||
"minimal_subrequests", | ||
"no_minimal_subrequests", | ||
"global_navigator", | ||
"no_global_navigator", | ||
"no_cots_on_external_fetch", | ||
"cots_on_external_fetch", | ||
"workers_api_getters_setters_on_prototype", | ||
"workers_api_getters_setters_on_instance", | ||
"durable_object_fetch_requires_full_url", | ||
"durable_object_fetch_allows_relative_url", | ||
"fetch_refuses_unknown_protocols", | ||
"fetch_treats_unknown_protocols_as_http", | ||
"streams_byob_reader_detaches_buffer", | ||
"streams_byob_reader_does_not_detach_buffer", | ||
"formdata_parser_supports_files", | ||
"formdata_parser_converts_files_to_strings", | ||
"html_rewriter_treats_esi_include_as_void_tag", | ||
]), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { z } from "zod"; | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#limits | ||
export const limitsSchema = z.object({ | ||
cpu_ms: z.number().optional(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { z } from "zod"; | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#custom-domains | ||
const customDomainsItemSchema = z.object({ | ||
pattern: z.string(), | ||
custom_domain: z.boolean().optional(), | ||
}); | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#zone-id-route | ||
const zoneIdRouteItemSchema = z.object({ | ||
pattern: z.string(), | ||
zone_id: z.string(), | ||
}); | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#zone-name-route | ||
const zoneNameRouteItemSchema = z.object({ | ||
pattern: z.string(), | ||
zone_name: z.string(), | ||
}); | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#simple-route | ||
const simpleRouteItemSchema = z.string(); | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes | ||
export const routeSchema = z.union([ | ||
customDomainsItemSchema, | ||
zoneIdRouteItemSchema, | ||
zoneNameRouteItemSchema, | ||
simpleRouteItemSchema, | ||
]); | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routess | ||
export const routesSchema = z.union([ | ||
z.array(customDomainsItemSchema), | ||
z.array(zoneIdRouteItemSchema), | ||
z.array(zoneNameRouteItemSchema), | ||
z.array(simpleRouteItemSchema), | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { z } from "zod"; | ||
|
||
// ref: https://developers.cloudflare.com/workers/wrangler/configuration/#bundling | ||
const ruleSchema = z.object({ | ||
type: z.enum(["ESModule", "CommonJS", "CompiledWasm", "Text", "Data"]), | ||
globs: z.array(z.string()), | ||
fallthrough: z.boolean().optional(), | ||
}); | ||
|
||
export const rulesSchema = z.array(ruleSchema); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { z } from "zod"; | ||
|
||
export const triggersSchema = z.object({ | ||
crons: z.array(z.string()), | ||
}); |