Skip to content

Commit

Permalink
Merge branch 'main' into rc-webauthn
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/api/package.json
#	packages/auth/package.json
#	yarn.lock
  • Loading branch information
cannikin committed Jul 18, 2022
2 parents e91eb6e + e094cf2 commit b719e91
Show file tree
Hide file tree
Showing 194 changed files with 39,326 additions and 3,246 deletions.
2 changes: 1 addition & 1 deletion .github/actions/message_slack_publishing/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
steps:
- name: Get status emoji
id: get-status-emoji
uses: sergeysova/jq-action@v2.1.0
uses: sergeysova/jq-action@v2.2.1
with:
cmd: 'echo "{ \"success\": \"✅\", \"failure\": \"🚨\" }" | jq .${{ inputs.status }} -r'

Expand Down
4 changes: 3 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"lru-cache",
"@types/lru-cache",
"pretty-bytes",
"is-port-reachable"
"is-port-reachable",
"pretty-ms",
"camelcase"
]
}
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ jobs:
- name: 🔎 Lint
run: yarn lint

- name: Get number of CPU cores
if: always()
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v1

- name: 🧪 Test
run: yarn test
run: yarn test-ci ${{ steps.cpu-cores.outputs.count }}

build-lint-test-docs:
needs: only-doc-changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

- name: 🏷 Get version
id: get-version
uses: sergeysova/jq-action@v2.1.0
uses: sergeysova/jq-action@v2.2.1
with:
cmd: 'jq .version packages/core/package.json -r'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:

- name: 🏷 Get version
id: get-version
uses: sergeysova/jq-action@v2.1.0
uses: sergeysova/jq-action@v2.2.1
with:
cmd: 'jq .version packages/core/package.json -r'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/require-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: 🏷 Require release label
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
- uses: mheap/github-action-required-labels@v2
with:
mode: exactly
count: 1
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tasks:
yarn run build:test-project ../rw-test-app --typescript --link --verbose
command: |
cd /workspace/rw-test-app
yarn rw dev
yarn rw dev --fwd="--client-web-socket-url=ws$(gp url 8910 | cut -c 5-)/ws"
ports:
Expand Down
154 changes: 85 additions & 69 deletions README.md

Large diffs are not rendered by default.

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": "2.0.0",
"@redwoodjs/graphql-server": "2.0.0"
"@redwoodjs/api": "2.1.0",
"@redwoodjs/graphql-server": "2.1.0"
}
}
5 changes: 2 additions & 3 deletions __fixtures__/test-project/api/src/functions/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import { createGraphQLHandler } from '@redwoodjs/graphql-server'

import directives from 'src/directives/**/*.{js,ts}'
import sdls from 'src/graphql/**/*.sdl.{js,ts}'
import { db } from 'src/lib/db'
import { logger } from 'src/lib/logger'
import services from 'src/services/**/*.{js,ts}'

import { getCurrentUser } from 'src/lib/auth'

import { db } from 'src/lib/db'
import { logger } from 'src/lib/logger'

