diff --git a/.github/scripts/publish_canary.sh b/.github/scripts/publish_canary.sh index 153f3466a438..3ed23efcc4fd 100755 --- a/.github/scripts/publish_canary.sh +++ b/.github/scripts/publish_canary.sh @@ -26,20 +26,32 @@ args+=( # `echo 'n'` to answer "no" to the "Are you sure you want to publish these # packages?" prompt. -# `|&` to pipe both stdout and stderr to grep. Mostly do this keep the github +# `2>&1` to pipe both stdout and stderr to grep. Mostly do this keep the github # action output clean. # At the end we use awk to increase the commit count by 1, because we'll commit # updated package.jsons in the next step, which will increase increase the # final number that lerna will use when publishing the canary packages. echo 'n' \ - | yarn lerna publish "${args[@]}" \ - |& grep '\-canary\.' \ + | yarn lerna publish "${args[@]}" 2>&1 \ + > publish_output +cat publish_output \ + | grep '\-canary\.' \ | tail -n 1 \ | sed 's/.*=> //' \ | sed 's/\+.*//' \ | awk -F. '{ $NF = $NF + 1 } 1' OFS=. \ > canary_version +if [ ! -s canary_version ]; then + echo "The canary_version file is empty or does not exist." + echo "'yarn lerna publish' output was:" + echo "---------------\n" + cat publish_output + echo "---------------\n" + + exit 1 +fi + # Update create-redwood-app templates to use canary packages sed "s/\"@redwoodjs\/\(.*\)\": \".*\"/\"@redwoodjs\/\1\": \"$(cat canary_version)\"/" \ diff --git a/__fixtures__/example-todo-main/web/src/graphql/fragment-masking.ts b/__fixtures__/example-todo-main/web/src/graphql/fragment-masking.ts index fbedede1f68e..aca71b13520e 100644 --- a/__fixtures__/example-todo-main/web/src/graphql/fragment-masking.ts +++ b/__fixtures__/example-todo-main/web/src/graphql/fragment-masking.ts @@ -20,25 +20,45 @@ export function useFragment( _documentNode: DocumentTypeDecoration, fragmentType: FragmentType> ): TType; +// return nullable if `fragmentType` is undefined +export function useFragment( + _documentNode: DocumentTypeDecoration, + fragmentType: FragmentType> | undefined +): TType | undefined; // return nullable if `fragmentType` is nullable +export function useFragment( + _documentNode: DocumentTypeDecoration, + fragmentType: FragmentType> | null +): TType | null; +// return nullable if `fragmentType` is nullable or undefined export function useFragment( _documentNode: DocumentTypeDecoration, fragmentType: FragmentType> | null | undefined ): TType | null | undefined; // return array of non-nullable if `fragmentType` is array of non-nullable +export function useFragment( + _documentNode: DocumentTypeDecoration, + fragmentType: Array>> +): Array; +// return array of nullable if `fragmentType` is array of nullable +export function useFragment( + _documentNode: DocumentTypeDecoration, + fragmentType: Array>> | null | undefined +): Array | null | undefined; +// return readonly array of non-nullable if `fragmentType` is array of non-nullable export function useFragment( _documentNode: DocumentTypeDecoration, fragmentType: ReadonlyArray>> ): ReadonlyArray; -// return array of nullable if `fragmentType` is array of nullable +// return readonly array of nullable if `fragmentType` is array of nullable export function useFragment( _documentNode: DocumentTypeDecoration, fragmentType: ReadonlyArray>> | null | undefined ): ReadonlyArray | null | undefined; export function useFragment( _documentNode: DocumentTypeDecoration, - fragmentType: FragmentType> | ReadonlyArray>> | null | undefined -): TType | ReadonlyArray | null | undefined { + fragmentType: FragmentType> | Array>> | ReadonlyArray>> | null | undefined +): TType | Array | ReadonlyArray | null | undefined { return fragmentType as any; } diff --git a/tasks/smoke-tests/rsc-kitchen-sink/tests/rsc-kitchen-sink.spec.ts b/tasks/smoke-tests/rsc-kitchen-sink/tests/rsc-kitchen-sink.spec.ts index 851e147be08b..b25a6bbc06e4 100644 --- a/tasks/smoke-tests/rsc-kitchen-sink/tests/rsc-kitchen-sink.spec.ts +++ b/tasks/smoke-tests/rsc-kitchen-sink/tests/rsc-kitchen-sink.spec.ts @@ -107,6 +107,8 @@ test('Submitting the form should return a response', async ({ page }) => { }) test('Page with Cell', async ({ page }) => { + await loginAsTestUser({ page, ...testUser }) + await page.goto('/user-examples') const h1 = await page.locator('h1').innerHTML() @@ -118,6 +120,8 @@ test('Page with Cell', async ({ page }) => { }) test("'use client' cell Empty state", async ({ page }) => { + await loginAsTestUser({ page, ...testUser }) + await page.goto('/empty-users') const h1 = await page.locator('h1').innerHTML() @@ -132,6 +136,8 @@ test("'use client' cell Empty state", async ({ page }) => { }) test("'use client' cell navigation", async ({ page }) => { + await loginAsTestUser({ page, ...testUser }) + await page.goto('/empty-users') await expect(page.getByText('No emptyUsers yet.')).toBeVisible()