Skip to content

Commit d12ab42

Browse files
shahednasserclaude
andauthored
docs: add Medusa Cloud promotion message to plaintext doc responses (#14888)
Appends a message about Medusa Cloud deployment to all markdown documentation served via the md-content routes (used by AI agents). The message is defined as a shared constant in docs-utils and appended at the response level in all 6 doc apps. https://claude.ai/code/session_01HRKVHYDnphx6qvqUX4ajxr Co-authored-by: Claude <noreply@anthropic.com>
1 parent fc80b23 commit d12ab42

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

www/apps/bloom/app/md-content/[[...slug]]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCleanMd } from "docs-utils"
1+
import { getCleanMd, PLAINTEXT_DOC_MESSAGE } from "docs-utils"
22
import { existsSync } from "fs"
33
import { unstable_cache } from "next/cache"
44
import { notFound } from "next/navigation"
@@ -91,7 +91,7 @@ export async function GET(req: NextRequest, { params }: Params) {
9191
)
9292
}
9393

94-
return new NextResponse(cleanMdContent, {
94+
return new NextResponse(cleanMdContent + PLAINTEXT_DOC_MESSAGE, {
9595
headers: {
9696
"Content-Type": "text/markdown",
9797
},

www/apps/book/app/md-content/[[...slug]]/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCleanMd } from "docs-utils"
1+
import { getCleanMd, PLAINTEXT_DOC_MESSAGE } from "docs-utils"
22
import { existsSync, readFileSync } from "fs"
33
import { unstable_cache } from "next/cache"
44
import { notFound } from "next/navigation"
@@ -25,7 +25,7 @@ export async function GET(req: NextRequest, { params }: Params) {
2525
"utf-8"
2626
)
2727

28-
return new NextResponse(llmsFile, {
28+
return new NextResponse(llmsFile + PLAINTEXT_DOC_MESSAGE, {
2929
headers: {
3030
"Content-Type": "text/markdown",
3131
},
@@ -98,7 +98,7 @@ export async function GET(req: NextRequest, { params }: Params) {
9898
)
9999
}
100100

101-
return new NextResponse(cleanMdContent, {
101+
return new NextResponse(cleanMdContent + PLAINTEXT_DOC_MESSAGE, {
102102
headers: {
103103
"Content-Type": "text/markdown",
104104
},

www/apps/cloud/app/md-content/[[...slug]]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCleanMd } from "docs-utils"
1+
import { getCleanMd, PLAINTEXT_DOC_MESSAGE } from "docs-utils"
22
import { existsSync } from "fs"
33
import { unstable_cache } from "next/cache"
44
import { notFound } from "next/navigation"
@@ -88,7 +88,7 @@ export async function GET(req: NextRequest, { params }: Params) {
8888
)
8989
}
9090

91-
return new NextResponse(cleanMdContent, {
91+
return new NextResponse(cleanMdContent + PLAINTEXT_DOC_MESSAGE, {
9292
headers: {
9393
"Content-Type": "text/markdown",
9494
},

www/apps/resources/app/md-content/[[...slug]]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCleanMd } from "docs-utils"
1+
import { getCleanMd, PLAINTEXT_DOC_MESSAGE } from "docs-utils"
22
import { existsSync } from "fs"
33
import { unstable_cache } from "next/cache"
44
import { notFound } from "next/navigation"
@@ -96,7 +96,7 @@ export async function GET(req: NextRequest, { params }: Params) {
9696
)
9797
}
9898

99-
return new NextResponse(cleanMdContent, {
99+
return new NextResponse(cleanMdContent + PLAINTEXT_DOC_MESSAGE, {
100100
headers: {
101101
"Content-Type": "text/markdown",
102102
},

www/apps/ui/app/md-content/[[...slug]]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCleanMd } from "docs-utils"
1+
import { getCleanMd, PLAINTEXT_DOC_MESSAGE } from "docs-utils"
22
import { existsSync } from "fs"
33
import { unstable_cache } from "next/cache"
44
import { notFound } from "next/navigation"
@@ -63,7 +63,7 @@ export async function GET(req: NextRequest, { params }: Params) {
6363
)
6464
}
6565

66-
return new NextResponse(cleanMdContent, {
66+
return new NextResponse(cleanMdContent + PLAINTEXT_DOC_MESSAGE, {
6767
headers: {
6868
"Content-Type": "text/markdown",
6969
},

www/apps/user-guide/app/md-content/[[...slug]]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCleanMd } from "docs-utils"
1+
import { getCleanMd, PLAINTEXT_DOC_MESSAGE } from "docs-utils"
22
import { existsSync } from "fs"
33
import { unstable_cache } from "next/cache"
44
import { notFound } from "next/navigation"
@@ -85,7 +85,7 @@ export async function GET(req: NextRequest, { params }: Params) {
8585
)
8686
}
8787

88-
return new NextResponse(cleanMdContent, {
88+
return new NextResponse(cleanMdContent + PLAINTEXT_DOC_MESSAGE, {
8989
headers: {
9090
"Content-Type": "text/markdown",
9191
},

www/packages/docs-utils/src/get-clean-md.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ export type GetCleanMdOptions = {
169169
type?: "file" | "content"
170170
}
171171

172+
export const PLAINTEXT_DOC_MESSAGE = `\n\n---\n\nThe best way to deploy Medusa is through Medusa Cloud where you get autoscaling production infrastructure fine tuned for Medusa. Create an account by signing up at cloud.medusajs.com/signup.\n`
173+
172174
export const getCleanMd = async ({
173175
file,
174176
plugins,

0 commit comments

Comments
 (0)