Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hive Docs x Nextra 4 #6089

Merged
merged 76 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
d29fed1
all in one
dimaMachina Dec 17, 2024
126dda1
fixes
dimaMachina Dec 17, 2024
e74509e
Move translate-x out of Tailwind
hasparus Dec 17, 2024
20b2ee9
Fix Federation section mobile styles
hasparus Dec 17, 2024
c31351d
Copy paste decorations to Federation section
hasparus Dec 17, 2024
a519c9b
Fix the dots and scrolling behavior in Company Testimonials
hasparus Dec 17, 2024
6ba874b
Style .nextra-search-results mark
hasparus Dec 17, 2024
8d3efd2
Update `path.resolve` per windows experts
dimaMachina Dec 18, 2024
12f74af
Move the background from body to HTML
hasparus Dec 19, 2024
d692d72
Merge branch 'main' into nextra-4--move-files
dimaMachina Jan 3, 2025
c612bff
fix storybook
dimaMachina Jan 3, 2025
7a2bd89
remove `apollo-studio.mdx` since it was renamed to `apollo-graphos` (…
dimaMachina Jan 3, 2025
6a85cf7
Merge branch 'main' into nextra-4--move-files
dimaMachina Jan 14, 2025
c7bb8ea
remove unused components/page.tsx during merge
dimaMachina Jan 14, 2025
e61f955
Merge branch 'main' into nextra-4--move-files
hasparus Jan 14, 2025
ec26ea8
Update packages/web/docs/src/app/product-updates/(with-blog-header)/(…
hasparus Jan 14, 2025
017a3de
Run format
hasparus Jan 14, 2025
3acce4b
Move MDX Link to Components 9.1.0
hasparus Jan 15, 2025
eb04232
Use validate-mdx-links from NPM
hasparus Jan 16, 2025
4abf2e0
Merge branch 'main' into nextra-4--move-files
hasparus Jan 16, 2025
0ec4ed4
Fix api reference CLI link
hasparus Jan 16, 2025
c725721
Stop nesting product updates in year directories
hasparus Jan 16, 2025
d6271de
Change (with-blog-header) directory to (posts)
hasparus Jan 16, 2025
22d80aa
Fix the newest update to use page.mdx file
hasparus Jan 16, 2025
6bcce64
Move validate-mdx-links to a reusable workflow
hasparus Jan 16, 2025
9126d6f
Fix yaml
hasparus Jan 16, 2025
b42d2f8
Comment out yaml to test
hasparus Jan 16, 2025
0c9ad42
Merge branch 'main' into nextra-4--move-files
hasparus Jan 16, 2025
a9d8721
Fix an image path
hasparus Jan 16, 2025
baad59c
yml -> yaml
hasparus Jan 16, 2025
bc68972
Prefix concurrency group
hasparus Jan 16, 2025
26afe9e
Use newer version of validate-mdx-links
hasparus Jan 16, 2025
ab291f4
Empty commit to rerun CI
hasparus Jan 16, 2025
e974068
Use newer CLI
hasparus Jan 16, 2025
2bc7db4
Empty commit to rerun again
hasparus Jan 16, 2025
bcf5309
Add trigger filters back
hasparus Jan 16, 2025
7f06aec
Merge branch 'main' into nextra-4--move-files
hasparus Jan 16, 2025
e1c6741
Revert Dima's change to .eslintrc.cjs and .prettierignore
hasparus Jan 16, 2025
a0b4248
Revert the changelog-related change to app/package.json
hasparus Jan 16, 2025
541af7c
Remove the generated changelog
hasparus Jan 16, 2025
6399a5d
Revert the refactor to ecosystem-page-nav-h2
hasparus Jan 16, 2025
c1416ea
Revert HowFederationWorksSection className change
hasparus Jan 16, 2025
c3ecc6a
Fix a link to Apollo docs
hasparus Jan 16, 2025
b51b547
Fix a redundant bold
hasparus Jan 16, 2025
159d3f8
Revert refactors to product updates header
hasparus Jan 16, 2025
441c242
Revert the .gitignore change to ignore changelog again
hasparus Jan 16, 2025
103c9a3
Add generateChangelog script back
hasparus Jan 16, 2025
51948cd
Move _pagefind .gitignore entry to docs dir
hasparus Jan 16, 2025
b60d86c
Remove next-validate-link
hasparus Jan 16, 2025
482337e
Stop emitting a changelog in RSS feed.xml API route
hasparus Jan 16, 2025
4be81e3
Revert Dima's refactor to activeElement destructuring
hasparus Jan 17, 2025
ff8dd80
Remove redundant if statement from a merge conflict
hasparus Jan 17, 2025
beb469a
Nextra 4: Use `HiveLayout` (#6396)
hasparus Jan 21, 2025
6d6ef33
Merge branch 'main' into nextra-4--move-files
hasparus Jan 21, 2025
a8a4ce3
Remove unused import
hasparus Jan 21, 2025
966021f
Remove clsx
hasparus Jan 21, 2025
63ac276
Update lockfile
hasparus Jan 21, 2025
fa2b6ae
Merge branch 'main' into nextra-4--move-files
hasparus Jan 21, 2025
896b2f0
Extract ProuctUpdateHeader to try to fix a build error
hasparus Jan 21, 2025
7372f69
Add a ! to silence an error that will not happen
hasparus Jan 21, 2025
7a8a44e
Fix errors after a merge
hasparus Jan 21, 2025
4777047
If there is no active path, don't access route
hasparus Jan 21, 2025
d450457
Remove unused import
hasparus Jan 21, 2025
859e6de
Add narrow pages config
hasparus Jan 21, 2025
5c4a6e9
Merge branch 'main' into nextra-4--move-files
hasparus Jan 21, 2025
5eff062
Use stable version of @theguild/components
hasparus Jan 21, 2025
d41367d
Merge branch 'main' into nextra-4--move-files
hasparus Jan 22, 2025
8a5c0c2
Work around Nextra not loading root opengraph-image
hasparus Jan 22, 2025
59e3d71
Move the newest product update to app
hasparus Jan 22, 2025
e262b8e
Merge branch 'main' into nextra-4--move-files
hasparus Jan 24, 2025
5fb26d3
Update cli-errors.tsx to server component (useData was removed)
hasparus Jan 24, 2025
d20d482
Change fill-rule to fillRule
hasparus Jan 24, 2025
4296983
Stop using Nextra internal Tailwind classes (Guys frfr)
hasparus Jan 24, 2025
73643f7
Remove contentEditable=false that was redundant and caused an error
hasparus Jan 24, 2025
765efae
Run format
hasparus Jan 24, 2025
bb34fd6
Merge branch 'main' into nextra-4--move-files
hasparus Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"eslint-plugin-tailwindcss": "npm:@hasparus/[email protected]",
"fs-extra": "11.2.0",
"graphql": "16.9.0",
"gray-matter": "4.0.3",
"jest-snapshot-serializer-raw": "2.0.0",
"pg": "8.13.1",
"prettier": "3.4.2",
Expand Down
1 change: 1 addition & 0 deletions packages/web/docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
temp
public/sitemap.xml
public/changelog.json
public/_pagefind/
1 change: 1 addition & 0 deletions packages/web/docs/mdx-components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { useHiveMDXComponents as useMDXComponents } from '@theguild/components/server';
3 changes: 1 addition & 2 deletions packages/web/docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
18 changes: 11 additions & 7 deletions packages/web/docs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { withGuildDocs } from '@theguild/components/next.config';

export default withGuildDocs({
nextraConfig: /** @satisfies import("nextra").NextraConfig*/ ({
themeConfig: './src/theme.config.tsx',
autoImportThemeStyle: false,
}),
output: 'export',
basePath: process.env.NEXT_BASE_PATH,
eslint: {
ignoreDuringBuilds: true,
},

experimental: {
turbo: {
treeShaking: true,
},
},
nextraConfig: {
contentDirBasePath: '/docs',
},
redirects: async () => [
{
source: '/docs/get-started/organizations',
Expand Down Expand Up @@ -245,7 +247,9 @@ export default withGuildDocs({
permanent: true,
},
],
swcMinify: true,
env: {
SITE_URL: 'https://the-guild.dev/graphql/hive',
},
webpack: (config, { webpack }) => {
config.externals['node:fs'] = 'commonjs node:fs';
config.externals['node:path'] = 'commonjs node:path';
Expand Down
23 changes: 12 additions & 11 deletions packages/web/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,37 @@
"private": true,
"scripts": {
"build": "next build && next-sitemap",
"dev": "next",
"dev": "next --turbopack",
"postbuild": "pagefind --site .next/server/app --output-path out/_pagefind",
"validate-mdx-links": "pnpx [email protected] --files 'src/**/*.mdx'"
},
"dependencies": {
"@radix-ui/react-accordion": "1.2.2",
"@radix-ui/react-icons": "1.3.2",
"@radix-ui/react-tabs": "1.1.2",
"@radix-ui/react-tooltip": "1.1.6",
"@tailwindcss/typography": "0.5.16",
"@theguild/components": "7.6.3",
"clsx": "2.1.1",
"@theguild/components": "9.2.0",
"date-fns": "4.1.0",
"next": "14.2.23",
"react": "18.3.1",
"next": "15.1.0",
"react": "19.0.0",
"react-avatar": "5.0.3",
"react-countup": "6.5.3",
"react-dom": "18.3.1",
"react-dom": "19.0.0",
"react-icons": "5.4.0",
"tailwind-merge": "2.6.0",
"tailwindcss-animate": "1.0.7",
"tailwindcss-radix": "3.0.5"
"tailwind-merge": "2.6.0"
},
"devDependencies": {
"@tailwindcss/typography": "0.5.16",
"@theguild/tailwind-config": "0.6.2",
"@types/react": "18.3.18",
"@types/rss": "^0.0.32",
"next-sitemap": "4.2.3",
"pagefind": "^1.2.0",
"postcss": "8.4.49",
"postcss-nesting": "^13.0.1",
"rss": "1.2.2",
"tailwindcss": "3.4.17"
"tailwindcss": "3.4.17",
"tailwindcss-animate": "1.0.7",
"tailwindcss-radix": "3.0.5"
}
}
20 changes: 0 additions & 20 deletions packages/web/docs/public/favicon.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,40 @@ const meta: Record<string, DeepPartial<Item | MenuItem | PageItem>> = {
title: 'Home',
type: 'page',
display: 'hidden',
theme: {
layout: 'raw',
},
},
federation: {
title: 'Federation',
type: 'page',
display: 'hidden',
theme: {
layout: 'raw',
},
},
hive: {
title: 'Get Started',
type: 'page',
href: 'https://app.graphql-hive.com',
newWindow: true,
},
'contact-us': {
title: 'Contact Us',
type: 'page',
href: 'https://the-guild.dev/contact',
newWindow: true,
},
status: {
title: 'Status',
type: 'page',
href: 'https://status.graphql-hive.com',
newWindow: true,
},
docs: {
title: 'Documentation',
type: 'page',
theme: {
toc: true,
},
},
partners: {
title: 'Partners',
type: 'page',
display: 'hidden',
theme: {
layout: 'raw',
},
},
ecosystem: {
title: 'Ecosystem',
type: 'page',
display: 'hidden',
theme: {
layout: 'raw',
},
},
products: {
title: 'Products',
Expand All @@ -67,9 +49,6 @@ const meta: Record<string, DeepPartial<Item | MenuItem | PageItem>> = {
pricing: {
title: 'Pricing',
type: 'page',
theme: {
layout: 'raw',
},
},
'product-updates': {
type: 'page',
Expand All @@ -85,21 +64,16 @@ const meta: Record<string, DeepPartial<Item | MenuItem | PageItem>> = {
type: 'page',
title: 'Our Open Source Friends',
display: 'hidden',
theme: {
layout: 'raw',
},
},
blog: {
title: 'Blog',
type: 'page',
href: 'https://the-guild.dev/blog',
newWindow: true,
},
github: {
title: 'GitHub',
type: 'page',
href: 'https://github.com/graphql-hive/platform',
newWindow: true,
},
'the-guild': {
title: 'The Guild',
Expand All @@ -108,20 +82,17 @@ const meta: Record<string, DeepPartial<Item | MenuItem | PageItem>> = {
'about-us': {
title: 'About Us',
href: 'https://the-guild.dev/about-us',
newWindow: true,
},
'brand-assets': {
title: 'Brand Assets',
href: 'https://the-guild.dev/logos',
newWindow: true,
},
},
},
'graphql-foundation': {
title: 'GraphQL Foundation',
type: 'page',
href: 'https://graphql.org/community/foundation/',
newWindow: true,
},
};

Expand Down
36 changes: 36 additions & 0 deletions packages/web/docs/src/app/docs/[[...mdxPath]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable import/no-extraneous-dependencies */
import { ResolvingMetadata } from 'next';
import { generateStaticParamsFor, importPage } from 'nextra/pages';
import { NextPageProps } from '@theguild/components';
import { useMDXComponents } from '../../../../mdx-components.js';
import { ConfiguredGiscus } from '../../../components/configured-giscus';

export const generateStaticParams = generateStaticParamsFor('mdxPath');

export async function generateMetadata(
props: NextPageProps<'...mdxPath'>,
_parent: ResolvingMetadata,
) {
const { mdxPath } = await props.params;
const { metadata } = await importPage(mdxPath);
return {
...metadata,
...(mdxPath?.[0] === 'gateway' && {
title: { absolute: `${metadata.title} | Hive Gateway` },
}),
};
}

const Wrapper = useMDXComponents().wrapper!;

export default async function Page(props: NextPageProps<'...mdxPath'>) {
const params = await props.params;
const result = await importPage(params.mdxPath);
const { default: MDXContent, toc, metadata } = result;
return (
<Wrapper toc={toc} metadata={metadata}>
<MDXContent {...props} params={params} />
<ConfiguredGiscus />
</Wrapper>
);
}
63 changes: 63 additions & 0 deletions packages/web/docs/src/app/dynamic-meta-tags.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
'use client';

import { usePathname } from 'next/navigation';
import { normalizePages } from '@theguild/components';

function ensureAbsolute(url: string) {
if (url.startsWith('/')) {
return `https://the-guild.dev/graphql/hive${url.replace(/\/$/, '')}`;
}

return url;
}

type NormalizedResult = ReturnType<typeof normalizePages>;

function createBreadcrumb(normalizedResult: NormalizedResult) {
const activePaths = normalizedResult.activePath.slice();

if (activePaths[0]?.route !== '/') {
// Add the home page to all pages except the home page
activePaths.unshift({
route: '/',
title: 'Hive',
name: 'index',
type: 'page',
display: 'hidden',
children: [],
frontMatter: {},
});
}
return {
'@context': 'https://schema.org',
'@type': 'BreadcrumbList',
itemListElement: activePaths.map((path, index) => {
return {
'@type': 'ListItem',
position: index + 1,
name: path.route === '/' ? 'Hive' : path.title,
item: ensureAbsolute(path.route),
};
}),
};
}

export function DynamicMetaTags({ pageMap }: { pageMap: any[] }) {
const pathname = usePathname()!;
if (pathname === '/_not-found') {
return;
}
const normalizePagesResult = normalizePages({
list: pageMap,
route: pathname,
});
return (
<script
type="application/ld+json"
id="breadcrumb"
dangerouslySetInnerHTML={{
__html: JSON.stringify(createBreadcrumb(normalizePagesResult), null, 2),
}}
/>
);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { GotAnIdeaSection } from '../got-an-idea-section';
import { Page as LandingPageContainer } from '../page';
import { GotAnIdeaSection } from '../../components/got-an-idea-section';
import { LandingPageContainer } from '../../components/landing-page-container';
import { components } from './components';
import EcosystemPageContent from './content.mdx';

export const metadata = {
title: 'The Ecosystem',
description: 'Everything you need to scale your API infrastructure',
};

export default function EcosystemPage() {
return (
<LandingPageContainer className="text-green-1000 light mx-auto max-w-[90rem] overflow-hidden px-4 [&>:not(header)]:px-4 lg:[&>:not(header)]:px-8 xl:[&>:not(header)]:px-[120px]">
Expand Down
Loading
Loading