Skip to content
Merged
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
7 changes: 1 addition & 6 deletions docs-app/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import type { NextConfig } from "next";
import { getDefaultVersionId } from "./lib/versions";

const defaultDocsVersion = getDefaultVersionId();
const docsStaticBaseUrl = (process.env.DOCS_STATIC_BASE_URL ?? "")
.trim()
.replace(/\/+$/, "");
if (docsStaticBaseUrl.length === 0) {
throw new Error("DOCS_STATIC_BASE_URL must be set for docs-app builds and runtime.");
}
const docsStaticBaseUrl = "https://d31fy84ku2wzt.cloudfront.net";

const nextConfig: NextConfig = {
// Enable trailing slashes for clean URLs
Expand Down
3 changes: 1 addition & 2 deletions scripts/test-docs-release-links-contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ test_registry_release_links() {
test_clean_link_routes_are_present() {
assert_file_contains "${NEXT_CONFIG_PATH}" 'source: "/demo"' "next config redirects /demo to latest release"
assert_file_contains "${NEXT_CONFIG_PATH}" 'source: "/playground"' "next config redirects /playground to snapshot"
assert_file_contains "${NEXT_CONFIG_PATH}" 'throw new Error("DOCS_STATIC_BASE_URL must be set for docs-app builds and runtime.")' "next config requires DOCS_STATIC_BASE_URL"
assert_file_contains "${NEXT_CONFIG_PATH}" 'const staticOrigin = `${docsStaticBaseUrl}/static`' "next config resolves static origin from DOCS_STATIC_BASE_URL"
assert_file_contains "${NEXT_CONFIG_PATH}" 'const docsStaticBaseUrl = "https://d31fy84ku2wzt.cloudfront.net"' "next config hardcodes DOCS_STATIC_BASE_URL"
assert_file_contains "${NEXT_CONFIG_PATH}" 'source: "/static/:path*"' "next config rewrites static assets through CDN origin"
assert_file_contains "${NEXT_CONFIG_PATH}" 'source: "/demo/:version/"' "next config rewrites clean demo entry route"
assert_file_contains "${NEXT_CONFIG_PATH}" 'destination: `${staticOrigin}/demo/:version/index.html`' "next config maps clean demo entry route"
Expand Down