Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into feat/rsc-build
Browse files Browse the repository at this point in the history
* 'main' of github.com:redwoodjs/redwood: (22 commits)
  fix: Handle static assets on the `rw-serve-fe` (redwoodjs#10018)
  fix(server): fix env var loading in `createServer` (redwoodjs#10021)
  fix(deps): remove react types packages from `@redwoodjs/testing` dependencies (redwoodjs#10020)
  chore(release): add back `update-package-versions` task (redwoodjs#10017)
  chore(renovate): Disable for experimental apollo package (redwoodjs#10016)
  RSC: server cells lowercase data function (redwoodjs#10015)
  fix(RSC/SSR): pass CLI options through to apiServerHandler (redwoodjs#10012)
  7.0 RC: Remove hardcoded check for `session.id` (redwoodjs#10013)
  Spelling fix in what-is-redwood.md (redwoodjs#10011)
  Typos in realtime.md (redwoodjs#10010)
  RSC: Server cell smoke tests (redwoodjs#10008)
  RSC: test-project EmptyUser 'use client' cell (redwoodjs#10007)
  RSC: babel-plugin-redwood-cell remove redundant reset (redwoodjs#10006)
  chore(deps): Upgrade to yarn v4.1.0 (redwoodjs#10002)
  fix(docs): Spelling of `data-migrate` command (redwoodjs#10003)
  docs: add aliases fo `type-check` command (redwoodjs#10004)
  RSC: Insert 'use client' in scaffolded components (redwoodjs#9998)
  fix(telemetry): Fix 'destroy' spelling (redwoodjs#10000)
  chore(jsdocs): Fix jsdoc formatting for hover help (redwoodjs#9999)
  bug: Update setupHandler.ts firebase version (redwoodjs#9997)
  ...
  • Loading branch information
dac09 committed Feb 16, 2024
2 parents a59b10c + 4891360 commit fbc3384
Show file tree
Hide file tree
Showing 88 changed files with 5,740 additions and 4,327 deletions.
2 changes: 1 addition & 1 deletion .github/actions/check_create_redwood_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@4.1.0"
}
12 changes: 6 additions & 6 deletions .github/actions/check_create_redwood_app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __metadata:
dependencies:
"@actions/http-client": "npm:^2.0.1"
uuid: "npm:^8.3.2"
checksum: 8c0/7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
checksum: 10c0/7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
languageName: node
linkType: hard

Expand All @@ -20,7 +20,7 @@ __metadata:
resolution: "@actions/exec@npm:1.1.1"
dependencies:
"@actions/io": "npm:^1.0.1"
checksum: 8c0/4a09f6bdbe50ce68b5cf8a7254d176230d6a74bccf6ecc3857feee209a8c950ba9adec87cc5ecceb04110182d1c17117234e45557d72fde6229b7fd3a395322a
checksum: 10c0/4a09f6bdbe50ce68b5cf8a7254d176230d6a74bccf6ecc3857feee209a8c950ba9adec87cc5ecceb04110182d1c17117234e45557d72fde6229b7fd3a395322a
languageName: node
linkType: hard

Expand All @@ -29,14 +29,14 @@ __metadata:
resolution: "@actions/http-client@npm:2.0.1"
dependencies:
tunnel: "npm:^0.0.6"
checksum: 8c0/b58987ba2f53d7988f612ede7ff834573a3360c21f8fdea9fea92f26ada0fd0efafb22aa7d83f49c18965a5b765775d5253e2edb8d9476d924c4b304ef726b67
checksum: 10c0/b58987ba2f53d7988f612ede7ff834573a3360c21f8fdea9fea92f26ada0fd0efafb22aa7d83f49c18965a5b765775d5253e2edb8d9476d924c4b304ef726b67
languageName: node
linkType: hard

"@actions/io@npm:^1.0.1":
version: 1.1.2
resolution: "@actions/io@npm:1.1.2"
checksum: 8c0/61c871bbee1cf58f57917d9bb2cf6bb7ea4dc40de3f65c7fb4ec619ceff57fc98f56be9cca2d476b09e7a96e1cba0d88cd125c4f690d384b9483935186f256c1
checksum: 10c0/61c871bbee1cf58f57917d9bb2cf6bb7ea4dc40de3f65c7fb4ec619ceff57fc98f56be9cca2d476b09e7a96e1cba0d88cd125c4f690d384b9483935186f256c1
languageName: node
linkType: hard

Expand All @@ -52,7 +52,7 @@ __metadata:
"tunnel@npm:^0.0.6":
version: 0.0.6
resolution: "tunnel@npm:0.0.6"
checksum: 8c0/e27e7e896f2426c1c747325b5f54efebc1a004647d853fad892b46d64e37591ccd0b97439470795e5262b5c0748d22beb4489a04a0a448029636670bfd801b75
checksum: 10c0/e27e7e896f2426c1c747325b5f54efebc1a004647d853fad892b46d64e37591ccd0b97439470795e5262b5c0748d22beb4489a04a0a448029636670bfd801b75
languageName: node
linkType: hard

Expand All @@ -61,6 +61,6 @@ __metadata:
resolution: "uuid@npm:8.3.2"
bin:
uuid: dist/bin/uuid
checksum: 8c0/bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54
checksum: 10c0/bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54
languageName: node
linkType: hard
2 changes: 1 addition & 1 deletion .github/actions/detect-changes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@4.1.0"
}
12 changes: 6 additions & 6 deletions .github/actions/detect-changes/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __metadata:
dependencies:
"@actions/http-client": "npm:^2.0.1"
uuid: "npm:^8.3.2"
checksum: 7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
checksum: 10c0/7a61446697a23dcad3545cf0634dedbdedf20ae9a0ee6ee977554589a15deb4a93593ee48a41258933d58ce0778f446b0d2c162b60750956fb75e0b9560fb832
languageName: node
linkType: hard

Expand All @@ -20,7 +20,7 @@ __metadata:
resolution: "@actions/exec@npm:1.1.1"
dependencies:
"@actions/io": "npm:^1.0.1"
checksum: 4a09f6bdbe50ce68b5cf8a7254d176230d6a74bccf6ecc3857feee209a8c950ba9adec87cc5ecceb04110182d1c17117234e45557d72fde6229b7fd3a395322a
checksum: 10c0/4a09f6bdbe50ce68b5cf8a7254d176230d6a74bccf6ecc3857feee209a8c950ba9adec87cc5ecceb04110182d1c17117234e45557d72fde6229b7fd3a395322a
languageName: node
linkType: hard

Expand All @@ -29,14 +29,14 @@ __metadata:
resolution: "@actions/http-client@npm:2.0.1"
dependencies:
tunnel: "npm:^0.0.6"
checksum: b58987ba2f53d7988f612ede7ff834573a3360c21f8fdea9fea92f26ada0fd0efafb22aa7d83f49c18965a5b765775d5253e2edb8d9476d924c4b304ef726b67
checksum: 10c0/b58987ba2f53d7988f612ede7ff834573a3360c21f8fdea9fea92f26ada0fd0efafb22aa7d83f49c18965a5b765775d5253e2edb8d9476d924c4b304ef726b67
languageName: node
linkType: hard

"@actions/io@npm:^1.0.1":
version: 1.1.2
resolution: "@actions/io@npm:1.1.2"
checksum: 61c871bbee1cf58f57917d9bb2cf6bb7ea4dc40de3f65c7fb4ec619ceff57fc98f56be9cca2d476b09e7a96e1cba0d88cd125c4f690d384b9483935186f256c1
checksum: 10c0/61c871bbee1cf58f57917d9bb2cf6bb7ea4dc40de3f65c7fb4ec619ceff57fc98f56be9cca2d476b09e7a96e1cba0d88cd125c4f690d384b9483935186f256c1
languageName: node
linkType: hard

Expand All @@ -52,7 +52,7 @@ __metadata:
"tunnel@npm:^0.0.6":
version: 0.0.6
resolution: "tunnel@npm:0.0.6"
checksum: e27e7e896f2426c1c747325b5f54efebc1a004647d853fad892b46d64e37591ccd0b97439470795e5262b5c0748d22beb4489a04a0a448029636670bfd801b75
checksum: 10c0/e27e7e896f2426c1c747325b5f54efebc1a004647d853fad892b46d64e37591ccd0b97439470795e5262b5c0748d22beb4489a04a0a448029636670bfd801b75
languageName: node
linkType: hard

Expand All @@ -61,6 +61,6 @@ __metadata:
resolution: "uuid@npm:8.3.2"
bin:
uuid: dist/bin/uuid
checksum: bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54
checksum: 10c0/bcbb807a917d374a49f475fae2e87fdca7da5e5530820ef53f65ba1d12131bd81a92ecf259cc7ce317cbe0f289e7d79fdfebcef9bfa3087c8c8a2fa304c9be54
languageName: node
linkType: hard
9 changes: 9 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
"sort-package-json",
"zx"
]
},

{
"groupName": "experimental",
"enabled": false,

"matchPackageNames": [
"@apollo/experimental-nextjs-app-support"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ You don't need to commit any other contents of this directory to your version co
| :---------------- | :------- |
| commandCache.json | This file contains mappings to assist the Redwood CLI in efficiently executing commands. |
| schema.graphql | This is the GraphQL schema which has been automatically generated from your Redwood project. |
| studio.db | The sqlite database used by the experimental `rw exp studio` feature. |
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
| test.db | The sqlite database used when running tests. |

Expand All @@ -32,6 +31,7 @@ You don't need to commit any other contents of this directory to your version co
| telemetry | Stores the recent telemetry that the Redwood CLI has generated. You may inspect these files to see everything Redwood is anonymously collecting. |
| types | Stores the results of type generation. |
| updateCheck | Stores a file which contains the results of checking for Redwood updates. |
| studio | Used to store data for `rw studio` |

We try to keep this README up to date but you may, from time to time, find other files or directories in this `.redwood` directory that have not yet been documented here. This is likely nothing to worry about but feel free to let us know and we'll update this list.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.3.0",
"configurations": [
{
"command": "yarn redwood dev --apiDebugPort 18911",
"command": "yarn redwood dev --apiDebugPort 18911", // you can add --fwd='--open=false' to prevent the browser from opening
"name": "Run Dev Server",
"request": "launch",
"type": "node-terminal"
Expand All @@ -18,7 +18,16 @@
"localRoot": "${workspaceFolder}/node_modules/@redwoodjs/api-server/dist",
"remoteRoot": "${workspaceFolder}/node_modules/@redwoodjs/api-server/dist",
"sourceMaps": true,
"restart": true
"restart": true,
"preLaunchTask": "WaitForDevServer",
},
{
"name": "Launch Web debugger",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8910",
"webRoot": "${workspaceRoot}/web/src",
"preLaunchTask": "WaitForDevServer",
},
{
"command": "yarn redwood test api",
Expand All @@ -32,5 +41,16 @@
"request": "launch",
"type": "node-terminal"
},
],
"compounds": [
{
"name": "Start Debug",
"configurations": [
"Run Dev Server",
"Attach API debugger",
"Launch Web debugger"
],
"stopAll": true
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "WaitForDevServer",
"group": "none",
"type": "shell",
"command": "bash",
"args": [
"-c",
"while ! echo -n > /dev/tcp/localhost/18911; do sleep 1; done;"
],
"windows": {
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy", "Bypass",
"while (-not (Test-NetConnection -ComputerName localhost -Port 18911)) { Start-Sleep -Seconds 1 };"
]
},
"presentation": {
"reveal": "silent",
"revealProblems": "onProblem",
"panel": "shared",
"close": true
}
},
]
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- CreateTable
CREATE TABLE "EmptyUser" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"email" TEXT NOT NULL,
"name" TEXT
);

-- CreateIndex
CREATE UNIQUE INDEX "EmptyUser_email_key" ON "EmptyUser"("email");
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Don't forget to tell Prisma about your edits to this file using
// `yarn rw prisma migrate dev` or `yarn rw prisma db push`.
// `migrate` is like committing while `push` is for prototyping.
// Read more about both here:
// https://www.prisma.io/docs/orm/prisma-migrate

datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
Expand All @@ -16,3 +22,9 @@ model UserExample {
email String @unique
name String?
}

model EmptyUser {
id Int @id @default(autoincrement())
email String @unique
name String?
}
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": "7.0.0-canary.981",
"@redwoodjs/graphql-server": "7.0.0-canary.981"
"@redwoodjs/api": "7.0.0-canary.993",
"@redwoodjs/graphql-server": "7.0.0-canary.993"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
export const schema = gql`
type EmptyUser {
id: Int!
email: String!
name: String
}
type Query {
emptyUsers: [EmptyUser!]! @requireAuth
emptyUser(id: Int!): EmptyUser @requireAuth
}
input CreateEmptyUserInput {
email: String!
name: String
}
input UpdateEmptyUserInput {
email: String
name: String
}
type Mutation {
createEmptyUser(input: CreateEmptyUserInput!): EmptyUser! @requireAuth
updateEmptyUser(id: Int!, input: UpdateEmptyUserInput!): EmptyUser!
@requireAuth
deleteEmptyUser(id: Int!): EmptyUser! @requireAuth
}
`
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ export const hasRole = ({ roles }) => {
export const requireAuth = ({ roles }) => {
return isAuthenticated()
}

export const getCurrentUser = async () => {
throw new Error(
'Auth is not set up yet. See https://redwoodjs.com/docs/authentication ' +
'to get started'
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Prisma, EmptyUser } from '@prisma/client'
import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.EmptyUserCreateArgs>({
emptyUser: {
one: { data: { email: 'String5770021' } },
two: { data: { email: 'String5278315' } },
},
})

export type StandardScenario = ScenarioData<EmptyUser, 'emptyUser'>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import type { EmptyUser } from '@prisma/client'

import {
emptyUsers,
emptyUser,
createEmptyUser,
updateEmptyUser,
deleteEmptyUser,
} from './emptyUsers'
import type { StandardScenario } from './emptyUsers.scenarios'

// Generated boilerplate tests do not account for all circumstances
// and can fail without adjustments, e.g. Float.
// Please refer to the RedwoodJS Testing Docs:
// https://redwoodjs.com/docs/testing#testing-services
// https://redwoodjs.com/docs/testing#jest-expect-type-considerations

describe('emptyUsers', () => {
scenario('returns all emptyUsers', async (scenario: StandardScenario) => {
const result = await emptyUsers()

expect(result.length).toEqual(Object.keys(scenario.emptyUser).length)
})

scenario('returns a single emptyUser', async (scenario: StandardScenario) => {
const result = await emptyUser({ id: scenario.emptyUser.one.id })

expect(result).toEqual(scenario.emptyUser.one)
})

scenario('creates a emptyUser', async () => {
const result = await createEmptyUser({
input: { email: 'String8450568' },
})

expect(result.email).toEqual('String8450568')
})

scenario('updates a emptyUser', async (scenario: StandardScenario) => {
const original = (await emptyUser({
id: scenario.emptyUser.one.id,
})) as EmptyUser
const result = await updateEmptyUser({
id: original.id,
input: { email: 'String82168002' },
})

expect(result.email).toEqual('String82168002')
})

scenario('deletes a emptyUser', async (scenario: StandardScenario) => {
const original = (await deleteEmptyUser({
id: scenario.emptyUser.one.id,
})) as EmptyUser
const result = await emptyUser({ id: original.id })

expect(result).toEqual(null)
})
})
Loading

0 comments on commit fbc3384

Please sign in to comment.