Skip to content

Commit 755ba27

Browse files
committed
Merge branch 'source' into landing--interactive-editor-on-landing
2 parents 8d8054d + 82ac0f2 commit 755ba27

File tree

3,001 files changed

+3207
-1411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,001 files changed

+3207
-1411
lines changed

.eslintrc.cjs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,22 @@ module.exports = {
5959
"@next/next/no-img-element": "off", // straight up upsell, small `img`s actually don't need optimization
6060

6161
"tailwindcss/classnames-order": "off",
62-
"@typescript-eslint/no-restricted-imports": [
63-
"error",
64-
{
65-
paths: [
66-
{
67-
name: "next/image",
68-
message: "Please use `next-image-export-optimizer` instead",
69-
allowTypeImports: true,
70-
},
71-
],
72-
},
73-
],
7462
"prefer-const": ["error", { destructuring: "all" }],
7563
"prefer-rest-params": "off",
7664
"@typescript-eslint/no-explicit-any": "off",
7765
"@typescript-eslint/no-unused-vars": "off",
7866
"@typescript-eslint/ban-ts-comment": "off",
7967
"@typescript-eslint/no-var-requires": "off",
8068
"@typescript-eslint/ban-types": "off",
69+
"no-restricted-syntax": [
70+
"error",
71+
{
72+
selector:
73+
"JSXElement[openingElement.name.name=/^(Image|NextImage)$/]:not(:has(JSXAttribute[name.name='placeholder']))",
74+
message:
75+
"Pass `placeholder: 'empty' | 'blur'` when calling <Image> or <NextImage>.",
76+
},
77+
],
8178
},
8279
settings: {
8380
tailwindcss: {

.prettierrc

Lines changed: 0 additions & 22 deletions
This file was deleted.

next.config.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import withLess from "next-with-less"
77
import nextBundleAnalyzer from "@next/bundle-analyzer"
88
import fs from "fs"
99
import rehypeMermaid from "rehype-mermaid"
10+
import withPlaiceholder from "@plaiceholder/next"
1011

1112
import { remarkGraphiQLComment } from "./src/remark-graphiql-comment.js"
1213
import { syntaxHighlightingThemes } from "./src/_design-system/syntax/index.js"
@@ -111,24 +112,14 @@ const config = {
111112
return config
112113
},
113114
images: {
114-
loader: "custom",
115-
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
116-
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
115+
remotePatterns: [
116+
{
117+
hostname: "avatars.sched.co",
118+
pathname: "**",
119+
},
120+
],
117121
},
118-
transpilePackages: ["next-image-export-optimizer"],
119122
env: {
120-
nextImageExportOptimizer_imageFolderPath: "public/images",
121-
nextImageExportOptimizer_exportFolderPath: "out",
122-
nextImageExportOptimizer_quality: "75",
123-
nextImageExportOptimizer_storePicturesInWEBP: "true",
124-
nextImageExportOptimizer_exportFolderName: "nextImageExportOptimizer",
125-
// If you do not want to use blurry placeholder images, then you can set
126-
// nextImageExportOptimizer_generateAndUseBlurImages to false and pass
127-
// `placeholder="empty"` to all <ExportedImage> components.
128-
nextImageExportOptimizer_generateAndUseBlurImages: "true",
129-
// If you want to cache the remote images, you can set the time to live of the cache in seconds.
130-
// The default value is 0 seconds.
131-
nextImageExportOptimizer_remoteImageCacheTTL: "0",
132123
NEXT_PUBLIC_GA_ID:
133124
process.env.NODE_ENV === "production" ? "UA-44373548-16" : "",
134125
},
@@ -172,13 +163,16 @@ const config = {
172163
},
173164
]
174165
},
166+
typedRoutes: true,
175167
}
176168

177169
const withBundleAnalyzer = nextBundleAnalyzer({
178170
enabled: process.env.ANALYZE === "true",
179171
})
180172

181-
export default withBundleAnalyzer(withLess(withNextra(config)))
173+
export default withBundleAnalyzer(
174+
withLess(withNextra(withPlaiceholder(config))),
175+
)
182176