export const handler = createGraphQLHandler({
getCurrentUser,
loggerConfig: { logger, options: {} },
Expand Down
8 changes: 4 additions & 4 deletions __fixtures__/test-project/api/src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type AllowedRoles = string | string[] | undefined
/**
* Checks if the currentUser is authenticated (and assigned one of the given roles)
*
* @param roles: AllowedRoles - Checks if the currentUser is assigned one of these roles
* @param roles: {@link AllowedRoles} - Checks if the currentUser is assigned one of these roles
*
* @returns {boolean} - Returns true if the currentUser is logged in and assigned one of the given roles,
* or when no roles are provided to check against. Otherwise returns false.
Expand Down Expand Up @@ -88,12 +88,12 @@ export const hasRole = (roles: AllowedRoles): boolean => {
* whether or not they are assigned a role, and optionally raise an
* error if they're not.
*
* @param roles: AllowedRoles - When checking role membership, these roles grant access.
* @param roles: {@link AllowedRoles} - When checking role membership, these roles grant access.
*
* @returns - If the currentUser is authenticated (and assigned one of the given roles)
*
* @throws {AuthenticationError} - If the currentUser is not authenticated
* @throws {ForbiddenError} If the currentUser is not allowed due to role permissions
* @throws {@link AuthenticationError} - If the currentUser is not authenticated
* @throws {@link ForbiddenError} If the currentUser is not allowed due to role permissions
*
* @see https://github.com/redwoodjs/redwood/tree/main/packages/auth for examples
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { db } from 'src/lib/db'
import type { QueryResolvers, MutationResolvers } from 'types/graphql'

import { db } from 'src/lib/db'

export const contacts: QueryResolvers['contacts'] = () => {
return db.contact.findMany()
}
Expand Down
3 changes: 2 additions & 1 deletion __fixtures__/test-project/api/src/services/posts/posts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { db } from 'src/lib/db'
import type { QueryResolvers, MutationResolvers } from 'types/graphql'

import { db } from 'src/lib/db'

export const posts: QueryResolvers['posts'] = () => {
return db.post.findMany()
}
Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
]
},
"devDependencies": {
"@redwoodjs/core": "2.0.0"
"@redwoodjs/core": "2.1.0"
},
"eslintConfig": {
"extends": "@redwoodjs/eslint-config",
Expand All @@ -25,4 +25,4 @@
"scripts": {
"postinstall": ""
}
}
}
1 change: 1 addition & 0 deletions __fixtures__/test-project/web/config/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['src/**/*.{js,jsx,ts,tsx}'],
theme: {
Expand Down
10 changes: 5 additions & 5 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": "2.0.0",
"@redwoodjs/forms": "2.0.0",
"@redwoodjs/router": "2.0.0",
"@redwoodjs/web": "2.0.0",
"@redwoodjs/auth": "2.1.0",
"@redwoodjs/forms": "2.1.0",
"@redwoodjs/router": "2.1.0",
"@redwoodjs/web": "2.1.0",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2"
Expand All @@ -25,6 +25,6 @@
"autoprefixer": "^10.4.7",
"postcss": "^8.4.14",
"postcss-loader": "^7.0.0",
"tailwindcss": "^3.0.24"
"tailwindcss": "^3.1.4"
}
}
2 changes: 2 additions & 0 deletions __fixtures__/test-project/web/src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage

import { Router, Route, Private, Set } from '@redwoodjs/router'

import ContactsLayout from 'src/layouts/ContactsLayout'

import PostsLayout from 'src/layouts/PostsLayout';

import HomePage from "src/pages/HomePage";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import humanize from 'humanize-string'

import { Link, routes, navigate } from '@redwoodjs/router'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { Link, routes, navigate } from '@redwoodjs/router'

const DELETE_CONTACT_MUTATION = gql`
mutation DeleteContactMutation($id: Int!) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { FindContactById } from 'types/graphql'

import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

import Contact from 'src/components/Contact/Contact'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import humanize from 'humanize-string'

import { Link, routes } from '@redwoodjs/router'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { Link, routes } from '@redwoodjs/router'

import { QUERY } from 'src/components/Contact/ContactsCell'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FindContacts } from 'types/graphql'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

import { Link, routes } from '@redwoodjs/router'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

import Contacts from 'src/components/Contact/Contacts'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { EditContactById } from 'types/graphql'

import { navigate, routes } from '@redwoodjs/router'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { navigate, routes } from '@redwoodjs/router'

import ContactForm from 'src/components/Contact/ContactForm'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { navigate, routes } from '@redwoodjs/router'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { navigate, routes } from '@redwoodjs/router'

import ContactForm from 'src/components/Contact/ContactForm'

const CREATE_CONTACT_MUTATION = gql`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { EditPostById } from 'types/graphql'

import { navigate, routes } from '@redwoodjs/router'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { navigate, routes } from '@redwoodjs/router'

import PostForm from 'src/components/Post/PostForm'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { navigate, routes } from '@redwoodjs/router'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { navigate, routes } from '@redwoodjs/router'

import PostForm from 'src/components/Post/PostForm'

const CREATE_POST_MUTATION = gql`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import humanize from 'humanize-string'

import { Link, routes, navigate } from '@redwoodjs/router'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { Link, routes, navigate } from '@redwoodjs/router'

const DELETE_POST_MUTATION = gql`
mutation DeletePostMutation($id: Int!) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { FindPostById } from 'types/graphql'

import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

import Post from 'src/components/Post/Post'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import humanize from 'humanize-string'

import { Link, routes } from '@redwoodjs/router'
import { useMutation } from '@redwoodjs/web'
import { toast } from '@redwoodjs/web/toast'
import { Link, routes } from '@redwoodjs/router'

import { QUERY } from 'src/components/Post/PostsCell'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FindPosts } from 'types/graphql'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

