Skip to content

Commit

Permalink
Merge branch 'main' of github.com:redwoodjs/redwood into try/dbauth-s…
Browse files Browse the repository at this point in the history
…sr-updated-forward-cookies

* 'main' of github.com:redwoodjs/redwood: (163 commits)
  chore(deps): update dependency @clerk/clerk-react to v4.28.3 (redwoodjs#9643)
  fix(deps): update prisma monorepo to v5.7.0 (redwoodjs#9642)
  fix(CLI): merge NODE_OPTIONS in `yarn rw dev` (redwoodjs#9585)
  chore(release): configure aloglia to index docs
  chore(release): handle OTP for lerna publish
  RSC: No need to patch Vite anymore (redwoodjs#9636)
  RSC: Remove unused code. Improve code organization (redwoodjs#9631)
  chore(release): improve tooling
  chore: Linting and disable some console logs (redwoodjs#9635)
  chore: Update Testing documentation to link to How to Test Email/Mailer (redwoodjs#9634)
  chore(release): fix open answer
  Add vscode web debugger and compound (redwoodjs#9567)
  RSC: Use Routes.tsx for (client-side) routing (redwoodjs#9630)
  RSC: Add RW env var definitions to Vite config and include FatalErrorBoundary (redwoodjs#9622)
  chore(release): add notes on redwoodjs#9624
  chore(release): add release:notes scripts, fix docs
  chore(deps): update dependency @clerk/clerk-react to v4.28.2 (redwoodjs#9625)
  fix(deps): update dependency @vitejs/plugin-react to v4.2.1 (redwoodjs#9626)
  fix(deps): update dependency vite to v4.5.1 (redwoodjs#9627)
  fix(deps): update storybook monorepo to v7.6.3 (redwoodjs#9628)
  ...
  • Loading branch information
dac09 committed Dec 8, 2023
2 parents 37adfa5 + fb3f1fb commit 0542ca7
Show file tree
Hide file tree
Showing 371 changed files with 19,479 additions and 17,219 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf8
charset = utf-8

[*.{js,jsx,ts,tsx,graphql,sql,md,html,mjml,json,jsonc,json5,yml,yaml,template,sh,Dockerfile}]
indent_style = space
Expand Down
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@3.6.3"
"packageManager": "yarn@3.7.0"
}
2 changes: 1 addition & 1 deletion .github/actions/check_test_project_fixture/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@3.6.3"
"packageManager": "yarn@3.7.0"
}
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@3.6.3"
"packageManager": "yarn@3.7.0"
}
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ jobs:

- uses: actions/checkout@v4

# Temporarily pinned to `18.18` because `18.19` has a breaking change
# related to loaders affecting one of our tests.
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 18.18

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand All @@ -119,7 +121,7 @@ jobs:
- name: Get number of CPU cores
if: always()
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2

- name: 🧪 Test
run: yarn test-ci ${{ steps.cpu-cores.outputs.count }}
Expand Down
41 changes: 0 additions & 41 deletions .github/workflows/monthly_issue_metrics.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ jobs:
with:
fetch-depth: 0

# Temporarily pinned to `18.18` because `18.19` has a breaking change
# related to loaders affecting one of our tests.
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 18.18

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish-release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ jobs:
# This is required because lerna uses tags to determine the version.
fetch-depth: 0

# Temporarily pinned to `18.18` because `18.19` has a breaking change
# related to loaders affecting one of our tests.
- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 18.18

- name: 🐈 Set up yarn cache
uses: ./.github/actions/set-up-yarn-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/require-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: 🏷 Require release label
runs-on: ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v4
- uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/weekly_issue_metrics.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.icloud
.cosine
.idea
.DS_Store
node_modules
Expand All @@ -8,7 +9,6 @@ yarn-error.log
**/*.tsbuildinfo
tasks/.verdaccio
tasks/e2e/cypress/fixtures/example.json
tasks/release/*.md
tmp/
blog-test-project/*
.yarn/*
Expand Down
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

875 changes: 875 additions & 0 deletions .yarn/releases/yarn-3.7.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ plugins:

preferInteractive: true

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-3.7.0.cjs

2 changes: 1 addition & 1 deletion __fixtures__/empty-project/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
v18
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const store = {
d67f5d54ba7d2a94e34809f20a0380f9921a5586:
'mutation AddTodo_CreateTodo($body: String!) { __typename createTodo(body: $body) { __typename body id status } }',
'81a7e7b720f992f8cfcaab15f42cf5a6802ed338':
'query NumTodosCell_GetCount { __typename todosCount }',
a9d0f2c090ac4320919f631ab0003fcdd2c30652:
'query TodoListCell_GetTodos { __typename todos { __typename body id status } }',
'69a8d2c6640912a8323a729adae2cc2f2f1bdb59':
'mutation TodoListCell_CheckTodo($id: Int!, $status: String!) { __typename updateTodoStatus(id: $id, status: $status) { __typename id status } }',
}
66 changes: 66 additions & 0 deletions __fixtures__/example-todo-main/web/src/graphql/fragment-masking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
import { FragmentDefinitionNode } from 'graphql';
import { Incremental } from './graphql';


export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
infer TType,
any
>
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
? TKey extends string
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
: never
: never
: never;

// return non-nullable if `fragmentType` is non-nullable
export function useFragment<TType>(
_documentNode: DocumentTypeDecoration<TType, any>,
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
): TType;
// return nullable if `fragmentType` is nullable
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: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
): ReadonlyArray<TType>;
// return 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 {
return fragmentType as any;
}


export function makeFragmentData<
F extends DocumentTypeDecoration<any, any>,
FT extends ResultOf<F>
>(data: FT, _fragment: F): FragmentType<F> {
return data as FragmentType<F>;
}
export function isFragmentReady<TQuery, TFrag>(
queryNode: DocumentTypeDecoration<TQuery, any>,
fragmentNode: TypedDocumentNode<TFrag>,
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
): data is FragmentType<typeof fragmentNode> {
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
?.deferredFields;

if (!deferredFields) return true;

const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
const fragName = fragDef?.name?.value;

const fields = (fragName && deferredFields[fragName]) || [];
return fields.length > 0 && fields.every(field => data && field in data);
}
73 changes: 73 additions & 0 deletions __fixtures__/example-todo-main/web/src/graphql/gql.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* eslint-disable */
import * as types from "./graphql";
import { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";

/**
* Map of all GraphQL operations in the project.
*
* This map has several performance disadvantages:
* 1. It is not tree-shakeable, so it will include all operations in the project.
* 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.
* 3. It does not support dead code elimination, so it will add unused operations.
*
* Therefore it is highly recommended to use the babel or swc plugin for production.
*/
const documents = {
"\n mutation AddTodo_CreateTodo($body: String!) {\n createTodo(body: $body) {\n id\n __typename\n body\n status\n }\n }\n":
types.AddTodo_CreateTodoDocument,
"\n query NumTodosCell_GetCount {\n todosCount\n }\n":
types.NumTodosCell_GetCountDocument,
"\n query TodoListCell_GetTodos {\n todos {\n id\n body\n status\n }\n }\n":
types.TodoListCell_GetTodosDocument,
"\n mutation TodoListCell_CheckTodo($id: Int!, $status: String!) {\n updateTodoStatus(id: $id, status: $status) {\n id\n __typename\n status\n }\n }\n":
types.TodoListCell_CheckTodoDocument,
};

/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*
*
* @example
* ```ts
* const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
* ```
*
* The query argument is unknown!
* Please regenerate the types.
*/
export function graphql(source: string): unknown;

/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "\n mutation AddTodo_CreateTodo($body: String!) {\n createTodo(body: $body) {\n id\n __typename\n body\n status\n }\n }\n"
): (typeof documents)["\n mutation AddTodo_CreateTodo($body: String!) {\n createTodo(body: $body) {\n id\n __typename\n body\n status\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "\n query NumTodosCell_GetCount {\n todosCount\n }\n"
): (typeof documents)["\n query NumTodosCell_GetCount {\n todosCount\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "\n query TodoListCell_GetTodos {\n todos {\n id\n body\n status\n }\n }\n"
): (typeof documents)["\n query TodoListCell_GetTodos {\n todos {\n id\n body\n status\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(
source: "\n mutation TodoListCell_CheckTodo($id: Int!, $status: String!) {\n updateTodoStatus(id: $id, status: $status) {\n id\n __typename\n status\n }\n }\n"
): (typeof documents)["\n mutation TodoListCell_CheckTodo($id: Int!, $status: String!) {\n updateTodoStatus(id: $id, status: $status) {\n id\n __typename\n status\n }\n }\n"];

export function graphql(source: string) {
return (documents as any)[source] ?? {};
}

export type DocumentType<TDocumentNode extends DocumentNode<any, any>> =
TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
export function gql(source: string) {
return graphql(source);
}
Loading

0 comments on commit 0542ca7

Please sign in to comment.