Skip to content

Commit

Permalink
improve site
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Jan 29, 2024
1 parent 9fae2e1 commit 2339a33
Show file tree
Hide file tree
Showing 16 changed files with 5,458 additions and 5,402 deletions.
2 changes: 1 addition & 1 deletion packages/myreact/src/share/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const enableDebugFiled = createRef(true);
/**
* @internal
*/
export const enableMockReact = createReadonlyRef(false);
export const enableMockReact = createReadonlyRef(true);

/**
* @internal
Expand Down
6 changes: 5 additions & 1 deletion scripts/rollupBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const externalReact = (id: string) =>
id.includes("@my-react/react-refresh") ||
(id.includes("node_modules") && !id.includes("tslib"));

const start = async () => {
const buildPackages = async () => {
await rollupBuild({ packageName: "myreact-shared", packageScope: "packages", external: externalReact });
await rollupBuild({ packageName: "myreact", packageScope: "packages", external: externalReact });
await rollupBuild({ packageName: "myreact-jsx", packageScope: "packages", external: externalReact });
Expand All @@ -18,6 +18,10 @@ const start = async () => {
await rollupBuild({ packageName: "myreact-refresh", packageScope: "packages", external: externalReact });
await rollupBuild({ packageName: "myreact-vite", packageScope: "packages", external: externalReact });
await rollupBuild({ packageName: "myreact-refresh-tools", packageScope: "packages", external: externalReact });
}

const start = async () => {
await buildPackages();
await rollupBuild({ packageName: "graphql", packageScope: "site", external });
await rollupBuild({ packageName: "webpack", packageScope: "site", external });
process.exit(0);
Expand Down
8 changes: 8 additions & 0 deletions site/graphql/src/document/repo.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
query getRepoAbout ($name: String!, $owner: String!) {
repository(name: $name, owner: $owner) {
description
url
homepageUrl
descriptionHTML
}
}
81 changes: 66 additions & 15 deletions site/graphql/src/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type * as SchemaTypes from "./schema";

import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";
export type GetViewerQueryVariables = SchemaTypes.Exact<{
first?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]>;
first?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]["input"]>;
}>;

export type GetViewerQuery = {
Expand All @@ -24,13 +24,13 @@ export type GetViewerQuery = {
};

export type GetBlogListQueryVariables = SchemaTypes.Exact<{
name: SchemaTypes.Scalars["String"];
owner: SchemaTypes.Scalars["String"];
first?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]>;
last?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]>;
after?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["String"]>;
before?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["String"]>;
labels?: SchemaTypes.InputMaybe<Array<SchemaTypes.Scalars["String"]> | SchemaTypes.Scalars["String"]>;
name: SchemaTypes.Scalars["String"]["input"];
owner: SchemaTypes.Scalars["String"]["input"];
first?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]["input"]>;
last?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]["input"]>;
after?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["String"]["input"]>;
before?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["String"]["input"]>;
labels?: SchemaTypes.InputMaybe<Array<SchemaTypes.Scalars["String"]["input"]> | SchemaTypes.Scalars["String"]["input"]>;
orderBy?: SchemaTypes.InputMaybe<SchemaTypes.IssueOrder>;
states?: SchemaTypes.InputMaybe<Array<SchemaTypes.IssueState> | SchemaTypes.IssueState>;
filterBy?: SchemaTypes.InputMaybe<SchemaTypes.IssueFilters>;
Expand Down Expand Up @@ -66,11 +66,11 @@ export type GetBlogListQuery = {
};

export type GetSingleBlogQueryVariables = SchemaTypes.Exact<{
name: SchemaTypes.Scalars["String"];
owner: SchemaTypes.Scalars["String"];
number: SchemaTypes.Scalars["Int"];
first?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]>;
after?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["String"]>;
name: SchemaTypes.Scalars["String"]["input"];
owner: SchemaTypes.Scalars["String"]["input"];
number: SchemaTypes.Scalars["Int"]["input"];
first?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["Int"]["input"]>;
after?: SchemaTypes.InputMaybe<SchemaTypes.Scalars["String"]["input"]>;
}>;

export type GetSingleBlogQuery = {
Expand Down Expand Up @@ -113,9 +113,16 @@ export type GetSingleBlogQuery = {
} | null;
};

export type GetRepoAboutQueryVariables = SchemaTypes.Exact<{
name: SchemaTypes.Scalars["String"]["input"];
owner: SchemaTypes.Scalars["String"]["input"];
}>;

export type GetRepoAboutQuery = { repository?: { description?: string | null; url: any; homepageUrl?: any | null; descriptionHTML: any } | null };

export type GetStarCountQueryVariables = SchemaTypes.Exact<{
name: SchemaTypes.Scalars["String"];
owner: SchemaTypes.Scalars["String"];
name: SchemaTypes.Scalars["String"]["input"];
owner: SchemaTypes.Scalars["String"]["input"];
}>;

export type GetStarCountQuery = { repository?: { id: string; stargazerCount: number } | null };
Expand Down Expand Up @@ -497,6 +504,50 @@ export const GetSingleBlogDocument = {
},
],
} as unknown as DocumentNode<GetSingleBlogQuery, GetSingleBlogQueryVariables>;
export const GetRepoAboutDocument = {
kind: "Document",
definitions: [
{
kind: "OperationDefinition",
operation: "query",
name: { kind: "Name", value: "getRepoAbout" },
variableDefinitions: [
{
kind: "VariableDefinition",
variable: { kind: "Variable", name: { kind: "Name", value: "name" } },
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } },
},
{
kind: "VariableDefinition",
variable: { kind: "Variable", name: { kind: "Name", value: "owner" } },
type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } },
},
],
selectionSet: {
kind: "SelectionSet",
selections: [
{
kind: "Field",
name: { kind: "Name", value: "repository" },
arguments: [
{ kind: "Argument", name: { kind: "Name", value: "name" }, value: { kind: "Variable", name: { kind: "Name", value: "name" } } },
{ kind: "Argument", name: { kind: "Name", value: "owner" }, value: { kind: "Variable", name: { kind: "Name", value: "owner" } } },
],
selectionSet: {
kind: "SelectionSet",
selections: [
{ kind: "Field", name: { kind: "Name", value: "description" } },
{ kind: "Field", name: { kind: "Name", value: "url" } },
{ kind: "Field", name: { kind: "Name", value: "homepageUrl" } },
{ kind: "Field", name: { kind: "Name", value: "descriptionHTML" } },
],
},
},
],
},
},
],
} as unknown as DocumentNode<GetRepoAboutQuery, GetRepoAboutQueryVariables>;
export const GetStarCountDocument = {
kind: "Document",
definitions: [
Expand Down
Loading

0 comments on commit 2339a33

Please sign in to comment.