Skip to content

Commit 54e3d13

Browse files
[Workers] Lerna revision (cloudflare#2429)
* [Workers] Lerna revision * removing 'can' language * Apply suggestions from code review Pedro's suggestions Co-authored-by: Pedro Sousa <[email protected]> * Update products/workers/src/content/tutorials/manage-projects-with-lerna/index.md Co-authored-by: Pedro Sousa <[email protected]>
1 parent becdc0d commit 54e3d13

File tree

1 file changed

+7
-7
lines changed
  • products/workers/src/content/tutorials/manage-projects-with-lerna

1 file changed

+7
-7
lines changed

products/workers/src/content/tutorials/manage-projects-with-lerna/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import TutorialsBeforeYouStart from "../../_partials/_tutorials-before-you-start
1313

1414
## Overview
1515

16-
Using [`lerna`](https://github.com/lerna/lerna), a tool for managing multiple JavaScript codebases inside a single "monorepo", developers can work with multiple Wrangler projects and share dependencies between them. If your codebase is already managed with `lerna`, you can also add a new Wrangler project into your existing monorepo without disrupting your workflow.
16+
Using [`lerna`](https://github.com/lerna/lerna), a tool for managing multiple JavaScript codebases inside a single monorepo, developers can work with multiple Wrangler projects and share dependencies between them. If your codebase is already managed with `lerna`, you can also add a new Wrangler project into your existing monorepo without disrupting your workflow.
1717

1818
Begin by installing `lerna`, and creating a new project in the folder `workers-monorepo`:
1919

@@ -40,7 +40,7 @@ $ wrangler generate my-site --site
4040
$ git clone https://github.com/cloudflare/worker-template.git
4141
```
4242

43-
This approach to managing your Workers projects can become incredibly powerful when you begin to share dependencies between the projects. Imagine that your codebase has a pre-defined set of API handlers that you want to re-use between our public and private APIs, in the packages `public-api` and `private-api`:
43+
This approach to managing your Workers projects can become incredibly powerful when you begin to share dependencies between projects. Imagine that your codebase has a pre-defined set of API handlers that you want to reuse between your public and private APIs, in the packages `public-api` and `private-api`:
4444

4545
```sh
4646
---
@@ -51,7 +51,7 @@ $ wrangler generate public-api
5151
$ wrangler generate private-api
5252
```
5353

54-
Adjacent to your API projects, you can create a new package `handlers`, which can be imported into each project:
54+
Next to your API projects, create a new package `handlers`, which can be imported into each project:
5555

5656
```sh
5757
---
@@ -71,7 +71,7 @@ filename: packages/public-api/package.json
7171
}
7272
```
7373

74-
Using the `bootstrap` command, you can link the packages together and use them inside of your code:
74+
Link the packages together using the `bootstrap` command and use them inside of your code:
7575

7676
```sh
7777
---
@@ -92,9 +92,9 @@ const handler = request => {
9292
}
9393
```
9494

95-
After adding an identical `dependency` to `private-api/package.json`, you can run `lerna bootstrap` again, and begin sharing code between your projects.
95+
After adding an identical `dependency` to `private-api/package.json`, run `lerna bootstrap` again, and begin sharing code between your projects.
9696

97-
When you’re ready to deploy your codebases, you can coordinate deploying them simultaneously by defining scripts in each package’s `package.json` file, that can be read by `lerna run`:
97+
When you are ready to deploy your codebases, define a script in each package’s `package.json` file (for example, `publish`), so that you can later deploy both codebases in a coordinated manner using the command `lerna run <SCRIPT_NAME>`:
9898

9999
```json
100100
---
@@ -144,4 +144,4 @@ lerna success - public-api
144144
lerna success - private-api
145145
```
146146

147-
If you’d like to explore an example repository, check out the accompanying open-source codebase on [GitHub](https://github.com/signalnerve/lerna-wrangler-monorepo-example) for this tutorial.
147+
If you would like to review an example repository, refer to the accompanying open-source codebase on [GitHub](https://github.com/signalnerve/lerna-wrangler-monorepo-example) for this tutorial.

0 commit comments

Comments
 (0)