Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move import/order rule into shared eslint configuration #4954

Merged
merged 6 commits into from
Jun 9, 2022

Conversation

nickpdemarco
Copy link
Contributor

Fixes #4953. See issue description for more information.

@netlify
Copy link

netlify bot commented Mar 28, 2022

Deploy Preview for redwoodjs-docs canceled.

Name Link
🔨 Latest commit 2ab6499
🔍 Latest deploy log https://app.netlify.com/sites/redwoodjs-docs/deploys/62a17d65a3a52f0008e980d9

@thedavidprice
Copy link
Contributor

@dac09 any chance you could take a look at this one? Easy patch if we get it in, just let me know.

@dac09
Copy link
Collaborator

dac09 commented Mar 29, 2022

Hey @nickpdemarco - thank you for this. I despise lint configuration, so grateful you are taking an interest in this!

So I think... what's actually happening is that this eslint configuration sits only in the framework and not in a users project - maybe this was by design - but I don't actually remember or know

I wonder if having such strict rules (erroring out for import order) is a good idea on a user's project? May be a little too opinionated?

Let me know what you think.

@simoncrypta simoncrypta added release:chore This PR is a chore (means nothing for users) topic/config Babel, Webpack, ESLint, Prettier, etc. labels Mar 30, 2022
@nickpdemarco
Copy link
Contributor Author

