Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into feat/dbauth-…
Browse files Browse the repository at this point in the history
…cookie+generic-handler

* 'main' of github.com:redwoodjs/redwood:
  chore: yarn install to update `yarn.lock` (follow up to redwoodjs#9669)
  chore(deps): update dependency @envelop/core to v5 (redwoodjs#9669)
  Use regex to make test pass in VSCode (redwoodjs#9791)
  fix(dbAuth): Correct hardcoded DB column (redwoodjs#9788)
  fix(deps): update dependency graphql-yoga to v5 (redwoodjs#9688)
  • Loading branch information
dac09 committed Jan 3, 2024
2 parents 9b1affd + 3e08e20 commit d25ed51
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 41 deletions.
5 changes: 3 additions & 2 deletions packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,9 @@ export class DbAuthHandler<

const existingDevice = await this.dbCredentialAccessor.findFirst({
where: {
id: plainCredentialId,
userId: user[this.options.authFields.id],
[this.options.webAuthn.credentialFields.id]: plainCredentialId,
[this.options.webAuthn.credentialFields.userId]:
user[this.options.authFields.id],
},
})

Expand Down
24 changes: 19 additions & 5 deletions packages/cli-packages/dataMigrate/src/__tests__/install.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type yargs from 'yargs'

import * as installCommand from '../commands/install'
import { handler as dataMigrateInstallHandler } from '../commands/installHandler.js'

Expand All @@ -24,12 +26,24 @@ describe('install', () => {
})

it('`builder` has an epilogue', () => {
const yargs = { epilogue: jest.fn() }
// @ts-expect-error this is a test file; epilogue is the only thing `builder` calls right now
// The typecasting here is to make TS happy when calling `builder(yargs)`
// further down. We know that only `epilogue` will be called.
const yargs = { epilogue: jest.fn() } as unknown as yargs.Argv

installCommand.builder(yargs)
expect(yargs.epilogue).toBeCalledWith(
// eslint-disable-next-line no-irregular-whitespace
'Also see the Redwood CLI Reference (​https://redwoodjs.com/docs/cli-commands#datamigrate-install​)'

// The epilogue is a string that contains a link to the docs. The string
// contains special control characters when rendered in a terminal that
// supports clickable links. We use regular expressions and wildcards here
// to avoid having to match control characters that might not even always
// be there
expect(yargs.epilogue).toHaveBeenCalledWith(
expect.stringMatching(/Also see the .*Redwood CLI Reference.*/)
)
expect(yargs.epilogue).toHaveBeenCalledWith(
expect.stringMatching(
/https:\/\/redwoodjs\.com\/docs\/cli-commands#datamigrate-install/
)
)
})

Expand Down
4 changes: 2 additions & 2 deletions packages/graphql-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"@babel/runtime-corejs3": "7.23.6",
"@envelop/core": "4.0.3",
"@envelop/core": "5.0.0",
"@envelop/depth-limit": "3.0.3",
"@envelop/disable-introspection": "5.0.3",
"@envelop/filter-operation-type": "5.0.3",
Expand All @@ -41,7 +41,7 @@
"graphql": "16.8.1",
"graphql-scalars": "1.22.4",
"graphql-tag": "2.12.6",
"graphql-yoga": "4.0.4",
"graphql-yoga": "5.1.0",
"lodash": "4.17.21",
"uuid": "9.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/realtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"ioredis": "^5.3.2"
},
"devDependencies": {
"@envelop/core": "4.0.3",
"@envelop/core": "5.0.0",
"@envelop/testing": "6.0.3",
"@envelop/types": "4.0.1",
"esbuild": "0.19.9",
Expand Down
11 changes: 5 additions & 6 deletions packages/studio/api/fastify/yoga.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { FastifyInstance } from 'fastify'
import type { FastifyRequest, FastifyReply } from 'fastify'
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify'
import type { YogaServerInstance } from 'graphql-yoga'

export default async function routes(
Expand All @@ -12,7 +11,7 @@ export default async function routes(
req: FastifyRequest
reply: FastifyReply
},
Record<string, unknown>
{}
>
}
) {
Expand All @@ -24,9 +23,9 @@ export default async function routes(
req,
reply,
})
response.headers.forEach((value, key) => {
reply.header(key, value)
})
for (const [name, value] of response.headers) {
reply.header(name, value)
}
reply.status(response.status)
reply.send(response.body)
return reply
Expand Down
11 changes: 4 additions & 7 deletions packages/studio/api/graphql/yoga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,10 @@ export const setupYoga = (fastify: FastifyInstance) => {
},
})

const yoga = createYoga<
{
req: FastifyRequest
reply: FastifyReply
},
Record<string, unknown>
>({
const yoga = createYoga<{
req: FastifyRequest
reply: FastifyReply
}>({
schema,
logging: {
debug: (...args) => args.forEach((arg) => fastify.log.debug(arg)),
Expand Down
2 changes: 1 addition & 1 deletion packages/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"fastify-raw-body": "4.3.0",
"graphql": "16.8.1",
"graphql-scalars": "1.22.4",
"graphql-yoga": "4.0.4",
"graphql-yoga": "5.1.0",
"jsonwebtoken": "9.0.2",
"lodash": "4.17.21",
"mailparser": "3.6.5",
Expand Down
75 changes: 58 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2301,7 +2301,17 @@ __metadata:
languageName: node
linkType: hard

"@envelop/core@npm:4.0.3, @envelop/core@npm:^4.0.0":
"@envelop/core@npm:5.0.0, @envelop/core@npm:^5.0.0":
version: 5.0.0
resolution: "@envelop/core@npm:5.0.0"
dependencies:
"@envelop/types": "npm:5.0.0"
tslib: "npm:^2.5.0"
checksum: abc06585177a634d355fd7cec22a838086e6ccf20317f34b4b9eb92c4acb1aee7f09f621197f065619148a58de027a968ecb26d0bdee87bf0380769816ad4be2
languageName: node
linkType: hard

"@envelop/core@npm:^4.0.0":
version: 4.0.3
resolution: "@envelop/core@npm:4.0.3"
dependencies:
Expand Down Expand Up @@ -2397,6 +2407,15 @@ __metadata:
languageName: node
linkType: hard

"@envelop/types@npm:5.0.0":
version: 5.0.0
resolution: "@envelop/types@npm:5.0.0"
dependencies:
tslib: "npm:^2.5.0"
checksum: 0cbaa68218cb6121b58c6d354b0a17913ded042673df7bfcf385cac6c3b42713b82719875f553b31e8f059727ff5478ed11b33b4febf8deeaf902f1a92b212a8
languageName: node
linkType: hard

"@esbuild/android-arm64@npm:0.18.20":
version: 0.18.20
resolution: "@esbuild/android-arm64@npm:0.18.20"
Expand Down Expand Up @@ -4625,12 +4644,12 @@ __metadata:
languageName: node
linkType: hard

"@graphql-yoga/logger@npm:^1.0.0":
version: 1.0.0
resolution: "@graphql-yoga/logger@npm:1.0.0"
"@graphql-yoga/logger@npm:^2.0.0":
version: 2.0.0
resolution: "@graphql-yoga/logger@npm:2.0.0"
dependencies:
tslib: "npm:^2.5.2"
checksum: b43a7c86faad2447a696b2c4f46e9219cc1ae95484857c8f54e5ad4ba7d984a3f37149c45320659ffc89da2aefdb44ad2a68a5b57acb88d3aad86caad2a8bcfe
checksum: 1489588485c9974aba66c0e5002a1251085771b0703ac1aaa2a3df93b895fc57f7cf6203680ff453b304d4ba438ea6a4cc9999d13a4bf6fd5128f3f088ff927b
languageName: node
linkType: hard

Expand Down Expand Up @@ -4681,7 +4700,7 @@ __metadata:
languageName: node
linkType: hard

"@graphql-yoga/subscription@npm:4.0.0, @graphql-yoga/subscription@npm:^4.0.0":
"@graphql-yoga/subscription@npm:4.0.0":
version: 4.0.0
resolution: "@graphql-yoga/subscription@npm:4.0.0"
dependencies:
Expand All @@ -4693,6 +4712,18 @@ __metadata:
languageName: node
linkType: hard

"@graphql-yoga/subscription@npm:^5.0.0":
version: 5.0.0
resolution: "@graphql-yoga/subscription@npm:5.0.0"
dependencies:
"@graphql-yoga/typed-event-target": "npm:^3.0.0"
"@repeaterjs/repeater": "npm:^3.0.4"
"@whatwg-node/events": "npm:^0.1.0"
tslib: "npm:^2.5.2"
checksum: 05e2f5cb23ea2b3cfe3737cf13fb98ebb3ded8a6a8239a170a6bd65b443109595e1bf2bbef94e3b18438b63dae18761bce4225eb437420bae651131457ede8b5
languageName: node
linkType: hard

"@graphql-yoga/typed-event-target@npm:^2.0.0":
version: 2.0.0
resolution: "@graphql-yoga/typed-event-target@npm:2.0.0"
Expand All @@ -4703,6 +4734,16 @@ __metadata:
languageName: node
linkType: hard

"@graphql-yoga/typed-event-target@npm:^3.0.0":
version: 3.0.0
resolution: "@graphql-yoga/typed-event-target@npm:3.0.0"
dependencies:
"@repeaterjs/repeater": "npm:^3.0.4"
tslib: "npm:^2.5.2"
checksum: 563c26e4ef8f116e3b2991651acc2a80a37e1c53c6df4159e46e948b226624fc3c414663deef063fa19a7a63bc6a2d2ed8b950782b4d57f34eea775e3312d61c
languageName: node
linkType: hard

"@grpc/grpc-js@npm:~1.8.0":
version: 1.8.20
resolution: "@grpc/grpc-js@npm:1.8.20"
Expand Down Expand Up @@ -9000,7 +9041,7 @@ __metadata:
"@babel/cli": "npm:7.23.4"
"@babel/core": "npm:^7.22.20"
"@babel/runtime-corejs3": "npm:7.23.6"
"@envelop/core": "npm:4.0.3"
"@envelop/core": "npm:5.0.0"
"@envelop/depth-limit": "npm:3.0.3"
"@envelop/disable-introspection": "npm:5.0.3"
"@envelop/filter-operation-type": "npm:5.0.3"
Expand All @@ -9026,7 +9067,7 @@ __metadata:
graphql: "npm:16.8.1"
graphql-scalars: "npm:1.22.4"
graphql-tag: "npm:2.12.6"
graphql-yoga: "npm:4.0.4"
graphql-yoga: "npm:5.1.0"
jest: "npm:29.7.0"
jsonwebtoken: "npm:9.0.2"
lodash: "npm:4.17.21"
Expand Down Expand Up @@ -9224,7 +9265,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@redwoodjs/realtime@workspace:packages/realtime"
dependencies:
"@envelop/core": "npm:4.0.3"
"@envelop/core": "npm:5.0.0"
"@envelop/live-query": "npm:6.0.3"
"@envelop/testing": "npm:6.0.3"
"@envelop/types": "npm:4.0.1"
Expand Down Expand Up @@ -9389,7 +9430,7 @@ __metadata:
graphiql: "npm:3.0.10"
graphql: "npm:16.8.1"
graphql-scalars: "npm:1.22.4"
graphql-yoga: "npm:4.0.4"
graphql-yoga: "npm:5.1.0"
jest: "npm:29.7.0"
json-bigint-patch: "npm:0.0.8"
jsonwebtoken: "npm:9.0.2"
Expand Down Expand Up @@ -21728,24 +21769,24 @@ __metadata:
languageName: node
linkType: hard

"graphql-yoga@npm:4.0.4":
version: 4.0.4
resolution: "graphql-yoga@npm:4.0.4"
"graphql-yoga@npm:5.1.0":
version: 5.1.0
resolution: "graphql-yoga@npm:5.1.0"
dependencies:
"@envelop/core": "npm:^4.0.0"
"@envelop/core": "npm:^5.0.0"
"@graphql-tools/executor": "npm:^1.0.0"
"@graphql-tools/schema": "npm:^10.0.0"
"@graphql-tools/utils": "npm:^10.0.0"
"@graphql-yoga/logger": "npm:^1.0.0"
"@graphql-yoga/subscription": "npm:^4.0.0"
"@graphql-yoga/logger": "npm:^2.0.0"
"@graphql-yoga/subscription": "npm:^5.0.0"
"@whatwg-node/fetch": "npm:^0.9.7"
"@whatwg-node/server": "npm:^0.9.1"
dset: "npm:^3.1.1"
lru-cache: "npm:^10.0.0"
tslib: "npm:^2.5.2"
peerDependencies:
graphql: ^15.2.0 || ^16.0.0
checksum: 147471c0c2da15567b0f49f6f8e62d92761c4bee6a953152b1ecfa0041a56bd100b3975218680a35cfe30fdbaf0e9d9fbd764f4d63ec4c217afac27ce9c0bf5d
checksum: 9814a12c279ea52050367a2c803d50669a180347e94ddd48bfc0579ecf0b0c686bcc824df564a47f5c280c91214779515e35955c00ccdee6ac60fe45bd7f69ed
languageName: node
linkType: hard

Expand Down

0 comments on commit d25ed51

Please sign in to comment.