Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into feat/ts-stri…
Browse files Browse the repository at this point in the history
…ctmode-gen

* 'main' of github.com:redwoodjs/redwood: (24 commits)
  fix: enable `windowsHide` for Windows OSes (redwoodjs#5734)
  Simplify check (redwoodjs#5746)
  Version docs to 2.0
  Update all contributors
  v2.0.0
  fix(deps): update graphqlcodegenerator monorepo (redwoodjs#5772)
  fix(deps): update storybook monorepo to v6.5.9 (redwoodjs#5770)
  fix(deps): update dependency core-js to v3.23.1 (redwoodjs#5771)
  fix(deps): update dependency @apollo/client to v3.6.8 (redwoodjs#5769)
  Correct a few spelling mistakes (redwoodjs#5747)
  docs: yet another set of single byte typo squashing (redwoodjs#5749)
  docs: GraphQL Yoga's playground, not Apollo Server's (redwoodjs#5741)
  docs(graphql): replaced outdated mentions to Apollo Server (redwoodjs#5768)
  Update routing-params.md (redwoodjs#5706)
  fixing typo (redwoodjs#5699)
  fix: RedwoodLogger -- Mask errors, but include stack trace in formatter (redwoodjs#5704)
  Lint fix some template files (redwoodjs#5766)
  fix: RedwoodLogger -- Mask errors, but include stack trace in formatter (redwoodjs#5704)
  Lint fix some template files (redwoodjs#5766)
  docs: adding precisions and fixes to contributing (redwoodjs#5760)
  ...
  • Loading branch information
dac09 committed Jun 20, 2022
2 parents e3702e6 + 33f8b16 commit 57a5527
Show file tree
Hide file tree
Showing 148 changed files with 35,521 additions and 682 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,37 @@ And there you have it.
</tr>
<tr>
<td align="center"><a href="https://fabiolazzaroni.dev/"><img src="https://avatars.githubusercontent.com/u/15056746?v=4" width="100px;" alt=""/><br /><sub><b>Fabio Lazzaroni</b></sub></a></td>
<td align="center"><a href="https://github.com/rushabhhere"><img src="https://avatars.githubusercontent.com/u/73743535?v=4" width="100px;" alt=""/><br /><sub><b>Rushabh Javeri</b></sub></a></td>
<td align="center"><a href="https://github.com/andershagbard"><img src="https://avatars.githubusercontent.com/u/9662430?v=4" width="100px;" alt=""/><br /><sub><b>Anders Søgaard</b></sub></a></td>
<td align="center"><a href="https://github.com/kunalarya"><img src="https://avatars.githubusercontent.com/u/1680103?v=4" width="100px;" alt=""/><br /><sub><b>kunalarya</b></sub></a></td>
<td align="center"><a href="https://github.com/alephao"><img src="https://avatars.githubusercontent.com/u/7674479?v=4" width="100px;" alt=""/><br /><sub><b>Aleph Retamal</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/AlonHor"><img src="https://avatars.githubusercontent.com/u/57628667?v=4" width="100px;" alt=""/><br /><sub><b>Alon</b></sub></a></td>
<td align="center"><a href="https://ionoid.io/"><img src="https://avatars.githubusercontent.com/u/1108370?v=4" width="100px;" alt=""/><br /><sub><b>Bouzid Badreddine</b></sub></a></td>
<td align="center"><a href="https://charlypoly.com/"><img src="https://avatars.githubusercontent.com/u/1252066?v=4" width="100px;" alt=""/><br /><sub><b>Charly POLY</b></sub></a></td>
<td align="center"><a href="https://github.com/MrGuiMan"><img src="https://avatars.githubusercontent.com/u/3082385?v=4" width="100px;" alt=""/><br /><sub><b>Guillaume Mantopoulos</b></sub></a></td>
<td align="center"><a href="https://github.com/jaaneh"><img src="https://avatars.githubusercontent.com/u/27323317?v=4" width="100px;" alt=""/><br /><sub><b>Jan Henning</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="http://oberschweiber.com/"><img src="https://avatars.githubusercontent.com/u/19388?v=4" width="100px;" alt=""/><br /><sub><b>Jonas Oberschweiber</b></sub></a></td>
<td align="center"><a href="https://jordanrolph.com/"><img src="https://avatars.githubusercontent.com/u/28222941?v=4" width="100px;" alt=""/><br /><sub><b>Jordan Rolph</b></sub></a></td>
<td align="center"><a href="https://github.com/jorgepvenegas"><img src="https://avatars.githubusercontent.com/u/2190603?v=4" width="100px;" alt=""/><br /><sub><b>Jorge Venegas</b></sub></a></td>
<td align="center"><a href="https://github.com/razzeee"><img src="https://avatars.githubusercontent.com/u/5943908?v=4" width="100px;" alt=""/><br /><sub><b>Kolja Lampe</b></sub></a></td>
<td align="center"><a href="https://github.com/Leon-Sam"><img src="https://avatars.githubusercontent.com/u/18523441?v=4" width="100px;" alt=""/><br /><sub><b>Leon</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Masvoras"><img src="https://avatars.githubusercontent.com/u/58081001?v=4" width="100px;" alt=""/><br /><sub><b>Masvoras</b></sub></a></td>
<td align="center"><a href="https://minho42.com/"><img src="https://avatars.githubusercontent.com/u/15278512?v=4" width="100px;" alt=""/><br /><sub><b>Min ho Kim</b></sub></a></td>
<td align="center"><a href="https://github.com/fangpinsern"><img src="https://avatars.githubusercontent.com/u/52379442?v=4" width="100px;" alt=""/><br /><sub><b>Pin Sern</b></sub></a></td>
<td align="center"><a href="https://click.ecc.ac.jp/ecc/rokazaki/"><img src="https://avatars.githubusercontent.com/u/70571576?v=4" width="100px;" alt=""/><br /><sub><b>RUI OKAZAKI</b></sub></a></td>
<td align="center"><a href="https://github.com/Gombeng"><img src="https://avatars.githubusercontent.com/u/57914770?v=4" width="100px;" alt=""/><br /><sub><b>Syahrizal Ardana</b></sub></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/craineum"><img src="https://avatars.githubusercontent.com/u/2641685?v=4" width="100px;" alt=""/><br /><sub><b>craineum</b></sub></a></td>
<td align="center"><a href="https://github.com/gtarsia"><img src="https://avatars.githubusercontent.com/u/4072352?v=4" width="100px;" alt=""/><br /><sub><b>hello there</b></sub></a></td>
<td align="center"><a href="https://github.com/mattdriscoll"><img src="https://avatars.githubusercontent.com/u/16880374?v=4" width="100px;" alt=""/><br /><sub><b>Matt Driscoll</b></sub></a></td>
<td align="center"><a href="http://paikwiki.github.io/"><img src="https://avatars.githubusercontent.com/u/4120850?v=4" width="100px;" alt=""/><br /><sub><b>paikwiki</b></sub></a></td>
</tr>
</table>

Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/test-project/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"dependencies": {
"@redwoodjs/api": "1.5.2",
"@redwoodjs/graphql-server": "1.5.2"
"@redwoodjs/api": "2.0.0",
"@redwoodjs/graphql-server": "2.0.0"
}
}
8 changes: 4 additions & 4 deletions __fixtures__/test-project/api/src/functions/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export const handler = async (event, context) => {

const resetPasswordOptions = {
// handler() is invoked after the password has been successfully updated in
// the database. Returning anything truthy will automatically logs the user
// the database. Returning anything truthy will automatically log the user
// in. Return `false` otherwise, and in the Reset Password page redirect the
// user to the login page.
handler: (user) => {
return user
},

// If `false` then the new password MUST be different than the current one
// If `false` then the new password MUST be different from the current one
allowReusedPassword: true,

errors: {
Expand Down Expand Up @@ -125,7 +125,7 @@ export const handler = async (event, context) => {
db: db,

// The name of the property you'd call on `db` to access your user table.
// ie. if your Prisma model is named `User` this value would be `user`, as in `db.user`
// i.e. if your Prisma model is named `User` this value would be `user`, as in `db.user`
authModelAccessor: 'user',

// A map of what dbAuth calls a field to what your database calls it.
Expand All @@ -146,7 +146,7 @@ export const handler = async (event, context) => {
HttpOnly: true,
Path: '/',
SameSite: 'Strict',
Secure: process.env.NODE_ENV !== 'development' ? true : false,
Secure: process.env.NODE_ENV !== 'development',

// If you need to allow other domains (besides the api side) access to
// the dbAuth session cookie:
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
]
},
"devDependencies": {
"@redwoodjs/core": "1.5.2"
"@redwoodjs/core": "2.0.0"
},
"eslintConfig": {
"extends": "@redwoodjs/eslint-config",
Expand Down
8 changes: 4 additions & 4 deletions __fixtures__/test-project/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
]
},
"dependencies": {
"@redwoodjs/auth": "1.5.2",
"@redwoodjs/forms": "1.5.2",
"@redwoodjs/router": "1.5.2",
"@redwoodjs/web": "1.5.2",
"@redwoodjs/auth": "2.0.0",
"@redwoodjs/forms": "2.0.0",
"@redwoodjs/router": "2.0.0",
"@redwoodjs/web": "2.0.0",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/connection-pooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To use Prisma Client with PgBouncer from a serverless function, add the `?pgboun
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?pgbouncer=true
```

Typically, your PgBouncer port will be 6543 which is different than the Postgres default of 5432.
Typically, your PgBouncer port will be 6543 which is different from the Postgres default of 5432.

> Note that since Prisma Migrate uses database transactions to check out the current state of the database and the migrations table, if you attempt to run Prisma Migrate commands in any environment that uses PgBouncer for connection pooling, you might see an error.
>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/contributing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ What you want to do not on the roadmap? Well, still go for it! We love spikes an
|[`@redwoodjs/graphql-server`](https://github.com/redwoodjs/redwood/blob/main/packages/graphql-server/README.md)|Exposes functions to build the GraphQL API, provides services with `context`, and a set of envelop plugins to supercharge your GraphQL API with logging, authentication, error handling, directives and more|
|[`@redwoodjs/internal`](https://github.com/redwoodjs/redwood/blob/main/packages/internal/README.md)|Provides tooling to parse Redwood configs and get a project's paths|
|[`@redwoodjs/prerender`](https://github.com/redwoodjs/redwood/blob/main/packages/prerender/README.md)|Defines functionality for prerendering static content|
|[`@redwoodjs/record`](https://github.com/redwoodjs/redwood/blob/main/packages/record/README.md)|ORM bult on top of Prisma. It may be extended in the future to wrap other database access packages|
|[`@redwoodjs/record`](https://github.com/redwoodjs/redwood/blob/main/packages/record/README.md)|ORM built on top of Prisma. It may be extended in the future to wrap other database access packages|
|[`@redwoodjs/router`](https://github.com/redwoodjs/redwood/blob/main/packages/router/README.md)|The built-in router for Redwood|
|[`@redwoodjs/structure`](https://github.com/redwoodjs/redwood/blob/main/packages/structure/README.md)|Provides a way to build, validate and inspect an object graph that represents a complete Redwood project|
|[`@redwoodjs/telemetry`](https://github.com/redwoodjs/redwood/blob/main/packages/telemetry/README.md)|Provides functionality for anonymous data collection|
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/contributing-walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ This has quickly become the de facto editor for JavaScript and TypeScript. Addit

**GitHub Desktop**
[Download GitHub Desktop](https://desktop.github.com)
You’ll need to be comfortable using Git at the command line. But the thing ew like best about GitHub Desktop is how easy it makes workflow across GitHub -- GitHub Desktop -- VS Code. You don’t have to worry about syncing permissions or finding things. You can start from a repo on GitHub.com and use Desktop to do everything from “clone and open on your computer” to returning back to the site to “open a PR on GitHub”.
You’ll need to be comfortable using Git at the command line. But the thing we like best about GitHub Desktop is how easy it makes workflow across GitHub -- GitHub Desktop -- VS Code. You don’t have to worry about syncing permissions or finding things. You can start from a repo on GitHub.com and use Desktop to do everything from “clone and open on your computer” to returning back to the site to “open a PR on GitHub”.

**[Mac OS] iTerm and Oh-My-Zsh**
There’s nothing wrong with Terminal (on Mac) and bash. (If you’re on Windows, we highly recommend using Git for Windows and Git bash.) But we enjoy using iTerm ([download](https://iterm2.com)) and Zsh much more (use [Oh My Zsh](https://ohmyz.sh)). Heads up, you can get lost in the world of theming and adding plugins. We recommend keeping it simple for awhile before taking the customization deep dive
😉
There’s nothing wrong with Terminal (on Mac) and plain zsh or bash. (If you’re on Windows, we highly recommend using Git for Windows and Git bash.) But we enjoy using iTerm2 ([download](https://iterm2.com)) and zsh much more (combined with [Oh My Zsh](https://ohmyz.sh)). Heads up, you can get lost in the world of theming and adding plugins. We recommend keeping it simple for awhile before taking the customization deep dive
😉.

**[Windows] Git for Windows with Git Bash or WSL(2)**
Unfortunately, there are a lot of “gotchas” when it comes to working with Javascript-based frameworks on Windows. We do our best to point out (and resolve) issues, but our priority focus is on developing a Redwood app vs contributing to the Framework. (If you’re interested, there’s a lengthy Forum conversation about this with many suggestions.)
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ Note that if you don't import `RedwoodApolloProvider`, it won't be included in y

### Understanding Default Resolvers

According to the spec, for every field in your sdl, there has to be a resolver in your Services. But you'll usually see fewer resolvers in your Services than you technically should. And that's because if you don't define a resolver, [Apollo Server will](https://www.apollographql.com/docs/apollo-server/data/resolvers/#default-resolvers).
According to the spec, for every field in your sdl, there has to be a resolver in your Services. But you'll usually see fewer resolvers in your Services than you technically should. And that's because if you don't define a resolver, GraphQL Yoga server will.

The key question Apollo Server asks is: "Does the parent argument (in Redwood apps, the `parent` argument is named `root`&mdash;see [Redwood's Resolver Args](#redwoods-resolver-args)) have a property with this resolver's exact name?" Most of the time, especially with Prisma Client's ergonomic returns, the answer is yes.
The key question the Yoga server asks is: "Does the parent argument (in Redwood apps, the `parent` argument is named `root`&mdash;see [Redwood's Resolver Args](#redwoods-resolver-args)) have a property with this resolver's exact name?" Most of the time, especially with Prisma Client's ergonomic returns, the answer is yes.

Let's walk through an example. Say our sdl looks like this:

Expand Down Expand Up @@ -161,7 +161,7 @@ export const users = () => {
Which begs the question: where are the resolvers for the User fields&mdash;`id`, `email`, and `name`?
All we have is the resolver for the Query field, `users`.
As we just mentioned, Apollo defines them for you. And since the `root` argument for `id`, `email`, and `name` has a property with each resolvers' exact name (i.e. `root.id`, `root.email`, `root.name`), it'll return the property's value (instead of returning `undefined`, which is what Apollo would do if that weren't the case).
As we just mentioned, GraphQL Yoga defines them for you. And since the `root` argument for `id`, `email`, and `name` has a property with each resolvers' exact name (i.e. `root.id`, `root.email`, `root.name`), it'll return the property's value (instead of returning `undefined`, which is what Yoga would do if that weren't the case).
But, if you wanted to be explicit about it, this is what it would look like:
Expand Down Expand Up @@ -221,7 +221,7 @@ Of the four, you'll see `args` and `root` being used a lot.
> **There's so many terms!**
>
> Half the battle here is really just coming to terms. To keep your head from spinning, keep in mind that everybody tends to rename `obj` to something else: Redwood calls it `root`, Apollo calls it `parent`. `obj` isn't exactly the most descriptive name in the world.
> Half the battle here is really just coming to terms. To keep your head from spinning, keep in mind that everybody tends to rename `obj` to something else: Redwood calls it `root`, GraphQL Yoga calls it `parent`. `obj` isn't exactly the most descriptive name in the world.
### Context
Expand Down Expand Up @@ -1017,7 +1017,7 @@ export const handler = createGraphQLHandler({
#### Redwood Errors
Redwood Errors are derived from [Apollo Server Error codes](https://www.apollographql.com/docs/apollo-server/data/errors/#error-codes) for common use cases:
Redwood Errors are inspired from [Apollo Server Error codes](https://www.apollographql.com/docs/apollo-server/data/errors/#error-codes) for common use cases:
To use a Redwood Error, import each from `@redwoodjs/graphql-server`.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/how-to/sending-emails.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Now is a good time to go get a fresh cup of coffee, or other beverage of choice.

## SendInBlue

To actually send an email you need a mail server that you can talk to using SMTP. `nodemailer` has a really [simple example](https://nodemailer.com/about/#example) on their webpage that uses Ethereal. But that's only for test messages. The emails will never actually be delivered beyond Ethereal. Another option is to use your own GMail address (if you have one). But to get that working reliably you need to set up Oauth2, which isn't very straight forward. So your best bet here is actually to use a dedicated Cloud/SaaS solution. A lot of them have a free tier that lets you send enough emails for a small production app. We'll be using SendInBlue that offers 300 free emails per day.
To actually send an email you need a mail server that you can talk to using SMTP. `nodemailer` has a really [simple example](https://nodemailer.com/about/#example) on their webpage that uses Ethereal. But that's only for test messages. The emails will never actually be delivered beyond Ethereal. Another option is to use your own GMail address (if you have one). But to get that working reliably you need to set up OAuth2, which isn't very straight forward. So your best bet here is actually to use a dedicated Cloud/SaaS solution. A lot of them have a free tier that lets you send enough emails for a small production app. We'll be using SendInBlue that offers 300 free emails per day.

So go ahead and create an account with SendInBlue. They'll ask for an address and a phone number. They need it to prevent users from creating accounts to send spam emails from. When your account is created and set up you need to click on the menu in the upper right with your company name and select the "SMTP & API" option.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/how-to/supabase-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ So, just this once, I hereby give you permission to fire-up Create React App as
>
> If you're like me—and I'm pretty sure I'm just human—you may find yourself spinning in jumbled auth jargon. Hang in there, you'll get your auth ducks lined up eventually.
>
> I'm proud to tell you that I now know that the Redwood Supabase auth client wraps the Supabase GoTrueJS client, which is a fork of Netlify’s GoTrueJS client (which is different than Netlify Identity). And dbAuth is a totally separate auth option. Plus, I'll keep it simple and not use RBAC at the moment.
> I'm proud to tell you that I now know that the Redwood Supabase auth client wraps the Supabase GoTrueJS client, which is a fork of Netlify’s GoTrueJS client (which is different from Netlify Identity). And dbAuth is a totally separate auth option. Plus, I'll keep it simple and not use RBAC at the moment.
>
> Ahhh! It took me a few weeks to figure this out.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ Two situations make testing Cells unique:
1. A single Cell can export up to four separate components
2. There's a GraphQL query taking place

The first situation is really no different than regular component testing: you just test more than one component in your test. For example:
The first situation is really no different from regular component testing: you just test more than one component in your test. For example:

```jsx title="web/src/components/ArticleCell/ArticleCell.js"
import Article from 'src/components/Article'
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorial/chapter3/saving-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Before we plug this into the UI, let's take a look at a nifty GUI you get just b

Often it's nice to experiment and call your API in a more "raw" form before you get too far down the path of implementation only to find out something is missing. Is there a typo in the API layer or the web layer? Let's find out by accessing just the API layer.

When you started development with `yarn redwood dev` (or `yarn rw dev`) you actually started a second process running at the same time. Open a new browser tab and head to [http://localhost:8911/graphql](http://localhost:8911/graphql) This is Apollo Server's [GraphQL Playground](https://www.apollographql.com/docs/apollo-server/testing/graphql-playground/), a web-based GUI for GraphQL APIs:
When you started development with `yarn redwood dev` (or `yarn rw dev`) you actually started a second process running at the same time. Open a new browser tab and head to [http://localhost:8911/graphql](http://localhost:8911/graphql) This is GraphQL Yoga's [GraphiQL](https://www.graphql-yoga.com/docs/features/graphiql), a web-based GUI for GraphQL APIs:

<img width="1410" alt="image" src="https://user-images.githubusercontent.com/32992335/161488164-37663b8a-0bfa-4d52-8312-8cfaac7c2915.png" />

Expand Down

0 comments on commit 57a5527

Please sign in to comment.