183177
function mermaidConfig() {
184178
return [

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"packageManager": "pnpm@10.16.1+sha512.0e155aa2629db8672b49e8475da6226aa4bdea85fdcdfdc15350874946d4f3c91faaf64cbdc4a5d1ab8002f473d5c3fcedcd197989cf0390f9badd3c04678706",
77
"scripts": {
88
"analyze": "ANALYZE=true next build",
9-
"build": "next build && next-image-export-optimizer",
9+
"build": "next build",
1010
"check:links": "lychee --verbose --no-progress './src/pages/**/*.mdx' --base https://graphql.org",
1111
"dev": "next",
1212
"format": "pnpm format:check --write",
@@ -16,7 +16,7 @@
1616
"lint:docs:ci": "eslint --ignore-path .gitignore src/pages/learn --format eslint-formatter-github",
1717
"postbuild": "next-sitemap",
1818
"prebuild": "tsx scripts/get-github-info && tsx scripts/sync-landing-schema/src/index.ts",
19-
"serve": "pnpx serve out",
19+
"start": "next start",
2020
"test": "playwright test && pnpm test:unit",
2121
"test:e2e": "playwright test",
2222
"test:ui": "playwright test --ui",
@@ -36,6 +36,7 @@
3636
"@igorkowalczyk/is-browser": "^5.1.0",
3737
"@lezer/highlight": "^1.2.1",
3838
"@next/bundle-analyzer": "^15.4.5",
39+
"@plaiceholder/next": "^3.0.0",
3940
"@radix-ui/react-radio-group": "^1.2.2",
4041
"@sparticuz/chromium": "^138.0.2",
4142
"@tailwindcss/container-queries": "^0.1.1",
@@ -57,7 +58,6 @@
5758
"markdown-to-jsx": "^7.7.2",
5859
"motion": "^12.11.0",
5960
"next": "^14.2.32",
60-
"next-image-export-optimizer": "^1.18.0",
6161
"next-query-params": "^5.0.1",
6262
"next-sitemap": "^4.2.3",
6363
"next-with-less": "^3.0.1",
@@ -66,6 +66,7 @@
6666
"numbro": "2.5.0",
6767
"p-limit": "^4.0.0",
6868
"parser-front-matter": "1.6.4",
69+
"plaiceholder": "^3.0.0",
6970
"playwright-core": "^1.54.2",
7071
"postcss": "^8.4.49",
7172
"postcss-import": "^16.1.1",

patches/nextra-theme-docs.patch

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/dist/index.d.mts b/dist/index.d.mts
2-
index 71f87bcd1dde49d7c19ad49fc098e715a76c5c10..aadd6228910ee3ebafccfae8672cb9ae1b0bca3c 100644
2+
index 71f87bcd1dde49d7c19ad49fc098e715a76c5c10..53dffe4fbe5fb2a92cb55a0466bf95315f904e4e 100644
33
--- a/dist/index.d.mts
44
+++ b/dist/index.d.mts
5-
@@ -1421,3 +1421,25 @@ declare function ThemeSwitch({ lite, className }: ThemeSwitchProps): ReactElemen
5+
@@ -1421,3 +1421,24 @@ declare function ThemeSwitch({ lite, className }: ThemeSwitchProps): ReactElemen
66
declare function Layout({ children, themeConfig, pageOpts }: NextraThemeLayoutProps): ReactElement;
77

88
export { Bleed, Collapse, type PartialDocsThemeConfig as DocsThemeConfig, Link, LocaleSwitch, Navbar, NotFoundPage, SkipNavContent, SkipNavLink, ThemeSwitch, Layout as default, getComponents, useConfig, useMenu, useThemeConfig };
@@ -22,14 +22,13 @@ index 71f87bcd1dde49d7c19ad49fc098e715a76c5c10..aadd6228910ee3ebafccfae8672cb9ae
2222
+export declare const useIntersectionObserver: () => IntersectionObserver | null
2323
+export declare const useSlugs: () => WeakMap<any, any>
2424
+
25-
+export declare const Breadcrumb: (props: { activePath: Item[] }) => ReactElement | null
2625
+export declare const NavLinks: (props: NavLinkProps) => ReactElement | null
2726
+export interface NavLinkProps {
2827
+ currentIndex: number
2928
+ flatDocsDirectories: Item[]
3029
+}
3130
diff --git a/dist/index.js b/dist/index.js
32-
index 56201641fd965dcc5ab7c5df53e444c41293c00e..07147c688ae75c4c7daf082833acc71de16b36ee 100644
31+
index 56201641fd965dcc5ab7c5df53e444c41293c00e..29a446663f5d24acad0389f873c5e31be910717c 100644
3332
--- a/dist/index.js
3433
+++ b/dist/index.js
3534
@@ -100,10 +100,10 @@ IntersectionObserverContext.displayName = "IntersectionObserver";
@@ -47,16 +46,52 @@ index 56201641fd965dcc5ab7c5df53e444c41293c00e..07147c688ae75c4c7daf082833acc71d
4746
var ActiveAnchorProvider = ({
4847
children
4948
}) => {
50-
@@ -526,7 +526,7 @@ import NextLink2 from "next/link";
51-
import { ArrowRightIcon } from "nextra/icons";
52-
import { Fragment as Fragment3 } from "react";
53-
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
49+
@@ -520,44 +520,6 @@ function Bleed({
50+
);
51+
}
52+
53+
-// src/components/breadcrumb.tsx
54+
-import cn4 from "clsx";
55+
-import NextLink2 from "next/link";
56+
-import { ArrowRightIcon } from "nextra/icons";
57+
-import { Fragment as Fragment3 } from "react";
58+
-import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
5459
-function Breadcrumb({
55-
+export function Breadcrumb({
56-
activePath
57-
}) {
58-
return /* @__PURE__ */ jsx9("div", { className: "nextra-breadcrumb _mt-1.5 _flex _items-center _gap-1 _overflow-hidden _text-sm _text-gray-500 dark:_text-gray-400 contrast-more:_text-current", children: activePath.map((item, index, arr) => {
59-
@@ -1255,7 +1255,7 @@ var classes = {
60+
- activePath
61+
-}) {
62+
- return /* @__PURE__ */ jsx9("div", { className: "nextra-breadcrumb _mt-1.5 _flex _items-center _gap-1 _overflow-hidden _text-sm _text-gray-500 dark:_text-gray-400 contrast-more:_text-current", children: activePath.map((item, index, arr) => {
63+
- const nextItem = arr[index + 1];
64+
- const href = nextItem ? item.withIndexPage ? item.route : item.children[0].route === nextItem.route ? "" : item.children[0].route : "";
65+
- const ComponentToUse = href ? NextLink2 : "span";
66+
- return /* @__PURE__ */ jsxs3(Fragment3, { children: [
67+
- index > 0 && /* @__PURE__ */ jsx9(
68+
- ArrowRightIcon,
69+
- {
70+
- height: "14",
71+
- className: "_shrink-0 rtl:_rotate-180"
72+
- }
73+
- ),
74+
- /* @__PURE__ */ jsx9(
75+
- ComponentToUse,
76+
- __spreadProps(__spreadValues({
77+
- className: cn4(
78+
- "_whitespace-nowrap _transition-colors",
79+
- nextItem ? "_min-w-6 _overflow-hidden _text-ellipsis" : "_font-medium _text-gray-700 contrast-more:_font-bold contrast-more:_text-current dark:_text-gray-100 contrast-more:dark:_text-current",
80+
- href && "nextra-focus _ring-inset hover:_text-gray-900 dark:hover:_text-gray-100"
81+
- ),
82+
- title: item.title
83+
- }, href && { href }), {
84+
- children: item.title
85+
- })
86+
- )
87+
- ] }, item.route + item.name);
88+
- }) });
89+
-}
90+
-
91+
// src/components/collapse.tsx
92+
import cn5 from "clsx";
93+
import { useEffect as useEffect3, useRef as useRef3 } from "react";
94+
@@ -1255,7 +1217,7 @@ var classes = {
6095
),
6196
icon: cn10("_inline _h-5 _shrink-0")
6297
};
@@ -65,3 +100,11 @@ index 56201641fd965dcc5ab7c5df53e444c41293c00e..07147c688ae75c4c7daf082833acc71d
65100
flatDocsDirectories,
66101
currentIndex
67102
}) {
103+
@@ -2421,7 +2383,6 @@ function Body({ children }) {
104+
themeContext.typesetting === "article" && "nextra-body-typesetting-article"
105+
),
106+
children: /* @__PURE__ */ jsxs17("main", { className: "_w-full _min-w-0 _max-w-6xl _px-6 _pt-4 md:_px-12", children: [
107+
- activeType !== "page" && themeContext.breadcrumb && /* @__PURE__ */ jsx26(Breadcrumb, { activePath }),
108+
body
109+
] })
110+
}

patches/nextra.patch

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
diff --git a/dist/client/components/image.js b/dist/client/components/image.js
2-
index 239d72f5921e2d1b7359e569ae5b74c12d7c9d8a..ebeb619da1e3ccb7722e9388c92c1e2192527027 100644
3-
--- a/dist/client/components/image.js
4-
+++ b/dist/client/components/image.js
5-
@@ -1,5 +1,5 @@
6-
import { jsx } from "react/jsx-runtime";
7-
-import NextImage from "next/image";
8-
+import NextImage from "next-image-export-optimizer";
9-
import { forwardRef } from "react";
10-
const Image = forwardRef((props, ref) => {
11-
const ComponentToUse = typeof props.src === "object" ? NextImage : "img";
121
diff --git a/dist/client/components/index.js b/dist/client/components/index.js
132
index 9d05118d3d10e746cd2c020785a0f34465bb8570..218107600d7efed1b5f9d49f0a696b166917d1ce 100644
143
--- a/dist/client/components/index.js

0 commit comments

Comments
 (0)