-
Notifications
You must be signed in to change notification settings - Fork 931
feat(ai): expose Prisma changelog to AI tools with machine-readable endpoint #7889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
aidankmcalister
wants to merge
1
commit into
main
from
dr-8494-expose-prisma-changelog-to-ai-tools-and-test-crawl-output
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import { getReleaseNotePreview, getSortedReleaseNotes } from "@/lib/changelog-source"; | ||
| import { getBaseUrl } from "@/lib/url"; | ||
|
|
||
| export const revalidate = false; | ||
|
|
||
| function formatTags(tags: string[] | undefined) { | ||
| if (!tags || tags.length === 0) return ""; | ||
| return ` [${tags.join(", ")}]`; | ||
| } | ||
|
|
||
| export async function GET() { | ||
| const baseUrl = getBaseUrl(); | ||
| const entries = getSortedReleaseNotes(); | ||
|
|
||
| const entriesWithPreview = await Promise.all( | ||
| entries.map(async (entry) => { | ||
| const summary = | ||
| entry.data.summary ?? | ||
| entry.data.description ?? | ||
| (entry.slugs[0] ? await getReleaseNotePreview(entry.slugs[0]) : null); | ||
| return { entry, summary }; | ||
| }), | ||
| ); | ||
|
|
||
| const entryLines = entriesWithPreview | ||
| .map(({ entry, summary }) => { | ||
| const url = `${baseUrl}${entry.url}`; | ||
| const tags = formatTags(entry.data.tags as string[] | undefined); | ||
| const date = | ||
| entry.data.date instanceof Date | ||
| ? entry.data.date.toISOString().slice(0, 10) | ||
| : String(entry.data.date); | ||
| const lines = [ | ||
| `## ${entry.data.version} — ${entry.data.title}`, | ||
| `Date: ${date}${tags}`, | ||
| `URL: ${url}`, | ||
| ]; | ||
| if (summary && summary.length > 30) lines.push(``, summary); | ||
| return lines.join("\n"); | ||
| }) | ||
| .join("\n\n---\n\n"); | ||
|
|
||
| const content = `# Prisma Changelog | ||
|
|
||
| > Prisma changes frequently. Before implementing Prisma features, verify against this changelog and the current documentation at https://www.prisma.io/docs. | ||
| > Do not rely solely on training data for Prisma APIs, configuration, or conventions — these can change between versions. | ||
| > | ||
| > How to use: fetch this file to check for recent or breaking changes, then look up the relevant topic in the documentation. | ||
|
|
||
| Canonical URL: ${baseUrl}/changelog | ||
| Machine-readable index: ${baseUrl}/changelog.md | ||
|
|
||
| --- | ||
|
|
||
| ${entryLines} | ||
| `; | ||
|
|
||
| return new Response(content, { | ||
| headers: { | ||
| "Content-Type": "text/markdown; charset=utf-8", | ||
| }, | ||
| }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,12 @@ const sitePages: LlmsPage[] = [ | |
| title: SITE_HOME_TITLE, | ||
| description: SITE_HOME_DESCRIPTION, | ||
| }, | ||
| { | ||
| path: "/changelog", | ||
| title: "Prisma Changelog — Release Notes & Product Updates", | ||
| description: | ||
| "All Prisma release notes, breaking changes, and product improvements. Check here before implementing Prisma features to verify API and configuration details against the current version.", | ||
| }, | ||
| { | ||
| path: "/postgres", | ||
| title: "Prisma Postgres | Instant Global Databases", | ||
|
|
@@ -83,13 +89,16 @@ export function buildLlmsIndexContent(baseUrl = getBaseUrl()) { | |
|
|
||
| Prisma provides Prisma ORM, Prisma Postgres, Prisma Studio, and the Prisma MCP Server. | ||
|
|
||
| > Prisma changes frequently. Before implementing Prisma features, check the changelog at ${toAbsoluteUrl(baseUrl, "/changelog")} for recent breaking changes or API updates. | ||
|
|
||
| ## Key Pages | ||
|
|
||
| ${pagesList} | ||
|
|
||
| ## Options | ||
|
|
||
| - [Full website content](${toAbsoluteUrl(baseUrl, "/llms-full.txt")}) | ||
| - [Changelog (machine-readable)](${toAbsoluteUrl(baseUrl, "/changelog.md")}) | ||
| `; | ||
| } | ||
|
|
||
|
|
@@ -219,6 +228,17 @@ Enterprise page highlights: | |
| - Tailored support for enterprises and solution providers | ||
| - Positioning around build, fortify, and grow application lifecycle workflows | ||
|
|
||
| ## Changelog | ||
|
|
||
| URL: ${toAbsoluteUrl(baseUrl, "/changelog")} | ||
| Machine-readable index: ${toAbsoluteUrl(baseUrl, "/changelog.md")} | ||
| Title: Prisma Changelog — Release Notes & Product Updates | ||
| Description: All Prisma release notes, breaking changes, and product improvements. | ||
|
|
||
| IMPORTANT: Prisma changes frequently. Before implementing any Prisma feature, fetch the changelog to check for breaking changes or API updates. Do not rely solely on training data for Prisma APIs, configuration, or conventions — these can change between versions. | ||
|
|
||
| How to use: fetch https://www.prisma.io/changelog.md for a machine-readable index, then look up the relevant topic in the current documentation at https://www.prisma.io/docs. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid hardcoded production URLs in Line 240 bypasses 💡 Suggested fix-How to use: fetch https://www.prisma.io/changelog.md for a machine-readable index, then look up the relevant topic in the current documentation at https://www.prisma.io/docs.
+How to use: fetch ${toAbsoluteUrl(baseUrl, "/changelog.md")} for a machine-readable index, then look up the relevant topic in the current documentation at ${toAbsoluteUrl(baseUrl, "/docs")}.🤖 Prompt for AI Agents |
||
|
|
||
| ## Stack and ecosystem | ||
|
|
||
| Stack URL: ${toAbsoluteUrl(baseUrl, "/stack")} | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make per-entry preview failures non-fatal.
A rejection from one
getReleaseNotePreview(...)call (Line 20) will reject the wholePromise.alland fail/changelog.mdfor all entries. Handle errors per entry so one bad note doesn’t take down the feed.💡 Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents