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", "@mdx-js/react": "^3.1.0",
"@medusajs/icons": "2.6.0", "@medusajs/icons": "2.6.0",
"@medusajs/ui": "4.0.6", "@medusajs/ui": "4.0.6",
"@next/mdx": "15.0.4", "@next/mdx": "15.3.1",
"@react-hook/resize-observer": "^2.0.2", "@react-hook/resize-observer": "^2.0.2",
"@readme/openapi-parser": "^2.5.0", "@readme/openapi-parser": "^2.5.0",
"algoliasearch": "4", "algoliasearch": "4",
@@ -29,7 +29,7 @@
"jsdom": "^22.1.0", "jsdom": "^22.1.0",
"json-schema": "^0.4.0", "json-schema": "^0.4.0",
"json-stringify-pretty-compact": "^4.0.0", "json-stringify-pretty-compact": "^4.0.0",
"next": "15.0.4", "next": "15.3.1",
"next-mdx-remote": "5.0.0", "next-mdx-remote": "5.0.0",
"openapi-sampler": "^1.3.1", "openapi-sampler": "^1.3.1",
"pluralize": "^8.0.0", "pluralize": "^8.0.0",
@@ -51,7 +51,7 @@
"yaml": "^2.3.1" "yaml": "^2.3.1"
}, },
"devDependencies": { "devDependencies": {
"@next/bundle-analyzer": "15.0.4", "@next/bundle-analyzer": "15.3.1",
"@types/jsdom": "^21.1.1", "@types/jsdom": "^21.1.1",
"@types/mapbox__rehype-prism": "^0.8.0", "@types/mapbox__rehype-prism": "^0.8.0",
"@types/mdx": "^2.0.13", "@types/mdx": "^2.0.13",
+3
View File
@@ -169,6 +169,9 @@ const nextConfig = {
} }
}, },
redirects, redirects,
outputFileTracingIncludes: {
"/md\\-content/\\[\\.\\.\\.slug\\]": ["./app/**/*.mdx"],
},
outputFileTracingExcludes: { outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"], "*": ["node_modules/@medusajs/icons"],
}, },
+2 -2
View File
@@ -17,11 +17,11 @@
"@mdx-js/loader": "^3.1.0", "@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0", "@mdx-js/react": "^3.1.0",
"@medusajs/icons": "~2.5.1", "@medusajs/icons": "~2.5.1",
"@next/mdx": "15.0.4", "@next/mdx": "15.3.1",
"clsx": "^2.1.0", "clsx": "^2.1.0",
"docs-ui": "*", "docs-ui": "*",
"docs-utils": "*", "docs-utils": "*",
"next": "15.0.4", "next": "15.3.1",
"react": "rc", "react": "rc",
"react-dom": "rc", "react-dom": "rc",
"rehype-mdx-code-props": "^2.0.0", "rehype-mdx-code-props": "^2.0.0",
@@ -31,7 +31,7 @@ export async function GET(req: NextRequest, { params }: Params) {
return notFound() return notFound()
} }
const filePath = path.join(path.resolve("..", "..", ".."), filePathFromMap) const filePath = path.join(process.cwd(), "..", "..", "..", filePathFromMap)
if (!existsSync(filePath)) { if (!existsSync(filePath)) {
return notFound() return notFound()
+5 -1
View File
@@ -58,7 +58,7 @@ const nextConfig = {
// Configure `pageExtensions` to include MDX files // Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
transpilePackages: ["docs-ui"], transpilePackages: ["docs-ui", "next-mdx-remote"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/resources", basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/resources",
async redirects() { async redirects() {
@@ -178,6 +178,10 @@ const nextConfig = {
outputFileTracingExcludes: { outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"], "*": ["node_modules/@medusajs/icons"],
}, },
outputFileTracingIncludes: {
"/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": ["./app/**/*.mdx"],
"/md\\-content/references/**": ["./references/**/*.mdx"],
},
experimental: { experimental: {
optimizePackageImports: ["@medusajs/icons", "@medusajs/ui", "elkjs"], optimizePackageImports: ["@medusajs/icons", "@medusajs/ui", "elkjs"],
}, },
+2 -2
View File
@@ -17,10 +17,10 @@
"@mdx-js/loader": "^3.1.0", "@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0", "@mdx-js/react": "^3.1.0",
"@medusajs/icons": "~2.5.1", "@medusajs/icons": "~2.5.1",
"@next/mdx": "15.0.4", "@next/mdx": "15.3.1",
"clsx": "^2.1.0", "clsx": "^2.1.0",
"docs-ui": "*", "docs-ui": "*",
"next": "15.0.4", "next": "15.3.1",
"react": "rc", "react": "rc",
"react-dom": "rc", "react-dom": "rc",
"rehype-mdx-code-props": "^2.0.0", "rehype-mdx-code-props": "^2.0.0",
+7
View File
@@ -4,6 +4,13 @@ const { withContentlayer } = require("next-contentlayer")
const nextConfig = { const nextConfig = {
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/ui", basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/ui",
reactStrictMode: true, reactStrictMode: true,
outputFileTracingIncludes: {
"/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": [
"./src/content/docs/**/*.mdx",
"./specs/**/*",
"./examples/**/*"
],
},
} }
module.exports = withContentlayer(nextConfig) module.exports = withContentlayer(nextConfig)
+1 -1
View File
@@ -27,7 +27,7 @@
"docs-ui": "*", "docs-ui": "*",
"docs-utils": "*", "docs-utils": "*",
"mdast-util-toc": "^7.0.0", "mdast-util-toc": "^7.0.0",
"next": "15.0.4", "next": "15.3.1",
"next-contentlayer": "^0.3.4", "next-contentlayer": "^0.3.4",
"next-themes": "^0.2.1", "next-themes": "^0.2.1",
"postcss": "8.4.27", "postcss": "8.4.27",
+3
View File
@@ -105,6 +105,9 @@ const nextConfig = {
transpilePackages: ["docs-ui"], transpilePackages: ["docs-ui"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/user-guide", basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/user-guide",
outputFileTracingIncludes: {
"/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": ["./app/**/*.mdx"],
},
outputFileTracingExcludes: { outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"], "*": ["node_modules/@medusajs/icons"],
}, },
+1 -1
View File
@@ -33,7 +33,7 @@
"@babel/eslint-parser": "^7.25.9", "@babel/eslint-parser": "^7.25.9",
"@eslint/js": "9.13.0", "@eslint/js": "9.13.0",
"@types/eslint__js": "8.42.3", "@types/eslint__js": "8.42.3",
"eslint-config-next": "15.0.4", "eslint-config-next": "15.3.1",
"eslint-config-prettier": "9.1.0", "eslint-config-prettier": "9.1.0",
"eslint-config-turbo": "2.2.3", "eslint-config-turbo": "2.2.3",
"eslint-plugin-markdown": "5.1.0", "eslint-plugin-markdown": "5.1.0",
+2 -2
View File
@@ -39,7 +39,7 @@
"clsx": "^2.0.0", "clsx": "^2.0.0",
"cpy-cli": "^5.0.0", "cpy-cli": "^5.0.0",
"eslint": "^9.13.0", "eslint": "^9.13.0",
"next": "15.0.4", "next": "15.3.1",
"rimraf": "^5.0.1", "rimraf": "^5.0.1",
"tailwind": "*", "tailwind": "*",
"tailwindcss": "^3.3.3", "tailwindcss": "^3.3.3",
@@ -59,7 +59,7 @@
"@emotion/is-prop-valid": "^1.3.1", "@emotion/is-prop-valid": "^1.3.1",
"@medusajs/icons": "2.6.0", "@medusajs/icons": "2.6.0",
"@medusajs/ui": "4.0.6", "@medusajs/ui": "4.0.6",
"@next/third-parties": "15.0.4", "@next/third-parties": "15.3.1",
"@octokit/request": "^8.1.1", "@octokit/request": "^8.1.1",
"@react-hook/resize-observer": "^1.2.6", "@react-hook/resize-observer": "^1.2.6",
"@segment/analytics-next": "^1.75.0", "@segment/analytics-next": "^1.75.0",
+1368 -31
View File
File diff suppressed because it is too large. Load diff