Skip to content

Commit

Permalink
Merge branch 'master' into lint-404s
Browse files Browse the repository at this point in the history
  • Loading branch information
a-hariti committed Jul 25, 2024
2 parents 0430b83 + 4e5cd81 commit d9b7584
Show file tree
Hide file tree
Showing 338 changed files with 6,722 additions and 1,405 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.babelrc.js
apps/changelog
14 changes: 4 additions & 10 deletions .github/workflows/algolia-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,11 @@ jobs:
# and save some build time.
- run: rm -r app/changelog

- run: yarn build
if: steps.filter.outputs.docs == 'true'

- run: yarn build:developer-docs
if: steps.filter.outputs.dev-docs == 'true'

# bun seems to be the most straightforward way to run a TypeScript script
# without introducing another dependency like ts-node or tsx for everyone else

# build docs index
- run: bun ./scripts/algolia.ts
- name: Build index for user docs
run: yarn build && bun ./scripts/algolia.ts
if: steps.filter.outputs.docs == 'true'
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand All @@ -56,8 +50,8 @@ jobs:
NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.NEXT_PUBLIC_ALGOLIA_APP_ID }}
NEXT_PUBLIC_ALGOLIA_SEARCH_KEY: ${{ secrets.NEXT_PUBLIC_ALGOLIA_SEARCH_KEY }}

# build dev docs index
- run: bun ./scripts/algolia.ts
- name: Build index for developer docs
run: yarn build:developer-docs && bun ./scripts/algolia.ts
if: steps.filter.outputs.dev-docs == 'true'
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/cleanup-preview-deployments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Delete Stale Vercel Preview Deployments

on:
# Run the workflow daily at 2:00 AM UTC
schedule:
- cron: '0 2 * * *'
# Allows manual triggering of the workflow
workflow_dispatch:

jobs:
delete-stale-deployments:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Run cleanup script for user docs
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_USER_DOCS }}
VERCEL_API_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
run: bun scripts/preview-deployment-cleanup.ts

- name: Run cleanup script for developer docs
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DEVELOP_DOCS }}
VERCEL_API_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
run: bun scripts/preview-deployment-cleanup.ts
19 changes: 0 additions & 19 deletions .github/workflows/dependency-review.yml

This file was deleted.

2 changes: 2 additions & 0 deletions app/changelog/feed.xml/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ export async function GET() {
allChangelogs.map(changelog => {
return feed.item({
title: changelog.title,
// @ts-expect-error TODO(lforst): This is broken for some reason
description: changelog.summary,
url: `https://sentry.io/changelog/${changelog.slug}`,
categories:
changelog.categories.map(category => {
return category.name;
}) || [],
// @ts-expect-error TODO(lforst): This is broken for some reason
date: changelog.publishedAt,
});
});
Expand Down
5 changes: 3 additions & 2 deletions app/platform-redirect/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {notFound, redirect} from 'next/navigation';
import {redirect} from 'next/navigation';

import {DocPage} from 'sentry-docs/components/docPage';
import {PlatformIcon} from 'sentry-docs/components/platformIcon';
Expand Down Expand Up @@ -27,7 +27,8 @@ export default async function Page({
});

if (platformList.length === 0) {
return notFound();
// try to redirect the user to the page directly, might result in 404
return redirect(next);
}

const requestedPlatform = Array.isArray(platform) ? platform[0] : platform;
Expand Down
8 changes: 8 additions & 0 deletions apps/changelog/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# rename this file to .env and supply the values listed below
# also make sure they are available to the build tool (e.g. Vercel/Netlify)
# warning: variables prefixed with NEXT_PUBLIC_ will be made available to client-side code
# be careful not to expose sensitive data

DATABASE_URL=postgresql://postgres:postgres@localhost:5432/changelog
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=secret
41 changes: 41 additions & 0 deletions apps/changelog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# dotenv environment variables file
.env
.env.development
36 changes: 36 additions & 0 deletions apps/changelog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
16 changes: 16 additions & 0 deletions apps/changelog/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.7'
services:
postgres:
container_name: changelog_postgres
image: postgres:latest
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data/
volumes:
postgres_data:
11 changes: 11 additions & 0 deletions apps/changelog/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {withSentryConfig} from '@sentry/nextjs';

const nextConfig = {
trailingSlash: true,
eslint: {
ignoreDuringBuilds: true,
},
transpilePackages: ['next-mdx-remote'],
};

export default withSentryConfig(nextConfig);
58 changes: 58 additions & 0 deletions apps/changelog/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "sentry-changelog",
"version": "1.0.0",
"description": "The Sentry changelog application",
"main": "index.js",
"repository": "https://github.com/getsentry/sentry-docs",
"author": "getsentry",
"license": "FSL-1.1-Apache-2.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "prisma generate && next build",
"start": "next start",
"lint": "next lint",
"migrate:dev": "dotenv -e .env.development -- yarn prisma migrate reset"
},
"dependencies": {
"rehype-prism-plus": "^1.6.3",
"rehype-slug": "^6.0.0",
"@auth/prisma-adapter": "^1.2.0",
"nextjs-toploader": "^1.6.6",
"prism-sentry": "^1.0.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-toolbar": "^1.0.4",
"@radix-ui/themes": "^2.0.3",
"@sentry/nextjs": "^8.8.0",
"@google-cloud/storage": "^7.7.0",
"@prisma/client": "^5.8.1",
"next": "^14.2.5",
"next-auth": "^4.24.5",
"next-mdx-remote": "^4.4.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-select": "^5.7.3",
"sass": "^1.69.5",
"react-textarea-autosize": "^8.5.3",
"rss": "^1.2.2",
"textarea-markdown-editor": "^1.0.4"
},
"devDependencies": {
"autoprefixer": "^10.4.17",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18.3.0",
"prisma": "^5.8.1",
"@types/rss": "^0.0.32",
"eslint": "^8",
"eslint-config-next": "^14.2.5",
"postcss": "^8.4.33",
"@tailwindcss/forms": "^0.5.7",
"tailwindcss": "^3.4.1",
"@tailwindcss/typography": "^0.5.10",
"typescript": "^5"
},
"volta": {
"extends": "../../package.json"
}
}
11 changes: 11 additions & 0 deletions apps/changelog/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
"postcss-import": {},
"tailwindcss/nesting": {},
tailwindcss: {},
autoprefixer: {},
},
};

export default config;
Loading

0 comments on commit d9b7584

Please sign in to comment.