Skip to content

Commit 42a60ea

Browse files
committed
Update to packagemanagers where appropriate
1 parent 89f4808 commit 42a60ea

File tree

4 files changed

+17
-59
lines changed

4 files changed

+17
-59
lines changed

src/content/docs/developer-spotlight/tutorials/create-sitemap-from-sanity-cms.mdx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spotlight:
1717
author_bio_source: LinkedIn
1818
---
1919

20-
import { TabItem, Tabs } from "~/components";
20+
import { TabItem, Tabs, PackageManagers } from "~/components";
2121

2222
In this tutorial, you will put together a Cloudflare Worker that creates and serves a sitemap using data from [Sanity.io](https://www.sanity.io), a headless CMS.
2323

@@ -44,25 +44,7 @@ While you can create Workers in the Cloudflare dashboard, it is a best practice
4444

4545
Create a new Worker project using [C3](/pages/get-started/c3/) (`create-cloudflare` CLI):
4646

47-
<Tabs> <TabItem label="pnpm">
48-
49-
```sh
50-
pnpm create cloudflare@latest
51-
```
52-
53-
</TabItem> <TabItem label="npm">
54-
55-
```sh
56-
npm create cloudflare@latest
57-
```
58-
59-
</TabItem> <TabItem label="yarn">
60-
61-
```sh
62-
yarn create cloudflare
63-
```
64-
65-
</TabItem> </Tabs>
47+
<PackageManagers type="create" pkg="cloudflare@latest" />
6648

6749
In this tutorial, the Worker will be named `cms-sitemap`.
6850

src/content/docs/developer-spotlight/tutorials/creating-a-recommendation-api.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sidebar:
2222
order: 2
2323
---
2424

25-
import { Render, TabItem, Tabs } from "~/components";
25+
import { Render, TabItem, Tabs, PackageManagers } from "~/components";
2626

2727
E-commerce and media sites often work on increasing the average transaction value to boost profitability. One of the strategies to increase the average transaction value is "cross-selling," which involves recommending related products. Cloudflare offers a range of products designed to build mechanisms for retrieving data related to the products users are viewing or requesting. In this tutorial, you will experience developing functionalities necessary for cross-selling by creating APIs for related product searches and product recommendations.
2828

@@ -61,6 +61,12 @@ First, let's create a Cloudflare Workers project.
6161
To efficiently create and manage multiple APIs, let's use [`Hono`](https://hono.dev). Hono is an open-source application framework released by a Cloudflare Developer Advocate. It is lightweight and allows for the creation of multiple API paths, as well as efficient request and response handling.
6262
Open your command line interface (CLI) and run the following command:
6363

64+
<PackageManagers
65+
type="create"
66+
pkg="cloudflare@latest"
67+
args={"cross-sell-api --framework=hono"}
68+
/>
69+
6470
<Tabs> <TabItem label="npm">
6571

6672
```sh
@@ -210,8 +216,6 @@ index_name = "stripe-products"
210216

211217
Additionally, let's add the configuration to use Workers AI in `wrangler.toml`.
212218

213-
214-
215219
<WranglerConfig>
216220

217221
```toml null {9,10}

src/content/docs/turnstile/tutorials/protecting-your-payment-form-from-attackers-bots-using-turnstile.mdx

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sidebar:
2222
order: 2
2323
---
2424

25-
import { Render, TabItem, Tabs } from "~/components";
25+
import { Render, TabItem, Tabs, PackageManagers } from "~/components";
2626

2727
This tutorial shows how you can build a more secure payment form using Turnstile. You can learn how to block bot access on the checkout page and trigger additional authentication flows by integrating Turnstile with Stripe.
2828

@@ -49,25 +49,11 @@ To efficiently create and manage multiple APIs, let's use [`Hono`](https://hono.
4949

5050
Open your command line interface (CLI) and run the following command:
5151

52-
<Tabs> <TabItem label="npm">
53-
54-
```sh
55-
npm create cloudflare@latest secure-payment-form -- --framework hono
56-
```
57-
58-
</TabItem> <TabItem label="yarn">
59-
60-
```sh
61-
yarn create cloudflare secure-payment-form -- --framework hono
62-
```
63-
64-
</TabItem> <TabItem label="pnpm">
65-
66-
```sh
67-
pnpm create cloudflare@latest secure-payment-form -- --framework hono
68-
```
69-
70-
</TabItem> </Tabs>
52+
<PackageManagers
53+
type="create"
54+
pkg="cloudflare@latest"
55+
args={"secure-payment-form --framework=hono"}
56+
/>
7157

7258
If this is your first time running the `C3` command, you will be asked whether you want to install it. Confirm that the package name for installation is `create-cloudflare` and answer `y`.
7359

src/content/partials/workers/c3-run-command-no-directory.mdx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@
22
{}
33
---
44

5-
import { TabItem, Tabs } from "~/components";
5+
import { PackageManagers } from "~/components";
66

7-
<Tabs> <TabItem label="npm">
8-
9-
```sh
10-
npm create cloudflare@latest
11-
```
12-
13-
</TabItem>
14-
15-
<TabItem label="yarn">
16-
17-
```sh
18-
yarn create cloudflare
19-
```
20-
21-
</TabItem> </Tabs>
7+
<PackageManagers type="create" pkg="cloudflare@latest" />

0 commit comments

Comments
 (0)