I hear you on the aggressiveness of erroring out. Personally, I’m more interested in this so I can modify App.js imports (see #4900) and then lint —fix it, so I know my changes are still RW compliant.

More generally, I do think sane import ordering is enough of a “best practice” to justify its enforcement in Redwood. As a relatively green web developer, I’d rather know someone wiser than me thought about import order and automatically enforced it, rather than having to rediscover that standard myself.

You can always disable or extend eslint, but I’d venture to guess most people using RW will welcome the constraint, so long as their editor automatically fixes it on save.

@jtoar
Copy link
Contributor

jtoar commented Apr 5, 2022

I'd love to see this working out of the box as well. @dac09 as you said, erroring out may be too harsh. I'll queue it up for the next core team meeting to get everyone's thoughts.

@thedavidprice
Copy link
Contributor

@jtoar and I discussed this one — error would result in a breaking change and need to coincide with a major version.

Next steps:

  • use warn
  • indicate (via @deprecation — I don't think it's possible?) we'll be moving to error in the next major version
  • add to "upcoming breaking changes" in CHANGELOG

@thedavidprice thedavidprice self-requested a review April 18, 2022 16:59
@jtoar jtoar added the v2 label Apr 19, 2022
@jtoar
Copy link
Contributor

jtoar commented Apr 19, 2022

Updated next steps to what @thedavidprice said: we won't be merging this till the next major. Having said that, we could still merge this into the next major branch, so that we could get that RC process going. We'll include guidance for how to lint files so that your commit history isn't littered with changes. Thanks @nickpdemarco!

@thedavidprice thedavidprice marked this pull request as draft April 20, 2022 00:51
@thedavidprice thedavidprice added release:breaking This PR is a breaking change and removed release:chore This PR is a chore (means nothing for users) labels Apr 22, 2022
@jtoar jtoar marked this pull request as ready for review May 21, 2022 05:15
@jtoar jtoar removed the v2 label Jun 9, 2022
@jtoar jtoar enabled auto-merge (squash) June 9, 2022 05:08
@jtoar jtoar merged commit 7cb547b into redwoodjs:main Jun 9, 2022
@jtoar jtoar modified the milestones: next-release, v2.0.0 Jun 9, 2022
cannikin added a commit that referenced this pull request Jun 15, 2022
commit 40c2c11
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 15 20:54:08 2022 +0000

    fix(deps): update dependency @apollo/client to v3.6.8 (#5769)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 8bc48ff
Author: Anders Søgaard <andershagbard@gmail.com>
Date:   Wed Jun 15 17:55:15 2022 +0200

    Correct a few spelling mistakes (#5747)

commit 957f98c
Author: António Meireles <antonio.meireles@reformi.st>
Date:   Wed Jun 15 16:14:13 2022 +0100

    docs: yet another set of single byte typo squashing (#5749)

    Signed-off-by: António Meireles <antonio.meireles@reformi.st>

    Co-authored-by: David Thyresson <dthyresson@gmail.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit ef5aaec
Author: Rushabh Javeri <javeri.rushabh45@gmail.com>
Date:   Wed Jun 15 20:40:33 2022 +0530

    docs: GraphQL Yoga's playground, not Apollo Server's (#5741)

    * docs: GraphQL Yoga's playground, not Apollo Server's

    * docs: Changed "GraphQL Playground" to "GraphiQL" and added appropriate link

commit 4272511
Author: Charly POLY <1252066+charlypoly@users.noreply.github.com>
Date:   Wed Jun 15 17:02:38 2022 +0200

    docs(graphql): replaced outdated mentions to Apollo Server (#5768)

commit b7636b1
Author: Masvoras <58081001+Masvoras@users.noreply.github.com>
Date:   Wed Jun 15 10:58:53 2022 -0400

    Update routing-params.md (#5706)

    There were errors in the code portion at the end of Chapter 2 -> Routing params when ArticleCell is last modified.

commit 90592e3
Author: Syahrizal Ardana <57914770+Gombeng@users.noreply.github.com>
Date:   Wed Jun 15 21:55:23 2022 +0700

    fixing typo (#5699)

commit 43230ae
Author: David Thyresson <dthyresson@gmail.com>
Date:   Wed Jun 15 10:41:20 2022 -0400

    fix: RedwoodLogger -- Mask errors, but include stack trace in formatter (#5704)

    * Mask errors, but include stack trasce in formatter

    * Fix tests for new error attribute in log data

    * Adds test to log stack traces

    * Tests log error formatter

    * style: remove extra space between error and stack

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 6c43606
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Wed Jun 15 21:41:46 2022 +0900

    Lint fix some template files (#5766)

    * fix: lint fix template files

    * fix: update snapshots

commit 4613200
Author: Guillaume Mantopoulos <3082385+MrGuiMan@users.noreply.github.com>
Date:   Wed Jun 15 00:55:54 2022 +0200

    docs: adding precisions and fixes to contributing (#5760)

    Co-authored-by: Guillaume Mantopoulos <guillaume.mantopoulos@gmail.com>
    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit 339d783
Author: Rob Cameron <cannikin@fastmail.com>
Date:   Tue Jun 14 15:23:00 2022 -0700

    Adds note about errors when generating cells without a SDL file (#5764)

commit 7423b55
Author: Jan Henning <triton539@outlook.com>
Date:   Tue Jun 14 19:16:28 2022 +0200

    docs: Fix not being able to fullscreen YouTube embeds (#5744)

    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit b6a733d
Author: Rob Cameron <cannikin@fastmail.com>
Date:   Mon Jun 13 14:29:49 2022 -0700

    Adds mailchimp signup form to tutorial Foreword page (#5758)

    * Add Mailchimp signup form

    * Update link

    * Rename back

    * Add form directly to 1.5 versioned docs

    * Fix link

    * Move signup form to root /docs dir

    * Also add to 1.5

    * Remove Mailchimp JS, move component to bottom to fix title

commit ac4844d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Jun 13 21:23:58 2022 +0000

    fix(deps): update dependency webpack-dev-server to v4.9.2 (#5754)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit e7e0e8b
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:34:24 2022 +0900

    Update yarn.lock

commit 025e113
Merge: 32e879a f3bc655
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:33:41 2022 +0900

    Merge branch 'release/patch/v1.5.2'

commit f3bc655
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:07:09 2022 +0900

    v1.5.2

commit 20aee39
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:02:53 2022 +0900

    Update yarn.lock

commit 0998c76
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Jun 13 22:45:20 2022 +0900

    fix(deps): update dependency webpack-cli to v4.10.0 (#5756)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 32e879a
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Jun 13 22:45:20 2022 +0900

    fix(deps): update dependency webpack-cli to v4.10.0 (#5756)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 9e9ecb6
Author: Rushabh Javeri <javeri.rushabh45@gmail.com>
Date:   Sat Jun 11 11:14:50 2022 +0530

    docs: Some fact checks in the deployment section. (#5736)

    * docs: Some fact checks in the deployment section.

    * docs: Inform users to create account in order to persist their DB.

    Co-authored-by: Rob Cameron <cannikin@fastmail.com>

    Co-authored-by: Rob Cameron <cannikin@fastmail.com>
    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit a81f916
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 15:05:33 2022 +0000

    fix(deps): update dependency ts-morph to v15 (#5644)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit be229fd
Author: Aleph Retamal <7674479+alephao@users.noreply.github.com>
Date:   Fri Jun 10 11:23:36 2022 -0300

    fix: typo in graphql generate service command (#5712)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit b71339b
Author: Kolja Lampe <razzeee@gmail.com>
Date:   Fri Jun 10 16:15:18 2022 +0200

    Fix typo (#5735)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 17730f6
Author: Bouzid Badreddine <ubugnu@gmail.com>
Date:   Fri Jun 10 15:11:35 2022 +0100

    Fix typo (#5733)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 5c6f08d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 22:20:06 2022 +0900

    fix(deps): update storybook monorepo to v6.5.8 (#5720)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 39e86c6
Author: Tobbe Lundberg <tobbe@tlundberg.com>
Date:   Fri Jun 10 13:30:59 2022 +0200

    Reorganize router utils (#5659)

commit 012bc15
Author: Alon <57628667+AlonHor@users.noreply.github.com>
Date:   Fri Jun 10 13:41:52 2022 +0300

    Fixed not enough spaces after '>' (#5732)

commit 218887b
Author: Rushabh Javeri <javeri.rushabh45@gmail.com>
Date:   Fri Jun 10 16:07:49 2022 +0530

    docs: (typo fix) Updated reference to GraphQL Yoga from Apollo (#5731)

    * docs: (typo fix) Updated reference to GraphQL Yoga from Apollo

    * docs: (typo fix) Updated reference to GraphQL Yoga from Apollo

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 14ec0c7
Author: kunalarya <alunaryak@gmail.com>
Date:   Fri Jun 10 03:31:40 2022 -0700

    docs: Fix Typescript typo in authentication chapter (#5621)

    * Fix Typescript typo in authentication chapter

    * Move changes to docs/docs

    Co-authored-by: Kunal Arya <me@example.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 5e3cb58
Author: Fabio Lazzaroni <lazzaroni@jeflab.it>
Date:   Fri Jun 10 12:25:27 2022 +0200

    Update comment-form.md (#5637)

    * Update comment-form.md

    Fix a broken import in example code

    * Update rbac.md

    Fix a broken import in example code

    * Update comment-form.md

    Fix a broken import in example code

    * typo(docs): fix typo in docs

    fix some broken imports in the example code of the tutorial documentation
    `api/src/lib/db` -> `src/lib/db`

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit c91b3dc
Author: mattdriscoll <mdriscoll815@gmail.com>
Date:   Fri Jun 10 05:13:27 2022 -0500

    Fix typo in Tutorial Chapter 1 Prerequisites (#5616)

    * Fix typo

    * chore: copy typo fix to ./docs

    Co-authored-by: Aditya Pandey <aditya@autospace.co>
    Co-authored-by: David Thyresson <dthyresson@gmail.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit ebd0ffe
Author: Anders Søgaard <andershagbard@gmail.com>
Date:   Fri Jun 10 12:10:48 2022 +0200

    Fix typo (#5711)

    * Fix typo

    * Update authentication.md

    * Update authentication.md

    * Update authentication.md

    * Update authentication.md

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 07b00d2
Author: David Thyresson <dthyresson@gmail.com>
Date:   Fri Jun 10 05:57:26 2022 -0400

    auth0 decoder handles undefined public key (#5701)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit fa8fba9
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Fri Jun 10 18:27:21 2022 +0900

    Revert "chore: update cypress github action"

    This reverts commit 1232e40.

commit 1232e40
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Fri Jun 10 18:04:41 2022 +0900

    chore: update cypress github action

commit 71823f5
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 08:44:34 2022 +0000

    fix(deps): update prisma monorepo to v3.15.1 (#5721)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5e10b85
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 16:57:13 2022 +0900

    chore(deps): update dependency octokit to v1.7.2 (#5719)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 03af8ff
Author: kunalarya <alunaryak@gmail.com>
Date:   Thu Jun 9 23:43:41 2022 -0700

    docs: Link to current document source. (#5658)

    Co-authored-by: Kunal Arya <me@example.com>
    Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>

commit e8d2eb9
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu Jun 9 16:23:30 2022 +0000

    fix(deps): update dependency @envelop/depth-limit to v1.5.3 (#5709)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 2dfe7d8
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 00:32:02 2022 +0900

    chore(deps): update dependency esbuild to v0.14.43 (#5717)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5eb4236
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu Jun 9 23:54:00 2022 +0900

    fix(deps): update dependency @envelop/disable-introspection to v3.3.3 (#5710)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 7cb547b
Author: nickpdemarco <nickpdemarco@gmail.com>
Date:   Thu Jun 9 01:25:44 2022 -0400

    Move import/order rule into shared eslint configuration so generated projects have to adhere to the rule as well (#4954)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 161c460
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 8 01:43:00 2022 +0000

    chore(deps): update dependency typescript to v4.7.3 (#5707)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit a56ef2b
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Jun 7 22:40:28 2022 +0000

    chore(deps): update dependency @clerk/clerk-sdk-node to v3.6.1 (#5697)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 3adbff8
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Jun 7 18:48:34 2022 +0000

    chore(deps): update dependency @nhost/hasura-auth-js to v1.1.14 (#5688)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit aba9a3a
Author: Pin Sern <52379442+fangpinsern@users.noreply.github.com>
Date:   Tue Jun 7 21:57:04 2022 +0800

    docs: Removes unnecessary word in Chapter 3: saving-data.md (#5698)

    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit a7dff82
Author: António Meireles <antonio.meireles@reformi.st>
Date:   Tue Jun 7 14:50:34 2022 +0100

    docs: yet another single byte typo squash (#5702)

commit b6005c3
Author: craineum <kevin.craine@codingzeal.com>
Date:   Tue Jun 7 07:45:49 2022 -0400

    Add example usage of useRegister and useErrorStyles (#5692)

    * 📝 Add documentation for custom input fields

    Covers use of `useRegister` and `useErrorStyles`

    * 👌 Implement PR feedback

    * 👌 A couple more PR feedback implementations

commit 62d209e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Jun 7 00:48:05 2022 +0000

    chore(deps): update dependency @envelop/testing to v4.3.3 (#5690)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 6729c29
Author: Jorge Venegas <jorgepvenegas@protonmail.com>
Date:   Mon Jun 6 12:00:38 2022 -0700

    Update contributing docs (#5685)

    * docs: remove broken URLs

    * docs: typo, update on description

    * docs: add missing packages

    * docs: add missing README

    * docs: add descriptions

    * Update packages/prerender/README.md

    Co-authored-by: David Price <thedavid@thedavidprice.com>

commit ca0bfe4
Author: Min ho Kim <minho42@gmail.com>
Date:   Tue Jun 7 01:20:37 2022 +0900

    Fix typos in docs (#5694)

    Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>

commit d5ef5da
Author: Leon <18523441+Leon-Sam@users.noreply.github.com>
Date:   Mon Jun 6 08:43:14 2022 -0400

    Fix typo in ArticleCell code snippet of Tutorial 2 docs (#5695)

commit 7b9c60e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sat Jun 4 02:40:18 2022 +0000

    fix(deps): update dependency core-js to v3.22.8 (#5683)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 4cc4fd1
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 3 23:18:20 2022 +0000

    fix(deps): update dependency webpack-dev-server to v4.9.1 (#5684)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit fd24d85
Author: paikwiki <paikwiki@gmail.com>
Date:   Sat Jun 4 02:34:57 2022 +0900

    Fix typo (#5686)

    Co-authored-by: David Price <thedavid@thedavidprice.com>

commit 0604543
Author: Andre Wruszczak <avataw.dev@gmail.com>
Date:   Fri Jun 3 19:20:52 2022 +0200

    Add warning box for missing roles in authorization doc (#5611)

    * Add warning box for missing roles in authorization doc

    * Update docs/docs/tutorial/chapter4/authentication.md

    Co-authored-by: Peter Colapietro <petercolapietro+github@gmail.com>

    Co-authored-by: Peter Colapietro <petercolapietro+github@gmail.com>
    Co-authored-by: David Price <thedavid@thedavidprice.com>

commit dbc0989
Author: Jonas Oberschweiber <jonas@frozenbeetle.net>
Date:   Thu Jun 2 17:25:34 2022 +0200

    Fix dbAuth on AWS Lambda (#5474)

    * queryStringParameters can be null in AWS Lambda

    * Allow cookie to be capitalized

    * Make cookie vs. Cookie distinction once in DbAuthHandler

    * Extract header handling into separate function

    * Missed another semicolon...

    * Fix linter errors, add extractCookie in one more place

    Co-authored-by: Rob Cameron <cannikin@fastmail.com>

commit d348e50
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu Jun 2 02:20:59 2022 +0000

    fix(deps): update dependency @types/jest to v27.5.2 (#5681)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 422867c
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 1 22:05:29 2022 +0000

    fix(deps): update dependency vscode-languageserver-textdocument to v1.0.5 (#5679)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 8b25fbc
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 1 18:23:20 2022 +0000

    chore(deps): update dependency @nhost/hasura-auth-js to v1.1.12 (#5677)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
@dac09
Copy link
Collaborator

dac09 commented Jul 7, 2022

@jtoar, @nickpdemarco - there's an error now introduced by this new lint order, where in my functions/graphql.ts it won't keen the glob imports together e.g.

It thinks this is the correct order:

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

@jtoar
Copy link
Contributor

jtoar commented Jul 8, 2022

@dac09 yeah that's how it's configured. Here's the create-redwood-app template:

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}'

We discussed this one as a team a few times. I'm down to make a change to the rule to keep the globs together, but that would be breaking of course. Not a big deal though; we can just make the change when the next major rolls around, and we already have release notes for it from the last one we can just copy and paste.

@dac09
Copy link
Collaborator

dac09 commented Jul 8, 2022

I find these lint rules a little too agressive - it makes no sense that I can't group globs together. It makes it harder for new comers to reason about the special glob import syntax too.

@jtoar
Copy link
Contributor

jtoar commented Jul 9, 2022

@dac09 I agree that it makes more sense to keep the globs together, and am happy to change it, as I said in my last comment.

If there's other changes you'd like to make to it, let's get them in at the same time too.

cannikin added a commit that referenced this pull request Jul 18, 2022
* Add dependencies

* Adds base64url dep

* Requesting registration options and verification on server working

* Requesting authentication options and authenticating on server working

* More config verification, updates for Safari

* Handle missing transports in DB

* Throw specific error if webauthn cookie is not present

* Fallback to looking up user by existing session cookie

* Set session cookie when authenticating with WebAuthn

* Don’t set webauthn cookie to be HttpOnly so we can read it from the client

* Adds dependency to auth package

* Start moving browser functionality to auth package

* Just import typescript-types, no browser package

* Copy @simplewebauthn/browser into local file

Error when importing ESM modules more than one level deep: MasterKale/SimpleWebAuthn#168

* Browser half with auth package working

* Allow duplicate registrations

This prevents an annoying UX case where you removed the `webAuthn` cookie—you are sent into the registration flow but can’t register because your devices is already in the DB, so you’re asked to authenticate, which means you have to scan your fingerprint/face again

* Create and throw named errors on web side

* Remove webAuthn cookie if no matching credential can be found

This makes it so that if someone tampers with the cookie, or their credential has been removed from the database, their webAuthn cookie is removed and sent back to the username/password flow

* Found some missing credentialField lookups

* Reorder imports

* Add unique error that tries to remedy iOS issue

MasterKale/SimpleWebAuthn#211

* Adds webAuthn settings to auth function template

* Adds webAuthn logic to login template

* Removes unneeded check

* Remove console logging

* Fix security warning

* No need to check for undefined

* Start of tests

* Squashed commit of the following:

commit 40c2c11
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 15 20:54:08 2022 +0000

    fix(deps): update dependency @apollo/client to v3.6.8 (#5769)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 8bc48ff
Author: Anders Søgaard <andershagbard@gmail.com>
Date:   Wed Jun 15 17:55:15 2022 +0200

    Correct a few spelling mistakes (#5747)

commit 957f98c
Author: António Meireles <antonio.meireles@reformi.st>
Date:   Wed Jun 15 16:14:13 2022 +0100

    docs: yet another set of single byte typo squashing (#5749)

    Signed-off-by: António Meireles <antonio.meireles@reformi.st>

    Co-authored-by: David Thyresson <dthyresson@gmail.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit ef5aaec
Author: Rushabh Javeri <javeri.rushabh45@gmail.com>
Date:   Wed Jun 15 20:40:33 2022 +0530

    docs: GraphQL Yoga's playground, not Apollo Server's (#5741)

    * docs: GraphQL Yoga's playground, not Apollo Server's

    * docs: Changed "GraphQL Playground" to "GraphiQL" and added appropriate link

commit 4272511
Author: Charly POLY <1252066+charlypoly@users.noreply.github.com>
Date:   Wed Jun 15 17:02:38 2022 +0200

    docs(graphql): replaced outdated mentions to Apollo Server (#5768)

commit b7636b1
Author: Masvoras <58081001+Masvoras@users.noreply.github.com>
Date:   Wed Jun 15 10:58:53 2022 -0400

    Update routing-params.md (#5706)

    There were errors in the code portion at the end of Chapter 2 -> Routing params when ArticleCell is last modified.

commit 90592e3
Author: Syahrizal Ardana <57914770+Gombeng@users.noreply.github.com>
Date:   Wed Jun 15 21:55:23 2022 +0700

    fixing typo (#5699)

commit 43230ae
Author: David Thyresson <dthyresson@gmail.com>
Date:   Wed Jun 15 10:41:20 2022 -0400

    fix: RedwoodLogger -- Mask errors, but include stack trace in formatter (#5704)

    * Mask errors, but include stack trasce in formatter

    * Fix tests for new error attribute in log data

    * Adds test to log stack traces

    * Tests log error formatter

    * style: remove extra space between error and stack

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 6c43606
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Wed Jun 15 21:41:46 2022 +0900

    Lint fix some template files (#5766)

    * fix: lint fix template files

    * fix: update snapshots

commit 4613200
Author: Guillaume Mantopoulos <3082385+MrGuiMan@users.noreply.github.com>
Date:   Wed Jun 15 00:55:54 2022 +0200

    docs: adding precisions and fixes to contributing (#5760)

    Co-authored-by: Guillaume Mantopoulos <guillaume.mantopoulos@gmail.com>
    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit 339d783
Author: Rob Cameron <cannikin@fastmail.com>
Date:   Tue Jun 14 15:23:00 2022 -0700

    Adds note about errors when generating cells without a SDL file (#5764)

commit 7423b55
Author: Jan Henning <triton539@outlook.com>
Date:   Tue Jun 14 19:16:28 2022 +0200

    docs: Fix not being able to fullscreen YouTube embeds (#5744)

    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit b6a733d
Author: Rob Cameron <cannikin@fastmail.com>
Date:   Mon Jun 13 14:29:49 2022 -0700

    Adds mailchimp signup form to tutorial Foreword page (#5758)

    * Add Mailchimp signup form

    * Update link

    * Rename back

    * Add form directly to 1.5 versioned docs

    * Fix link

    * Move signup form to root /docs dir

    * Also add to 1.5

    * Remove Mailchimp JS, move component to bottom to fix title

commit ac4844d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Jun 13 21:23:58 2022 +0000

    fix(deps): update dependency webpack-dev-server to v4.9.2 (#5754)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit e7e0e8b
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:34:24 2022 +0900

    Update yarn.lock

commit 025e113
Merge: 32e879a f3bc655
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:33:41 2022 +0900

    Merge branch 'release/patch/v1.5.2'

commit f3bc655
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:07:09 2022 +0900

    v1.5.2

commit 20aee39
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Mon Jun 13 23:02:53 2022 +0900

    Update yarn.lock

commit 0998c76
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Jun 13 22:45:20 2022 +0900

    fix(deps): update dependency webpack-cli to v4.10.0 (#5756)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 32e879a
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Mon Jun 13 22:45:20 2022 +0900

    fix(deps): update dependency webpack-cli to v4.10.0 (#5756)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 9e9ecb6
Author: Rushabh Javeri <javeri.rushabh45@gmail.com>
Date:   Sat Jun 11 11:14:50 2022 +0530

    docs: Some fact checks in the deployment section. (#5736)

    * docs: Some fact checks in the deployment section.

    * docs: Inform users to create account in order to persist their DB.

    Co-authored-by: Rob Cameron <cannikin@fastmail.com>

    Co-authored-by: Rob Cameron <cannikin@fastmail.com>
    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit a81f916
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 15:05:33 2022 +0000

    fix(deps): update dependency ts-morph to v15 (#5644)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit be229fd
Author: Aleph Retamal <7674479+alephao@users.noreply.github.com>
Date:   Fri Jun 10 11:23:36 2022 -0300

    fix: typo in graphql generate service command (#5712)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit b71339b
Author: Kolja Lampe <razzeee@gmail.com>
Date:   Fri Jun 10 16:15:18 2022 +0200

    Fix typo (#5735)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 17730f6
Author: Bouzid Badreddine <ubugnu@gmail.com>
Date:   Fri Jun 10 15:11:35 2022 +0100

    Fix typo (#5733)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 5c6f08d
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 22:20:06 2022 +0900

    fix(deps): update storybook monorepo to v6.5.8 (#5720)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 39e86c6
Author: Tobbe Lundberg <tobbe@tlundberg.com>
Date:   Fri Jun 10 13:30:59 2022 +0200

    Reorganize router utils (#5659)

commit 012bc15
Author: Alon <57628667+AlonHor@users.noreply.github.com>
Date:   Fri Jun 10 13:41:52 2022 +0300

    Fixed not enough spaces after '>' (#5732)

commit 218887b
Author: Rushabh Javeri <javeri.rushabh45@gmail.com>
Date:   Fri Jun 10 16:07:49 2022 +0530

    docs: (typo fix) Updated reference to GraphQL Yoga from Apollo (#5731)

    * docs: (typo fix) Updated reference to GraphQL Yoga from Apollo

    * docs: (typo fix) Updated reference to GraphQL Yoga from Apollo

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 14ec0c7
Author: kunalarya <alunaryak@gmail.com>
Date:   Fri Jun 10 03:31:40 2022 -0700

    docs: Fix Typescript typo in authentication chapter (#5621)

    * Fix Typescript typo in authentication chapter

    * Move changes to docs/docs

    Co-authored-by: Kunal Arya <me@example.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 5e3cb58
Author: Fabio Lazzaroni <lazzaroni@jeflab.it>
Date:   Fri Jun 10 12:25:27 2022 +0200

    Update comment-form.md (#5637)

    * Update comment-form.md

    Fix a broken import in example code

    * Update rbac.md

    Fix a broken import in example code

    * Update comment-form.md

    Fix a broken import in example code

    * typo(docs): fix typo in docs

    fix some broken imports in the example code of the tutorial documentation
    `api/src/lib/db` -> `src/lib/db`

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit c91b3dc
Author: mattdriscoll <mdriscoll815@gmail.com>
Date:   Fri Jun 10 05:13:27 2022 -0500

    Fix typo in Tutorial Chapter 1 Prerequisites (#5616)

    * Fix typo

    * chore: copy typo fix to ./docs

    Co-authored-by: Aditya Pandey <aditya@autospace.co>
    Co-authored-by: David Thyresson <dthyresson@gmail.com>
    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit ebd0ffe
Author: Anders Søgaard <andershagbard@gmail.com>
Date:   Fri Jun 10 12:10:48 2022 +0200

    Fix typo (#5711)

    * Fix typo

    * Update authentication.md

    * Update authentication.md

    * Update authentication.md

    * Update authentication.md

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 07b00d2
Author: David Thyresson <dthyresson@gmail.com>
Date:   Fri Jun 10 05:57:26 2022 -0400

    auth0 decoder handles undefined public key (#5701)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit fa8fba9
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Fri Jun 10 18:27:21 2022 +0900

    Revert "chore: update cypress github action"

    This reverts commit 1232e40.

commit 1232e40
Author: Dominic Saadi <dominiceliassaadi@gmail.com>
Date:   Fri Jun 10 18:04:41 2022 +0900

    chore: update cypress github action

commit 71823f5
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 08:44:34 2022 +0000

    fix(deps): update prisma monorepo to v3.15.1 (#5721)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5e10b85
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 16:57:13 2022 +0900

    chore(deps): update dependency octokit to v1.7.2 (#5719)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 03af8ff
Author: kunalarya <alunaryak@gmail.com>
Date:   Thu Jun 9 23:43:41 2022 -0700

    docs: Link to current document source. (#5658)

    Co-authored-by: Kunal Arya <me@example.com>
    Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>

commit e8d2eb9
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu Jun 9 16:23:30 2022 +0000

    fix(deps): update dependency @envelop/depth-limit to v1.5.3 (#5709)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 2dfe7d8
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 10 00:32:02 2022 +0900

    chore(deps): update dependency esbuild to v0.14.43 (#5717)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 5eb4236
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu Jun 9 23:54:00 2022 +0900

    fix(deps): update dependency @envelop/disable-introspection to v3.3.3 (#5710)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 7cb547b
Author: nickpdemarco <nickpdemarco@gmail.com>
Date:   Thu Jun 9 01:25:44 2022 -0400

    Move import/order rule into shared eslint configuration so generated projects have to adhere to the rule as well (#4954)

    Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>

commit 161c460
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 8 01:43:00 2022 +0000

    chore(deps): update dependency typescript to v4.7.3 (#5707)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit a56ef2b
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Jun 7 22:40:28 2022 +0000

    chore(deps): update dependency @clerk/clerk-sdk-node to v3.6.1 (#5697)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 3adbff8
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Jun 7 18:48:34 2022 +0000

    chore(deps): update dependency @nhost/hasura-auth-js to v1.1.14 (#5688)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit aba9a3a
Author: Pin Sern <52379442+fangpinsern@users.noreply.github.com>
Date:   Tue Jun 7 21:57:04 2022 +0800

    docs: Removes unnecessary word in Chapter 3: saving-data.md (#5698)

    Co-authored-by: David Thyresson <dthyresson@gmail.com>

commit a7dff82
Author: António Meireles <antonio.meireles@reformi.st>
Date:   Tue Jun 7 14:50:34 2022 +0100

    docs: yet another single byte typo squash (#5702)

commit b6005c3
Author: craineum <kevin.craine@codingzeal.com>
Date:   Tue Jun 7 07:45:49 2022 -0400

    Add example usage of useRegister and useErrorStyles (#5692)

    * 📝 Add documentation for custom input fields

    Covers use of `useRegister` and `useErrorStyles`

    * 👌 Implement PR feedback

    * 👌 A couple more PR feedback implementations

commit 62d209e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Tue Jun 7 00:48:05 2022 +0000

    chore(deps): update dependency @envelop/testing to v4.3.3 (#5690)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 6729c29
Author: Jorge Venegas <jorgepvenegas@protonmail.com>
Date:   Mon Jun 6 12:00:38 2022 -0700

    Update contributing docs (#5685)

    * docs: remove broken URLs

    * docs: typo, update on description

    * docs: add missing packages

    * docs: add missing README

    * docs: add descriptions

    * Update packages/prerender/README.md

    Co-authored-by: David Price <thedavid@thedavidprice.com>

commit ca0bfe4
Author: Min ho Kim <minho42@gmail.com>
Date:   Tue Jun 7 01:20:37 2022 +0900

    Fix typos in docs (#5694)

    Co-authored-by: Daniel Choudhury <dannychoudhury@gmail.com>

commit d5ef5da
Author: Leon <18523441+Leon-Sam@users.noreply.github.com>
Date:   Mon Jun 6 08:43:14 2022 -0400

    Fix typo in ArticleCell code snippet of Tutorial 2 docs (#5695)

commit 7b9c60e
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Sat Jun 4 02:40:18 2022 +0000

    fix(deps): update dependency core-js to v3.22.8 (#5683)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 4cc4fd1
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Fri Jun 3 23:18:20 2022 +0000

    fix(deps): update dependency webpack-dev-server to v4.9.1 (#5684)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit fd24d85
Author: paikwiki <paikwiki@gmail.com>
Date:   Sat Jun 4 02:34:57 2022 +0900

    Fix typo (#5686)

    Co-authored-by: David Price <thedavid@thedavidprice.com>

commit 0604543
Author: Andre Wruszczak <avataw.dev@gmail.com>
Date:   Fri Jun 3 19:20:52 2022 +0200

    Add warning box for missing roles in authorization doc (#5611)

    * Add warning box for missing roles in authorization doc

    * Update docs/docs/tutorial/chapter4/authentication.md

    Co-authored-by: Peter Colapietro <petercolapietro+github@gmail.com>

    Co-authored-by: Peter Colapietro <petercolapietro+github@gmail.com>
    Co-authored-by: David Price <thedavid@thedavidprice.com>

commit dbc0989
Author: Jonas Oberschweiber <jonas@frozenbeetle.net>
Date:   Thu Jun 2 17:25:34 2022 +0200

    Fix dbAuth on AWS Lambda (#5474)

    * queryStringParameters can be null in AWS Lambda

    * Allow cookie to be capitalized

    * Make cookie vs. Cookie distinction once in DbAuthHandler

    * Extract header handling into separate function

    * Missed another semicolon...

    * Fix linter errors, add extractCookie in one more place

    Co-authored-by: Rob Cameron <cannikin@fastmail.com>

commit d348e50
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Thu Jun 2 02:20:59 2022 +0000

    fix(deps): update dependency @types/jest to v27.5.2 (#5681)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 422867c
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 1 22:05:29 2022 +0000

    fix(deps): update dependency vscode-languageserver-textdocument to v1.0.5 (#5679)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

commit 8b25fbc
Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Date:   Wed Jun 1 18:23:20 2022 +0000

    chore(deps): update dependency @nhost/hasura-auth-js to v1.1.12 (#5677)

    Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Put @SimpleWebAuthn includes in devDependencies

* Move @SimpleWebAuthn imports into function as require

* Can import package again

* Install @SimpleWebAuthn deps along with dbAuth

* Move webAuthn to client on <AuthProvider>

* Move to default export

* Update AuthClients with new WebAuthnClient type

* Update to be undefined instead of null function

* Pick -> WebAuthnClientType

* Put @redwoodjs/auth back in prerender

* Fix @ts-ignores

* Add comments

* Enable —webAuthn flag in `setup auth` command

Uses separate provider data and templates if webAuthn is enabled

* Need to be able to override `force`

* Allow `any` to be sent for `type`

* WebAuthn docs added to dbAuth doc

* Brings original login template back, adds webAuthn template

* Adds —webAuthn flag to login page generator

* Update post install instructions if generating webAuthn login page

* WebAuthn docs update

* Save out options into new variable

* Tests for webAuthnAuthenticate

* Adds tests for webAuthnRegister

* Fix lint errors

* Fix yarn constraints and dedupe

* Allow setting different lengths of time on session vs webAuthn cookies

* Adds docs for webAuthn.expires config

* Prompt users to install WebAuthn support in CLI

* Prompt to ask if webAuthn templates should be use when generating dbAuth pages

* Don’t include challenge selection if webAuthn not enabled

* Updates docs for removal of —webAuthn flag

* challenge key is optional if not using WebAuthn

* credentialModelAccessor is optional

* Doc updates

* Moves up tutorial reminder email form

* yarn dedupe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change topic/config Babel, Webpack, ESLint, Prettier, etc.
Projects
Status: Archived
Development

Successfully merging this pull request may close these issues.

Linting Import Ordering
5 participants