Skip to content

Commit

Permalink
Merge branch 'main' into navigation-versions-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina authored Jan 3, 2025
2 parents 59b7cae + 9534194 commit d1d39c9
Show file tree
Hide file tree
Showing 17 changed files with 968 additions and 823 deletions.
5 changes: 5 additions & 0 deletions .changeset/fast-drinks-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@theguild/components': patch
---

exports `convertToPageMap`, `mergeMetaWithPageMap`, `normalizePageMap`, `evaluate` from nextra
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "the-guild-docs-monorepo",
"type": "module",
"private": true,
"packageManager": "pnpm@9.15.0",
"packageManager": "pnpm@9.15.1",
"scripts": {
"build": "turbo run build --filter=!website",
"build-example": "turbo run build --filter=website",
Expand All @@ -23,7 +23,7 @@
},
"devDependencies": {
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.10",
"@changesets/cli": "2.27.11",
"@rollup/plugin-alias": "5.1.1",
"@storybook/addon-essentials": "8.4.2",
"@storybook/addon-links": "8.4.2",
Expand All @@ -36,7 +36,7 @@
"@theguild/prettier-config": "3.0.0",
"@theguild/tailwind-config": "0.6.2",
"@types/jest-image-snapshot": "6.4.0",
"@types/react": "18.3.17",
"@types/react": "18.3.18",
"@types/react-paginate": "7.1.4",
"@types/webpack": "5.28.5",
"css-loader": "7.1.2",
Expand All @@ -57,7 +57,7 @@
"storybook": "8.4.2",
"storybook-dark-mode": "4.0.2",
"style-loader": "4.0.0",
"tailwindcss": "3.4.16",
"tailwindcss": "3.4.17",
"tailwindcss-animate": "^1.0.7",
"tsconfig-paths-webpack-plugin": "4.2.0",
"tsup": "8.3.5",
Expand Down
69 changes: 69 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
# @theguild/components

## 8.1.2

### Patch Changes

- [#1901](https://github.com/the-guild-org/docs/pull/1901)
[`f466946`](https://github.com/the-guild-org/docs/commit/f466946b62c4bb34f430eaaf11c55fd22eb0a023)
Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates:

- Updated dependency
[`@next/bundle-analyzer@15.1.1` ↗︎](https://www.npmjs.com/package/@next/bundle-analyzer/v/15.1.1)
(from `15.1.0`, in `dependencies`)

- [#1904](https://github.com/the-guild-org/docs/pull/1904)
[`25f4d4c`](https://github.com/the-guild-org/docs/commit/25f4d4cbf5cd507a7c25d992eefeec12f99aac7a)
Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates:

- Updated dependency
[`nextra-theme-docs@4.0.0-app-router.38` ↗︎](https://www.npmjs.com/package/nextra-theme-docs/v/4.0.0)
(from `4.0.0-app-router.37`, in `dependencies`)

- [#1905](https://github.com/the-guild-org/docs/pull/1905)
[`d17dae0`](https://github.com/the-guild-org/docs/commit/d17dae0f8aa014a84efb208b4eae02ecffe071cb)
Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates:

- Updated dependency
[`nextra@4.0.0-app-router.38` ↗︎](https://www.npmjs.com/package/nextra/v/4.0.0) (from
`4.0.0-app-router.37`, in `dependencies`)

- [#1899](https://github.com/the-guild-org/docs/pull/1899)
[`91232cf`](https://github.com/the-guild-org/docs/commit/91232cf540acffb43e3f9203dc9a35f27bd5964e)
Thanks [@hasparus](https://github.com/hasparus)! - Add background-color for Nextra search result
mark

- [#1891](https://github.com/the-guild-org/docs/pull/1891)
[`1510524`](https://github.com/the-guild-org/docs/commit/15105246ea4e5722a42b29720a412d7ef3652031)
Thanks [@hasparus](https://github.com/hasparus)! - Export sharedMetaItems for meta.ts files

## 8.1.1

### Patch Changes

- [#1889](https://github.com/the-guild-org/docs/pull/1889)
[`b2daf75`](https://github.com/the-guild-org/docs/commit/b2daf75fe8c68f84e962a18b05f564ae79373cd1)
Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates:

- Updated dependency
[`nextra@4.0.0-app-router.36` ↗︎](https://www.npmjs.com/package/nextra/v/4.0.0) (from
`4.0.0-app-router.35`, in `dependencies`)

- [#1895](https://github.com/the-guild-org/docs/pull/1895)
[`fa5c560`](https://github.com/the-guild-org/docs/commit/fa5c560f75fe8dd001e07f5a9907ba55102b5827)
Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates:

- Updated dependency
[`nextra@4.0.0-app-router.37` ↗︎](https://www.npmjs.com/package/nextra/v/4.0.0) (from
`4.0.0-app-router.36`, in `dependencies`)
- Updated dependency
[`nextra-theme-docs@4.0.0-app-router.37` ↗︎](https://www.npmjs.com/package/nextra-theme-docs/v/4.0.0)
(from `4.0.0-app-router.36`, in `dependencies`)

- [#1897](https://github.com/the-guild-org/docs/pull/1897)
[`5725a0b`](https://github.com/the-guild-org/docs/commit/5725a0bb52f5f7489a6db3af6463300536663261)
Thanks [@dimaMachina](https://github.com/dimaMachina)! - adjust Next.js Metadata tags

- [#1897](https://github.com/the-guild-org/docs/pull/1897)
[`5725a0b`](https://github.com/the-guild-org/docs/commit/5725a0bb52f5f7489a6db3af6463300536663261)
Thanks [@dimaMachina](https://github.com/dimaMachina)! - add
`export { normalizePages } from 'nextra/normalize-pages'`

## 8.1.0

### Minor Changes
Expand Down
12 changes: 6 additions & 6 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theguild/components",
"version": "8.1.0",
"version": "8.1.2",
"repository": {
"url": "https://github.com/the-guild-org/docs",
"directory": "packages/components"
Expand Down Expand Up @@ -51,12 +51,12 @@
},
"dependencies": {
"@giscus/react": "3.0.0",
"@next/bundle-analyzer": "15.1.0",
"@next/bundle-analyzer": "15.1.1",
"@radix-ui/react-navigation-menu": "^1.2.0",
"clsx": "2.1.1",
"fuzzy": "0.1.3",
"nextra": "4.0.0-app-router.35",
"nextra-theme-docs": "4.0.0-app-router.36",
"nextra": "4.0.0-app-router.39",
"nextra-theme-docs": "4.0.0-app-router.39",
"react-paginate": "8.2.0",
"react-player": "2.16.0",
"semver": "^7.3.8",
Expand All @@ -67,13 +67,13 @@
"@theguild/editor": "workspace:*",
"@theguild/tailwind-config": "0.6.2",
"@types/dedent": "0.7.2",
"@types/react": "18.3.17",
"@types/react": "18.3.18",
"@types/react-dom": "18.3.5",
"@types/semver": "7.5.8",
"dedent": "1.5.3",
"esbuild-plugin-svgr": "^3.0.0",
"graphql": "16.10.0",
"next": "15.1.0",
"next": "15.1.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"unified": "^11.0.3"
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from './types/components';
export * from './logos';
export { cn } from './cn';
export * from './next-types';
export { normalizePages } from 'nextra/normalize-pages';

declare module 'react' {
interface CSSProperties {
Expand Down
10 changes: 9 additions & 1 deletion packages/components/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ export { MDXRemote } from 'nextra/mdx-remote';

export { fetchFilePathsFromGitHub } from 'nextra/fetch-filepaths-from-github';
export { compileMdx } from 'nextra/compile';
export { getPageMap, createIndexPage } from 'nextra/page-map';
export {
getPageMap,
createIndexPage,
convertToPageMap,
mergeMetaWithPageMap,
normalizePageMap,
} from 'nextra/page-map';
export { evaluate } from 'nextra/evaluate';
export { fetchPackageInfo } from './npm.js';
export { sharedMetaItems } from './shared-meta-items';

/**
* Contain `getPageMap` import which imports `metadata` from pages, in case importing from
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/server/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const defaultNextraOptions: NextraConfig = {
defaultShowCopyCode: true,
whiteListTagsStyling: ['iframe', 'video', 'source'],
search: {
codeblocks: true,
codeblocks: false,
},
mdxOptions: {
// Check front matter only in production (when Webpack is used)
Expand Down
45 changes: 45 additions & 0 deletions packages/components/src/server/shared-meta-items.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { PRODUCTS_MENU_LIST, ProductType } from '../products';

export function sharedMetaItems(options: { githubUrl: string; product: ProductType }) {
return {
products: {
title: 'Products',
type: 'menu',
items: PRODUCTS_MENU_LIST,
},
ecosystem: {
title: 'Ecosystem',
type: 'page',
...(options.product !== 'HIVE' && { href: 'https://the-guild.dev/graphql/hive/ecosystem' }),
},
blog: {
title: 'Blog',
type: 'page',
href: 'https://the-guild.dev/blog',
},
github: {
title: 'GitHub',
type: 'page',
href: options.githubUrl,
},
'the-guild': {
title: 'The Guild',
type: 'menu',
items: {
'about-us': {
title: 'About Us',
href: 'https://the-guild.dev/about-us',
},
'brand-assets': {
title: 'Brand Assets',
href: 'https://the-guild.dev/logos',
},
},
},
'graphql-foundation': {
title: 'GraphQL Foundation',
type: 'page',
href: 'https://graphql.org/community/foundation',
},
};
}
24 changes: 16 additions & 8 deletions packages/components/src/server/theme-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentProps, FC, ReactNode } from 'react';
import { Metadata } from 'next';
import { PageMapItem } from 'nextra';
import { Layout, Navbar } from 'nextra-theme-docs';
import { Head } from 'nextra/components';
import { getPageMap } from 'nextra/page-map';
Expand Down Expand Up @@ -72,6 +73,7 @@ export const GuildLayout: FC<{
* Nextra's Docs Theme `<Navbar>` component props
*/
navbarProps: NavbarProps;
pageMap?: PageMapItem[];
}> = async ({
children,
websiteName,
Expand All @@ -81,8 +83,9 @@ export const GuildLayout: FC<{
logo,
layoutProps,
navbarProps,
...props
}) => {
const [meta, ...pageMap] = await getPageMap();
const [meta, ...pageMap] = props.pageMap || (await getPageMap());

const pageMapWithCompanyMenu = [
{
Expand Down Expand Up @@ -183,12 +186,6 @@ export function getDefaultMetadata({
site: 'https://the-guild.dev',
creator: '@TheGuildDev',
},
openGraph: {
siteName: websiteName,
type: 'website',
images: `https://og-image.the-guild.dev/?product=${productName}`,
url: siteUrl,
},
applicationName: websiteName,
appleWebApp: {
title: websiteName,
Expand All @@ -198,8 +195,19 @@ export function getDefaultMetadata({
follow: true,
},
alternates: {
canonical: siteUrl,
// https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632
canonical: './',
},
metadataBase: new URL(siteUrl!),
...additionalMetadata,
openGraph: {
siteName: websiteName,
type: 'website',
images: `https://og-image.the-guild.dev/?product=${productName}`,
// https://github.com/vercel/next.js/discussions/50189#discussioncomment-10826632
url: './',
locale: 'en_US',
...additionalMetadata.openGraph,
},
};
}
4 changes: 4 additions & 0 deletions packages/components/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
&::before {
background-color: rgb(229, 231, 235);
}

& mark {
background-color: oklch(0.611752 0.07807 214.47 / 0.8);
}
}

/* #endregion search results */
Expand Down
6 changes: 3 additions & 3 deletions packages/og-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"yoga-wasm-web": "0.3.3"
},
"devDependencies": {
"@cloudflare/workers-types": "4.20241214.0",
"@types/react": "18.3.17",
"@cloudflare/workers-types": "4.20241218.0",
"@types/react": "18.3.18",
"typescript": "5.7.2",
"wrangler": "3.95.0"
"wrangler": "3.98.0"
}
}
2 changes: 1 addition & 1 deletion packages/remark-mermaid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"devDependencies": {
"@types/mdast": "4.0.4",
"nextra": "4.0.0-app-router.35",
"nextra": "4.0.0-app-router.39",
"react": "18.3.1",
"unified": "11.0.5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/remark-npm2yarn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@types/mdast": "4.0.4",
"nextra": "4.0.0-app-router.35",
"nextra": "4.0.0-app-router.39",
"unified": "11.0.5"
},
"publishConfig": {
Expand Down
Loading

0 comments on commit d1d39c9

Please sign in to comment.