Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into chore/move-m…
Browse files Browse the repository at this point in the history
…iddleware

* 'main' of github.com:redwoodjs/redwood:
  chore(server-store): Alias imports for getting request details to  `@redwoodjs/web/request` (redwoodjs#10904)
  chore(ci): Cleaner log when publishing, unless failure (redwoodjs#10919)
  chore(tests): Fix failing kitchen-sink tests by logging in (redwoodjs#10920)
  fix(internal gql): Update types in test fixture (redwoodjs#10918)
  debug(ci): Print publishing command output (redwoodjs#10916)
  chore(ci): Use more supported syntax in publish_canary script (redwoodjs#10915)
  chore(ci): Exit canary publishing if version cannot be determined (redwoodjs#10914)
  • Loading branch information
GitHub Actions committed Jul 6, 2024
2 parents 57e1f2f + 32d9b63 commit 31cb16a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
18 changes: 15 additions & 3 deletions .github/scripts/publish_canary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"/" \
Expand Down
26 changes: 23 additions & 3 deletions __fixtures__/example-todo-main/web/src/graphql/fragment-masking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,45 @@ export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
): TType;
// return nullable if `fragmentType` is undefined
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | undefined
): TType | undefined;
// return nullable if `fragmentType` is nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null
): TType | null;
// return nullable if `fragmentType` is nullable or undefined
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
): TType | null | undefined;
// return array of non-nullable if `fragmentType` is array of non-nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>>
): Array<TType>;
// return array of nullable if `fragmentType` is array of nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: Array<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): Array<TType> | null | undefined;
// return readonly array of non-nullable if `fragmentType` is array of non-nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
): ReadonlyArray<TType>;
// return array of nullable if `fragmentType` is array of nullable
// return readonly array of nullable if `fragmentType` is array of nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): ReadonlyArray<TType> | null | undefined;
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): TType | ReadonlyArray<TType> | null | undefined {
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | Array<FragmentType<DocumentTypeDecoration<TType, any>>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
): TType | Array<TType> | ReadonlyArray<TType> | null | undefined {
return fragmentType as any;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 31cb16a

Please sign in to comment.