You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
> -[Discovery Process and Open Issues](https://redwoodjs.com/docs/contributing#what-should-i-work-on)
16
16
17
17
_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)._
18
18
19
+
## Table of Contents
20
+
21
+
-[Code Organization: Project and Framework](#code-organization-project-and-framework)
22
+
-[Local Development Setup](#local-development-setup)
-[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
+
19
37
## Code Organization: Project and Framework
20
38
21
39
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
32
50
33
51
### Redwood Framework
34
52
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:
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:
47
67
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`
49
70
-`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
52
72
53
73
**Using the functional test project might be the fastest and easiest way to test your changes.**
54
74
55
75
#### Redwood Functional Test Project
56
76
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
58
84
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`.
64
88
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:**
66
90
67
91
> Besides `<project directory>`, `build:test-project` takes a few other options as well:
68
92
>
@@ -82,10 +106,6 @@ Run `yarn run build:test-project <project path>` from the root of your local cop
82
106
> yarn run build:test-project ~/my-repos/redwood-project --javascript --link
83
107
> ```
84
108
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
-
89
109
### Testing the Framework in Your Project
90
110
91
111
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
107
127
108
128
As `project:sync` starts up, it'll start logging to the console. In order, it:
109
129
110
-
<!-- Markdown numbers for us automatically -->
111
130
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
116
135
117
136
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`:
`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!
154
173
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.
158
177
159
178
## Cloud Developer Environment
160
179
@@ -168,19 +187,19 @@ This generates a functional test project and links it with the Redwood Framework
168
187
169
188
## Local QA and Integration Tests
170
189
171
-
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.
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.
172
191
173
192
### Build, Lint, Test, and Check
174
193
175
194
Within your Framework directory, use the following tools and commands to test your code:
176
195
177
196
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`
179
198
2.**Syntax and Formatting**: `yarn lint`
180
-
- to fix errors or warnings: `yarn lint:fix`
199
+
- to fix errors or warnings: `yarn lint:fix`
181
200
3.**Run unit tests for each package**: `yarn test`
182
201
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
184
203
185
204
### E2E Integration Tests
186
205
@@ -215,18 +234,8 @@ Most of the time your contribution to Redwood won't involve adding any new depen
215
234
216
235
## Yarn v3: Tips and Troubleshooting
217
236
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
220
238
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
230
239
**`yarn add --interactive`**
231
240
Reuse the specified package from other workspaces in the project. Example:
232
241
```
@@ -258,31 +267,13 @@ locked to different locators. They are a natural consequence of Yarn's
258
267
deterministic installs, but they can sometimes pile up and unnecessarily
259
268
increase the size of your project.
260
269
> 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).
- Reference from Babel project: https://github.com/babel/babel/blob/main/constraints.pro
267
276
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
-
286
277
#### New Files
287
278
288
279
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
301
292
- "Binary hoisting" is no longer allowed
302
293
- Specifying Yarn v1 binary (when necessary)
303
294
-`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
305
296
- how "postinstall" script works
306
297
307
298
# 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
310
301
311
302
## Option 1: Create a Gitpod Snapshot
312
303
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):
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.
320
311
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.
321
312
322
313
# Release Publishing
@@ -332,8 +323,8 @@ yarn rw upgrade --tag canary
332
323
333
324
For testing and QA purposes, Release Candidates (RCs) will be published prior to a GA release. The process is (will be) automated:
334
325
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`
337
328
338
329
The most recent RC packages can be used in Redwood Projects via the following command:
0 commit comments