Skip to content

Commit

Permalink
Merge branch 'master' into martinhaintz/fix-flutter-multiview
Browse files Browse the repository at this point in the history
* master: (213 commits)
  Remove feature flag documentation from issue details page (#11734)
  docs(insights): Remove EA note from Queries re: MongoDB (#11735)
  docs(nuxt): `piniaIntegration` in Nuxt (#11684)
  feat(flags): Add OpenFeature and LaunchDarkly integration documentation (#11675)
  Cleaning up mermaid code and made it a bit more readable in dark mode (#11726)
  docs(scopes): Add graphics for scope forking (#11702)
  Unreal Engine plugin documentation update (#11625)
  Bump API schema to 25e528ff (#11728)
  Bump API schema to 12bd311c (#11725)
  fix dark theme resolution (#11718)
  Update sign in to go to sentry (#11723)
  getsentry/relay@4bdad17
  API examples syntax highlighting (#11715)
  feat: Convert mermaid code blocks to SVGs client side (#11690)
  Trace context is required for transactions (#11456)
  deps: Bump SDK to 8.36.0 (#11696)
  getsentry/relay@2e2587c
  MAUI screenshot `SetBeforeScreenshotCapture`(#11672)
  Add CSS rule to fix color of bold links (#11707)
  Fix small typo on web-vitals-concepts (#11706)
  ...
  • Loading branch information
mar-hai committed Nov 5, 2024
2 parents 97c512c + 9a7bded commit 06c2123
Show file tree
Hide file tree
Showing 663 changed files with 14,727 additions and 3,885 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-content-03-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "📝 Documentation on develop.sentry.dev"
labels: ["Type: Content", "Develop"]
description: Missing, incorrect, or unclear developer documentation.
body:
- type: markdown
attributes:
value: |-
Is the documentation issue something you know how to fix? Consider contributing to Open Source by opening a PR to fix it instead!
- type: input
id: area-specific
attributes:
label: Which section?
description: Which section of the developer documentation needs to be updated?
validations:
required: true
- type: input
id: page-url
attributes:
label: Page URL
description: Please provide the URL of the page which should be changed (if applicable).
- type: textarea
id: description
attributes:
label: Description
description: What were you looking for/trying to do/expecting?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Suggested Solution
description: If you have an idea on how we can solve this, please share.
- type: markdown
attributes:
value: |-
## Thanks 🙏
Check our [triage docs](https://open.sentry.io/triage/) for what to expect next.
2 changes: 1 addition & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# Product Areas - www.notion.so/sentry/473791bae5bf43399d46093050b77bf0
- name: 'Product Area: Unknown'
color: '8D5494'
- name: 'Product Area: Sign In'
- name: 'Product Area: Go to Sentry'
color: '8D5494'
- name: 'Product Area: Issues'
color: '8D5494'
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/enforce-version-convention.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Enforce Version Conventions

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
check-version-convention:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Run script for checking conventions
run: bun scripts/check-version-conventions.ts
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
with:
github-token: ${{ steps.token.outputs.token }}

# TODO(mjq): Bring this back once tests are working.
job_test:
name: Test
runs-on: ubuntu-latest
Expand All @@ -72,5 +71,4 @@ jobs:
- run: yarn install --frozen-lockfile
if: steps.cache.outputs.cache-hit != 'true'
- name: Run Tests
# run: yarn test
run: true
run: yarn test
120 changes: 100 additions & 20 deletions app/[[...path]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@ import {Home} from 'sentry-docs/components/home';
import {Include} from 'sentry-docs/components/include';
import {PlatformContent} from 'sentry-docs/components/platformContent';
import {
DocNode,
getCurrentPlatformOrGuide,
getDocsRootNode,
getNextNode,
getPreviousNode,
nodeForPath,
} from 'sentry-docs/docTree';
import {isDeveloperDocs} from 'sentry-docs/isDeveloperDocs';
import {getDevDocsFrontMatter, getDocsFrontMatter, getFileBySlug} from 'sentry-docs/mdx';
import {
getDevDocsFrontMatter,
getDocsFrontMatter,
getFileBySlug,
getVersionsFromDoc,
} from 'sentry-docs/mdx';
import {mdxComponents} from 'sentry-docs/mdxComponents';
import {setServerContext} from 'sentry-docs/serverContext';
import {PaginationNavNode} from 'sentry-docs/types/paginationNavNode';
import {stripVersion} from 'sentry-docs/versioning';

export async function generateStaticParams() {
const docs = await (isDeveloperDocs ? getDevDocsFrontMatter() : getDocsFrontMatter());
Expand All @@ -36,7 +46,11 @@ export const dynamic = 'force-static';

const mdxComponentsWithWrapper = mdxComponents(
{Include, PlatformContent},
({children, frontMatter}) => <DocPage frontMatter={frontMatter}>{children}</DocPage>
({children, frontMatter, nextPage, previousPage}) => (
<DocPage frontMatter={frontMatter} nextPage={nextPage} previousPage={previousPage}>
{children}
</DocPage>
)
);

function MDXLayoutRenderer({mdxSource, ...rest}) {
Expand All @@ -47,11 +61,48 @@ function MDXLayoutRenderer({mdxSource, ...rest}) {
export default async function Page({params}: {params: {path?: string[]}}) {
// get frontmatter of all docs in tree
const rootNode = await getDocsRootNode();

setServerContext({
rootNode,
path: params.path ?? [],
});

if (!params.path && !isDeveloperDocs) {
return <Home />;
}

const pageNode = nodeForPath(rootNode, params.path ?? '');

if (!pageNode) {
// eslint-disable-next-line no-console
console.warn('no page node', params.path);
return notFound();
}

// gather previous and next page that will be displayed in the bottom pagination
const getPaginationDetails = (
getNode: (node: DocNode) => DocNode | undefined | 'root',
page: PaginationNavNode | undefined
) => {
if (page && 'path' in page && 'title' in page) {
return page;
}

const node = getNode(pageNode);

if (node === 'root') {
return {path: '', title: 'Welcome to Sentry'};
}

return node ? {path: node.path, title: node.frontmatter.title} : undefined;
};

const previousPage = getPaginationDetails(
getPreviousNode,
pageNode?.frontmatter?.previousPage
);
const nextPage = getPaginationDetails(getNextNode, pageNode?.frontmatter?.nextPage);

if (isDeveloperDocs) {
// get the MDX for the current doc and render it
let doc: Awaited<ReturnType<typeof getFileBySlug>> | null = null;
Expand All @@ -67,13 +118,17 @@ export default async function Page({params}: {params: {path?: string[]}}) {
}
const {mdxSource, frontMatter} = doc;
// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc
return <MDXLayoutRenderer mdxSource={mdxSource} frontMatter={frontMatter} />;
}
if (!params.path) {
return <Home />;
return (
<MDXLayoutRenderer
mdxSource={mdxSource}
frontMatter={frontMatter}
nextPage={nextPage}
previousPage={previousPage}
/>
);
}

if (params.path[0] === 'api' && params.path.length > 1) {
if (params.path?.[0] === 'api' && params.path.length > 1) {
const categories = await apiCategories();
const category = categories.find(c => c.slug === params?.path?.[1]);
if (category) {
Expand All @@ -87,13 +142,6 @@ export default async function Page({params}: {params: {path?: string[]}}) {
}
}

const pageNode = nodeForPath(rootNode, params.path);
if (!pageNode) {
// eslint-disable-next-line no-console
console.warn('no page node', params.path);
return notFound();
}

// get the MDX for the current doc and render it
let doc: Awaited<ReturnType<typeof getFileBySlug>> | null = null;
try {
Expand All @@ -108,8 +156,19 @@ export default async function Page({params}: {params: {path?: string[]}}) {
}
const {mdxSource, frontMatter} = doc;

// collect versioned files
const allFm = await getDocsFrontMatter();
const versions = getVersionsFromDoc(allFm, pageNode.path);

// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc.
return <MDXLayoutRenderer mdxSource={mdxSource} frontMatter={frontMatter} />;
return (
<MDXLayoutRenderer
mdxSource={mdxSource}
frontMatter={{...frontMatter, versions}}
nextPage={nextPage}
previousPage={previousPage}
/>
);
}

type MetadataProps = {
Expand All @@ -118,6 +177,17 @@ type MetadataProps = {
};
};

// Helper function to clean up canonical tags missing leading or trailing slash
function formatCanonicalTag(tag: string) {
if (tag.charAt(0) !== '/') {
tag = '/' + tag;
}
if (tag.charAt(tag.length - 1) !== '/') {
tag = tag + '/';
}
return tag;
}

export async function generateMetadata({params}: MetadataProps): Promise<Metadata> {
const domain = isDeveloperDocs
? 'https://develop.sentry.dev'
Expand All @@ -128,27 +198,37 @@ export async function generateMetadata({params}: MetadataProps): Promise<Metadat
: domain;
let title =
'Sentry Docs | Application Performance Monitoring &amp; Error Tracking Software';
let customCanonicalTag;
let description =
'Self-hosted and cloud-based application performance monitoring &amp; error tracking that helps software teams see clearer, solve quicker, &amp; learn continuously.';
const images = [{url: `${previewDomain ?? domain}/meta.jpg`, width: 1200, height: 822}];

const rootNode = await getDocsRootNode();

if (params.path) {
const pageNode = nodeForPath(rootNode, params.path);
const pageNode = nodeForPath(
rootNode,
stripVersion(params.path.join('/')).split('/')
);
if (pageNode) {
const guideOrPlatform = getCurrentPlatformOrGuide(rootNode, params.path);

title =
pageNode.frontmatter.title +
(guideOrPlatform ? ` | Sentry for ${guideOrPlatform.title}` : '');
description = pageNode.frontmatter.description ?? '';

if (pageNode.frontmatter.customCanonicalTag) {
customCanonicalTag = formatCanonicalTag(pageNode.frontmatter.customCanonicalTag);
}
}
}

let canonical = domain;
if (params.path) {
canonical = `${domain}/${params.path.join('/')}/`;
}
const canonical = customCanonicalTag
? domain + customCanonicalTag
: params.path
? `${domain}/${params.path.join('/')}/`
: domain;

return {
title,
Expand Down
26 changes: 20 additions & 6 deletions app/platform-redirect/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {redirect} from 'next/navigation';

import {Alert} from 'sentry-docs/components/alert';
import {DocPage} from 'sentry-docs/components/docPage';
import {PlatformIcon} from 'sentry-docs/components/platformIcon';
import {SmartLink} from 'sentry-docs/components/smartLink';
Expand All @@ -14,16 +15,31 @@ export default async function Page({
if (Array.isArray(next)) {
next = next[0];
}

// discard the hash
const [pathname, _] = next.split('#');
const rootNode = await getDocsRootNode();
const defaultTitle = 'Platform Specific Content';
let description = '';
const platformInfo =
"The page you are looking for is customized for each platform. Select your platform below and we'll direct you to the most specific documentation on it.";
let title = defaultTitle;

// get rid of irrelevant platforms for the `next` path
const platformList = extractPlatforms(rootNode).filter(platform_ => {
return !!nodeForPath(rootNode, [
const node = nodeForPath(rootNode, [
'platforms',
platform_.key,
...pathname.split('/').filter(Boolean),
]);

// extract title and description for displaying it on page
if (node && title === defaultTitle && pathname.length > 0) {
title = node.frontmatter.title ?? title;
description = node.frontmatter.description || '';
}

return !!node;
});

if (platformList.length === 0) {
Expand All @@ -42,18 +58,16 @@ export default async function Page({
}

const frontMatter = {
title: 'Platform Specific Content',
title,
description,
};

// make the Sidebar aware of the current path
setServerContext({rootNode, path: ['platform-redirect']});

return (
<DocPage frontMatter={frontMatter}>
<p>
The page you are looking for is customized for each platform. Select your platform
below and we&apos;ll direct you to the most specific documentation on it.
</p>
<Alert level="info">{platformInfo}</Alert>

<ul>
{platformList.map(p => (
Expand Down
16 changes: 10 additions & 6 deletions apps/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry/nextjs": "8.29.0",
"@sentry/nextjs": "8.36.0",
"@spotlightjs/spotlight": "^2.1.1",
"next": "^15.0.0-canary.83",
"next": "15.0.0-rc.1",
"next-auth": "^4.24.5",
"next-mdx-remote": "^4.4.1",
"nextjs-toploader": "^1.6.6",
"nuqs": "^1.17.7",
"prism-sentry": "^1.0.2",
"react": "beta",
"react-dom": "beta",
"react": "19.0.0-rc-cd22717c-20241013",
"react-dom": "19.0.0-rc-cd22717c-20241013",
"react-select": "^5.7.3",
"react-textarea-autosize": "^8.5.3",
"rehype-prism-plus": "^1.6.3",
Expand All @@ -44,8 +44,8 @@
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18.3.0",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"@types/rss": "^0.0.32",
"autoprefixer": "^10.4.17",
"dotenv-cli": "^7.4.2",
Expand All @@ -58,5 +58,9 @@
},
"volta": {
"extends": "../../package.json"
},
"resolutions": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
}
}
Loading

0 comments on commit 06c2123

Please sign in to comment.