import { Link, routes } from '@redwoodjs/router'
import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'

import Posts from 'src/components/Post/Posts'

Expand Down
15 changes: 15 additions & 0 deletions docs/docs/auth/okta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Okta

The following CLI command will install required packages and generate boilerplate code and files for Redwood Projects:

```bash
yarn rw setup auth okta
```

Update your .env file with the following setting which can be found on your Okta project's dashboard.

- `OKTA_ISSUER` The URL for your Okta organization or an Okta authentication server.
- `OKTA_CLIENT_ID` Client Id pre-registered with Okta for the OIDC authentication flow.
- `OKTA_REDIRECT_URI` The URL that is redirected to when using token.getWithRedirect. This must be listed in your Okta application's Login redirect URIs.
- `OKTA_AUDIENCE` The audience of the Okta jwt token
- `OKTA_DOMAIN` The domain for your Okta authentication server.
1 change: 1 addition & 0 deletions docs/docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ We currently support the following third-party authentication providers:
- Netlify Identity _([Repo on GitHub](https://github.com/netlify/netlify-identity-widget))_
- Netlify GoTrue-JS _([Repo on GitHub](https://github.com/netlify/gotrue-js))_
- Nhost _([Documentation Website](https://docs.nhost.io/platform/authentication))_
- Okta _([Repo on GitHub](https://github.com/okta/okta-auth-js))_
- Supabase _([Documentation Website](https://supabase.io/docs/guides/auth))_
- WalletConnect _([Repo on GitHub](https://github.com/oneclickdapp/ethereum-auth))_

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -1829,10 +1829,10 @@ Set up a UI design or style library. Right now the choices are [Chakra UI](https
yarn rw setup ui <library>
```
| Arguments & Options | Description |
| :------------------ | :-------------------------------------------------------------- |
| `library` | Library to configure. Choices are `chakra-ui` and `tailwindcss` |
| `--force, -f` | Overwrite existing configuration |
| Arguments & Options | Description |
| :------------------ | :-------------------------------------------------------------------------- |
| `library` | Library to configure. Choices are `chakra-ui`, `tailwindcss` and `windicss` |
| `--force, -f` | Overwrite existing configuration |
## storybook
Expand Down
23 changes: 5 additions & 18 deletions docs/docs/contributing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ _Before interacting with the Redwood community, please read and understand our [
> 1. 🧭 **Overview and Orientation** (👈 you are here)
> 2. 📓 [Reference: Contributing to the Framework Packages](https://github.com/redwoodjs/redwood/blob/main/CONTRIBUTING.md)
> 3. 🪜 [Step-by-step Walkthrough](contributing-walkthrough.md) (including Video Recording)
> 4. 📈 [Current Project Status: v1 Release Board](https://github.com/orgs/redwoodjs/projects/6)
> 4. 📈 [Current Project Status](https://github.com/orgs/redwoodjs/projects/11)
> 5. 🤔 What should I work on?
> - ["Help Wanted" v1 Triage Board](https://redwoodjs.com/good-first-issue)
> - [Good First Issue](https://redwoodjs.com/good-first-issue)
> - [Discovery Process and Open Issues](#what-should-i-work-on)
## The Characteristics of a Contributor
Expand All @@ -46,27 +46,14 @@ Even if you know the mechanics, it’s hard to get started without a starting pl

There are other more direct ways to get started as well, which are outlined below.

### Roadmap to Redwood v1: Project Boards and GitHub Issues
Over the next few months, our focus is to achieve a v1.0.0 release of Redwood. You can read Tom’s important announcement about the v1 release candidate process [via this forum post](https://community.redwoodjs.com/t/what-the-1-0-release-candidate-phase-means-and-when-1-0-will-drop/2604).

> **What a v1 release candidate means:**
>
> 1. all core features are complete and
> 2. we are done making breaking changes
>
> During the release candidate cycle, we are completing all remaining tasks necessary to publish v1.0.0 GA.
The Redwood Core Team is working publicly — progress is updated daily on the [Release Project Board](https://github.com/orgs/redwoodjs/projects/6). There’s also a Triage Board, including an important tab view of Issues that are priorities but need community help.
- 👉 **Start here**: [v1 Help Wanted tab on the Triage Project Board](https://github.com/orgs/redwoodjs/projects/4) (sorted by difficulty)
### Project Boards and GitHub Issues

The Redwood Core Team is working publicly — progress is updated daily on the [Release Project Board](https://github.com/orgs/redwoodjs/projects/11).

Eventually, all this leads you back to Redwood’s GitHub Issues page. Here you’ll find open items that need help, which are organized by labels. There are four labels helpful for contributing:
1. [Good First Issue](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22): these items are more likely to be an accessible entry point to the Framework. It’s less about skill level and more about focused scope.
2. [Help Wanted](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22): these items especially need contribution help from the community.
3. [v1 Priority](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3Av1%2Fpriority+): to reach Redwood v1.0.0, we need to close all Issues with this label.
4. [Bugs 🐛](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3Abug%2Fconfirmed): Last but not least, we always need help with bugs. Some are technically less challenging than others. Sometimes the best way you can help is to attempt to reproduce the bug and confirm whether or not it’s still an issue.

**The sweet spot is a “v1 Priority” Issue that’s either a “Good First Issue” or “Help Wanted”.** Yes, please!
3. [Bugs 🐛](https://github.com/redwoodjs/redwood/issues?q=is%3Aissue+is%3Aopen+label%3Abug%2Fconfirmed): last but not least, we always need help with bugs. Some are technically less challenging than others. Sometimes the best way you can help is to attempt to reproduce the bug and confirm whether or not it’s still an issue.

### Create a New Issue
Anyone can create a new Issue. If you’re not sure that your feature or idea is something to work on, start the discussion with an Issue. Describe the idea and problem + solution as clearly as possible, including examples or pseudo code if applicable. It’s also very helpful to `@` mention a maintainer or Core Team member that shares the area of interest.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/deploy/serverless.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Deploy to AWS with Serverless Framework
Yes, the name is confusing, but Serverless provides a very interesting option—deploy to your own cloud service account and skip the middleman entirely! By default, Serverless just orchestrates starting up services in your cloud provider of choice and pushing your code up to them. Any bill you receive is from your hosting provider (although many offer a generous free tier). You can optionally use the [Serverless Dashboard](https://www.serverless.com/dashboard/) to monitor your deploys and setup CI/CD to automatically deploy when pushing to your repo of choice. If you don't setup CI/CD you actually deploy from your development machine (or another designated machine you've setup to do the deployment).

Currently we default to deploying to AWS. We'd like to add more providers in the future but need help from the community in figuring our what services are equivalent to the ones we're using in AWS (Lambda for the api-side and S3/CloudFront for the web-side).
Currently we default to deploying to AWS. We'd like to add more providers in the future but need help from the community in figuring out what services are equivalent to the ones we're using in AWS (Lambda for the api-side and S3/CloudFront for the web-side).

We'll handle most of the deployment commands for you, you just need an [AWS account](https://www.serverless.com/framework/docs/providers/aws/guide/credentials#sign-up-for-an-aws-account) and your [access/secret keys](https://www.serverless.com/framework/docs/providers/aws/guide/credentials#create-an-iam-user-and-access-key) before we begin.

Expand Down
Loading

0 comments on commit b719e91

Please sign in to comment.