Skip to content

Commit e35482e

Browse files
authored
Website: update guild/component + config (#2281)
1 parent 170f48a commit e35482e

File tree

9 files changed

+260
-213
lines changed

9 files changed

+260
-213
lines changed

website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"analyze": "cross-env ANALYZE=true next build"
1212
},
1313
"dependencies": {
14-
"@theguild/components": "4.2.4",
14+
"@theguild/components": "4.3.6",
1515
"next": "12.3.1",
1616
"next-sitemap": "3.1.23",
1717
"react": "18.2.0",
@@ -32,7 +32,7 @@
3232
},
3333
"devDependencies": {
3434
"@theguild/algolia": "1.0.1",
35-
"@theguild/tailwind-config": "0.1.3",
35+
"@theguild/tailwind-config": "0.2.1",
3636
"@types/node": "18.7.18",
3737
"@types/react": "18.0.21",
3838
"cross-env": "7.0.3",

website/src/pages/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"index": {
33
"title": "Home",
44
"type": "page",
5+
"display": "hidden",
56
"theme": {
67
"layout": "raw"
78
}

website/src/pages/docs/di/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ We learned not to force Dependency Injection too early in the process, because d
88

99
GraphQL Modules let you choose whether to use dependency injection or not.
1010

11-
<Callout type="warning" emoji='⚠️'>
11+
<Callout type="warning">
1212
GraphQL Modules depend on **Reflect API** and specifically **design:paramtypes** for reflection and for defining dependencies between DI parts, please install and import `reflect-metadata` before every other module.
1313

1414
```typescript

website/src/pages/docs/di/scopes.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Scope defines a life cycle of `Providers` and `InjectionToken`. There are two ki
88

99
As mentioned before, `Singleton` scope is the default choice in GraphQL Modules. Every Service and Token is created even before the first incoming GraphQL operation and never gets destroyed (only when Node process is terminated).
1010

11-
<Callout type='warning' emoji='⚠️'>
11+
<Callout type='warning' >
1212
We decided to make it the default choice, because of performance-related
1313
reasons. In most cases, there's no need to instantiate classes on every new
1414
request and dispose them later on.
@@ -58,7 +58,7 @@ export const myModule = createModule({
5858

5959
All classes and values are created within the context of execution, meaning every incoming GraphQL Operation.
6060

61-
<Callout type="warning" emoji='⚠️'>
61+
<Callout type="warning">
6262
Because of performance-related reasons, we recommend using Singletons whenever
6363
possible.
6464
</Callout>

website/src/pages/docs/essentials/testing.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { testkit } from 'graphql-modules'
1212

1313
The `testkit` object and its API will grow over time, we expect to implement more and more useful features in upcoming releases.
1414

15-
<Callout type="warning" emoji='⚠️'>
15+
<Callout type="warning">
1616
GraphQL Modules depend on **Reflect API** for reflection and for defining
1717
dependencies between DI parts, please import `reflect-metadata` in every test
1818
file or setup your testing framework to import it somewhere globally.
@@ -61,7 +61,7 @@ In the example above we modified the original application by setting testing `EN
6161

6262
Now let's talk about `addProviders()` function. It allows you to overwrite application-level providers.
6363

64-
<Callout type="warning" emoji='⚠️'>
64+
<Callout type="warning">
6565
In GraphQL Modules, always the last provider wins. What does it mean? When you
6666
pass a list of providers and two of them try to provide the same token, only
6767
the last one counts.

website/src/pages/docs/essentials/type-definitions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const myModule = createModule({
2727
})
2828
```
2929

30-
<Callout type="warning" emoji='⚠️'>
30+
<Callout type="warning">
3131
Using `string`s could be possible, but we decided to force a better pattern.
3232
Using `gql` tag means your IDE can highlight the GraphQL SDL and in general
3333
works better with other tools from the GraphQL ecosystem.

website/src/pages/docs/get-started.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { PackageCmd, Tabs, Tab, Callout } from '@theguild/components'
44

55
To start using GraphQL Modules, all you need is to install its package and `graphql`.
66

7-
<Callout type="warning" emoji='⚠️'>
7+
<Callout type="warning">
88
We highly recommend to use TypeScript for writing your backend, since it
99
provides support for Reflection (if you plan to use dependency injection) and
1010
makes it easier to develop API services.
@@ -73,7 +73,7 @@ const application = createApplication({
7373
const mySchema = application.schema
7474
```
7575

76-
<Callout type="warning" emoji='⚠️'>
76+
<Callout type="warning">
7777
Application doesn't allow providing schemas or resolvers, since it's only
7878
a loader of your various modules.
7979
</Callout>

website/theme.config.tsx

Lines changed: 23 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,32 @@
11
/* eslint sort-keys: error */
2-
import {
3-
defineConfig,
4-
Giscus,
5-
ModulesLogo,
6-
useTheme,
7-
} from '@theguild/components';
2+
import { defineConfig, Giscus, useTheme } from '@theguild/components';
83
import { useRouter } from 'next/router';
94

10-
const SITE_NAME = 'GraphQL Modules';
11-
125
export default defineConfig({
136
docsRepositoryBase:
147
'https://github.com/Urigo/graphql-modules/tree/master/website',
15-
head: (
16-
<>
17-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
18-
<meta name="description" content={`${SITE_NAME}: documentation`} />
19-
<meta name="og:title" content={`${SITE_NAME}: documentation`} />
20-
</>
21-
),
22-
logo: (
23-
<>
24-
<ModulesLogo className="mr-1.5 h-9 w-9" />
25-
<div>
26-
<h1 className="md:text-md text-sm font-medium">{SITE_NAME}</h1>
27-
<h2 className="hidden text-xs sm:block">
28-
Enterprise Grade Tooling for Your GraphQL Server
29-
</h2>
30-
</div>
31-
</>
32-
),
33-
main: {
34-
extraContent() {
35-
const { resolvedTheme } = useTheme();
36-
const { route } = useRouter();
8+
main({ children }) {
9+
const { resolvedTheme } = useTheme();
10+
const { route } = useRouter();
3711

38-
if (route === '/') {
39-
return null;
40-
}
41-
return (
42-
<Giscus
43-
// ensure giscus is reloaded when client side route is changed
44-
key={route}
45-
repo="Urigo/graphql-modules"
46-
repoId="MDEwOlJlcG9zaXRvcnkxMzI5Mjc2NjU="
47-
category="Docs Discussions"
48-
categoryId="DIC_kwDOB-xQsc4CSDST"
49-
mapping="pathname"
50-
theme={resolvedTheme}
51-
/>
52-
);
53-
},
12+
const comments = route !== '/' && (
13+
<Giscus
14+
// ensure giscus is reloaded when client side route is changed
15+
key={route}
16+
repo="Urigo/graphql-modules"
17+
repoId="MDEwOlJlcG9zaXRvcnkxMzI5Mjc2NjU="
18+
category="Docs Discussions"
19+
categoryId="DIC_kwDOB-xQsc4CSDST"
20+
mapping="pathname"
21+
theme={resolvedTheme}
22+
/>
23+
);
24+
return (
25+
<>
26+
{children}
27+
{comments}
28+
</>
29+
);
5430
},
55-
titleSuffix: ` – ${SITE_NAME}`,
31+
siteName: 'MODULES',
5632
});

0 commit comments

Comments
 (0)