Skip to content

Commit 9f107da

Browse files
Modules - New website (#2228)
* temp temp temp temp temp temp temp temp temp temp temp temp temp temp * fix * fix postcss.config.js rename to cjs * add patch to website also * update to latest components * remove vercel-ignore-build-step.sh * replace @guild-docs/algolia with @theguild/algolia * with styles on mobile, update components with basePath setup Co-authored-by: Dimitri POSTOLOV <[email protected]>
1 parent 78bd7fb commit 9f107da

Some content is hidden

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

53 files changed

+2782
-5617
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
**/dist
33
benchmark
44
examples
5-
website

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"bob-the-bundler": "1.7.3",
5454
"chalk": "4.1.2",
5555
"dataloader": "2.1.0",
56-
"eslint": "8.23.0",
56+
"eslint": "8.22.0",
5757
"express": "4.18.1",
5858
"express-graphql": "0.12.0",
5959
"globby": "11.1.0",
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
diff --git a/node_modules/nextra-theme-docs/dist/index.js b/node_modules/nextra-theme-docs/dist/index.js
2+
index ce17c56..e659acc 100644
3+
--- a/node_modules/nextra-theme-docs/dist/index.js
4+
+++ b/node_modules/nextra-theme-docs/dist/index.js
5+
@@ -52,7 +52,7 @@ var __async = (__this, __arguments, generator) => {
6+
7+
// src/index.tsx
8+
import React41, { useEffect as useEffect8, useMemo as useMemo5, useRef as useRef7 } from "react";
9+
-import { useRouter as useRouter9 } from "next/router";
10+
+import { useRouter as useRouter9 } from "next/router.js";
11+
import "focus-visible";
12+
import scrollIntoView3 from "scroll-into-view-if-needed";
13+
import { SkipNavContent } from "@reach/skip-nav";
14+
@@ -61,11 +61,11 @@ import { MDXProvider } from "@mdx-js/react";
15+
16+
// src/constants.tsx
17+
import React38, { isValidElement } from "react";
18+
-import { useRouter as useRouter8 } from "next/router";
19+
+import { useRouter as useRouter8 } from "next/router.js";
20+
21+
// src/components/anchor.tsx
22+
import React3, { forwardRef } from "react";
23+
-import NextLink from "next/link";
24+
+import NextLink from "next/link.js";
25+
26+
// src/contexts/active-anchor.tsx
27+
import React, {
28+
@@ -189,8 +189,9 @@ var Anchor = forwardRef(function(_a, forwardedRef) {
29+
if (config.newNextLinkBehavior) {
30+
return /* @__PURE__ */ React3.createElement(NextLink, __spreadValues({
31+
ref: forwardedRef,
32+
- href
33+
- }, props), children);
34+
+ href,
35+
+ legacyBehavior: false
36+
+ }, props), React.createElement(Fragment, null, children));
37+
}
38+
return /* @__PURE__ */ React3.createElement(NextLink, {
39+
href,
40+
@@ -466,7 +467,7 @@ var getFSRoute = (asPath, locale) => {
41+
import parseGitUrl from "parse-git-url";
42+
var getGitEditUrl = (filePath) => {
43+
const config = useConfig();
44+
- const repo = parseGitUrl(config.docsRepositoryBase || "");
45+
+ const repo = parseGitUrl.default(config.docsRepositoryBase || "");
46+
if (!repo)
47+
throw new Error("Invalid `docsRepositoryBase` URL!");
48+
const subdir = repo.subdir ? `${repo.subdir}/` : "";
49+
@@ -487,7 +488,7 @@ var getGitIssueUrl = ({
50+
title,
51+
labels
52+
}) => {
53+
- const repo = parseGitUrl2(repository);
54+
+ const repo = parseGitUrl2.default(repository);
55+
if (!repo)
56+
throw new Error("Invalid `docsRepositoryBase` URL!");
57+
switch (repo.type) {
58+
@@ -952,7 +953,7 @@ function Collapse({
59+
60+
// src/components/flexsearch.tsx
61+
import React23, { useState as useState5, useCallback as useCallback3 } from "react";
62+
-import { useRouter as useRouter2 } from "next/router";
63+
+import { useRouter as useRouter2 } from "next/router.js";
64+
import FlexSearch from "flexsearch";
65+
import cn8 from "clsx";
66+
67+
@@ -992,7 +993,7 @@ var Input = forwardRef2((_a, forwardedRef) => {
68+
});
69+
70+
// src/components/search.tsx
71+
-import { useRouter } from "next/router";
72+
+import { useRouter } from "next/router.js";
73+
var INPUTS = ["input", "select", "button", "textarea"];
74+
function Search({
75+
className,
76+
@@ -1369,7 +1370,7 @@ import cn10 from "clsx";
77+
78+
// src/components/locale-switch.tsx
79+
import React25 from "react";
80+
-import { useRouter as useRouter3 } from "next/router";
81+
+import { useRouter as useRouter3 } from "next/router.js";
82+
83+
// src/components/select.tsx
84+
import React24 from "react";
85+
@@ -1509,7 +1510,7 @@ function Footer({ menu }) {
86+
87+
// src/components/head.tsx
88+
import React28 from "react";
89+
-import NextHead from "next/head";
90+
+import NextHead from "next/head.js";
91+
import { useTheme as useTheme2 } from "next-themes";
92+
function Head() {
93+
const config = useConfig();
94+
@@ -1588,7 +1589,7 @@ var NavLinks = ({
95+
// src/components/navbar.tsx
96+
import React30 from "react";
97+
import cn12 from "clsx";
98+
-import { useRouter as useRouter4 } from "next/router";
99+
+import { useRouter as useRouter4 } from "next/router.js";
100+
import { Menu, Transition as Transition3 } from "@headlessui/react";
101+
var classes2 = {
102+
link: "text-sm contrast-more:text-gray-700 contrast-more:dark:text-gray-100",
103+
@@ -1686,7 +1687,7 @@ function Navbar({ flatDirectories, items }) {
104+
105+
// src/components/not-found.tsx
106+
import React31 from "react";
107+
-import { useRouter as useRouter5 } from "next/router";
108+
+import { useRouter as useRouter5 } from "next/router.js";
109+
function NotFoundPage() {
110+
const config = useConfig();
111+
const mounted = useMounted();
112+
@@ -1710,7 +1711,7 @@ function NotFoundPage() {
113+
114+
// src/components/server-side-error.tsx
115+
import React33 from "react";
116+
-import { useRouter as useRouter6 } from "next/router";
117+
+import { useRouter as useRouter6 } from "next/router.js";
118+
function ServerSideErrorPage() {
119+
const config = useConfig();
120+
const mounted = useMounted();
121+
@@ -1742,7 +1743,7 @@ import React34, {
122+
} from "react";
123+
import cn13 from "clsx";
124+
import Slugger from "github-slugger";
125+
-import { useRouter as useRouter7 } from "next/router";
126+
+import { useRouter as useRouter7 } from "next/router.js";
127+
import scrollIntoView from "scroll-into-view-if-needed";
128+
var TreeState = /* @__PURE__ */ Object.create(null);
129+
var Folder = memo2(FolderImpl);
130+
diff --git a/node_modules/nextra-theme-docs/package.json b/node_modules/nextra-theme-docs/package.json
131+
index 0a8a39f..c536a6e 100644
132+
--- a/node_modules/nextra-theme-docs/package.json
133+
+++ b/node_modules/nextra-theme-docs/package.json
134+
@@ -5,6 +5,7 @@
135+
"repository": "https://github.com/shuding/nextra",
136+
"author": "Shu Ding <[email protected]>",
137+
"license": "MIT",
138+
+ "type": "module",
139+
"files": [
140+
"dist",
141+
"style.css"

scripts/vercel-ignore-build-step.sh

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

website/.eslintrc.js

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

website/docs/advanced/execution-context.mdx

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

website/next-i18next.config.js

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

website/next.config.mjs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
import { createRequire } from 'module';
2-
import { withGuildDocs } from '@guild-docs/server';
3-
import bundleAnalyzer from '@next/bundle-analyzer';
4-
import { register } from 'esbuild-register/dist/node.js';
5-
import { i18n } from './next-i18next.config.js';
1+
import { withGuildDocs } from '@theguild/components/next.config';
62

7-
const require = createRequire(import.meta.url);
8-
9-
const withBundleAnalyzer = bundleAnalyzer({
10-
enabled: process.env.ANALYZE === 'true',
11-
});
12-
13-
register({ extensions: ['.ts', '.tsx'] });
14-
15-
const { getRoutes } = require('./routes.ts');
16-
17-
export default withBundleAnalyzer(
18-
withGuildDocs({
19-
i18n,
20-
getRoutes,
21-
})
22-
);
3+
export default withGuildDocs();

website/package.json

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,19 @@
22
"name": "website",
33
"private": true,
44
"version": "0.0.0",
5+
"type": "module",
56
"scripts": {
67
"algolia-sync": "node scripts/algolia-ci.mjs",
7-
"api": "node ./scripts/api-doc.js",
8-
"dev": "concurrently -r \"next-remote-watch ./docs ./src/pages/_app.tsx ./src/pages/_document.tsx\" \"wait-on -s 1 http://localhost:3000 && open-cli http://localhost:3000\"",
9-
"next": "next",
8+
"dev": "next",
109
"build": "next build",
1110
"start": "next start",
12-
"lint": "eslint --ignore-path ../.gitignore --ext js,jsx,cjs,mjs,ts,tsx,cts,mts .",
1311
"analyze": "cross-env ANALYZE=true next build"
1412
},
1513
"dependencies": {
16-
"@chakra-ui/icons": "1.1.7",
17-
"@chakra-ui/react": "1.8.8",
18-
"@chakra-ui/theme-tools": "1.3.6",
19-
"@guild-docs/client": "3.1.0",
20-
"@guild-docs/server": "4.0.0",
21-
"@mdx-js/react": "2.1.3",
22-
"@theguild/components": "1.12.0",
23-
"framer-motion": "6.5.1",
24-
"next": "12.2.5",
25-
"next-i18next": "12.0.0",
26-
"next-seo": "5.5.0",
27-
"react": "17.0.2",
28-
"react-dom": "17.0.2",
29-
"react-icons": "4.4.0",
30-
"react-use": "17.4.0",
31-
"shiki": "0.11.1"
14+
"@theguild/components": "4.0.3",
15+
"next": "12.3.1",
16+
"react": "18.2.0",
17+
"react-dom": "18.2.0"
3218
},
3319
"browserslist": {
3420
"production": [
@@ -43,19 +29,11 @@
4329
]
4430
},
4531
"devDependencies": {
46-
"@guild-docs/algolia": "0.2.2",
47-
"@next/bundle-analyzer": "12.2.5",
48-
"@types/node": "16.11.56",
49-
"@types/react": "17.0.48",
50-
"concurrently": "7.3.0",
32+
"@theguild/algolia": "0.0.2",
33+
"@theguild/tailwind-config": "0.1.0",
34+
"@types/node": "18.7.18",
35+
"@types/react": "18.0.20",
5136
"cross-env": "7.0.3",
52-
"esbuild": "0.15.5",
53-
"esbuild-register": "3.3.3",
54-
"eslint-config-next": "12.2.5",
55-
"eslint-config-prettier": "8.5.0",
56-
"next-remote-watch": "1.0.0",
57-
"open-cli": "7.0.1",
58-
"typescript": "4.7.4",
59-
"wait-on": "6.0.1"
37+
"typescript": "4.8.3"
6038
}
6139
}

website/postcss.config.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@theguild/tailwind-config/postcss.config');

0 commit comments

Comments
 (0)