Skip to content

Commit b4df497

Browse files
authored
Updated CONTRIBUTING.md with TOC & Readability Changes
Added TOC Added language about requiring a Fork to submit PRs. Restructured Functional Test Project section. Kept all info just moved things around. Updated Gitpod Starter repo link. Removed Yarn v1-3 upgrade information as of v0.37.
1 parent e798075 commit b4df497

File tree

1 file changed

+57
-66
lines changed

1 file changed

+57
-66
lines changed

CONTRIBUTING.md

+57-66
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to the Framework Packages (Reference Doc)
22

3-
Love Redwood and want to get involved? Youre in the right place!
3+
Love Redwood and want to get involved? You're in the right place!
44

55
> ⚡️ **Quick Links**
66
>
@@ -9,13 +9,31 @@ Love Redwood and want to get involved? You’re in the right place!
99
> 1. 🧭 [Overview and Orientation](https://redwoodjs.com/docs/contributing)
1010
> 2. 📓 **Reference: Contributing to the Framework Packages** (👈 you are here)
1111
> 3. 🪜 [Step-by-step Walkthrough](https://redwoodjs.com/docs/contributing-walkthrough) (including Video Recording)
12-
> 4. 📈 [Current Project Status: v1 Release Board](https://github.com/orgs/redwoodjs/projects/6)
12+
> 4. 📈 [Current Project Boards](https://github.com/orgs/redwoodjs/projects)
1313
> 5. 🤔 What should I work on?
1414
> - ["Help Wanted" v1 Triage Board](https://redwoodjs.com/good-first-issue)
1515
> - [Discovery Process and Open Issues](https://redwoodjs.com/docs/contributing#what-should-i-work-on)
1616
1717
_Before interacting with the Redwood community, please read and understand our [Code of Conduct](https://github.com/redwoodjs/redwood/blob/main/CODE_OF_CONDUCT.md)._
1818

19+
## Table of Contents
20+
21+
- [Code Organization: Project and Framework](#code-organization-project-and-framework)
22+
- [Local Development Setup](#local-development-setup)
23+
- [Redwood Framework](#redwood-framework)
24+
- [Redwood Project: Setup Options](#redwood-project-setup-options)
25+
- [Redwood Functional Test Project](#redwood-functional-test-project)
26+
- [Testing the Framework in Your Project](#testing-the-framework-in-your-project)
27+
- [Testing the CLI in Your Project](#testing-the-cli-in-your-project)
28+
- [Cloud Developer Environment](#cloud-developer-environment)
29+
- [Local QA and Integration Tests](#local-qa-and-integration-tests)
30+
- [Build, Lint, Test, and Check](#build-lint-test-and-check)
31+
- [E2E Integration Tests](#e2e-integration-tests)
32+
- [Troubleshooting Dependencies](#troubleshooting-dependencies)
33+
- [Yarn v3: Tips and Troubleshooting](#yarn-v3-tips-and-troubleshooting)
34+
- [Creating a Reproduction to Include with Issues](#creating-a-reproduction-to-include-with-issues)
35+
- [Release Publishing](#release-publishing)
36+
1937
## Code Organization: Project and Framework
2038

2139
As a Redwood developer, you're already familiar with the codebase created by `yarn create redwood-app`. In this document, we'll refer to that codebase as a **Redwood Project**.
@@ -32,10 +50,12 @@ Chances are that you'll have more than a few VS Codes open when you're contribut
3250

3351
### Redwood Framework
3452

35-
Use `git clone` to get a local copy of the Redwood Framework. If you've already got a local copy, make sure you've got the `main` branch's latest changes using `git pull`. Then run `yarn install` in the root directory to install the dependencies:
53+
To submit PRs, you will need to Fork the redwoodjs/redwood codebase. You can [do this from GitHub.com or by using GitHub Desktop.](https://docs.github.com/en/desktop/adding-and-cloning-repositories/cloning-and-forking-repositories-from-github-desktop#forking-a-repository) Use `git clone` on your fork to get a local copy of the Redwood Framework. If you've already got a local copy, make sure you've got the `main` branch's latest changes using `git pull`. Then run `yarn install` in the root directory to install the dependencies:
54+
55+
Replace `your-username` with your GitHub username below:
3656

3757
```terminal
38-
git clone https://github.com/redwoodjs/redwood.git
58+
git clone https://github.com/your-username/redwood.git
3959
cd redwood
4060
corepack enable
4161
yarn install
@@ -45,24 +65,28 @@ yarn install
4565

4666
You'll almost always want to test the functionality of your changes to the Redwood Framework in a Redwood Project. When it comes to getting a Redwood Project to test your changes out in, you have several options:
4767

48-
- run `yarn create redwood-app ./redwood-project`
68+
- [***Recommended for 90% of cases***] Create a functional test project. See section below for steps.
69+
- Run `yarn create redwood-app ./redwood-project`
4970
- `git clone` the [RedwoodJS Tutorial Blog](https://github.com/redwoodjs/redwood-tutorial)
50-
- use a project you've already created
51-
- create a functional test project: go to the location of your local copy of the Redwood Framework and use `yarn run build:test-project <project directory>` 👀
71+
- Use a project you've already created
5272

5373
**Using the functional test project might be the fastest and easiest way to test your changes.**
5474

5575
#### Redwood Functional Test Project
5676

57-
You can create a Redwood Project that contains a lot of functionality in just a few minutes. For example, here's a brief overview of all the things `yarn run build:test-project <project directory>` does. It...
77+
Run `yarn run build:test-project <project directory>` from the root of your local copy of the Redwood Framework to create a functional test project. In just a few minutes, this will create a Redwood Project on the current canary (optional: `latest` stable) that contains a lot of functionality. For example, here's a brief overview of all the things `yarn run build:test-project <project directory>` does:
78+
79+
1. It installs using the `create-redwood-app` template in the current branch of your Redwood Framework
80+
2. It uses the current `canary` version of Redwood Packages (with the option to use the `latest` stable version)
81+
3. It has a TypeScript language target (with the option for JavaScript)
82+
4. It applies code mods from the [Redwood tutorial](https://redwoodjs.com/tutorial) to add functionality and styling
83+
5. It initializes a Prisma DB migration for SQLite
5884

59-
1. installs using the `create-redwood-app` template in the current branch of your Redwood Framework
60-
2. with the current `canary` version of Redwood Packages (with the option to use the `latest` stable version)
61-
3. with a TypeScript language target (with the option for JavaScript)
62-
4. then applies code mods from the [Redwood tutorial](https://redwoodjs.com/tutorial) to add functionality and styling
63-
5. and initializes a Prisma DB migration for SQLite
85+
Unless you've already got a project with a lot of functionality, it'd take quite some effort to add all of this yourself. Moreover, testing your changes in a project that has a lot of functionality will increase your confidence in the changes you're making.
86+
87+
But how do you actually test your changes in the Redwood Framework in your Redwood Project? With another command, this time in the root of your Redwood Project: `yarn rwfw`.
6488

65-
Run `yarn run build:test-project <project path>` from the root of your local copy of the Redwood Framework to create a functional test project.
89+
**Test Project CLI Options:**
6690

6791
> Besides `<project directory>`, `build:test-project` takes a few other options as well:
6892
>
@@ -82,10 +106,6 @@ Run `yarn run build:test-project <project path>` from the root of your local cop
82106
> yarn run build:test-project ~/my-repos/redwood-project --javascript --link
83107
> ```
84108
85-
Unless you've already got a project with a lot of functionality, it'd take quite some effort to add all of this yourself. Moreover, testing your changes in a project that has a lot of functionality will increase your confidence in the changes you're making.
86-
87-
But how do you actually test your changes in the Redwood Framework in your Redwood Project? With another command, this time in the root of your Redwood Project: `yarn rwfw`.
88-
89109
### Testing the Framework in Your Project
90110
91111
As you make changes to the Redwood Framework, you'll want to see your changes reflected "live" in a Redwood Project. Since we're always looking for ways to make contributing to Redwood easier, there are a few workflows we've come up with. The one you'll want to use is `yarn rwfw`.
@@ -107,12 +127,11 @@ Where `~/redwood` is the path to your local copy of the Redwood Framework. Once
107127

108128
As `project:sync` starts up, it'll start logging to the console. In order, it:
109129

110-
<!-- Markdown numbers for us automatically -->
111130
1. cleans and builds the framework
112-
1. copies the framework's dependencies to your project
113-
1. runs `yarn install` in your project
114-
1. copies over the framework's packages to your project
115-
1. waits for changes
131+
2. copies the framework's dependencies to your project
132+
3. runs `yarn install` in your project
133+
4. copies over the framework's packages to your project
134+
5. waits for changes
116135

117136
Step two is the only explicit change you'll see to your project. You'll see that a ton of packages have been added to your project's root `package.json`:
118137

@@ -152,9 +171,9 @@ yarn dev <cli command> --cwd <project directory>
152171

153172
`yarn dev` runs the CLI and `--cwd` makes the command run in your Redwood Project. If you make a change to the code, remember to rebuild the packages!
154173

155-
> Tip: You can use `yarn build:watch` to automatically build the framework whilst you're making changes.
156-
>
157-
> Tip 2: --cwd is optional, it will reference the `__fixtures__/example-todo-main` project in the framework.
174+
> Tips:
175+
> - You can use `yarn build:watch` to automatically build the framework whilst you're making changes.
176+
> - `--cwd` is optional, it will reference the `__fixtures__/example-todo-main` project in the framework.
158177
159178
## Cloud Developer Environment
160179

@@ -168,19 +187,19 @@ This generates a functional test project and links it with the Redwood Framework
168187

169188
## Local QA and Integration Tests
170189

171-
All of these checks are included in Redwoods GitHub PR Continuous Integration (CI) automation. But its good practice to understand what they do by using them locally too. The E2E tests arent something we use every time anymore (because it takes a while), but you should learn how to use it because it comes in handy when your code is failing tests on GitHub and you need to diagnose.
190+
All of these checks are included in Redwood's GitHub PR Continuous Integration (CI) automation. But it's good practice to understand what they do by using them locally too. The E2E tests aren't something we use every time anymore (because it takes a while), but you should learn how to use it because it comes in handy when your code is failing tests on GitHub and you need to diagnose.
172191

173192
### Build, Lint, Test, and Check
174193

175194
Within your Framework directory, use the following tools and commands to test your code:
176195

177196
1. **Build the packages**: `yarn build`
178-
- to delete all previous build directories: `yarn build:clean`
197+
- to delete all previous build directories: `yarn build:clean`
179198
2. **Syntax and Formatting**: `yarn lint`
180-
- to fix errors or warnings: `yarn lint:fix`
199+
- to fix errors or warnings: `yarn lint:fix`
181200
3. **Run unit tests for each package**: `yarn test`
182201
4. **Check Yarn resolutions and package.json format**: `yarn check`
183-
- includes yarn dedupe, constraints, and package.json formatter
202+
- includes yarn dedupe, constraints, and package.json formatter
184203

185204
### E2E Integration Tests
186205

@@ -215,18 +234,8 @@ Most of the time your contribution to Redwood won't involve adding any new depen
215234

216235
## Yarn v3: Tips and Troubleshooting
217236

218-
### Migrating from yarn v1 to yarn v3
219-
As of `v0.37`, the Redwood Framework has moved from yarn `v1` to yarn `v3`.
237+
### Yarn Commands and Utilities
220238

221-
If you already have a local copy of the Redwood Framework, or if you're switching between branches that are using different versions, **you'll have to run**:
222-
```
223-
git clean -fxd -e .env
224-
yarn install
225-
```
226-
...and then you'll be good to go.
227-
228-
> Note: Yarn v3 is installed in the directory, while Yarn v1 is installed globally. This allows us to switch as needed per branch and/or project.
229-
### New Yarn Commands and Utilities
230239
**`yarn add --interactive`**
231240
Reuse the specified package from other workspaces in the project. Example:
232241
```
@@ -258,31 +267,13 @@ locked to different locators. They are a natural consequence of Yarn's
258267
deterministic installs, but they can sometimes pile up and unnecessarily
259268
increase the size of your project.
260269
> This command dedupes dependencies in the current project using different
261-
strategies (only one is implemented at the moment):
270+
strategies (only one is implemented at the moment).
262271

263272
**`yarn constraints`**
264273
See new file `constraints.pro` for repo config
265-
- https://yarnpkg.com/features/constraints
274+
- [Yarn Constraints](https://yarnpkg.com/features/constraints)
266275
- Reference from Babel project: https://github.com/babel/babel/blob/main/constraints.pro
267276

268-
### About Yarn v3
269-
Aside from a few plugins, we aren't using most of it's advanced features (like [PnP](https://yarnpkg.com/features/pnp)) yet.
270-
271-
So besides the output in your terminal looking different, not much else is.
272-
273-
> We may explore things like PnP in the future.
274-
> We just have to take things one step at a time since we're trying to release `v1`.
275-
#### Benefits
276-
277-
Some of the benefit yarn `v3` brings us as we prepare for `v1` are:
278-
279-
- faster CI (up to 50% faster)
280-
- most importantly, no more Windows timeouts!
281-
- faster yarn installs
282-
- better dependency guarantees
283-
284-
One of the most significant changes in yarn `v3` is it's stance on [hoisting](https://yarnpkg.com/advanced/lexicon/#hoisting).
285-
286277
#### New Files
287278

288279
Yarn `v3` keeps more of itself in the repo than before.
@@ -301,7 +292,7 @@ If needed, there's more information in [this PR #3154 comment](https://github.co
301292
- "Binary hoisting" is no longer allowed
302293
- Specifying Yarn v1 binary (when necessary)
303294
- `yarn dlx`
304-
- Set `YARN_IGNORE_PATH=1` to ignore local yarn version settings.
295+
- Set `YARN_IGNORE_PATH=1` to ignore local yarn version settings
305296
- how "postinstall" script works
306297

307298
# Creating a Reproduction to Include with Issues
@@ -310,13 +301,13 @@ Are you about to open an issue? Including a reproduction, either as a series of
310301

311302
## Option 1: Create a Gitpod Snapshot
312303

313-
This is a great option when the issue you're reporting is cross-platform. I.e., it isn't a Windows-specific issue. Here's a video walkthrough on how to create a snapshot of the [Redwood-Gitpod starter repo](https://github.com/redwoodjs/gitpod-starter):
304+
This is a great option when the issue you're reporting is cross-platform. I.e., it isn't a Windows-specific issue. Here's a video walkthrough on how to create a snapshot of the [Redwood-Gitpod starter repo](https://github.com/redwoodjs/starter):
314305

315306
https://user-images.githubusercontent.com/1521877/176033049-d3c57b92-3ee6-4c60-918b-fdbcfa83fd0f.mp4
316307

317308
## Option 2: Fork the Starter Repo
318309

319-
You can always fork the [Redwood-Gitpod starter repo](https://github.com/redwoodjs/gitpod-starter) which is a brand new project with the latest stable version of Redwood.
310+
You can always fork the [Redwood-Gitpod starter repo](https://github.com/redwoodjs/starter) which is a brand new project with the latest stable version of Redwood.
320311
Once you make your changes in your fork, include the link to your repo in your issue. This'll make it much easier for us to understand what's going on.
321312

322313
# Release Publishing
@@ -332,8 +323,8 @@ yarn rw upgrade --tag canary
332323

333324
For testing and QA purposes, Release Candidates (RCs) will be published prior to a GA release. The process is (will be) automated:
334325

335-
1. a release branch is created from `main`, e.g. `release/minor/v1.2.0`
336-
2. once published, any commits to the release branch will trigger automatic publishing of an RC, e.g. `v1.2.0-rc.1`
326+
1. A release branch is created from `main`, e.g. `release/minor/v1.2.0`
327+
2. Once published, any commits to the release branch will trigger automatic publishing of an RC, e.g. `v1.2.0-rc.1`
337328

338329
The most recent RC packages can be used in Redwood Projects via the following command:
339330

0 commit comments

Comments
 (0)