Skip to content

Commit 60ba25a

Browse files
a-haritiGabeVillalobosmarkstoryjjbayerDominikB2014
authored
Develop docs 2 (#10345)
* remove unused docs prop * add getDevDocsFrontMatter() * escape {} braces * fix image path * fix comment block * fix style prop * fix me later * fix comments * fix me later * delete seemingly invisible <IconFire /> components on component-library * account for developer docs on middleware redirects * fix opentelemetry table syntax * port configValue component * temp fix for github integration * port createGitHubAppForm component * oopsy * reaname DEVELOPER_DOCS env var * remove console.logs * fix developer docs home page * force preview to show developer docs for now * make TS happy * feat: account for developer docs on sitemap * fix missing slash on sitemap entries * simplify sitemap logic * refactor: extract developer docs check to its own module * hide sidebar for now * add host condition to sdk docs wildcard redirects * fix generateStaticParams() depending on kind of docs * split vercel.json file to base and redirects * dynamically build vercel.json based on target docs * throw an error if base-vercel.json has redirects or rewrites * fix developer docs checks on middleware * populate serverContext before handling develop-docs paths * fix develop-docs docTree * remove unecessary null check * sidebar (wip) * feat(flagpole): Updates feature flag docs for Flagpole rollout (#1299) Co-authored-by: Mark Story <mark@mark-story.com> * doc(metrics): Metric tags can only have a single value (#1307) * chore(flagpole): Updates documentation with commonly used context properties (#1308) * feat(insights): asset module documentation (#1306) * asset module initial docs * update broken link * Update assets.mdx Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com> * Update assets.mdx Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com> * Update assets.mdx Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com> * Update assets.mdx Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com> * code review * Update src/docs/sdk/performance/modules/assets.mdx Co-authored-by: Ash <0Calories@users.noreply.github.com> * asset data description * update snippet * update typos --------- Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com> Co-authored-by: Ash <0Calories@users.noreply.github.com> * Add new mechanism fields from RFC 0079 (#1207) * docs(migrations): Update is_dangerous -> is_post_deployment (#1310) * fix: Clarify context keys (#1309) * feat: Remove DDM * Document Java SDK learnings for Hubs/Scopes merge (#1251) * tidy up sidebar items (wip) * Upgrade to GitHub-native Dependabot (#322) Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Abhijeet Prasad <aprasad@sentry.io> * add data data-schemas submodule to develop-docs * move data-schemas to the top level * . * Move content to subfolders; make sure pages use proper MDX for titles * wip * SDK Philosophy - Write less code (#1316) * SDK Philosophy - Write less code Another addition for our SDK Philosophy * Update philosophy.mdx * Update src/docs/sdk/philosophy.mdx Co-authored-by: Abhijeet Prasad <aprasad@sentry.io> --------- Co-authored-by: Michi Hoffmann <cleptric@users.noreply.github.com> Co-authored-by: Abhijeet Prasad <aprasad@sentry.io> * fix: Improve ngrok setup docs (#1317) Clarify how ngrok should be setup for siloed and non-siloed modes. Refs getsentry/sentry#14423 * chore(hybridcloud) Add sentry_region to flagpole docs (#1318) * feat(feedback): add page for feedback architecture (#1313) * feat(feedback): add a page for feedback architecture * Camelcase for model name * Add diagrams * Add some whitespace * Header capitalizion * Update src/docs/feedback-architecture.mdx Co-authored-by: Catherine Lee <55311782+c298lee@users.noreply.github.com> * Update src/docs/feedback-architecture.mdx Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> * Update src/docs/feedback-architecture.mdx Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> * Update src/docs/feedback-architecture.mdx Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> * Update src/docs/feedback-architecture.mdx Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> * Update src/docs/feedback-architecture.mdx Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> * Update src/docs/feedback-architecture.mdx Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> * Add to bottom of sidebar as 'User Feedback Architecture' * Make diagrams light mode * Tweak ##Creation sources wording * Add links to envelope formats in Creation sources + some more tweaks * Code-ify user_report * Reword mistakenly * Tweak diagrams: envelopes->envelope and rm widget/api from first graph * Reword user report endpoint * Add crash reports section * Split up diagrams and finalize * Tweak feedback envelope * Update report diagram * Update title * Add ff's * Use bullet points * Tweak ff descrip * Final tweaks --------- Co-authored-by: Catherine Lee <55311782+c298lee@users.noreply.github.com> Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> * fix(flagpole): Fixes incorrect segment behavior description (#1322) * fix: Update docs on running migration tests (#1323) * Revert "wip" This reverts commit a504ca4. * formatting * fix redirect type * Use frontmatter for all page titles * Fix title for performance page * formatting * somewhat working JsonSchema * update git submodules before build * feat: build algolia index conditionally * switch git submodules to https * feat(migrations): add docs for snapshots & backup testing (#1324) * feat(features) Add note to remove features from options-automator (#1325) * chore(hybridcloud) Update hybridcloud examples to use new paths (#1326) Paths have changed and docs need to be updated. * Discord "SDK Contributor" chat is no longer used. Moved to "SDK-Chat" (#1328) * conditionally skip builds based on APP_NAME env var and changes APP_NAME should be either `sdk-docs` or `develop-docs` * document skip-build script * simplify skip-build.sh logic * suppress console.log warning * really? * docs: Document bump version workflow (#1329) * Extend github integration docs (#1235) * Update github.mdx * Update sso.mdx * fix(environment): restructure subheadings and clarify ingest setup (#1330) * restructure docs and clarify ingest setup * fix copy paste errors * fix link location * fix link location again * fix missing backticks * move getsentry instructions above siloed instance instructions * bug * properly bold text * chore: re-trigger deploy * proper build scripts for dev docs and sdk docs (#10617) * re-trigger deploy This reverts commit 619ec78. * re-trigger deploy This reverts commit 1f46763. * fix dev build command * fix: update algolia workflow * fix: load correct frontmatter in algolia build * [getsentry/action-github-commit] Auto commit * fix: set env var for gh action --------- Co-authored-by: Gabe Villalobos <GabeVillalobos@users.noreply.github.com> Co-authored-by: Mark Story <mark@mark-story.com> Co-authored-by: Joris Bayer <joris.bayer@sentry.io> Co-authored-by: Dominik Buszowiecki <44422760+DominikB2014@users.noreply.github.com> Co-authored-by: George Gritsouk <989898+gggritso@users.noreply.github.com> Co-authored-by: Ash <0Calories@users.noreply.github.com> Co-authored-by: Emir Ribić <ribice@gmail.com> Co-authored-by: Isabella Enriquez <isabellapenriquez@gmail.com> Co-authored-by: Francesco Novy <francesconovy@gmail.com> Co-authored-by: Matej Minar <matej.minar@sentry.io> Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Abhijeet Prasad <aprasad@sentry.io> Co-authored-by: Stephanie Anderson <stephanie.anderson@sentry.io> Co-authored-by: Daniel Griesser <daniel.griesser.86@gmail.com> Co-authored-by: Michi Hoffmann <cleptric@users.noreply.github.com> Co-authored-by: Andrew Liu <159852527+aliu39@users.noreply.github.com> Co-authored-by: Catherine Lee <55311782+c298lee@users.noreply.github.com> Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com> Co-authored-by: Alberto Leal <mail4alberto@gmail.com> Co-authored-by: Charly Gomez <charly.gomez@sentry.io> Co-authored-by: Simon Hellmayr <shellmayr@users.noreply.github.com> Co-authored-by: Joe Malatesta <106361624+joemmalatesta@users.noreply.github.com> Co-authored-by: Tony Xiao <txiao@sentry.io> Co-authored-by: Lucas <lucas@raschek.at> Co-authored-by: Michelle Fu <83109586+mifu67@users.noreply.github.com> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent f16f0bc commit 60ba25a

209 files changed

Lines changed: 2333 additions & 1567 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ updates:
3131
schedule:
3232
# Check for updates to GitHub Actions every week
3333
interval: 'daily'
34+
35+
- package-ecosystem: gitsubmodule
36+
directory: '/'
37+
schedule:
38+
interval: daily
39+
open-pull-requests-limit: 10
40+
reviewers:
41+
- AbhiPrasad

.github/workflows/algolia-index.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212
- uses: getsentry/action-setup-volta@c52be2ea13cfdc084edb806e81958c13e445941e # v1.2.0
13+
- uses: dorny/paths-filter@v3
14+
id: filter
15+
with:
16+
filters: |
17+
docs:
18+
- 'docs/**'
19+
- 'includes/**'
20+
- 'platform-includes/**'
21+
dev-docs:
22+
- 'develop-docs/**'
1323
- uses: oven-sh/setup-bun@v1
1424
with:
1525
bun-version: latest
@@ -22,16 +32,38 @@ jobs:
2232

2333
- run: yarn install --frozen-lockfile
2434
if: steps.cache.outputs.cache-hit != 'true'
35+
2536
# Remove the changelog directory to avoid a build error due to missing `DATABASE_URL`
2637
# and save some build time.
2738
- run: rm -r app/changelog
39+
2840
- run: yarn build
41+
if: steps.filter.outputs.docs == 'true'
42+
43+
- run: yarn build:developer-docs
44+
if: steps.filter.outputs.dev-docs == 'true'
45+
46+
2947
# bun seems to be the most straightforward way to run a TypeScript script
3048
# without introducing another dependency like ts-node or tsx for everyone else
49+
50+
# build docs index
3151
- run: bun ./scripts/algolia.ts
52+
if: steps.filter.outputs.docs == 'true'
3253
env:
3354
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
3455
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
3556
DOCS_INDEX_NAME: ${{ secrets.DOCS_INDEX_NAME }}
3657
NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.NEXT_PUBLIC_ALGOLIA_APP_ID }}
3758
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY: ${{ secrets.NEXT_PUBLIC_ALGOLIA_SEARCH_KEY }}
59+
60+
# build dev docs index
61+
- run: bun ./scripts/algolia.ts
62+
if: steps.filter.outputs.dev-docs == 'true'
63+
env:
64+
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
65+
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
66+
DOCS_INDEX_NAME: ${{ secrets.DEVELOP_DOCS_INDEX_NAME }}
67+
NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.NEXT_PUBLIC_ALGOLIA_APP_ID }}
68+
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY: ${{ secrets.NEXT_PUBLIC_ALGOLIA_SEARCH_KEY }}
69+
DEVELOPER_DOCS: 1

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,7 @@ public/page-data
9595
tsconfig.tsbuildinfo
9696

