docs: fix index.html.md causing 404 (#12241)

* docs: fix index.html.md causing 404

* update next.js

* test

* test

* test

* test

* fix revalidate

* test

* test

* test

* test

* test

* test

* test

* test

* clean up
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-04-18 18:08:54 +03:00
1 parent 2e65f7ffc0
commit f3cb8f2e03
12 files changed
+1398 -44

No files matched your search

+3 -3
View File
@@ -18,7 +18,7 @@
"@mdx-js/react": "^3.1.0",
"@medusajs/icons": "2.6.0",
"@medusajs/ui": "4.0.6",
"@next/mdx": "15.0.4",
"@next/mdx": "15.3.1",
"@react-hook/resize-observer": "^2.0.2",
"@readme/openapi-parser": "^2.5.0",
"algoliasearch": "4",
@@ -29,7 +29,7 @@
"jsdom": "^22.1.0",
"json-schema": "^0.4.0",
"json-stringify-pretty-compact": "^4.0.0",
"next": "15.0.4",
"next": "15.3.1",
"next-mdx-remote": "5.0.0",
"openapi-sampler": "^1.3.1",
"pluralize": "^8.0.0",
@@ -51,7 +51,7 @@
"yaml": "^2.3.1"
},
"devDependencies": {
"@next/bundle-analyzer": "15.0.4",
"@next/bundle-analyzer": "15.3.1",
"@types/jsdom": "^21.1.1",
"@types/mapbox__rehype-prism": "^0.8.0",
"@types/mdx": "^2.0.13",
+3
View File
@@ -169,6 +169,9 @@ const nextConfig = {
}
},
redirects,
outputFileTracingIncludes: {
"/md\\-content/\\[\\.\\.\\.slug\\]": ["./app/**/*.mdx"],
},
outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"],
},
+2 -2
View File
@@ -17,11 +17,11 @@
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@medusajs/icons": "~2.5.1",
"@next/mdx": "15.0.4",
"@next/mdx": "15.3.1",
"clsx": "^2.1.0",
"docs-ui": "*",
"docs-utils": "*",
"next": "15.0.4",
"next": "15.3.1",
"react": "rc",
"react-dom": "rc",
"rehype-mdx-code-props": "^2.0.0",
@@ -31,7 +31,7 @@ export async function GET(req: NextRequest, { params }: Params) {
return notFound()
}
const filePath = path.join(path.resolve("..", "..", ".."), filePathFromMap)
const filePath = path.join(process.cwd(), "..", "..", "..", filePathFromMap)
if (!existsSync(filePath)) {
return notFound()
+5 -1
View File
@@ -58,7 +58,7 @@ const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
transpilePackages: ["docs-ui"],
transpilePackages: ["docs-ui", "next-mdx-remote"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/resources",
async redirects() {
@@ -178,6 +178,10 @@ const nextConfig = {
outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"],
},
outputFileTracingIncludes: {
"/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": ["./app/**/*.mdx"],
"/md\\-content/references/**": ["./references/**/*.mdx"],
},
experimental: {
optimizePackageImports: ["@medusajs/icons", "@medusajs/ui", "elkjs"],
},
+2 -2
View File
@@ -17,10 +17,10 @@
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@medusajs/icons": "~2.5.1",
"@next/mdx": "15.0.4",
"@next/mdx": "15.3.1",
"clsx": "^2.1.0",
"docs-ui": "*",
"next": "15.0.4",
"next": "15.3.1",
"react": "rc",
"react-dom": "rc",
"rehype-mdx-code-props": "^2.0.0",
+7
View File
@@ -4,6 +4,13 @@ const { withContentlayer } = require("next-contentlayer")
const nextConfig = {
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/ui",
reactStrictMode: true,
outputFileTracingIncludes: {
"/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": [
"./src/content/docs/**/*.mdx",
"./specs/**/*",
"./examples/**/*"
],
},
}
module.exports = withContentlayer(nextConfig)
+1 -1
View File
@@ -27,7 +27,7 @@
"docs-ui": "*",
"docs-utils": "*",
"mdast-util-toc": "^7.0.0",
"next": "15.0.4",
"next": "15.3.1",
"next-contentlayer": "^0.3.4",
"next-themes": "^0.2.1",
"postcss": "8.4.27",
+3
View File
@@ -105,6 +105,9 @@ const nextConfig = {
transpilePackages: ["docs-ui"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/user-guide",
outputFileTracingIncludes: {
"/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": ["./app/**/*.mdx"],
},
outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"],
},