forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:redwoodjs/redwood into feat/rsc-build
* '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
Showing
88 changed files
with
5,740 additions
and
4,327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
__fixtures__/test-project-rsc-external-packages-and-cells/.vscode/tasks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 modified
BIN
+8 KB
(130%)
__fixtures__/test-project-rsc-external-packages-and-cells/api/db/dev.db
Binary file not shown.
9 changes: 9 additions & 0 deletions
9
...rsc-external-packages-and-cells/api/db/migrations/20240212134007_empty_user/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
__fixtures__/test-project-rsc-external-packages-and-cells/api/src/graphql/emptyUsers.sdl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...oject-rsc-external-packages-and-cells/api/src/services/emptyUsers/emptyUsers.scenarios.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'> |
59 changes: 59 additions & 0 deletions
59
...st-project-rsc-external-packages-and-cells/api/src/services/emptyUsers/emptyUsers.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
}) | ||
}) |
Oops, something went wrong.