9797
public/mdx-images/*
98+
99+
# the vercel.json should be generated by the ./scripts/make-vercel-json.mjs script
100+
# to differentiate between SDK docs and developer docs redirects
101+
vercel.json

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "data-schemas"]
2+
path = data-schemas
3+
url = https://github.com/getsentry/sentry-data-schemas.git

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ repos:
1111
- id: check-xml
1212
- id: check-yaml
1313
- id: detect-private-key
14+
exclude: |
15+
(?x)^(
16+
develop-docs/application/config.mdx|
17+
develop-docs/integrations/github.mdx|
18+
develop-docs/self-hosted/sso.mdx
19+
)$
1420
- id: end-of-file-fixer
1521
- id: trailing-whitespace
1622
- id: debug-statements

app/[[...path]]/page.tsx

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ import {
1515
getDocsRootNode,
1616
nodeForPath,
1717
} from 'sentry-docs/docTree';
18-
import {getDocsFrontMatter, getFileBySlug} from 'sentry-docs/mdx';
18+
import {isDeveloperDocs} from 'sentry-docs/isDeveloperDocs';
19+
import {getDevDocsFrontMatter, getDocsFrontMatter, getFileBySlug} from 'sentry-docs/mdx';
1920
import {mdxComponents} from 'sentry-docs/mdxComponents';
2021
import {setServerContext} from 'sentry-docs/serverContext';
2122
import {capitilize} from 'sentry-docs/utils';
2223

2324
export async function generateStaticParams() {
24-
const docs = await getDocsFrontMatter();
25+
const docs = await (isDeveloperDocs ? getDevDocsFrontMatter() : getDocsFrontMatter());
2526
const paths: {path: string[] | undefined}[] = docs.map(doc => {
2627
const path = doc.slug.split('/');
2728
return {path};
@@ -44,33 +45,43 @@ function MDXLayoutRenderer({mdxSource, ...rest}) {
4445
return <MDXLayout components={mdxComponentsWithWrapper} {...rest} />;
4546
}
4647

47-
export default async function Page({params}) {
48-
if (!params.path) {
49-
return <Home />;
50-
}
51-
48+
export default async function Page({params}: {params: {path?: string[]}}) {
5249
// get frontmatter of all docs in tree
53-
const docs = await getDocsFrontMatter();
5450
const rootNode = await getDocsRootNode();
55-
if (!rootNode) {
56-
// eslint-disable-next-line no-console
57-
console.warn('no root node');
58-
return notFound();
59-
}
60-
6151
setServerContext({
6252
rootNode,
63-
path: params.path,
53+
path: params.path ?? [],
6454
});
6555

56+
if (isDeveloperDocs) {
57+
// get the MDX for the current doc and render it
58+
let doc: Awaited<ReturnType<typeof getFileBySlug>> | null = null;
59+
try {
60+
doc = await getFileBySlug(`develop-docs/${params.path?.join('/') ?? ''}`);
61+
} catch (e) {
62+
if (e.code === 'ENOENT') {
63+
// eslint-disable-next-line no-console
64+
console.error('ENOENT', params.path);
65+
return notFound();
66+
}
67+
throw e;
68+
}
69+
const {mdxSource, frontMatter} = doc;
70+
// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc
71+
return <MDXLayoutRenderer mdxSource={mdxSource} frontMatter={frontMatter} />;
72+
}
73+
if (!params.path) {
74+
return <Home />;
75+
}
76+
6677
if (params.path[0] === 'api' && params.path.length > 1) {
6778
const categories = await apiCategories();
68-
const category = categories.find(c => c.slug === params.path[1]);
79+
const category = categories.find(c => c.slug === params?.path?.[1]);
6980
if (category) {
7081
if (params.path.length === 2) {
7182
return <ApiCategoryPage category={category} />;
7283
}
73-
const api = category.apis.find(a => a.slug === params.path[2]);
84+
const api = category.apis.find(a => a.slug === params.path?.[2]);
7485
if (api) {
7586
return <ApiPage api={api} />;
7687
}
@@ -99,9 +110,7 @@ export default async function Page({params}) {
99110
const {mdxSource, frontMatter} = doc;
100111

101112
// pass frontmatter tree into sidebar, rendered page + fm into middle, headers into toc
102-
return (
103-
<MDXLayoutRenderer docs={docs} mdxSource={mdxSource} frontMatter={frontMatter} />
104-
);
113+
return <MDXLayoutRenderer mdxSource={mdxSource} frontMatter={frontMatter} />;
105114
}
106115

107116
type MetadataProps = {

app/sitemap.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
import type {MetadataRoute} from 'next';
22

3-
import {getDocsFrontMatter} from 'sentry-docs/mdx';
3+
import {isDeveloperDocs} from 'sentry-docs/isDeveloperDocs';
4+
import {getDevDocsFrontMatter, getDocsFrontMatter} from 'sentry-docs/mdx';
45

56
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
7+
if (isDeveloperDocs) {
8+
const docs = getDevDocsFrontMatter();
9+
const baseUrl = 'https://develop.sentry.dev';
10+
return docsToSitemap(docs, baseUrl);
11+
}
612
const docs = await getDocsFrontMatter();
13+
const baseUrl = 'https://docs.sentry.io';
14+
return docsToSitemap(docs, baseUrl);
15+
}
716

8-
const sitemapEntries = docs.map(doc => {
9-
let slug = doc.slug;
10-
if (!slug.endsWith('/')) {
11-
slug += '/';
17+
function docsToSitemap(docs: {slug: string}[], baseUrl: string): MetadataRoute.Sitemap {
18+
const paths = docs.map(({slug}) => slug);
19+
const appendSlash = (path: string) => {
20+
if (path === '' || path.endsWith('/')) {
21+
return path;
1222
}
13-
return {url: `https://docs.sentry.io/${slug}`};
14-
});
15-
sitemapEntries.unshift({
16-
url: 'https://docs.sentry.io/',
17-
});
18-
return sitemapEntries;
23+
return path + '/';
24+
};
25+
const toFullUrl = (path: string) => `${appendSlash(baseUrl)}${appendSlash(path)}`;
26+
const toSitemapEntry = (path: string) => ({url: toFullUrl(path)});
27+
return ['', ...paths].map(toSitemapEntry);
1928
}

base-vercel.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"headers": [
3+
{
4+
"source": "/(.*)",
5+
"headers": [
6+
{
7+
"key": "X-Content-Type-Options",
8+
"value": "nosniff"
9+
},
10+
{
11+
"key": "X-Frame-Options",
12+
"value": "sameorigin"
13+
},
14+
{
15+
"key": "X-XSS-Protection",
16+
"value": "1; mode=block"
17+
},
18+
{
19+
"key": "Content-Security-Policy",
20+
"value": "upgrade-insecure-requests; default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.sentry-cdn.com www.googletagmanager.com plausible.io vercel.live; connect-src 'self' *.sentry.io sentry.io *.algolia.net *.algolianet.com *.algolia.io plausible.io reload.getsentry.net storage.googleapis.com; img-src * 'self' data: www.google.com www.googletagmanager.com; style-src 'self' 'unsafe-inline'; font-src 'self' fonts.gstatic.com; frame-src demo.arcade.software player.vimeo.com; worker-src blob:; report-uri https://o1.ingest.sentry.io/api/1267915/security/?sentry_key=ad63ba38287245f2803dc220be959636; report-to csp"
21+
},
22+
{
23+
"key": "NEL",
24+
"value": "{\"report_to\":\"nel\",\"max_age\":3600,\"success_fraction\":0.0,\"failure_fraction\":1.0}"
25+
},
26+
{
27+
"key": "Report-To",
28+
"value": "{\"group\":\"nel\",\"max_age\":3600,\"endpoints\":[{\"url\":\"https://o1.ingest.sentry.io/api/1267915/nel/?sentry_key=ad63ba38287245f2803dc220be959636\"}]},{\"group\":\"csp\",\"max_age\":3600,\"endpoints\":[{\"url\":\"https://o1.ingest.sentry.io/api/1267915/security/?sentry_key=ad63ba38287245f2803dc220be959636\"}]}"
29+
}
30+
]
31+
}
32+
],
33+
"trailingSlash": true
34+
}

data-schemas

Submodule data-schemas added at 8c13457

develop-docs/ab-testing/index.mdx renamed to develop-docs/application/ab-testing/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# A/B Tests with Amplitude
1+
---
2+
title: A/B Tests with Amplitude
3+
---
24

35
## Why AB testing?
46

0 commit comments

Comments
 (0)