Skip to content

Commit 2481457

Browse files
committed
Merge remote-tracking branch 'origin/production' into kathayl-patch-12-1
2 parents 6fd0ab9 + 2f58fdc commit 2481457

File tree

367 files changed

+3051
-8354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+3051
-8354
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@
120120
/public/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls @roerohan @ravindra-dyte
121121
/src/content/docs/stream/ @tsmith512 @ToriLindsay @cloudflare/pcx-technical-writing @renandincer @third774
122122
/src/content/release-notes/stream.yaml @tsmith512 @ToriLindsay @cloudflare/pcx-technical-writing
123-
/src/content/docs/workers/ @cloudflare/workers-docs @GregBrimble @irvinebroque @mikenomitch @korinne @WalshyDev @cloudflare/deploy-config @cloudflare/pcx-technical-writing @kodster28 @cloudflare/wrangler @cloudflare/workers-runtime-1 @cloudflare/wrangler
124-
/src/content/partials/workers/ @cloudflare/workers-docs @GregBrimble @irvinebroque @mikenomitch @WalshyDev @cloudflare/deploy-config @cloudflare/pcx-technical-writing @kodster28 @cloudflare/wrangler @cloudflare/workers-runtime-1 @cloudflare/wrangler
125-
/src/assets/images/workers/ @cloudflare/workers-docs @GregBrimble @irvinebroque @WalshyDev @cloudflare/deploy-config @cloudflare/pcx-technical-writing @kodster28 @cloudflare/wrangler @cloudflare/workers-runtime-1 @cloudflare/wrangler
123+
/src/content/docs/workers/ @cloudflare/workers-docs @GregBrimble @irvinebroque @mikenomitch @korinne @WalshyDev @cloudflare/deploy-config @cloudflare/pcx-technical-writing @kodster28 @cloudflare/wrangler @cloudflare/workers-runtime-1
124+
/src/content/partials/workers/ @cloudflare/workers-docs @GregBrimble @irvinebroque @mikenomitch @WalshyDev @cloudflare/deploy-config @cloudflare/pcx-technical-writing @kodster28 @cloudflare/wrangler @cloudflare/workers-runtime-1
125+
/src/assets/images/workers/ @cloudflare/workers-docs @GregBrimble @irvinebroque @WalshyDev @cloudflare/deploy-config @cloudflare/pcx-technical-writing @kodster28 @cloudflare/wrangler @cloudflare/workers-runtime-1
126126
/src/content/release-notes/workers.yaml @cloudflare/workers-docs @GregBrimble @WalshyDev @aninibread @cloudflare/deploy-config @cloudflare/pcx-technical-writing @irvinebroque @mikenomitch
127127
/src/content/docs/zaraz/ @ToriLindsay @kathayl @bjesus @jonnyparris @simonabadoiu @cloudflare/pcx-technical-writing
128128
/src/content/release-notes/zaraz.yaml @bjesus @jonnyparris @simonabadoiu @cloudflare/pcx-technical-writing

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@expressive-code/plugin-line-numbers": "0.41.3",
4343
"@floating-ui/react": "0.27.16",
4444
"@iarna/toml": "2.2.5",
45-
"@lottiefiles/dotlottie-react": "0.16.0",
45+
"@lottiefiles/dotlottie-react": "0.16.1",
4646
"@marsidev/react-turnstile": "1.3.0",
4747
"@microsoft/fetch-event-source": "2.0.1",
4848
"@nanostores/react": "1.0.0",
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
diff --git a/node_modules/@astrojs/starlight-docsearch/DocSearch.astro b/node_modules/@astrojs/starlight-docsearch/DocSearch.astro
2+
index f50c208..5309557 100644
3+
--- a/node_modules/@astrojs/starlight-docsearch/DocSearch.astro
4+
+++ b/node_modules/@astrojs/starlight-docsearch/DocSearch.astro
5+
@@ -109,15 +109,20 @@ const docsearchTranslations: DocSearchTranslationProps = {
6+
.DocSearch-Button-Keys {
7+
margin-inline-start: auto;
8+
}
9+
- .DocSearch-Button-Keys::before {
10+
- content: '';
11+
- width: 1em;
12+
- height: 1em;
13+
- -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z'%3E%3C/path%3E%3Cpath d='M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z'%3E%3C/path%3E%3C/svg%3E");
14+
- mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z'%3E%3C/path%3E%3Cpath d='M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z'%3E%3C/path%3E%3C/svg%3E");
15+
- -webkit-mask-size: 100%;
16+
- mask-size: 100%;
17+
- background-color: currentColor;
18+
+ .DocSearch-Button-Key:first-child {
19+
+ margin-right: 0.4em;
20+
+ }
21+
+ .DocSearch-Button-Key {
22+
+ display: inline-block;
23+
+ font-size: 0.75em;
24+
+ font-weight: 600;
25+
+ opacity: 0.8;
26+
+ border: 1px solid var(--sl-color-gray-4);
27+
+ border-radius: 0.25rem;
28+
+ padding: 0.125rem 0.375rem;
29+
+ background-color: var(--sl-color-gray-6);
30+
+ color: var(--sl-color-gray-1);
31+
+ line-height: 1;
32+
}
33+
}
34+
</style>
35+
@@ -128,6 +133,7 @@ const docsearchTranslations: DocSearchTranslationProps = {
36+
class StarlightDocSearch extends HTMLElement {
37+
constructor() {
38+
super();
39+
+
40+
window.addEventListener('DOMContentLoaded', async () => {
41+
const { default: docsearch } = await import('@docsearch/js');
42+
const options = { ...config, container: 'sl-doc-search' };
43+
@@ -136,6 +142,27 @@ const docsearchTranslations: DocSearchTranslationProps = {
44+
Object.assign(options, translations);
45+
} catch {}
46+
docsearch(options);
47+
+
48+
+ const keyboardShortcuts = options.keyboardShortcuts ?? {};
49+
+ const slashEnabled = keyboardShortcuts?.['/'] !== false;
50+
+ const ctrlCmdKEnabled = keyboardShortcuts?.['Ctrl/Cmd+K'] !== false;
51+
+
52+
+ if (slashEnabled && !ctrlCmdKEnabled) {
53+
+ const styleContainer = document.createElement('style');
54+
+ styleContainer.innerHTML = `
55+
+ .DocSearch-Button-Keys::before {
56+
+ content: '';
57+
+ width: 1em;
58+
+ height: 1em;
59+
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z'%3E%3C/path%3E%3Cpath d='M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z'%3E%3C/path%3E%3C/svg%3E");
60+
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z'%3E%3C/path%3E%3Cpath d='M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z'%3E%3C/path%3E%3C/svg%3E");
61+
+ -webkit-mask-size: 100%;
62+
+ mask-size: 100%;
63+
+ background-color: currentColor;
64+
+ }
65+
+ `;
66+
+ document.head.appendChild(styleContainer);
67+
+ }
68+
});
69+
}
70+
}
71+
diff --git a/node_modules/@astrojs/starlight-docsearch/index.ts b/node_modules/@astrojs/starlight-docsearch/index.ts
72+
index e8cc7e5..6c88e07 100644
73+
--- a/node_modules/@astrojs/starlight-docsearch/index.ts
74+
+++ b/node_modules/@astrojs/starlight-docsearch/index.ts
75+
@@ -43,6 +43,18 @@ const DocSearchConfigSchema = z
76+
* @see https://www.algolia.com/doc/api-reference/search-api-parameters/
77+
*/
78+
searchParameters: z.custom<SearchOptions>(),
79+
+ /**
80+
+ * Configuration for keyboard shortcuts that trigger the DocSearch modal.
81+
+ * @see https://docsearch.algolia.com/docs/api/#keyboardshortcuts
82+
+ */
83+
+ keyboardShortcuts: z
84+
+ .object({
85+
+ /** Enable/disable Ctrl/Cmd+K shortcut. @default true */
86+
+ 'Ctrl/Cmd+K': z.boolean().optional(),
87+
+ /** Enable/disable / shortcut. @default true */
88+
+ '/': z.boolean().optional(),
89+
+ })
90+
+ .optional(),
91+
})
92+
.strict()
93+
.or(

patches/@docsearch+js+3.8.2.patch

Lines changed: 38 additions & 0 deletions
Large diffs are not rendered by default.

public/__redirects

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,15 @@
492492
/ddos-protection/managed-rulesets/adjust-rules/false-positive/ /ddos-protection/managed-rulesets/http/http-overrides/override-examples/#legitimate-traffic-is-incorrectly-identified-as-an-attack-and-causes-a-false-positive 301
493493
/ddos-protection/managed-rulesets/adjust-rules/ /ddos-protection/managed-rulesets/http/http-overrides/override-examples/ 301
494494

495+
# developer spotlight
496+
/developer-spotlight/tutorials/ /developer-spotlight/ 301
497+
/developer-spotlight/tutorials/create-sitemap-from-sanity-cms/ /developer-spotlight/ 301
498+
/developer-spotlight/tutorials/creating-a-recommendation-api/ /developer-spotlight/ 301
499+
/developer-spotlight/tutorials/custom-access-control-for-files/ /developer-spotlight/ 301
500+
/developer-spotlight/tutorials/fullstack-authentication-with-next-js-and-cloudflare-d1/ /developer-spotlight/ 301
501+
/developer-spotlight/tutorials/handle-form-submission-with-astro-resend/ /developer-spotlight/ 301
502+
/developer-spotlight/application-guide/ /developer-spotlight/ 301
503+
495504
# dns
496505
/dns/additional-options/cname-flattening/ /dns/cname-flattening/ 301
497506
/dns/additional-options/dnssec/ /dns/dnssec/ 301
@@ -1610,6 +1619,7 @@
16101619
/turnstile/glossary/ /turnstile/ 301
16111620
/turnstile/get-started/supported-browsers/ /cloudflare-challenges/reference/supported-browsers/ 301
16121621
/turnstile/troubleshooting/troubleshooting-faqs/ /turnstile/frequently-asked-questions/#troubleshooting 301
1622+
/turnstile/tutorials/protecting-your-payment-form-from-attackers-bots-using-turnstile/ /developer-spotlight/ 301
16131623

16141624
# waf
16151625
/waf/about/ /waf/concepts/ 301
@@ -1905,8 +1915,8 @@
19051915
/workers/configuration/bindings/about-service-bindings/ /workers/runtime-apis/bindings/service-bindings/ 301
19061916
/workers/tutorials/localize-a-website/ /pages/tutorials/localize-a-website/ 301
19071917
/workers/tutorials/manage-projects-with-lerna/ /pages/configuration/monorepos/#monorepo-management-tools 301
1908-
/workers/tutorials/create-sitemap-from-sanity-cms/ /developer-spotlight/tutorials/create-sitemap-from-sanity-cms/ 301
1909-
/workers/tutorials/custom-access-control-for-files-in-r2-using-d1-and-workers/ /developer-spotlight/tutorials/custom-access-control-for-files/ 301
1918+
/workers/tutorials/create-sitemap-from-sanity-cms/ /developer-spotlight/ 301
1919+
/workers/tutorials/custom-access-control-for-files-in-r2-using-d1-and-workers/ /developer-spotlight/ 301
19101920
/workers/tutorials/generate-dynamic-og-images-using-workers/ /workers/tutorials/ 302
19111921
/workers/static-assets/migrate-from-pages/ /workers/static-assets/migration-guides/migrate-from-pages/ 301
19121922
/workers/static-assets/compatibility-matrix/ /workers/static-assets/migration-guides/migrate-from-pages/ 301
@@ -1939,6 +1949,8 @@
19391949
/workers/testing/miniflare/get-started/migrating/ /workers/testing/miniflare/migrations/from-v2/ 301
19401950
/workers/databases/native-integrations/fauna/ /workers/databases/native-integrations/ 301
19411951
/workers/tutorials/store-data-with-fauna/ https://fauna.com/blog/the-future-of-fauna 301
1952+
/workers/tutorials/live-cursors-with-nextjs-rpc-do/ /developer-spotlight/ 301
1953+
/workers/tutorials/automated-analytics-reporting/ /developer-spotlight/ 301
19421954

19431955
# workers ai
19441956
/workers-ai/models/llm/ /workers-ai/models/#text-generation 301
@@ -1955,9 +1967,11 @@
19551967
/workers-ai/configuration/function-calling/ /workers-ai/function-calling/ 301
19561968
/workers-ai/platform/storage-options/ /workers/platform/storage-options/ 301
19571969
/workers-ai/configuration/workers-ai-sdk/ /workers-ai/configuration/bindings/ 301
1958-
/workers-ai/tutorials/creating-a-recommendation-api/ /developer-spotlight/tutorials/creating-a-recommendation-api/ 301
1970+
/workers-ai/tutorials/creating-a-recommendation-api/ /developer-spotlight/ 301
19591971
/workers/observability/baselime-integration/ /workers/observability/integrations/baselime-integration/ 301
19601972
/workers-ai/tutorials/image-generator-flux/ /workers-ai/tutorials/image-generation-playground/ 301
1973+
/workers-ai/guides/tutorials/build-a-voice-notes-app-with-auto-transcription/ /developer-spotlight/ 301
1974+
/workers-ai/tutorials/build-ai-interview-practice-tool/ /developer-spotlight/ 301
19611975

19621976
# Workers AI reorganization redirects
19631977
# Function calling
-187 KB
Binary file not shown.
-38.3 KB
Binary file not shown.

src/components/404.astro

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,37 @@
1010

1111
<script>
1212
import { track } from "~/util/zaraz";
13+
import { openGlobalSearch } from "~/util/search";
1314

1415
const { pathname } = window.location;
1516

1617
const anchor = document.getElementById("404-search-link");
18+
const pretty = decodeURIComponent(
19+
pathname.replaceAll("/", " ").replaceAll("-", " ").trim(),
20+
);
1721

1822
if (anchor) {
19-
const pretty = pathname.replaceAll("/", " ").replaceAll("-", " ").trim();
20-
2123
anchor.setAttribute("href", `/search/?q=${encodeURIComponent(pretty)}`);
2224
anchor.addEventListener("click", () => {
2325
track("serp from location", { value: "404", query: pretty });
2426
});
2527
}
28+
29+
document.addEventListener(
30+
"keydown",
31+
(keyboardEvent) => {
32+
if (
33+
(keyboardEvent.metaKey || keyboardEvent.ctrlKey) &&
34+
keyboardEvent.key === "k"
35+
) {
36+
keyboardEvent.preventDefault();
37+
keyboardEvent.stopPropagation();
38+
39+
openGlobalSearch(pretty);
40+
}
41+
},
42+
{
43+
capture: true,
44+
},
45+
);
2646
</script>

src/components/WranglerCLI.astro

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
import { z } from "astro:schema";
3+
import { PackageManagers } from "starlight-package-managers";
4+
import { commands, getCommand } from "~/util/wrangler";
5+
import WranglerArg from "./WranglerArg.astro";
6+
import Details from "./Details.astro";
7+
8+
function validateArg(value: any, expected: string): boolean {
9+
if (Array.isArray(expected)) {
10+
for (const choice of expected) {
11+
if (value === choice) {
12+
return true;
13+
}
14+
}
15+
16+
return false;
17+
}
18+
19+
return typeof value === expected;
20+
}
21+
22+
type Props = z.input<typeof props>;
23+
24+
const props = z.object({
25+
command: z.string(),
26+
positionals: z.array(z.string()).optional(),
27+
flags: z.record(z.string(), z.any()).optional(),
28+
showArgs: z.boolean().default(false),
29+
});
30+
31+
const { command, positionals, flags, showArgs } = props.parse(Astro.props);
32+
33+
const definition = getCommand(command);
34+
35+
const { globalFlags } = commands;
36+
37+
let args = [];
38+
39+
if (flags) {
40+
for (const [key, value] of Object.entries(flags)) {
41+
const flagDef = definition.args?.[key];
42+
43+
if (!flagDef) {
44+
throw new Error(
45+
`[WranglerCLI] Received "${key}" for "${command}" but no such arg exists`,
46+
);
47+
}
48+
49+
const type = flagDef.type ?? flagDef.choices;
50+
const valid = validateArg(value, type);
51+
52+
if (!valid) {
53+
throw new Error(
54+
`[WranglerCLI] Expected "${type}" for "${key}" but got "${typeof value}"`,
55+
);
56+
}
57+
58+
args.push(...[`--${key}`, value]);
59+
}
60+
}
61+
62+
if (positionals) {
63+
const positionalsDef = definition.positionalArgs ?? [];
64+
65+
if (positionalsDef.length === 0) {
66+
throw new Error(
67+
`[WranglerCLI] Expected 0 positional arguments for "${command}" but received ${positionals.length}`,
68+
);
69+
}
70+
71+
args.push(...positionals);
72+
}
73+
---
74+
75+
<PackageManagers
76+
pkg="wrangler"
77+
type="exec"
78+
args={`${command} ${args.join(" ")}`}
79+
/>
80+
81+
{
82+
showArgs && definition.args && (
83+
<Details header="Arguments">
84+
<p>
85+
<strong>Command flags</strong>
86+
</p>
87+
<ul>
88+
{Object.entries(definition.args)
89+
.filter(([_, value]) => !value.hidden)
90+
.map(([key, value]) => {
91+
return <WranglerArg key={key} definition={value} />;
92+
})}
93+
</ul>
94+
95+
<p>
96+
<strong>Global flags</strong>
97+
</p>
98+
<ul>
99+
{Object.entries(globalFlags).map(([key, value]) => {
100+
return <WranglerArg key={key} definition={value} />;
101+
})}
102+
</ul>
103+
</Details>
104+
)
105+
}

0 commit comments

Comments
 (0)