Skip to content

Upgrade to Next.js Latest Version and Migrate to next-mdx-remote #1115

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 0 additions & 110 deletions contentlayer.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion docs/admin/config/settings.schema.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/admin/config/site.schema.json

This file was deleted.

8 changes: 3 additions & 5 deletions docs/admin/deploy/docker-compose/upgrade.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Upgrade Sourcegraph on Docker Compose

This document describes the process to update a Docker Compose Sourcegraph instance. If you are unfamiliar with sourcegraph versioning or releases see our [general concepts documentation](/admin/updates/).
Expand All @@ -12,7 +10,7 @@ A [standard upgrade](/admin/updates/#upgrade-types) occurs between a Sourcegraph

If you've [configured Docker Compose with a release branch](/admin/deploy/docker-compose/#step-1-prepare-the-deployment-repository), please merge the upstream release tag for the next minor version into your `release` branch.

In the following example, the release branch is being upgraded to {CURRENT_VERSION_STRING()}.
In the following example, the release branch is being upgraded to.

```sh
# first, checkout the release branch
Expand All @@ -28,9 +26,9 @@ git merge {CURRENT_VERSION}

For each conflict, you need to reconcile any customizations you made with the updates from the new version. Use the information you gathered earlier from the change log and changes list to interpret the merge conflict and to ensure that it doesn't over-write your customizations. You may need to update your customizations to accommodate the new version.

> NOTE: If you have made no changes or only very minimal changes to your configuration, you can also ask git to always select incoming changes in the event of merge conflicts. In the following example merges will be accepted from the upstream version {CURRENT_VERSION_STRING()}:
> NOTE: If you have made no changes or only very minimal changes to your configuration, you can also ask git to always select incoming changes in the event of merge conflicts. In the following example merges will be accepted from the upstream version :
>
> `git merge -X theirs {CURRENT_VERSION_STRING}`
> `git merge -X theirs`
>
> If you do this, make sure your configuration is correct before proceeding because it may have made changes to your docker-compose YAML file.

Expand Down
2 changes: 0 additions & 2 deletions docs/admin/deploy/docker-single-container/aws.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Install single-container Sourcegraph with Docker on AWS

This tutorial shows you how to deploy [single-container Sourcegraph with Docker](/admin/deploy/docker-single-container/) to a single EC2 instance on AWS.
Expand Down
2 changes: 0 additions & 2 deletions docs/admin/deploy/docker-single-container/digitalocean.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Install single-container Sourcegraph with Docker on DigitalOcean

This tutorial shows you how to deploy [single-container Sourcegraph with Docker](/admin/deploy/docker-single-container/) to a single node running on DigitalOcean.
Expand Down
2 changes: 0 additions & 2 deletions docs/admin/deploy/docker-single-container/google_cloud.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Install single-container Sourcegraph with Docker on Google Cloud

This tutorial shows you how to deploy [single-container Sourcegraph with Docker](/admin/deploy/docker-single-container/) to a single node running on Google Cloud.
Expand Down
4 changes: 1 addition & 3 deletions docs/admin/deploy/docker-single-container/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Docker Single Container Deployment

The Docker Single Container deployment type is a way to very quickly get an instance of Sourcegraph set up locally to experiment with many of its features. However, it is **not recommended** for a production instance, and **has limitations** depending on the OS you are deploying to, as well as the associated resources. See the [troubleshooting section](#troubleshooting) for additional information.
Expand Down Expand Up @@ -296,7 +294,7 @@ Sourcegraph can be **tested** on Windows 10 using roughly the same steps provide
1. [Install Docker for Windows](https://docs.docker.com/docker-for-windows/install/)
2. Using a command prompt, follow the same [installation steps provided above](#install-sourcegraph-with-docker) but remove the `--volume` arguments. For example by pasting this:

<pre class="pre-wrap"><code>docker run<span class="virtual-br"></span> --publish 7080:7080 --publish 127.0.0.1:3370:3370 --rm<span class="virtual-br"></span> sourcegraph/server:{CURRENT_VERSION_STRING_NO_V()}</code></pre>
<pre class="pre-wrap"><code>docker run<span class="virtual-br"></span> --publish 7080:7080 --publish 127.0.0.1:3370:3370 --rm<span class="virtual-br"></span> sourcegraph/server</code></pre>

### Low resource environments

Expand Down
2 changes: 0 additions & 2 deletions docs/admin/deploy/kubernetes/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Sourcegraph on Kubernetes with Helm

Best for large enterprises that require a multi-node, self-hosted solution.
Expand Down
2 changes: 0 additions & 2 deletions docs/admin/deploy/machine-images/gce.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Sourcegraph Google Compute Instances

Sourcegraph [Google Compute Engine (GCE) Images](https://cloud.google.com/compute/docs/images) allow you to quickly deploy a production-ready Sourcegraph instance tuned to your organization's scale in just a few clicks.
Expand Down
4 changes: 1 addition & 3 deletions docs/admin/deploy/repositories.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Reference Repositories

Sourcegraph provides reference repositories with branches corresponding to the version of Sourcegraph you wish to deploy for each supported deployment type. The reference repository contains everything you need to spin up and configure your instance depending on your deployment type.
Expand Down Expand Up @@ -64,7 +62,7 @@ You can now deploy using your private copy of the repository you've just created

Before you can upgrade Sourcegraph, you will first update your private copy with the upstream branch, and then merge the upstream release tag for the next minor version into your release branch.

In the following example, the release branch is being upgraded to {CURRENT_VERSION_STRING()}.
In the following example, the release branch is being upgraded to.

```bash
export YOUR_RELEASE_BRANCH=release-$SG_DEPLOY_VERSION
Expand Down
4 changes: 1 addition & 3 deletions docs/admin/external_services/postgres.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Using your own PostgreSQL server

You can use your own PostgreSQL v16+ server with Sourcegraph if you wish. For example, you may prefer this if you already have existing backup infrastructure around your own PostgreSQL server, wish to use Amazon RDS, etc.
Expand Down Expand Up @@ -150,7 +148,7 @@ When [PgBouncer] is used, we need to include `statement_cache_mode=describe` in

Add the following to your `docker run` command:

<pre class="pre-wrap start-sourcegraph-command"><code>docker run [...]<span class="virtual-br"></span> -e PGDATASOURCE="postgres://username:password@sourcegraph-pgbouncer.mycompany.com:5432/sg?statement_cache_mode=describe"<span class="virtual-br"></span> -e CODEINSIGHTS_PGDATASOURCE="postgres://username:password@sourcegraph-codeintel-pgbouncer.mycompany.com:5432/sg?statement_cache_mode=describe"<span class="virtual-br"></span> sourcegraph/server:{CURRENT_VERSION_STRING_NO_V()}</code></pre>
<pre class="pre-wrap start-sourcegraph-command"><code>docker run [...]<span class="virtual-br"></span> -e PGDATASOURCE="postgres://username:password@sourcegraph-pgbouncer.mycompany.com:5432/sg?statement_cache_mode=describe"<span class="virtual-br"></span> -e CODEINSIGHTS_PGDATASOURCE="postgres://username:password@sourcegraph-codeintel-pgbouncer.mycompany.com:5432/sg?statement_cache_mode=describe"<span class="virtual-br"></span> sourcegraph/server:</code></pre>

### Docker Compose

Expand Down
2 changes: 0 additions & 2 deletions docs/admin/http_https_configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Sourcegraph HTTP and HTTPS/SSL configuration

Overview:
Expand Down
2 changes: 0 additions & 2 deletions docs/admin/ssl_https_self_signed_cert_nginx.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Adding SSL (HTTPS) to Sourcegraph with a self-signed certificate

This is for external Sourcegraph instances that need a self-signed certificate because they don't yet have a certificate from a [globally trusted Certificate Authority (CA)](https://en.wikipedia.org/wiki/Certificate_authority#Providers). It includes how to get the self-signed certificate trusted by your browser.
Expand Down
2 changes: 0 additions & 2 deletions docs/admin/updates/grpc/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

# Sourcegraph 5.3 gRPC Configuration Guide

## Overview
Expand Down
2 changes: 0 additions & 2 deletions docs/cli/explanations/versioning.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { CURRENT_VERSION_STRING_NO_V, CURRENT_VERSION_STRING } from 'src/components/PreCodeBlock'

## Installation & versioning

Binary downloads are available on the [releases tab](https://github.com/sourcegraph/src-cli/releases), and through Sourcegraph.com. _If the latest version does not work for you,_ consider using the version compatible with your Sourcegraph instance instead.
Expand Down
9 changes: 5 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
const config = require('./docs.config.js');
const {withContentlayer} = require('next-contentlayer');
const {updatedRedirectsData} = require('./src/data/redirects.ts');
const {generateRssFeed} = require('./dev/rss');
/** @type {import('next').NextConfig} */

const nextConfig = {
reactStrictMode: true,
swcMinify: true,
// swcMinify: true,
// in prod, we serve the docs from sourcegraph.com/docs, and this requires special config on the GFE side
// in preview/development, this is not necessary.
//
// VERCEL_ENV is a system env var set by Vercel
// https://vercel.com/docs/projects/environment-variables/system-environment-variables
// basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '',
basePath: process.env.VERCEL_ENV === 'production' ? '/docs' : '',
basePath: '/docs',
// Add transpilePackages for next-mdx-remote if using Turbopack
transpilePackages: ['next-mdx-remote'],
// async redirects() {
// return [
// ...updatedRedirectsData,
Expand Down Expand Up @@ -49,5 +50,5 @@ const nextConfig = {
module.exports = async () => {
// placing this here so its part of nextjs's build process
await generateRssFeed();
return withContentlayer(nextConfig);
return nextConfig;
};
Loading
Loading